@visactor/vtable 0.9.0-alpha.0-alpha.0

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 (1210) hide show
  1. package/README.md +152 -0
  2. package/cjs/ListTable.d.ts +38 -0
  3. package/cjs/ListTable.js +258 -0
  4. package/cjs/ListTable.js.map +1 -0
  5. package/cjs/PivotTable.d.ts +50 -0
  6. package/cjs/PivotTable.js +275 -0
  7. package/cjs/PivotTable.js.map +1 -0
  8. package/cjs/body-helper/body-helper.d.ts +14 -0
  9. package/cjs/body-helper/body-helper.js +99 -0
  10. package/cjs/body-helper/body-helper.js.map +1 -0
  11. package/cjs/body-helper/style/ImageStyle.d.ts +7 -0
  12. package/cjs/body-helper/style/ImageStyle.js +24 -0
  13. package/cjs/body-helper/style/ImageStyle.js.map +1 -0
  14. package/cjs/body-helper/style/MultilineTextStyle.d.ts +13 -0
  15. package/cjs/body-helper/style/MultilineTextStyle.js +38 -0
  16. package/cjs/body-helper/style/MultilineTextStyle.js.map +1 -0
  17. package/cjs/body-helper/style/NumberStyle.d.ts +7 -0
  18. package/cjs/body-helper/style/NumberStyle.js +24 -0
  19. package/cjs/body-helper/style/NumberStyle.js.map +1 -0
  20. package/cjs/body-helper/style/ProgressBarStyle.d.ts +52 -0
  21. package/cjs/body-helper/style/ProgressBarStyle.js +126 -0
  22. package/cjs/body-helper/style/ProgressBarStyle.js.map +1 -0
  23. package/cjs/body-helper/style/Style.d.ts +85 -0
  24. package/cjs/body-helper/style/Style.js +200 -0
  25. package/cjs/body-helper/style/Style.js.map +1 -0
  26. package/cjs/body-helper/style.d.ts +10 -0
  27. package/cjs/body-helper/style.js +52 -0
  28. package/cjs/body-helper/style.js.map +1 -0
  29. package/cjs/chartType.d.ts +3 -0
  30. package/cjs/chartType.js +14 -0
  31. package/cjs/chartType.js.map +1 -0
  32. package/cjs/core/BaseTable.d.ts +287 -0
  33. package/cjs/core/BaseTable.js +1272 -0
  34. package/cjs/core/BaseTable.js.map +1 -0
  35. package/cjs/core/FouseInput.d.ts +11 -0
  36. package/cjs/core/FouseInput.js +38 -0
  37. package/cjs/core/FouseInput.js.map +1 -0
  38. package/cjs/core/TABLE_EVENT_TYPE.d.ts +30 -0
  39. package/cjs/core/TABLE_EVENT_TYPE.js +34 -0
  40. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -0
  41. package/cjs/core/tableHelper.d.ts +28 -0
  42. package/cjs/core/tableHelper.js +141 -0
  43. package/cjs/core/tableHelper.js.map +1 -0
  44. package/cjs/core.d.ts +3 -0
  45. package/cjs/core.js +24 -0
  46. package/cjs/core.js.map +1 -0
  47. package/cjs/data/CachedDataSource.d.ts +16 -0
  48. package/cjs/data/CachedDataSource.js +54 -0
  49. package/cjs/data/CachedDataSource.js.map +1 -0
  50. package/cjs/data/DataSource.d.ts +64 -0
  51. package/cjs/data/DataSource.js +294 -0
  52. package/cjs/data/DataSource.js.map +1 -0
  53. package/cjs/data/FilterDataSource.d.ts +1 -0
  54. package/cjs/data/FilterDataSource.js +1 -0
  55. package/cjs/data/FilterDataSource.js.map +1 -0
  56. package/cjs/data.d.ts +4 -0
  57. package/cjs/data.js +24 -0
  58. package/cjs/data.js.map +1 -0
  59. package/cjs/dataset/DataStatistics.d.ts +10 -0
  60. package/cjs/dataset/DataStatistics.js +81 -0
  61. package/cjs/dataset/DataStatistics.js.map +1 -0
  62. package/cjs/dataset/dataset.d.ts +72 -0
  63. package/cjs/dataset/dataset.js +490 -0
  64. package/cjs/dataset/dataset.js.map +1 -0
  65. package/cjs/dataset/flatDataToObject.d.ts +31 -0
  66. package/cjs/dataset/flatDataToObject.js +71 -0
  67. package/cjs/dataset/flatDataToObject.js.map +1 -0
  68. package/cjs/event/EventHandler.d.ts +45 -0
  69. package/cjs/event/EventHandler.js +120 -0
  70. package/cjs/event/EventHandler.js.map +1 -0
  71. package/cjs/event/EventTarget.d.ts +11 -0
  72. package/cjs/event/EventTarget.js +59 -0
  73. package/cjs/event/EventTarget.js.map +1 -0
  74. package/cjs/event/chart.d.ts +2 -0
  75. package/cjs/event/chart.js +24 -0
  76. package/cjs/event/chart.js.map +1 -0
  77. package/cjs/event/drill.d.ts +3 -0
  78. package/cjs/event/drill.js +23 -0
  79. package/cjs/event/drill.js.map +1 -0
  80. package/cjs/event/event.d.ts +35 -0
  81. package/cjs/event/event.js +426 -0
  82. package/cjs/event/event.js.map +1 -0
  83. package/cjs/event/media-click.d.ts +2 -0
  84. package/cjs/event/media-click.js +58 -0
  85. package/cjs/event/media-click.js.map +1 -0
  86. package/cjs/event/scroll.d.ts +2 -0
  87. package/cjs/event/scroll.js +23 -0
  88. package/cjs/event/scroll.js.map +1 -0
  89. package/cjs/header-helper/header-helper.d.ts +26 -0
  90. package/cjs/header-helper/header-helper.js +214 -0
  91. package/cjs/header-helper/header-helper.js.map +1 -0
  92. package/cjs/header-helper/style/ImageStyle.d.ts +7 -0
  93. package/cjs/header-helper/style/ImageStyle.js +25 -0
  94. package/cjs/header-helper/style/ImageStyle.js.map +1 -0
  95. package/cjs/header-helper/style/MultilineTextHeaderStyle.d.ts +13 -0
  96. package/cjs/header-helper/style/MultilineTextHeaderStyle.js +38 -0
  97. package/cjs/header-helper/style/MultilineTextHeaderStyle.js.map +1 -0
  98. package/cjs/header-helper/style/SortHeaderStyle.d.ts +1 -0
  99. package/cjs/header-helper/style/SortHeaderStyle.js +3 -0
  100. package/cjs/header-helper/style/SortHeaderStyle.js.map +1 -0
  101. package/cjs/header-helper/style/Style.d.ts +88 -0
  102. package/cjs/header-helper/style/Style.js +208 -0
  103. package/cjs/header-helper/style/Style.js.map +1 -0
  104. package/cjs/header-helper/style.d.ts +5 -0
  105. package/cjs/header-helper/style.js +30 -0
  106. package/cjs/header-helper/style.js.map +1 -0
  107. package/cjs/icons.d.ts +4 -0
  108. package/cjs/icons.js +241 -0
  109. package/cjs/icons.js.map +1 -0
  110. package/cjs/index.d.ts +17 -0
  111. package/cjs/index.js +95 -0
  112. package/cjs/index.js.map +1 -0
  113. package/cjs/layout/index.d.ts +1 -0
  114. package/cjs/layout/index.js +15 -0
  115. package/cjs/layout/index.js.map +1 -0
  116. package/cjs/layout/pivot-header-layout.d.ts +155 -0
  117. package/cjs/layout/pivot-header-layout.js +897 -0
  118. package/cjs/layout/pivot-header-layout.js.map +1 -0
  119. package/cjs/layout/pivot-layout.d.ts +86 -0
  120. package/cjs/layout/pivot-layout.js +422 -0
  121. package/cjs/layout/pivot-layout.js.map +1 -0
  122. package/cjs/layout/simple-header-layout.d.ts +67 -0
  123. package/cjs/layout/simple-header-layout.js +413 -0
  124. package/cjs/layout/simple-header-layout.js.map +1 -0
  125. package/cjs/menu/dom/BaseMenu.d.ts +15 -0
  126. package/cjs/menu/dom/BaseMenu.js +30 -0
  127. package/cjs/menu/dom/BaseMenu.js.map +1 -0
  128. package/cjs/menu/dom/Menu.d.ts +9 -0
  129. package/cjs/menu/dom/Menu.js +24 -0
  130. package/cjs/menu/dom/Menu.js.map +1 -0
  131. package/cjs/menu/dom/MenuHandler.d.ts +20 -0
  132. package/cjs/menu/dom/MenuHandler.js +134 -0
  133. package/cjs/menu/dom/MenuHandler.js.map +1 -0
  134. package/cjs/menu/dom/logic/MenuContainer.d.ts +22 -0
  135. package/cjs/menu/dom/logic/MenuContainer.js +110 -0
  136. package/cjs/menu/dom/logic/MenuContainer.js.map +1 -0
  137. package/cjs/menu/dom/logic/MenuElement.css +86 -0
  138. package/cjs/menu/dom/logic/MenuElement.d.ts +27 -0
  139. package/cjs/menu/dom/logic/MenuElement.js +278 -0
  140. package/cjs/menu/dom/logic/MenuElement.js.map +1 -0
  141. package/cjs/plugins/chartTypes.d.ts +3 -0
  142. package/cjs/plugins/chartTypes.js +6 -0
  143. package/cjs/plugins/chartTypes.js.map +1 -0
  144. package/cjs/plugins/icons.d.ts +12 -0
  145. package/cjs/plugins/icons.js +26 -0
  146. package/cjs/plugins/icons.js.map +1 -0
  147. package/cjs/plugins/themes.d.ts +4 -0
  148. package/cjs/plugins/themes.js +6 -0
  149. package/cjs/plugins/themes.js.map +1 -0
  150. package/cjs/register.d.ts +5 -0
  151. package/cjs/register.js +35 -0
  152. package/cjs/register.js.map +1 -0
  153. package/cjs/render/layout/arc.d.ts +23 -0
  154. package/cjs/render/layout/arc.js +20 -0
  155. package/cjs/render/layout/arc.js.map +1 -0
  156. package/cjs/render/layout/circle.d.ts +19 -0
  157. package/cjs/render/layout/circle.js +19 -0
  158. package/cjs/render/layout/circle.js.map +1 -0
  159. package/cjs/render/layout/container.d.ts +52 -0
  160. package/cjs/render/layout/container.js +99 -0
  161. package/cjs/render/layout/container.js.map +1 -0
  162. package/cjs/render/layout/direction.d.ts +22 -0
  163. package/cjs/render/layout/direction.js +35 -0
  164. package/cjs/render/layout/direction.js.map +1 -0
  165. package/cjs/render/layout/element.d.ts +47 -0
  166. package/cjs/render/layout/element.js +27 -0
  167. package/cjs/render/layout/element.js.map +1 -0
  168. package/cjs/render/layout/group-element.d.ts +25 -0
  169. package/cjs/render/layout/group-element.js +52 -0
  170. package/cjs/render/layout/group-element.js.map +1 -0
  171. package/cjs/render/layout/icon.d.ts +21 -0
  172. package/cjs/render/layout/icon.js +48 -0
  173. package/cjs/render/layout/icon.js.map +1 -0
  174. package/cjs/render/layout/image.d.ts +21 -0
  175. package/cjs/render/layout/image.js +20 -0
  176. package/cjs/render/layout/image.js.map +1 -0
  177. package/cjs/render/layout/index.d.ts +9 -0
  178. package/cjs/render/layout/index.js +25 -0
  179. package/cjs/render/layout/index.js.map +1 -0
  180. package/cjs/render/layout/line.d.ts +32 -0
  181. package/cjs/render/layout/line.js +88 -0
  182. package/cjs/render/layout/line.js.map +1 -0
  183. package/cjs/render/layout/percent-calc.d.ts +8 -0
  184. package/cjs/render/layout/percent-calc.js +13 -0
  185. package/cjs/render/layout/percent-calc.js.map +1 -0
  186. package/cjs/render/layout/rect.d.ts +22 -0
  187. package/cjs/render/layout/rect.js +19 -0
  188. package/cjs/render/layout/rect.js.map +1 -0
  189. package/cjs/render/layout/text.d.ts +22 -0
  190. package/cjs/render/layout/text.js +26 -0
  191. package/cjs/render/layout/text.js.map +1 -0
  192. package/cjs/scenegraph/component/cell-content.d.ts +36 -0
  193. package/cjs/scenegraph/component/cell-content.js +100 -0
  194. package/cjs/scenegraph/component/cell-content.js.map +1 -0
  195. package/cjs/scenegraph/component/cell-mover.d.ts +15 -0
  196. package/cjs/scenegraph/component/cell-mover.js +107 -0
  197. package/cjs/scenegraph/component/cell-mover.js.map +1 -0
  198. package/cjs/scenegraph/component/custom.d.ts +7 -0
  199. package/cjs/scenegraph/component/custom.js +212 -0
  200. package/cjs/scenegraph/component/custom.js.map +1 -0
  201. package/cjs/scenegraph/component/drill-icon.d.ts +9 -0
  202. package/cjs/scenegraph/component/drill-icon.js +70 -0
  203. package/cjs/scenegraph/component/drill-icon.js.map +1 -0
  204. package/cjs/scenegraph/component/menu.d.ts +41 -0
  205. package/cjs/scenegraph/component/menu.js +214 -0
  206. package/cjs/scenegraph/component/menu.js.map +1 -0
  207. package/cjs/scenegraph/component/table-component.d.ts +37 -0
  208. package/cjs/scenegraph/component/table-component.js +302 -0
  209. package/cjs/scenegraph/component/table-component.js.map +1 -0
  210. package/cjs/scenegraph/component/util.d.ts +2 -0
  211. package/cjs/scenegraph/component/util.js +11 -0
  212. package/cjs/scenegraph/component/util.js.map +1 -0
  213. package/cjs/scenegraph/debug-tool/debug-tool.d.ts +36 -0
  214. package/cjs/scenegraph/debug-tool/debug-tool.js +138 -0
  215. package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -0
  216. package/cjs/scenegraph/debug-tool/index.d.ts +4 -0
  217. package/cjs/scenegraph/debug-tool/index.js +14 -0
  218. package/cjs/scenegraph/debug-tool/index.js.map +1 -0
  219. package/cjs/scenegraph/graphic/chart.d.ts +30 -0
  220. package/cjs/scenegraph/graphic/chart.js +66 -0
  221. package/cjs/scenegraph/graphic/chart.js.map +1 -0
  222. package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +10 -0
  223. package/cjs/scenegraph/graphic/contributions/chart-render.js +46 -0
  224. package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -0
  225. package/cjs/scenegraph/graphic/contributions/group-contribution-render.d.ts +70 -0
  226. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +195 -0
  227. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -0
  228. package/cjs/scenegraph/graphic/contributions/image-contribution-render.d.ts +20 -0
  229. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js +46 -0
  230. package/cjs/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -0
  231. package/cjs/scenegraph/graphic/contributions/index.d.ts +3 -0
  232. package/cjs/scenegraph/graphic/contributions/index.js +36 -0
  233. package/cjs/scenegraph/graphic/contributions/index.js.map +1 -0
  234. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.d.ts +17 -0
  235. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js +47 -0
  236. package/cjs/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -0
  237. package/cjs/scenegraph/graphic/group.d.ts +23 -0
  238. package/cjs/scenegraph/graphic/group.js +94 -0
  239. package/cjs/scenegraph/graphic/group.js.map +1 -0
  240. package/cjs/scenegraph/graphic/icon.d.ts +24 -0
  241. package/cjs/scenegraph/graphic/icon.js +25 -0
  242. package/cjs/scenegraph/graphic/icon.js.map +1 -0
  243. package/cjs/scenegraph/graphic/text.d.ts +16 -0
  244. package/cjs/scenegraph/graphic/text.js +146 -0
  245. package/cjs/scenegraph/graphic/text.js.map +1 -0
  246. package/cjs/scenegraph/group-creater/cell-helper.d.ts +7 -0
  247. package/cjs/scenegraph/group-creater/cell-helper.js +84 -0
  248. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -0
  249. package/cjs/scenegraph/group-creater/cell-type/chart-cell.d.ts +3 -0
  250. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +78 -0
  251. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -0
  252. package/cjs/scenegraph/group-creater/cell-type/image-cell.d.ts +7 -0
  253. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +123 -0
  254. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -0
  255. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +9 -0
  256. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +342 -0
  257. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -0
  258. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +3 -0
  259. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +163 -0
  260. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -0
  261. package/cjs/scenegraph/group-creater/cell-type/text-cell.d.ts +5 -0
  262. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +64 -0
  263. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -0
  264. package/cjs/scenegraph/group-creater/cell-type/video-cell.d.ts +4 -0
  265. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +100 -0
  266. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -0
  267. package/cjs/scenegraph/group-creater/column-helper.d.ts +24 -0
  268. package/cjs/scenegraph/group-creater/column-helper.js +136 -0
  269. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -0
  270. package/cjs/scenegraph/group-creater/column.d.ts +14 -0
  271. package/cjs/scenegraph/group-creater/column.js +57 -0
  272. package/cjs/scenegraph/group-creater/column.js.map +1 -0
  273. package/cjs/scenegraph/group-creater/progress/proxy.d.ts +45 -0
  274. package/cjs/scenegraph/group-creater/progress/proxy.js +267 -0
  275. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -0
  276. package/cjs/scenegraph/header-icon/layout.d.ts +3 -0
  277. package/cjs/scenegraph/header-icon/layout.js +75 -0
  278. package/cjs/scenegraph/header-icon/layout.js.map +1 -0
  279. package/cjs/scenegraph/hover-state.d.ts +14 -0
  280. package/cjs/scenegraph/hover-state.js +27 -0
  281. package/cjs/scenegraph/hover-state.js.map +1 -0
  282. package/cjs/scenegraph/layout/auto-height.d.ts +2 -0
  283. package/cjs/scenegraph/layout/auto-height.js +50 -0
  284. package/cjs/scenegraph/layout/auto-height.js.map +1 -0
  285. package/cjs/scenegraph/layout/auto-width.d.ts +2 -0
  286. package/cjs/scenegraph/layout/auto-width.js +85 -0
  287. package/cjs/scenegraph/layout/auto-width.js.map +1 -0
  288. package/cjs/scenegraph/layout/compute-col-width.d.ts +3 -0
  289. package/cjs/scenegraph/layout/compute-col-width.js +194 -0
  290. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -0
  291. package/cjs/scenegraph/layout/move-cell.d.ts +2 -0
  292. package/cjs/scenegraph/layout/move-cell.js +61 -0
  293. package/cjs/scenegraph/layout/move-cell.js.map +1 -0
  294. package/cjs/scenegraph/layout/update-cell.d.ts +3 -0
  295. package/cjs/scenegraph/layout/update-cell.js +55 -0
  296. package/cjs/scenegraph/layout/update-cell.js.map +1 -0
  297. package/cjs/scenegraph/layout/update-height.d.ts +6 -0
  298. package/cjs/scenegraph/layout/update-height.js +90 -0
  299. package/cjs/scenegraph/layout/update-height.js.map +1 -0
  300. package/cjs/scenegraph/layout/update-width.d.ts +2 -0
  301. package/cjs/scenegraph/layout/update-width.js +103 -0
  302. package/cjs/scenegraph/layout/update-width.js.map +1 -0
  303. package/cjs/scenegraph/scenegraph.d.ts +109 -0
  304. package/cjs/scenegraph/scenegraph.js +798 -0
  305. package/cjs/scenegraph/scenegraph.js.map +1 -0
  306. package/cjs/scenegraph/style/frame-border.d.ts +3 -0
  307. package/cjs/scenegraph/style/frame-border.js +43 -0
  308. package/cjs/scenegraph/style/frame-border.js.map +1 -0
  309. package/cjs/scenegraph/utils/border-line.d.ts +8 -0
  310. package/cjs/scenegraph/utils/border-line.js +51 -0
  311. package/cjs/scenegraph/utils/border-line.js.map +1 -0
  312. package/cjs/scenegraph/utils/break-string.d.ts +1 -0
  313. package/cjs/scenegraph/utils/break-string.js +37 -0
  314. package/cjs/scenegraph/utils/break-string.js.map +1 -0
  315. package/cjs/scenegraph/utils/cell-pos.d.ts +4 -0
  316. package/cjs/scenegraph/utils/cell-pos.js +18 -0
  317. package/cjs/scenegraph/utils/cell-pos.js.map +1 -0
  318. package/cjs/scenegraph/utils/font.d.ts +1 -0
  319. package/cjs/scenegraph/utils/font.js +20 -0
  320. package/cjs/scenegraph/utils/font.js.map +1 -0
  321. package/cjs/scenegraph/utils/get-cell-merge.d.ts +3 -0
  322. package/cjs/scenegraph/utils/get-cell-merge.js +11 -0
  323. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -0
  324. package/cjs/scenegraph/utils/get-prop.d.ts +4 -0
  325. package/cjs/scenegraph/utils/get-prop.js +44 -0
  326. package/cjs/scenegraph/utils/get-prop.js.map +1 -0
  327. package/cjs/scenegraph/utils/icon.d.ts +12 -0
  328. package/cjs/scenegraph/utils/icon.js +35 -0
  329. package/cjs/scenegraph/utils/icon.js.map +1 -0
  330. package/cjs/scenegraph/utils/keep-aspect-ratio.d.ts +4 -0
  331. package/cjs/scenegraph/utils/keep-aspect-ratio.js +16 -0
  332. package/cjs/scenegraph/utils/keep-aspect-ratio.js.map +1 -0
  333. package/cjs/scenegraph/utils/measure-text.d.ts +20 -0
  334. package/cjs/scenegraph/utils/measure-text.js +111 -0
  335. package/cjs/scenegraph/utils/measure-text.js.map +1 -0
  336. package/cjs/scenegraph/utils/padding.d.ts +1 -0
  337. package/cjs/scenegraph/utils/padding.js +16 -0
  338. package/cjs/scenegraph/utils/padding.js.map +1 -0
  339. package/cjs/scenegraph/utils/text-icon-layout.d.ts +9 -0
  340. package/cjs/scenegraph/utils/text-icon-layout.js +237 -0
  341. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -0
  342. package/cjs/scenegraph/utils/text-pos.d.ts +8 -0
  343. package/cjs/scenegraph/utils/text-pos.js +27 -0
  344. package/cjs/scenegraph/utils/text-pos.js.map +1 -0
  345. package/cjs/state/cell-move/adjust-header.d.ts +3 -0
  346. package/cjs/state/cell-move/adjust-header.js +20 -0
  347. package/cjs/state/cell-move/adjust-header.js.map +1 -0
  348. package/cjs/state/cell-move/index.d.ts +4 -0
  349. package/cjs/state/cell-move/index.js +60 -0
  350. package/cjs/state/cell-move/index.js.map +1 -0
  351. package/cjs/state/common/check-in-select.d.ts +8 -0
  352. package/cjs/state/common/check-in-select.js +63 -0
  353. package/cjs/state/common/check-in-select.js.map +1 -0
  354. package/cjs/state/drill/index.d.ts +2 -0
  355. package/cjs/state/drill/index.js +15 -0
  356. package/cjs/state/drill/index.js.map +1 -0
  357. package/cjs/state/hover/col.d.ts +5 -0
  358. package/cjs/state/hover/col.js +24 -0
  359. package/cjs/state/hover/col.js.map +1 -0
  360. package/cjs/state/hover/is-cell-hover.d.ts +5 -0
  361. package/cjs/state/hover/is-cell-hover.js +36 -0
  362. package/cjs/state/hover/is-cell-hover.js.map +1 -0
  363. package/cjs/state/hover/row.d.ts +5 -0
  364. package/cjs/state/hover/row.js +22 -0
  365. package/cjs/state/hover/row.js.map +1 -0
  366. package/cjs/state/hover/single.d.ts +5 -0
  367. package/cjs/state/hover/single.js +18 -0
  368. package/cjs/state/hover/single.js.map +1 -0
  369. package/cjs/state/hover/update-cell.d.ts +2 -0
  370. package/cjs/state/hover/update-cell.js +13 -0
  371. package/cjs/state/hover/update-cell.js.map +1 -0
  372. package/cjs/state/hover/update-position.d.ts +2 -0
  373. package/cjs/state/hover/update-position.js +44 -0
  374. package/cjs/state/hover/update-position.js.map +1 -0
  375. package/cjs/state/pin/index.d.ts +2 -0
  376. package/cjs/state/pin/index.js +10 -0
  377. package/cjs/state/pin/index.js.map +1 -0
  378. package/cjs/state/select/update-position.d.ts +4 -0
  379. package/cjs/state/select/update-position.js +111 -0
  380. package/cjs/state/select/update-position.js.map +1 -0
  381. package/cjs/state/sort/index.d.ts +2 -0
  382. package/cjs/state/sort/index.js +41 -0
  383. package/cjs/state/sort/index.js.map +1 -0
  384. package/cjs/state/spark-line/index.d.ts +3 -0
  385. package/cjs/state/spark-line/index.js +98 -0
  386. package/cjs/state/spark-line/index.js.map +1 -0
  387. package/cjs/state/state.d.ts +155 -0
  388. package/cjs/state/state.js +431 -0
  389. package/cjs/state/state.js.map +1 -0
  390. package/cjs/themes/ARCO.d.ts +3 -0
  391. package/cjs/themes/ARCO.js +114 -0
  392. package/cjs/themes/ARCO.js.map +1 -0
  393. package/cjs/themes/BRIGHT.d.ts +3 -0
  394. package/cjs/themes/BRIGHT.js +71 -0
  395. package/cjs/themes/BRIGHT.js.map +1 -0
  396. package/cjs/themes/DARK.d.ts +3 -0
  397. package/cjs/themes/DARK.js +90 -0
  398. package/cjs/themes/DARK.js.map +1 -0
  399. package/cjs/themes/DEFAULT.d.ts +3 -0
  400. package/cjs/themes/DEFAULT.js +89 -0
  401. package/cjs/themes/DEFAULT.js.map +1 -0
  402. package/cjs/themes/SIMPLIFY.d.ts +3 -0
  403. package/cjs/themes/SIMPLIFY.js +46 -0
  404. package/cjs/themes/SIMPLIFY.js.map +1 -0
  405. package/cjs/themes/theme.d.ts +34 -0
  406. package/cjs/themes/theme.js +520 -0
  407. package/cjs/themes/theme.js.map +1 -0
  408. package/cjs/themes.d.ts +28 -0
  409. package/cjs/themes.js +52 -0
  410. package/cjs/themes.js.map +1 -0
  411. package/cjs/tools/LimitPromiseQueue.d.ts +8 -0
  412. package/cjs/tools/LimitPromiseQueue.js +29 -0
  413. package/cjs/tools/LimitPromiseQueue.js.map +1 -0
  414. package/cjs/tools/NumberMap.d.ts +16 -0
  415. package/cjs/tools/NumberMap.js +76 -0
  416. package/cjs/tools/NumberMap.js.map +1 -0
  417. package/cjs/tools/Rect.d.ts +24 -0
  418. package/cjs/tools/Rect.js +69 -0
  419. package/cjs/tools/Rect.js.map +1 -0
  420. package/cjs/tools/calc.d.ts +5 -0
  421. package/cjs/tools/calc.js +197 -0
  422. package/cjs/tools/calc.js.map +1 -0
  423. package/cjs/tools/debounce.d.ts +1 -0
  424. package/cjs/tools/debounce.js +51 -0
  425. package/cjs/tools/debounce.js.map +1 -0
  426. package/cjs/tools/dom.d.ts +1 -0
  427. package/cjs/tools/dom.js +11 -0
  428. package/cjs/tools/dom.js.map +1 -0
  429. package/cjs/tools/env.d.ts +19 -0
  430. package/cjs/tools/env.js +48 -0
  431. package/cjs/tools/env.js.map +1 -0
  432. package/cjs/tools/global.d.ts +13 -0
  433. package/cjs/tools/global.js +12 -0
  434. package/cjs/tools/global.js.map +1 -0
  435. package/cjs/tools/helper.d.ts +60 -0
  436. package/cjs/tools/helper.js +216 -0
  437. package/cjs/tools/helper.js.map +1 -0
  438. package/cjs/tools/icons.d.ts +4 -0
  439. package/cjs/tools/icons.js +10 -0
  440. package/cjs/tools/icons.js.map +1 -0
  441. package/cjs/tools/isx.d.ts +16 -0
  442. package/cjs/tools/isx.js +117 -0
  443. package/cjs/tools/isx.js.map +1 -0
  444. package/cjs/tools/sort.d.ts +1 -0
  445. package/cjs/tools/sort.js +18 -0
  446. package/cjs/tools/sort.js.map +1 -0
  447. package/cjs/tools/style.css +60 -0
  448. package/cjs/tools/style.d.ts +2 -0
  449. package/cjs/tools/style.js +11 -0
  450. package/cjs/tools/style.js.map +1 -0
  451. package/cjs/tools/text-width.d.ts +1 -0
  452. package/cjs/tools/text-width.js +17 -0
  453. package/cjs/tools/text-width.js.map +1 -0
  454. package/cjs/tools/util.d.ts +45 -0
  455. package/cjs/tools/util.js +299 -0
  456. package/cjs/tools/util.js.map +1 -0
  457. package/cjs/tooltip/BaseTooltip.d.ts +22 -0
  458. package/cjs/tooltip/BaseTooltip.js +35 -0
  459. package/cjs/tooltip/BaseTooltip.js.map +1 -0
  460. package/cjs/tooltip/Tooltip.d.ts +5 -0
  461. package/cjs/tooltip/Tooltip.js +16 -0
  462. package/cjs/tooltip/Tooltip.js.map +1 -0
  463. package/cjs/tooltip/TooltipHandler.d.ts +27 -0
  464. package/cjs/tooltip/TooltipHandler.js +129 -0
  465. package/cjs/tooltip/TooltipHandler.js.map +1 -0
  466. package/cjs/tooltip/logic/BubbleTooltipElement.css +63 -0
  467. package/cjs/tooltip/logic/BubbleTooltipElement.d.ts +33 -0
  468. package/cjs/tooltip/logic/BubbleTooltipElement.js +152 -0
  469. package/cjs/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  470. package/cjs/ts-types/base-table.d.ts +313 -0
  471. package/cjs/ts-types/base-table.js +6 -0
  472. package/cjs/ts-types/base-table.js.map +1 -0
  473. package/cjs/ts-types/chartType.d.ts +53 -0
  474. package/cjs/ts-types/chartType.js +6 -0
  475. package/cjs/ts-types/chartType.js.map +1 -0
  476. package/cjs/ts-types/column/index.d.ts +2 -0
  477. package/cjs/ts-types/column/index.js +21 -0
  478. package/cjs/ts-types/column/index.js.map +1 -0
  479. package/cjs/ts-types/column/style.d.ts +78 -0
  480. package/cjs/ts-types/column/style.js +6 -0
  481. package/cjs/ts-types/column/style.js.map +1 -0
  482. package/cjs/ts-types/column/type.d.ts +2 -0
  483. package/cjs/ts-types/column/type.js +6 -0
  484. package/cjs/ts-types/column/type.js.map +1 -0
  485. package/cjs/ts-types/common.d.ts +72 -0
  486. package/cjs/ts-types/common.js +6 -0
  487. package/cjs/ts-types/common.js.map +1 -0
  488. package/cjs/ts-types/customElement.d.ts +111 -0
  489. package/cjs/ts-types/customElement.js +6 -0
  490. package/cjs/ts-types/customElement.js.map +1 -0
  491. package/cjs/ts-types/customLayout.d.ts +8 -0
  492. package/cjs/ts-types/customLayout.js +6 -0
  493. package/cjs/ts-types/customLayout.js.map +1 -0
  494. package/cjs/ts-types/events.d.ts +182 -0
  495. package/cjs/ts-types/events.js +6 -0
  496. package/cjs/ts-types/events.js.map +1 -0
  497. package/cjs/ts-types/icon.d.ts +86 -0
  498. package/cjs/ts-types/icon.js +26 -0
  499. package/cjs/ts-types/icon.js.map +1 -0
  500. package/cjs/ts-types/index.d.ts +15 -0
  501. package/cjs/ts-types/index.js +28 -0
  502. package/cjs/ts-types/index.js.map +1 -0
  503. package/cjs/ts-types/list-table/define/basic-define.d.ts +36 -0
  504. package/cjs/ts-types/list-table/define/basic-define.js +6 -0
  505. package/cjs/ts-types/list-table/define/basic-define.js.map +1 -0
  506. package/cjs/ts-types/list-table/define/chart-define.d.ts +10 -0
  507. package/cjs/ts-types/list-table/define/chart-define.js +6 -0
  508. package/cjs/ts-types/list-table/define/chart-define.js.map +1 -0
  509. package/cjs/ts-types/list-table/define/image-define.d.ts +15 -0
  510. package/cjs/ts-types/list-table/define/image-define.js +6 -0
  511. package/cjs/ts-types/list-table/define/image-define.js.map +1 -0
  512. package/cjs/ts-types/list-table/define/index.d.ts +21 -0
  513. package/cjs/ts-types/list-table/define/index.js +6 -0
  514. package/cjs/ts-types/list-table/define/index.js.map +1 -0
  515. package/cjs/ts-types/list-table/define/link-define.d.ts +17 -0
  516. package/cjs/ts-types/list-table/define/link-define.js +6 -0
  517. package/cjs/ts-types/list-table/define/link-define.js.map +1 -0
  518. package/cjs/ts-types/list-table/define/multilinetext-define.d.ts +12 -0
  519. package/cjs/ts-types/list-table/define/multilinetext-define.js +6 -0
  520. package/cjs/ts-types/list-table/define/multilinetext-define.js.map +1 -0
  521. package/cjs/ts-types/list-table/define/progressbar-define.d.ts +11 -0
  522. package/cjs/ts-types/list-table/define/progressbar-define.js +6 -0
  523. package/cjs/ts-types/list-table/define/progressbar-define.js.map +1 -0
  524. package/cjs/ts-types/list-table/define/sparkline-define.d.ts +10 -0
  525. package/cjs/ts-types/list-table/define/sparkline-define.js +6 -0
  526. package/cjs/ts-types/list-table/define/sparkline-define.js.map +1 -0
  527. package/cjs/ts-types/list-table/index.d.ts +2 -0
  528. package/cjs/ts-types/list-table/index.js +21 -0
  529. package/cjs/ts-types/list-table/index.js.map +1 -0
  530. package/cjs/ts-types/list-table/layout-map/api.d.ts +92 -0
  531. package/cjs/ts-types/list-table/layout-map/api.js +6 -0
  532. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -0
  533. package/cjs/ts-types/list-table/layout-map/index.d.ts +1 -0
  534. package/cjs/ts-types/list-table/layout-map/index.js +6 -0
  535. package/cjs/ts-types/list-table/layout-map/index.js.map +1 -0
  536. package/cjs/ts-types/menu.d.ts +73 -0
  537. package/cjs/ts-types/menu.js +6 -0
  538. package/cjs/ts-types/menu.js.map +1 -0
  539. package/cjs/ts-types/new-data-set.d.ts +95 -0
  540. package/cjs/ts-types/new-data-set.js +14 -0
  541. package/cjs/ts-types/new-data-set.js.map +1 -0
  542. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +6 -0
  543. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +13 -0
  544. package/cjs/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -0
  545. package/cjs/ts-types/pivot-table/corner.d.ts +19 -0
  546. package/cjs/ts-types/pivot-table/corner.js +6 -0
  547. package/cjs/ts-types/pivot-table/corner.js.map +1 -0
  548. package/cjs/ts-types/pivot-table/dimension/basic-dimension.d.ts +25 -0
  549. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js +6 -0
  550. package/cjs/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -0
  551. package/cjs/ts-types/pivot-table/dimension/image-dimension.d.ts +9 -0
  552. package/cjs/ts-types/pivot-table/dimension/image-dimension.js +6 -0
  553. package/cjs/ts-types/pivot-table/dimension/image-dimension.js.map +1 -0
  554. package/cjs/ts-types/pivot-table/dimension/index.d.ts +4 -0
  555. package/cjs/ts-types/pivot-table/dimension/index.js +6 -0
  556. package/cjs/ts-types/pivot-table/dimension/index.js.map +1 -0
  557. package/cjs/ts-types/pivot-table/dimension/link-dimension.d.ts +10 -0
  558. package/cjs/ts-types/pivot-table/dimension/link-dimension.js +6 -0
  559. package/cjs/ts-types/pivot-table/dimension/link-dimension.js.map +1 -0
  560. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.d.ts +7 -0
  561. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.js +6 -0
  562. package/cjs/ts-types/pivot-table/dimension/multilinetext-dimension.js.map +1 -0
  563. package/cjs/ts-types/pivot-table/index.d.ts +4 -0
  564. package/cjs/ts-types/pivot-table/index.js +22 -0
  565. package/cjs/ts-types/pivot-table/index.js.map +1 -0
  566. package/cjs/ts-types/pivot-table/indicator/basic-indicator.d.ts +26 -0
  567. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js +6 -0
  568. package/cjs/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -0
  569. package/cjs/ts-types/pivot-table/indicator/chart-indicator.d.ts +10 -0
  570. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js +6 -0
  571. package/cjs/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -0
  572. package/cjs/ts-types/pivot-table/indicator/image-indicator.d.ts +15 -0
  573. package/cjs/ts-types/pivot-table/indicator/image-indicator.js +6 -0
  574. package/cjs/ts-types/pivot-table/indicator/image-indicator.js.map +1 -0
  575. package/cjs/ts-types/pivot-table/indicator/index.d.ts +10 -0
  576. package/cjs/ts-types/pivot-table/indicator/index.js +6 -0
  577. package/cjs/ts-types/pivot-table/indicator/index.js.map +1 -0
  578. package/cjs/ts-types/pivot-table/indicator/link-indicator.d.ts +17 -0
  579. package/cjs/ts-types/pivot-table/indicator/link-indicator.js +6 -0
  580. package/cjs/ts-types/pivot-table/indicator/link-indicator.js.map +1 -0
  581. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.d.ts +11 -0
  582. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.js +6 -0
  583. package/cjs/ts-types/pivot-table/indicator/multilinetext-indicator.js.map +1 -0
  584. package/cjs/ts-types/pivot-table/indicator/progress-indicator.d.ts +11 -0
  585. package/cjs/ts-types/pivot-table/indicator/progress-indicator.js +6 -0
  586. package/cjs/ts-types/pivot-table/indicator/progress-indicator.js.map +1 -0
  587. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.d.ts +10 -0
  588. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.js +6 -0
  589. package/cjs/ts-types/pivot-table/indicator/sparkline-indicator.js.map +1 -0
  590. package/cjs/ts-types/pivot-table/title.d.ts +18 -0
  591. package/cjs/ts-types/pivot-table/title.js +6 -0
  592. package/cjs/ts-types/pivot-table/title.js.map +1 -0
  593. package/cjs/ts-types/style-define.d.ts +60 -0
  594. package/cjs/ts-types/style-define.js +6 -0
  595. package/cjs/ts-types/style-define.js.map +1 -0
  596. package/cjs/ts-types/table-engine.d.ts +169 -0
  597. package/cjs/ts-types/table-engine.js +12 -0
  598. package/cjs/ts-types/table-engine.js.map +1 -0
  599. package/cjs/ts-types/theme.d.ts +88 -0
  600. package/cjs/ts-types/theme.js +6 -0
  601. package/cjs/ts-types/theme.js.map +1 -0
  602. package/cjs/ts-types/tooltip.d.ts +22 -0
  603. package/cjs/ts-types/tooltip.js +6 -0
  604. package/cjs/ts-types/tooltip.js.map +1 -0
  605. package/dist/vtable.js +72964 -0
  606. package/dist/vtable.min.js +17 -0
  607. package/es/ListTable.d.ts +38 -0
  608. package/es/ListTable.js +256 -0
  609. package/es/ListTable.js.map +1 -0
  610. package/es/PivotTable.d.ts +50 -0
  611. package/es/PivotTable.js +282 -0
  612. package/es/PivotTable.js.map +1 -0
  613. package/es/body-helper/body-helper.d.ts +14 -0
  614. package/es/body-helper/body-helper.js +80 -0
  615. package/es/body-helper/body-helper.js.map +1 -0
  616. package/es/body-helper/style/ImageStyle.d.ts +7 -0
  617. package/es/body-helper/style/ImageStyle.js +16 -0
  618. package/es/body-helper/style/ImageStyle.js.map +1 -0
  619. package/es/body-helper/style/MultilineTextStyle.d.ts +13 -0
  620. package/es/body-helper/style/MultilineTextStyle.js +30 -0
  621. package/es/body-helper/style/MultilineTextStyle.js.map +1 -0
  622. package/es/body-helper/style/NumberStyle.d.ts +7 -0
  623. package/es/body-helper/style/NumberStyle.js +16 -0
  624. package/es/body-helper/style/NumberStyle.js.map +1 -0
  625. package/es/body-helper/style/ProgressBarStyle.d.ts +52 -0
  626. package/es/body-helper/style/ProgressBarStyle.js +118 -0
  627. package/es/body-helper/style/ProgressBarStyle.js.map +1 -0
  628. package/es/body-helper/style/Style.d.ts +85 -0
  629. package/es/body-helper/style/Style.js +194 -0
  630. package/es/body-helper/style/Style.js.map +1 -0
  631. package/es/body-helper/style.d.ts +10 -0
  632. package/es/body-helper/style.js +20 -0
  633. package/es/body-helper/style.js.map +1 -0
  634. package/es/chartType.d.ts +3 -0
  635. package/es/chartType.js +10 -0
  636. package/es/chartType.js.map +1 -0
  637. package/es/core/BaseTable.d.ts +287 -0
  638. package/es/core/BaseTable.js +1281 -0
  639. package/es/core/BaseTable.js.map +1 -0
  640. package/es/core/FouseInput.d.ts +11 -0
  641. package/es/core/FouseInput.js +30 -0
  642. package/es/core/FouseInput.js.map +1 -0
  643. package/es/core/TABLE_EVENT_TYPE.d.ts +30 -0
  644. package/es/core/TABLE_EVENT_TYPE.js +30 -0
  645. package/es/core/TABLE_EVENT_TYPE.js.map +1 -0
  646. package/es/core/tableHelper.d.ts +28 -0
  647. package/es/core/tableHelper.js +107 -0
  648. package/es/core/tableHelper.js.map +1 -0
  649. package/es/core.d.ts +3 -0
  650. package/es/core.js +6 -0
  651. package/es/core.js.map +1 -0
  652. package/es/data/CachedDataSource.d.ts +16 -0
  653. package/es/data/CachedDataSource.js +48 -0
  654. package/es/data/CachedDataSource.js.map +1 -0
  655. package/es/data/DataSource.d.ts +64 -0
  656. package/es/data/DataSource.js +267 -0
  657. package/es/data/DataSource.js.map +1 -0
  658. package/es/data/FilterDataSource.d.ts +1 -0
  659. package/es/data/FilterDataSource.js +1 -0
  660. package/es/data/FilterDataSource.js.map +1 -0
  661. package/es/data.d.ts +4 -0
  662. package/es/data.js +6 -0
  663. package/es/data.js.map +1 -0
  664. package/es/dataset/DataStatistics.d.ts +10 -0
  665. package/es/dataset/DataStatistics.js +74 -0
  666. package/es/dataset/DataStatistics.js.map +1 -0
  667. package/es/dataset/dataset.d.ts +72 -0
  668. package/es/dataset/dataset.js +482 -0
  669. package/es/dataset/dataset.js.map +1 -0
  670. package/es/dataset/flatDataToObject.d.ts +31 -0
  671. package/es/dataset/flatDataToObject.js +63 -0
  672. package/es/dataset/flatDataToObject.js.map +1 -0
  673. package/es/event/EventHandler.d.ts +45 -0
  674. package/es/event/EventHandler.js +111 -0
  675. package/es/event/EventHandler.js.map +1 -0
  676. package/es/event/EventTarget.d.ts +11 -0
  677. package/es/event/EventTarget.js +50 -0
  678. package/es/event/EventTarget.js.map +1 -0
  679. package/es/event/chart.d.ts +2 -0
  680. package/es/event/chart.js +16 -0
  681. package/es/event/chart.js.map +1 -0
  682. package/es/event/drill.d.ts +3 -0
  683. package/es/event/drill.js +17 -0
  684. package/es/event/drill.js.map +1 -0
  685. package/es/event/event.d.ts +35 -0
  686. package/es/event/event.js +438 -0
  687. package/es/event/event.js.map +1 -0
  688. package/es/event/media-click.d.ts +2 -0
  689. package/es/event/media-click.js +54 -0
  690. package/es/event/media-click.js.map +1 -0
  691. package/es/event/scroll.d.ts +2 -0
  692. package/es/event/scroll.js +17 -0
  693. package/es/event/scroll.js.map +1 -0
  694. package/es/header-helper/header-helper.d.ts +26 -0
  695. package/es/header-helper/header-helper.js +189 -0
  696. package/es/header-helper/header-helper.js.map +1 -0
  697. package/es/header-helper/style/ImageStyle.d.ts +7 -0
  698. package/es/header-helper/style/ImageStyle.js +17 -0
  699. package/es/header-helper/style/ImageStyle.js.map +1 -0
  700. package/es/header-helper/style/MultilineTextHeaderStyle.d.ts +13 -0
  701. package/es/header-helper/style/MultilineTextHeaderStyle.js +30 -0
  702. package/es/header-helper/style/MultilineTextHeaderStyle.js.map +1 -0
  703. package/es/header-helper/style/SortHeaderStyle.d.ts +1 -0
  704. package/es/header-helper/style/SortHeaderStyle.js +3 -0
  705. package/es/header-helper/style/SortHeaderStyle.js.map +1 -0
  706. package/es/header-helper/style/Style.d.ts +88 -0
  707. package/es/header-helper/style/Style.js +202 -0
  708. package/es/header-helper/style/Style.js.map +1 -0
  709. package/es/header-helper/style.d.ts +5 -0
  710. package/es/header-helper/style.js +14 -0
  711. package/es/header-helper/style.js.map +1 -0
  712. package/es/icons.d.ts +4 -0
  713. package/es/icons.js +241 -0
  714. package/es/icons.js.map +1 -0
  715. package/es/index.d.ts +17 -0
  716. package/es/index.js +34 -0
  717. package/es/index.js.map +1 -0
  718. package/es/layout/index.d.ts +1 -0
  719. package/es/layout/index.js +2 -0
  720. package/es/layout/index.js.map +1 -0
  721. package/es/layout/pivot-header-layout.d.ts +155 -0
  722. package/es/layout/pivot-header-layout.js +888 -0
  723. package/es/layout/pivot-header-layout.js.map +1 -0
  724. package/es/layout/pivot-layout.d.ts +86 -0
  725. package/es/layout/pivot-layout.js +416 -0
  726. package/es/layout/pivot-layout.js.map +1 -0
  727. package/es/layout/simple-header-layout.d.ts +67 -0
  728. package/es/layout/simple-header-layout.js +405 -0
  729. package/es/layout/simple-header-layout.js.map +1 -0
  730. package/es/menu/dom/BaseMenu.d.ts +15 -0
  731. package/es/menu/dom/BaseMenu.js +22 -0
  732. package/es/menu/dom/BaseMenu.js.map +1 -0
  733. package/es/menu/dom/Menu.d.ts +9 -0
  734. package/es/menu/dom/Menu.js +18 -0
  735. package/es/menu/dom/Menu.js.map +1 -0
  736. package/es/menu/dom/MenuHandler.d.ts +20 -0
  737. package/es/menu/dom/MenuHandler.js +132 -0
  738. package/es/menu/dom/MenuHandler.js.map +1 -0
  739. package/es/menu/dom/logic/MenuContainer.d.ts +22 -0
  740. package/es/menu/dom/logic/MenuContainer.js +105 -0
  741. package/es/menu/dom/logic/MenuContainer.js.map +1 -0
  742. package/es/menu/dom/logic/MenuElement.css +86 -0
  743. package/es/menu/dom/logic/MenuElement.d.ts +27 -0
  744. package/es/menu/dom/logic/MenuElement.js +277 -0
  745. package/es/menu/dom/logic/MenuElement.js.map +1 -0
  746. package/es/plugins/chartTypes.d.ts +3 -0
  747. package/es/plugins/chartTypes.js +2 -0
  748. package/es/plugins/chartTypes.js.map +1 -0
  749. package/es/plugins/icons.d.ts +12 -0
  750. package/es/plugins/icons.js +22 -0
  751. package/es/plugins/icons.js.map +1 -0
  752. package/es/plugins/themes.d.ts +4 -0
  753. package/es/plugins/themes.js +2 -0
  754. package/es/plugins/themes.js.map +1 -0
  755. package/es/register.d.ts +5 -0
  756. package/es/register.js +31 -0
  757. package/es/register.js.map +1 -0
  758. package/es/render/layout/arc.d.ts +23 -0
  759. package/es/render/layout/arc.js +12 -0
  760. package/es/render/layout/arc.js.map +1 -0
  761. package/es/render/layout/circle.d.ts +19 -0
  762. package/es/render/layout/circle.js +11 -0
  763. package/es/render/layout/circle.js.map +1 -0
  764. package/es/render/layout/container.d.ts +52 -0
  765. package/es/render/layout/container.js +99 -0
  766. package/es/render/layout/container.js.map +1 -0
  767. package/es/render/layout/direction.d.ts +22 -0
  768. package/es/render/layout/direction.js +31 -0
  769. package/es/render/layout/direction.js.map +1 -0
  770. package/es/render/layout/element.d.ts +47 -0
  771. package/es/render/layout/element.js +19 -0
  772. package/es/render/layout/element.js.map +1 -0
  773. package/es/render/layout/group-element.d.ts +25 -0
  774. package/es/render/layout/group-element.js +46 -0
  775. package/es/render/layout/group-element.js.map +1 -0
  776. package/es/render/layout/icon.d.ts +21 -0
  777. package/es/render/layout/icon.js +19 -0
  778. package/es/render/layout/icon.js.map +1 -0
  779. package/es/render/layout/image.d.ts +21 -0
  780. package/es/render/layout/image.js +12 -0
  781. package/es/render/layout/image.js.map +1 -0
  782. package/es/render/layout/index.d.ts +9 -0
  783. package/es/render/layout/index.js +18 -0
  784. package/es/render/layout/index.js.map +1 -0
  785. package/es/render/layout/line.d.ts +32 -0
  786. package/es/render/layout/line.js +80 -0
  787. package/es/render/layout/line.js.map +1 -0
  788. package/es/render/layout/percent-calc.d.ts +8 -0
  789. package/es/render/layout/percent-calc.js +7 -0
  790. package/es/render/layout/percent-calc.js.map +1 -0
  791. package/es/render/layout/rect.d.ts +22 -0
  792. package/es/render/layout/rect.js +11 -0
  793. package/es/render/layout/rect.js.map +1 -0
  794. package/es/render/layout/text.d.ts +22 -0
  795. package/es/render/layout/text.js +18 -0
  796. package/es/render/layout/text.js.map +1 -0
  797. package/es/scenegraph/component/cell-content.d.ts +36 -0
  798. package/es/scenegraph/component/cell-content.js +98 -0
  799. package/es/scenegraph/component/cell-content.js.map +1 -0
  800. package/es/scenegraph/component/cell-mover.d.ts +15 -0
  801. package/es/scenegraph/component/cell-mover.js +101 -0
  802. package/es/scenegraph/component/cell-mover.js.map +1 -0
  803. package/es/scenegraph/component/custom.d.ts +7 -0
  804. package/es/scenegraph/component/custom.js +211 -0
  805. package/es/scenegraph/component/custom.js.map +1 -0
  806. package/es/scenegraph/component/drill-icon.d.ts +9 -0
  807. package/es/scenegraph/component/drill-icon.js +41 -0
  808. package/es/scenegraph/component/drill-icon.js.map +1 -0
  809. package/es/scenegraph/component/menu.d.ts +41 -0
  810. package/es/scenegraph/component/menu.js +212 -0
  811. package/es/scenegraph/component/menu.js.map +1 -0
  812. package/es/scenegraph/component/table-component.d.ts +37 -0
  813. package/es/scenegraph/component/table-component.js +304 -0
  814. package/es/scenegraph/component/table-component.js.map +1 -0
  815. package/es/scenegraph/component/util.d.ts +2 -0
  816. package/es/scenegraph/component/util.js +5 -0
  817. package/es/scenegraph/component/util.js.map +1 -0
  818. package/es/scenegraph/debug-tool/debug-tool.d.ts +36 -0
  819. package/es/scenegraph/debug-tool/debug-tool.js +126 -0
  820. package/es/scenegraph/debug-tool/debug-tool.js.map +1 -0
  821. package/es/scenegraph/debug-tool/index.d.ts +4 -0
  822. package/es/scenegraph/debug-tool/index.js +6 -0
  823. package/es/scenegraph/debug-tool/index.js.map +1 -0
  824. package/es/scenegraph/graphic/chart.d.ts +30 -0
  825. package/es/scenegraph/graphic/chart.js +59 -0
  826. package/es/scenegraph/graphic/chart.js.map +1 -0
  827. package/es/scenegraph/graphic/contributions/chart-render.d.ts +10 -0
  828. package/es/scenegraph/graphic/contributions/chart-render.js +47 -0
  829. package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -0
  830. package/es/scenegraph/graphic/contributions/group-contribution-render.d.ts +70 -0
  831. package/es/scenegraph/graphic/contributions/group-contribution-render.js +192 -0
  832. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -0
  833. package/es/scenegraph/graphic/contributions/image-contribution-render.d.ts +20 -0
  834. package/es/scenegraph/graphic/contributions/image-contribution-render.js +42 -0
  835. package/es/scenegraph/graphic/contributions/image-contribution-render.js.map +1 -0
  836. package/es/scenegraph/graphic/contributions/index.d.ts +3 -0
  837. package/es/scenegraph/graphic/contributions/index.js +29 -0
  838. package/es/scenegraph/graphic/contributions/index.js.map +1 -0
  839. package/es/scenegraph/graphic/contributions/rect-contribution-render.d.ts +17 -0
  840. package/es/scenegraph/graphic/contributions/rect-contribution-render.js +45 -0
  841. package/es/scenegraph/graphic/contributions/rect-contribution-render.js.map +1 -0
  842. package/es/scenegraph/graphic/group.d.ts +23 -0
  843. package/es/scenegraph/graphic/group.js +86 -0
  844. package/es/scenegraph/graphic/group.js.map +1 -0
  845. package/es/scenegraph/graphic/icon.d.ts +24 -0
  846. package/es/scenegraph/graphic/icon.js +17 -0
  847. package/es/scenegraph/graphic/icon.js.map +1 -0
  848. package/es/scenegraph/graphic/text.d.ts +16 -0
  849. package/es/scenegraph/graphic/text.js +142 -0
  850. package/es/scenegraph/graphic/text.js.map +1 -0
  851. package/es/scenegraph/group-creater/cell-helper.d.ts +7 -0
  852. package/es/scenegraph/group-creater/cell-helper.js +93 -0
  853. package/es/scenegraph/group-creater/cell-helper.js.map +1 -0
  854. package/es/scenegraph/group-creater/cell-type/chart-cell.d.ts +3 -0
  855. package/es/scenegraph/group-creater/cell-type/chart-cell.js +54 -0
  856. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -0
  857. package/es/scenegraph/group-creater/cell-type/image-cell.d.ts +7 -0
  858. package/es/scenegraph/group-creater/cell-type/image-cell.js +102 -0
  859. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -0
  860. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +9 -0
  861. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +337 -0
  862. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -0
  863. package/es/scenegraph/group-creater/cell-type/spark-line-cell.d.ts +3 -0
  864. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +165 -0
  865. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -0
  866. package/es/scenegraph/group-creater/cell-type/text-cell.d.ts +5 -0
  867. package/es/scenegraph/group-creater/cell-type/text-cell.js +66 -0
  868. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -0
  869. package/es/scenegraph/group-creater/cell-type/video-cell.d.ts +4 -0
  870. package/es/scenegraph/group-creater/cell-type/video-cell.js +86 -0
  871. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -0
  872. package/es/scenegraph/group-creater/column-helper.d.ts +24 -0
  873. package/es/scenegraph/group-creater/column-helper.js +135 -0
  874. package/es/scenegraph/group-creater/column-helper.js.map +1 -0
  875. package/es/scenegraph/group-creater/column.d.ts +14 -0
  876. package/es/scenegraph/group-creater/column.js +49 -0
  877. package/es/scenegraph/group-creater/column.js.map +1 -0
  878. package/es/scenegraph/group-creater/progress/proxy.d.ts +45 -0
  879. package/es/scenegraph/group-creater/progress/proxy.js +268 -0
  880. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -0
  881. package/es/scenegraph/header-icon/layout.d.ts +3 -0
  882. package/es/scenegraph/header-icon/layout.js +69 -0
  883. package/es/scenegraph/header-icon/layout.js.map +1 -0
  884. package/es/scenegraph/hover-state.d.ts +14 -0
  885. package/es/scenegraph/hover-state.js +19 -0
  886. package/es/scenegraph/hover-state.js.map +1 -0
  887. package/es/scenegraph/layout/auto-height.d.ts +2 -0
  888. package/es/scenegraph/layout/auto-height.js +44 -0
  889. package/es/scenegraph/layout/auto-height.js.map +1 -0
  890. package/es/scenegraph/layout/auto-width.d.ts +2 -0
  891. package/es/scenegraph/layout/auto-width.js +82 -0
  892. package/es/scenegraph/layout/auto-width.js.map +1 -0
  893. package/es/scenegraph/layout/compute-col-width.d.ts +3 -0
  894. package/es/scenegraph/layout/compute-col-width.js +167 -0
  895. package/es/scenegraph/layout/compute-col-width.js.map +1 -0
  896. package/es/scenegraph/layout/move-cell.d.ts +2 -0
  897. package/es/scenegraph/layout/move-cell.js +55 -0
  898. package/es/scenegraph/layout/move-cell.js.map +1 -0
  899. package/es/scenegraph/layout/update-cell.d.ts +3 -0
  900. package/es/scenegraph/layout/update-cell.js +55 -0
  901. package/es/scenegraph/layout/update-cell.js.map +1 -0
  902. package/es/scenegraph/layout/update-height.d.ts +6 -0
  903. package/es/scenegraph/layout/update-height.js +91 -0
  904. package/es/scenegraph/layout/update-height.js.map +1 -0
  905. package/es/scenegraph/layout/update-width.d.ts +2 -0
  906. package/es/scenegraph/layout/update-width.js +105 -0
  907. package/es/scenegraph/layout/update-width.js.map +1 -0
  908. package/es/scenegraph/scenegraph.d.ts +109 -0
  909. package/es/scenegraph/scenegraph.js +818 -0
  910. package/es/scenegraph/scenegraph.js.map +1 -0
  911. package/es/scenegraph/style/frame-border.d.ts +3 -0
  912. package/es/scenegraph/style/frame-border.js +35 -0
  913. package/es/scenegraph/style/frame-border.js.map +1 -0
  914. package/es/scenegraph/utils/border-line.d.ts +8 -0
  915. package/es/scenegraph/utils/border-line.js +45 -0
  916. package/es/scenegraph/utils/border-line.js.map +1 -0
  917. package/es/scenegraph/utils/break-string.d.ts +1 -0
  918. package/es/scenegraph/utils/break-string.js +31 -0
  919. package/es/scenegraph/utils/break-string.js.map +1 -0
  920. package/es/scenegraph/utils/cell-pos.d.ts +4 -0
  921. package/es/scenegraph/utils/cell-pos.js +12 -0
  922. package/es/scenegraph/utils/cell-pos.js.map +1 -0
  923. package/es/scenegraph/utils/font.d.ts +1 -0
  924. package/es/scenegraph/utils/font.js +6 -0
  925. package/es/scenegraph/utils/font.js.map +1 -0
  926. package/es/scenegraph/utils/get-cell-merge.d.ts +3 -0
  927. package/es/scenegraph/utils/get-cell-merge.js +5 -0
  928. package/es/scenegraph/utils/get-cell-merge.js.map +1 -0
  929. package/es/scenegraph/utils/get-prop.d.ts +4 -0
  930. package/es/scenegraph/utils/get-prop.js +36 -0
  931. package/es/scenegraph/utils/get-prop.js.map +1 -0
  932. package/es/scenegraph/utils/icon.d.ts +12 -0
  933. package/es/scenegraph/utils/icon.js +29 -0
  934. package/es/scenegraph/utils/icon.js.map +1 -0
  935. package/es/scenegraph/utils/keep-aspect-ratio.d.ts +4 -0
  936. package/es/scenegraph/utils/keep-aspect-ratio.js +10 -0
  937. package/es/scenegraph/utils/keep-aspect-ratio.js.map +1 -0
  938. package/es/scenegraph/utils/measure-text.d.ts +20 -0
  939. package/es/scenegraph/utils/measure-text.js +114 -0
  940. package/es/scenegraph/utils/measure-text.js.map +1 -0
  941. package/es/scenegraph/utils/padding.d.ts +1 -0
  942. package/es/scenegraph/utils/padding.js +8 -0
  943. package/es/scenegraph/utils/padding.js.map +1 -0
  944. package/es/scenegraph/utils/text-icon-layout.d.ts +9 -0
  945. package/es/scenegraph/utils/text-icon-layout.js +239 -0
  946. package/es/scenegraph/utils/text-icon-layout.js.map +1 -0
  947. package/es/scenegraph/utils/text-pos.d.ts +8 -0
  948. package/es/scenegraph/utils/text-pos.js +20 -0
  949. package/es/scenegraph/utils/text-pos.js.map +1 -0
  950. package/es/state/cell-move/adjust-header.d.ts +3 -0
  951. package/es/state/cell-move/adjust-header.js +14 -0
  952. package/es/state/cell-move/adjust-header.js.map +1 -0
  953. package/es/state/cell-move/index.d.ts +4 -0
  954. package/es/state/cell-move/index.js +52 -0
  955. package/es/state/cell-move/index.js.map +1 -0
  956. package/es/state/common/check-in-select.d.ts +8 -0
  957. package/es/state/common/check-in-select.js +53 -0
  958. package/es/state/common/check-in-select.js.map +1 -0
  959. package/es/state/drill/index.d.ts +2 -0
  960. package/es/state/drill/index.js +9 -0
  961. package/es/state/drill/index.js.map +1 -0
  962. package/es/state/hover/col.d.ts +5 -0
  963. package/es/state/hover/col.js +16 -0
  964. package/es/state/hover/col.js.map +1 -0
  965. package/es/state/hover/is-cell-hover.d.ts +5 -0
  966. package/es/state/hover/is-cell-hover.js +30 -0
  967. package/es/state/hover/is-cell-hover.js.map +1 -0
  968. package/es/state/hover/row.d.ts +5 -0
  969. package/es/state/hover/row.js +14 -0
  970. package/es/state/hover/row.js.map +1 -0
  971. package/es/state/hover/single.d.ts +5 -0
  972. package/es/state/hover/single.js +10 -0
  973. package/es/state/hover/single.js.map +1 -0
  974. package/es/state/hover/update-cell.d.ts +2 -0
  975. package/es/state/hover/update-cell.js +7 -0
  976. package/es/state/hover/update-cell.js.map +1 -0
  977. package/es/state/hover/update-position.d.ts +2 -0
  978. package/es/state/hover/update-position.js +36 -0
  979. package/es/state/hover/update-position.js.map +1 -0
  980. package/es/state/pin/index.d.ts +2 -0
  981. package/es/state/pin/index.js +4 -0
  982. package/es/state/pin/index.js.map +1 -0
  983. package/es/state/select/update-position.d.ts +4 -0
  984. package/es/state/select/update-position.js +103 -0
  985. package/es/state/select/update-position.js.map +1 -0
  986. package/es/state/sort/index.d.ts +2 -0
  987. package/es/state/sort/index.js +35 -0
  988. package/es/state/sort/index.js.map +1 -0
  989. package/es/state/spark-line/index.d.ts +3 -0
  990. package/es/state/spark-line/index.js +92 -0
  991. package/es/state/spark-line/index.js.map +1 -0
  992. package/es/state/state.d.ts +155 -0
  993. package/es/state/state.js +458 -0
  994. package/es/state/state.js.map +1 -0
  995. package/es/themes/ARCO.d.ts +3 -0
  996. package/es/themes/ARCO.js +110 -0
  997. package/es/themes/ARCO.js.map +1 -0
  998. package/es/themes/BRIGHT.d.ts +3 -0
  999. package/es/themes/BRIGHT.js +67 -0
  1000. package/es/themes/BRIGHT.js.map +1 -0
  1001. package/es/themes/DARK.d.ts +3 -0
  1002. package/es/themes/DARK.js +86 -0
  1003. package/es/themes/DARK.js.map +1 -0
  1004. package/es/themes/DEFAULT.d.ts +3 -0
  1005. package/es/themes/DEFAULT.js +85 -0
  1006. package/es/themes/DEFAULT.js.map +1 -0
  1007. package/es/themes/SIMPLIFY.d.ts +3 -0
  1008. package/es/themes/SIMPLIFY.js +42 -0
  1009. package/es/themes/SIMPLIFY.js.map +1 -0
  1010. package/es/themes/theme.d.ts +34 -0
  1011. package/es/themes/theme.js +505 -0
  1012. package/es/themes/theme.js.map +1 -0
  1013. package/es/themes.d.ts +28 -0
  1014. package/es/themes.js +62 -0
  1015. package/es/themes.js.map +1 -0
  1016. package/es/tools/LimitPromiseQueue.d.ts +8 -0
  1017. package/es/tools/LimitPromiseQueue.js +21 -0
  1018. package/es/tools/LimitPromiseQueue.js.map +1 -0
  1019. package/es/tools/NumberMap.d.ts +16 -0
  1020. package/es/tools/NumberMap.js +70 -0
  1021. package/es/tools/NumberMap.js.map +1 -0
  1022. package/es/tools/Rect.d.ts +24 -0
  1023. package/es/tools/Rect.js +61 -0
  1024. package/es/tools/Rect.js.map +1 -0
  1025. package/es/tools/calc.d.ts +5 -0
  1026. package/es/tools/calc.js +191 -0
  1027. package/es/tools/calc.js.map +1 -0
  1028. package/es/tools/debounce.d.ts +1 -0
  1029. package/es/tools/debounce.js +43 -0
  1030. package/es/tools/debounce.js.map +1 -0
  1031. package/es/tools/dom.d.ts +1 -0
  1032. package/es/tools/dom.js +5 -0
  1033. package/es/tools/dom.js.map +1 -0
  1034. package/es/tools/env.d.ts +19 -0
  1035. package/es/tools/env.js +42 -0
  1036. package/es/tools/env.js.map +1 -0
  1037. package/es/tools/global.d.ts +13 -0
  1038. package/es/tools/global.js +26 -0
  1039. package/es/tools/global.js.map +1 -0
  1040. package/es/tools/helper.d.ts +60 -0
  1041. package/es/tools/helper.js +216 -0
  1042. package/es/tools/helper.js.map +1 -0
  1043. package/es/tools/icons.d.ts +4 -0
  1044. package/es/tools/icons.js +4 -0
  1045. package/es/tools/icons.js.map +1 -0
  1046. package/es/tools/isx.d.ts +16 -0
  1047. package/es/tools/isx.js +79 -0
  1048. package/es/tools/isx.js.map +1 -0
  1049. package/es/tools/sort.d.ts +1 -0
  1050. package/es/tools/sort.js +12 -0
  1051. package/es/tools/sort.js.map +1 -0
  1052. package/es/tools/style.css +60 -0
  1053. package/es/tools/style.d.ts +2 -0
  1054. package/es/tools/style.js +5 -0
  1055. package/es/tools/style.js.map +1 -0
  1056. package/es/tools/text-width.d.ts +1 -0
  1057. package/es/tools/text-width.js +9 -0
  1058. package/es/tools/text-width.js.map +1 -0
  1059. package/es/tools/util.d.ts +45 -0
  1060. package/es/tools/util.js +250 -0
  1061. package/es/tools/util.js.map +1 -0
  1062. package/es/tooltip/BaseTooltip.d.ts +22 -0
  1063. package/es/tooltip/BaseTooltip.js +27 -0
  1064. package/es/tooltip/BaseTooltip.js.map +1 -0
  1065. package/es/tooltip/Tooltip.d.ts +5 -0
  1066. package/es/tooltip/Tooltip.js +10 -0
  1067. package/es/tooltip/Tooltip.js.map +1 -0
  1068. package/es/tooltip/TooltipHandler.d.ts +27 -0
  1069. package/es/tooltip/TooltipHandler.js +131 -0
  1070. package/es/tooltip/TooltipHandler.js.map +1 -0
  1071. package/es/tooltip/logic/BubbleTooltipElement.css +63 -0
  1072. package/es/tooltip/logic/BubbleTooltipElement.d.ts +33 -0
  1073. package/es/tooltip/logic/BubbleTooltipElement.js +149 -0
  1074. package/es/tooltip/logic/BubbleTooltipElement.js.map +1 -0
  1075. package/es/ts-types/base-table.d.ts +313 -0
  1076. package/es/ts-types/base-table.js +2 -0
  1077. package/es/ts-types/base-table.js.map +1 -0
  1078. package/es/ts-types/chartType.d.ts +53 -0
  1079. package/es/ts-types/chartType.js +2 -0
  1080. package/es/ts-types/chartType.js.map +1 -0
  1081. package/es/ts-types/column/index.d.ts +2 -0
  1082. package/es/ts-types/column/index.js +4 -0
  1083. package/es/ts-types/column/index.js.map +1 -0
  1084. package/es/ts-types/column/style.d.ts +78 -0
  1085. package/es/ts-types/column/style.js +2 -0
  1086. package/es/ts-types/column/style.js.map +1 -0
  1087. package/es/ts-types/column/type.d.ts +2 -0
  1088. package/es/ts-types/column/type.js +2 -0
  1089. package/es/ts-types/column/type.js.map +1 -0
  1090. package/es/ts-types/common.d.ts +72 -0
  1091. package/es/ts-types/common.js +2 -0
  1092. package/es/ts-types/common.js.map +1 -0
  1093. package/es/ts-types/customElement.d.ts +111 -0
  1094. package/es/ts-types/customElement.js +2 -0
  1095. package/es/ts-types/customElement.js.map +1 -0
  1096. package/es/ts-types/customLayout.d.ts +8 -0
  1097. package/es/ts-types/customLayout.js +2 -0
  1098. package/es/ts-types/customLayout.js.map +1 -0
  1099. package/es/ts-types/events.d.ts +182 -0
  1100. package/es/ts-types/events.js +2 -0
  1101. package/es/ts-types/events.js.map +1 -0
  1102. package/es/ts-types/icon.d.ts +86 -0
  1103. package/es/ts-types/icon.js +28 -0
  1104. package/es/ts-types/icon.js.map +1 -0
  1105. package/es/ts-types/index.d.ts +15 -0
  1106. package/es/ts-types/index.js +30 -0
  1107. package/es/ts-types/index.js.map +1 -0
  1108. package/es/ts-types/list-table/define/basic-define.d.ts +36 -0
  1109. package/es/ts-types/list-table/define/basic-define.js +2 -0
  1110. package/es/ts-types/list-table/define/basic-define.js.map +1 -0
  1111. package/es/ts-types/list-table/define/chart-define.d.ts +10 -0
  1112. package/es/ts-types/list-table/define/chart-define.js +2 -0
  1113. package/es/ts-types/list-table/define/chart-define.js.map +1 -0
  1114. package/es/ts-types/list-table/define/image-define.d.ts +15 -0
  1115. package/es/ts-types/list-table/define/image-define.js +2 -0
  1116. package/es/ts-types/list-table/define/image-define.js.map +1 -0
  1117. package/es/ts-types/list-table/define/index.d.ts +21 -0
  1118. package/es/ts-types/list-table/define/index.js +2 -0
  1119. package/es/ts-types/list-table/define/index.js.map +1 -0
  1120. package/es/ts-types/list-table/define/link-define.d.ts +17 -0
  1121. package/es/ts-types/list-table/define/link-define.js +2 -0
  1122. package/es/ts-types/list-table/define/link-define.js.map +1 -0
  1123. package/es/ts-types/list-table/define/multilinetext-define.d.ts +12 -0
  1124. package/es/ts-types/list-table/define/multilinetext-define.js +2 -0
  1125. package/es/ts-types/list-table/define/multilinetext-define.js.map +1 -0
  1126. package/es/ts-types/list-table/define/progressbar-define.d.ts +11 -0
  1127. package/es/ts-types/list-table/define/progressbar-define.js +2 -0
  1128. package/es/ts-types/list-table/define/progressbar-define.js.map +1 -0
  1129. package/es/ts-types/list-table/define/sparkline-define.d.ts +10 -0
  1130. package/es/ts-types/list-table/define/sparkline-define.js +2 -0
  1131. package/es/ts-types/list-table/define/sparkline-define.js.map +1 -0
  1132. package/es/ts-types/list-table/index.d.ts +2 -0
  1133. package/es/ts-types/list-table/index.js +4 -0
  1134. package/es/ts-types/list-table/index.js.map +1 -0
  1135. package/es/ts-types/list-table/layout-map/api.d.ts +92 -0
  1136. package/es/ts-types/list-table/layout-map/api.js +2 -0
  1137. package/es/ts-types/list-table/layout-map/api.js.map +1 -0
  1138. package/es/ts-types/list-table/layout-map/index.d.ts +1 -0
  1139. package/es/ts-types/list-table/layout-map/index.js +2 -0
  1140. package/es/ts-types/list-table/layout-map/index.js.map +1 -0
  1141. package/es/ts-types/menu.d.ts +73 -0
  1142. package/es/ts-types/menu.js +2 -0
  1143. package/es/ts-types/menu.js.map +1 -0
  1144. package/es/ts-types/new-data-set.d.ts +95 -0
  1145. package/es/ts-types/new-data-set.js +13 -0
  1146. package/es/ts-types/new-data-set.js.map +1 -0
  1147. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.d.ts +6 -0
  1148. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js +9 -0
  1149. package/es/ts-types/pivot-table/PIVOT_TABLE_EVENT_TYPE.js.map +1 -0
  1150. package/es/ts-types/pivot-table/corner.d.ts +19 -0
  1151. package/es/ts-types/pivot-table/corner.js +2 -0
  1152. package/es/ts-types/pivot-table/corner.js.map +1 -0
  1153. package/es/ts-types/pivot-table/dimension/basic-dimension.d.ts +25 -0
  1154. package/es/ts-types/pivot-table/dimension/basic-dimension.js +2 -0
  1155. package/es/ts-types/pivot-table/dimension/basic-dimension.js.map +1 -0
  1156. package/es/ts-types/pivot-table/dimension/image-dimension.d.ts +9 -0
  1157. package/es/ts-types/pivot-table/dimension/image-dimension.js +2 -0
  1158. package/es/ts-types/pivot-table/dimension/image-dimension.js.map +1 -0
  1159. package/es/ts-types/pivot-table/dimension/index.d.ts +4 -0
  1160. package/es/ts-types/pivot-table/dimension/index.js +2 -0
  1161. package/es/ts-types/pivot-table/dimension/index.js.map +1 -0
  1162. package/es/ts-types/pivot-table/dimension/link-dimension.d.ts +10 -0
  1163. package/es/ts-types/pivot-table/dimension/link-dimension.js +2 -0
  1164. package/es/ts-types/pivot-table/dimension/link-dimension.js.map +1 -0
  1165. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.d.ts +7 -0
  1166. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.js +2 -0
  1167. package/es/ts-types/pivot-table/dimension/multilinetext-dimension.js.map +1 -0
  1168. package/es/ts-types/pivot-table/index.d.ts +4 -0
  1169. package/es/ts-types/pivot-table/index.js +8 -0
  1170. package/es/ts-types/pivot-table/index.js.map +1 -0
  1171. package/es/ts-types/pivot-table/indicator/basic-indicator.d.ts +26 -0
  1172. package/es/ts-types/pivot-table/indicator/basic-indicator.js +2 -0
  1173. package/es/ts-types/pivot-table/indicator/basic-indicator.js.map +1 -0
  1174. package/es/ts-types/pivot-table/indicator/chart-indicator.d.ts +10 -0
  1175. package/es/ts-types/pivot-table/indicator/chart-indicator.js +2 -0
  1176. package/es/ts-types/pivot-table/indicator/chart-indicator.js.map +1 -0
  1177. package/es/ts-types/pivot-table/indicator/image-indicator.d.ts +15 -0
  1178. package/es/ts-types/pivot-table/indicator/image-indicator.js +2 -0
  1179. package/es/ts-types/pivot-table/indicator/image-indicator.js.map +1 -0
  1180. package/es/ts-types/pivot-table/indicator/index.d.ts +10 -0
  1181. package/es/ts-types/pivot-table/indicator/index.js +2 -0
  1182. package/es/ts-types/pivot-table/indicator/index.js.map +1 -0
  1183. package/es/ts-types/pivot-table/indicator/link-indicator.d.ts +17 -0
  1184. package/es/ts-types/pivot-table/indicator/link-indicator.js +2 -0
  1185. package/es/ts-types/pivot-table/indicator/link-indicator.js.map +1 -0
  1186. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.d.ts +11 -0
  1187. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.js +2 -0
  1188. package/es/ts-types/pivot-table/indicator/multilinetext-indicator.js.map +1 -0
  1189. package/es/ts-types/pivot-table/indicator/progress-indicator.d.ts +11 -0
  1190. package/es/ts-types/pivot-table/indicator/progress-indicator.js +2 -0
  1191. package/es/ts-types/pivot-table/indicator/progress-indicator.js.map +1 -0
  1192. package/es/ts-types/pivot-table/indicator/sparkline-indicator.d.ts +10 -0
  1193. package/es/ts-types/pivot-table/indicator/sparkline-indicator.js +2 -0
  1194. package/es/ts-types/pivot-table/indicator/sparkline-indicator.js.map +1 -0
  1195. package/es/ts-types/pivot-table/title.d.ts +18 -0
  1196. package/es/ts-types/pivot-table/title.js +2 -0
  1197. package/es/ts-types/pivot-table/title.js.map +1 -0
  1198. package/es/ts-types/style-define.d.ts +60 -0
  1199. package/es/ts-types/style-define.js +2 -0
  1200. package/es/ts-types/style-define.js.map +1 -0
  1201. package/es/ts-types/table-engine.d.ts +169 -0
  1202. package/es/ts-types/table-engine.js +12 -0
  1203. package/es/ts-types/table-engine.js.map +1 -0
  1204. package/es/ts-types/theme.d.ts +88 -0
  1205. package/es/ts-types/theme.js +2 -0
  1206. package/es/ts-types/theme.js.map +1 -0
  1207. package/es/ts-types/tooltip.d.ts +22 -0
  1208. package/es/ts-types/tooltip.js +2 -0
  1209. package/es/ts-types/tooltip.js.map +1 -0
  1210. package/package.json +95 -0
@@ -0,0 +1,17 @@
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).VTable={})}(this,(function(t){"use strict";var e,n,i,r,o,a,s;!function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(e||(e={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none"}(n||(n={})),function(t){t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT"}(i||(i={})),function(t){t.ASC="ASC",t.DESC="DESC"}(r||(r={})),function(t){t.inlineFront="inlineFront",t.inlineEnd="inlineEnd",t.left="left",t.right="right",t.absoluteRight="absoluteRight",t.contentLeft="contentLeft",t.contentRight="contentRight",t.absolute="absolute"}(o||(o={})),function(t){t.pin="pin",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp"}(a||(a={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.pinIconName="pin",t.pinedIconName="pined",t.pinedHoverIconName="pined_hover",t.pinedCurrentIconName="pinedCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse"}(s||(s={}));var l=Object.freeze({__proto__:null,get AggregationType(){return i},get HierarchyState(){return n},get IconFuncTypeEnum(){return a},get IconPosition(){return o},get InternalIconName(){return s},get Placement(){return e},get SortType(){return r}});const u=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e,h=t=>u(t,"object"),c=t=>u(t,"function"),d=t=>u(t,"string"),f=t=>u(t,"number"),p=t=>u(t,"undefined"),v=t=>u(t,"null");function g(t,...e){if(!e.length)return t||{};const n=e.shift();if(h(t)&&h(n))for(const e in n)h(n[e])?(t[e]||Object.assign(t,{[e]:{}}),h(t[e])||Object.assign(t,{[e]:n[e]}),g(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return g(t,...e)}function y(t){if(!t)return t;let e;if([Number,String,Boolean].forEach((function(n){t instanceof n&&(e=n(t))})),void 0===e)if("[object Array]"===Object.prototype.toString.call(t))e=[],t.forEach((function(t,n){e[n]=y(t)}));else if("object"==typeof t)if(t.nodeType&&"function"==typeof t.cloneNode)e=t.cloneNode(!0);else if(t.prototype)e=t.constructor?new t.constructor:t;else if(t instanceof Date)e=new Date(t);else if(t.clone)e=t.clone();else{e={};for(const n in t)e[n]=y(t[n])}else e=t;return e}function m(t){return"function"==typeof t&&(t=t()),_(t)?`${t}`:""}function b(t){if(t?.length<=0)return t;const e=t.length,n=t[0].length,i=new Array(n);for(let r=0;r<e;r++)for(let o=0;o<n;o++)i[o]||(i[o]=new Array(e)),i[o][r]=t[r][o];return i}function w(t,e){let n=null;return function(...i){n||(t.apply(this,i),n=setTimeout((()=>{n=null}),e)),console.log("throttle")}}function x(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function C(t,e,n){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const i=Math.round(256*e)*(n?-1:1),r=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),o=r&&_(r[4])?r[4]:null,a=r?[r[1],r[2],r[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return r?`rgb${null!==o?"a":""}(${Math[n?"max":"min"](parseInt(a[0],10)+i,n?0:255)}, ${Math[n?"max":"min"](parseInt(a[1],10)+i,n?0:255)}, ${Math[n?"max":"min"](parseInt(a[2],10)+i,n?0:255)}${null!==o?`, ${o}`:""})`:["#",x(Math[n?"max":"min"](parseInt(a[0],10)+i,n?0:255).toString(16),2),x(Math[n?"max":"min"](parseInt(a[1],10)+i,n?0:255).toString(16),2),x(Math[n?"max":"min"](parseInt(a[2],10)+i,n?0:255).toString(16),2)].join("")}function _(t){return!p(t)&&!v(t)}function k(t){return p(t)||v(t)?"":t.toString()}function S(){return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}function A(t,e,n){return"desc"!==n?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}let B,R=1,T=class{listenersData={listeners:{},listenerData:{}};listen(t,e){const n=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);n.push(e);const i=R++;return this.listenersData.listenerData[i]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[i];const r=n.indexOf(e);n.splice(r,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},i}unlisten(t){this.listenersData&&this.listenersData.listenerData[t].remove()}addEventListener(t,e,n){this.listen(t,e)}removeEventListener(t,e){if(this.listenersData)for(const n in this.listenersData.listenerData){const i=this.listenersData.listenerData[n];i.type===t&&i.listener===e&&this.unlisten(n)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,...e){if(!this.listenersData)return[];const n=this.listenersData.listeners[t];return n?n.map((t=>t.call(this,...e))).filter((t=>_(t))):[]}dispose(){delete this.listenersData}};const M={CHANGE_STYLE:"change_style"};let P,O,E=class t extends T{_color;_fontSize;_fontFamily;_fontWeight;_fontVariant;_fontStyle;_padding;_defaultPadding=[10,16,10,16];_textOverflow;_textAlign;_textBaseline;_bgColor;_borderColor;_lineHeight;_underline;_underlineColor;_underlineDash;_lineThrough;_lineThroughColor;_lineThroughDash;_linkColor;_cursor;_borderLineWidth;_borderLineDash;_marked;static get EVENT_TYPE(){return M}static get DEFAULT(){return B||(B=new t)}constructor(t={},e={}){super(),this._textAlign=t?.textAlign??e?.textAlign,this._textBaseline=t?.textBaseline??e?.textBaseline,this._color=t?.color??e?.color,this._fontSize=t.fontSize??e?.fontSize,this._fontFamily=t.fontFamily??e?.fontFamily,this._fontWeight=t.fontWeight??e?.fontWeight,this._fontVariant=t.fontVariant??e?.fontVariant,this._fontStyle=t.fontStyle??e?.fontStyle,this._padding=t?.padding??e?.padding??this._defaultPadding,this._borderColor=t?.borderColor??e?.borderColor,this._textOverflow=t?.textOverflow??e?.textOverflow,this._bgColor=t?.bgColor??e?.bgColor,this._lineHeight=t?.lineHeight??e?.lineHeight,this._underline=t?.underline??e?.underline,this._underlineColor=t?.underlineColor??e?.underlineColor,this._underlineDash=t?.underlineDash??e?.underlineDash,this._lineThrough=t?.lineThrough??e?.lineThrough,this._lineThroughColor=t?.lineThroughColor??e?.lineThroughColor,this._lineThroughDash=t?.lineThroughDash??e?.lineThroughDash,this._linkColor=t?.linkColor??e?.linkColor,this._cursor=t.cursor??e?.cursor,this._borderLineWidth=t.borderLineWidth??e?.borderLineWidth,this._borderLineDash=t.borderLineDash??e?.borderLineDash,this._marked=t.marked??e?.marked}get color(){return this._color}set color(t){this._color=t,this.doChangeStyle()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.doChangeStyle()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.doChangeStyle()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.doChangeStyle()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.doChangeStyle()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this.doChangeStyle()}get padding(){return this._padding}set padding(t){this._padding=t,this.doChangeStyle()}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t,this.doChangeStyle()}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t,this.doChangeStyle()}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this.doChangeStyle()}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.doChangeStyle()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.doChangeStyle()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.doChangeStyle()}get underline(){return this._underline}set underline(t){this._underline=t,this.doChangeStyle()}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t,this.doChangeStyle()}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t,this.doChangeStyle()}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t,this.doChangeStyle()}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t,this.doChangeStyle()}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t,this.doChangeStyle()}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t,this.doChangeStyle()}get cursor(){return this._cursor}set cursor(t){this._cursor=t,this.doChangeStyle()}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t,this.doChangeStyle()}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t,this.doChangeStyle()}get marked(){return this._marked}set marked(t){this._marked=t,this.doChangeStyle()}doChangeStyle(){this.fireListeners(M.CHANGE_STYLE)}clone(){return new t(this,null)}},H=class t extends E{static get DEFAULT(){return P||(P=new t)}constructor(t={},e={}){super(t,e)}clone(){return new t(this,null)}};class L extends E{_autoWrapText;_lineClamp;static get DEFAULT(){return O||(O=new L)}constructor(t={},e={}){super(t,e),this._autoWrapText=t?.autoWrapText??e?.autoWrapText,this._lineClamp=t?.lineClamp??e?.lineClamp}clone(){return new L(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t,this.doChangeStyle()}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t,this.doChangeStyle()}}const{EVENT_TYPE:I}=E;function D(t,e,n,i=E,r){return t||e?t instanceof E?t:"function"==typeof t?D(t(n),e,n,i,r):(t||(t={}),r&&!_(t.autoWrapText)&&(t.autoWrapText=!0),new i(t??{},e??{})):i.DEFAULT}let j;const W={CHANGE_STYLE:"change_style"};class F extends T{_color;_fontSize;_fontFamily;_fontWeight;_fontVariant;_fontStyle;_textOverflow;_padding;_defaultPadding=[10,16,10,16];_textStick;_marked;_textAlign;_textBaseline;_bgColor;_borderColor;_lineHeight;_underline;_underlineColor;_underlineDash;_lineThrough;_lineThroughColor;_lineThroughDash;_linkColor;_cursor;_borderLineWidth;_borderLineDash;static get EVENT_TYPE(){return W}static get DEFAULT(){return j||(j=new F)}constructor(t={},e={}){super(),this._color=t.color??e?.color,this._fontSize=t.fontSize??e?.fontSize,this._fontFamily=t.fontFamily??e?.fontFamily,this._fontWeight=t.fontWeight??e?.fontWeight,this._fontVariant=t.fontVariant??e?.fontVariant,this._fontStyle=t.fontStyle??e?.fontStyle,this._textOverflow=(t.textOverflow??e?.textOverflow)||"ellipsis",this._textStick=t.textStick??e?.textStick??!1,this._marked=t.marked??e?.marked??!1,this._textAlign=(t.textAlign??e?.textAlign)||"left",this._textBaseline=(t.textBaseline??e?.textBaseline)||"middle",this._bgColor=t.bgColor??e?.bgColor,this._padding=t.padding??e?.padding??this._defaultPadding,this._borderColor=t.borderColor??e?.borderColor,this._lineHeight=t.lineHeight??e?.lineHeight,this._underline=t.underline??e?.underline,this._underlineColor=t.underlineColor??e?.underlineColor,this._underlineDash=t.underlineDash??e?.underlineDash,this._lineThrough=t.lineThrough??e?.lineThrough,this._lineThroughColor=t.lineThroughColor??e?.lineThroughColor,this._lineThroughDash=t.lineThroughDash??e?.lineThroughDash,this._linkColor=t.linkColor??e?.linkColor,this._cursor=t.cursor??e?.cursor,this._borderLineWidth=t.borderLineWidth??e?.borderLineWidth,this._borderLineDash=t.borderLineDash??e?.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t,this.doChangeStyle()}get color(){return this._color}set color(t){this._color=t,this.doChangeStyle()}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.doChangeStyle()}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t,this.doChangeStyle()}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t,this.doChangeStyle()}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t,this.doChangeStyle()}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t,this.doChangeStyle()}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t,this.doChangeStyle()}get padding(){return this._padding??this._defaultPadding}set padding(t){this._padding=t,this.doChangeStyle()}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this.doChangeStyle()}get textStick(){return this._textStick}set textStick(t){this._textStick=t,this.doChangeStyle()}get marked(){return this._marked}set marked(t){this._marked=t,this.doChangeStyle()}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.doChangeStyle()}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t,this.doChangeStyle()}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t,this.doChangeStyle()}get underline(){return this._underline}set underline(t){this._underline=t,this.doChangeStyle()}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t,this.doChangeStyle()}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t,this.doChangeStyle()}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t,this.doChangeStyle()}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t,this.doChangeStyle()}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t,this.doChangeStyle()}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t,this.doChangeStyle()}get cursor(){return this._cursor}set cursor(t){this._cursor=t,this.doChangeStyle()}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t,this.doChangeStyle()}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t,this.doChangeStyle()}doChangeStyle(){this.fireListeners(W.CHANGE_STYLE)}clone(){return new F(this)}}let z;class N extends F{_autoWrapText;_lineClamp;static get DEFAULT(){return z||(z=new N)}constructor(t={},e=null){super(t,e),this._autoWrapText=t?.autoWrapText??e?.autoWrapText,this._lineClamp=t?.lineClamp??e?.lineClamp}clone(){return new N(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t,this.doChangeStyle()}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t,this.doChangeStyle()}}function G(t,e,n,i,r){return t||e?t instanceof F?t:"function"==typeof t?G(t(n),e,n,i,r):(t||(t={}),r&&!_(t.autoWrapText)&&(t.autoWrapText=!0),new i(t??{},e??{})):i.DEFAULT}function U(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}function V(t){return t?.hoverOn||"none"===t?.visible?0:t?.width??7}U(".vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n");const K="undefined"==typeof window||void 0===window.window;let Y,X;const $={get find(){return Y||(Y=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const n=$.findIndex(t,e);return n>=0?t[n]:void 0},Y)},get findIndex(){return X||(X=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:n}=t;for(let i=0;i<n;i++){if(e(t[i],i,t))return i}return-1},X)}};const{IE:q,Chrome:Z,Firefox:J,Edge:Q,Safari:et}=function(){if(K)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(t),Edge:t.indexOf("edge")>-1,Chrome:t.indexOf("chrome")>-1&&-1===t.indexOf("edge"),Firefox:t.indexOf("firefox")>-1,Safari:t.indexOf("safari")>-1&&-1===t.indexOf("edge")}}();function nt(...t){const e={};return t.forEach((t=>{for(const n in t)Object.defineProperty(e,n,{get:()=>t[n],set(e){t[n]=e},configurable:!0,enumerable:!0})})),e}function it(t,e,...n){let i=t;for(let t=0;t<n.length&&null!=i;t++)i=e(i,n[t]);return i}function rt(t,...e){return it(t,((t,e)=>t[e]),...e)}function ot(t,...e){return"function"==typeof t?t(...e):t}function at(t){return Boolean(t&&"function"==typeof t.then)}function st(t,e,n){return t.start.col<=e&&e<=t.end.col&&t.start.row<=n&&n<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=n&&n<=t.start.row}function lt(t){return{start:{col:Math.min(t.start.col,t.end.col),row:Math.min(t.start.row,t.end.row)},end:{col:Math.max(t.start.col,t.end.col),row:Math.max(t.start.row,t.end.row)}}}function ut(t,e){const n=lt(t),i=lt(e);if(Math.max(n.start.col,i.start.col)<=Math.min(n.end.col,i.end.col)){if(Math.max(n.start.row,i.start.row)<=Math.min(n.end.row,i.end.row))return!0}return!1}const ht=q,ct={isObject:function(t){return t===Object(t)}},dt={endsWith:function(t,e,n){const i=k(t);("number"!=typeof n||!isFinite(n)||Math.floor(n)!==n||n>i.length)&&(n=i.length),n-=e.length;const r=i.lastIndexOf(e,n);return-1!==r&&r===n}},ft={isTouchEvent:function(t){return!!t.changedTouches}},pt={toBoxArray:function(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}},vt=Function.prototype;const gt={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",CHANGE_HEADER_POSITION:"change_header_position",SORT_CLICK:"sort_click",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",DROPDOWNMENU_CLICK:"dropdownmenu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click"},yt=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function mt(t,e,n){let i,r,o,a,s,l,u=0,h=!1,c=!1,d=!0;const f=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const n=i,o=r;return r=void 0,i=void 0,u=e,a=t.apply(o,n),a}function v(t,e){return f?requestAnimationFrame(t):setTimeout(t,e)}function g(t){const n=t-l;return void 0===l||n>=e||n<0||h&&t-u>=o}function y(){const t=Date.now();if(g(t))return function(t){return s=void 0,d&&i?p(t):(r=void 0,i=void 0,a)}(t);s=v(y,function(t){const n=t-u,i=e&&-(t-l);return h?Math.min(i,o-n):i}(t))}return e=+e||0,yt(n,"object")&&(c=!!n.leading,h="maxWait"in n,h&&(o=Math.max(+n.maxWait||0,e)),d="trailing"in n?!!n.trailing:d),function(...t){const n=Date.now(),o=g(n);if(i=t,r=this,l=n,o){if(void 0===s)return function(t){return u=t,s=v(y,e),c?p(t):a}(l);if(h)return s=v(y,e),p(l)}return void 0===s&&(s=v(y,e)),a}}class bt{static _mode;static get mode(){return bt._mode||(bt._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),bt._mode}static set mode(t){bt._mode=t}static dpr=0;static CreateCanvas;static LoadImage;static RequestAnimationFrame;static CancelAnimationFrame;static RegisterCreateCanvas(t){bt.CreateCanvas=t}static RegisterLoadImage(t){bt.LoadImage=t}static GetCreateCanvasFunc(){return bt.CreateCanvas?bt.CreateCanvas:"worker"===bt.mode?(t=200,e=200)=>new OffscreenCanvas(t,e):void 0}static RegisterRequestAnimationFrame(t){bt.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(bt.RequestAnimationFrame)return bt.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){bt.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(bt.CancelAnimationFrame)return bt.CancelAnimationFrame}}let wt=1;class xt{resizeTime=100;element;cb;observer;lastSize={width:0,height:0};callBackDebounce;constructor(t,e,n){if(this.element=t,this.cb=e,this.lastSize=this.getSize(),n&&(this.resizeTime=Math.max(n,16)),this.callBackDebounce=mt(this.callBack,this.resizeTime),window?.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),this.observer?.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}mutationResize=()=>{this.onResize()};disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}callBack=()=>{const t=this.getSize();t.width===this.lastSize.width&&t.height===this.lastSize.height||(this.lastSize=t,this.cb&&this.cb({...this.lastSize}))};setSize(t){this.lastSize=t}onResize=()=>{this.checkSize()&&this.callBackDebounce()};checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:{...this.lastSize}}}class Ct{listeners={};reseizeListeners={};on(t,e,n,...i){if("node"===bt.mode)return-1;const r=wt++;if(t?.addEventListener)if("resize"!==e||t===window)t?.addEventListener(e,n,...i);else{const e=new xt(t,n);this.reseizeListeners[r]=e}const o={target:t,type:e,listener:n,options:i};return this.listeners[r]=o,r}once(t,e,n,...i){if("node"===bt.mode)return-1;const r=this.on(t,e,((...t)=>{this.off(r),n(...t)}),...i);return r}off(t){if("node"===bt.mode)return;if(null==t)return;const e=this.listeners[t];e&&(delete this.listeners[t],e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options))}fire(t,e,...n){if("node"!==bt.mode)for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&r.listener.call(r.target,...n)}}hasListener(t,e){if("node"===bt.mode)return!1;let n=!1;for(const i in this.listeners){const r=this.listeners[i];r.target===t&&r.type===e&&(n=!0)}return n}clear(){if("node"!==bt.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}this.listeners={}}}dispose(){"node"!==bt.mode&&(this.clear(),this.listeners=null)}}const _t=(t,e)=>{let n=0,i=t.length-1;for(;n<=i;){const r=Math.floor((n+i)/2);if(t[r]===e)return r;t[r]>e?i=r-1:n=r+1}return i<0?0:i};class kt{_keys=[];_vals={};_sorted=!1;count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,n){const{_keys:i}=this;if(this._sorted||(i.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const r=[];for(let o=_t(i,t+n-1);o>=0;o--){const a=i[o];if(a>=t)r.push(this.get(a));else if(e<=a&&a<t)this.put(a+n,this.get(a));else if(a<e)break}for(let t=0;t<n;t++)this.put(e+t,r[n-1-t])}const{length:r}=i;if(t<e){const o=[];for(let a=_t(i,t);a<r;a++){const r=i[a];if(r>=t&&r<t+n)o.push(this.get(r));else if(t+n<=r&&r<=e)this.put(r-n,this.get(r));else if(r>e)break}for(let t=0;t<n;t++)this.put(e+t,o[t])}}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return _(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,n){const{_keys:i}=this,{length:r}=i;this._sorted||(i.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let o=_t(i,t);o<r;o++){const r=i[o];if(t<=r&&r<=e){if(!1===n(this.get(r),r))break}else if(e<r)return}}}var St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function At(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bt={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,a=new Array(o);r<o;r++)a[r]=i[r].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var l,u,h=this._events[s],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,o),!0;case 6:return h.fn.call(h.context,e,i,r,o,a),!0}for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var d,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),c){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,i);break;case 4:h[u].fn.call(h[u].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];h[u].fn.apply(h[u].context,l)}}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,i,r){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||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,u=[],h=s.length;l<h;l++)(s[l].fn!==e||r&&!s[l].once||i&&s[l].context!==i)&&u.push(s[l]);u.length?this._events[o]=1===u.length?u[0]:u: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 i,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}(Bt);var Rt=At(Bt.exports),Tt=function(t,e){return toString.call(t)==="[object ".concat(e,"]")},Mt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Tt(t,"Boolean")},Pt=function(t){return"function"==typeof t},Ot=function(t){return null==t},Et=function(t){return null!=t};function Ht(t){return Ht="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},Ht(t)}var Lt=function(t){var e=Ht(t);return null!==t&&"object"===e||"function"===e},It=function(t){if(!function(t){return"object"==Ht(t)&&null!==t}(t)||!Tt(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},Dt=function(t){return void 0===t},jt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"string"===n:"string"===n||Tt(t,"String")},Wt=function(t){return Array.isArray?Array.isArray(t):Tt(t,"Array")},Ft=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},zt=function(t){return Tt(t,"Date")},Nt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Ht(t);return e?"number"===n:"number"===n||Tt(t,"Number")},Gt=function(t){return Nt(t)&&Number.isFinite(t)},Ut=Object.prototype,Vt=Object.prototype.hasOwnProperty;function Kt(t){if(Ot(t))return!0;if(Ft(t))return!t.length;var e=function(t){return{}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")}(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ut)}(t))return!Object.keys(t).length;for(var n in t)if(Vt.call(t,n))return!1;return!0}var Yt=function(t,e,n){for(var i=jt(e)?e.split("."):e,r=0;r<i.length;r++)t=t?t[i[r]]:void 0;return void 0===t?n:t},Xt=Object.prototype.hasOwnProperty,$t=function(t,e){return null!=t&&Xt.call(t,e)};function qt(t){var e;if(!Et(t)||"object"!=Ht(t))return t;var n=Wt(t),i=t.length;e=n?new Array(i):"object"==Ht(t)?{}:Mt(t)||Nt(t)||jt(t)?t:zt(t)?new Date(+t):void 0;var r=n?void 0:Object.keys(Object(t)),o=-1;if(e)for(;++o<(r||t).length;){var a=r?r[o]:o,s=t[a];e[a]=qt(s)}return e}function Zt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(Et(e)&&"object"==Ht(e)){var i=Object(e),r=[];for(var o in i)r.push(o);for(var a=r.length,s=-1;a--;){var l=r[++s];Et(i[l])&&"object"==Ht(i[l])?Jt(t,e,l,n):Qt(t,l,i[l])}}}}function Jt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[n],o=e[n],a=e[n],s=!0;if(Wt(o)){if(i)a=[];else if(Wt(r))a=r;else if(Ft(r)){a=new Array(r.length);for(var l=-1,u=r.length;++l<u;)a[l]=r[l]}}else It(o)?(a=r,"function"!=typeof r&&"object"==Ht(r)||(a={})):s=!1;s&&Zt(a,o,i),Qt(t,n,a)}function Qt(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function te(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)Zt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}Object.prototype.hasOwnProperty;function ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function ne(t,e){if(t){if("string"==typeof t)return ee(t,e);var n=Object.prototype.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)?ee(t,e):void 0}}function ie(t){return function(t){if(Array.isArray(t))return ee(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ne(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 re(t){return Et(t)?Wt(t)?t:[t]:[]}function oe(t,e){if(!Wt(t)||!Wt(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function ae(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function se(t){return Number(t)}function le(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;for(Ot(i)&&(i=t.length);n<i;){var r=n+i>>>1;ae(t[r],e)>0?i=r:n=r+1}return n}Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var ue=1e-10,he=1e-10;function ce(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ue,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:he)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}function de(t,e,n,i){return t>e&&!ce(t,e,n,i)}function fe(t,e,n,i){return t<e&&!ce(t,e,n,i)}var pe=function(t,e,n){return t<e?e:t>n?n:t};function ve(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 i,r,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(t,e)||ne(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 ge=function(t,e,n){var i=ve(t,2),r=i[0],o=i[1];o<r&&(r=t[1],o=t[0]);var a=o-r;return a>=n-e?[e,n]:[r=Math.min(Math.max(r,e),n-a),r+a]};function ye(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}var me=!1;try{me="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){me=!1}function be(t,e,n){var i,r,o,a,s,l,u=0,h=!1,c=!1,d=!0,f=!e&&0!==e&&me;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=i,o=r;return i=r=void 0,u=e,a=t.apply(o,n)}function v(t,e){return f?(cancelAnimationFrame(s),requestAnimationFrame(t)):setTimeout(t,e)}function g(t){var n=t-l;return void 0===l||n>=e||n<0||c&&t-u>=o}function y(){var t=Date.now();if(g(t))return m(t);s=v(y,function(t){var n=t-u,i=e-(t-l);return c?Math.min(i,o-n):i}(t))}function m(t){return s=void 0,d&&i?p(t):(i=r=void 0,a)}function b(){for(var t=Date.now(),n=g(t),o=arguments.length,d=new Array(o),f=0;f<o;f++)d[f]=arguments[f];if(i=d,r=this,l=t,n){if(void 0===s)return function(t){return u=t,s=v(y,e),h?p(t):a}(l);if(c)return s=v(y,e),p(l)}return void 0===s&&(s=v(y,e)),a}return e=+e||0,Lt(n)&&(h=!!n.leading,(c="maxWait"in n)&&(o=Math.max(Gt(n.maxWait)?n.maxWait:0,e)),d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==s&&function(t){if(f)return cancelAnimationFrame(t);clearTimeout(t)}(s),u=0,i=l=r=s=void 0},b.flush=function(){return void 0===s?a:m(Date.now())},b.pending=function(){return void 0!==s},b}function we(t,e){return function(n){return t*(1-n)+e*n}}function xe(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}me=!1;var Ce=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;new RegExp(Ce.source,"g");function _e(t){var e=function(t,e){if("object"!==Ht(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==Ht(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ht(e)?e:String(e)}function ke(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,_e(i.key),i)}}function Se(t,e,n){return e&&ke(t.prototype,e),n&&ke(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Be=1e-12,Re=Math.PI,Te=Re/2,Me=2*Re,Pe=2*Math.PI,Oe=Math.abs,Ee=Math.atan2,He=Math.cos,Le=Math.max,Ie=Math.min,De=Math.sin,je=Math.sqrt,We=Math.pow;function Fe(t){return t>1?0:t<-1?Re:Math.acos(t)}function ze(t){return t>=1?Te:t<=-1?-Te:Math.asin(t)}function Ne(t,e,n,i,r){var o,a;return"number"==typeof t&&"number"==typeof n&&(o=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(a=(1-r)*e+r*i),{x:o,y:a}}var Ge=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;Ae(this,t),this.x=0,this.y=0,this.x=e,this.y=n,this.x1=i,this.y1=r}return Se(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return Nt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return Nt(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}]),t}(),Ue=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"distancePP",value:function(t,e){return je(We(t.x-e.x,2)+We(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,n,i){return je(We(t-n,2)+We(e-i,2))}},{key:"distancePN",value:function(t,e,n){return je(We(e-t.x,2)+We(n-t.y,2))}},{key:"pointAtPP",value:function(t,e,n){return new Ge((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}]),t}();function Ve(t,e){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ve(t,e)}function Ke(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&&Ve(t,e)}function Ye(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(t,e){if(e&&("object"===Ht(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ye(t)}function $e(t){return $e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$e(t)}function qe(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function Ze(t,e,n){var i=e.x1,r=e.y1,o=e.x2,a=e.y2;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*o+n.c*r+n.e,n.b*o+n.d*r+n.f),t.add(n.a*o+n.c*a+n.e,n.b*o+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}var Je=function(){function t(e){Ae(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return Se(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Wt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return Ze(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,o=this.x2,a=this.y2,s=Math.cos(t),l=Math.sin(t),u=e-e*s+n*l,h=n-e*l-n*s;return[s*i-l*r+u,l*i+s*r+h,s*i-l*a+u,l*i+s*a+h,s*o-l*r+u,l*o+s*r+h,s*o-l*a+u,l*o+s*a+h]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}]),t}(),Qe=function(t){Ke(n,t);var e=qe(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Je);function tn(t){return t*(Math.PI/180)}function en(t){return 180*t/Math.PI}var nn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Me;)t+=Me;else if(t>0)for(;t>Me;)t-=Me;return t};function rn(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}function on(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var an=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;Ae(this,t),this.a=e,this.b=n,this.c=i,this.d=r,this.e=o,this.f=a}return Se(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,n,i,r,o){return!(this.e!==r||this.f!==o||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}},{key:"setValue",value:function(t,e,n,i,r,o){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=o,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,n=this.b,i=this.c,r=this.d,o=this.e,a=this.f,s=new t,l=e*r-n*i;return s.a=r/l,s.b=-n/l,s.c=-i/l,s.d=e/l,s.e=(i*a-r*o)/l,s.f=-(e*a-n*o)/l,s}},{key:"rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,o=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=o,this.d=a,this}},{key:"rotateByCenter",value:function(t,e,n){var i=Math.cos(t),r=Math.sin(t),o=(1-i)*e+r*n,a=(1-i)*n-r*e,s=i*this.a-r*this.b,l=r*this.a+i*this.b,u=i*this.c-r*this.d,h=r*this.c+i*this.d,c=i*this.e-r*this.f+o,d=r*this.e+i*this.f+a;return this.a=s,this.b=l,this.c=u,this.d=h,this.e=c,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,n,i,r,o){return this.multiply(t,e,n,i,r,o),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=o,this.f=r,this}},{key:"multiply",value:function(t,e,n,i,r,o){var a=this.a,s=this.b,l=this.c,u=this.d,h=a*t+l*e,c=s*t+u*e,d=a*n+l*i,f=s*n+u*i,p=a*r+l*o+this.e,v=s*r+u*o+this.f;return this.a=h,this.b=c,this.c=d,this.d=f,this.e=p,this.f=v,this}},{key:"interpolate",value:function(e,n){var i=new t;return i.a=this.a+(e.a-this.a)*n,i.b=this.b+(e.b-this.b)*n,i.c=this.c+(e.c-this.c)*n,i.d=this.d+(e.d-this.d)*n,i.e=this.e+(e.e-this.e)*n,i.f=this.f+(e.f-this.f)*n,i}},{key:"transformPoint",value:function(t,e){var n=this.a,i=this.b,r=this.c,o=this.d,a=this.e,s=this.f,l=n*o-i*r,u=o/l,h=-i/l,c=-r/l,d=n/l,f=(r*s-o*a)/l,p=-(n*s-i*a)/l,v=t.x,g=t.y;e.x=v*u+g*c+f,e.y=v*h+g*d+p}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,o={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var a=Math.sqrt(t*t+e*e);o.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),o.scaleX=a,o.scaleY=r/a,o.skewX=(t*n+e*i)/r,o.skewY=0}else if(0!==n||0!==i){var s=Math.sqrt(n*n+i*i);o.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/s):-Math.acos(n/s)),o.scaleX=r/s,o.scaleY=s,o.skewX=0,o.skewY=(t*n+e*i)/r}return o.rotateDeg=en(o.rotateDeg),o}}]),t}();var sn=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"clearCache",value:function(e,n){var i=n.CLEAN_THRESHOLD,r=void 0===i?t.CLEAN_THRESHOLD:i,o=n.L_TIME,a=void 0===o?t.L_TIME:o,s=n.R_COUNT,l=void 0===s?t.R_COUNT:s;if(e.size<r)return 0;var u=0,h=function(t){u++,e.delete(t)},c=Date.now();return e.forEach((function(t,e){if(t.timestamp.length<l)return h(e);for(var n=0;c-t.timestamp[t.timestamp.length-1-n]<a&&!(++n>=l););if(n<l)return h(e);for(;c-t.timestamp[0]>a;)t.timestamp.shift()})),u}},{key:"addLimitedTimestamp",value:function(e,n,i){var r=i.R_TIMESTAMP_MAX_SIZE,o=void 0===r?t.R_TIMESTAMP_MAX_SIZE:r;e.timestamp.length>o&&e.timestamp.shift(),e.timestamp.push(n)}},{key:"clearTimeStamp",value:function(e,n){var i=n.L_TIME,r=void 0===i?t.L_TIME:i,o=Date.now();e.forEach((function(t){for(;o-t.timestamp[0]>r;)t.timestamp.shift()}))}},{key:"clearItemTimestamp",value:function(e,n){for(var i=n.L_TIME,r=void 0===i?t.L_TIME:i,o=Date.now();o-e.timestamp[0]>r;)e.timestamp.shift()}}]),t}();function ln(t,e,n){e/=100,n/=100;var i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),o=n-i/2,a=0,s=0,l=0;return 0<=t&&t<60?(a=i,s=r,l=0):60<=t&&t<120?(a=r,s=i,l=0):120<=t&&t<180?(a=0,s=i,l=r):180<=t&&t<240?(a=0,s=r,l=i):240<=t&&t<300?(a=r,s=0,l=i):300<=t&&t<360&&(a=i,s=0,l=r),{r:a=Math.round(255*(a+o)),g:s=Math.round(255*(s+o)),b:l=Math.round(255*(l+o))}}function un(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,e,n),r=Math.max(t,e,n),o=r-i,a=0,s=0;return a=0===o?0:r===t?(e-n)/o%6:r===e?(n-t)/o+2:(t-e)/o+4,(a=Math.round(60*a))<0&&(a+=360),s=(r+i)/2,{h:a,s:+(100*(0===o?0:o/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}sn.CLEAN_THRESHOLD=1e3,sn.L_TIME=1e3,sn.R_COUNT=1,sn.R_TIMESTAMP_MAX_SIZE=20;var hn=/^#([0-9a-f]{3,8})$/,cn={transparent:4294967040},dn={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 fn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function pn(t){return Nt(t)?new gn(t>>16,t>>8&255,255&t,1):Wt(t)?new gn(t[0],t[1],t[2]):new gn(255,255,255)}var vn=function(){function t(e){Ae(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new gn(255,255,255))}return Se(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"brighter",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,n){var i=this.color.opacity,r=un(this.color.r,this.color.g,this.color.b),o=ln(Ot(t)?r.h:pe(t,0,360),Ot(e)?r.s:e>=0&&e<=1?100*e:e,Ot(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new gn(o.r,o.g,o.b,i),this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",i=e instanceof t?e:new t(e);switch(n){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}},{key:"parseColorString",value:function(t){if(Et(cn[t]))return function(t){return Nt(t)?new gn(t>>>24,t>>>16&255,t>>>8&255,255&t):Wt(t)?new gn(t[0],t[1],t[2],t[3]):new gn(255,255,255,1)}(cn[t]);if(Et(dn[t]))return pn(dn[t]);var e="".concat(t).trim().toLowerCase(),n=hn.exec(e);if(n){var i=parseInt(n[1],16),r=n[1].length;return 3===r?new gn((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?pn(i):8===r?new gn(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var o=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new gn(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10),parseFloat(o[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var a=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),s=ln(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10));return new gn(s.r,s.g,s.b,parseFloat(a[3]))}}}]),t}(),gn=function(){function t(e,n,i,r){Ae(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),Et(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}return Se(t,[{key:"formatHex",value:function(){return"#".concat(fn(this.r)+fn(this.g)+fn(this.b)+(1===this.opacity?"":fn(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=un(this.r,this.g,this.b),n=e.h,i=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(i,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}]),t}();function yn(t){for(var e="",n="",i="",r="#"===t[0]?1:0,o=r;o<t.length;o++)"#"!==t[o]&&(o<r+2?e+=t[o]:o<r+4?n+=t[o]:o<r+6&&(i+=t[o]));return[parseInt(e,16),parseInt(n,16),parseInt(i,16)]}function mn(t,e,n){return Number((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)}function bn(t,e){var n=t.r,i=e.r,r=t.g,o=e.g,a=t.b,s=e.b,l=t.opacity,u=e.opacity;return function(t){var e=Math.round(n*(1-t)+i*t),h=Math.round(r*(1-t)+o*t),c=Math.round(a*(1-t)+s*t);return new gn(e,h,c,l*(1-t)+u*t)}}var wn,xn,Cn,_n,kn,Sn,An,Bn,Rn;function Tn(t,e,n){var i,r,o,a;return!(t&&e&&(n?(wn=t.x1,xn=t.x2,Cn=t.y1,_n=t.y2,kn=e.x1,Sn=e.x2,An=e.y1,Bn=e.y2,wn>xn&&(i=[xn,wn],wn=i[0],xn=i[1]),Cn>_n&&(r=[_n,Cn],Cn=r[0],_n=r[1]),kn>Sn&&(o=[Sn,kn],kn=o[0],Sn=o[1]),An>Bn&&(a=[Bn,An],An=a[0],Bn=a[1]),wn>Sn||xn<kn||Cn>Bn||_n<An):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Rn||(Rn={}));var Mn=1e-8;function Pn(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;o<t.length;o++){var a=t[o];i+=On(r.x,r.y,a.x,a.y,e,n),r=a}var s=t[0];return En(r.x,s.x)&&En(r.y,s.y)||(i+=On(r.x,r.y,s.x,s.y,e,n)),0!==i}function On(t,e,n,i,r,o){if(o>e&&o>i||o<e&&o<i)return 0;if(i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;1!==a&&0!==a||(s=i<e?.5:-.5);var l=a*(n-t)+t;return l===r?1/0:l>r?s:0}function En(t,e){return Math.abs(t-e)<Mn}var Hn=function(t){var e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(i=(e&=1023)<<10|(n&=1023),i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};var Ln=function(){function t(e,n){Ae(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportCanopus=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=n?n:{},this.textSpec=this._initSpec(),Et(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=Et(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return Se(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(Ot(this._canvas)&&(Et(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),Ot(this._canvas)&&Et(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),Ot(this._context)&&Et(this._canvas)){var t=this._canvas.getContext("2d");Et(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,o=void 0===r?e.fontVariant:r,a=t.fontWeight,s=void 0===a?e.fontWeight:a,l=t.fontSize,u=void 0===l?e.fontSize:l,h=t.fontFamily;return(i?i+" ":"")+(o?o+" ":"")+(s?s+" ":"")+u+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!Ot(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,n,i=this._option.defaultFontParams,r=void 0===i?{}:i,o=this._userSpec,a=o.fontStyle,s=void 0===a?r.fontStyle:a,l=o.fontVariant,u=void 0===l?r.fontVariant:l,h=o.fontWeight,c=void 0===h?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":h,d=o.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,p=o.fontFamily,v=void 0===p?null!==(n=r.fontFamily)&&void 0!==n?n:"sans-serif":p,g=o.align,y=o.textAlign,m=void 0===y?null!=g?g:"center":y,b=o.baseline,w=o.textBaseline,x=void 0===w?null!=b?b:"middle":w,C=o.ellipsis,_=o.limit,k=o.lineHeight;return{fontStyle:s,fontVariant:u,fontFamily:v,fontSize:f,fontWeight:c,textAlign:m,textBaseline:x,ellipsis:C,limit:_,lineHeight:void 0===k?f:k}}},{key:"measure",value:function(t,e){switch(e){case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(Ot(t))return{width:0,height:0};if(Ot(this._option.getTextBounds)||!this._notSupportCanopus)return this.measureWithNaiveCanvas(t);var e,n=this.textSpec,i=n.fontFamily,r=n.fontSize,o=n.fontWeight,a=n.textAlign,s=n.textBaseline,l=n.ellipsis,u=n.limit,h=n.lineHeight;try{var c=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:o,textAlign:a,textBaseline:s,ellipsis:!!l,maxLineWidth:u||1/0,lineHeight:h});e={width:c.width(),height:c.height()}}catch(n){this._notSupportCanopus=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var e=this._context.measureText(t),n=this.textSpec,i=n.fontSize,r=n.lineHeight;return{width:e.width,height:null!=r?r:i}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var n={width:0,height:0},i=0;i<e.length;i++){var r=e[i],o=this._measureSpecialChar(r);Ot(o)&&t.NUMBERS_CHAR_SET.includes(r)&&(o=this._measureNumberChar()),Ot(o)&&["F","W"].includes(Hn(r))&&(o=this._measureFullSizeChar()),Ot(o)&&(o=this._measureLetterChar()),n.width+=o.width,n.height=Math.max(n.height,o.height)}return n}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e={width:0,height:0},n=this.textSpec,i=n.fontSize,r=n.lineHeight,o=0;o<t.length;o++){var a=t[o],s=["F","W"].includes(Hn(a))?1:.53;e.width+=s*i}return e.height=null!=r?r:i,e}},{key:"_measureReduce",value:function(t,e){var n=this.textSpec,i=n.fontSize,r=n.lineHeight,o={width:0,height:0};if(Ot(t))return o;if(Wt(t)){var a=t.filter(Et).map((function(t){return t.toString()}));return 0===a.length?o:1===a.length?e(a[0]):{width:a.reduce((function(t,n){return Math.max(t,e(n).width)}),0),height:a.length*((null!=r?r:i)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(Ot(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return Ot(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(Ot(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return Et(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){Et(this._canvas)&&(this._canvas=null),Et(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}]),t}();Ln.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Ln.NUMBERS_CHAR_SET="0123456789",Ln.FULL_SIZE_CHAR="字";function In(t){if(Gt(t))return[t,t,t,t];if(Wt(t)){var e=t.length;if(1===e){var n=t[0];return[n,n,n,n]}if(2===e){var i=ve(t,2),r=i[0],o=i[1];return[r,o,r,o]}if(3===e){var a=ve(t,3),s=a[0],l=a[1];return[s,l,a[2],l]}if(4===e)return t}if(Lt(t)){var u=t.top,h=void 0===u?0:u,c=t.right,d=void 0===c?0:c,f=t.bottom,p=void 0===f?0:f,v=t.left;return[h,d,p,void 0===v?0:v]}return[0,0,0,0]}let Dn=class t{bounds;constructor(t,e,n,i){this.bounds=new Je,this.bounds.set(t,e,t+n,e+i)}static bounds(e,n,i,r){return new t(e,n,Math.round(i-e),Math.round(r-n))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new t(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}};var jn={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:n}=t;return 1&e-n.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],roundCornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"#29364D",cellBorderColor:"#4284FF",cellBorderLineWidth:2}};var Wn={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:n}=t;return 1&e-n.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],roundCornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"}};var Fn={underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:n}=t;return 1&e-n.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],roundCornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"}};var zn={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:n}=t;return 1&e-n.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],roundCornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},menuStyle:{color:"#000",highlightColor:"#2E68CF",fontSize:12,fontFamily:"sans-serif",highlightFont:"12px sans-serif",hoverBgColor:"#EEE"},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,inlineColumnBgColor:"#CCE0FF",inlineRowBgColor:"#CCE0FF",cellBorderColor:"#0000ff"}};var Nn={underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:n}=t,{colCount:i,frozenColCount:r}=n,o="#ccc7c7",a="#ccc7c7";return r-1===e||i-1===e?[o,"#f2f2f2",a,null]:[o,null,a,null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:n}}=t;return n-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"#6FA8DC"}};const Gn={},Un=[],Vn=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,Kn="$$indicator$$";function Yn(t,e,n,i){return rt(t,...n)||rt(e,...n)||i&&rt(t,...i)||i&&rt(e,...i)}class Xn{internalTheme;_defaultStyle=null;_header=null;_cornerHeader=null;_rowHeader=null;_body=null;_scroll=null;_tooltip=null;_frameStyle=null;_columnResizer=null;_dragHeaderSplitLine=null;_frozenColumnLine=null;_selectionStyle=null;constructor(t,e){this.internalTheme={obj:t,superTheme:e}}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Yn(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Yn(t,e,["underlayBackgroundColor"])}get defaultStyle(){if(!this._defaultStyle){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.defaultStyle,t.defaultStyle);this._defaultStyle={get fontSize(){return n.fontSize??16},get fontFamily(){return n.fontFamily??"sans-serif"},get fontWeight(){return n.fontWeight},get fontVariant(){return n.fontVariant},get fontStyle(){return n.fontStyle},get bgColor(){return n.bgColor??"#FFF"},get color(){return n.color??"#000"},get borderColor(){return n.borderColor??"#000"},get borderLineWidth(){return n.borderLineWidth??1},get borderLineDash(){return n.borderLineDash??Un},get hover(){if(n.hover)return{get cellBgColor(){return n.hover?.cellBgColor??void 0},get inlineColumnBgColor(){return n.hover?.inlineColumnBgColor??(n.hover?.cellBgColor&&"string"==typeof n.hover?.cellBgColor?C(n.hover?.cellBgColor,.1,!1):void 0)??void 0},get inlineRowBgColor(){return n.hover?.inlineRowBgColor??(n.hover?.cellBgColor&&"string"==typeof n.hover?.cellBgColor?C(n.hover?.cellBgColor,.1,!1):void 0)??void 0}}},get padding(){return n.padding??[10,16,10,16]},get textAlign(){return n.textAlign??"left"},get textBaseline(){return n.textBaseline??"middle"},get textOverflow(){return n.textOverflow??"ellipsis"},get lineHeight(){return n.lineHeight},get autoWrapText(){return n.autoWrapText??!1},get lineClamp(){return n.lineClamp??"auto"},get linkColor(){return n.linkColor??"#3772ff"},get cursor(){return n.cursor??"auto"},get marked(){return n.marked??!1},get underline(){return n.underline??!1},get underlineColor(){return n.underlineColor},get underlineDash(){return n.underlineDash},get lineThrough(){return n.lineThrough??!1},get lineThroughColor(){return n.lineThroughColor},get lineThroughDash(){return n.lineThroughDash}}}return this._defaultStyle}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,n=g({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(n)}return this._header}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,n=g({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(n)}return this._cornerHeader}get rowHeaderStyle(){if(!this._rowHeader){const{obj:t,superTheme:e}=this.internalTheme,n=g({},this.defaultStyle,e.rowHeaderStyle,t.rowHeaderStyle);this._rowHeader=this.getStyle(n)}return this._rowHeader}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,n=g({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(n)}return this._body}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return n.borderColor},get borderLineWidth(){return n.borderLineWidth},get borderLineDash(){return n.borderLineDash},get shadowBlur(){return n.shadowBlur},get shadowColor(){return n.shadowColor},get shadowOffsetX(){return n.shadowOffsetX},get shadowOffsetY(){return n.shadowOffsetY},get roundCornerRadius(){return n.roundCornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){return n.scrollSliderColor??"#C0C0C0"},get scrollRailColor(){return n.scrollRailColor},get visible(){return n.visible??"scrolling"},get width(){return n.width??7},get hoverOn(){return n.hoverOn??!0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get font(){return n.font??"16px sans-serif"},get bgColor(){return n.bgColor??"#000"},get padding(){return n.padding??[6,8]},get color(){return n.color??"#FFF"}}}return this._tooltip}get columnResize(){if(!this._columnResizer){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.columnResize,t.columnResize);this._columnResizer={get lineColor(){return n.lineColor??"#416EFF"},get bgColor(){return n.bgColor??"#D9E2FF"},get lineWidth(){return n.lineWidth??1},get width(){return n.width??n.lineWidth+2}}}return this._columnResizer}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){return n.lineColor??"blue"},get lineWidth(){return n.lineWidth??2},get shadowBlockColor(){return n.shadowBlockColor??"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(n.shadow)return{get width(){return n.shadow?.width??24},get startColor(){return n.shadow?.startColor??"rgba(00, 24, 47, 0.06)"},get endColor(){return n.shadow?.endColor??"rgba(00, 24, 47, 0)"}}},get border(){if(n.border)return{get lineColor(){return n.border?.lineColor??"rgba(00, 24, 47, 0.06)"},get bgColor(){return n.border?.bgColor??n.border?.lineColor??"rgba(00, 24, 47, 0.06)"},get lineWidth(){return n.border?.lineWidth??4},get width(){return n.border?.width??n.border?.lineWidth??4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,n=g({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){return n?.cellBgColor??"rgba(0, 0, 255,0.1)"},get cellBorderColor(){return n?.cellBorderColor??"#3073f2"},get cellBorderLineWidth(){return n?.cellBorderLineWidth??2}}}return this._selectionStyle}hasProperty(t){const{obj:e,superTheme:n}=this.internalTheme;return $n(e,t)||$n(n,t)}extends(t){return new Xn(t,this)}getStyle(t){return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){return t.hover?.cellBgColor??void 0},get inlineColumnBgColor(){return t.hover?.inlineColumnBgColor??(t.hover?.cellBgColor&&"string"==typeof t.hover?.cellBgColor?C(t.hover?.cellBgColor,.1,!1):void 0)??void 0},get inlineRowBgColor(){return t.hover?.inlineRowBgColor??(t.hover?.cellBgColor&&"string"==typeof t.hover?.cellBgColor?C(t.hover?.cellBgColor,.1,!1):void 0)??void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){return t.frameStyle?.borderColor??void 0},get borderLineWidth(){return t.frameStyle?.borderLineWidth??void 0},get borderLineDash(){return t.frameStyle?.borderLineDash??void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){return t.underline??!1},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get lineThrough(){return t.lineThrough??!1},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function $n(t,e){if(t instanceof Xn)return t.hasProperty(e);let n=t;if(!n)return!1;for(let t=0;t<e.length;t++){if(n=n[e[t]],!n)return!1}return!!n}const qn=new Xn(jn,jn),Zn=new Xn(Wn,Wn),Jn=new Xn(Fn,Fn),Qn=new Xn(zn,zn),ti=new Xn(Nn,Nn),ei={DEFAULT:Qn,SIMPLIFY:ti,ARCO:Jn,DARK:qn,BRIGHT:Zn},ni={TableTheme:Xn};function ii(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const n=e.toLowerCase();if(t[n])return t[n];const i=e.toLowerCase();if(t[i])return t[i];for(const e in t)if(e.toLowerCase()===n)return t[e]}(ri(),t);return e?e instanceof Xn?e:new Xn(e,e):null}return t instanceof Xn?t:new Xn(t,t)}function ri(){return nt(ei,Gn)}var oi,ai={DARK:qn,BRIGHT:Zn,ARCO:Jn,DEFAULT:Qn,SIMPLIFY:ti,theme:ni,of:ii,get:ri},si=Object.freeze({__proto__:null,ARCO:Jn,BRIGHT:Zn,DARK:qn,DEFAULT:Qn,SIMPLIFY:ti,default:ai,get:ri,of:ii,theme:ni});!function(t){!function(e){var n="object"===Ht(St)?St:"object"===("undefined"==typeof self?"undefined":Ht(self))?self:"object"===Ht(this)?this:Function("return this;")(),i=r(t);function r(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===n.Reflect?n.Reflect=t:i=r(n.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,l={create:o?function(){return it(Object.create(null))}:a?function(){return it({__proto__:null})}:function(){return it({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),h="object"===("undefined"==typeof process?"undefined":Ht(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,d=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(h||"function"!=typeof WeakMap?nt():WeakMap);function p(t,e,n,i){if(L(n)){if(!U(t))throw new TypeError;if(!K(e))throw new TypeError;return k(t,e)}if(!U(t))throw new TypeError;if(!j(e))throw new TypeError;if(!j(i)&&!L(i)&&!I(i))throw new TypeError;return I(i)&&(i=void 0),S(t,e,n=G(n),i)}function v(t,e){function n(n,i){if(!j(n))throw new TypeError;if(!L(i)&&!Y(i))throw new TypeError;P(t,e,n,i)}return n}function g(t,e,n,i){if(!j(n))throw new TypeError;return L(i)||(i=G(i)),P(t,e,n,i)}function y(t,e,n){if(!j(e))throw new TypeError;return L(n)||(n=G(n)),B(t,e,n)}function m(t,e,n){if(!j(e))throw new TypeError;return L(n)||(n=G(n)),R(t,e,n)}function b(t,e,n){if(!j(e))throw new TypeError;return L(n)||(n=G(n)),T(t,e,n)}function w(t,e,n){if(!j(e))throw new TypeError;return L(n)||(n=G(n)),M(t,e,n)}function x(t,e){if(!j(t))throw new TypeError;return L(e)||(e=G(e)),O(t,e)}function C(t,e){if(!j(t))throw new TypeError;return L(e)||(e=G(e)),E(t,e)}function _(t,e,n){if(!j(e))throw new TypeError;L(n)||(n=G(n));var i=A(e,n,!1);if(L(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=f.get(e);return r.delete(n),r.size>0||f.delete(e),!0}function k(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!L(i)&&!I(i)){if(!K(i))throw new TypeError;e=i}}return e}function S(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=(0,t[r])(e,n,i);if(!L(o)&&!I(o)){if(!j(o))throw new TypeError;i=o}}return i}function A(t,e,n){var i=f.get(t);if(L(i)){if(!n)return;i=new c,f.set(t,i)}var r=i.get(e);if(L(r)){if(!n)return;r=new c,i.set(e,r)}return r}function B(t,e,n){if(R(t,e,n))return!0;var i=Q(e);return!I(i)&&B(t,i,n)}function R(t,e,n){var i=A(e,n,!1);return!L(i)&&z(i.has(t))}function T(t,e,n){if(R(t,e,n))return M(t,e,n);var i=Q(e);return I(i)?void 0:T(t,i,n)}function M(t,e,n){var i=A(e,n,!1);if(!L(i))return i.get(t)}function P(t,e,n,i){A(n,i,!0).set(t,e)}function O(t,e){var n=E(t,e),i=Q(t);if(null===i)return n;var r=O(i,e);if(r.length<=0)return n;if(n.length<=0)return r;for(var o=new d,a=[],s=0,l=n;s<l.length;s++){var u=l[s];o.has(u)||(o.add(u),a.push(u))}for(var h=0,c=r;h<c.length;h++){u=c[h];o.has(u)||(o.add(u),a.push(u))}return a}function E(t,e){var n=[],i=A(t,e,!1);if(L(i))return n;for(var r=$(i.keys()),o=0;;){var a=Z(r);if(!a)return n.length=o,n;var s=q(a);try{n[o]=s}catch(t){try{J(r)}finally{throw t}}o++}}function H(t){if(null===t)return 1;switch(Ht(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function I(t){return null===t}function D(t){return"symbol"===Ht(t)}function j(t){return"object"===Ht(t)?null!==t:"function"==typeof t}function W(t,e){switch(H(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=X(t,i);if(void 0!==r){var o=r.call(t,n);if(j(o))throw new TypeError;return o}return F(t,"default"===n?"number":n)}function F(t,e){if("string"===e){var n=t.toString;if(V(n))if(!j(r=n.call(t)))return r;if(V(i=t.valueOf))if(!j(r=i.call(t)))return r}else{var i;if(V(i=t.valueOf))if(!j(r=i.call(t)))return r;var r,o=t.toString;if(V(o))if(!j(r=o.call(t)))return r}throw new TypeError}function z(t){return!!t}function N(t){return""+t}function G(t){var e=W(t,3);return D(e)?e:N(e)}function U(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function V(t){return"function"==typeof t}function K(t){return"function"==typeof t}function Y(t){switch(H(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!V(n))throw new TypeError;return n}}function $(t){var e=X(t,r);if(!V(e))throw new TypeError;var n=e.call(t);if(!j(n))throw new TypeError;return n}function q(t){return t.value}function Z(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Q(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r<i;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new c}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[r]=function(){return this.keys()},t}()}function nt(){var t=16,n=l.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?l.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+u()}while(l.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function u(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;i<t;++i){var r=e[i];4!==i&&6!==i&&8!==i||(n+="-"),r<16&&(n+="0"),n+=r.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",p),t("metadata",v),t("defineMetadata",g),t("hasMetadata",y),t("hasOwnMetadata",m),t("getMetadata",b),t("getOwnMetadata",w),t("getMetadataKeys",x),t("getOwnMetadataKeys",C),t("deleteMetadata",_)}(i)}()}(oi||(oi={}));var li="named",ui="name",hi="unmanaged",ci="optional",di="inject",fi="multi_inject",pi="inversify:tagged",vi="inversify:tagged_props",gi="inversify:paramtypes",yi="design:paramtypes",mi="post_construct",bi="pre_destroy";var wi=[di,fi,ui,hi,li,ci],xi={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Ci={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},_i={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},ki=0;function Si(){return ki++}var Ai=function(){function t(t,e){this.id=Si(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Ci.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===xi.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),Bi="Metadata key was used more than once in a parameter:",Ri="NULL argument",Ti="Key Not Found",Mi="Ambiguous match found for serviceIdentifier:",Pi="No matching bindings found for serviceIdentifier:",Oi="Missing required @injectable annotation in:",Ei="Missing required @inject or @multiInject annotation in:",Hi="Circular dependency found:",Li="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Ii=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Di=function(t,e){return"@postConstruct error in class "+t+": "+e},ji=function(t,e){return"@preDestroy error in class "+t+": "+e},Wi=function(t,e){return"onDeactivation() error in class "+t+": "+e},Fi="Maximum call stack size exceeded",zi=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(gi,t),userGeneratedMetadata:Reflect.getMetadata(pi,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(vi,t)||[]},t}(),Ni={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Gi(t){return t instanceof RangeError||t.message===Fi}function Ui(t){return"function"==typeof t?t.name:"symbol"===Ht(t)?t.toString():t}function Vi(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Xi(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i}function Ki(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Ki(t.parentRequest,e))}function Yi(t){t.childRequests.forEach((function(t){if(Ki(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var i=Ui(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Hi+" "+e)}Yi(t)}))}function Xi(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var $i=function(){function t(t){this.id=Si(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),qi=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===li?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Zi=function(t,e){this.parentContext=t,this.rootRequest=e},Ji=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Qi=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),tr=function(){function t(t,e,n,i){this.id=Si(),this.type=t,this.serviceIdentifier=n;var r="symbol"===Ht(e)?e.toString().slice(7,-1):e;this.name=new Qi(r||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof i?o=new qi(li,i):i instanceof qi&&(o=i),null!==o&&this.metadata.push(o)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(fi)},t.prototype.matchesArray=function(t){return this.matchesTag(fi)(t)},t.prototype.isNamed=function(){return this.hasTag(li)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return wi.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(ci)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===li}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return wi.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(li)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;i<r.length;i++){var o=r[i];if(o.key===t&&o.value===n)return!0}return!1}},t}(),er=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function nr(t,e,n,i){var r=t.getConstructorMetadata(n),o=r.compilerGeneratedMetadata;if(void 0===o)throw new Error(Oi+" "+e+".");var a=r.userGeneratedMetadata,s=Object.keys(a),l=0===n.length&&s.length>0,u=s.length>n.length,h=function(t,e,n,i,r){for(var o=[],a=0;a<r;a++){var s=ir(a,t,e,n,i);null!==s&&o.push(s)}return o}(i,e,o,a,l||u?s.length:n.length),c=or(t,n,e);return er(er([],h,!0),c,!0)}function ir(t,e,n,i,r){var o=r[t.toString()]||[],a=sr(o),s=!0!==a.unmanaged,l=i[t],u=a.inject||a.multiInject;if((l=u||l)instanceof Ji&&(l=l.unwrap()),s){if(!e&&(l===Object||l===Function||void 0===l))throw new Error(Ei+" argument "+t+" in class "+n+".");var h=new tr(_i.ConstructorArgument,a.targetName,l);return h.metadata=o,h}return null}function rr(t,e,n,i){var r=t||e;if(void 0===r){var o=Oi+" for property "+String(n)+" in class "+i+".";throw new Error(o)}return r}function or(t,e,n){for(var i=t.getPropertiesMetadata(e),r=[],o=Object.getOwnPropertySymbols(i),a=0,s=Object.keys(i).concat(o);a<s.length;a++){var l=s[a],u=i[l],h=sr(u),c=h.targetName||l,d=rr(h.inject,h.multiInject,l,n),f=new tr(_i.ClassProperty,c,d);f.metadata=u,r.push(f)}var p=Object.getPrototypeOf(e.prototype).constructor;if(p!==Object){var v=or(t,p,n);r=er(er([],r,!0),v,!0)}return r}function ar(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var i=nr(t,Xi(n),n,!0),r=i.map((function(t){return t.metadata.filter((function(t){return t.key===hi}))})),o=[].concat.apply([],r).length,a=i.length-o;return a>0?a:ar(t,n)}return 0}function sr(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[di],multiInject:e[fi],targetName:e[ui],unmanaged:e[hi]}}var lr=function(){function t(t,e,n,i,r){this.id=Si(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();function ur(t){return t._bindingDictionary}function hr(t,e,n,i,r){var o=dr(n.container,r.serviceIdentifier),a=[];return o.length===Ni.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),o=dr(n.container,r.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new lr(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case Ni.NoBindingsAvailable:if(n.isOptional())return e;var r=Ui(t),o=Pi;throw o+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(r,n),o+=Vi(i,r,dr),new Error(o);case Ni.OnlyOneBindingAvailable:return e;case Ni.MultipleBindingsAvailable:default:if(n.isArray())return e;r=Ui(t),o=Mi+" "+r;throw o+=Vi(i,r,dr),new Error(o)}}(r.serviceIdentifier,a,r,n.container),a}function cr(t,e,n,i,r,o){var a,s;if(null===r){a=hr(t,e,i,null,o),s=new lr(n,i,null,a,o);var l=new Zi(i,s);i.addPlan(l)}else a=hr(t,e,i,r,o),s=r.addChildRequest(o.serviceIdentifier,a,o);a.forEach((function(e){var n=null;if(o.isArray())n=s.addChildRequest(e.serviceIdentifier,e,o);else{if(e.cache)return;n=s}if(e.type===Ci.Instance&&null!==e.implementationType){var r=function(t,e){return nr(t,Xi(e),e,!1)}(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var a=ar(t,e.implementationType);if(r.length<a){var l=Ii(Xi(e.implementationType));throw new Error(l)}}r.forEach((function(e){cr(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function dr(t,e){var n=[],i=ur(t);return i.hasKey(e)?n=i.get(e):null!==t.parent&&(n=dr(t.parent,e)),n}function fr(t,e,n,i,r,o,a,s){void 0===s&&(s=!1);var l=new $i(e),u=function(t,e,n,i,r,o){var a=new qi(t?fi:di,n),s=new tr(e,i,n,a);if(void 0!==r){var l=new qi(r,o);s.metadata.push(l)}return s}(n,i,r,"",o,a);try{return cr(t,s,r,l,null,u),l}catch(t){throw Gi(t)&&Yi(l.plan.rootRequest),t}}function pr(t){return("object"===Ht(t)&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function vr(t){return!!pr(t)||Array.isArray(t)&&t.some(pr)}var gr,yr=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},mr=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},br=function(t,e,n){t.has(e.id)||t.set(e.id,n)},wr=function(t,e){t.cache=e,t.activated=!0,pr(e)&&xr(t,e)},xr=function(t,e){return yr(void 0,void 0,void 0,(function(){var n,i;return mr(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return n=r.sent(),t.cache=n,[3,3];case 2:throw i=r.sent(),t.cache=null,t.activated=!1,i;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(gr||(gr={}));var Cr=function(){return Cr=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Cr.apply(this,arguments)},_r=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},kr=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Sr=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function Ar(t,e,n){var i;if(e.length>0){var r=function(t,e){return t.reduce((function(t,n){var i=e(n);return n.target.type===_i.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=vr(i)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),o=Cr(Cr({},r),{constr:t});i=r.isAsync?function(t){return _r(this,void 0,void 0,(function(){var e,n;return kr(this,(function(i){switch(i.label){case 0:return[4,Rr(t.constructorInjections)];case 1:return e=i.sent(),[4,Rr(t.propertyInjections)];case 2:return n=i.sent(),[2,Br(Cr(Cr({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(o):Br(o)}else i=new t;return i}function Br(t){var e,n=new((e=t.constr).bind.apply(e,Sr([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,i){var r=e.target.identifier,o=t.propertyInjections[i];n[r]=o})),n}function Rr(t){return _r(this,void 0,void 0,(function(){var e,n,i,r;return kr(this,(function(o){for(e=[],n=0,i=t;n<i.length;n++)r=i[n],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function Tr(t,e){var n=function(t,e){var n,i;if(Reflect.hasMetadata(mi,t)){var r=Reflect.getMetadata(mi,t);try{return null===(i=(n=e)[r.value])||void 0===i?void 0:i.call(n)}catch(e){throw new Error(Di(t.name,e.message))}}}(t,e);return pr(n)?n.then((function(){return e})):e}function Mr(t,e){t.scope!==xi.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===xi.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Wi(e.name,n));if(Reflect.hasMetadata(bi,e))throw new Error(ji(e.name,n))}(t,e)}var Pr=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},Or=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Er=function t(e){return function(n){n.parentContext.setCurrentRequest(n);var i=n.bindings,r=n.childRequests,o=n.target&&n.target.isArray(),a=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(o&&a)return r.map((function(n){return t(e)(n)}));if(!n.target.isOptional()||0!==i.length){var s=i[0];return Dr(e,n,s)}}},Hr=function(t,e){var n=function(t){switch(t.type){case Ci.Factory:return{factory:t.factory,factoryType:gr.Factory};case Ci.Provider:return{factory:t.provider,factoryType:gr.Provider};case Ci.DynamicValue:return{factory:t.dynamicValue,factoryType:gr.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Gi(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,i=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+i+"'."));var t,i}))},Lr=function(t,e,n){var i,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case Ci.ConstantValue:case Ci.Function:e=t.cache;break;case Ci.Constructor:case Ci.Instance:e=t.implementationType;break;case Ci.DynamicValue:e=t.dynamicValue;break;case Ci.Provider:e=t.provider;break;case Ci.Factory:e=t.factory}if(null===e){var n=Ui(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case Ci.ConstantValue:case Ci.Function:i=n.cache;break;case Ci.Constructor:i=n.implementationType;break;case Ci.Instance:i=function(t,e,n,i){Mr(t,e);var r=Ar(e,n,i);return pr(r)?r.then((function(t){return Tr(e,t)})):Tr(e,r)}(n,n.implementationType,r,Er(t));break;default:i=Hr(n,e.parentContext)}return i},Ir=function(t,e,n){var i=function(t,e){return e.scope===xi.Singleton&&e.activated?e.cache:e.scope===xi.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==i||function(t,e,n){e.scope===xi.Singleton&&wr(e,n),e.scope===xi.Request&&br(t,e,n)}(t,e,i=n()),i},Dr=function(t,e,n){return Ir(t,n,(function(){var i=Lr(t,e,n);return i=pr(i)?i.then((function(t){return jr(e,n,t)})):jr(e,n,i)}))};function jr(t,e,n){var i,r=Wr(t.parentContext,e,n),o=Gr(t.parentContext.container),a=o.next();do{i=a.value;var s=t.parentContext,l=t.serviceIdentifier,u=Nr(i,l);r=pr(r)?zr(u,s,r):Fr(u,s,r),a=o.next()}while(!0!==a.done&&!ur(i).hasKey(t.serviceIdentifier));return r}var Wr=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},Fr=function(t,e,n){for(var i=t.next();!i.done;){if(pr(n=i.value(e,n)))return zr(t,e,n);i=t.next()}return n},zr=function(t,e,n){return Pr(void 0,void 0,void 0,(function(){var i,r;return Or(this,(function(o){switch(o.label){case 0:return[4,n];case 1:i=o.sent(),r=t.next(),o.label=2;case 2:return r.done?[3,4]:[4,r.value(e,i)];case 3:return i=o.sent(),r=t.next(),[3,2];case 4:return[2,i]}}))}))},Nr=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Gr=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Ur=function t(e,n){var i=e.parentRequest;return null!==i&&(!!n(i)||t(i,n))},Vr=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new qi(t,e),n}},Kr=Vr(li),Yr=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}},Xr=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new $r(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=Kr(t),new $r(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new $r(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Vr(t)(e),new $r(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&Yr(t)(e.parentRequest)},new $r(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Kr(t)(e.parentRequest)},new $r(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Vr(t)(e)(n.parentRequest)},new $r(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Ur(e,Yr(t))},new $r(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Ur(e,Yr(t))},new $r(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Ur(e,Kr(t))},new $r(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Ur(e,Kr(t))},new $r(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Ur(n,Vr(t)(e))},new $r(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!Ur(n,Vr(t)(e))},new $r(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Ur(e,t)},new $r(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Ur(e,t)},new $r(this._binding)},t}(),$r=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new Xr(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new Xr(this._binding)},t}(),qr=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Xr(this._binding),this._bindingOnSyntax=new $r(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Zr=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=xi.Request,new qr(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=xi.Transient,new qr(this._binding)},t}(),Jr=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new Xr(this._binding),this._bindingOnSyntax=new $r(this._binding),this._bindingInSyntax=new Zr(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Qr=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=Ci.Instance,this._binding.implementationType=t,new Jr(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=Ci.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=Ci.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Jr(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=Ci.Constructor,this._binding.implementationType=t,this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=Ci.Factory,this._binding.factory=t,this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=Ci.Function,this._binding.scope=xi.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=Ci.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=Ci.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new qr(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=Ci.Provider,this._binding.provider=t,this._binding.scope=xi.Singleton,new qr(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),to=function(){function t(){}return t.of=function(e,n,i,r,o){var a=new t;return a.bindings=e,a.middleware=n,a.deactivations=r,a.activations=i,a.moduleActivationStore=o,a},t}();var eo=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(Ri);if(null==e)throw new Error(Ri);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(Ri);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(Ti)},t.prototype.remove=function(t){if(null==t)throw new Error(Ri);if(!this._map.delete(t))throw new Error(Ti)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,i){var r=t.hasKey(n)?t.get(n):void 0;if(void 0!==r){var o=i.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(n,o)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(i,r){for(var o=[],a=0,s=i;a<s.length;a++){var l=s[a];t(l)?n.push(l):o.push(l)}e._setValue(r,o)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(Ri);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,function(t){return"object"===Ht(t)&&null!==t&&"clone"in t&&"function"==typeof t.clone}(t)?t.clone():t)}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),no=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new eo,onDeactivations:new eo}},t}(),io=function(){return io=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},io.apply(this,arguments)},ro=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},oo=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},ao=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},so=function(){function t(t){var e=t||{};if("object"!==Ht(e))throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=xi.Transient;else if(e.defaultScope!==xi.Singleton&&e.defaultScope!==xi.Transient&&e.defaultScope!==xi.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=Si(),this._bindingDictionary=new eo,this._snapshots=[],this._middleware=null,this._activations=new eo,this._deactivations=new eo,this.parent=null,this._metadataReader=new zi,this._moduleActivationStore=new no}return t.merge=function(e,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var o=new t,a=ao([e,n],i,!0).map((function(t){return ur(t)})),s=ur(o);return a.forEach((function(t){!function(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}(t,s)})),o},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),i=0,r=t;i<r.length;i++){var o=r[i],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ro(this,void 0,void 0,(function(){var e,n,i,r,o;return oo(this,(function(a){switch(a.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,a.label=1;case 1:return n<i.length?(r=i[n],o=e(r.id),[4,r.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)]):[3,4];case 2:a.sent(),a.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n=t._removeModuleBindings(e.id);t._deactivateSingletons(n),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ro(this,void 0,void 0,(function(){var e,n,i,r;return oo(this,(function(o){switch(o.label){case 0:e=0,n=t,o.label=1;case 1:return e<n.length?(i=n[e],r=this._removeModuleBindings(i.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:o.sent(),this._removeModuleHandlers(i.id),o.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||xi.Transient,n=new Ai(t,e);return this._bindingDictionary.add(t,n),new Qr(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return ro(this,void 0,void 0,(function(){return oo(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return ro(this,void 0,void 0,(function(){var e;return oo(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,n){t._deactivateSingletons(n)})),this._bindingDictionary=new eo},t.prototype.unbindAllAsync=function(){return ro(this,void 0,void 0,(function(){var t,e=this;return oo(this,(function(n){switch(n.label){case 0:return t=[],this._bindingDictionary.traverse((function(n,i){t.push(e._deactivateSingletonsAsync(i))})),[4,Promise.all(t)];case 1:return n.sent(),this._bindingDictionary=new eo,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,li,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),o=function(t,e,n,i){var r=new tr(_i.Variable,"",e,new qi(n,i)),o=new $i(t);return new lr(e,o,null,[],r)}(this,t,e,n);i=r.some((function(t){return t.constraint(o)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(to.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return ro(this,void 0,void 0,(function(){var e;return oo(this,(function(n){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,n){var i=this._getNotAllArgs(t,!1,e,n);return this._getButThrowIfAsync(i)},t.prototype.getTaggedAsync=function(t,e,n){return ro(this,void 0,void 0,(function(){var i;return oo(this,(function(r){return i=this._getNotAllArgs(t,!1,e,n),[2,this._get(i)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,li,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,li,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getButThrowIfAsync(i)},t.prototype.getAllTaggedAsync=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getAll(i)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,li,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,li,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var n=this.get(t);return e||this.unbind(t),n},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(bi,t))return e[Reflect.getMetadata(bi,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var n=this,i=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(pr(r))return this._handleDeactivationError(r.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,i)})),i)}var o=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(pr(o))return this._handleDeactivationError(o,i)}catch(t){throw new Error(Wi(i.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return ro(this,void 0,void 0,(function(){var n;return oo(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),new Error(Wi(e.name,n.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var n=this,i=e.next();i.value;){var r=i.value(t);if(pr(r))return r.then((function(){return n._deactivateContainerAsync(t,e)}));i=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return ro(this,void 0,void 0,(function(){var n;return oo(this,(function(i){switch(i.label){case 0:n=e.next(),i.label=1;case 1:return n.value?[4,n.value(t)]:[3,3];case 2:return i.sent(),n=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}},i=function(e){return function(n,i){t._moduleActivationStore.addActivation(e,n,i),t.onActivation(n,i)}},r=function(e){return function(n,i){t._moduleActivationStore.addDeactivation(e,n,i),t.onDeactivation(n,i)}};return function(o){return{bindFunction:(a=o,function(n){var i=t.bind(n);return e(i,a),i}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:i(o),onDeactivationFunction:r(o),rebindFunction:n(o),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var a}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=io(io({},t),{contextInterceptor:function(t){return t},targetType:_i.Variable});if(this._middleware){var n=this._middleware(e);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(vr(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=fr(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return Er(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(n=e.contextInterceptor(n))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return pr(t.cache)?t.cache.then((function(n){return e._deactivate(t,n)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];if(pr(this._deactivateIfSingleton(i)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return ro(this,void 0,void 0,(function(){var e=this;return oo(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return n.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,n){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,n)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,n){return ro(this,void 0,void 0,(function(){return oo(this,(function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,n)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Ui(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,n){var i=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(pr(r))return r.then((function(){return i._preDestroy(n,e)}))}return this._preDestroy(n,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,n){return ro(this,void 0,void 0,(function(){return oo(this,(function(i){switch(i.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,e)];case 3:return i.sent(),[2]}}))}))},t}(),lo=function(t){this.id=Si(),this.registry=t};function uo(t,e,n,i){!function(t){if(void 0!==t)throw new Error(Li)}(e),co(pi,t,n.toString(),i)}function ho(t){var e=[];if(Array.isArray(t)){var n=function(t){for(var e=new Set,n=0,i=t;n<i.length;n++){var r=i[n];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==n)throw new Error(Bi+" "+n.toString())}else e=[t];return e}function co(t,e,n,i){var r=ho(i),o={};Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var a=o[n];if(void 0===a)a=[];else for(var s=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(Bi+" "+t.key.toString())},l=0,u=a;l<u.length;l++){s(u[l])}a.push.apply(a,r),o[n]=a,Reflect.defineMetadata(t,o,e)}function fo(t){return function(e,n,i){"number"==typeof i?uo(e,n,i,t):function(t,e,n){if(void 0!==t.prototype)throw new Error(Li);co(vi,t.constructor,e,n)}(e,n,t)}}function po(){return function(t){if(Reflect.hasOwnMetadata(gi,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata(yi,t)||[];return Reflect.defineMetadata(gi,e,t),t}}function vo(t){return fo(new qi(li,t))}function go(t){return function(e){return function(n,i,r){if(void 0===e){var o="function"==typeof n?n.name:n.constructor.name;throw new Error(function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."}(o))}return fo(new qi(t,e))(n,i,r)}}}var yo=go(di);var mo=go(fi);function bo(t,e){return function(){return function(n,i){var r=new qi(t,i);if(Reflect.hasOwnMetadata(t,n.constructor))throw new Error(e);Reflect.defineMetadata(t,r,n.constructor)}}}var wo,xo=bo(mi,"Cannot apply @postConstruct decorator multiple times in the same class");bo(bi,"Cannot apply @preDestroy decorator multiple times in the same class");wo||(wo={});var Co,_o=Symbol.for("EnvContribution"),ko=Symbol.for("Global");!function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Co||(Co={}));var So=function(){function t(e,n){Ae(this,t),this._args=e,this.name=n,this.taps=[]}return Se(t,[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((function(t){return t.name!==n&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,n){var i;if("string"==typeof e)i={name:e.trim()};else if("object"!=Ht(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i)}},{key:"_tap",value:function(t,e,n){this._insert(this._parseOptions(t,e,n))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+1]=r;var o=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(o>n)){i++;break}}this.taps[i]=t}}]),t}();function Ao(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Bo=function(t){Ke(n,t);var e=Ao(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}]),n}(So);function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fontStyle,i=void 0===n?e.fontStyle:n,r=t.fontVariant,o=void 0===r?e.fontVariant:r,a=t.fontWeight,s=void 0===a?e.fontWeight:a,l=t.fontSize,u=void 0===l?e.fontSize:l,h=t.fontFamily;return(i?i+" ":"")+(o?o+" ":"")+(s?s+" ":"")+1*u+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}function To(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Mo(t,e){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?-e:t&&"alphabetic"!==t?0:-.79*e}var Po,Oo=Me-1e-8,Eo=function(){function t(e){Ae(this,t),this.init(e)}return Se(t,[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,e,n,i,r,o){if(Math.abs(r-i)>Oo)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);var a,s,l,u,h=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),u=n*Math.sin(t),l<h&&(h=l),l>c&&(c=l),u<d&&(d=u),u>f&&(f=u)}if(p(i),p(r),r!==i)if((i%=Me)<0&&(i+=Me),(r%=Me)<0&&(r+=Me),r<i&&(o=!o,a=i,i=r,r=a),o)for(r-=Me,a=i-i%Te,s=0;s<4&&a>r;++s,a-=Te)p(a);else for(a=i-i%Te+Te,s=0;s<4&&a<r;++s,a+=Te)p(a);this.bounds.add(t+h,e+d),this.bounds.add(t+c,e+f)}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,o)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}},{key:"rect",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}]),t}();function Ho(){return Ho="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=$e(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},Ho.apply(this,arguments)}function Lo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}!function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Po||(Po={}));var Io=function(){function t(e,n){Ae(this,t),this.init(e,n)}return Se(t,[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o,a){var s=new Ra(new Ge(this._lastX,this._lastY),new Ge(t,e),new Ge(n,i),new Ge(r,o));s.defined=a,this.curves.push(s),this._lastX=r,this._lastY=o}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,n){var i=this.addLinearCurve(t,e,n);this.curves.push(i),this._lastX=t,this._lastY=e}},{key:"moveTo",value:function(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}},{key:"quadraticCurveTo",value:function(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,e,n){var i=new Ta(new Ge(this._lastX,this._lastY),new Ge(t,e));return i.defined=n,i}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){if(t===Po.COLUMN){if(!this.curves.length)return 0;var e=this.curves[0],n=this.curves[this.curves.length-1];return Oe(e.p0.y-n.p1.y)}if(t===Po.ROW){if(!this.curves.length)return 0;var i=this.curves[0],r=this.curves[this.curves.length-1];return Oe(i.p0.x-r.p1.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}]),t}(),Do=function(t){Ke(n,t);var e=Lo(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"bezierCurveTo",value:function(t,e,i,r,o,a,s){return Ho($e(n.prototype),"bezierCurveTo",this).call(this,e,t,r,i,a,o,s)}},{key:"lineTo",value:function(t,e,i){return Ho($e(n.prototype),"lineTo",this).call(this,e,t,i)}},{key:"moveTo",value:function(t,e){return Ho($e(n.prototype),"moveTo",this).call(this,e,t)}},{key:"clear",value:function(){return Ho($e(n.prototype),"clear",this).call(this)}}]),n}(Io);function jo(t,e){for(var n=!1,i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function Wo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Fo=Se((function t(){Ae(this,t)})),zo=function(t){Ke(n,t);var e=Wo(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Fo),No=function(t){Ke(n,t);var e=Wo(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Fo);function Go(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Uo=function(t){Ke(n,t);var e=Go(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).context=t,i&&(r.startPoint=i),r}return Se(n,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),n}(zo);function Vo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=new Io("linear",null!=n?n:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,1)}(new Uo(r,i),t),r}function Ko(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function Yo(t,e,n,i){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i)}var Xo=function(t){Ke(n,t);var e=Ko(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).context=t,r.startPoint=i,r}return Se(n,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&Yo(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;break;default:Yo(this,e,n,!1!==this._lastDefined&&!1!==t.defined)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),n}(No);function $o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Vo(t,e);var r=new Io("basis",null!=n?n:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,2)}(new Xo(r,i),t),r}function qo(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function Zo(t){return t<0?-1:1}function Jo(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),s=(o*r+a*i)/(i+r);return(Zo(o)+Zo(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Qo(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ta(t,e,n,i){var r=t._x0,o=t._y0,a=t._x1,s=t._y1,l=(a-r)/3;t.context.bezierCurveTo(r+l,o+l*e,a-l,s-l*n,a,s,i)}var ea=function(t){Ke(n,t);var e=qo(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).context=t,r.startPoint=i,r}return Se(n,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined);break;case 3:ta(this,this._t0,Qo(this,this._t0),!1!==this._lastDefined)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,n=t.x,i=t.y;if(n!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(n,i);break;case 1:this._point=2;break;case 2:this._point=3,ta(this,Qo(this,e=Jo(this,n,i)),e,!1!==this._lastDefined&&!1!==t.defined);break;default:ta(this,this._t0,e=Jo(this,n,i),!1!==this._lastDefined&&!1!==t.defined)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined=!1!==t.defined}}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),n}(No),na=function(t){Ke(n,t);var e=qo(n);function n(t,i){return Ae(this,n),e.call(this,t,i)}return Se(n,[{key:"point",value:function(t){return Ho($e(n.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}]),n}(ea);function ia(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Vo(t,e);var r=new Io("monotoneX",null!=n?n:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,2)}(new ea(r,i),t),r}function ra(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return Vo(t,e);var r=new Do("monotoneY",null!=n?n:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,2)}(new na(r,i),t),r}function oa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var aa=function(t){Ke(n,t);var e=oa(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,o=arguments.length>2?arguments[2]:void 0;return Ae(this,n),(i=e.call(this)).context=t,i._t=r,i.startPoint=o,i}return Se(n,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined);else{var i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined)}}this._lastDefined=t.defined,this._x=e,this._y=n}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),n}(No);function sa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.direction,r=n.startPoint;if(t.length<2-Number(!!r))return null;var o=new Io("step",null!=i?i:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,1)}(new aa(o,e,r),t),o}function la(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var ua=function(t){Ke(n,t);var e=la(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).context=t,i&&(r.startPoint=i),r}return Se(n,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){this.context.closePath()}},{key:"point",value:function(t){var e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined):this.context.moveTo(e,n);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),n}(zo);function ha(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=new Io("linear",null!=n?n:Oe(t[t.length-1].x-t[0].x)>Oe(t[t.length-1].y-t[0].y)?Po.ROW:Po.COLUMN);return function(t,e){jo(t,e,1)}(new ua(r,i),t),r}function ca(t,e,n){switch(e){case"linear":default:return Vo(t,n);case"basis":return $o(t,n);case"monotoneX":return ia(t,n);case"monotoneY":return ra(t,n);case"step":return sa(t,.5,n);case"stepBefore":return sa(t,0,n);case"stepAfter":return sa(t,1,n);case"linearClosed":return ha(t,n)}}var da,fa,pa,va,ga,ya,ma=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ba={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},wa={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};var xa=function(t,e,n,i,r,o,a){var s=Math.abs(n-e),l=4*Math.tan(s/4)/3,u=n<e?-1:1,h=Math.cos(e),c=Math.sin(e),d=Math.cos(n),f=Math.sin(n),p=h*o+i,v=c*a+r,g=d*o+i,y=f*a+r,m=o*l*u,b=a*l*u;t.push(p-m*c,v+b*h,g+m*f,y-b*d,g,y)};var Ca=[function(t,e,n,i,r,o,a){return e.arc(t[1]*r+n,t[2]*o+i,t[3]*(r+o)/2,t[4],t[5],t[6],a)},function(t,e,n,i,r,o,a){return e.arcTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,t[5]*(r+o)/2,a)},function(t,e,n,i,r,o,a){return e.bezierCurveTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,t[5]*r+n,t[6]*o+i,a)},function(t,e,n,i){return e.closePath()},function(t,e,n,i,r,o){return e.ellipse(t[1]*r+n,t[2]*o+i,t[3]*r,t[4]*o,t[5],t[6],t[7],t[8])},function(t,e,n,i,r,o,a){return e.lineTo(t[1]*r+n,t[2]*o+i,a)},function(t,e,n,i,r,o,a){return e.moveTo(t[1]*r+n,t[2]*o+i,a)},function(t,e,n,i,r,o,a){return e.quadraticCurveTo(t[1]*r+n,t[2]*o+i,t[3]*r+n,t[4]*o+i,a)},function(t,e,n,i,r,o,a){return e.rect(t[1]*r+n,t[2]*o+i,t[3]*r,t[4]*o,a)}];function _a(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0,s=0;s<t.length;s++){var l=t[s];Ca[l[0]](l,e,n,i,r,o,a)}}function ka(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=l*o,h=-s*a,c=s*o,d=l*a,f=Math.cos(i),p=Math.sin(i),v=Math.cos(r),g=Math.sin(r),y=.5*(r-i),m=Math.sin(.5*y),b=8/3*m*m/Math.sin(y),w=e+f-b*p,x=n+p+b*f,C=e+v,_=n+g,k=C+b*g,S=_-b*v;return[u*w+h*x,c*w+d*x,u*k+h*S,c*k+d*S,u*C+h*_,c*C+d*_]}function Sa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function Aa(t,e,n,i){for(var r=function(t,e,n,i,r,o,a,s,l){var u=tn(a),h=Math.sin(u),c=Math.cos(u),d=c*(s-t)*.5+h*(l-e)*.5,f=c*(l-e)*.5-h*(s-t)*.5,p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(n*=p=Math.sqrt(p),i*=p);var v=c/n,g=h/n,y=-h/i,m=c/i,b=v*s+g*l,w=y*s+m*l,x=v*t+g*e,C=y*t+m*e,_=1/((x-b)*(x-b)+(C-w)*(C-w))-.25;_<0&&(_=0);var k=Math.sqrt(_);o===r&&(k=-k);var S=.5*(b+x)-k*(C-w),A=.5*(w+C)+k*(x-b),B=Math.atan2(w-A,b-S),R=Math.atan2(C-A,x-S)-B;R<0&&1===o?R+=Me:R>0&&0===o&&(R-=Me);for(var T=Math.ceil(Math.abs(R/(Te+.001))),M=[],P=0;P<T;++P){var O=B+P*R/T,E=B+(P+1)*R/T;M[P]=[S,A,O,E,n,i,h,c]}return M}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),o=0;o<r.length;++o){var a=ka(r[o]);t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5])}}var Ba=function(){function t(){Ae(this,t)}return Se(t,[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}]),t}(),Ra=function(t){Ke(n,t);var e=Sa(n);function n(t,i,r,o){var a;return Ae(this,n),(a=e.call(this)).type=Co.CubicBezierCurve,a.p0=t,a.p1=i,a.p2=r,a.p3=o,a}return Se(n,[{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return La(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,function(t,e){for(var n=0,i=t.length,r=0;r<i;r++){var o=t[r],a=e[r],s=t[(r+1)%i],l=e[(r+1)%i];n+=Ue.distanceNN(o,a,s,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}},{key:"calcProjLength",value:function(t){return t===Po.ROW?Oe(this.p0.x-this.p3.x):t===Po.COLUMN?Oe(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var e=Le(t-.01,0),n=Ie(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return Ee(r.y-i.y,r.x-i.x)}}]),n}(Ba),Ta=function(t){Ke(n,t);var e=Sa(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).type=Co.LineCurve,r.p0=t,r.p1=i,r}return Se(n,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return Ue.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=Ee(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?Ue.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===Po.ROW?Oe(this.p0.x-this.p1.x):t===Po.COLUMN?Oe(this.p0.y-this.p1.y):0}}]),n}(Ba),Ma=function(){function t(){Ae(this,t),this.curves=[],this.bounds=new Qe}return Se(t,[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}]),t}(),Pa=function(t){Ke(n,t);var e=Sa(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).commandList=[],t&&(i._ctx=t),i._boundsContext=new Eo(i.bounds),i}return Se(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([wa.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([wa.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,i){return this.commandList.push([wa.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){return this.commandList.push([wa.C,t,e,n,i,r,o]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this}},{key:"arcTo",value:function(t,e,n,i,r){return this.commandList.push([wa.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){return this.commandList.push([wa.E,t,e,n,i,r,o,a,s]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,o,a,s),this}},{key:"rect",value:function(t,e,n,i){return this.commandList.push([wa.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}},{key:"arc",value:function(t,e,n,i,r,o){return this.commandList.push([wa.A,t,e,n,i,r,o]),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this}},{key:"closePath",value:function(){return this.commandList.push([wa.Z]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[wa.M]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[wa.L]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[wa.Q]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[wa.C]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[wa.A]=function(t){var e=[];xa(e,t[4],t[5],t[1],t[2],t[3],t[3]);for(var n="",i=0;i<e.length;i+=6)n+="C".concat(e[i]," ").concat(e[i+1]," ").concat(e[i+2]," ").concat(e[i+3]," ").concat(e[i+4]," ").concat(e[i+5]);return n},t[wa.Z]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,n="";return this.commandList.forEach((function(t){n+=e[t[0]](t)})),n}},{key:"fromString",value:function(t,e,n,i,r){this.clear();var o=function(t){if(!t)return[];var e,n,i=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===i)return[];for(var r=[],o=0,a=i.length;o<a;o++)if(da=i[o],fa=da.slice(1),e=[pa=da[0]],null!==(n=fa.match(ma))){for(var s=0,l=n.length;s<l;s++)va=n[s],ga=parseFloat(va),Number.isNaN(ga)||e.push(ga);if(ya=ba[pa],e.length-1>ya)for(var u=void 0,h=1,c=e.length;h<c;h+=ya){u=[pa];for(var d=h,f=h+ya;d<f;d++)u.push(e[d]);r.push(u)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(o,e,n,i,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,n=e.points,i=e.curveType,r=e.clipRangeByDimension;if(n){var o=ca(n,i);"x"===r?this.direction=Po.ROW:"y"===r?this.direction=Po.COLUMN:"auto"===r&&(this.direction=o.direction),this.curves=o.curves}}},{key:"fromCustomPath2D",value:function(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,n,i){var r=this,o=this.commandList;if(!this.transformCbList){var a=[];a[wa.M]=this.moveToTransform,a[wa.L]=this.lineToTransform,a[wa.Q]=this.quadraticCurveToTransform,a[wa.C]=this.bezierCurveToTransform,a[wa.AT]=this.arcToTransform,a[wa.E]=this.ellipseTransform,a[wa.R]=this.rectTransform,a[wa.A]=this.arcTransform,a[wa.Z]=this.closePathTransform,this.transformCbList=a}o.forEach((function(o){r.transformCbList[o[0]](o,t,e,n,i)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"lineToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"quadraticCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}},{key:"bezierCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}},{key:"arcToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}},{key:"ellipseTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,n,i,r,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=null,c=0,d=0,f=0,p=0,v=0,g=t.length;v<g;++v){switch(e=t[v],1===l&&1===u||(e=Ea(e,l,u)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+a,d+s);break;case"L":c=e[1],d=e[2],this.lineTo(c+a,d+s);break;case"h":c+=e[1],this.lineTo(c+a,d+s);break;case"H":c=e[1],this.lineTo(c+a,d+s);break;case"v":d+=e[1],this.lineTo(c+a,d+s);break;case"V":d=e[1],this.lineTo(c+a,d+s);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+a,d+s);break;case"M":c=e[1],d=e[2],this.moveTo(c+a,d+s);break;case"c":n=c+e[5],i=d+e[6],f=c+e[3],p=d+e[4],this.bezierCurveTo(c+e[1]+a,d+e[2]+s,f+a,p+s,n+a,i+s),c=n,d=i;break;case"C":c=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+a,e[2]+s,f+a,p+s,c+a,d+s);break;case"s":n=c+e[3],i=d+e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+s,c+e[1]+a,d+e[2]+s,n+a,i+s),f=c+e[1],p=d+e[2],c=n,d=i;break;case"S":n=e[3],i=e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+s,e[1]+a,e[2]+s,n+a,i+s),c=n,d=i,f=e[1],p=e[2];break;case"q":n=c+e[3],i=d+e[4],f=c+e[1],p=d+e[2],this.quadraticCurveTo(f+a,p+s,n+a,i+s),c=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+a,e[2]+s,n+a,i+s),c=n,d=i,f=e[1],p=e[2];break;case"t":n=c+e[1],i=d+e[2],null===h[0].match(/[QqTt]/)?(f=c,p=d):"t"===h[0]?(f=2*c-r,p=2*d-o):"q"===h[0]&&(f=2*c-f,p=2*d-p),r=f,o=p,this.quadraticCurveTo(f+a,p+s,n+a,i+s),d=i,f=(c=n)+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*c-f,p=2*d-p,this.quadraticCurveTo(f+a,p+s,n+a,i+s),c=n,d=i;break;case"a":Aa(this,c+a,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+c+a,e[7]+d+s]),c+=e[6],d+=e[7];break;case"A":Aa(this,c+a,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+s]),c=e[6],d=e[7];break;case"z":case"Z":this.closePath()}h=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(var o=0,a=t.length;o<a;++o){var s=t[o].slice();switch(s[0]){case wa.L:this.lineToTransform(s,e,n,i,r);break;case wa.M:this.moveToTransform(s,e,n,i,r);break;case wa.C:this.bezierCurveToTransform(s,e,n,i,r);break;case wa.Q:this.quadraticCurveToTransform(s,e,n,i,r);break;case wa.A:this.arcToTransform(s,e,n,i,r);break;case wa.E:this.ellipseTransform(s,e,n,i,r);break;case wa.R:this.rectTransform(s,e,n,i,r);break;case wa.AT:this.arcToTransform(s,e,n,i,r);break;case wa.Z:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),_a(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===Po.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],e=this.curves[this.curves.length-1];return Oe(t.p0.y-e.p1.y)}if(this.direction===Po.ROW){if(!this.curves.length)return 0;var n=this.curves[0],i=this.curves[this.curves.length-1];return Oe(n.p0.x-i.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,n=0,i=0;i<this.curves.length;i++){var r=(e=this.curves[i]).getLength(this.direction);if(n+r>=t)break;n+=r}var o=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}]),n}(Ma),Oa=["l",0,0,0,0,0,0,0];function Ea(t,e,n){var i=Oa[0]=t[0];if("a"===i||"A"===i)Oa[1]=e*t[1],Oa[2]=n*t[2],Oa[3]=t[3],Oa[4]=t[4],Oa[5]=t[5],Oa[6]=e*t[6],Oa[7]=n*t[7];else if("h"===i||"H"===i)Oa[1]=e*t[1];else if("v"===i||"V"===i)Oa[1]=n*t[1];else for(var r=1,o=t.length;r<o;++r)Oa[r]=(r%2==1?e:n)*t[r];return Oa}function Ha(t,e,n,i,r){var o=1-r;return o*o*o*t+3*e*r*o*o+3*n*r*r*o+i*r*r*r}function La(t,e,n,i,r){var o=Ha(t.x,e.x,n.x,i.x,r),a=Ha(t.y,e.y,n.y,i.y,r);return new Ge(o,a)}function Ia(t,e){var n=t.p0,i=t.p1,r=t.p2,o=t.p3,a=La(n,i,r,o,e),s=Ue.pointAtPP(n,i,e),l=Ue.pointAtPP(i,r,e),u=Ue.pointAtPP(r,o,e),h=Ue.pointAtPP(s,l,e),c=Ue.pointAtPP(l,u,e);return[new Ra(n,s,h,a),new Ra(a,c,u,o)]}function Da(t,e){var n=t.p0,i=t.p1,r=Ue.pointAtPP(n,i,e);return[new Ta(n,r),new Ta(r,i)]}function ja(t,e,n){var i=e,r=t.currentMatrix,o=r.a,a=r.b,s=r.c,l=r.d,u=Math.sign(o)*Math.sqrt(o*o+a*a),h=Math.sign(l)*Math.sqrt(s*s+l*l);return u+h===0?0:i=i/Math.abs(u+h)*2*n}function Wa(t,e,n,i,r){return e?"string"==typeof e?e:("linear"===e.gradient?o=function(t,e,n,i,r){var o=n.x2-n.x1,a=n.y2-n.y1,s=n.x1,l=n.y1,u=t.createLinearGradient(s+(e.x0||0)*o,l+(e.y0||0)*a,s+(e.x1||1)*o,l+(e.y1||0)*a);return e.stops.forEach((function(t){u.addColorStop(t.offset,t.color)})),u}(t,e,n.AABBBounds):"conical"===e.gradient?o=function(t,e,n,i,r){if(!n)return;var o=n.x2-n.x1,a=n.y2-n.y1,s=n.x1||0,l=n.y1||0,u=t.createConicGradient(s+(e.x||0)*o,l+(e.y||0)*a,e.startAngle,e.endAngle);return e.stops.forEach((function(t){u.addColorStop(t.offset,t.color)})),u.GetPattern(o+s,a+l,void 0)}(t,e,n.AABBBounds):"radial"===e.gradient&&(o=function(t,e,n,i,r){var o=n.x2-n.x1,a=n.y2-n.y1,s=n.x1,l=n.y1,u=t.createRadialGradient(s+(e.x0||.5)*o,l+(e.y0||.5)*a,Math.max(o,a)*(e.r0||0),s+(e.x1||.5)*o,l+(e.y1||.5)*a,Math.max(o,a)*(e.r1||.5));return e.stops.forEach((function(t){u.addColorStop(t.offset,t.color)})),u}(t,e,n.AABBBounds)),o||"orange"):"black";var o}var Fa=Symbol("ContributionProvider"),za=function(){function t(e,n){Ae(this,t),this.serviceIdentifier=e,this.container=n}return Se(t,[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&(t=this.caches).push.apply(t,ie(this.container.getAll(this.serviceIdentifier)))),this.caches}}]),t}();function Na(t,e){t(Fa).toDynamicValue((function(t){var n=t.container;return new za(e,n)})).inSingletonScope().whenTargetNamed(e)}var Ga,Ua=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}]),t}();Ua.auto_increment_id=0,function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(Ga||(Ga={}));var Va=[!1,!1,!1,!1],Ka=[0,0,0,0],Ya=function(t){return t?Wt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Ka[0]=t[0],Ka[2]=t[0],Ka[1]=t[1],Ka[3]=t[1],Ka):t:t:0},Xa=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],$a=[1,2,3,0,1,2,3,0];function qa(t,e,n,i){for(;t>=Pe;)t-=Pe;for(;t<0;)t+=Pe;for(;t>e;)e+=Pe;Xa[0].x=n,Xa[1].y=n,Xa[2].x=-n,Xa[3].y=-n;var r=Math.ceil(t/Te)%4,o=Math.ceil(e/Te)%4;if(i.add(He(t)*n,De(t)*n),i.add(He(e)*n,De(e)*n),r!==o||e-t>Re)for(var a=!1,s=0;s<$a.length;s++)if(a||r!==$a[s]){if(a&&o===$a[s])break;if(a){var l=Xa[$a[s]];i.add(l.x,l.y)}}else{a=!0;var u=Xa[r];i.add(u.x,u.y)}}function Za(t,e,n){var i=Ne(t.x,t.y,e.x,e.y,n),r=i.x,o=i.y,a=Ne(t.x1,t.y1,e.x1,e.y1,n),s=a.x,l=a.y,u=new Ge(r,o,s,l);return u.defined=e.defined,u}function Ja(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var i=[];if(t.length>e.length){i=e.map((function(t){var e=new Ge(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var r=0;r<e.length;r++)i[r]=Za(t[r],e[r],n)}else{i=e.map((function(t){var e=new Ge(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var o=0;o<t.length;o++)i[o]=Za(t[o],e[o],n)}return i}function Qa(t,e,n,i,r,o){var a;if(Nt(o,!0))a=[o,o,o,o];else if(Array.isArray(o)){var s=o;switch(s.length){case 0:a=[0,0,0,0];break;case 1:a=[s[0],s[0],s[0],s[0]];break;case 2:case 3:a=[s[0],s[1],s[0],s[1]];break;default:a=s.slice(0,5)}}else a=[0,0,0,0];if(i<0||Math.abs(a[0])+Math.abs(a[1])+Math.abs(a[2])+Math.abs(a[3])<1e-12)return t.rect(e,n,i,r);var l=[e,n],u=[e+i,n],h=[e+i,n+r],c=[e,n+r],d=Math.min(i/2,r/2),f=[Math.min(d,a[0]),Math.min(d,a[1]),Math.min(d,a[2]),Math.min(d,a[3])],p=[l[0]+f[0],l[1]],v=[l[0],l[1]+f[0]],g=[u[0]-f[1],u[1]],y=[u[0],u[1]+f[1]],m=[h[0]-f[2],h[1]],b=[h[0],h[1]-f[2]],w=[c[0]+f[3],c[1]],x=[c[0],c[1]-f[3]];if(t.moveTo(p[0],p[1]),t.lineTo(g[0],g[1]),!oe(g,y)){var C=g[0],_=g[1]+f[1];t.arc(C,_,f[1],Math.atan2(g[1]-_,g[0]-C),Math.atan2(y[1]-_,y[0]-C),!1)}if(t.lineTo(b[0],b[1]),!oe(m,b)){var k=b[0]-f[2],S=b[1];t.arc(k,S,f[2],Math.atan2(b[1]-S,b[0]-k),Math.atan2(m[1]-S,m[0]-k),!1)}if(t.lineTo(w[0],w[1]),!oe(w,x)){var A=w[0],B=w[1]-f[3];t.arc(A,B,f[3],Math.atan2(w[1]-B,w[0]-A),Math.atan2(x[1]-B,x[0]-A),!1)}if(t.lineTo(v[0],v[1]),!oe(p,v)){var R=p[0],T=p[1]+f[0];t.arc(R,T,f[0],Math.atan2(v[1]-T,v[0]-R),Math.atan2(p[1]-T,p[0]-R),!1)}return t.closePath(),t}function ts(t,e,n,i){if(e.p1){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,u=r.offsetZ,h=void 0===u?0:u;if(1===n)e.p2&&e.p3?t.bezierCurveTo(a+e.p1.x,l+e.p1.y,a+e.p2.x,l+e.p2.y,a+e.p3.x,l+e.p3.y,h):t.lineTo(a+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var c=ve(Ia(e,n),1)[0];t.bezierCurveTo(a+c.p1.x,l+c.p1.y,a+c.p2.x,l+c.p2.y,a+c.p3.x,l+c.p3.y,h)}else{var d=e.getPointAt(n);t.lineTo(a+d.x,l+d.y,h)}}}function es(t,e,n,i){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,u=r.offsetZ,h=void 0===u?0:u,c=!0;e.forEach((function(e){e.defined?(c&&t.moveTo(e.p0.x+a,e.p0.y+l,h),ns(t,e,1,i),c=!1):c=!0})),c=!0;for(var d=n.length-1;d>=0;d--){var f=n[d];f.defined?(c&&t.lineTo(f.p0.x+a,f.p0.y+l,h),ns(t,f,1,i),c=!1):c=!0}}function ns(t,e,n,i){if(e.p1){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,u=r.offsetZ,h=void 0===u?0:u;if(1===n)e.p2&&e.p3?t.bezierCurveTo(a+e.p1.x,l+e.p1.y,a+e.p2.x,l+e.p2.y,a+e.p3.x,l+e.p3.y,h):t.lineTo(a+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var c=ve(Ia(e,n),1)[0];t.bezierCurveTo(a+c.p1.x,l+c.p1.y,a+c.p2.x,l+c.p2.y,a+c.p3.x,l+c.p3.y,h)}else{var d=e.getPointAt(n);t.lineTo(a+d.x,l+d.y,h)}}}var is={exports:{}},rs={exports:{}};!function(t){function e(n){return t.exports=e="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},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(rs);var os=rs.exports;!function(t){var e=os.default;function n(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
+ t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var i={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function d(t,e,n,i){var r=e&&e.prototype instanceof v?e:v,o=Object.create(r.prototype),s=new R(i||[]);return a(o,"_invoke",{value:k(t,n,s)}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=d;var p={};function v(){}function g(){}function y(){}var m={};c(m,l,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==r&&o.call(w,l)&&(m=w);var x=y.prototype=v.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,n){function i(r,a,s,l){var u=f(t[r],t,a);if("throw"!==u.type){var h=u.arg,c=h.value;return c&&"object"==e(c)&&o.call(c,"__await")?n.resolve(c.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):n.resolve(c).then((function(t){h.value=t,s(h)}),(function(t){return i("throw",t,s,l)}))}l(u.arg)}var r;a(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,r){i(t,e,n,r)}))}return r=r?r.then(o,o):o()}})}function k(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return M()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=f(t,e,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function S(t,e){var n=e.method,i=t.iterator[n];if(void 0===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=f(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,p;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function T(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:M}}function M(){return{value:void 0,done:!0}}return g.prototype=y,a(x,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=c(y,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,c(t,h,"GeneratorFunction")),t.prototype=Object.create(x),t},i.awrap=function(t){return{__await:t}},C(_.prototype),c(_.prototype,u,(function(){return this})),i.AsyncIterator=_,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new _(d(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},C(x),c(x,h,"Generator"),c(x,l,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},i.values=T,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var s=o.call(r,"catchLoc"),l=o.call(r,"finallyLoc");if(s&&l){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=t,a.arg=e,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;B(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(is);var as=is.exports,ss=as(),ls=ss;try{regeneratorRuntime=ss}catch(t){"object"===("undefined"==typeof globalThis?"undefined":Ht(globalThis))?globalThis.regeneratorRuntime=ss:Function("r","regeneratorRuntime = r")(ss)}var us=At(ls),hs=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};function cs(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={},s=[],l=!1;o?l=!0:t.forEachChildren((function(t,n){var r=t.attribute.zIndex,o=void 0===r?e:r;if(0===n)i=o;else if(i!==o)return l=!0,!0;return!1}),r);if(l){t.forEachChildren((function(t){var n=t.attribute.zIndex,i=void 0===n?e:n;a[i]?a[i].push(t):(a[i]=[t],s.push(i))}),r),s.sort((function(t,e){return r?e-t:t-e}));for(var u=!1,h=0;h<s.length&&!u;h++){var c=s[h],d=a[c];o&&d.sort((function(t,e){var n,i;return(r?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(i=t.attribute.z)&&void 0!==i?i:0))}));for(var f=0;f<d.length;f++)if(n(d[f],f)){u=!0;break}}}else t.forEachChildren(n,r)}function ds(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return hs(this,void 0,void 0,us.mark((function e(){return us.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(n,i);case 2:case"end":return e.stop()}}),e)})))}function fs(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},o=[],a=!1;t.forEachChildren((function(t,e){var i=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===i?n:i))return a=!0,!0;return!1}),i);var s=null,l=!1;if(a){t.forEachChildren((function(t){var e=t.attribute.zIndex,i=void 0===e?n:e;r[i]?r[i].push(t):(r[i]=[t],o.push(i))}),i),o.sort((function(t,e){return i?e-t:t-e}));for(var u=!1,h=0;h<o.length&&!u;h++)for(var c=o[h],d=r[c],f=0;f<d.length;f++){if(l){u=!0,s=d[f];break}d[f]._uid!==e||(l=!0)}}else t.forEachChildren((function(t){return l?(s=t,!0):(t._uid===e&&(l=!0),!1)}),i);return s}var ps,vs,gs,ys,ms,bs;!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=51]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX"}(ps||(ps={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(vs||(vs={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(gs||(gs={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(ys||(ys={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(ms||(ms={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(bs||(bs={}));var ws=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},xs=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cs=function(t,e){return function(n,i){e(n,i,t)}},_s=function(){function t(e){Ae(this,t),this.contributions=e,this.hooks={onSetEnv:new Bo(["lastEnv","env","global"])},this.measureTextMethod="native"}return Se(t,[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}},{key:"bindContribution",value:function(t){var e=this;this.contributions.getContributions().forEach((function(n){n.configure(e,t)}))}},{key:"setEnv",value:function(t,e){(e&&!0===e.force||this._env!==t)&&(this.deactiveCurrentEnv(),this.activeEnv(t,e))}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var n=this._env;this._env=t,this.bindContribution(e),this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}}]),t}();function ks(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}_s=ws([po(),Cs(0,yo(Fa)),Cs(0,vo(_o)),xs("design:paramtypes",[Object])],_s);var Ss=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))},As=function(t){Ke(n,t);var e=ks(n);function n(){var t;return Ae(this,n),(t=e.call(this))._uid=Ua.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return Se(n,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,n=0;e;){if(t(e,n++))return;e=e._prev}else for(var i=this._firstChild,r=0;i;){if(t(i,r++))return;i=i._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ss(this,void 0,void 0,us.mark((function n(){var i,r,o,a,s,l;return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e){n.next=16;break}i=this._lastChild,r=0;case 2:if(!i){n.next=14;break}if(o=t(i,r++),n.t0=o.then,!n.t0){n.next=9;break}return n.next=8,o;case 8:o=n.sent;case 9:if(!o){n.next=11;break}return n.abrupt("return");case 11:i=i._prev;case 12:n.next=2;break;case 14:n.next=29;break;case 16:a=this._firstChild,s=0;case 17:if(!a){n.next=29;break}if(l=t(a,s++),n.t1=l.then,!n.t1){n.next=24;break}return n.next=23,l;case 23:l=n.sent;case 24:if(!l){n.next=26;break}return n.abrupt("return");case 26:a=a._next;case 27:n.next=17;break;case 29:case"end":return n.stop()}}),n,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(t,e){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertAfter",value:function(t,e){if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}},{key:"insertInto",value:function(t,e){if(e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,i=0;i<e;i++){if(!n)return null;i>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}var i;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(i=this._nodeList[r]);r--);return i?i._next?this.insertBefore(t,i._next):this.appendChild(t):this.insertInto(t,0)}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return e===t}));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(){if(this._idMap){for(var t=this._firstChild;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren((function(n,r){return!(n===e||!t(n,r)||(i=n,0))})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}},{key:"findAll",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren((function(n,r){n!==e&&t(n,r)&&i.push(n)})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var n=this._firstChild;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,e,i){var r=Mt(i,!0)&&i||Lt(i)&&i.capture,o=Lt(i)&&i.once,a=Pt(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Pt(e)?e:e.handleEvent,o?Ho($e(n.prototype),"once",this).call(this,t,e,a):Ho($e(n.prototype),"on",this).call(this,t,e,a),this}},{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,i){var r=Mt(i,!0)&&i||Lt(i)&&i.capture,o=Pt(e)?void 0:e;t=r?"".concat(t,"capture"):t,e=Pt(e)?e:e.handleEvent;var a=Lt(i)&&i.once;return Ho($e(n.prototype),"off",this).call(this,t,e,o,a),this}},{key:"off",value:function(t,e,n){return this.removeEventListener(t,e,n)}},{key:"once",value:function(t,e,n){return Lt(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}},{key:"removeAllEventListeners",value:function(){return Ho($e(n.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return(e=Ho($e(n.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(r)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}]),n}(Rt);function Bs(t,e,n){return(e=_e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Rs=function(){function t(e){Ae(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ge,this.page=new Ge,this.canvas=new Ge,this.viewport=new Ge,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Se(t,[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}]),t}();function Ts(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Ms=function(t){Ke(n,t);var e=Ts(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).client=new Ge,t.movement=new Ge,t.offset=new Ge,t.global=new Ge,t.screen=new Ge,t}return Se(n,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(t,e,n,i,r,o,a,s,l,u,h,c,d,f,p){throw new Error("Method not implemented.")}}]),n}(Rs);function Ps(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Os=function(t){Ke(n,t);var e=Ps(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).width=0,t.height=0,t.isPrimary=!1,t}return Se(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}]),n}(Ms);function Es(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Hs=function(t){Ke(n,t);var e=Es(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).DOM_DELTA_PIXEL=0,t.DOM_DELTA_LINE=1,t.DOM_DELTA_PAGE=2,t}return Se(n,[{key:"clone",value:function(){var t,e,i,r=new n(this.manager);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice(),r.type=this.type,r}}]),n}(Ms);function Ls(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Hs.DOM_DELTA_PIXEL=0,Hs.DOM_DELTA_LINE=1,Hs.DOM_DELTA_PAGE=2;var Is=function(t){Ke(n,t);var e=Ls(n);function n(t,i){var r;return Ae(this,n),(r=e.call(this)).type=t,r.detail=i,r}return Se(n)}(Rs),Ds="object"==("undefined"==typeof performance?"undefined":Ht(performance))&&performance.now?performance:Date;function js(t){return"mouse"===t||"pen"===t}var Ws=function(){function t(e){var n=this;Ae(this,t),this.dispatch=new Rt,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=function(t,e){if(t instanceof Os){var i=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)n.dispatchEvent(i,"touchstart");else if(js(i.pointerType)){var r=2===i.button;n.dispatchEvent(i,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),n.freeEvent(i)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerMove=function(t,e){var i,r;if(t instanceof Os){var o=n.createPointerEvent(t,t.type,e),a=js(o.pointerType),s=n.trackingData(t.pointerId),l=n.findMountedTarget(s.overTargets);if(s.overTargets&&l&&l!==n.rootTarget&&l!==o.target){var u="mousemove"===t.type?"mouseout":"pointerout",h=n.createPointerEvent(t,u,l||void 0);if(n.dispatchEvent(h,"pointerout"),a&&n.dispatchEvent(h,"mouseout"),!o.composedPath().includes(l)){var c=n.createPointerEvent(t,"pointerleave",l||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!o.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),a&&n.notifyTarget(c,"mouseleave"),c.target=c.target.parent;n.freeEvent(c)}n.freeEvent(h)}if(l!==o.target){var d="mousemove"===t.type?"mouseover":"pointerover",f=n.clonePointerEvent(o,d);n.dispatchEvent(f,"pointerover"),a&&n.dispatchEvent(f,"mouseover");for(var p=null==l?void 0:l.parent;p&&p!==n.rootTarget.parent&&p!==o.target;)p=p.parent;if(!p||p===n.rootTarget.parent){var v=n.clonePointerEvent(o,"pointerenter");for(v.eventPhase=v.AT_TARGET;v.target&&v.target!==l&&v.target!==n.rootTarget.parent;)v.currentTarget=v.target,n.notifyTarget(v),a&&n.notifyTarget(v,"mouseenter"),v.target=v.target.parent;n.freeEvent(v)}n.freeEvent(f)}n.dispatchEvent(o,"pointermove"),"touch"===o.pointerType&&n.dispatchEvent(o,"touchmove"),a&&(n.dispatchEvent(o,"mousemove"),n.cursor=null===(r=null===(i=o.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor),s.overTargets=o.composedPath(),n.freeEvent(o)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOver=function(t,e){var i,r;if(t instanceof Os){var o=n.trackingData(t.pointerId),a=n.createPointerEvent(t,t.type,e),s=js(a.pointerType);n.dispatchEvent(a,"pointerover"),s&&n.dispatchEvent(a,"mouseover"),"mouse"===a.pointerType&&(n.cursor=null===(r=null===(i=a.target)||void 0===i?void 0:i.attribute)||void 0===r?void 0:r.cursor);var l=n.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==n.rootTarget.parent;)l.currentTarget=l.target,n.notifyTarget(l),s&&n.notifyTarget(l,"mouseenter"),l.target=l.target.parent;o.overTargets=a.composedPath(),n.freeEvent(a),n.freeEvent(l)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOut=function(t,e){if(t instanceof Os){var i=n.trackingData(t.pointerId);if(i.overTargets){var r=js(t.pointerType),o=n.findMountedTarget(i.overTargets),a=n.createPointerEvent(t,"pointerout",o||void 0);n.dispatchEvent(a),r&&n.dispatchEvent(a,"mouseout");var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==n.rootTarget.parent;)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],n.freeEvent(a),n.freeEvent(s)}n.cursor=""}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUp=function(t,e){if(t instanceof Os){var i=Ds.now(),r=n.createPointerEvent(t,t.type,e);if(n.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)n.dispatchEvent(r,"touchend");else if(js(r.pointerType)){var o=2===r.button;n.dispatchEvent(r,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),l=s;if(s&&!r.composedPath().includes(s)){for(var u=s;u&&!r.composedPath().includes(u);){if(r.currentTarget=u,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)n.notifyTarget(r,"touchendoutside");else if(js(r.pointerType)){var h=2===r.button;n.notifyTarget(r,h?"rightupoutside":"mouseupoutside")}u=u.parent}delete a.pressTargetsByButton[t.button],l=u}if(l){var c=n.clonePointerEvent(r,"click");c.target=l,c.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:c.target,timeStamp:i});var d=a.clicksByButton[t.button];d.target===c.target&&i-d.timeStamp<200?++d.clickCount:d.clickCount=1,d.target=c.target,d.timeStamp=i,c.detail=d.clickCount,js(c.pointerType)?(n.dispatchEvent(c,"click"),2===d.clickCount&&n.dispatchEvent(c,"dblclick")):"touch"===c.pointerType&&n.dispatchEvent(c,"tap"),n.dispatchEvent(c,"pointertap"),n.freeEvent(c)}n.freeEvent(r)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUpOutside=function(t,e){if(t instanceof Os){var i=n.trackingData(t.pointerId),r=n.findMountedTarget(i.pressTargetsByButton[t.button]),o=n.createPointerEvent(t,t.type,e);if(r){for(var a=r;a;)o.currentTarget=a,n.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?n.notifyTarget(o,"touchendoutside"):js(o.pointerType)&&n.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),a=a.parent;delete i.pressTargetsByButton[t.button]}n.freeEvent(o)}else console.warn("EventManager cannot map a non-pointer event as a pointer event")},this.onWheel=function(t,e){if(t instanceof Hs){var i=n.createWheelEvent(t,e);n.dispatchEvent(i),n.freeEvent(i)}else console.warn("EventManager cannot map a non-wheel event as a wheel event")},this.rootTarget=e,this.mappingTable={},this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}return Se(t,[{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"dispatchEvent",value:function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}},{key:"mapEvent",value:function(t){var e;if(this.rootTarget){var n,i=this.mappingTable[t.type],r="".concat(t.canvasX,"-").concat(t.canvasY);if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[r])?n=this._prePointTargetCache[r]:(n=this.pickTarget(t.canvasX,t.canvasY),this._prePointTargetCache=Bs({},r,n)),i)for(var o=0,a=i.length;o<a;o++)i[o].fn(t,n);else console.warn("[EventManager]: Event mapping not defined for ".concat(t.type))}}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=0,r=n.length-1;i<r;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(var o=n.length-2;o>=0;o--)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){for(var e=[t],n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}},{key:"createPointerEvent",value:function(t,e,n){var i=this.allocateEvent(Os);return this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,i.target=n||this.pickTarget(i.global.x,i.global.y),"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t,e){var n=this.allocateEvent(Hs);return this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=e||this.pickTarget(n.global.x,n.global.y),n}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Os);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyPointerData",value:function(t,e){t instanceof Os&&e instanceof Os&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}},{key:"copyMouseData",value:function(t,e){t instanceof Ms&&e instanceof Ms&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset),e.viewport.copyFrom(t.viewport))}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Ds.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"allocateEvent",value:function(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);var n=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),null===(e=this.eventPool.get(n))||void 0===e||e.push(t)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeEventListener(e,n.fn,{once:!0}),n.fn.call(n.context,t);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeEventListener(e,n[i].fn,{once:!0}),n[i].fn.call(n[i].context,t);else this.emitDelegation(t,e)}},{key:"emitDelegation",value:function(t,e){var n=t.currentTarget._events["*"];if(n)if("fn"in n)n.fn.call(n.context,t,e);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,t,e)}},{key:"pickTarget",value:function(t,e){var n=this.rootTarget.pick(t,e);return n&&n.graphic?n.graphic:n&&n.group?n.group:t>=0&&t<=Yt(this.rootTarget,"width")&&e>=0&&e<=Yt(this.rootTarget,"height")?this.rootTarget:null}}]),t}(),Fs={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof Rs))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit:function(t,e){return this.dispatchEvent(new Is(t,e))}},zs={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Ns=function(){function t(e){var n=this;Ae(this,t),this.resolution=1,this.onPointerDown=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerData(t);n.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=0,r=e.length;i<r;i++){var o=e[i],a=n.bootstrapEvent(n.rootPointerEvent,o);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor)}},this.onPointerMove=function(t){if(!(n.supportsTouchEvents&&"touch"===t.pointerType||n.isEventOutsideOfTargetElement(t))){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var o=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor)}},this.onPointerUp=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.isEventOutsideOfTargetElement(t)?"outside":"",i=n.normalizeToPointerData(t),r=0,o=i.length;r<o;r++){var a=n.bootstrapEvent(n.rootPointerEvent,i[r]);a.type+=e,n.manager.mapEvent(a)}n.setCursor(n.manager.cursor)}},this.onPointerOverOut=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var o=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor)}},this.onWheel=function(t){var e=n.normalizeWheelEvent(t);n.manager.mapEvent(e)};var i=e.targetElement,r=e.resolution,o=e.rootNode,a=e.global,s=e.viewport,l=e.autoPreventDefault,u=void 0!==l&&l;this.manager=new Ws(o),this.globalObj=a,this.supportsPointerEvents=a.supportsPointerEvents,this.supportsTouchEvents=a.supportsTouchEvents,this.supportsMouseEvents=a.supportsMouseEvents,this.applyStyles=a.applyStyles,this.autoPreventDefault=u,this.eventsAdded=!1,this.viewport=s,this.rootPointerEvent=new Os,this.rootWheelEvent=new Hs,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=r,this.setTargetElement(i)}return Se(t,[{key:"release",value:function(){this.setTargetElement(null)}},{key:"setCursor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=this.applyStyles,n=this.domElement;if(this.currentCursor!==t){this.currentCursor=t;var i=this.cursorStyles[t];i?"string"==typeof i&&e?n.style.cursor=i:"function"==typeof i?i(t):"object"==Ht(i)&&e&&Object.assign(n.style,i):e&&jt(t)&&!$t(this.cursorStyles,t)&&(n.style.cursor=t)}}},{key:"setTargetElement",value:function(t){this.removeEvents(),this.domElement=t,this.addEvents()}},{key:"addEvents",value:function(){if(!this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}}},{key:"removeEvents",value:function(){if(this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}}},{key:"mapToViewportPoint",value:function(t){var e=this.viewport,n=t.x,i=t.y;return{x:n-e.x,y:i-e.y}}},{key:"mapToCanvasPoint",value:function(t){var e,n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t);if(n)return n;var i=t.clientX,r=t.clientY,o=this.domElement.getBoundingClientRect();return{x:i-o.left,y:r-o.top}}},{key:"normalizeToPointerData",value:function(t){var e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(var n=0,i=t.changedTouches.length;n<i;n++){var r=t.changedTouches[n];Dt(r.button)&&(r.button=0),Dt(r.buttons)&&(r.buttons=1),Dt(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Dt(r.width)&&(r.width=r.radiusX||1),Dt(r.height)&&(r.height=r.radiusY||1),Dt(r.tiltX)&&(r.tiltX=0),Dt(r.tiltY)&&(r.tiltY=0),Dt(r.pointerType)&&(r.pointerType="touch"),Dt(r.pointerId)&&(r.pointerId=r.identifier||0),Dt(r.pressure)&&(r.pressure=r.force||.5),Dt(r.twist)&&(r.twist=0),Dt(r.tangentialPressure)&&(r.tangentialPressure=0),Dt(r.layerX)&&(r.layerX=r.offsetX=r.clientX),Dt(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){var o=t;Dt(o.isPrimary)&&(o.isPrimary=!0),Dt(o.width)&&(o.width=1),Dt(o.height)&&(o.height=1),Dt(o.tiltX)&&(o.tiltX=0),Dt(o.tiltY)&&(o.tiltY=0),Dt(o.pointerType)&&(o.pointerType="mouse"),Dt(o.pointerId)&&(o.pointerId=1),Dt(o.pressure)&&(o.pressure=.5),Dt(o.twist)&&(o.twist=0),Dt(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}else e.push(t);return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.mapToCanvasPoint(t),i=n.x,r=n.y;e.canvas.x=i,e.canvas.y=r,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas);var o=this.mapToViewportPoint(e),a=o.x,s=o.y;return e.viewport.x=a,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.mapToCanvasPoint(e),i=n.x,r=n.y;t.canvas.x=i,t.canvas.y=r,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas);var o=this.mapToViewportPoint(t),a=o.x,s=o.y;return t.viewport.x=a,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=zs[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Ds.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}},{key:"isEventOutsideOfTargetElement",value:function(t){var e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}}]),t}();var Gs={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,anchor:[0,0],anchor3d:[0,0],postMatrix:new an},Us={fillColor:"black",fillOpacity:1,fill:null,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Vs={strokeColor:"black",strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:null},Ks=Object.assign({outerBorder:Object.assign(Object.assign({},Vs),{distance:0}),innerBorder:Object.assign(Object.assign({},Vs),{distance:0})},Vs),Ys={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:16,underline:0,lineThrough:0},Xs=Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null},Us),Ks),$s=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0},Xs),Gs);var qs=Object.assign(Object.assign({},$s),{startAngle:0,endAngle:Pe,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Zs=Object.assign(Object.assign({},$s),{points:[],segments:[],curveType:"linear",clipRange:1}),Js=Object.assign(Object.assign({},$s),{radius:1,startAngle:0,endAngle:Pe}),Qs=Object.assign(Object.assign({},$s),{width:0,height:0,borderRadius:0,path:[],clip:!1,visibleAll:!0}),tl=Object.assign(Object.assign({},$s),{path:"",width:0,height:0,borderRadius:0,clip:!1}),el=Object.assign(Object.assign({},$s),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"}),nl=Object.assign(Object.assign({},$s),{path:new Pa,customPath:function(){console.warn("空函数")}}),il=Object.assign(Object.assign({},$s),{points:[],borderRadius:0}),rl=Object.assign(Object.assign({},$s),{width:0,height:0,borderRadius:0}),ol=Object.assign(Object.assign({},$s),{width:0,height:0,borderRadius:0,length:0}),al=Object.assign(Object.assign({},$s),{symbolType:"circle",size:10,keepDirIn3d:!0}),sl=Object.assign(Object.assign(Object.assign({},$s),Ys),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ll=Object.assign(Object.assign({},$s),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ul=Object.assign(Object.assign({repeatX:"stretch",repeatY:"stretch",image:"",width:0,height:0},$s),{fill:!0}),hl=Object.assign(Object.assign({},ul),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:!0,backgroundFillColor:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeColor:"#000",backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),cl={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]},dl={};for(var fl in cl)$t(cl,fl)&&(dl[cl[fl]]=fl);var pl={to:{},get:{}};function vl(t,e,n){return Math.min(Math.max(e,t),n)}function gl(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}pl.get=function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];switch(t.substring(0,3).toLowerCase()){case"hsl":e=pl.get.hsl(t,i),n="hsl";break;case"hwb":e=pl.get.hwb(t,i),n="hwb";break;default:e=pl.get.rgb(t,i),n="rgb"}return e?{model:n,value:e}:null},pl.get.rgb=function(t){if(!t)return null;var e,n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var o=2*n;r[n]=parseInt(e.slice(o,o+2),16)}i&&(r[3]=Math.round(parseInt(i,16)/255*100)/100)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);i&&(r[3]=Math.round(parseInt(i+i,16)/255*100)/100)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],10);e[4]&&(r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(e=t.match(/(\D+)/)){if("transparent"===e[1])return[0,0,0,0];var a=cl[e[1]];return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r?(r[3]=1,r):null}return null}for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=vl(r[n],0,255);return r[3]=vl(r[3],0,1),r},pl.get.hsl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;var n=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){var i=parseFloat(n[4]);return e[0]=(parseFloat(n[1])+360)%360,e[1]=vl(parseFloat(n[2]),0,100),e[2]=vl(parseFloat(n[3]),0,100),e[3]=vl(isNaN(i)?1:i,0,1),e}return null},pl.get.hwb=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;var n=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){var i=parseFloat(n[4]);return e[0]=(parseFloat(n[1])%360+360)%360,e[1]=vl(parseFloat(n[2]),0,100),e[2]=vl(parseFloat(n[3]),0,100),e[3]=vl(isNaN(i)?1:i,0,1),e}return null},pl.to.hex=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return"#"+gl(i[0])+gl(i[1])+gl(i[2])+(i[3]<1?gl(Math.round(255*i[3])):"")},pl.to.rgb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return i.length<4||1===i[3]?"rgb("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+")":"rgba("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+", "+i[3]+")"},pl.to.rgb.percent=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e,r=Math.round(i[0]/255*100),o=Math.round(i[1]/255*100),a=Math.round(i[2]/255*100);return i.length<4||1===i[3]?"rgb("+r+"%, "+o+"%, "+a+"%)":"rgba("+r+"%, "+o+"%, "+a+"%, "+i[3]+")"},pl.to.hsl=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e;return i.length<4||1===i[3]?"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)":"hsla("+i[0]+", "+i[1]+"%, "+i[2]+"%, "+i[3]+")"},pl.to.hwb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e,r="";return i.length>=4&&1!==i[3]&&(r=", "+i[3]),"hwb("+i[0]+", "+i[1]+"%, "+i[2]+"%"+r+")"},pl.to.keyword=function(t){return dl[t.slice(0,3)]};var yl,ml=pl;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(yl||(yl={}));var bl=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"Get",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(n===yl.Color1){var r=t.store1[e];if(r)return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i;if((r=pl.get(e))&&r.value){var o=r.value,a=[o[0]/255,o[1]/255,o[2]/255,o[3]];t.store1[e]=a,t.store255[e]=o,i[0]=a[0],i[1]=a[1],i[2]=a[2],i[3]=a[3]}return i}var s=t.store255[e];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;if((s=pl.get(e))&&s.value){var l=s.value;t.store1[e]=[l[0]/255,l[1]/255,l[2]/255,l[3]],t.store255[e]=l,i[0]=l[0],i[1]=l[1],i[2]=l[2],i[3]=l[3]}return i}},{key:"Set",value:function(e,n,i){if(n===yl.Color1){if(t.store1[e])return;t.store1[e]=i,t.store255[e]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(t.store255[e])return;t.store255[e]=i,t.store1[e]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}]),t}();function wl(t,e,n,i,r){var o,a,s=!1,l=!1;if(Array.isArray(t)?o=t:"string"==typeof t?o=bl.Get(t,yl.Color255):s=!0,Array.isArray(e)?a=e:"string"==typeof e?a=bl.Get(e,yl.Color255):l=!0,s!==l)return!1;if(s){if(t.gradient===e.gradient){var u=t,h=e,c=u.stops,d=h.stops;if(c.length!==d.length)return!1;if("linear"===u.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:_l(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(u,h,n);if("radial"===u.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:_l(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(u,h,n);if("conical"===u.gradient)return function(t,e,n){var i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:_l(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}(u,h,n)}return!1}r&&r(o,a);var f=function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(o,a,n);return i?"rgb(".concat(Math.round(f[0]),",").concat(Math.round(f[1]),",").concat(Math.round(f[2]),",").concat(f[3].toFixed(2),")"):"rgb(".concat(Math.round(f[0]),",").concat(Math.round(f[1]),",").concat(Math.round(f[2]),")")}bl.store255={},bl.store1={};var xl=[0,0,0,0],Cl=[0,0,0,0];function _l(t,e,n){return bl.Get(t,yl.Color255,xl),bl.Get(e,yl.Color255,Cl),"rgba(".concat(Math.round(xl[0]+(Cl[0]-xl[0])*n),",").concat(Math.round(xl[1]+(Cl[1]-xl[1])*n),",").concat(Math.round(xl[2]+(Cl[2]-xl[2])*n),",").concat(xl[3]+(Cl[3]-xl[3])*n,")")}var kl={arc:qs,area:Zs,circle:Js,line:el,path:nl,symbol:al,text:sl,rect:rl,rect3d:ol,polygon:il,richtext:ll,richtextIcon:hl,image:ul,group:Qs,glyph:tl},Sl=Object.keys(kl);function Al(){return{arc:Object.assign({},kl.arc),area:Object.assign({},kl.area),circle:Object.assign({},kl.circle),line:Object.assign({},kl.line),path:Object.assign({},kl.path),symbol:Object.assign({},kl.symbol),text:Object.assign({},kl.text),rect:Object.assign({},kl.rect),rect3d:Object.assign({},kl.rect3d),polygon:Object.assign({},kl.polygon),richtext:Object.assign({},kl.richtext),richtextIcon:Object.assign({},kl.richtextIcon),image:Object.assign({},kl.image),group:Object.assign({},kl.group),glyph:Object.assign({},kl.glyph)}}var Bl=new Array(60).fill(0).map((function(){return Al()})),Rl=function(){function t(){Ae(this,t),this._defaultTheme=Bl.pop()||Al(),this.combinedTheme=this._defaultTheme,this.dirty=!1}return Se(t,[{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,e){if(this.dirty){var n=this.getParentWithTheme(t);if(n){var i=n.theme;i.dirty&&i.applyTheme(n,e),function(t,e){e&&Object.keys(e).forEach((function(n){t[n]?Object.assign(t[n],e[n]):t[n]=e[n]}))}(e,i.userTheme)}this.userTheme?this.doCombine(e):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this.userTheme,n=this._defaultTheme,i=this.combinedTheme,r=t.common||{},o=Object.assign(r,this.commonTheme);Sl.forEach((function(r){var a,s;e[r]||o||t[r]?i[r]=Object.assign({},n[r],null!=o?o:{},null!==(a=t[r])&&void 0!==a?a:{},null!==(s=e[r])&&void 0!==s?s:{}):i[r]=n[r]})),this.dirty=!1}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"setTheme",value:function(t,e){var n=this.userTheme;n?Object.keys(t).forEach((function(e){n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}]),t}(),Tl=new Rl;function Ml(t,e){return t.glyphHost?Ml(t.glyphHost):e?(t.isContainer,e):function(t){var e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Tl.getTheme()}return null}(t)||Tl.getTheme()}var Pl=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"GetImage",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?TC.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&TC.getRequestAnimationFrame()((function(){n.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=TC.loadImage(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetSvg",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?TC.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&TC.getRequestAnimationFrame()((function(){n.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=TC.loadSvg(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetFile",value:function(e,n){var i=t.cache.get(e);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((function(t){return t.data})):Promise.resolve(i.data):(i={type:n,loadState:"init"},t.cache.set(e,i),"arrayBuffer"===n?i.dataPromise=TC.loadArrayBuffer(e):"blob"===n?i.dataPromise=TC.loadBlob(e):"json"===n&&(i.dataPromise=TC.loadJson(e)),i.dataPromise.then((function(t){return t.data})))}}]),t}();function Ol(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Pl.cache=new Map;var El=new an,Hl=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Ll=["x","y"],Il=["scaleX","scaleY"],Dl=["angle"],jl=0;function Wl(){return jl++}var Fl=new Ge,zl=function(t){Ke(n,t);var e=Ol(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ae(this,n),(t=e.call(this))._AABBBounds=new Qe,t._updateTag=ps.INIT,t.attribute=i,t.valid=t.isValid(),i.background&&t.loadImage(i.background,!0),t}return Se(n,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"OBBBounds",get:function(){return this.tryUpdateOBBBounds()}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attribute,i=n.dx,r=void 0===i?t.dx:i,o=n.dy,a=void 0===o?t.dy:o;if(e&&this.parent){var s=Ml(this.parent).group,l=this.parent.attribute,u=l.scrollX,h=void 0===u?s.scrollX:u,c=l.scrollY,d=void 0===c?s.scrollY:c;Fl.x=r+h,Fl.y=a+d}else Fl.x=r,Fl.y=a;return Fl}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;OC.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return OC.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new an),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&ps.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&ps.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&ps.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&ps.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&ps.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&ps.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=ps.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:IC;if(n===vs.GLOBAL){var r=new Ge(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),t=r.x,e=r.y}return i.containsPoint(this,{x:t,y:e})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=Object.keys(t),r=0;r<i.length;r++){var o=i[r];this.attribute[o]=t[o]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(n)}},{key:"setAttribute",value:function(t,e,n,i){var r,o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(Bs({},t,e),this.attribute,t,i);o?this._setAttributes(o,n,i):Ot(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Hl.length;e++){var n=Hl[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Hl.length;e++)if(t===Hl[e])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:gs.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=ps.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var n,i;if(0===t&&0===e)return this;var r={type:gs.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ll,r);o&&(t=o.x,e=o.y,delete o.x,delete o.y,this._setAttributes(o));var a=this.attribute,s=a.postMatrix;return s?PC.fromMatrix(s,s).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Gs.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Gs.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var n=this.attribute;if(n.x===t&&n.y===e)return this;var i={type:gs.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ll,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this)}},{key:"scale",value:function(t,e,n){var i,r;if(1===t&&1===e)return this;var o={type:gs.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,Il,o);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));var s=this.attribute;if(n){var l=this.attribute.postMatrix;l||(l=new an,s.postMatrix=l),PC.fromMatrix(l,l).scale(t,e,n)}else s.scaleX=(null!==(i=s.scaleX)&&void 0!==i?i:Gs.scaleX)*t,s.scaleY=(null!==(r=s.scaleY)&&void 0!==r?r:Gs.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(o),this}},{key:"scaleTo",value:function(t,e){var n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;var i={type:gs.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Il,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(i),this)}},{key:"rotate",value:function(t){var e;if(0===t)return this;var n={type:gs.ROTATE},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Dl,n);if(i)return this._setAttributes(i,!1,n),this;var r=this.attribute;return r.angle=(null!==(e=r.angle)&&void 0!==e?e:Gs.angle)+t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var n={type:gs.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Dl,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.onAttributeUpdate(n),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var n=new XC(null==t?void 0:t.id).bind(this);if(t){var i=t.onStart,r=t.onFrame,o=t.onEnd,a=t.onRemove;null!=i&&n.onStart(i),null!=r&&n.onFrame(r),null!=o&&n.onEnd(o),null!=a&&n.onRemove(a),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((function(){e.animates.delete(n.id)})),n}},{key:"onAttributeUpdate",value:function(t){OC.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t)}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!Ot(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,n,i){var r,o,a,s,l=this;if(n){var u=Object.keys(t),h=i?u.reduce((function(e,n){return e[n]=void 0===t[n]?l.getDefaultAttribute(n):t[n],e}),{}):t,c=this.animate();c.stateNames=e,c.to(h,null!==(o=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==o?o:ZC.duration,null!==(s=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==s?s:ZC.easing)}else this.setAttributes(t,!1,{type:gs.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,n={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(n[t]=e.normalAttrs[t],delete e.normalAttrs[t]):n[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(n){t[n]=e.normalAttrs[n]}))):Object.keys(t).forEach((function(t){n[t]=e.getNormalAttribute(t)})),this.normalAttrs=n}},{key:"getNormalAttribute",value:function(t){var e=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var i=n.getEndProps();$t(i,t)&&(e=i[t])}})),e}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var n=this.currentStates.filter((function(e){return e!==t}));this.useStates(n,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}},{key:"addState",value:function(t,e,n){var i;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){var r={};t.forEach((function(e){var n,o=i.stateProxy?i.stateProxy(e,t):null===(n=i.states)||void 0===n?void 0:n[e];o&&Object.assign(r,o)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=ps.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=ps.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=ps.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&ps.UPDATE_SHAPE_AND_BOUNDS)===ps.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=ps.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ps.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ps.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=ps.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=ps.CLEAR_GLOBAL_MATRIX}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?Gs.x:e,i=t.y,r=void 0===i?Gs.y:i,o=t.scaleX,a=void 0===o?Gs.scaleX:o,s=t.scaleY,l=void 0===s?Gs.scaleY:s,u=t.angle,h=void 0===u?Gs.angle:u,c=t.anchor,d=t.postMatrix,f=[0,0];if(c){if("string"==typeof c[0]){var p=parseFloat(c[0])/100,v=this.AABBBounds;f[0]=v.x1+(v.x2-v.x1)*p}else f[0]=c[0];if("string"==typeof c[1]){var g=parseFloat(c[1])/100,y=this.AABBBounds;f[1]=y.x1+(y.x2-y.x1)*g}else f[1]=c[1]}!function(t,e,n,i,r,o,a,s){var l,u,h=e.a,c=e.b,d=e.c,f=e.d,p=e.e,v=e.f,g=He(a),y=De(a);s?(l=s[0],u=s[1]):(l=n,u=i);var m=l-n,b=u-i,w=h*g+d*y,x=c*g+f*y,C=d*g-h*y,_=f*g-c*y;t.a=r*w,t.b=r*x,t.c=o*C,t.d=o*_,t.e=p+h*l+d*u-w*m-C*b,t.f=v+c*l+f*u-x*m-_*b}(this._transMatrix,this._transMatrix.reset(),n,r,a,l,h,c&&f);var m=this.getOffsetXY(Gs);if(this._transMatrix.e+=m.x,this._transMatrix.f+=m.y,d){var b=El.setValue(d.a,d.b,d.c,d.d,d.e,d.f),w=this._transMatrix;b.multiply(w.a,w.b,w.c,w.d,w.e,w.f),w.setValue(b.a,b.b,b.c,b.d,b.e,b.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,n=void 0===e?0:e,i=t.scrollY,r=void 0===i?0:i;this._globalTransMatrix.translate(n,r)}}},{key:"setStage",value:function(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),OC.onSetStage(this,t))}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:gs.ANIMATE_END})}},{key:"onStep",value:function(t,e,n,i,r){var o={};if(n.customAnimate)n.customAnimate.update(r,i,o);else{var a=n.props,s=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,o,n,i,r,a,void 0,s,l)}this.setAttributes(o,!1,{type:gs.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,n,i,r,o,a,s,l,u){var h=this;u||(u=Object.keys(a),i.propKeys=u),o?i.propKeys.forEach((function(t){e.validAttr(t)&&(n[t]=a[t])})):u.forEach((function(o){var u;if(e.validAttr(o)){var c=a[o],d=null!==(u=s&&s[o])&&void 0!==u?u:t.getLastPropByName(o,i);e.interpolateFunc&&e.interpolateFunc(o,r,d,c,n)||(e.customInterpolate(o,r,d,c,h,n)||h.defaultInterpolate(c,d,o,n,l,r)||h._interpolate(o,r,d,c,n))}})),i.parsedProps=l}},{key:"defaultInterpolate",value:function(t,e,n,i,r,o){if(Number.isFinite(t))return i[n]=e+(t-e)*o,!0;if("fillColor"===n){r||(r={});var a=r.fillColorArray,s=wl(e,null!=a?a:t,o,!1,(function(t,e){r.fillColorArray=e}));return s&&(i[n]=s),!0}if("strokeColor"===n){r||(r={});var l=r.strokeColorArray,u=wl(e,null!=l?l:t,o,!1,(function(t,e){r.strokeColorArray=e}));return u&&(i[n]=u),!0}if("shadowColor"===n){r||(r={});var h=r.shadowColorArray,c=wl(e,null!=h?h:t,o,!0,(function(t,e){r.shadowColorArray=e}));return c&&(i[n]=c),!0}return!1}},{key:"_interpolate",value:function(t,e,n,i,r){}},{key:"getDefaultAttribute",value:function(t){return Ml(this)[this.type][t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:OC.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return jt(t,!0)?this.pathProxy=(new Pa).fromString(t):this.pathProxy=new Pa,this.pathProxy}},{key:"loadImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n=t;this.resources||(this.resources=new Map);var i,r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",i=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(i)||function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)}(t)?(Pl.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(Pl.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||e)}}},{key:"imageLoadSuccess",value:function(t,e,n){if(this.resources){var i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var n=this.resources.get(t);n&&(n.state="fail",e&&e())}}},{key:"release",value:function(){this.releaseStatus="released"}},{key:"_emitCustomEvent",value:function(t,e){var n,i,r=new Is(t,e);r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}]),n}(As);function Nl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}zl.mixin(Fs);var Gl=Wl(),Ul=["radius","startAngle","endAngle"].concat(ie(Hl)),Vl=function(t){Ke(n,t);var e=Nl(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return Ae(this,n),(t=e.call(this,i)).type="circle",t.numberType=Gl,t}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.radius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}},{key:"doUpdateAABBBounds",value:function(t){var e=Ml(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=OC.updateCircleAABBBounds(n,Ml(this).circle,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Ya(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).circle[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Ul.length;e++){var n=Ul[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Ul.length;e++)if(t===Ul[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t,e,n,i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),o=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),s=new Pa;return s.arc(0,0,r,o,a),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl),Kl=function(){function t(e,n,i){Ae(this,t),this.fontFamily=e,this.textOptions=n,this.textMeasure=i}return Se(t,[{key:"LayoutBBox",value:function(t,e,n){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,n,i,r,o,a,s){for(var l=[],u=[e,n],h=[0,0];t.length>0;){var c=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a).str;l.push({str:c,width:this.textMeasure.measureTextWidth(c,this.textOptions)}),t=t.substring(c.length)}"left"===i||"start"===i||("center"===i?h[0]=u[0]/-2:"right"!==i&&"end"!==i||(h[0]=-u[0])),"top"===r||("middle"===r?h[1]=u[1]/-2:"bottom"===r&&(h[1]=-u[1]));var d={xOffset:h[0],yOffset:h[1],width:u[0],height:u[1]};return this.layoutWithBBox(d,l,i,r,o)}},{key:"GetLayoutByLines",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=arguments.length>5?arguments[5]:void 0;t=t.map((function(t){return t.toString()}));var a=[],s=[0,0];if("number"==typeof o&&o!==1/0){for(var l,u=0,h=t.length;u<h;u++)l=Math.min(this.textMeasure.measureTextWidth(t[u],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[u],this.textOptions,l,r).str,width:l});s[0]=o}else{var c,d;o=0;for(var f=0,p=t.length;f<p;f++)d=t[f],c=this.textMeasure.measureTextWidth(d,this.textOptions),o=Math.max(o,c),a.push({str:d,width:c});s[0]=o}s[1]=a.length*i;var v={xOffset:0,yOffset:0,width:s[0],height:s[1]};return this.LayoutBBox(v,e,n),this.layoutWithBBox(v,a,e,n,i)}},{key:"layoutWithBBox",value:function(t,e,n,i,r){var o=[0,0],a=e.length*r;"top"===i||("middle"===i?o[1]=(t.height-a)/2:"bottom"===i&&(o[1]=t.height-a));for(var s=0;s<e.length;s++)this.lineOffset(t,e[s],n,i,r,o);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}},{key:"lineOffset",value:function(t,e,n,i,r,o){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=.79*r+o[1],o[1]+=r,e}}]),t}();function Yl(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Xl=Wl(),$l=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight"].concat(ie(Hl)),ql=function(t){Ke(n,t);var e=Yl(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return Ae(this,n),(t=e.call(this,i)).type="text",t.numberType=Xl,t.cache={},t}return Se(n,[{key:"font",get:function(){var t=Ml(this).text;return this._font||(this._font=Ro(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,n=Ml(this).text;if(!Array.isArray(e.text)){var i=e.maxLineWidth,r=void 0===i?n.maxLineWidth:i;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}}},{key:"clipedWidth",get:function(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Ml(this).text,e=this.attribute;if(!Array.isArray(e.text)){var n=e.maxLineWidth,i=void 0===n?t.maxLineWidth:n;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),this.clipedText===e.text)}}},{key:"multilineLayout",get:function(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateTextAABBBounds(e,t,this._AABBBounds,this);return this.clearUpdateBoundTag(),n}},{key:"updateAABBBounds",value:function(){var t=Ml(this).text,e=this.attribute,n=OC.updateTextAABBBounds(e,Ml(this).text,this._AABBBounds,this),i=this.attribute.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"updateSingallineAABBBounds",value:function(t){var e,n,i,r=Ml(this).text,o=MC.textMeasure,a=this.attribute,s=a.maxLineWidth,l=void 0===s?r.maxLineWidth:s,u=a.ellipsis,h=void 0===u?r.ellipsis:u,c=a.textAlign,d=void 0===c?r.textAlign:c,f=a.textBaseline,p=void 0===f?r.textBaseline:f,v=a.fontSize,g=void 0===v?r.fontSize:v,y=a.stroke,m=void 0===y?r.stroke:y,b=a.lineHeight,w=void 0===b?null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||r.fontSize)+2:b,x=a.lineWidth,C=void 0===x?r.lineWidth:x;if(!this.shouldUpdateShape()&&this.cache){var _=To(d,n=this.cache.clipedWidth),k=Mo(p,w);return this._AABBBounds.set(_,k,_+n,k+w),m&&this._AABBBounds.expand(C/2),this._AABBBounds}if(Number.isFinite(l)){if(h){var S=!0===h?r.ellipsis:h,A=o.clipTextWithSuffix(t.toString(),{fontSize:g},l,S);i=A.str,n=A.width}else{var B=o.clipText(t.toString(),{fontSize:g},l);i=B.str,n=B.width}this.cache.clipedText=i,this.cache.clipedWidth=n}else n=o.measureTextWidth(t.toString(),{fontSize:g}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();var R=To(d,n),T=Mo(p,w);return this._AABBBounds.set(R,T,R+n,T+w),m&&this._AABBBounds.expand(C/2),this._AABBBounds}},{key:"updateMultilineAABBBounds",value:function(t){var e,n=Ml(this).text,i=this.attribute,r=i.fontFamily,o=void 0===r?n.fontFamily:r,a=i.textAlign,s=void 0===a?n.textAlign:a,l=i.textBaseline,u=void 0===l?n.textBaseline:l,h=i.fontSize,c=void 0===h?n.fontSize:h,d=i.lineHeight,f=void 0===d?i.lineHeight||i.fontSize||n.fontSize:d,p=i.ellipsis,v=void 0===p?n.ellipsis:p,g=i.maxLineWidth,y=i.stroke,m=void 0===y?n.stroke:y,b=i.lineWidth,w=void 0===b?n.lineWidth:b;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){var x=this.cache.layoutData.bbox;return this._AABBBounds.set(x.xOffset,x.yOffset,x.xOffset+x.width,x.yOffset+x.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}var C=MC.textMeasure,_=new Kl(o,{fontSize:c},C).GetLayoutByLines(t,s,u,f,!0===v?n.ellipsis:v||void 0,g),k=_.bbox;return this.cache.layoutData=_,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).text[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<$l.length;e++){var n=$l[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<$l.length;e++)if(t===$l[e])return!0;return!1}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function Zl(t,e,n,i,r){return r?t.arc(n,i,e,0,Me,!1,r):t.arc(n,i,e,0,Me),!1}var Jl=function(){function t(){Ae(this,t),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}return Se(t,[{key:"draw",value:function(t,e,n,i,r){return Zl(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return Zl(t,e/2+r,n,i,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Ql=new Jl;var tu=function(){function t(){Ae(this,t),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}return Se(t,[{key:"draw",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return function(t,e,n,i,r,o){return t.moveTo(-3*e+n-r,-e+i-r,o),t.lineTo(-e+n-r,-e+i-r,o),t.lineTo(-e+n-r,-3*e+i-r,o),t.lineTo(e+n+r,-3*e+i-r,o),t.lineTo(e+n+r,-e+i-r,o),t.lineTo(3*e+n+r,-e+i-r,o),t.lineTo(3*e+n+r,e+i+r,o),t.lineTo(e+n+r,e+i+r,o),t.lineTo(e+n+r,3*e+i+r,o),t.lineTo(-e+n-r,3*e+i+r,o),t.lineTo(-e+n-r,e+i+r,o),t.lineTo(-3*e+n-r,e+i+r,o),t.closePath(),!0}(t,e/6,n,i,r,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),eu=new tu;function nu(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var iu=function(){function t(){Ae(this,t),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}return Se(t,[{key:"draw",value:function(t,e,n,i,r){return nu(t,e/2,n,i,r)}},{key:"drawFitDir",value:function(t,e,n,i,r){return nu(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,o){return nu(t,e/2+r,n,i,o)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),ru=new iu;function ou(t,e,n,i){var r=2*e;return t.rect(n-e,i-e,r,r),!1}var au=function(){function t(){Ae(this,t),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return ou(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ou(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),su=new au;function lu(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}var uu=function(){function t(){Ae(this,t),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return lu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),hu=new uu;function cu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var du=function(t){Ke(n,t);var e=cu(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).type="triangle",t}return Se(n)}(uu),fu=new du,pu=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),vu=Math.sin(Me/10)*pu,gu=-Math.cos(Me/10)*pu;function yu(t,e,n,i){var r=vu*e,o=gu*e;t.moveTo(n,-e+i),t.lineTo(r+n,o+i);for(var a=1;a<5;++a){var s=Me*a/5,l=Math.cos(s),u=Math.sin(s);t.lineTo(u*e+n,-l*e+i),t.lineTo(l*r-u*o+n,u*r+l*o+i)}return t.closePath(),!0}var mu=function(){function t(){Ae(this,t),this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}return Se(t,[{key:"draw",value:function(t,e,n,i){return yu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return yu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),bu=new mu,wu=je(3);function xu(t,e,n,i){var r=e,o=r/wu,a=o/5,s=e;return t.moveTo(0+n,-r+i),t.lineTo(o/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,s+i),t.lineTo(-a/2+n,s+i),t.lineTo(-a/2+n,i),t.lineTo(-o/2+n,i),t.closePath(),!0}var Cu=function(){function t(){Ae(this,t),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return xu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return xu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),_u=new Cu;function ku(t,e,n,i){var r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Su=function(){function t(){Ae(this,t),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return ku(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ku(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Au=new Su;function Bu(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Ru=function(){function t(){Ae(this,t),this.type="stroke",this.pathStr=""}return Se(t,[{key:"draw",value:function(t,e,n,i){return Bu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Bu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Tu=new Ru,Mu=-.5,Pu=je(3)/2,Ou=1/je(12);function Eu(t,e,n,i){var r=e/2,o=e*Ou,a=r,s=e*Ou+e,l=-a,u=s;return t.moveTo(r+n,o+i),t.lineTo(a+n,s+i),t.lineTo(l+n,u+i),t.lineTo(Mu*r-Pu*o+n,Pu*r+Mu*o+i),t.lineTo(Mu*a-Pu*s+n,Pu*a+Mu*s+i),t.lineTo(Mu*l-Pu*u+n,Pu*l+Mu*u+i),t.lineTo(Mu*r+Pu*o+n,Mu*o-Pu*r+i),t.lineTo(Mu*a+Pu*s+n,Mu*s-Pu*a+i),t.lineTo(Mu*l+Pu*u+n,Mu*u-Pu*l+i),t.closePath(),!1}var Hu=function(){function t(){Ae(this,t),this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}return Se(t,[{key:"draw",value:function(t,e,n,i){return Eu(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Eu(t,e/2+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Lu=new Hu;var Iu=function(){function t(){Ae(this,t),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Du=new Iu;var ju=function(){function t(){Ae(this,t),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Wu=new ju;var Fu=function(){function t(){Ae(this,t),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),zu=new Fu;function Nu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Gu=je(3);function Uu(t,e,n,i){var r=e*Gu;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Vu=function(t){Ke(n,t);var e=Nu(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return Se(n,[{key:"draw",value:function(t,e,n,i){return Uu(t,e/2/Gu,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Uu(t,e/2/Gu+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),n}(uu),Ku=new Vu;function Yu(t,e,n,i){var r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Xu=function(){function t(){Ae(this,t),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.5 0.5"}return Se(t,[{key:"draw",value:function(t,e,n,i){return Yu(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Yu(t,e/4+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),$u=new Xu;function qu(t,e,n,i){var r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Zu=function(){function t(){Ae(this,t),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5"}return Se(t,[{key:"draw",value:function(t,e,n,i){return qu(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return qu(t,e/4+r,n,i)}},{key:"bounds",value:function(t,e){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}]),t}(),Ju=new Zu;function Qu(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}var th=function(){function t(){Ae(this,t),this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}return Se(t,[{key:"draw",value:function(t,e,n,i){return Qu(t,Nt(e)?[e,e]:e,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Qu(t,Nt(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],n,i)}},{key:"bounds",value:function(t,e){var n=Nt(t)?[t,t]:t;e.x1=-n[0]/2,e.x2=n[0]/2,e.y1=-n[1]/2,e.y2=n[1]/2}}]),t}(),eh=new th,nh=function(){function t(e,n){Ae(this,t),this.pathStr="",this.type=e,this.path=n}return Se(t,[{key:"drawOffset",value:function(t,e,n,i,r){return _a(this.path.commandList,t,n,i,e+r,e+r),!1}},{key:"draw",value:function(t,e,n,i){return _a(this.path.commandList,t,n,i,e,e),!1}},{key:"bounds",value:function(t,e){this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}]),t}(),ih={};function rh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}[Ql,eu,ru,su,Ku,fu,bu,_u,Au,Tu,Lu,Du,Wu,hu,zu,$u,Ju,eh].forEach((function(t){ih[t.type]=t}));var oh=Wl(),ah=["symbolType","size"].concat(ie(Hl)),sh=function(t){Ke(n,t);var e=rh(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return Ae(this,n),(t=e.call(this,i)).type="symbol",t.numberType=oh,t}return Se(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return Wt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t=Ml(this).symbol,e=this.attribute.symbolType,i=void 0===e?t.symbolType:e,r=ih[i];if(r)return this._parsedPath=r,r;if(r=n.userSymbolMap[i])return this._parsedPath=r,r;var o=(new Pa).fromString(i),a=o.bounds.width(),s=o.bounds.height(),l=1/Le(a,s);return o.transform(0,0,l,l),this._parsedPath=new nh(i,o),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Ml(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=OC.updateSymbolAABBBounds(n,Ml(this).symbol,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Ya(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).symbol[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<ah.length;e++){var n=ah[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<ah.length;e++)if(t===ah[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),e=this.attribute.size,n=Wt(e)?e:[e,e];return t.path?(new Pa).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Pa).fromString(t.pathStr,0,0,n[0],n[1])}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}sh.userSymbolMap={};var uh=Wl(),hh=["segments","points","curveType"].concat(ie(Hl)),ch=function(t){Ke(n,t);var e=lh(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ae(this,n),(t=e.call(this,i)).type="line",t.numberType=uh,t}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ja(n,i,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateLineAABBBounds(e,Ml(this).line,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).line[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<hh.length;e++){var n=hh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<hh.length;e++)if(t===hh[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new Pa,n=t.segments,i=function(t){if(t&&t.length){var n=!0;t.forEach((function(t){!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((function(t){i(t.points)})):t.points&&i(t.points),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function dh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var fh=Wl(),ph=["width","height","borderRadius"].concat(ie(Hl)),vh=function(t){Ke(n,t);var e=dh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="rect",i.numberType=fh,i}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.width,n=t.height;return this._validNumber(e)&&this._validNumber(n)}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateRectAABBBounds(e,Ml(this).rect,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).rect[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<ph.length;e++){var n=ph[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<ph.length;e++)if(t===ph[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute,e=t.width,n=t.height,i=new Pa;return i.moveTo(0,0),i.rect(0,0,e,n),i}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function gh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var yh=Wl(),mh=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],bh=function(t){Ke(n,t);var e=gh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="rect3d",i.numberType=yh,i}return Se(n,[{key:"findFace",value:function(){for(var t={polygons:[],vertices:[],edges:[]},e=Ml(this).rect3d,n=this.attribute,i=n.width,r=void 0===i?e.width:i,o=n.height,a=void 0===o?e.width:o,s=n.length,l=void 0===s?Ie(e.width,e.height):s,u=0;u<mh.length;u++){var h=mh[u];t.vertices.push([h[0]*r,h[1]*a,h[2]*l])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}]),n}(vh);var wh=Wl(),xh=function(){function t(e,n,i){Ae(this,t),this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic","number"==typeof i.lineHeight?this.lineHeight=i.lineHeight>this.fontSize?i.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;var r=Th(e,i),o=r.ascent,a=r.height,s=r.descent,l=r.width,u=0,h=0,c=0;this.height>a&&(u=(this.height-a)/2,h=Math.ceil(u),c=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=a-u):"bottom"===this.textBaseline?(this.ascent=a-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+h,this.descent=s+c),this.length=e.length,this.width=l||0,this.text=e||"",this.newLine=n||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}return Se(t,[{key:"updateWidth",value:function(){var t=Th(this.text,this.character).width;this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}},{key:"draw",value:function(t,e,n,i,r){var o=this.text,a=this.left+n;e+=this.top;var s=this.direction;if(this.verticalEllipsis)o="...",s="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)o+="...","right"===r&&(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){var l=Bh(o,("vertical"===s?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,o.length-1);if(o=o.slice(0,l),o+="...","right"===r){var u=Th(this.text.slice(l),this.character).width;"vertical"===s||(a-=this.ellipsisWidth-u)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}this.character.stroke&&(function(t,e){t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=e&&e.strokeColor||_h.strokeColor.value;var n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(o,a,e)),function(t,e){t.globalAlpha=1,t.fillStyle=e&&e.fillColor||_h.fillColor.value;var n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),"vertical"===s&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.fill&&t.fillText(o,a,e),(this.character.stroke||this.character.fill)&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===s&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){var i=Bh(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,i),e+="...";var r=Th(this.text.slice(i),this.character).width;return n+this.ellipsisWidth-r}return n}}]),t}(),Ch={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},_h={fontSize:16,fontFamily:"sans-serif",fill:!0,stroke:!1,fillColor:{value:"black"},strokeColor:{value:"black"},fontWeight:"normal",lineHeight:"normal",fontStyle:"normal",textDecoration:"none",textAlign:"left",script:"normal"},kh=(String.fromCharCode(160),/\w|\(|\)/),Sh=/[.?!,;:/,。?!、;:]/,Ah=/\S/;function Bh(t,e,n,i,r){if(!e||e<=0)return 0;for(var o=MC.textMeasure,a=i,s=t.slice(0,a),l=Math.floor(o.measureText(s,n).width),u=t.slice(0,a+1),h=Math.floor(o.measureText(u,n).width);l>e||h<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}s=t.slice(0,a),l=Math.floor(o.measureText(s,n).width),u=t.slice(0,a+1),h=Math.floor(o.measureText(u,n).width)}return r&&(a=Rh(t,a)),a}function Rh(t,e){for(var n=e;kh.test(t[n-1])&&kh.test(t[n])||Sh.test(t[n]);)if(--n<=0)return e;return n}function Th(t,e){var n=MC.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var Mh=function(){function t(e,n,i,r,o,a,s,l,u,h,c,d,f,p){Ae(this,t),this.left=e,this.top=n,this.width=i,this.height=r,this.actualHeight=0,this.bottom=n+r,this.right=e+i,this.ellipsis=o,this.wordBreak=a,this.verticalDirection=s,this.lines=[],this.globalAlign=l,this.globalBaseline=u,this.layoutDirection=h,this.directionKey=Ch[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=d,this.singleLine=f,p?(p.clear(),this.icons=p):this.icons=new Map}return Se(t,[{key:"draw",value:function(t,e){var n=this.getActualSize(),i=n.width,r=n.height,o=this.isWidthMax?Math.min(this.width,i):this.width||i||0,a=this.isHeightMax?Math.min(this.height,r):this.height||r||0;a=Math.min(a,r);var s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-a/2;break;case"bottom":s=-a}var l=0;switch(this.globalAlign){case"left":l=0;break;case"center":l=-o/2;break;case"right":l=-o}var u=this[this.directionKey.height];this.singleLine&&(u=this.lines[0].height+1);var h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=u&&0!==u)for(var c=0;c<this.lines.length;c++){var d=this.lines[c],f=d.top,p=d.height;if(f+p<this[this.directionKey.top]||f+p>this[this.directionKey.top]+u)return h;var v=!1;this.ellipsis&&this.lines[c+1]&&this.lines[c+1].top+this.lines[c+1].height>this[this.directionKey.top]+u&&(v=!0,h=!0),this.lines[c].draw(t,v,this.lines[c][this.directionKey.left]+l,this.lines[c][this.directionKey.top]+s,e)}else{var g=Math.floor((u-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=g:s+=g;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+l,this.lines[y][this.directionKey.top]+s,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var m=0;m<this.lines.length;m++){var b=this.lines[m],w=(b.top,b.height),x=u-this.lines[m].top-this.lines[m].height;if(0===u)this.lines[m].draw(t,!1,l,x+s,e);else{if(x+w>this[this.directionKey.top]+u||x<this[this.directionKey.top])return h;var C=!1;this.ellipsis&&this.lines[m+1]&&x-this.lines[m+1].height<this[this.directionKey.top]&&(C=!0,h=!0),this.lines[m].draw(t,C,l,x+s,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(var _=0;_<this.lines.length;_++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[_].height+this.lines[_].top);var k=this.lines[_],S=k.top,A=k.height;if(0===u)this.lines[_].draw(t,!1,this.lines[_][this.directionKey.left]+l,this.lines[_][this.directionKey.top]+s,e);else{if(S+A<this[this.directionKey.top]||S+A>this[this.directionKey.top]+u)return h;var B=!1;this.ellipsis&&this.lines[_+1]&&this.lines[_+1].top+this.lines[_+1].height>this[this.directionKey.top]+u&&(B=!0,h=!0),this.lines[_].draw(t,B,this.lines[_][this.directionKey.left]+l,this.lines[_][this.directionKey.top]+s,e)}}}return h}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,n=0;n<this.lines.length;n++){var i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,n=this.getRawActualSize(),i=(n.width,n.height);this.width;var r=this.height||i||0;r=Math.min(r,i);var o=this[this.directionKey.height];if(this.singleLine&&(o=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=o&&0!==o)for(var a=0;a<this.lines.length;a++){var s=this.lines[a],l=s.top,u=s.height;if(l+u<this[this.directionKey.top]||l+u>this[this.directionKey.top]+o);else if(this.ellipsis&&this.lines[a+1]&&this.lines[a+1].top+this.lines[a+1].height>this[this.directionKey.top]+o){var h=this.lines[a].getWidthWithEllips();h>t&&(t=h),e+=this.lines[a].height}else this.lines[a].actualWidth>t&&(t=this.lines[a].actualWidth),e+=this.lines[a].height}else{Math.floor((o-this.actualHeight)/2);for(var c=0;c<this.lines.length;c++)this.lines[c].actualWidth>t&&(t=this.lines[c].actualWidth),e+=this.lines[c].height}else if("bottom"===this.verticalDirection)for(var d=0;d<this.lines.length;d++){var f=this.lines[d],p=(f.top,f.height),v=o-this.lines[d].top-this.lines[d].height;if(0===o)this.lines[d].actualWidth>t&&(t=this.lines[d].actualWidth),e+=this.lines[d].height;else if(v+p>this[this.directionKey.top]+o||v<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[d+1]&&v-this.lines[d+1].height<this[this.directionKey.top]){var g=this.lines[d].getWidthWithEllips();g>t&&(t=g),e+=this.lines[d].height}else this.lines[d].actualWidth>t&&(t=this.lines[d].actualWidth),e+=this.lines[d].height}else for(var y=0;y<this.lines.length;y++){var m=this.lines[y],b=m.top,w=m.height;if(0===o)this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height;else if(b+w<this[this.directionKey.top]||b+w>this[this.directionKey.top]+o);else if(this.ellipsis&&this.lines[y+1]&&this.lines[y+1].top+this.lines[y+1].height>this[this.directionKey.top]+o){var x=this.lines[y].getWidthWithEllips();x>t&&(t=x),e+=this.lines[y].height}else this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}]),t}();function Ph(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Oh=Wl(),Eh=["width","height","image"].concat(ie(Hl)),Hh=function(t){Ke(n,t);var e=Ph(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="image",i.numberType=Oh,i.loadImage(i.attribute.image),i}return Se(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"stretch"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"stretch"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,i){var r=this;Ho($e(n.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var i=this;Ho($e(n.prototype),"imageLoadFail",this).call(this,t,(function(){i.failCallback&&i.failCallback()}))}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateImageAABBBounds(e,Ml(this).image,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return ul[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Eh.length;e++){var n=Eh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Eh.length;e++)if(t===Eh[e])return!0;return!1}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function Lh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Ih=function(t){Ke(n,t);var e=Lh(n);function n(t){var i;if(Ae(this,n),(i=e.call(this,t))._x=0,i._y=0,i._hovered=!1,i._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(i._hovered=!0),t.margin){var r=Ya(t.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}return i.onBeforeAttributeUpdate=function(t,e,n){if(Wt(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){var r=Ya(e.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}else i._marginArray=[0,0,0,0]},Xe(i)}return Se(n,[{key:"width",get:function(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}},{key:"height",get:function(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();var t=this.attribute,e=t.width,n=void 0===e?ul.width:e,i=t.height,r=void 0===i?ul.height:i,o=this.attribute,a=o.backgroundWidth,s=void 0===a?n:a,l=o.backgroundHeight,u=(s-n)/2,h=((void 0===l?r:l)-r)/2;return this._AABBBounds.expand([h,u,h,u]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}]),n}(Hh),Dh=function(){function t(e,n,i,r,o,a,s,l){var u=this;Ae(this,t),this.left=e,this.width=n,this.baseline=i,this.ascent=r,this.descent=o,this.top=i-r,this.paragraphs=a.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof Ih?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=s,this.directionKey=Ch[this.direction];var h=this.directionKey;this.actualWidth=0;var c=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof xh){var n=Ah.exec(t.text);0!==(null==n?void 0:n.index)&&(t.text=t.text.slice(null==n?void 0:n.index),t.updateWidth())}u.actualWidth+=t[u.directionKey.width],c=Math.max(t[u.directionKey.height],c)})),this.height=c,this.blankWidth=l?0:this.width-this.actualWidth;var d=this.left,f=0;if(this.actualWidth<n&&!l)switch(this.textAlign){case"right":d=n-this.actualWidth;break;case"center":d=(n-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?d=(n-this.actualWidth)/2:f=(n-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof Ih?(t["_"+h.x]=d,d+=t[h.width]+f,t["_"+h.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?c-t.height:(c-t.height)/2):(t[h.left]=d,d+=t[h.width]+f)}))}return Se(t,[{key:"draw",value:function(t,e,n,i,r){var o=this;if(e)for(var a=0,s=this.paragraphs.length-1;s>=0;s--){var l=this.paragraphs[s];if(l instanceof Ih)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var u=Th("...",l.character).width||0;if(u<=this.blankWidth+a){l.ellipsis="add";break}if(u<=this.blankWidth+a+l.width){l.ellipsis="replace",l.ellipsisWidth=u,l.ellipsisOtherParagraphWidth=this.blankWidth+a;break}l.ellipsis="hide",a+=l.width}this.paragraphs.map((function(e,a){if(e instanceof Ih)return e.setAttributes({x:n+e._x,y:i+e._y}),void r(e,t,n+e._x,i+e._y,o.ascent);e.draw(t,i+o.ascent,n,0===a,o.textAlign)}))}},{key:"getWidthWithEllips",value:function(){for(var t=this,e=0,n=this.paragraphs.length-1;n>=0;n--){var i=this.paragraphs[n];if(i instanceof Ih)break;var r=Th("...",i.character).width||0;if(r<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=r;break}if(r<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=r,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}var o=0;return this.paragraphs.map((function(e,n){o+=e instanceof Ih?e.width:e.getWidthWithEllips(t.direction)})),o}}]),t}(),jh=function(){function t(e){Ae(this,t),this.frame=e,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=e.layoutDirection,this.directionKey=Ch[this.direction]}return Se(t,[{key:"store",value:function(t){if(t instanceof Ih){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}},{key:"send",value:function(){if(0!==this.lineBuffer.length){var t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new Dh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){t instanceof Ih?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}},{key:"cut",value:function(t){var e=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=Bh(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){var r=function(t,e){var n=t.text.slice(0,e),i=t.text.slice(e);return[new xh(n,t.newLine,t.character),new xh(i,!0,t.character)]}(t,i),o=ve(r,2),a=o[0],s=o[1];this.store(a),this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}]),t}();function Wh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Fh=Wl(),zh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(ie(Hl)),Nh=function(t){Ke(n,t);var e=Wh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="richtext",i._currentHoverIcon=null,i.numberType=Fh,i}return Se(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ll.width},set:function(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:ll.height},set:function(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxWidth",get:function(){return this.attribute.maxWidth},set:function(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxHeight",get:function(){return this.attribute.maxHeight},set:function(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}},{key:"ellipsis",get:function(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:ll.ellipsis},set:function(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}},{key:"wordBreak",get:function(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:ll.wordBreak},set:function(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}},{key:"verticalDirection",get:function(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:ll.verticalDirection},set:function(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}},{key:"textAlign",get:function(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:ll.textAlign},set:function(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}},{key:"textBaseline",get:function(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:ll.textBaseline},set:function(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}},{key:"textConfig",get:function(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:ll.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateRichTextAABBBounds(e,Ml(this).richtext,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return ll[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<zh.length;e++){var n=zh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<zh.length;e++)if(t===zh[e])return!0;return!1}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"doUpdateFrameCache",value:function(){for(var t,e=this,n=this.attribute,i=n.textConfig,r=n.maxWidth,o=n.maxHeight,a=n.width,s=n.height,l=n.ellipsis,u=n.wordBreak,h=n.verticalDirection,c=n.textAlign,d=n.textBaseline,f=n.layoutDirection,p=n.singleLine,v=[],g=0;g<i.length;g++)if("image"in i[g]){var y=i[g],m=y.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(y.id);if(m)v.push(m);else{var b=new Ih(y);b.successCallback=function(){var t;e.addUpdateBoundTag(),null===(t=e.stage)||void 0===t||t.renderNextFrame()},b.richtextId=y.id,v.push(b)}}else if(i[g].text.includes("\n"))for(var w=i[g].text.split("\n"),x=0;x<w.length;x++)v.push(new xh(w[x],0!==x,i[g]));else v.push(new xh(i[g].text,!1,i[g]));for(var C=new Mh(0,0,("number"==typeof r&&(!a||a>r)?r:a)||0,("number"==typeof o&&(!s||s>o)?o:s)||0,l,u,h,c,d,f||"horizontal","number"==typeof r&&(!a||a>r),"number"==typeof o&&(!s||s>o),p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),_=new jh(C),k=0;k<v.length;k++)_.deal(v[k]);_.send(),this._frameCache=C}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){Ho($e(n.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(n){n.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var n,i,r,o,a,s=t.pickIcon(e.global);s&&s===t._currentHoverIcon||(s?(null===(n=t._currentHoverIcon)||void 0===n||n.setHoverState(!1),t._currentHoverIcon=s,t._currentHoverIcon.setHoverState(!0),s.attribute.cursor&&(null===(i=t.stage)||void 0===i||i.setCursor(s.attribute.cursor)),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!s&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(o=t.stage)||void 0===o||o.setCursor(),null===(a=t.stage)||void 0===a||a.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var n,i;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(n=t.stage)||void 0===n||n.setCursor(),null===(i=t.stage)||void 0===i||i.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,n=this.getFrameCache(),i=this.globalTransMatrix,r=i.e,o=i.f;return n.icons.forEach((function(n){var i,a;n.containsPoint(t.x-r,t.y-o)&&(e=n,e.globalX=(null!==(i=e.attribute.x)&&void 0!==i?i:0)+r,e.globalY=(null!==(a=e.attribute.y)&&void 0!==a?a:0)+o)})),e}}]),n}(zl);function Gh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Uh=Wl(),Vh=["path","customPath"].concat(ie(Hl)),Kh=function(t){Ke(n,t);var e=Gh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="path",i.numberType=Uh,i}return Se(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.path;return null!=t&&""!==t}},{key:"getParsedPathShape",value:function(){var t=Ml(this).path;if(!this.valid)return t.path;var e=this.attribute;return e.path instanceof Pa?e.path:(Ot(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Pa?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updatePathAABBBounds(e,Ml(this).path,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;jt(t.path,!0)?this.cache=(new Pa).fromString(t.path):t.customPath&&(this.cache=new Pa,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ml(this).path[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Vh.length;e++){var n=Vh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Vh.length;e++)if(t===Vh[e])return!0;return!1}},{key:"toCustomPath",value:function(){return(new Pa).fromCustomPath2D(this.getParsedPathShape(),0,0)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function Yh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Xh=Wl(),$h=["segments","points","curveType"].concat(ie(Hl)),qh=function(t){Ke(n,t);var e=Yh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="area",i.numberType=Xh,i}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updateAreaAABBBounds(e,Ml(this).area,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ja(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Ml(this).area[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<$h.length;e++){var n=$h[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<$h.length;e++)if(t===$h[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=new Pa,e=this.attribute,n=e.segments,i=function(e){if(e&&e.length){var n=!0,i=[];if(e.forEach((function(e){var r,o;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(o=e.y1)&&void 0!==o?o:e.y}),n=!1)})),i.length){for(var r=i.length-1;r>=0;r--)t.lineTo(i[r].x,i[r].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((function(t){i(t.points)})),t}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function Zh(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Jh=Wl(),Qh=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(ie(Hl)),tc=function(t){Ke(n,t);var e=Zh(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="arc",i.numberType=Jh,i}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=Ml(this).arc,e=this.attribute,n=e.cornerRadius,i=void 0===n?t.cornerRadius:n,r=e.outerRadius,o=void 0===r?t.outerRadius:r,a=e.innerRadius,s=void 0===a?t.innerRadius:a;if(0===i||"0%"===i)return 0;var l=Math.abs(o-s);return Math.min(Nt(i,!0)?i:l*parseFloat(i)/100,l/2)}},{key:"getParsedAngle",value:function(){var t=Ml(this).arc,e=this.attribute,n=e.startAngle,i=void 0===n?t.startAngle:n,r=e.endAngle,o=void 0===r?t.endAngle:r,a=this.attribute.cap,s=void 0===a?t.cap:a,l=o-i>=0?1:-1,u=o-i;if(o=(i=nn(i))+u,s&&Oe(u)<Pe-Be){var h=1,c=1;s.length&&(h=Number(s[0]),c=Number(s[1]));var d=this.attribute,f=d.outerRadius,p=void 0===f?t.outerRadius:f,v=d.innerRadius,g=void 0===v?t.innerRadius:v,y=Math.abs(p-g)/2,m=y/p;if(y>Be&&p>Be)return{startAngle:i-l*m*h,endAngle:o+l*m*c}}return{startAngle:i,endAngle:o}}},{key:"getParsePadAngle",value:function(t,e){var n=Ml(this).arc,i=this.attribute,r=i.outerRadius,o=void 0===r?n.outerRadius:r,a=i.innerRadius,s=void 0===a?n.innerRadius:a,l=i.padAngle,u=void 0===l?n.padAngle:l,h=this.attribute.padRadius,c=void 0===h?je(o*o+s*s):h,d=Oe(e-t),f=t,p=e,v=t,g=e,y=u/2,m=d,b=d;if(y>Be&&c>Be){var w=e>t?1:-1,x=ze(Number(c)/s*De(y)),C=ze(Number(c)/o*De(y));return(m-=2*x)>Be?(v+=x*=w,g-=x):(m=0,v=g=(t+e)/2),(b-=2*C)>Be?(f+=C*=w,p-=C):(b=0,f=p=(t+e)/2),{outerStartAngle:f,outerEndAngle:p,innerStartAngle:v,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:b}}return{outerStartAngle:f,outerEndAngle:p,innerStartAngle:v,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:b}}},{key:"doUpdateAABBBounds",value:function(t){var e=Ml(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=this.attribute,i=OC.updateArcAABBBounds(n,Ml(this).arc,this._AABBBounds,t,this),r=n.boundsPadding,o=void 0===r?e.boundsPadding:r,a=Ya(o);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Qh.length;e++){var n=Qh[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Qh.length;e++)if(t===Qh[e])return!0;return!1}},{key:"getDefaultAttribute",value:function(t){return Ml(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,e=this.getParsedAngle(),n=e.startAngle,i=e.endAngle,r=t.innerRadius,o=t.outerRadius,a=Oe(i-n),s=i>n;if(o<r){var l=o;o=r,r=l}var u=new Pa;if(o<=Be)u.moveTo(0,0);else if(a>=Pe-Be)u.moveTo(0+o*He(n),0+o*De(n)),u.arc(0,0,o,n,i,!s),r>Be&&(u.moveTo(0+r*He(i),0+r*De(i)),u.arc(0,0,r,i,n,s));else{var h=o*He(n),c=o*De(n),d=r*He(i),f=r*De(i);u.moveTo(0+h,0+c),u.arc(0,0,o,n,i,!s),u.lineTo(0+d,0+f),u.arc(0,0,r,i,n,s),u.closePath()}return u}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);var ec=Wl();function nc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var ic,rc=Wl();!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ic||(ic={}));var oc=function(t){Ke(n,t);var e=nc(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="group",i.parent=null,i.isContainer=!0,i.numberType=rc,i._childUpdateTag=ps.UPDATE_BOUNDS,i}return Se(n,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new Rl),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new Rl)}},{key:"hideAll",value:function(){this.setAttribute("visible",!1),this.forEachChildren((function(t){t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}},{key:"showAll",value:function(){this.setAttribute("visible",!0),this.forEachChildren((function(t){t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}},{key:"containsPoint",value:function(t,e,n){if(n===vs.GLOBAL){var i=new Ge(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}},{key:"shouldUpdateAABBBounds",value:function(){return!!Ho($e(n.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&ps.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;OC.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return OC.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=Ml(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var n=OC.updateGroupAABBBounds(t,Ml(this).group,this._AABBBounds,this),i=t.boundsPadding,r=void 0===i?e.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=ps.CLEAR_BOUNDS,this._childUpdateTag&=ps.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=ps.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&ps.UPDATE_BOUNDS||(this._childUpdateTag|=ps.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=Ho($e(n.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),OC.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){Ho($e(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),OC.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=Ho($e(n.prototype),"appendChild",this).call(this,t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertBefore",value:function(t,e){var i=Ho($e(n.prototype),"insertBefore",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertAfter",value:function(t,e){var i=Ho($e(n.prototype),"insertAfter",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertInto",value:function(t,e){var i=Ho($e(n.prototype),"insertInto",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"removeChild",value:function(t){var e=Ho($e(n.prototype),"removeChild",this).call(this,t);return t.stage=null,OC.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){OC.onRemove(t)})),Ho($e(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var n=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),OC.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,n.layer)})))}},{key:"addUpdatePositionTag",value:function(){Ho($e(n.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){Ho($e(n.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag&ps.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,n){var i=this._getChildByName(t);return i?i.setAttributes(e):((i=OC.creator[n](e)).name=t,this.add(i)),i}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);function ac(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var sc=Wl(),lc=["points","borderRadius"].concat(ie(Hl)),uc=function(t){Ke(n,t);var e=ac(n);function n(t){var i;return Ae(this,n),(i=e.call(this,t)).type="polygon",i.numberType=sc,i}return Se(n,[{key:"isValid",value:function(){return Ho($e(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.points;return t&&t.length>=2}},{key:"doUpdateAABBBounds",value:function(){var t=Ml(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,n=OC.updatePolygonAABBBounds(e,Ml(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,o=Ya(r);return o&&n.expand(o),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ja(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return Ml(this).polygon[t]}},{key:"needUpdateTags",value:function(t){for(var e=0;e<lc.length;e++){var n=lc[e];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=0;e<lc.length;e++)if(t===lc[e])return!0;return!1}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new Pa;return t.forEach((function(t,n){0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}}]),n}(zl);var hc=Wl();function cc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var dc=function(t){Ke(n,t);var e=cc(n);function n(t){var i;return Ae(this,n),(i=e.call(this,{x:0,y:0})).type="shadowroot",i.shadowHost=t,i}return Se(n,[{key:"addUpdateBoundTag",value:function(){Ho($e(n.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){Ho($e(n.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}]),n}(oc),fc=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vc=function(t,e){return function(n,i){e(n,i,t)}},gc=Symbol.for("Window"),yc=Symbol.for("WindowHandlerContribution"),mc=function(){function t(e){Ae(this,t),this.global=e,this.hooks={onChange:new Bo(["x","y","width","height"])},this._uid=Ua.GenAutoIncrementId()}return Se(t,[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){var t=this;this.global.hooks.onSetEnv.tap("window",(function(){t.active()})),this.active()}},{key:"active",value:function(){var t=this.global;t.env&&!this.actived&&(RC.getNamed(yc,t.env).configure(this,t),this.actived=!0)}},{key:"style",get:function(){return this._handler.getStyle()},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){this._handler.createWindow(t);var e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,n){return this._handler.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._handler.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t,e){this._handler.clearViewBox(t,e)}}]),t}();function bc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}fc([xo(),pc("design:type",Function),pc("design:paramtypes",[]),pc("design:returntype",void 0)],mc.prototype,"postInit",null),mc=fc([po(),vc(0,yo(ko)),pc("design:paramtypes",[Object])],mc);var wc=Symbol.for("LayerHandlerContribution"),xc=function(t){Ke(n,t);var e=bc(n);function n(t,i,r,o){var a,s;return Ae(this,n),(a=e.call(this,{})).stage=t,a.global=i,a.window=r,a.main=o.main,a.layerHandler=RC.get(wc),a.layerHandler.init(Ye(a),r,{main:o.main,canvasId:o.canvasId,width:a.viewWidth,height:a.viewHeight,zIndex:null!==(s=o.zIndex)&&void 0!==s?s:0}),a.layer=Ye(a),a.subLayers=new Map,a.theme=new Rl,a.background="rgba(0, 0, 0, 0)",a}return Se(n,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(n.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&n.forEach((function(t){t.group&&(t.group.incremental=0)})),n.forEach((function(e){DC.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){Ho($e(n.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"render",value:function(t,e){var n,i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){throw new Error("暂不支持")}},{key:"afterDraw",value:function(t){throw new Error("暂不支持")}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"combineTo",value:function(t,e){var n;this.offscreen&&this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e))}},{key:"release",value:function(){var t=this;Ho($e(n.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){DC.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var n;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:this.stage.x,y:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e))}}]),n}(oc);function Cc(t,e){return(Wt(t)?t.some((function(t){return t})):t)&&e>0}function _c(t,e){return t*e>0}function kc(t,e,n,i){return t*e>0&&n>0&&i>0}function Sc(t,e){return t*e>0}function Ac(t,e,n,i){return t*e>0&&n>0&&i>0}function Bc(t,e,n,i,r,o,a,s){if(!t.pathProxy)return!1;var l=Ml(t,null==o?void 0:o.theme)[t.type],u=t.attribute,h=u.fill,c=void 0===h?null==l.fill?!!t.attribute.fillColor:l.fill:h,d=u.stroke,f=void 0===d?null==l.stroke?!!t.attribute.strokeColor:l.stroke:d,p=u.opacity,v=void 0===p?l.opacity:p,g=u.fillOpacity,y=void 0===g?l.fillOpacity:g,m=u.lineWidth,b=void 0===m?l.lineWidth:m,w=u.strokeOpacity,x=void 0===w?l.strokeOpacity:w,C=u.visible,_=void 0===C?l.visible:C,k=_c(v,y),S=Sc(v,x),A=c,B=Cc(f,b);return!_||(!A&&!B||(!(k||S||a||s)||(e.beginPath(),_a(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),B&&(s?s(e,t.attribute,l):S&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),A&&(a?a(e,t.attribute,l):k&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),!0)))}var Rc=Symbol.for("CanvasFactory"),Tc=Symbol.for("Context2dFactory"),Mc=1e-4,Pc=Math.sqrt(3),Oc=1/3;function Ec(t){return t>-Yc&&t<Yc}function Hc(t){return t>Yc||t<-Yc}var Lc=[0,0],Ic=[0,0],Dc=[0,0];function jc(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Wc(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function Fc(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function zc(t){return(t%=Pe)<0&&(t+=Pe),t}function Nc(t,e,n,i,r,o){if(o>e&&o>i||o<e&&o<i)return 0;if(i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;1!==a&&0!==a||(s=i<e?.5:-.5);var l=a*(n-t)+t;return l===r?1/0:l>r?s:0}function Gc(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var u=a;return!(l>e+u&&l>i+u&&l>o+u||l<e-u&&l<i-u&&l<o-u||s>t+u&&s>n+u&&s>r+u||s<t-u&&s<n-u&&s<r-u)&&function(t,e,n,i,r,o,a,s,l){var u=0,h=.005,c=1/0;Lc[0]=a,Lc[1]=s;for(var d=0;d<1;d+=.05){Ic[0]=Wc(t,n,r,d),Ic[1]=Wc(e,i,o,d);var f=jc(Lc,Ic);f<c&&(u=d,c=f)}c=1/0;for(var p=0;p<32&&!(h<Mc);p++){var v=u-h,g=u+h;Ic[0]=Wc(t,n,r,v),Ic[1]=Wc(e,i,o,v);var y=jc(Ic,Lc);if(v>=0&&y<c)u=v,c=y;else{Dc[0]=Wc(t,n,r,g),Dc[1]=Wc(e,i,o,g);var m=jc(Dc,Lc);g<=1&&m<c?(u=g,c=m):h*=.5}}return l&&(l[0]=Wc(t,n,r,u),l[1]=Wc(e,i,o,u)),Math.sqrt(c)}(t,e,n,i,r,o,s,l,null)<=u/2}function Uc(t,e,n,i,r,o,a,s,l,u,h){if(0===l)return!1;var c=l;return!(h>e+c&&h>i+c&&h>o+c&&h>s+c||h<e-c&&h<i-c&&h<o-c&&h<s-c||u>t+c&&u>n+c&&u>r+c&&u>a+c||u<t-c&&u<n-c&&u<r-c&&u<a-c)&&function(t,e,n,i,r,o,a,s,l,u,h){var c,d,f,p,v=0,g=.005,y=1/0;Lc[0]=l,Lc[1]=u;for(var m=0;m<1;m+=.05)Ic[0]=Fc(t,n,r,a,m),Ic[1]=Fc(e,i,o,s,m),(f=jc(Lc,Ic))<y&&(v=m,y=f);y=1/0;for(var b=0;b<32&&!(g<Mc);b++)c=v-g,d=v+g,Ic[0]=Fc(t,n,r,a,c),Ic[1]=Fc(e,i,o,s,c),f=jc(Ic,Lc),c>=0&&f<y?(v=c,y=f):(Dc[0]=Fc(t,n,r,a,d),Dc[1]=Fc(e,i,o,s,d),p=jc(Dc,Lc),d<=1&&p<y?(v=d,y=p):g*=.5);return h&&(h[0]=Fc(t,n,r,a,v),h[1]=Fc(e,i,o,s,v)),Math.sqrt(y)}(t,e,n,i,r,o,a,s,u,h,null)<=c/2}function Vc(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var u=a;s-=t,l-=e;var h=Math.sqrt(s*s+l*l);if(h-u>n||h+u<n)return!1;if(Math.abs(i-r)%Pe<1e-4)return!0;if(o){var c=i;i=zc(r),r=zc(c)}else i=zc(i),r=zc(r);i>r&&(r+=Pe);var d=Math.atan2(l,s);return d<0&&(d+=Pe),d>=i&&d<=r||d+Pe>=i&&d+Pe<=r}function Kc(t,e,n,i,r,o,a){if(0===r)return!1;var s,l=r,u=r/2;if(a>e+u&&a>i+u||a<e-u&&a<i-u||o>t+u&&o>n+u||o<t-u&&o<n-u)return!1;if(t===n)return Math.abs(o-t)<=l/2;var h=(s=(e-i)/(t-n))*o-a+(t*i-n*e)/(t-n);return h*h/(s*s+1)<=l/2*l/2}var Yc=1e-4;function Xc(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Ec(a)){if(Hc(o)){var u=-s/o;u>=0&&u<=1&&(r[l++]=u)}}else{var h=o*o-4*a*s;if(Ec(h))r[0]=-o/(2*a);else if(h>0){var c=Math.sqrt(h),d=(-o+c)/(2*a),f=(-o-c)/(2*a);d>=0&&d<=1&&(r[l++]=d),f>=0&&f<=1&&(r[l++]=f)}}return l}var $c=[-1,-1,-1],qc=[-1,-1];function Zc(t,e,n,i,r,o,a,s,l,u){if(u>e&&u>i&&u>o&&u>s||u<e&&u<i&&u<o&&u<s)return 0;var h=function(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-r,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,f=0;if(Ec(h)&&Ec(c))if(Ec(s))o[0]=0;else{var p=-l/s;p>=0&&p<=1&&(o[f++]=p)}else{var v=c*c-4*h*d;if(Ec(v)){var g=c/h,y=-s/a+g,m=-g/2;y>=0&&y<=1&&(o[f++]=y),m>=0&&m<=1&&(o[f++]=m)}else if(v>0){var b=Math.sqrt(v),w=h*s+1.5*a*(-c+b),x=h*s+1.5*a*(-c-b),C=(-s-((w=w<0?-Math.pow(-w,Oc):Math.pow(w,Oc))+(x=x<0?-Math.pow(-x,Oc):Math.pow(x,Oc))))/(3*a);C>=0&&C<=1&&(o[f++]=C)}else{var _=(2*h*s-3*a*c)/(2*Math.sqrt(h*h*h)),k=Math.acos(_)/3,S=Math.sqrt(h),A=Math.cos(k),B=(-s-2*S*A)/(3*a),R=(-s+S*(A+Pc*Math.sin(k)))/(3*a),T=(-s+S*(A-Pc*Math.sin(k)))/(3*a);B>=0&&B<=1&&(o[f++]=B),R>=0&&R<=1&&(o[f++]=R),T>=0&&T<=1&&(o[f++]=T)}}return f}(e,i,o,s,u,$c);if(0===h)return 0;for(var c,d=0,f=-1,p=0,v=0,g=0;g<h;g++){var y=$c[g],m=0===y||1===y?.5:1;Fc(t,n,r,a,y)<l||(f<0&&(f=Xc(e,i,o,s,qc),qc[1]<qc[0]&&f>1&&(c=void 0,c=qc[0],qc[0]=qc[1],qc[1]=c),p=Fc(e,i,o,s,qc[0]),f>1&&(v=Fc(e,i,o,s,qc[1]))),2===f?y<qc[0]?d+=p<e?m:-m:y<qc[1]?d+=v<p?m:-m:d+=s<v?m:-m:y<qc[0]?d+=p<e?m:-m:d+=s<p?m:-m)}return d}function Jc(t,e,n,i,r,o,a,s){if(s>e&&s>i&&s>o||s<e&&s<i&&s<o)return 0;var l=function(t,e,n,i,r){var o=t-2*e+n,a=2*(e-t),s=t-i,l=0;if(Ec(o)){if(Hc(a)){var u=-s/a;u>=0&&u<=1&&(r[l++]=u)}}else{var h=a*a-4*o*s;if(Ec(h)){var c=-a/(2*o);c>=0&&c<=1&&(r[l++]=c)}else if(h>0){var d=Math.sqrt(h),f=(-a+d)/(2*o),p=(-a-d)/(2*o);f>=0&&f<=1&&(r[l++]=f),p>=0&&p<=1&&(r[l++]=p)}}return l}(e,i,o,s,$c);if(0===l)return 0;var u,h,c,d=0===(c=(u=e)+o-2*(h=i))?.5:(u-h)/c;if(d>=0&&d<=1){for(var f=0,p=Wc(e,i,o,d),v=0;v<l;v++){var g=0===$c[v]||1===$c[v]?.5:1;Wc(t,n,r,$c[v])<a||($c[v]<d?f+=p<e?g:-g:f+=o<p?g:-g)}return f}var y=0===$c[0]||1===$c[0]?.5:1;return Wc(t,n,r,$c[0])<a?0:o<e?y:-y}function Qc(t,e,n,i,r,o,a,s){if((s-=e)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);$c[0]=-l,$c[1]=l;var u=Math.abs(i-r);if(u<1e-4)return 0;if(u>=Pe-1e-4){i=0,r=Pe;var h=o?1:-1;return a>=$c[0]+t&&a<=$c[1]+t?h:0}if(i>r){var c=i;i=r,r=c}i<0&&(i+=Pe,r+=Pe);for(var d=0,f=0;f<2;f++){var p=$c[f];if(p+t>a){var v=Math.atan2(s,p),g=o?1:-1;v<0&&(v=Pe+v),(v>=i&&v<=r||v+Pe>=i&&v+Pe<=r)&&(v>Re/2&&v<1.5*Re&&(g=-g),d+=g)}}return d}function td(t){return Math.round(t/Re*1e8)/1e8%2*Re}function ed(t,e){var n=td(t[0]);n<0&&(n+=Pe);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=Pe?r=n+Pe:e&&n-r>=Pe?r=n-Pe:!e&&n>r?r=n+(Pe-td(n-r)):e&&n<r&&(r=n-(Pe-td(r-n))),t[0]=n,t[1]=r}var nd=[0,0];function id(t,e,n,i,r){for(var o,a,s=t,l=t.length,u=0,h=0,c=0,d=0,f=0,p=0;p<l;p++){var v=s[p],g=0===p;v[0]===wa.M&&p>1&&(n||(u+=Nc(h,c,d,f,i,r))),g&&(d=h=v[1],f=c=v[2]);var y=v[0],m=v[1],b=v[2],w=v[3],x=v[4],C=v[5],_=v[6],k=x,S=C;nd[0]=k,nd[1]=S,ed(nd,Boolean(v[6]));var A=k=nd[0],B=(S=nd[1])-k,R=!!(1-(v[6]?0:1)),T=(i-m)*w/w+m;switch(y){case wa.M:h=d=m,c=f=b;break;case wa.L:if(n){if(Kc(h,c,m,b,e,i,r))return!0}else u+=Nc(h,c,m,b,i,r)||0;h=m,c=b;break;case wa.C:if(n){if(Uc(h,c,m,b,w,x,C,_,e,i,r))return!0}else u+=Zc(h,c,m,b,w,x,C,_,i,r)||0;h=C,c=_;break;case wa.Q:if(n){if(Gc(h,c,m,b,w,x,e,i,r))return!0}else u+=Jc(h,c,m,b,w,x,i,r)||0;h=w,c=x;break;case wa.A:if(o=Math.cos(A)*w+m,a=Math.sin(A)*w+b,g?(d=o,f=a):u+=Nc(h,c,o,a,i,r),n){if(Vc(m,b,w,A,A+B,R,e,T,r))return!0}else u+=Qc(m,b,w,A,A+B,R,T,r);h=Math.cos(A+B)*w+m,c=Math.sin(A+B)*w+b;break;case wa.R:if(o=(d=h=m)+w,a=(f=c=b)+x,n){if(Kc(d,f,o,f,e,i,r)||Kc(o,f,o,a,e,i,r)||Kc(o,a,d,a,e,i,r)||Kc(d,a,d,f,e,i,r))return!0}else u+=Nc(o,f,o,a,i,r),u+=Nc(d,a,d,f,i,r);break;case wa.Z:if(n){if(Kc(h,c,d,f,e,i,r))return!0}else u+=Nc(h,c,d,f,i,r);h=d,c=f}}return n||function(t,e){return Math.abs(t-e)<Yc}(c,f)||(u+=Nc(h,c,d,f,i,r)||0),0!==u}var rd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},od=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ad=new an(1,0,0,1,0,0),sd={x:0,y:0},ld=function(){function t(e,n){Ae(this,t),this.matrix=new an(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new an(1,0,0,1,0,0),this.path=new Pa}return Se(t,[{key:"nativeContext",get:function(){return this.path}},{key:"getCanvas",value:function(){throw new Error("不支持getCanvas")}},{key:"getContext",value:function(){throw new Error("不支持getContext")}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return EC.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.restore()}},{key:"restore",value:function(){this.stack.length>0&&(EC.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(EC.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*o),a&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,o),a&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.path.clear()}},{key:"clip",value:function(t,e){}},{key:"arc",value:function(t,e,n,i,r,o){this.path.arc(t,e,n,i,r,o)}},{key:"arcTo",value:function(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o){this.path.bezierCurveTo(t,e,n,i,r,o)}},{key:"closePath",value:function(){this.path.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){}},{key:"lineTo",value:function(t,e){this.path.lineTo(t,e)}},{key:"moveTo",value:function(t,e){this.path.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"createImageData",value:function(t,e){return null}},{key:"createLinearGradient",value:function(t,e,n,i){throw new Error("不支持createLinearGradient")}},{key:"createPattern",value:function(t,e){throw new Error("不支持createPattern")}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){throw new Error("不支持createRadialGradient")}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"fill",value:function(t,e){}},{key:"fillRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){}},{key:"fillText",value:function(t,e,n){}},{key:"getImageData",value:function(t,e,n,i){return null}},{key:"getLineDash",value:function(){return[]}},{key:"isPointInPath",value:function(t,e){return this.matrix.transformPoint({x:t,y:e},sd),function(t,e,n){return id(t,0,!1,e,n)}(this.path.commandList,sd.x,sd.y)}},{key:"isPointInStroke",value:function(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},sd);var n=ja(this,this.lineWidth,this.dpr);return function(t,e,n,i){return id(t,e,!0,n,i)}(this.path.commandList,n,sd.x,sd.y)}},{key:"measureText",value:function(t){throw new Error("不支持measureText")}},{key:"putImageData",value:function(t,e,n){throw new Error("不支持measureText")}},{key:"setLineDash",value:function(t){}},{key:"stroke",value:function(t){}},{key:"strokeRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n){}},{key:"drawImage",value:function(){}},{key:"setCommonStyle",value:function(t,e,n,i,r){}},{key:"_setCommonStyle",value:function(t,e,n,i){}},{key:"setStrokeStyle",value:function(t,e,n,i,r){}},{key:"_setStrokeStyle",value:function(t,e,n,i){}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){}},{key:"setTextStyle",value:function(t,e){}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(ad,t,e)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return EC.free(t)})),this.stack.length=0}}]),t}();ld=rd([po(),od("design:paramtypes",[Object,Number])],ld);var ud=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"GetCanvas",value:function(){try{return t.canvas||(t.canvas=TC.createCanvas({})),t.canvas}catch(t){return null}}},{key:"GetCtx",value:function(){if(!t.ctx){var e=t.GetCanvas();t.ctx=e.getContext("2d")}return t.ctx}}]),t}(),hd=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;Ae(this,t);var i=ud.GetCanvas(),r=ud.GetCtx();if(i.width=n,i.height=1,r){if(r.translate(0,0),!r)throw new Error("获取ctx发生错误");var o=r.createLinearGradient(0,0,n,0);e.forEach((function(t){o.addColorStop(t[0],t[1])})),r.fillStyle=o,r.fillRect(0,0,n,1),this.rgbaSet=r.getImageData(0,0,n,1).data}}return Se(t,[{key:"getColor",value:function(t){var e=this.rgbaSet.slice(4*t,4*t+4);return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3]/255,")")}}],[{key:"GetOrCreate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i="";e.forEach((function(t){return i+=t.join()})),i+=n;var r=t.dataMap.get(i);return r||(r=new t(e,n),t.dataMap.set(i,r)),r}},{key:"SetColorInterpolateInstance",value:function(e,n){t.dataMap.set(e,n)}},{key:"GetColorInterpolateInstance",value:function(e){return t.dataMap.get(e)}}]),t}();hd.dataMap=new Map;var cd=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"GetSize",value:function(e){for(var n=0;n<t.ImageSize.length;n++)if(t.ImageSize[n]>=e)return t.ImageSize[n];return e}},{key:"Get",value:function(e,n,i,r,o,a,s){var l=t.GenKey(e,n,i,r,o),u=t.cache[l];if(!u||0===u.length)return null;for(var h=0;h<u.length;h++)if(u[h].width>=a&&u[h].height>=s)return u[h].imageData;return null}},{key:"Set",value:function(e,n,i,r,o,a,s,l){var u=t.GenKey(e,n,i,r,o);t.cache[u]?t.cache[u].push({width:s,height:l,imageData:a}):t.cache[u]=[{width:s,height:l,imageData:a}]}},{key:"GenKey",value:function(t,e,n,i,r){return"".concat(e,",").concat(n,",").concat(i,",").concat(r,",").concat(t.join())}}]),t}();cd.cache={},cd.ImageSize=[20,40,80,160,320,640,1280,2560];var dd,fd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pd=Symbol.for("MatrixAllocate"),vd=Symbol.for("Mat4Allocate");var gd=function(){function t(){Ae(this,t),this.pools=[]}return Se(t,[{key:"allocate",value:function(t,e,n,i,r,o){if(!this.pools.length)return new an(t,e,n,i,r,o);var a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=o,a}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new an(t.a,t.b,t.c,t.d,t.e,t.f);var e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}();gd=fd([po()],gd);var yd=dd=function(){function t(){Ae(this,t),this.pools=[]}return Se(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var t=this.pools.pop();return dd.identity(t),t}},{key:"allocateByObj",value:function(t){var e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(var n=0;n<e.length;n++)e[n]=t[n];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(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}}]),t}();function md(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],w=n[1],x=n[2],C=n[3];return t[0]=b*i+w*s+x*c+C*v,t[1]=b*r+w*l+x*d+C*g,t[2]=b*o+w*u+x*f+C*y,t[3]=b*a+w*h+x*p+C*m,b=n[4],w=n[5],x=n[6],C=n[7],t[4]=b*i+w*s+x*c+C*v,t[5]=b*r+w*l+x*d+C*g,t[6]=b*o+w*u+x*f+C*y,t[7]=b*a+w*h+x*p+C*m,b=n[8],w=n[9],x=n[10],C=n[11],t[8]=b*i+w*s+x*c+C*v,t[9]=b*r+w*l+x*d+C*g,t[10]=b*o+w*u+x*f+C*y,t[11]=b*a+w*h+x*p+C*m,b=n[12],w=n[13],x=n[14],C=n[15],t[12]=b*i+w*s+x*c+C*v,t[13]=b*r+w*l+x*d+C*g,t[14]=b*o+w*u+x*f+C*y,t[15]=b*a+w*h+x*p+C*m,t}function bd(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/a,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t}yd=dd=fd([po()],yd);var wd=function(){function t(e){Ae(this,t),this.params=e}return Se(t,[{key:"params",get:function(){return Object.assign({},this._params)},set:function(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}},{key:"getViewMatrix",value:function(){return this._viewMatrixCached||(this._viewMatrixCached=HC.allocate()),this._viewMatrixCached}},{key:"forceGetViewMatrix",value:function(){this._viewMatrixCached||(this._viewMatrixCached=HC.allocate());var t=this.params.viewParams,e=t.pos,n=t.center,i=t.up;return function(t,e,n,i){var r,o,a,s,l,u,h,c,d,f,p=e[0],v=e[1],g=e[2],y=i[0],m=i[1],b=i[2],w=n[0],x=n[1],C=n[2];Math.abs(p-w)<Be&&Math.abs(v-x)<Be&&Math.abs(g-C)<Be?yd.identity(t):(h=p-w,c=v-x,d=g-C,r=m*(d*=f=1/Math.hypot(h,c,d))-b*(c*=f),o=b*(h*=f)-y*d,a=y*c-m*h,(f=Math.hypot(r,o,a))?(r*=f=1/f,o*=f,a*=f):(r=0,o=0,a=0),s=c*a-d*o,l=d*r-h*a,u=h*o-c*r,(f=Math.hypot(s,l,u))?(s*=f=1/f,l*=f,u*=f):(s=0,l=0,u=0),t[0]=r,t[1]=s,t[2]=h,t[3]=0,t[4]=o,t[5]=l,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=d,t[11]=0,t[12]=-(r*p+o*v+a*g),t[13]=-(s*p+l*v+u*g),t[14]=-(h*p+c*v+d*g),t[15]=1)}(this._viewMatrixCached,e,n,i),this._vp||(this._vp=HC.allocate()),this._vp=md(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}},{key:"getProjectionMatrix",value:function(){return this._projectionMatrixCached||(this._projectionMatrixCached=HC.allocate()),this._projectionMatrixCached}},{key:"forceGetProjectionMatrix",value:function(){this._projectionMatrixCached||(this._projectionMatrixCached=HC.allocate());var t=this._params,e=t.left,n=t.top,i=t.right,r=t.bottom;return function(t,e,n,i,r,o,a){var s=1/(e-n),l=1/(i-r),u=1/(o-a);t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=(a+o)*u,t[15]=1}(this._projectionMatrixCached,e,i,r,n,0,-2e6),this._vp||(this._vp=HC.allocate()),this._vp=md(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}},{key:"getField",value:function(){var t=this._params,e=t.fieldRatio,n=void 0===e?.8:e,i=t.fieldDepth,r=t.left,o=t.right;return(null!=i?i:o-r)*n}},{key:"getProjectionScale",value:function(t){var e=this.getField();return e/(e+t)}},{key:"view",value:function(t,e,n){var i=[0,0,0];return bd(i,[t,e,n],this._viewMatrixCached),i}},{key:"vp",value:function(t,e,n){var i=[0,0,0],r=this._params.viewParams.pos;bd(i,[t,e,n],this._viewMatrixCached),t=i[0],e=i[1],n=i[2];var o=this.getProjectionScale(n);return{x:t*o+r[0],y:e*o+r[1]}}}]),t}(),xd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Cd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_d=[0,0,0],kd=new an(1,0,0,1,0,0),Sd=function(){function t(e,n){Ae(this,t),this.fillAttributes=Object.assign(Object.assign({},Us),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Ks),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Ys),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;var i=e.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=e,this.matrix=new an(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new an(1,0,0,1,0,0)}return Se(t,[{key:"fillStyle",get:function(){return this.nativeContext.fillStyle},set:function(t){this.nativeContext.fillStyle=t}},{key:"font",get:function(){return this.nativeContext.font},set:function(t){this.nativeContext.font=t}},{key:"globalAlpha",get:function(){return this.nativeContext.globalAlpha},set:function(t){this.nativeContext.globalAlpha=t}},{key:"lineCap",get:function(){return this.nativeContext.lineCap},set:function(t){this.nativeContext.lineCap=t}},{key:"lineDashOffset",get:function(){return this.nativeContext.lineDashOffset},set:function(t){this.nativeContext.lineDashOffset=t}},{key:"lineJoin",get:function(){return this.nativeContext.lineJoin},set:function(t){this.nativeContext.lineJoin=t}},{key:"lineWidth",get:function(){return this.nativeContext.lineWidth},set:function(t){this.nativeContext.lineWidth=t}},{key:"miterLimit",get:function(){return this.nativeContext.miterLimit},set:function(t){this.nativeContext.miterLimit=t}},{key:"shadowBlur",get:function(){return this.nativeContext.shadowBlur},set:function(t){this.nativeContext.shadowBlur=t}},{key:"shadowColor",get:function(){return this.nativeContext.shadowColor},set:function(t){this.nativeContext.shadowColor=t}},{key:"shadowOffsetX",get:function(){return this.nativeContext.shadowOffsetX},set:function(t){this.nativeContext.shadowOffsetX=t}},{key:"shadowOffsetY",get:function(){return this.nativeContext.shadowOffsetY},set:function(t){this.nativeContext.shadowOffsetY=t}},{key:"strokeStyle",get:function(){return this.nativeContext.strokeStyle},set:function(t){this.nativeContext.strokeStyle=t}},{key:"textAlign",get:function(){return this.nativeContext.textAlign},set:function(t){this.nativeContext.textAlign=t}},{key:"textBaseline",get:function(){return this.nativeContext.textBaseline},set:function(t){this.nativeContext.textBaseline=t}},{key:"inuse",get:function(){return!!this._inuse},set:function(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}},{key:"reset",value:function(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new an(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getContext",value:function(){return this.nativeContext}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return EC.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}},{key:"restore",value:function(){this.nativeContext.restore(),this.stack.length>0&&(EC.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(EC.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*o),a&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,o){var a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,o),a&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.disableBeginPath||this.nativeContext.beginPath()}},{key:"clip",value:function(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}},{key:"arc",value:function(t,e,n,i,r,o,a){if(a=a||0,this.camera){var s=[];!function(t,e,n,i,r,o,a,s){for(var l=Re/3*(n>e?1:-1),u=e,h=u;h!==n;){h=l>0?Math.min(h+l,n):Math.max(h+l,n);var c=Math.abs(h-u),d=4*Math.tan(c/4)/3,f=h<u?-1:1,p=Math.cos(u),v=Math.sin(u),g=Math.cos(h),y=Math.sin(h),m=p*o+i,b=v*a+r,w=g*o+i,x=y*a+r,C=o*d*f,_=a*d*f;t.push([m-C*v,b+_*p,w+C*y,x-_*g,w,x]),u=h}}(s,i,r,t,e,n,n);for(var l=0;l<s.length;++l){var u=s[l];this.bezierCurveTo(u[0],u[1],u[2],u[3],u[4],u[5],a)}}else this.nativeContext.arc(t,e,n,i,r,o)}},{key:"arcTo",value:function(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,o,a){if(a=a||0,this.camera){var s=a,l=a;this.modelMatrix&&(bd(_d,[t,e,a],this.modelMatrix),t=_d[0],e=_d[1],s=_d[2],bd(_d,[n,i,a],this.modelMatrix),n=_d[0],i=_d[1],l=_d[2],bd(_d,[r,o,a],this.modelMatrix),r=_d[0],o=_d[1],a=_d[2]);var u=this.camera.vp(r,o,a);r=u.x,o=u.y,t=(u=this.camera.vp(t,e,s)).x,e=u.y,n=(u=this.camera.vp(n,i,l)).x,i=u.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,o)}},{key:"closePath",value:function(){this.nativeContext.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,o,a,s){null==s?this.nativeContext.ellipse(t,e,n,i,r,o,a):this.nativeContext.ellipse(t,e,n,i,r,o,a,s)}},{key:"lineTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bd(_d,[t,e,n],this.modelMatrix),t=_d[0],e=_d[1],n=_d[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}},{key:"moveTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bd(_d,[t,e,n],this.modelMatrix),t=_d[0],e=_d[1],n=_d[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i,r){if(r=r||0,this.camera){var o=r;this.modelMatrix&&(bd(_d,[t,e,r],this.modelMatrix),t=_d[0],e=_d[1],o=_d[2],bd(_d,[n,i,r],this.modelMatrix),n=_d[0],i=_d[1],r=_d[2]);var a=this.camera.vp(n,i,r);n=a.x,i=a.y,t=(a=this.camera.vp(t,e,o)).x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}},{key:"createImageData",value:function(){var t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}},{key:"createLinearGradient",value:function(t,e,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}},{key:"createPattern",value:function(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}},{key:"createRadialGradient",value:function(t,e,n,i,r,o){return this.nativeContext.createRadialGradient(t,e,n,i,r,o)}},{key:"createConicGradient",value:function(t,e,n,i){var r,o=!1,a=this;return{stops:[],addColorStop:function(t,e){this.stops.push([t,e]),o=!0},GetPattern:function(s,l,u){return o&&(u||(u=i-n),r=function(t,e,n,i,r,o,a,s,l){var u=Math.floor(180*r/Math.PI),h=ud.GetCanvas(),c=ud.GetCtx();if(!c)return null;var d=cd.GetSize(s),f=cd.GetSize(l),p=cd.Get(e,n,i,o,a,d,f);if(p)return h.width=p.width,h.height=p.height,c.putImageData(p,0,0),t.createPattern(h,"no-repeat");var v=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),g=u+1,y=r/Math.max(1,g-1),m=hd.GetOrCreate(e,g),b=2*Math.PI*v/360;h.width=d,h.height=f,c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,d,f),c.translate(n,i),c.rotate(o);for(var w=0,x=g-1;w<x&&!(o+w*y>a);w++){var C=m.getColor(w);c.beginPath(),c.rotate(y),c.moveTo(0,0),c.lineTo(v,-2*b),c.lineTo(v,0),c.fillStyle=C,c.closePath(),c.fill()}return p=c.getImageData(0,0,d,f),cd.Set(e,n,i,o,a,p,d,f),h.width=p.width,h.height=p.height,c.putImageData(p,0,0),t.createPattern(h,"no-repeat")}(a,this.stops,t,e,u,n,i,s,l),o=!1),r}}}},{key:"fill",value:function(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}},{key:"fillRect",value:function(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}},{key:"project",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bd(_d,[t,e,n],this.modelMatrix),t=_d[0],e=_d[1],n=_d[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}},{key:"view",value:function(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(bd(_d,[t,e,n],this.modelMatrix),t=_d[0],e=_d[1],n=_d[2]),this.camera.view(t,e,n)):[t,e,n]}},{key:"fillText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(bd(_d,[e,n,i],this.modelMatrix),e=_d[0],n=_d[1],i=_d[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.fillText(t,e,n)}},{key:"getImageData",value:function(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}},{key:"getLineDash",value:function(){return this.nativeContext.getLineDash()}},{key:"isPointInPath",value:function(t,e){return this.nativeContext.isPointInPath(t,e)}},{key:"isPointInStroke",value:function(t,e){return this.nativeContext.isPointInStroke(t,e)}},{key:"measureText",value:function(t){var e,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:TC.measureTextMethod;return r&&"native"!==r?(this.mathTextMeasure||(this.mathTextMeasure=MC.createTextMeasureInstance({},{},(function(){return i.canvas}))),this.mathTextMeasure.textSpec.fontFamily=null!==(e=this.fontFamily)&&void 0!==e?e:Ys.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(n=this.fontSize)&&void 0!==n?n:Ys.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,r)):this.nativeContext.measureText(t)}},{key:"putImageData",value:function(t,e,n){this.nativeContext.putImageData(t,e,n)}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}},{key:"stroke",value:function(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}},{key:"strokeRect",value:function(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n,i){if(i=i||0,this.camera){var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.strokeText(t,e,n)}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"setCommonStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);var o={};return r.forEach((function(t){Object.assign(o,t)})),this._setCommonStyle(t,e,n,i,o)}return this._setCommonStyle(t,e,n,i,r)}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.fillAttributes);var a=e.fillOpacity,s=void 0===a?r.fillOpacity:a,l=e.opacity,u=void 0===l?r.opacity:l,h=e.fillColor,c=void 0===h?r.fillColor:h;s>1e-12&&u>1e-12?(o.globalAlpha=s*u,o.fillStyle=Wa(this,c,t)):o.globalAlpha=s*u}},{key:"setShadowStyle",value:function(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowStyle(t,n[0]);var i={};return n.forEach((function(t){Object.assign(i,t)})),this._setShadowStyle(t,e,i)}return this._setShadowStyle(t,e,n)}},{key:"_setShadowStyle",value:function(t,e,n){var i=this.nativeContext;n||(n=this.fillAttributes);var r=e.opacity,o=void 0===r?n.opacity:r,a=e.shadowBlur,s=void 0===a?n.shadowBlur:a,l=e.shadowColor,u=void 0===l?n.shadowColor:l,h=e.shadowOffsetX,c=void 0===h?n.shadowOffsetX:h,d=e.shadowOffsetY,f=void 0===d?n.shadowOffsetY:d,p=e.blur,v=void 0===p?n.blur:p;o<=1e-12||(s||c||f?(i.shadowBlur=s,i.shadowColor=u,i.shadowOffsetX=c,i.shadowOffsetY=f,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),v?(i.filter="blur(".concat(v,"px)"),this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1))}},{key:"setStrokeStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);var o={};return r.forEach((function(t){Object.assign(o,t)})),this._setStrokeStyle(t,e,n,i,o)}return this._setStrokeStyle(t,e,n,i,r)}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.strokeAttributes);var a=e.strokeOpacity,s=void 0===a?r.strokeOpacity:a,l=e.opacity,u=void 0===l?r.opacity:l;if(s>1e-12&&u>1e-12){var h=e.lineWidth,c=void 0===h?r.lineWidth:h,d=e.strokeColor,f=void 0===d?r.strokeColor:d,p=e.lineJoin,v=void 0===p?r.lineJoin:p,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,b=void 0===m?r.lineCap:m,w=e.miterLimit,x=void 0===w?r.miterLimit:w;o.globalAlpha=s*u,o.lineWidth=ja(this,c,this.dpr),o.strokeStyle=Wa(this,f,t),o.lineJoin=v,o.setLineDash(y),o.lineCap=b,o.miterLimit=x}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,n){var i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Ro(t,e,this.camera&&this.camera.getProjectionScale(n));var r=t.fontFamily,o=void 0===r?e.fontFamily:r,a=t.fontSize,s=void 0===a?e.fontSize:a;this.fontFamily=o,this.fontSize=s,i.textAlign="left",i.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,n){var i,r,o=this.nativeContext;e||(e=this.textAttributes),t.font?o.font=t.font:o.font=Ro(t,e,this.camera&&this.camera.getProjectionScale(n));var a=t.fontFamily,s=void 0===a?e.fontFamily:a,l=t.fontSize,u=void 0===l?e.fontSize:l;this.fontFamily=s,this.fontSize=u,o.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,o.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(kd,t,e)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return EC.free(t)})),this.stack.length=0}}]),t}();Sd.env="browser",Sd=xd([po(),Cd("design:paramtypes",[Object,Number])],Sd);var Ad=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Bd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rd=500,Td=500,Md=1,Pd=function(){function t(e){Ae(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?Rd:i,o=e.height,a=void 0===o?Td:o,s=e.dpr,l=void 0===s?Md:s,u=e.container,h=e.x,c=e.y,d=e.canvasControled,f=void 0===d||d;if(this._x=null!=h?h:0,this._y=null!=c?c:0,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this.controled=f,"string"==typeof u){var p=TC.getElementById(u);p&&(this._container=p)}else this._container=u;this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new Sd(this,this._dpr),this._id=n.id,this.initStyle()}return Se(t,[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this.width,this.height)}},{key:"initStyle",value:function(){if(this.controled){var t=this.nativeCanvas;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}}},{key:"applyPosition",value:function(){var t=this._nativeCanvas;t.style.position="absolute",t.style.top="".concat(this._y,"px"),t.style.left="".concat(this._x,"px")}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){if(this.controled){var e=t.width,n=void 0===e?this._displayWidth:e,i=t.height,r=void 0===i?this._displayHeight:i,o=t.dpr,a=void 0===o?this._dpr:o,s=t.x,l=void 0===s?this._x:s,u=t.y,h=void 0===u?this._y:u,c=this.nativeCanvas;c.width=n*a,c.height=r*a,!c.style||this.setCanvasStyle(c,l,h,n,r),t.id&&(c.id=t.id),this.visiable||this.hide()}}},{key:"setCanvasStyle",value:function(t,e,n,i,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width="".concat(i,"px"),t.style.height="".concat(r,"px"))}},{key:"hide",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}},{key:"show",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}},{key:"resize",value:function(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width="".concat(t,"px"),this._nativeCanvas.style.height="".concat(e,"px")),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}},{key:"toDataURL",value:function(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}},{key:"readPixels",value:function(t,e,n,i){return this._context.getImageData(t,e,n,i)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}]),t}();function Od(t){return RC.getNamed(Rc,TC.env)(t)}Pd.env="browser",Pd=Ad([po(),Bd("design:paramtypes",[Object])],Pd);var Ed,Hd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};!function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ed||(Ed={}));var Ld=function(){function t(){Ae(this,t),this.time=Ed.beforeFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h,c){var d=t.attribute.background;if(d)if(t.backgroundImg&&t.resources){var f=t.resources.get(d);if("success"!==f.state||!f.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var p=Ml(t.parent).group,v=t.parent.attribute,g=v.scrollX,y=void 0===g?p.scrollX:g,m=v.scrollY,b=void 0===m?p.scrollY:m;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(y,b)}e.clip();var w=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.drawImage(f.data,w.x1,w.y1,w.width(),w.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}]),t}();Ld=Hd([po()],Ld);var Id=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=10}return Se(t,[{key:"createCommonPattern",value:function(t,e,n,i,r){var o=(t-2*e)/2,a=LC.allocate({width:t,height:t,dpr:1}),s=a.getContext("2d");if(!s)return null;s.clearRect(0,0,t,t),r(o,s);var l=i.createPattern(a.nativeCanvas,"repeat");return LC.free(a),l}},{key:"createCirclePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,e){e.fillStyle=n,e.arc(t,t,t,0,Pe),e.fill()}))}},{key:"createDiamondPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){var r=t/2,o=r;i.fillStyle=n,i.moveTo(r,o-e),i.lineTo(e+r,o),i.lineTo(r,o+e),i.lineTo(r-e,o),i.closePath(),i.fill()}))}},{key:"createRectPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,o=r;i.fillStyle=n,i.fillRect(r,o,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var o=e;r.fillStyle=n,r.fillRect(o,0,2*i,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var o=e;r.fillStyle=n,r.fillRect(0,o,t,2*i)}))}},{key:"createBiasLRLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);var r=t/2,o=-r;i.moveTo(r,o),i.lineTo(r+t,o+t),i.moveTo(-r,-o),i.lineTo(-r+t,-o+t),i.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);var r=t/2,o=r;i.moveTo(t+r,o),i.lineTo(r,o+t),i.moveTo(t-r,-o),i.lineTo(-r,-o+t),i.stroke()}))}},{key:"createGridPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,o=r;i.fillStyle=n,i.fillRect(r,o,t,t),i.fillRect(r+t,o+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h,c){this.textureMap||this.initTextureMap(e,t.stage);var d=t.attribute,f=d.texture,p=void 0===f?l.texture:f,v=d.textureColor,g=void 0===v?l.textureColor:v,y=d.textureSize,m=void 0===y?l.textureSize:y,b=d.texturePadding,w=void 0===b?l.texturePadding:b;if(p){var x=this.textureMap.get(p);if(!x)switch(p){case"circle":x=this.createCirclePattern(m,w,g,e);break;case"diamond":x=this.createDiamondPattern(m,w,g,e);break;case"rect":x=this.createRectPattern(m,w,g,e);break;case"vertical-line":x=this.createVerticalLinePattern(m,w,g,e);break;case"horizontal-line":x=this.createHorizontalLinePattern(m,w,g,e);break;case"bias-lr":x=this.createBiasLRLinePattern(m,w,g,e);break;case"bias-rl":x=this.createBiasRLLinePattern(m,w,g,e);break;case"grid":x=this.createGridPattern(m,w,g,e)}x&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=x,e.fill(),e.highPerformanceRestore())}}}]),t}();function Dd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Id=Hd([po()],Id);var jd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Wd=Symbol.for("ArcRenderContribution"),Fd=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.innerRadius,f=void 0===d?l.innerRadius:d,p=c.outerRadius,v=void 0===p?l.outerRadius:p,g=c.startAngle,y=void 0===g?l.startAngle:g,m=c.endAngle,b=void 0===m?l.endAngle:m,w=c.opacity,x=void 0===w?l.opacity:w,C=c.outerBorder,_=c.innerBorder;if(C){var k=C.distance,S=void 0===k?l.outerBorder.distance:k,A=ja(e,S,e.dpr),B=S/v;if(t.setAttributes({outerRadius:v+A,innerRadius:f-A,startAngle:y-B,endAngle:b+B}),e.beginPath(),Xd(t,e,n,i,v+A,f-A),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,C,l.outerBorder);else if(s){var R=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,C,n,i,l.outerBorder),l.outerBorder.opacity=R,e.stroke()}}if(_){var T=_.distance,M=void 0===T?l.innerBorder.distance:T,P=ja(e,M,e.dpr),O=M/v;if(t.setAttributes({outerRadius:v-P,innerRadius:f+P,startAngle:y+O,endAngle:b-O}),e.beginPath(),Xd(t,e,n,i,v-P,f+P),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,_,l.innerBorder);else if(s){var E=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,_,n,i,l.innerBorder),l.innerBorder.opacity=E,e.stroke()}}t.setAttributes({outerRadius:v,innerRadius:f,startAngle:y,endAngle:b})}}]),t}();Fd=jd([po()],Fd);var zd=function(t){Ke(n,t);var e=Dd(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);zd=jd([po()],zd);var Nd=function(t){Ke(n,t);var e=Dd(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id);Nd=jd([po()],Nd);var Gd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ud=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vd=function(t,e){return function(n,i){e(n,i,t)}};function Kd(t,e,n,i,r,o,a,s){var l=n-t,u=i-e,h=a-r,c=s-o,d=c*l-h*u;return d*d<Be?[]:[t+(d=(h*(e-o)-c*(t-r))/d)*l,e+d*u]}function Yd(t,e,n,i,r,o,a){var s=t-n,l=e-i,u=(a?o:-o)/Math.sqrt(s*s+l*l),h=u*l,c=-u*s,d=t+h,f=e+c,p=n+h,v=i+c,g=(d+p)/2,y=(f+v)/2,m=p-d,b=v-f,w=m*m+b*b,x=r-o,C=d*v-p*f,_=(b<0?-1:1)*Math.sqrt(Math.max(0,x*x*w-C*C)),k=(C*b-m*_)/w,S=(-C*m-b*_)/w,A=(C*b+m*_)/w,B=(-C*m+b*_)/w,R=k-g,T=S-y,M=A-g,P=B-y;return R*R+T*T>M*M+P*P&&(k=A,S=B),{cx:k,cy:S,x01:-h,y01:-c,x11:k*(r/x-1),y11:S*(r/x-1)}}function Xd(t,e,n,i,r,o,a){var s=t.getParsedAngle(),l=s.startAngle,u=s.endAngle,h=Oe(u-l),c=u>l,d=!1;if(r<o){var f=r;r=o,o=f}if(r<=Be)e.moveTo(n,i);else if(h>=Pe-Be)e.moveTo(n+r*He(l),i+r*De(l)),e.arc(n,i,r,l,u,!c),o>Be&&(e.moveTo(n+o*He(u),i+o*De(u)),e.arc(n,i,o,u,l,c));else{var p,v,g,y,m=t.getParsedCornerRadius(),b=t.getParsePadAngle(l,u),w=b.outerDeltaAngle,x=b.innerDeltaAngle,C=b.outerStartAngle,_=b.outerEndAngle,k=b.innerEndAngle,S=b.innerStartAngle,A=m,B=m,R=m,T=m,M=Math.max(B,A),P=Math.max(R,T),O=M,E=P,H=r*He(C),L=r*De(C),I=o*He(k),D=o*De(k);if((P>Be||M>Be)&&(p=r*He(_),v=r*De(_),g=o*He(S),y=o*De(S),h<Re)){var j=Kd(H,L,g,y,p,v,I,D);if(j){var W=H-j[0],F=L-j[1],z=p-j[0],N=v-j[1],G=1/De(Fe((W*z+F*N)/(je(W*W+F*F)*je(z*z+N*N)))/2),U=je(j[0]*j[0]+j[1]*j[1]);E=Ie(P,(o-U)/(G-1)),O=Ie(M,(r-U)/(G+1))}}if(w<.001)a&&(a[3]||a[1])&&e.moveTo(n+H,i+L),d=!0;else if(O>Be){var V=Ie(A,O),K=Ie(B,O),Y=Yd(g,y,H,L,r,V,Number(c)),X=Yd(p,v,I,D,r,K,Number(c));O<M&&V===K?!a||a[0]?(e.moveTo(n+Y.cx+Y.x01,i+Y.cy+Y.y01),e.arc(n+Y.cx,i+Y.cy,O,Ee(Y.y01,Y.x01),Ee(X.y01,X.x01),!c)):e.moveTo(n+Y.cx+O*He(Ee(X.y01,X.x01)),i+Y.cy+O*De(Ee(X.y01,X.x01))):!a||a[0]?(e.moveTo(n+Y.cx+Y.x01,i+Y.cy+Y.y01),V>0&&e.arc(n+Y.cx,i+Y.cy,V,Ee(Y.y01,Y.x01),Ee(Y.y11,Y.x11),!c),e.arc(n,i,r,Ee(Y.cy+Y.y11,Y.cx+Y.x11),Ee(X.cy+X.y11,X.cx+X.x11),!c),K>0&&e.arc(n+X.cx,i+X.cy,K,Ee(X.y11,X.x11),Ee(X.y01,X.x01),!c)):K>0?e.moveTo(n+X.cx+K*He(Ee(X.y01,X.x01)),i+X.cy+K*De(Ee(X.y01,X.x01))):e.moveTo(n+p,i+r*De(_))}else a&&!a[0]||(e.moveTo(n+H,i+L),e.arc(n,i,r,C,_,!c));if(!(o>Be)||x<.001)!a||a[1]?e.lineTo(n+I,i+D):e.moveTo(n+I,i+D),d=!0;else if(E>Be){var $=Ie(T,E),q=Ie(R,E),Z=Yd(I,D,p,v,o,-q,Number(c)),J=Yd(H,L,g,y,o,-$,Number(c));if(!a||a[1]?e.lineTo(n+Z.cx+Z.x01,i+Z.cy+Z.y01):e.moveTo(n+Z.cx+Z.x01,i+Z.cy+Z.y01),E<P&&$===q){var Q=Ee(J.y01,J.x01);!a||a[2]?e.arc(n+Z.cx,i+Z.cy,E,Ee(Z.y01,Z.x01),Q,!c):e.moveTo(n+Z.cx+He(Q),i+Z.cy+De(Q))}else!a||a[2]?(q>0&&e.arc(n+Z.cx,i+Z.cy,q,Ee(Z.y01,Z.x01),Ee(Z.y11,Z.x11),!c),e.arc(n,i,o,Ee(Z.cy+Z.y11,Z.cx+Z.x11),Ee(J.cy+J.y11,J.cx+J.x11),c),$>0&&e.arc(n+J.cx,i+J.cy,$,Ee(J.y11,J.x11),Ee(J.y01,J.x01),!c)):$>0?e.moveTo(n+J.cx+$*He(Ee(J.y01,J.x01)),i+J.cy+$*De(Ee(J.y01,J.x01))):e.moveTo(n+g,i+y)}else!a||a[1]?e.lineTo(n+I,i+D):e.moveTo(n+I,i+D),!a||a[2]?e.arc(n,i,o,k,S,c):e.moveTo(n+o*He(S),i+o*De(S))}return a?a[3]&&e.lineTo(n+r*He(u),i+r*He(u)):e.closePath(),d}var $d=function(){function t(e){Ae(this,t),this.arcRenderContribitions=e,this.numberType=Jh}return Se(t,[{key:"drawArcTailCapPath",value:function(t,e,n,i,r,o,a,s){var l=s-a,u=t.getParsedAngle(),h=u.startAngle,c=u.endAngle,d=Oe((c=s)-h),f=c>h,p=!1;if(r<o){var v=r;r=o,o=v}var g,y,m,b,w=t.getParsedCornerRadius(),x=t.getParsePadAngle(h,c),C=(x.outerDeltaAngle,x.innerDeltaAngle),_=x.outerStartAngle,k=x.outerEndAngle,S=x.innerEndAngle,A=x.innerStartAngle,B=w,R=w,T=w,M=w,P=Math.max(R,B),O=Math.max(T,M),E=P,H=O,L=r*He(_),I=r*De(_),D=o*He(S),j=o*De(S);if((O>Be||P>Be)&&(g=r*He(k),y=r*De(k),m=o*He(A),b=o*De(A),d<Re)){var W=Kd(L,I,m,b,g,y,D,j);if(W){var F=L-W[0],z=I-W[1],N=g-W[0],G=y-W[1],U=1/De(Fe((F*N+z*G)/(je(F*F+z*z)*je(N*N+G*G)))/2),V=je(W[0]*W[0]+W[1]*W[1]);H=Ie(O,(o-V)/(U-1)),E=Ie(P,(r-V)/(U+1))}}if(E>Be){var K=Ie(B,E),Y=Ie(R,E),X=Yd(m,b,L,I,r,K,Number(f)),$=Yd(g,y,D,j,r,Y,Number(f));if(E<P&&K===Y)e.moveTo(n+X.cx+X.x01,i+X.cy+X.y01),e.arc(n+X.cx,i+X.cy,E,Ee(X.y01,X.x01),Ee($.y01,$.x01),!f);else{var q=c-l-.03,Z=Ee($.y11,$.x11);e.arc(n,i,r,q,Z,!f),Y>0&&e.arc(n+$.cx,i+$.cy,Y,Ee($.y11,$.x11),Ee($.y01,$.x01),!f)}}else e.moveTo(n+L,i+I);if(!(o>Be)||C<.001)e.lineTo(n+D,i+j),p=!0;else if(H>Be){var J=Ie(M,H),Q=Ie(T,H),tt=Yd(D,j,g,y,o,-Q,Number(f)),et=Yd(L,I,m,b,o,-J,Number(f));if(e.lineTo(n+tt.cx+tt.x01,i+tt.cy+tt.y01),H<O&&J===Q){var nt=Ee(et.y01,et.x01);e.arc(n+tt.cx,i+tt.cy,H,Ee(tt.y01,tt.x01),nt,!f)}else{Q>0&&e.arc(n+tt.cx,i+tt.cy,Q,Ee(tt.y01,tt.x01),Ee(tt.y11,tt.x11),!f);var it=Ee(tt.cy+tt.y11,tt.cx+tt.x11),rt=c-l-.03;e.arc(n,i,o,it,rt,f)}}else e.lineTo(n+o*He(A),i+o*De(A));return p}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Ml(t,null==o?void 0:o.theme).arc,u=t.attribute,h=u.fill,c=void 0===h?null==l.fill?!!t.attribute.fillColor:l.fill:h,d=u.background,f=u.stroke,p=void 0===f?null==l.stroke?!!t.attribute.strokeColor:l.stroke:f,v=u.opacity,g=void 0===v?l.opacity:v,y=u.fillOpacity,m=void 0===y?l.fillOpacity:y,b=u.lineWidth,w=void 0===b?l.lineWidth:b,x=u.strokeOpacity,C=void 0===x?l.strokeOpacity:x,_=u.visible,k=void 0===_?l.visible:_,S=_c(g,m),A=Sc(g,C),B=c,R=Cc(p,w);if(t.valid&&k&&(B||R||d)&&(S||A||a||s||d)){var T=t.attribute,M=T.outerRadius,P=void 0===M?l.outerRadius:M,O=T.innerRadius,E=void 0===O?l.innerRadius:O,H=T.cap,L=void 0===H?l.cap:H,I=T.forceShowCap,D=void 0===I?l.forceShowCap:I,j=function(t){var e=!0;if(Mt(t,!0)){for(var n=0;n<4;n++)Va[n]=t;e=t}else if(Array.isArray(t))for(var i=0;i<4;i++)Va[i]=!!t[i],e&&(e=Va[i]);else Nt(t,!0)&&(Va[0]=!!(t&Ga.Top),Va[1]=!!(t&Ga.Right),Va[2]=!!(t&Ga.Bottom),Va[3]=!!(t&Ga.Left),e=Va[0]&&Va[1]&&Va[2]&&Va[3]);return{isFullStroke:e,stroke:Va}}(p),W=j.isFullStroke,F=j.stroke;if((B||W)&&(e.beginPath(),Xd(t,e,n,i,P,E),this._arcRenderContribitions||(this._arcRenderContribitions=this.arcRenderContribitions.getContributions()||[],this._arcRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._arcRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,B,R,S,A,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),B&&(a?a(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),R&&W&&(s?s(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke()))),!W&&R&&(e.beginPath(),Xd(t,e,n,i,P,E,F),s?s(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),L&&D){var z=t.getParsedAngle(),N=z.startAngle,G=z.endAngle;if(Oe(G-N)>=Pe-Be){e.beginPath();var U=Math.abs(P-E)/2/P,V=t.attribute,K=V.endAngle,Y=void 0===K?l.endAngle:K,X=V.fillColor,$=void 0===X?l.fillColor:X,q=Y;if(this.drawArcTailCapPath(t,e,n,i,P,E,q,q+U),B){var Z=$;if("conical"===Z.gradient){var J=function(t,e,n,i){for(var r=i.stops,o=i.startAngle,a=i.endAngle;n<0;)n+=Pe;for(;n>Pe;)n-=Pe;if(n<o)return r[0].color;if(n>a)return r[0].color;for(var s,l,u=(n-o)/(a-o),h=0;h<r.length;h++)if(r[h].offset>=u){s=r[h-1],l=r[h];break}return u=(u-s.offset)/(l.offset-s.offset),wl(s.color,l.color,u,!1)}(0,0,Y,Z);a||_c&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=J,e.fill())}}R&&(s||A&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke()))}}this._arcRenderContribitions||(this._arcRenderContribitions=this.arcRenderContribitions.getContributions()||[]),this._arcRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,B,R,S,A,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=Ml(t,null==i?void 0:i.theme).arc;r.highPerformanceSave();var a=t.attribute,s=a.x,l=void 0===s?o.x:s,u=a.y,h=void 0===u?o.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,h+=c.y,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);Bc(t,r,l,h,0,i)||this.drawShape(t,r,l,h,n,i),r.highPerformanceRestore()}}}]),t}();function qd(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}$d=Gd([po(),Vd(0,yo(Fa)),Vd(0,vo(Wd)),Ud("design:paramtypes",[Object])],$d);var Zd=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Jd=Symbol.for("CircleRenderContribution"),Qd=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.radius,f=void 0===d?l.radius:d,p=c.startAngle,v=void 0===p?l.startAngle:p,g=c.endAngle,y=void 0===g?l.endAngle:g,m=c.opacity,b=void 0===m?l.opacity:m,w=c.outerBorder,x=c.innerBorder;if(w){var C=w.distance,_=ja(e,void 0===C?l.outerBorder.distance:C,e.dpr);if(e.beginPath(),e.arc(n,i,f+_,v,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,w,l.outerBorder);else if(s){var k=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,w,n,i,l.outerBorder),l.outerBorder.opacity=k,e.stroke()}}if(x){var S=x.distance,A=ja(e,void 0===S?l.innerBorder.distance:S,e.dpr);if(e.beginPath(),e.arc(n,i,f-A,v,y),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,x,l.innerBorder);else if(s){var B=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,x,n,i,l.innerBorder),l.innerBorder.opacity=B,e.stroke()}}}}]),t}();Qd=Zd([po()],Qd);var tf=function(t){Ke(n,t);var e=qd(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);tf=Zd([po()],tf);var ef=function(t){Ke(n,t);var e=qd(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id);ef=Zd([po()],ef);var nf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},of=function(t,e){return function(n,i){e(n,i,t)}},af=function(){function t(e){Ae(this,t),this.circleRenderContribitions=e,this.numberType=Gl}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Ml(t,null==o?void 0:o.theme).circle,u=t.attribute,h=u.fill,c=void 0===h?null==l.fill?!!t.attribute.fillColor:l.fill:h,d=u.background,f=u.stroke,p=void 0===f?null==l.stroke?!!t.attribute.strokeColor:l.stroke:f,v=u.radius,g=void 0===v?l.radius:v,y=u.startAngle,m=void 0===y?l.startAngle:y,b=u.endAngle,w=void 0===b?l.endAngle:b,x=u.fillOpacity,C=void 0===x?l.fillOpacity:x,_=u.strokeOpacity,k=void 0===_?l.strokeOpacity:_,S=u.opacity,A=void 0===S?l.opacity:S,B=u.lineWidth,R=void 0===B?l.lineWidth:B,T=u.visible,M=void 0===T?l.visible:T,P=_c(A,C),O=Sc(A,k),E=c,H=Cc(p,R);t.valid&&M&&(E||H||d)&&(P||O||a||s||d)&&(e.beginPath(),e.arc(n,i,g,m,w),e.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._circleRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,E,H,P,O,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),E&&(a?a(e,t.attribute,l):P&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),H&&(s?s(e,t.attribute,l):O&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._circleRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,E,H,P,O,l,a,s)})))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).circle,a=t.attribute,s=a.x,l=void 0===s?o.x:s,u=a.y,h=void 0===u?o.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,h+=c.y,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);Bc(t,r,l,h,0,i)||this.drawShape(t,r,l,h,n,i),r.highPerformanceRestore()}}}]),t}();af=nf([po(),of(0,yo(Fa)),of(0,vo(Jd)),rf("design:paramtypes",[Object])],af);var sf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},lf=function(){function t(){Ae(this,t)}return Se(t,[{key:"transform",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.transMatrix.onlyTranslate(),o=t.attribute,a=o.x,s=void 0===a?e.x:a,l=o.y,u=void 0===l?e.y:l,h=o.z,c=void 0===h?e.z:h,d=o.scaleX,f=void 0===d?e.scaleX:d,p=o.scaleY,v=void 0===p?e.scaleY:p,g=o.angle,y=void 0===g?e.angle:g,m=n.modelMatrix,b=n.camera,w={x:s,y:u,z:c,lastModelMatrix:m},x=b&&(i||function(t){var e=t.attribute,n=e.alpha,i=e.beta;return n||i}(t));if(x){var C=HC.allocate(),_=HC.allocate();kg(_,t,e),_g(C,m||C,_),w.x=0,w.y=0,w.z=0,n.modelMatrix=C,n.setTransform(1,0,0,1,0,0,!0),HC.free(_)}if(r&&!m){var k=t.getOffsetXY(e);w.x+=k.x,w.y+=k.y,w.z=c,n.setTransformForCurrent()}else if(x)w.x=0,w.y=0,w.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(b&&n.project){var S=t.getOffsetXY(e);w.x+=S.x,w.y+=S.y,this.transformWithoutTranslate(n,w.x,w.y,w.z,f,v,y)}else n.transformFromMatrix(t.transMatrix,!0),w.x=0,w.y=0,w.z=0;return w}},{key:"transformUseContext2d",value:function(t,e,n,i){var r=i.camera;if(this.camera=r,r){var o=t.AABBBounds,a=o.x2-o.x1,s=o.y2-o.y1,l=i.project(0,0,n),u=i.project(a,0,n),h=i.project(a,s,n),c={x:0,y:0},d={x:a,y:0},f={x:a,y:s};i.camera=null;var p=1/(c.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*c.y),v=-(c.y*(h.x-u.x)-d.y*h.x+f.y*u.x+(d.y-f.y)*l.x)*p,g=(d.y*h.y+c.y*(u.y-h.y)-f.y*u.y+(f.y-d.y)*l.y)*p,y=(c.x*(h.x-u.x)-d.x*h.x+f.x*u.x+(d.x-f.x)*l.x)*p,m=-(d.x*h.y+c.x*(u.y-h.y)-f.x*u.y+(f.x-d.x)*l.y)*p,b=(c.x*(f.y*u.x-d.y*h.x)+c.y*(d.x*h.x-f.x*u.x)+(f.x*d.y-d.x*f.y)*l.x)*p,w=(c.x*(f.y*u.y-d.y*h.y)+c.y*(d.x*h.y-f.x*u.y)+(f.x*d.y-d.x*f.y)*l.y)*p;i.setTransform(v,g,y,m,b,w,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,n,i){this.camera&&(i.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,n,i,r,o,a){var s=t.project(e,n,i);t.translate(s.x,s.y,!1),t.scale(r,o,!1),t.rotate(a,!1),t.translate(-s.x,-s.y,!1),t.setTransformForCurrent()}}]),t}();function uf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var hf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},cf=function(t){Ke(n,t);var e=uf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).numberType=uh,t}return Se(n,[{key:"draw",value:function(t,e,n,i){var r=n.context;r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).line,a=this.transform(t,o,r),s=a.x,l=a.y,u=a.z,h=a.lastModelMatrix;this.z=u,Bc(t,r,s,l)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==h&&HC.free(r.modelMatrix),r.modelMatrix=h),r.highPerformanceRestore()}},{key:"drawSegmentItem",value:function(t,e,n,i,r,o,a,s,l,u,h,c,d,f,p){var v;t.beginPath();var g=null!==(v=this.z)&&void 0!==v?v:0;return function(t,e,n,i,r){var o=r||{},a=o.offsetX,s=void 0===a?0:a,l=o.offsetY,u=void 0===l?0:l,h=o.offsetZ,c=void 0===h?0:h,d=!0,f=e.curves;if(n>=1)f.forEach((function(e){e.defined?(d&&t.moveTo(e.p0.x+s,e.p0.y+u,c),ts(t,e,1,r),d=!1):d=!0}));else if(!(n<=0)){var p;"x"===i?p=Po.ROW:"y"===i?p=Po.COLUMN:"auto"===i&&(p=e.direction);for(var v=n*e.tryUpdateLength(p),g=0,y=0,m=f.length;y<m;y++){var b=f[y],w=b.getLength(p),x=(v-g)/w;if(g+=w,x<0)break;b.defined?(d&&t.moveTo(b.p0.x+s,b.p0.y+u,c),ts(t,b,Ie(x,1),r),d=!1):d=!0}}}(t.camera?t:t.nativeContext,e,l,u,{offsetX:h,offsetY:c,offsetZ:g}),d.cache&&!Wt(d.cache)&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(d,a,s),!1!==n&&(f?f(t,a,s):r&&(t.setCommonStyle(d,a,h,c,s),t.fill())),!1!==i&&(p?p(t,a,s):o&&(t.setStrokeStyle(d,a,h,c,s),t.stroke())),!1}},{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=this,u=Ml(t,null==o?void 0:o.theme).line,h=t.attribute,c=h.fill,d=void 0===c?null==u.fill?!!t.attribute.fillColor:u.fill:c,f=h.stroke,p=void 0===f?null==u.stroke?!!t.attribute.strokeColor:u.stroke:f,v=h.opacity,g=void 0===v?u.opacity:v,y=h.fillOpacity,m=void 0===y?u.fillOpacity:y,b=h.strokeOpacity,w=void 0===b?u.strokeOpacity:b,x=h.lineWidth,C=void 0===x?u.lineWidth:x,_=h.visible,k=void 0===_?u.visible:_,S=_c(g,m),A=Sc(g,w),B=d,R=Cc(p,C);if(t.valid&&k&&(B||R)&&(S||A||a||s)){if(t.shouldUpdateShape()){var T=t.attribute,M=T.points,P=T.segments,O=T.curveType,E=void 0===O?u.curveType:O,H=M;if(P&&P.length){var L,I;t.cache=P.map((function(t,e){return 1===e?L={x:I.endX,y:I.endY,defined:I.curves[I.curves.length-1].defined}:e>1&&(L.x=I.endX,L.y=I.endY,L.defined=I.curves[I.curves.length-1].defined),I=ca(t.points,E,{startPoint:L})}))}else{if(!M||!M.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ca(H,E)}t.clearUpdateShapeTag()}var D=t.attribute,j=D.clipRange,W=void 0===j?u.clipRange:j,F=D.clipRangeByDimension,z=void 0===F?u.clipRangeByDimension:F;if(Array.isArray(t.cache))if(1===W){var N=!1;t.cache.forEach((function(r,o){N||(N=l.drawSegmentItem(e,r,d,!!p,m,w,t.attribute.segments[o],[u,t.attribute],W,z,n,i,t,a,s))}))}else{var G=t.cache.reduce((function(t,e){return t+e.getLength()}),0),U=W*G,V=0,K=!1;t.cache.forEach((function(r,o){if(!K){var h=r.getLength(),c=(U-V)/h;V+=h,c>0&&(K=l.drawSegmentItem(e,r,d,!!p,m,w,t.attribute.segments[o],[u,t.attribute],Ie(c,1),z,n,i,t,a,s))}}))}else this.drawSegmentItem(e,t.cache,d,!!p,m,w,t.attribute,u,W,z,n,i,t,a,s)}}}]),n}(lf=sf([po()],lf));function df(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}cf=hf([po()],cf);var ff=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pf=Symbol.for("AreaRenderContribution"),vf=function(t){Ke(n,t);var e=df(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);vf=ff([po()],vf);var gf=function(t){Ke(n,t);var e=df(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h,c){var d,f,p,v;this.textureMap||this.initTextureMap(e,t.stage);var g=(c||{}).attribute,y=void 0===g?t.attribute:g,m=y.texture,b=void 0===m?null!==(d=t.attribute.texture)&&void 0!==d?d:l.texture:m,w=y.textureColor,x=void 0===w?null!==(f=t.attribute.textureColor)&&void 0!==f?f:l.textureColor:w,C=y.textureSize,_=void 0===C?null!==(p=t.attribute.textureSize)&&void 0!==p?p:l.textureSize:C,k=y.texturePadding,S=void 0===k?null!==(v=t.attribute.texturePadding)&&void 0!==v?v:l.texturePadding:k;if(b){var A=this.textureMap.get(b);if(!A)switch(b){case"circle":A=this.createCirclePattern(_,S,x,e);break;case"diamond":A=this.createDiamondPattern(_,S,x,e);break;case"rect":A=this.createRectPattern(_,S,x,e);break;case"vertical-line":A=this.createVerticalLinePattern(_,S,x,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(_,S,x,e);break;case"bias-lr":A=this.createBiasLRLinePattern(_,S,x,e);break;case"bias-rl":A=this.createBiasRLLinePattern(_,S,x,e);break;case"grid":A=this.createGridPattern(_,S,x,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}}}]),n}(Id);function yf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}gf=ff([po()],gf);var mf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bf=Symbol.for("GroupRenderContribution"),wf=function(t){Ke(n,t);var e=yf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute.background;if(c)if(t.backgroundImg&&t.resources){var d=t.resources.get(c);if("success"!==d.state||!d.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var f=t.AABBBounds;e.drawImage(d.data,f.x1,f.y1,f.width(),f.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=c,e.fill(),e.highPerformanceRestore()}}]),n}(Ld);function xf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}wf=mf([po()],wf);var Cf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_f=Symbol.for("ImageRenderContribution"),kf=function(t){Ke(n,t);var e=xf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.background;c.width,c.height;if(d)if(t.backgroundImg){var f=t.resources.get(d);if("success"!==f.state||!f.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var p=Ml(t.parent).group,v=t.parent.attribute,g=v.scrollX,y=void 0===g?p.scrollX:g,m=v.scrollY,b=void 0===m?p.scrollY:m;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(y,b)}var w=t.AABBBounds;e.drawImage(f.data,w.x1,w.y1,w.width(),w.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else{e.beginPath();var x=t.AABBBounds;e.rect(n,i,x.width(),x.height()),e.fillStyle=d,e.globalAlpha=1,e.fill()}}}]),n}(Ld);function Sf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}kf=Cf([po()],kf);var Af=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Bf=Symbol.for("RectRenderContribution"),Rf=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.width,f=void 0===d?l.width:d,p=c.height,v=void 0===p?l.height:p,g=c.borderRadius,y=void 0===g?l.borderRadius:g,m=c.opacity,b=void 0===m?l.opacity:m,w=c.outerBorder,x=c.innerBorder;if(w){var C=w.distance,_=ja(e,void 0===C?l.outerBorder.distance:C,e.dpr),k=n-_,S=i-_,A=2*_;if(0===y||Wt(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(k,S,f+A,v+A)):(e.beginPath(),Qa(e,k,S,f+A,v+A,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,w,l.outerBorder);else if(s){var B=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,w,n,i,l.outerBorder),l.outerBorder.opacity=B,e.stroke()}}if(x){var R=x.distance,T=ja(e,void 0===R?l.innerBorder.distance:R,e.dpr),M=n+T,P=i+T,O=2*T;if(0===y||Wt(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(M,P,f-O,v-O)):(e.beginPath(),Qa(e,M,P,f-O,v-O,y)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,x,l.innerBorder);else if(s){var E=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,x,n,i,l.innerBorder),l.innerBorder.opacity=E,e.stroke()}}}}]),t}();Rf=Af([po()],Rf);var Tf=function(t){Ke(n,t);var e=Sf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);Tf=Af([po()],Tf);var Mf=function(t){Ke(n,t);var e=Sf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id);Mf=Af([po()],Mf);var Pf=function(){function t(){Ae(this,t),this.time=Ed.beforeFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h,c){var d=t.attribute.stroke,f=void 0===d?l.stroke:d;Array.isArray(f)&&(c.doStroke=!1)}}]),t}();Pf=Af([po()],Pf);var Of=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.width,f=void 0===d?l.width:d,p=c.height,v=void 0===p?l.height:p,g=c.stroke,y=void 0===g?l.stroke:g;if(Array.isArray(y)){if(e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),y[0]?e.lineTo(n+f,i):e.moveTo(n+f,i),y[1]?e.lineTo(n+f,i+v):e.moveTo(n+f,i+v),y[2]?e.lineTo(n,i+v):e.moveTo(n,i+v),y[3]){var m=y[0]?i-e.lineWidth/2:i;e.lineTo(n,m)}else e.moveTo(n,i);e.stroke()}}}]),t}();function Ef(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Of=Af([po()],Of);var Hf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Lf=Symbol.for("SymbolRenderContribution"),If=function(){function t(){Ae(this,t),this.time=Ed.afterFillStroke,this.useStyle=!0,this.order=0}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s,l,u,h){var c=t.attribute,d=c.size,f=void 0===d?l.size:d,p=c.opacity,v=void 0===p?l.opacity:p,g=c.outerBorder,y=c.innerBorder,m=t.getParsedPath();if(m){if(g){var b=g.distance,w=ja(e,void 0===b?l.outerBorder.distance:b,e.dpr);if(e.beginPath(),!1===m.drawOffset(e,f,n,i,w)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,g,l.outerBorder);else if(s){var x=l.outerBorder.opacity;l.outerBorder.opacity=v,e.setStrokeStyle(t,g,n,i,l.outerBorder),l.outerBorder.opacity=x,e.stroke()}}if(y){var C=y.distance,_=ja(e,void 0===C?l.innerBorder.distance:C,e.dpr);if(e.beginPath(),!1===m.drawOffset(e,f,n,i,-_)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),h)h(e,y,l.innerBorder);else if(s){var k=l.innerBorder.opacity;l.innerBorder.opacity=v,e.setStrokeStyle(t,y,n,i,l.innerBorder),l.innerBorder.opacity=k,e.stroke()}}}}}]),t}();If=Hf([po()],If);var Df=function(t){Ke(n,t);var e=Ef(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld),jf=function(t){Ke(n,t);var e=Ef(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id),Wf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ff=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zf=function(t,e){return function(n,i){e(n,i,t)}};function Nf(t,e,n){switch(e){case"linear":default:return Vo(t,n);case"basis":return $o(t,n);case"monotoneX":return ia(t,n);case"monotoneY":return ra(t,n);case"step":return sa(t,.5,n);case"stepBefore":return sa(t,0,n);case"stepAfter":return sa(t,1,n);case"linearClosed":return ha(t,n)}}var Gf=function(){function t(e){Ae(this,t),this.areaRenderContribitions=e,this.numberType=Xh}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u,h,c,d,f,p=this,v=Ml(t,null==o?void 0:o.theme).area,g=t.attribute,y=g.fill,m=void 0===y?null==v.fill?!!t.attribute.fillColor:v.fill:y,b=g.fillOpacity,w=void 0===b?v.fillOpacity:b,x=g.opacity,C=void 0===x?v.opacity:x,_=g.visible,k=void 0===_?v.visible:_,S=g.z,A=void 0===S?v.z:S,B=g.stroke,R=void 0===B?!!t.attribute.strokeColor:B,T=g.lineWidth,M=void 0===T?v.lineWidth:T,P=g.strokeOpacity,O=void 0===P?v.strokeOpacity:P,E=_c(C,w),H=m,L=Cc(R,M),I=Sc(C,O);if(t.valid&&k&&(H||L)&&(E||a||I||s)){var D=t.attribute.clipRange,j=void 0===D?v.clipRange:D;if(t.shouldUpdateShape()){var W=t.attribute,F=W.points,z=W.segments,N=W.curveType,G=void 0===N?v.curveType:N;if(z&&z.length){for(var U,V,K,Y=z.map((function(t,e){return 1===e?U={x:V.endX,y:V.endY}:e>1&&(U.x=V.endX,U.y=V.endY),V=Nf(t.points,G,{startPoint:U})})),X=[],$=z.length-1;$>=0;$--){for(var q=z[$].points,Z=[],J=q.length-1;J>=0;J--)Z.push({x:null!==(l=q[J].x1)&&void 0!==l?l:q[J].x,y:null!==(u=q[J].y1)&&void 0!==u?u:q[J].y});if(0!==$){var Q=z[$-1].points,tt=Q[Q.length-1];tt&&Z.push({x:null!==(h=tt.x1)&&void 0!==h?h:tt.x,y:null!==(c=tt.y1)&&void 0!==c?c:tt.y})}K=Nf(Z,G),X.unshift(K)}t.cacheArea=X.map((function(t,e){return{top:Y[e],bottom:t}}))}else{if(!F||!F.length)return t.cache=null,void t.clearUpdateShapeTag();for(var et=F,nt=[],it=F.length-1;it>=0;it--)nt.push({x:null!==(d=F[it].x1)&&void 0!==d?d:F[it].x,y:null!==(f=F[it].y1)&&void 0!==f?f:F[it].y});var rt=Nf(et,G),ot=Nf(nt,"stepBefore"===G?"stepAfter":"stepAfter"===G?"stepBefore":G);t.cacheArea={top:rt,bottom:ot}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===j){var at=!1;t.cacheArea.forEach((function(r,o){at||(at=p.drawSegmentItem(e,r,m,w,t.attribute.segments[o],[v,t.attribute],j,n,i,A,t,a))}))}else{var st=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),lt=j*st,ut=0,ht=!1;t.cacheArea.forEach((function(r,o){if(!ht){var s=r.top.getLength(),l=(lt-ut)/s;ut+=s,l>0&&(ht=p.drawSegmentItem(e,r,m,w,t.attribute.segments[o],[v,t.attribute],Ie(l,1),n,i,A,t,a))}}))}else this.drawSegmentItem(e,t.cacheArea,m,w,t.attribute,v,j,n,i,A,t,a)}}},{key:"draw",value:function(t,e,n,i){var r=n.context,o=Ml(t,null==i?void 0:i.theme).area,a=t.attribute,s=a.x,l=void 0===s?o.x:s,u=a.y,h=void 0===u?o.y:u;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,h+=c.y,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);Bc(t,r,l,h,0,i)||this.drawShape(t,r,l,h,n,i),r.highPerformanceRestore()}},{key:"drawSegmentItem",value:function(t,e,n,i,r,o,a,s,l,u,h,c){return t.beginPath(),function(t,e,n,i){var r,o=e.top,a=e.bottom;if(n>=1){for(var s=[],l=[],u=!0,h=0,c=o.curves.length;h<c;h++){var d=o.curves[h];u!==d.defined?(u?(es(t,s,l,i),s.length=0,l.length=0):(s.push(d),l.push(a.curves[c-h-1])),u=!u):u&&(s.push(d),l.push(a.curves[c-h-1]))}es(t,s,l,i)}else if(!(n<=0)){var f=(i||{}).direction,p=o.curves,v=null!==(r=p[p.length-1].p3)&&void 0!==r?r:p[p.length-1].p1,g=Oe(v.x-p[0].p0.x),y=Oe(v.y-p[0].p0.y);f=null!=f?f:g>y?Po.ROW:Po.COLUMN,Number.isFinite(g)||(f=Po.COLUMN),Number.isFinite(y)||(f=Po.ROW);for(var m=n*(f===Po.ROW?g:y),b=0,w=!0,x=[],C=[],_=0,k=o.curves.length;_<k;_++){var S=o.curves[_],A=S.getLength(f),B=(m-b)/A;if(B<0)break;b+=A;var R=null,T=null;w!==S.defined?(w?(es(t,x,C,i),x.length=0,C.length=0):(R=S,T=a.curves[k-_-1]),w=!w):w&&(R=S,T=a.curves[k-_-1]),R&&T&&(B<1&&(R=R.p2&&R.p3?Ia(R,B)[0]:Da(R,B)[0],T=T.p2&&T.p3?Ia(T,1-B)[1]:Da(T,1-B)[1]),R.defined=w,T.defined=w,x.push(R),C.push(T)),R=null,T=null}es(t,x,C,i)}}(t.camera?t:t.nativeContext,e,a,{offsetX:s,offsetY:l,offsetZ:u}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._areaRenderContribitions.forEach((function(e){e.time===Ed.beforeFillStroke&&e.drawShape(h,t,s,l,!!i,!1,n,!1,o,c,null,{attribute:r})})),t.setShadowStyle&&t.setShadowStyle(h,r,o),!1!==n&&(c?c(t,r,o):i&&(t.setCommonStyle(h,r,s,l,o),t.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((function(e){e.time===Ed.afterFillStroke&&e.drawShape(h,t,s,l,!!i,!1,n,!1,o,c,null,{attribute:r})})),!1}}]),t}();function Uf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Gf=Wf([po(),zf(0,yo(Fa)),zf(0,vo(pf)),Ff("design:paramtypes",[Object])],Gf);var Vf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Kf=Symbol.for("PathRenderContribution"),Yf=function(t){Ke(n,t);var e=Uf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);Yf=Vf([po()],Yf);var Xf=function(t){Ke(n,t);var e=Uf(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id);function $f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Xf=Vf([po()],Xf);var qf=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jf=function(t,e){return function(n,i){e(n,i,t)}},Qf=function(t){Ke(n,t);var e=$f(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).pathRenderContribitions=t,i.numberType=Uh,i}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u,h=Ml(t,null==o?void 0:o.theme).path,c=t.attribute,d=c.fill,f=void 0===d?null==h.fill?!!t.attribute.fillColor:h.fill:d,p=c.stroke,v=void 0===p?null==h.stroke?!!t.attribute.strokeColor:h.stroke:p,g=c.fillOpacity,y=void 0===g?h.fillOpacity:g,m=c.strokeOpacity,b=void 0===m?h.strokeOpacity:m,w=c.opacity,x=void 0===w?h.opacity:w,C=c.background,_=c.lineWidth,k=void 0===_?h.lineWidth:_,S=c.visible,A=void 0===S?h.visible:S,B=null!==(l=this.z)&&void 0!==l?l:0,R=_c(x,y),T=Sc(x,b),M=f,P=Cc(v,k);if(t.valid&&A&&(M||P||C)&&(R||T||a||s||C)){if(e.beginPath(),t.pathShape)_a(t.pathShape.commandList,e,n,i,1,1,B);else _a((null!==(u=t.attribute.path)&&void 0!==u?u:h.path).commandList,e,n,i,1,1,B);this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._pathRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,M,P,R,T,h,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),P&&(s?s(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())),M&&(a?a(e,t.attribute,h):R&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fill())),this._pathRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,M,P,R,T,h,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).path,a=this.transform(t,o,r),s=a.x,l=a.y,u=a.z,h=a.lastModelMatrix;this.z=u,Bc(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==h&&HC.free(r.modelMatrix),r.modelMatrix=h),r.highPerformanceRestore()}}}]),n}(lf);Qf=qf([po(),Jf(0,yo(Fa)),Jf(0,vo(Kf)),Zf("design:paramtypes",[Object])],Qf);var tp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ep=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},np=function(t,e){return function(n,i){e(n,i,t)}},ip=function(){function t(e){Ae(this,t),this.rectRenderContribitions=e,this.type="rect",this.numberType=fh}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Ml(t,null==o?void 0:o.theme).rect,u=t.attribute,h=u.fill,c=void 0===h?null==l.fill?!!t.attribute.fillColor:l.fill:h,d=u.background,f=u.stroke,p=void 0===f?null==l.stroke?!!t.attribute.strokeColor:l.stroke:f,v=u.width,g=void 0===v?l.width:v,y=u.height,m=void 0===y?l.height:y,b=u.borderRadius,w=void 0===b?l.borderRadius:b,x=u.opacity,C=void 0===x?l.opacity:x,_=u.fillOpacity,k=void 0===_?l.fillOpacity:_,S=u.lineWidth,A=void 0===S?l.lineWidth:S,B=u.strokeOpacity,R=void 0===B?l.strokeOpacity:B,T=u.visible,M=void 0===T?l.visible:T,P=kc(C,k,g,m),O=Ac(C,R,g,m),E=c,H=Cc(p,A);if(t.valid&&M&&(E||H||d)&&(P||O||a||s||d)){0===w||Wt(w)&&w.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,g,m)):(e.beginPath(),Qa(e,n,i,g,m,w)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort((function(t,e){return e.order-t.order})));var L={doFill:E,doStroke:H};this._rectRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,E,H,P,O,l,a,s,L)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),L.doFill&&(a?a(e,t.attribute,l):P&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),L.doStroke&&(s?s(e,t.attribute,l):O&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._rectRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,E,H,P,O,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).rect,a=t.attribute,s=a.x,l=void 0===s?o.x:s,u=a.y,h=void 0===u?o.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,h+=c.y,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);Bc(t,r,l,h,0,i)||this.drawShape(t,r,l,h,n,i),r.highPerformanceRestore()}}}]),t}();function rp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}ip=tp([po(),np(0,yo(Fa)),np(0,vo(Bf)),ep("design:paramtypes",[Object])],ip);var op=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ap=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sp=function(t,e){return function(n,i){e(n,i,t)}},lp=function(t){Ke(n,t);var e=rp(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).symbolRenderContribitions=t,i.numberType=oh,i}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u=Ml(t,null==o?void 0:o.theme).symbol,h=t.attribute,c=h.size,d=void 0===c?u.size:c,f=h.fill,p=void 0===f?null==u.fill?!!t.attribute.fillColor:u.fill:f,v=h.background,g=h.fillOpacity,y=void 0===g?u.fillOpacity:g,m=h.strokeOpacity,b=void 0===m?u.strokeOpacity:m,w=h.opacity,x=void 0===w?u.opacity:w,C=h.lineWidth,_=void 0===C?u.lineWidth:C,k=h.stroke,S=void 0===k?null==u.stroke?!!t.attribute.strokeColor:u.stroke:k,A=h.visible,B=void 0===A?u.visible:A,R=_c(x,y),T=Sc(x,b),M=p,P=Cc(S,_);if(t.valid&&B&&(M||P||v)&&(R||T||a||s||v)){var O=t.getParsedPath();if(O){var E=t.attribute.keepDirIn3d,H=void 0===E?u.keepDirIn3d:E,L=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),H&&e.camera&&e.project){var I=e.project(n,i,L),D=e.camera;e.camera=null,!1===O.draw(e,d,I.x,I.y)&&e.closePath(),e.camera=D}else!1===O.draw(e,d,n,i,L)&&e.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._symbolRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,M,P,R,T,u,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),M&&(a?a(e,t.attribute,u):R&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fill())),P&&(s?s(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke())),this._symbolRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,M,P,R,T,u,a,s)}))}}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).symbol,a=this.transform(t,o,r),s=a.x,l=a.y,u=a.z,h=a.lastModelMatrix;this.z=u,Bc(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==h&&HC.free(r.modelMatrix),r.modelMatrix=h),r.highPerformanceRestore()}}}]),n}(lf);function up(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}lp=op([po(),sp(0,yo(Fa)),sp(0,vo(Lf)),ap("design:paramtypes",[Object])],lp);var hp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},cp=function(t){Ke(n,t);var e=up(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).numberType=Xl,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=this,u=Ml(t,null==o?void 0:o.theme).text,h=t.attribute,c=h.text,d=h.fill,f=void 0===d?null==u.fill?!!t.attribute.fillColor:u.fill:d,p=h.stroke,v=void 0===p?null==u.stroke?!!t.attribute.strokeColor:u.stroke:p,g=h.fillOpacity,y=void 0===g?u.fillOpacity:g,m=h.strokeOpacity,b=void 0===m?u.strokeOpacity:m,w=h.opacity,x=void 0===w?u.opacity:w,C=h.lineWidth,_=void 0===C?u.lineWidth:C,k=h.visible,S=void 0===k?u.visible:k,A=h.underline,B=void 0===A?u.underline:A,R=h.lineThrough,T=void 0===R?u.lineThrough:R,M=h.keepDirIn3d,P=void 0===M?u.keepDirIn3d:M,O=_c(x,y),E=Sc(x,b),H=f,L=Cc(v,_);if(t.valid&&S&&(H||L||O||E)){var I=!P,D=this.z||0;if(e.beginPath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),I&&this.transformUseContext2d(t,u,D,e),Array.isArray(c)){e.setTextStyleWithoutAlignBaseline(t.attribute,u,D);var j=t.multilineLayout;if(!j)return void e.highPerformanceRestore();var W=j.bbox,F=W.xOffset,z=W.yOffset;L&&(s?s(e,t.attribute,u):E&&(e.setStrokeStyle(t,t.attribute,n,i,u),j.lines.forEach((function(t){e.strokeText(t.str,(t.leftOffset||0)+F+n,(t.topOffset||0)+z+i,D)})))),H&&(a?a(e,t.attribute,u):O&&(e.setCommonStyle(t,t.attribute,n,i,u),j.lines.forEach((function(r){e.fillText(r.str,(r.leftOffset||0)+F+n,(r.topOffset||0)+z+i,D),l.drawMultiUnderLine(B,T,t,(r.leftOffset||0)+n,(r.topOffset||0)+z+i,D,r.width,u,e)}))))}else{e.setTextStyle(t.attribute,u,D);var N=t.clipedText;L&&(s?s(e,t.attribute,u):E&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.strokeText(N,n,i,D))),H&&(a?a(e,t.attribute,u):O&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fillText(N,n,i,D),this.drawUnderLine(B,T,t,n,i,D,u,e)))}I&&this.restoreTransformUseContext2d(t,u,D,e)}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?o.keepDirIn3d:a),l=this.transform(t,o,r,s),u=l.x,h=l.y,c=l.z,d=l.lastModelMatrix;this.z=c,this.drawShape(t,r,u,h,n,i),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}}},{key:"drawUnderLine",value:function(t,e,n,i,r,o,a,s){if(!(e+t<=0)){var l=n.attribute,u=l.textAlign,h=void 0===u?a.textAlign:u,c=l.textBaseline,d=void 0===c?a.textBaseline:c,f=l.fontSize,p=void 0===f?a.fontSize:f,v=l.fillColor,g=void 0===v?a.fillColor:v,y=l.opacity,m=void 0===y?a.opacity:y,b=l.fillOpacity,w=void 0===b?a.fillOpacity:b,x=n.clipedWidth,C=To(h,x),_=Mo(d,p),k={lineWidth:0,strokeColor:g,opacity:m,strokeOpacity:w};if(t){k.lineWidth=t,s.setStrokeStyle(n,k,i,r,a),s.beginPath();var S=r+_+p;s.moveTo(i+C,S,o),s.lineTo(i+C+x,S,o),s.stroke()}if(e){k.lineWidth=e,s.setStrokeStyle(n,k,i,r,a),s.beginPath();var A=r+_+p/2;s.moveTo(i+C,A,o),s.lineTo(i+C+x,A,o),s.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,n,i,r,o,a,s,l){if(!(e+t<=0)){var u=n.attribute,h=u.textAlign,c=void 0===h?s.textAlign:h,d=u.fontSize,f=void 0===d?s.fontSize:d,p=u.fillColor,v=void 0===p?s.fillColor:p,g=u.opacity,y=void 0===g?s.opacity:g,m=u.fillOpacity,b=void 0===m?s.fillOpacity:m,w=To(c,a),x=Mo("alphabetic",f),C={lineWidth:0,strokeColor:v,opacity:y,strokeOpacity:b},_=-3;if(t){C.lineWidth=t,l.setStrokeStyle(n,C,i,r,s),l.beginPath();var k=r+x+f+_;l.moveTo(i+w,k,o),l.lineTo(i+w+a,k,o),l.stroke()}if(_=-1,e){C.lineWidth=e,l.setStrokeStyle(n,C,i,r,s),l.beginPath();var S=r+x+f/2+_;l.moveTo(i+w,S,o),l.lineTo(i+w+a,S,o),l.stroke()}}}}]),n}(lf);cp=hp([po()],cp);var dp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},fp=Se((function t(){Ae(this,t)}));function pp(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function vp(t,e){return Math.sqrt(t*t+e*e)}function gp(t,e,n,i,r){var o=e/n;return{x:t.x-i*o,y:t.y-r*o}}function yp(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}fp=dp([po()],fp);var mp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bp=Symbol.for("PolygonRenderContribution"),wp=function(t){Ke(n,t);var e=yp(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.beforeFillStroke,t}return Se(n)}(Ld);wp=mp([po()],wp);var xp=function(t){Ke(n,t);var e=yp(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).time=Ed.afterFillStroke,t}return Se(n)}(Id);xp=mp([po()],xp);var Cp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_p=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kp=function(t,e){return function(n,i){e(n,i,t)}},Sp=function(){function t(e){Ae(this,t),this.polygonRenderContribitions=e,this.numberType=sc}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Ml(t,null==o?void 0:o.theme).polygon,u=t.attribute,h=u.points,c=void 0===h?l.points:h,d=u.fill,f=void 0===d?null==l.fill?!!t.attribute.fillColor:l.fill:d,p=u.stroke,v=void 0===p?null==l.stroke?!!t.attribute.strokeColor:l.stroke:p,g=u.borderRadius,y=void 0===g?l.borderRadius:g,m=u.fillOpacity,b=void 0===m?l.fillOpacity:m,w=u.background,x=u.strokeOpacity,C=void 0===x?l.strokeOpacity:x,_=u.lineWidth,k=void 0===_?l.lineWidth:_,S=u.opacity,A=void 0===S?l.opacity:S,B=u.visible,R=void 0===B?l.visible:B,T=_c(A,b),M=Sc(A,C),P=f,O=Cc(v,k);t.valid&&R&&(P||O||w)&&(T||M||a||s||w)&&(e.beginPath(),y<=0||Wt(y)&&y.every((function(t){return 0===t}))?pp(e.camera?e:e.nativeContext,c,n,i):function(t,e,n,i,r){var o;if(e.length<3)pp(t,e,n,i);else for(var a=0;a<e.length;a++){var s=e[a],l=e[(a+1)%e.length],u=e[(a+2)%e.length],h=l.x-s.x,c=l.y-s.y,d=l.x-u.x,f=l.y-u.y,p=(Math.atan2(c,h)-Math.atan2(f,d))/2,v=Math.abs(Math.tan(p)),g=Array.isArray(r)?null!==(o=r[(a+1)%e.length])&&void 0!==o?o:0:r,y=g/v,m=vp(h,c),b=vp(d,f),w=Math.min(m,b);y>w&&(y=w,g=w*v);var x=gp(l,y,m,h,c),C=gp(l,y,b,d,f),_=2*l.x-x.x-C.x,k=2*l.y-x.y-C.y,S=vp(_,k),A=gp(l,vp(y,g),S,_,k),B=Math.atan2(x.y-A.y,x.x-A.x),R=Math.atan2(C.y-A.y,C.x-A.x),T=R-B;T<0&&(B=R,T=-T),T>Math.PI&&(T-=Math.PI),0===a?t.moveTo(x.x+n,x.y+i):t.lineTo(x.x+n,x.y+i),T&&t.arcTo(l.x+n,l.y+i,C.x+n,C.y+i,g),t.lineTo(C.x+n,C.y+i)}}(e.camera?e:e.nativeContext,c,n,i,y),e.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort((function(t,e){return e.order-t.order}))),this._polygonRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,P,O,T,M,l,a,s)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),P&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),O&&(s?s(e,t.attribute,l):C&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._polygonRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,P,O,T,M,l,a,s)})))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){r.highPerformanceSave();var o=Ml(t,null==i?void 0:i.theme).polygon,a=t.attribute,s=a.x,l=void 0===s?o.x:s,u=a.y,h=void 0===u?o.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(o);l+=c.x,h+=c.y,r.setTransformForCurrent()}else l=0,h=0,r.transformFromMatrix(t.transMatrix,!0);Bc(t,r,l,h,0,i)||this.drawShape(t,r,l,h,n,i),r.highPerformanceRestore()}}}]),t}();Sp=Cp([po(),kp(0,yo(Fa)),kp(0,vo(bp)),_p("design:paramtypes",[Object])],Sp);var Ap=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Bp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rp=function(t,e){return function(n,i){e(n,i,t)}},Tp=function(){function t(e){Ae(this,t),this.imageRenderContribitions=e,this.numberType=Oh}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a){var s=Ml(t).image,l=t.attribute,u=l.fill,h=void 0===u?s.fill:u,c=l.width,d=void 0===c?s.width:c,f=l.height,p=void 0===f?s.height:f,v=l.opacity,g=void 0===v?s.opacity:v,y=l.fillOpacity,m=void 0===y?s.fillOpacity:y,b=l.visible,w=void 0===b?s.visible:b,x=l.image,C=_c(g,m),_=h;if(t.valid&&w&&_&&(C||a)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,_,!1,C,!1,s,a)})),e.setShadowStyle&&e.setShadowStyle(t,s),_)if(a)a(e,t.attribute,s);else if(C){if(!x||!t.resources)return;var k=t.resources.get(x);if("success"!==k.state)return;e.setCommonStyle(t,t.attribute,n,i,s),e.drawImage(k.data,n,i,d,p)}this._imageRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,_,!1,C,!1,s,a)}))}}},{key:"draw",value:function(t,e,n){var i=e.drawParams.context;if(i){var r=Ml(t).image,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l,h=t.attribute.image;if(h&&t.resources&&"success"===t.resources.get(h).state){if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,u+=c.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,u,n),i.highPerformanceRestore()}}}}]),t}();Tp=Ap([po(),Rp(0,yo(Fa)),Rp(0,vo(_f)),Bp("design:paramtypes",[Object])],Tp);var Mp=Symbol.for("IncrementalDrawContribution"),Pp=Symbol.for("ArcRender"),Op=Symbol.for("Arc3dRender"),Ep=Symbol.for("AreaRender"),Hp=Symbol.for("CircleRender"),Lp=Symbol.for("GraphicRender"),Ip=Symbol.for("GroupRender"),Dp=Symbol.for("LineRender"),jp=Symbol.for("PathRender"),Wp=Symbol.for("PolygonRender"),Fp=Symbol.for("RectRender"),zp=Symbol.for("Rect3DRender"),Np=Symbol.for("SymbolRender"),Gp=Symbol.for("TextRender"),Up=Symbol.for("RichTextRender"),Vp=Symbol.for("Pyramid3dRender"),Kp=Symbol.for("GlyphRender"),Yp=Symbol.for("ImageRender"),Xp=Symbol.for("RenderSelector"),$p=Symbol.for("DrawContribution"),qp=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jp=function(t,e){return function(n,i){e(n,i,t)}},Qp=Symbol.for("RenderService"),tv=(Symbol.for("BeforeRenderConstribution"),function(){function t(e){Ae(this,t),this.drawContribution=e}return Se(t,[{key:"prepare",value:function(t){var e=this;this.renderTreeRoots.forEach((function(n){e._prepare(n,t)}))}},{key:"_prepare",value:function(t,e){var n=this;t.forEachChildren((function(t){n._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}}]),t}());tv=qp([po(),Jp(0,yo($p)),Zp("design:paramtypes",[Object])],tv);var ev=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},nv=Symbol.for("PickItemInterceptor"),iv=function(){function t(){Ae(this,t),this.order=1}return Se(t,[{key:"beforePickItem",value:function(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;var o=e.pickContext,a=t.stage;if(!o||!a)return null;if(i.in3dInterceptor=!0,o.save(),this.initCanvasCtx(o),o.camera=a.camera,t.isContainer){var s,l=!1,u=!1;if(t.forEachChildren((function(t){return!(l=t.numberType===ec)})),t.forEachChildren((function(t){return!(u=!!t.findFace)})),l){var h=t.getChildren(),c=ie(h);c.sort((function(t,e){for(var n,i,r,o,a=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i:0)/2,s=(null!==(o=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==o?o:0)/2;a<0;)a+=Pe;for(;s<0;)s+=Pe;return s-a})),c.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),c.forEach((function(e){t.appendChild(e)})),i.hack_pieFace="outside",(s=e.pickGroup(t,n,r.parentMatrix,i)).graphic||(i.hack_pieFace="inside",s=e.pickGroup(t,n,r.parentMatrix,i)),s.graphic||(i.hack_pieFace="top",s=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),h.forEach((function(t){t._next=null,t._prev=null})),h.forEach((function(e){t.appendChild(e)}))}else if(u){var d=t.getChildren(),f=d.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return o.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));f.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),f.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),f.forEach((function(e){t.add(e.g)})),s=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),t.update(),d.forEach((function(e){t.add(e)}))}else s=e.pickGroup(t,n,r.parentMatrix,i);return o.camera=null,o.restore(),i.in3dInterceptor=!1,s}return null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();iv=ev([po()],iv);var rv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ov=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},av=function(t,e){return function(n,i){e(n,i,t)}},sv=(Symbol.for("GraphicPicker"),Symbol.for("PickerService")),lv=function(){function t(e,n){Ae(this,t),this.global=e,this.pickItemInterceptorContributions=n,this.type="default"}return Se(t,[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,e,n){var i={graphic:null,group:null};n.pickerService=this;var r=0,o=0;if(n&&n.bounds){if(!n.bounds.contains(e.x,e.y))return i;r=n.bounds.x1,o=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var a,s=new an(1,0,0,1,r,o),l=t.length-1;l>=0&&(t[l].isContainer?i=this.pickGroup(t[l],e,s,n):i.graphic=this.pickItem(t[l],e,n),!i.graphic);l--)a||(a=i.group);return i.graphic||(i.group=a),this.pickContext&&(this.pickContext.inuse=!1),i}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,o={group:null,graphic:null};if(!1===t.attribute.visibleAll)return o;var a=i.pickContext,s=a.modelMatrix;if(a.camera){var l=t.transMatrix,u=HC.allocate();if(Cg(u,l),s){if(u){var h=HC.allocate();a.modelMatrix=_g(h,s,u),HC.free(u)}}else Cg(u,t.globalTransMatrix),a.modelMatrix=u}if(this.InterceptorContributions.length)for(var c=0;c<this.InterceptorContributions.length;c++){var d=this.InterceptorContributions[c];if(d.beforePickItem){var f=d.beforePickItem(t,this,e,i,{parentMatrix:n});if(f)return a.modelMatrix!==s&&HC.free(a.modelMatrix),a.modelMatrix=s,f}}var p=t.transMatrix,v=EC.allocateByObj(n),g=new Ge(e.x,e.y);v.transformPoint(g,g);var y=t.AABBBounds.containsPoint(g);if(!y&&!t.stage.camera)return o;var m=!1!==t.attribute.pickable&&y;return v.multiply(p.a,p.b,p.c,p.d,p.e,p.f),!1!==t.attribute.childrenPickable&&cs(t,$s.zIndex,(function(n){if(n.isContainer){var a=new Ge(e.x,e.y),s=Ml(t).group,l=t.attribute,u=l.scrollX,h=void 0===u?s.scrollX:u,c=l.scrollY,d=void 0===c?s.scrollY:c;a.x-=h,a.y-=d,o=r.pickGroup(n,a,v,i)}else{var f=new Ge(e.x,e.y);v.transformPoint(f,f);var p=Ml(t).group,g=t.attribute,y=g.scrollX,m=void 0===y?p.scrollX:y,b=g.scrollY,w=void 0===b?p.scrollY:b;f.x-=m,f.y-=w;var x=r.pickItem(n,f,i);o.graphic=x}return!!o.graphic||!!o.group}),!0,!!a.camera),a.modelMatrix!==s&&HC.free(a.modelMatrix),a.modelMatrix=s,o.graphic||o.group||!m||t.stage.camera||(o.group=t),EC.free(v),o}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}]),t}();lv=rv([po(),av(0,yo(ko)),av(1,yo(Fa)),av(1,vo(nv)),ov("design:paramtypes",[Object,Object])],lv);var uv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cv=Symbol.for("PluginService"),dv=function(){function t(){Ae(this,t),this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}return Se(t,[{key:"active",value:function(t){this.stage=t,this.actived=!0}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(n){n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((function(n){n.name===t&&e.push(n)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}]),t}();dv=uv([po(),hv("design:paramtypes",[])],dv);var fv=function(){function t(){Ae(this,t),this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=Ua.GenAutoIncrementId(),this.key=this.name+this._uid}return Se(t,[{key:"activate",value:function(t){this.pluginService=t,OC.hooks.onAttributeUpdate.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),OC.hooks.onSetStage.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}},{key:"deactivate",value:function(t){var e=this;OC.hooks.onAttributeUpdate.taps=OC.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),OC.hooks.onSetStage.taps=OC.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}]),t}(),pv=function(){function t(){var e=this;Ae(this,t),this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Ua.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!0,e.pageX=t.page.x,e.pageY=t.page.y)},this.onMouseUp=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!1)},this.onMouseMove=function(t){var n=e.pluginService.stage;if(e.option3d||(e.option3d=n.option3d),e.option3d&&e.mousedown)if(e.pageX&&e.pageY){var i=t.page.x-e.pageX,r=t.page.y-e.pageY;e.pageX=t.page.x,e.pageY=t.page.y;var o=i/100,a=r/100;e.option3d.alpha+=o,e.option3d.beta+=a,n.set3dOptions(e.option3d),n.renderNextFrame()}else e.pageX=t.page.x,e.pageY=t.page.y}}return Se(t,[{key:"activate",value:function(t){this.pluginService=t;var e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}},{key:"deactivate",value:function(t){var e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}]),t}(),vv=function(){function t(){Ae(this,t),this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=Ua.GenAutoIncrementId(),this.key=this.name+this._uid}return Se(t,[{key:"activate",value:function(t){var e=this;this.pluginService=t,OC.hooks.onAddIncremental.tap(this.key,(function(n,i,r){n.glyphHost&&(n=n.glyphHost),n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=i._uid,e.renderNextFrame(i))})),OC.hooks.onClearIncremental.tap(this.key,(function(n,i){n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=n._uid,e.nextUserParams.restartIncremental=!0,e.renderNextFrame(n))}))}},{key:"deactivate",value:function(t){var e=this;OC.hooks.onAddIncremental.taps=OC.hooks.onAddIncremental.taps.filter((function(t){return t.name!==e.key})),OC.hooks.onClearIncremental.taps=OC.hooks.onClearIncremental.taps.filter((function(t){return t.name!==e.key}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,TC.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this,e=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((function(n){var i=n.layer;if(i&&n.layer.subLayers){var r=n.layer.subLayers.get(n._uid);r&&r.drawContribution&&r.drawContribution.draw(e.renderService,Object.assign({x:e.x,y:e.y,width:i.viewWidth,height:i.viewHeight,stage:e,layer:i,clear:"transparent",renderService:e.renderService,updateBounds:!1,startAtId:n._uid,context:r.layer.getNativeHandler().getContext()},t.nextUserParams))}})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}]),t}(),gv=new Qe,yv=function(){function t(){Ae(this,t),this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=Ua.GenAutoIncrementId(),this.key=this.name+this._uid}return Se(t,[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(t){t&&t===e.pluginService.stage&&t.dirtyBounds.clear()})),OC.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(gv.setValue(r.x1,r.y1,r.x2,r.y2),n.dirty(gv,t.parent&&t.parent.globalTransMatrix)))})),OC.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,o){n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!o||n.dirty(r.globalAABBBounds))})),OC.hooks.onRemove.tap(this.key,(function(t){var n=t.stage;n&&n===e.pluginService.stage&&n.renderCount&&n&&n.dirty(t.globalAABBBounds)}))}},{key:"deactivate",value:function(t){var e=this;OC.hooks.beforeUpdateAABBBounds.taps=OC.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),OC.hooks.afterUpdateAABBBounds.taps=OC.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),OC.hooks.onRemove.taps=OC.hooks.onRemove.taps.filter((function(t){return t.name!==e.key}))}}]),t}(),mv=function(){function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;Ae(this,t),this.dir=e,this.color=n,this.colorRgb=ml.get(n).value,this.colorRgb[0]/=255,this.colorRgb[1]/=255,this.colorRgb[2]/=255,this.ambient=i;var r=je(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}return Se(t,[{key:"computeColor",value:function(t,e){var n,i=this.formatedDir,r=Ie(Le((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);n=jt(e)?ml.get(e).value:e;var o=this.colorRgb;return ml.to.rgb(o[0]*n[0]*r,o[1]*n[1]*r,o[2]*n[2]*r)}}]),t}();function bv(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var wv="white",xv=function(t){Ke(n,t);var e=bv(n);function n(t){var i,r;return Ae(this,n),(i=e.call(this,{})).beforeRender=function(t){i._beforeRender&&i._beforeRender(t)},i.afterRender=function(t){i.renderCount++,i._afterRender&&i._afterRender(t),i._afterNextRenderCbs&&i._afterNextRenderCbs.forEach((function(e){return e(t)})),i._afterNextRenderCbs=null},i.theme=new Rl,i.hooks={beforeRender:new Bo(["stage"]),afterRender:new Bo(["stage"])},i.global=RC.get(ko),i.window=RC.get(gc),i.renderService=RC.get(Qp),i.pickerService=RC.get(sv),i.pluginService=RC.get(cv),i.pluginService.active(Ye(i)),i.window.create({width:t.width,height:t.height,container:t.container,dpr:t.dpr||i.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),i._viewBox=new Qe,t.viewBox?i._viewBox.setValue(t.viewBox.x1,t.viewBox.y1,t.viewBox.x2,t.viewBox.y2):i._viewBox.setValue(0,0,i.width,i.height),i.renderCount=0,i._subView=!(i._viewBox.width()===i.width&&i._viewBox.height()===i.height),i._background=null!==(r=t.background)&&void 0!==r?r:wv,i.appendChild(new xc(Ye(i),i.global,i.window,{main:!0})),i.nextFrameRenderLayerSet=new Set,i.willNextFrameRender=!1,i.stage=Ye(i),i.renderStyle=t.renderStyle,i.global.supportEvent&&(i.eventSystem=new Ns({targetElement:i.window,resolution:i.window.dpr||i.global.devicePixelRatio,rootNode:Ye(i),global:i.global,viewport:{viewBox:i._viewBox,get x(){return this.viewBox.x1},get y(){return this.viewBox.y1},get width(){return this.viewBox.width()},get height(){return this.viewBox.height()}}})),t.autoRender&&i.enableAutoRender(),!1===t.disableDirtyBounds&&i.enableDirtyBounds(),t.enableView3dTranform&&i.enableView3dTranform(),i.hooks.beforeRender.tap("constructor",i.beforeRender),i.hooks.afterRender.tap("constructor",i.afterRender),i._beforeRender=t.beforeRender,i._afterRender=t.afterRender,i.ticker=t.ticker||e_,i}return Se(n,[{key:"viewBox",get:function(){return this._viewBox},set:function(t){this._viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}},{key:"x",get:function(){return this._viewBox.x1},set:function(t){this._viewBox.translate(t-this._viewBox.x1,0)}},{key:"y",get:function(){return this._viewBox.y1},set:function(t){this._viewBox.translate(0,t-this._viewBox.y1)}},{key:"width",get:function(){return this.window.width},set:function(t){this.resize(t,this.height)}},{key:"viewWidth",get:function(){return this._viewBox.width()},set:function(t){this.resizeView(t,this.viewHeight)}},{key:"viewHeight",get:function(){return this._viewBox.height()},set:function(t){this.resizeView(this.viewWidth,t)}},{key:"height",get:function(){return this.window.height},set:function(t){this.resize(this.width,t)}},{key:"dpr",get:function(){return this.window.dpr},set:function(t){this.setDpr(t)}},{key:"background",get:function(){var t;return null!==(t=this._background)&&void 0!==t?t:wv},set:function(t){this._background=t}},{key:"defaultLayer",get:function(){return this.at(0)}},{key:"set3dOptions",value:function(t){this.option3d=t;var e=t.center,n=void 0===e?{x:this.width/2,y:this.height/2}:e,i=t.light,r=void 0===i?{}:i,o=t.alpha,a=void 0===o?0:o,s=t.beta,l=void 0===s?0:s,u=t.camera,h=t.fieldRatio,c=void 0===h?1:h,d=t.fieldDepth,f=r.dir,p=void 0===f?[1,1,-1]:f,v=r.color,g=void 0===v?"white":v,y=r.ambient,m=[n.x,n.y,0],b=0,w=0,x=0;u||(b=Math.sin(a)+n.x,w=Math.sin(l)+n.y,x=Math.cos(a)*Math.cos(l)*1),this.light=new mv(p,g,y);var C={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:c,fieldDepth:d,viewParams:{pos:[b,w,x],center:m,up:[0,1,0]}};this.camera?this.camera.params=C:this.camera=new wd(C)}},{key:"setBeforeRender",value:function(t){this._beforeRender=t}},{key:"setAfterRender",value:function(t){this._afterRender=t}},{key:"afterNextRender",value:function(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}},{key:"enableView3dTranform",value:function(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new pv))}},{key:"disableView3dTranform",value:function(){var t=this;this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableAutoRender",value:function(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new fv))}},{key:"disableAutoRender",value:function(){var t=this;this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableIncrementalAutoRender",value:function(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new vv))}},{key:"disableIncrementalAutoRender",value:function(){var t=this;this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"enableDirtyBounds",value:function(){if(!this.dirtyBounds){this.dirtyBounds=new Je;var t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t||(t=new yv,this.pluginService.register(t)),t.activate(this.pluginService)}}},{key:"disableDirtyBounds",value:function(){var t=this;this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((function(e){e.deactivate(t.pluginService)})))}},{key:"tryUpdateAABBBounds",value:function(){var t=this._viewBox;return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}},{key:"combineLayer",value:function(t,e){throw new Error("暂不支持")}},{key:"createLayer",value:function(t){var e=new xc(this,this.global,this.window,{main:!1,canvasId:t});return this.appendChild(e),e}},{key:"sortLayer",value:function(t){throw new Error("暂不支持")}},{key:"removeLayer",value:function(t){return this.removeChild(this.findChildByUid(t))}},{key:"clearViewBox",value:function(t){this.window.clearViewBox(this._viewBox,t)}},{key:"render",value:function(t,e){var n=this;this.ticker.start(),this.lastRenderparams=e,this.hooks.beforeRender.call(this),(t||this).forEach((function(t,i){t.render({renderService:n.renderService,background:t===n.defaultLayer?n.background:void 0,updateBounds:!!n.dirtyBounds},Object.assign({renderStyle:n.renderStyle},e))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this)}},{key:"combineLayersToWindow",value:function(){var t=this;this.forEach((function(e,n){e.combineTo(t.window,{clear:0===n,x:t.x,y:t.y,width:t.viewWidth,height:t.viewHeight,renderService:t.renderService,background:e===t.defaultLayer?t.background:void 0,updateBounds:!!t.dirtyBounds})}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((function(t){e.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this;this.nextFrameRenderLayerSet.size&&(this.ticker.start(),this.hooks.beforeRender.call(this),this.forEach((function(e){t.nextFrameRenderLayerSet.has(e)&&e.render({renderService:t.renderService,background:e===t.defaultLayer?t.background:void 0,updateBounds:!!t.dirtyBounds},Object.assign({renderStyle:t.renderStyle},t.lastRenderparams||{}))})),this.combineLayersToWindow(),this.hooks.afterRender.call(this),this.nextFrameRenderLayerSet.clear())}},{key:"resizeWindow",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),n&&this.render()}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),this.forEachChildren((function(n){n.resize(t,e)})),this._subView||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render()}},{key:"resizeView",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((function(n){n.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render()}},{key:"setViewBox",value:function(t,e,n,i,r){var o=this,a=!0;"object"==Ht(t)?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(a=!1)):(this.viewBox.setValue(t,e,t+n,e+i),!1===r&&(a=!1)),this.forEachChildren((function(t){t.resizeView(o.viewBox.width(),o.viewBox.height())})),a&&this.render()}},{key:"setDpr",value:function(t){this.forEachChildren((function(e){e.setDpr(t)}))}},{key:"setOrigin",value:function(t,e){throw new Error("暂不支持")}},{key:"export",value:function(t){throw new Error("暂不支持")}},{key:"pick",value:function(t,e){var n=this.pickerService.pick(this.children,new Ge(t,e),{bounds:this.AABBBounds});return!(!(null==n?void 0:n.graphic)&&!(null==n?void 0:n.group))&&n}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"release",value:function(){Ho($e(n.prototype),"release",this).call(this),this.eventSystem.release(),this.pluginService.release(),this.forEach((function(t){t.release()})),this.window.release()}},{key:"setStage",value:function(t){}},{key:"dirty",value:function(t,e){e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t)}},{key:"renderTo",value:function(t,e){var n=this;this.forEachChildren((function(i,r){i.drawTo(t,Object.assign(Object.assign({},e),{renderService:n.renderService,background:i===n.defaultLayer?n.background:void 0,clear:0===r,updateBounds:!!n.dirtyBounds}))}))}},{key:"renderToNewWindow",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=RC.get(gc);return t?e.create({width:this.viewWidth,height:this.viewHeight,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}):e.create({width:Math.min(this.viewWidth,this.window.width-this.x),height:Math.min(this.viewHeight,this.window.height-this.y),dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e,{x:0,y:0,width:e.width,height:e.height}),e}},{key:"toCanvas",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.renderToNewWindow(t).getNativeHandler();return e.nativeCanvas?e.nativeCanvas:null}},{key:"setCursor",value:function(t){this.eventSystem.setCursor(t)}}]),n}(oc),Cv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_v=function(){function t(){Ae(this,t)}return Se(t,[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}}]),t}();_v=Cv([po()],_v);var kv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Sv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Av=function(){function t(){Ae(this,t),this._uid=Ua.GenAutoIncrementId()}return Se(t,[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}}]),t}();Av=kv([po(),Sv("design:paramtypes",[])],Av);var Bv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Rv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tv=function(t,e){return function(n,i){e(n,i,t)}},Mv=Symbol.for("LayerService"),Pv=function(){function t(e){Ae(this,t),this.global=e,this.layerMap=new Map}return Se(t,[{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"createLayer",value:function(t){var e=new xc(t,this.global,t.window,{main:!1}),n=this.layerMap.get(t)||[];return n.push(e),this.layerMap.set(t,n),e}},{key:"releaseLayer",value:function(t,e){e.release();var n=this.layerMap.get(t)||[];this.layerMap.set(t,n.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}}]),t}();function Ov(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Pv=Bv([po(),Tv(0,yo(ko)),Rv("design:paramtypes",[Object])],Pv);var Ev=["heightLimit","lineClamp"],Hv=function(t){Ke(n,t);var e=Ov(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return Wt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,n=Ml(this).text,i=this.attribute,r=i.fontFamily,o=void 0===r?n.fontFamily:r,a=i.textAlign,s=void 0===a?n.textAlign:a,l=i.textBaseline,u=void 0===l?n.textBaseline:l,h=i.fontSize,c=void 0===h?n.fontSize:h,d=i.lineHeight,f=void 0===d?this.attribute.lineHeight||this.attribute.fontSize||n.fontSize:d,p=i.ellipsis,v=void 0===p?n.ellipsis:p,g=i.maxLineWidth,y=i.stroke,m=void 0===y?n.stroke:y,b=i.lineWidth,w=void 0===b?n.lineWidth:b,x=i.heightLimit,C=void 0===x?0:x,_=i.lineClamp;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){var k=this.cache.layoutData.bbox;return this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}var S=MC.textMeasure,A=new Kl(o,{fontSize:c},S),B=t.map((function(t){return t.toString()})),R=[],T=[0,0],M=1/0;if(C>0&&(M=Math.max(Math.floor(C/f),1)),_&&(M=Math.min(M,_)),"number"==typeof g&&g!==1/0){if(g>0)for(var P=0;P<B.length;P++){var O=B[P];if(P===M-1){var E=A.textMeasure.clipTextWithSuffix(O,A.textOptions,g,v);R.push({str:E.str,width:E.width});break}var H=A.textMeasure.clipText(O,A.textOptions,g);if(R.push({str:H.str,width:H.width}),H.str.length===O.length);else{var L=O.substring(H.str.length);B.splice(P+1,0,L)}}var I=0;R.forEach((function(t){I=Math.max(I,t.width)})),T[0]=I}else{for(var D,j,W=0,F=0,z=B.length;F<z;F++){if(F===M-1){var N=A.textMeasure.clipTextWithSuffix(B[F],A.textOptions,g,v);R.push({str:N.str,width:N.width}),W=Math.max(W,N.width);break}j=B[F],D=A.textMeasure.measureTextWidth(j,A.textOptions),W=Math.max(W,D),R.push({str:j,width:D})}T[0]=W}T[1]=R.length*(f+2);var G={xOffset:0,yOffset:0,width:T[0],height:T[1]};A.LayoutBBox(G,s,u);var U=A.layoutWithBBox(G,R,s,u,f);return this.cache.layoutData=U,this.clearUpdateShapeTag(),this._AABBBounds.set(G.xOffset,G.yOffset,G.xOffset+G.width,G.yOffset+G.height),m&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<Ev.length;e++){var i=Ev[e];if(-1!==t.indexOf(i))return!0}return Ho($e(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<Ev.length;e++)if(t===Ev[e])return!0;return Ho($e(n.prototype),"needUpdateTag",this).call(this,t)}}]),n}(ql);function Lv(t){return new tc(t)}function Iv(t){return new Vl(t)}function Dv(t){return new oc(t)}function jv(t){return new ch(t)}function Wv(t){return new Kh(t)}function Fv(t){return new vh(t)}function zv(t){return new ql(t)}function Nv(t){return new sh(t)}function Gv(t){return new Hh(t)}function Uv(t){return new uc(t)}function Vv(t){return new Nh(t)}var Kv={arc:Lv,area:function(t){return new qh(t)},circle:Iv,group:Dv,image:Gv,line:jv,path:Wv,rect:Fv,rect3d:function(t){return new bh(t)},symbol:Nv,text:zv,richtext:Vv,polygon:Uv,shadowRoot:function(t){return new dc(t)},wrapText:function(t){return new Hv(t)}},Yv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Xv=function(){function t(){Ae(this,t)}return Se(t,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,o=t.shadowBlur,a=void 0===o?e.shadowBlur:o;if(r){var s=e.outerBorder,l=r.distance,u=void 0===l?s.distance:l,h=r.lineWidth,c=void 0===h?s.lineWidth:h;n.expand(u+a+c/2)}return n}}]),t}();function $v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Xv=Yv([po()],Xv);var qv=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zv=Symbol.for("RectBoundsContribution"),Jv=function(t){Ke(n,t);var e=$v(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Xv);Jv=qv([po()],Jv);function Qv(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+i+(n?function(t,e){return t?e:0}(n,e):0)),t}function tg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var eg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ng=Symbol.for("SymbolBoundsContribution"),ig=function(t){Ke(n,t);var e=tg(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,o=t.shadowBlur,a=void 0===o?e.shadowBlur:o,s=t.strokeBoundsBuffer,l=void 0===s?e.strokeBoundsBuffer:s;if(r){var u=e.outerBorder,h=r.distance,c=void 0===h?u.distance:h,d=r.lineWidth;Qv(n,c+a+(void 0===d?u.lineWidth:d)/2,!0,l)}return n}}]),n}(Xv);function rg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}ig=eg([po()],ig);var og=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ag=Symbol.for("CircleBoundsContribution"),sg=function(t){Ke(n,t);var e=rg(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Xv);function lg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}sg=og([po()],sg);var ug=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hg=Symbol.for("ArcBoundsContribution"),cg=function(t){Ke(n,t);var e=lg(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Xv);function dg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}cg=ug([po()],cg);var fg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pg=Symbol.for("PathBoundsContribution"),vg=function(t){Ke(n,t);var e=dg(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Xv);vg=fg([po()],vg);var gg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},yg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mg=function(t,e){return function(n,i){e(n,i,t)}};function bg(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],d=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*r+u*i,t[5]=a*r+h*i,t[6]=s*r+c*i,t[7]=l*r+d*i,t[8]=u*r-o*i,t[9]=h*r-a*i,t[10]=c*r-s*i,t[11]=d*r-l*i,t}function wg(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],h=e[9],c=e[10],d=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*r-u*i,t[1]=a*r-h*i,t[2]=s*r-c*i,t[3]=l*r-d*i,t[8]=o*i+u*r,t[9]=a*i+h*r,t[10]=s*i+c*r,t[11]=l*i+d*r,t}function xg(t,e,n){var i,r,o,a,s,l,u,h,c,d,f,p,v=n[0],g=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*g+e[8]*y+e[12],t[13]=e[1]*v+e[5]*g+e[9]*y+e[13],t[14]=e[2]*v+e[6]*g+e[10]*y+e[14],t[15]=e[3]*v+e[7]*g+e[11]*y+e[15]):(i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=h,t[8]=c,t[9]=d,t[10]=f,t[11]=p,t[12]=i*v+s*g+c*y+e[12],t[13]=r*v+l*g+d*y+e[13],t[14]=o*v+u*g+f*y+e[14],t[15]=a*v+h*g+p*y+e[15]),t}function Cg(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function _g(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],f=e[10],p=e[11],v=e[12],g=e[13],y=e[14],m=e[15],b=n[0],w=n[1],x=n[2],C=n[3];return t[0]=b*i+w*s+x*c+C*v,t[1]=b*r+w*l+x*d+C*g,t[2]=b*o+w*u+x*f+C*y,t[3]=b*a+w*h+x*p+C*m,b=n[4],w=n[5],x=n[6],C=n[7],t[4]=b*i+w*s+x*c+C*v,t[5]=b*r+w*l+x*d+C*g,t[6]=b*o+w*u+x*f+C*y,t[7]=b*a+w*h+x*p+C*m,b=n[8],w=n[9],x=n[10],C=n[11],t[8]=b*i+w*s+x*c+C*v,t[9]=b*r+w*l+x*d+C*g,t[10]=b*o+w*u+x*f+C*y,t[11]=b*a+w*h+x*p+C*m,b=n[12],w=n[13],x=n[14],C=n[15],t[12]=b*i+w*s+x*c+C*v,t[13]=b*r+w*l+x*d+C*g,t[14]=b*o+w*u+x*f+C*y,t[15]=b*a+w*h+x*p+C*m,t}function kg(t,e,n){var i,r=e.attribute,o=r.x,a=void 0===o?n.x:o,s=r.y,l=void 0===s?n.y:s,u=r.z,h=void 0===u?n.z:u,c=r.dx,d=void 0===c?n.dx:c,f=r.dy,p=void 0===f?n.dy:f,v=r.dz,g=void 0===v?n.dz:v,y=r.scaleX,m=void 0===y?n.scaleX:y,b=r.scaleY,w=void 0===b?n.scaleY:b,x=r.scaleZ,C=void 0===x?n.scaleZ:x,_=r.alpha,k=void 0===_?n.alpha:_,S=r.beta,A=void 0===S?n.beta:S,B=r.angle,R=void 0===B?n.angle:B,T=r.anchor3d,M=void 0===T?e.attribute.anchor:T,P=r.anchor,O=[0,0,0];if(M){if("string"==typeof M[0]){var E=parseFloat(M[0])/100,H=e.AABBBounds;O[0]=H.x1+(H.x2-H.x1)*E}else O[0]=M[0];if("string"==typeof M[1]){var L=parseFloat(M[1])/100,I=e.AABBBounds;O[1]=I.x1+(I.x2-I.x1)*L}else O[1]=M[1];O[2]=null!==(i=M[2])&&void 0!==i?i:0}if(function(t){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),xg(t,t,[a+d,l+p,h+g]),xg(t,t,[O[0],O[1],O[2]]),bg(t,t,A),wg(t,t,k),xg(t,t,[-O[0],-O[1],O[2]]),function(t,e,n){var i=n[0],r=n[1],o=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,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,t,[m,w,C]),R){var D=HC.allocate(),j=[0,0];if(P){if("string"==typeof M[0]){var W=parseFloat(M[0])/100,F=e.AABBBounds;j[0]=F.x1+(F.x2-F.x1)*W}else j[0]=M[0];if("string"==typeof M[1]){var z=parseFloat(M[1])/100,N=e.AABBBounds;j[1]=N.x1+(N.x2-N.x1)*z}else j[1]=M[1]}xg(D,D,[j[0],j[1],0]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],h=e[5],c=e[6],d=e[7];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*r+u*i,t[1]=a*r+h*i,t[2]=s*r+c*i,t[3]=l*r+d*i,t[4]=u*r-o*i,t[5]=h*r-a*i,t[6]=c*r-s*i,t[7]=d*r-l*i}(D,D,R),xg(D,D,[-j[0],-j[1],0]),_g(t,t,D)}}var Sg=Symbol.for("GraphicService"),Ag=function(){function t(e,n,i,r,o){Ae(this,t),this.rectBoundsContribitions=e,this.symbolBoundsContribitions=n,this.circleBoundsContribitions=i,this.arcBoundsContribitions=r,this.pathBoundsContribitions=o,this.creator=Kv,this.hooks={onAttributeUpdate:new Bo(["graphic"]),onSetStage:new Bo(["graphic","stage"]),onRemove:new Bo(["graphic"]),onAddIncremental:new Bo(["graphic","group","stage"]),onClearIncremental:new Bo(["graphic","group","stage"]),beforeUpdateAABBBounds:new Bo(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Bo(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Qe,this.tempAABBBounds2=new Qe}return Se(t,[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onAddIncremental",value:function(t,e,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}},{key:"afterUpdateAABBBounds",value:function(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;var i=new Eo(t);return _a(n.commandList,i,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a;n.set(0,0,o,s)}var l=this.tempAABBBounds1,u=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),u.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,l,i),n.union(l),l.setValue(u.x1,u.y1,u.x2,u.y2)})),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updateGroupAABBBounds",value:function(t,e,n,i){var r=t.width,o=t.height,a=t.path,s=t.clip,l=void 0===s?e.clip:s;a&&a.length?a.forEach((function(t){n.union(t.AABBBounds)})):null!=r&&null!=o&&n.set(0,0,r,o);var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),l||(i.forEachChildren((function(t){n.union(t.AABBBounds)})),this.combindShadowAABBBounds(n,i)),this.transformAABBBounds(t,n,e,i),n}},{key:"updateGlyphAABBBounds",value:function(t,e,n,i){return i.getSubGraphic().forEach((function(t){n.union(t.AABBBounds)})),n}},{key:"updateRichTextAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a,l=t.maxWidth,u=void 0===l?e.maxWidth:l,h=t.maxHeight,c=void 0===h?e.maxHeight:h,d=t.textAlign,f=void 0===d?e.textAlign:d,p=t.textBaseline,v=void 0===p?e.textBaseline:p;if(o>0&&s>0)n.set(0,0,o,s);else{var g=i.getFrameCache().getActualSize(),y=g.width,m=g.height,b=o||y||0,w=s||m||0;w="number"==typeof c&&w>c?c:w||0,b="number"==typeof u&&b>u?u:b||0,n.set(0,0,b,w)}var x=0;switch(v){case"top":x=0;break;case"middle":x=-n.height()/2;break;case"bottom":x=-n.height()}var C=0;switch(f){case"left":C=0;break;case"center":C=-n.width()/2;break;case"right":C=-n.width()}n.translate(C,x);var _=this.tempAABBBounds1,k=this.tempAABBBounds2;return _.setValue(n.x1,n.y1,n.x2,n.y2),k.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updateTextAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.attribute.text,o=void 0===r?e.text:r;Array.isArray(o)?i.updateMultilineAABBBounds(o):i.updateSingallineAABBBounds(o);var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),Ze(n,n,i.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(a){a.updateBounds(t,e,r,i),n.union(r),r.setValue(o.x1,o.y1,o.x2,o.y2)})),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,n,i){if(!i)return n;var r=i.getParsedPathShape();return n.union(r.getBounds()),n}},{key:"updatePyramid3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((function(t){var e=t[0],i=t[1];n.add(e,i)}));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updateArc3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;var o=t.outerRadius,a=void 0===o?e.outerRadius:o,s=t.height,l=a+(void 0===s?0:s);n.setValue(-l,-l,l,l);var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePolygonAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,n,i){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){n.add(t.x,t.y)})),n}},{key:"updateLineAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,o=void 0===r?e.points:r,a=n;return o.forEach((function(t){a.add(t.x,t.y)})),a}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,o=void 0===r?e.segments:r,a=n;return o.forEach((function(t){t.points.forEach((function(t){a.add(t.x,t.y)}))})),a}},{key:"updateAreaAABBBounds",value:function(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,o=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,o=void 0===r?e.points:r,a=n;return o.forEach((function(t){var e,n;a.add(t.x,t.y),a.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),a}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,o=void 0===r?e.segments:r,a=n;return o.forEach((function(t){t.points.forEach((function(t){var e,n;a.add(t.x,t.y),a.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),a}},{key:"updateCircleAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.combindShadowAABBBounds(n,r),this.transformAABBBounds(t,n,e,r),n}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,n,i){var r=t.radius,o=void 0===r?e.radius:r;return n.set(-o,-o,o,o),n}},{key:"updateCircleAABBBoundsAccurate",value:function(t,e,n,i){var r=t.startAngle,o=void 0===r?e.startAngle:r,a=t.endAngle,s=void 0===a?e.endAngle:a,l=t.radius,u=void 0===l?e.radius:l;return s-o>Pe-Be?n.set(-u,-u,u,u):qa(o,s,u,n),n}},{key:"updateArcAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.combindShadowAABBBounds(n,r),this.transformAABBBounds(t,n,e,r),n}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,n,i){var r=t.outerRadius,o=void 0===r?e.outerRadius:r;return n.set(-o,-o,o,o),n}},{key:"updateArcAABBBoundsAccurate",value:function(t,e,n,i){var r=t.outerRadius,o=void 0===r?e.outerRadius:r,a=t.innerRadius,s=void 0===a?e.innerRadius:a,l=t.endAngle,u=void 0===l?e.endAngle:l,h=t.startAngle,c=void 0===h?e.startAngle:h;return o<=Be?n.set(0,0,0,0):Math.abs(u-c)>Pe-Be?n.set(-o,-o,o,o):(qa(c,u,o,n),qa(c,u,s,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));var o=this.tempAABBBounds1,a=this.tempAABBBounds2;return o.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(i){i.updateBounds(t,e,o,r),n.union(o),o.setValue(a.x1,a.y1,a.x2,a.y2)})),this.transformAABBBounds(t,n,e,r),n}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,e,n,i){var r=t.size,o=void 0===r?e.size:r;if(Wt(o))n.set(-o[0]/2,-o[1]/2,o[0]/2,o[1]/2);else{var a=o/2;n.set(-a,-a,a,a)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,n,i){if(!i)return n;var r=t.size,o=void 0===r?e.size:r;return i.getParsedPath().bounds(o,n),n}},{key:"updateImageAABBBounds",value:function(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,o=void 0===r?e.width:r,a=t.height,s=void 0===a?e.height:a;n.set(0,0,o,s)}var l=this.tempAABBBounds1,u=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),u.setValue(n.x1,n.y1,n.x2,n.y2),this.combindShadowAABBBounds(n,i),this.transformAABBBounds(t,n,e,i),n}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var n=e.shadowRoot.AABBBounds;t.union(n)}}},{key:"transformAABBBounds",value:function(t,e,n,i){var r=t.scaleX,o=void 0===r?n.scaleX:r,a=t.scaleY,s=void 0===a?n.scaleY:a,l=t.stroke,u=void 0===l?null==n.stroke?!!t.strokeColor:n.stroke:l,h=t.shadowBlur,c=void 0===h?n.shadowBlur:h,d=t.lineWidth,f=void 0===d?n.lineWidth:d,p=t.lineJoin,v=void 0===p?n.lineJoin:p,g=t.strokeBoundsBuffer,y=void 0===g?n.strokeBoundsBuffer:g,m=this.tempAABBBounds1,b=this.tempAABBBounds2;u&&(Qv(m,f/Math.abs(o+s),"miter"===v,y),e.union(m),m.setValue(b.x1,b.y1,b.x2,b.y2));c&&(Qv(m,c/Math.abs(o+s),"miter"===v,y),e.union(m));this.combindShadowAABBBounds(e,i),Ze(e,e,i.transMatrix)}}]),t}();Ag=gg([po(),mg(0,yo(Fa)),mg(0,vo(Zv)),mg(1,yo(Fa)),mg(1,vo(ng)),mg(2,yo(Fa)),mg(2,vo(ag)),mg(3,yo(Fa)),mg(3,vo(hg)),mg(4,yo(Fa)),mg(4,vo(pg)),yg("design:paramtypes",[Object,Object,Object,Object,Object])],Ag);var Bg=zv({text:""});function Rg(t){return Bg.setAttributes(t),Bg.AABBBounds}var Tg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Mg=function(){function t(){Ae(this,t)}return Se(t,[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var n=e.fontSize,i=void 0===n?sl.fontSize:n,r=0,o=0,a=0;a<t.length;a++)t.charCodeAt(a)<128?r++:o++;return{width:~~(.8*r*i+o*i),height:i}}},{key:"measureTextPixelHeight",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Ys.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Ys.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipText",value:function(t,e,n){if(0===t.length)return{str:"",width:0};var i=this.measureTextWidth(t,e);return i<=n?{str:t,width:i}:(i=this.measureTextWidth(t[0],e))>n?{str:"",width:0}:this._clipText(t,e,n,0,t.length-1)}},{key:"_clipText",value:function(t,e,n,i,r){var o,a=Math.floor((i+r)/2),s=t.substring(0,a+1),l=this.measureTextWidth(s,e);if(l>n){if(s.length<=1)return{str:"",width:0};var u=t.substring(0,a);return(o=this.measureTextWidth(u,e))<=n?{str:u,width:o}:this._clipText(t,e,n,i,a)}if(l<n){if(a>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(0,a+2);return(o=this.measureTextWidth(h,e))>=n?{str:s,width:l}:this._clipText(t,e,n,a,r)}return{str:s,width:l}}},{key:"clipTextWithSuffix",value:function(t,e,n,i){if(""===i)return this.clipText(t,e,n);if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};var o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;var a=this._clipText(t,e,n,0,t.length-1);return a.str+=i,a.width+=o,a}}]),t}();function Pg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Mg=Tg([po()],Mg);var Og=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Eg=Symbol.for("TextMeasureContribution"),Hg=function(t){Ke(n,t);var e=Pg(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(Mg);Hg=Og([po()],Hg);var Lg,Ig=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Dg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jg=function(t,e){return function(n,i){e(n,i,t)}},Wg=Symbol.for("GraphicUtil"),Fg=function(){function t(e,n){var i=this;Ae(this,t),this.contributions=e,this.global=n,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}return Se(t,[{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var n=this;if(!this.configured){var i=Od({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=i,this.context=i.getContext("2d"),this.contributions.getContributions().forEach((function(t){t.configure(n,e)})),this.configured=!0}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=i;var o={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Ys.fontSize};return this.global.measureTextMethod=r,o}},{key:"createTextMeasureInstance",value:function(t,e,n){var i=this;return this.configure(this.global,this.global.env),new Ln(Object.assign({defaultFontParams:{fontFamily:Ys.fontFamily,fontSize:Ys.fontSize},getCanvasForMeasure:n||function(){return i.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Ln.ALPHABET_CHAR_SET+Ln.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}}]),t}();Fg=Ig([po(),jg(0,yo(Fa)),jg(0,vo(Eg)),jg(1,yo(ko)),Dg("design:paramtypes",[Object,Object])],Fg),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Lg||(Lg={}));var zg=Symbol.for("TransformUtil"),Ng=new an,Gg=function(){function t(){Ae(this,t),this.matrix=new an}return Se(t,[{key:"init",value:function(t){return this.mode=Lg.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=Lg.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,n){var i=this.outSourceMatrix;if(Ng.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){var r=n.x,o=n.y;this.outTargetMatrix.translate(r,o),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-o)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Ng.a,Ng.b,Ng.c,Ng.d,Ng.e,Ng.f),this}},{key:"scale",value:function(t,e,n){return this.mode===Lg.matrix?this.scaleMatrix(t,e,n):this}},{key:"translateMatrix",value:function(t,e){var n=this.outSourceMatrix;return Ng.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Ng.a,Ng.b,Ng.c,Ng.d,Ng.e,Ng.f),this}},{key:"translate",value:function(t,e){return this.mode===Lg.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===Lg.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();Gg=Ig([po(),Dg("design:paramtypes",[])],Gg);var Ug=new lo((function(t){t(_s).toSelf().inSingletonScope(),t(ko).toService(_s),t(mc).to(mc),t(gc).toService(mc),t(Fg).toSelf().inSingletonScope(),t(Wg).toService(Fg),t(Gg).toSelf().inSingletonScope(),t(zg).toService(Gg),t(Pv).toSelf().inSingletonScope(),t(Mv).toService(Pv)})),Vg=new lo((function(t){t(tv).toSelf(),t(Qp).toService(tv)})),Kg=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xg=function(t,e){return function(n,i){e(n,i,t)}},$g=(Symbol.for("BoundsPicker"),Symbol.for("GlobalPickerService")),qg=function(){function t(e){var n=this;Ae(this,t),this.global=e,this.global.hooks.onSetEnv.tap("global-picker-service",(function(t,e,i){n.configure(i,e)})),this.configure(this.global,this.global.env)}return Se(t,[{key:"configure",value:function(t,e){}},{key:"pick",value:function(t,e,n){for(var i,r={graphic:null,group:null},o=new an(1,0,0,1,0,0),a=0;a<t.length&&(t[a].isContainer?r=this.pickGroup(t[a],e,o,n):r.graphic=this.pickItem(t[a],e,n),!r.graphic);a++)i||(i=r.group);return r.graphic||(r.group=i),r}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,o={group:null,graphic:null};if(!1===t.attribute.visibleAll)return o;var a=t.transMatrix,s=new Ge(e.x,e.y);n.transformPoint(s,s);var l=t.AABBBounds.containsPoint(s);if(!l)return o;var u=!1!==t.attribute.pickable&&l;return n.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((function(t){if(t.isContainer)o=r.pickGroup(t,e,n,i);else{var a=new Ge(e.x,e.y);n.transformPoint(a,a),o.graphic=r.pickItem(t,a,i)}return!!o.graphic||!!o.group})),o.graphic||o.group||!u||(o.group=t),o}},{key:"pickItem",value:function(t,e,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}}]),t}();qg=Kg([po(),Xg(0,yo(ko)),Yg("design:paramtypes",[Object])],qg);var Zg=Symbol.for("CanvasArcPicker"),Jg=Symbol.for("CanvasArc3dPicker"),Qg=Symbol.for("CanvasAreaPicker"),ty=Symbol.for("CanvasCirclePicker"),ey=Symbol.for("CanvasImagePicker"),ny=Symbol.for("CanvasLinePicker"),iy=Symbol.for("CanvasPathPicker"),ry=Symbol.for("CanvasRectPicker"),oy=Symbol.for("CanvasRect3dPicker"),ay=Symbol.for("CanvasSymbolPicker"),sy=Symbol.for("CanvasTextPicker"),ly=Symbol.for("CanvasPolygonPicker"),uy=Symbol.for("CanvasPyramid3dPicker"),hy=Symbol.for("CanvasRichTextPicker"),cy=Symbol.for("CanvasGlyphPicker"),dy=Symbol.for("CanvasPickerContribution"),fy=Symbol.for("MathArcPicker"),py=Symbol.for("MathAreaPicker"),vy=Symbol.for("MathCirclePicker"),gy=(Symbol.for("MathImagePicker"),Symbol.for("MathLinePicker")),yy=Symbol.for("MathPathPicker"),my=Symbol.for("MathRectPicker"),by=Symbol.for("MathSymbolPicker"),wy=Symbol.for("MathTextPicker"),xy=Symbol.for("MathPolygonPicker"),Cy=Symbol.for("MathGlyphPicker"),_y=Symbol.for("MathPickerContribution");function ky(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Sy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ay=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},By=function(t,e){return function(n,i){e(n,i,t)}},Ry=function(t){Ke(n,t);var e=ky(n);function n(t,i,r,o,a,s,l,u,h,c,d,f,p,v,g){var y;return Ae(this,n),(y=e.call(this,v,g)).contributions=t,y.circlePicker=i,y.rectPicker=r,y.arcPicker=o,y.areaPicker=a,y.imagePicker=s,y.linePicker=l,y.pathPicker=u,y.symbolPicker=h,y.textPicker=c,y.polygonPicker=d,y.richtextPicker=f,y.drawContribution=p,y.global=v,y.pickItemInterceptorContributions=g,y.global.hooks.onSetEnv.tap("canvas-picker-service",(function(t,e,n){y.configure(n,e)})),y.configure(y.global,y.global.env),y.pickerMap=new Map,y}return Se(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),Ho($e(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){var n={width:100,height:100,nativeCanvas:t.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new Pd(n),this.pickContext=this.pickCanvas.getContext("2d")}},{key:"pickItem",value:function(t,e,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforePickItem&&r.beforePickItem(t,this,e,n))return t}var o=this.pickerMap.get(t.numberType);return o&&o.contains(t,e,n)?t:null}}]),n}(lv);function Ty(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Sy([xo(),Ay("design:type",Function),Ay("design:paramtypes",[]),Ay("design:returntype",void 0)],Ry.prototype,"init",null),Ry=Sy([po(),By(0,yo(Fa)),By(0,vo(dy)),By(1,yo(ty)),By(2,yo(ry)),By(3,yo(Zg)),By(4,yo(Qg)),By(5,yo(ey)),By(6,yo(ny)),By(7,yo(iy)),By(8,yo(ay)),By(9,yo(sy)),By(10,yo(ly)),By(11,yo(hy)),By(12,yo($p)),By(13,yo(ko)),By(14,yo(Fa)),By(14,vo(nv)),Ay("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],Ry);var My=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Py=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oy=function(t,e){return function(n,i){e(n,i,t)}},Ey=function(t){Ke(n,t);var e=Ty(n);function n(t,i,r){var o;return Ae(this,n),(o=e.call(this,i,r)).contributions=t,o.global=i,o.pickItemInterceptorContributions=r,o.global.hooks.onSetEnv.tap("math-picker-service",(function(t,e,n){o.configure(n,e)})),o.configure(o.global,o.global.env),o.pickerMap=new Map,o}return Se(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),Ho($e(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){this.pickContext=new ld(null,1)}},{key:"pickItem",value:function(t,e,n){if(!1===t.attribute.pickable)return null;var i=this.pickerMap.get(t.numberType);return i&&i.contains(t,e,n)?t:null}}]),n}(lv);My([xo(),Py("design:type",Function),Py("design:paramtypes",[]),Py("design:returntype",void 0)],Ey.prototype,"init",null),Ey=My([po(),Oy(0,yo(Fa)),Oy(0,vo(_y)),Oy(1,yo(ko)),Oy(2,yo(Fa)),Oy(2,vo(nv)),Py("design:paramtypes",[Object,Object,Object])],Ey);var Hy=new lo((function(t){t(Ry).toSelf().inSingletonScope(),t(Ey).toSelf().inSingletonScope(),t(sv).toService(Ry),t(qg).toSelf().inSingletonScope(),t($g).toService(qg),t(iv).toSelf().inSingletonScope(),t(nv).toService(iv),Na(t,nv)})),Ly=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Iy=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dy=function(t,e){return function(n,i){e(n,i,t)}},jy=Symbol.for("CanvasAllocate"),Wy=function(){function t(e){Ae(this,t),this.global=e,this.pools=[]}return Se(t,[{key:"allocate",value:function(t){if(!this.pools.length)return Od(Object.assign({nativeCanvas:this.global.createCanvas(t)},t));var e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr};return Od(Object.assign({nativeCanvas:this.global.createCanvas(e)},e))}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}();function Fy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Wy=Ly([po(),Dy(0,yo(ko)),Iy("design:paramtypes",[Object])],Wy);var zy=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ny=function(){function t(){Ae(this,t),this.pools=[]}return Se(t,[{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}();Ny=zy([po()],Ny);var Gy=Symbol.for("RectAllocate"),Uy=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new vh(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new vh(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);Uy=zy([po()],Uy);var Vy=Symbol.for("ArcAllocate"),Ky=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new tc(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new tc(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);Ky=zy([po()],Ky);var Yy=Symbol.for("AreaAllocate"),Xy=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new qh(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new qh(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);Xy=zy([po()],Xy);var $y=Symbol.for("CircleAllocate"),qy=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new Vl(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new Vl(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);qy=zy([po()],qy);var Zy=Symbol.for("LineAllocate"),Jy=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new ch(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new ch(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);Jy=zy([po()],Jy);var Qy=Symbol.for("PathAllocate"),tm=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new Kh(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new Kh(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);tm=zy([po()],tm);var em=Symbol.for("SymbolAllocate"),nm=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new sh(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new sh(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);nm=zy([po()],nm);var im=Symbol.for("TextAllocate"),rm=function(t){Ke(n,t);var e=Fy(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"allocate",value:function(t){if(!this.pools.length)return new ql(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new ql(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),n}(Ny);rm=zy([po()],rm);var om=new lo((function(t){t(gd).toSelf().inSingletonScope(),t(pd).toService(gd),t(yd).toSelf().inSingletonScope(),t(vd).toService(yd),t(Wy).toSelf().inSingletonScope(),t(jy).toService(Wy),t(Uy).toSelf().inSingletonScope(),t(Gy).toService(Uy),t(qy).toSelf().inSingletonScope(),t($y).toService(qy),t(Ky).toSelf().inSingletonScope(),t(Vy).toService(Ky),t(Xy).toSelf().inSingletonScope(),t(Yy).toService(Xy),t(Jy).toSelf().inSingletonScope(),t(Zy).toService(Jy),t(tm).toSelf().inSingletonScope(),t(Qy).toService(tm),t(nm).toSelf().inSingletonScope(),t(em).toService(nm),t(rm).toSelf().inSingletonScope(),t(im).toService(rm)})),am=new lo((function(t){t(Ag).toSelf().inSingletonScope(),t(Sg).toService(Ag),t(Jv).toSelf().inSingletonScope(),t(Zv).toService(Jv),Na(t,Zv),t(ig).toSelf().inSingletonScope(),t(ng).toService(ig),Na(t,ng),t(sg).toSelf().inSingletonScope(),t(ag).toService(sg),Na(t,ag),t(cg).toSelf().inSingletonScope(),t(hg).toService(cg),Na(t,hg),t(vg).toSelf().inSingletonScope(),t(pg).toService(vg),Na(t,pg)})),sm=new lo((function(t){t(dv).toSelf(),t(cv).toService(dv)}));function lm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var um=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function cm(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.createElement("img");if(n.crossOrigin="anonymous",e){var i=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(i)}return n.src=t,n.complete?Promise.resolve(n):new Promise((function(t,e){n.onload=function(){t(n)},n.onerror=function(){e(new Error("加载失败"))}}))}var dm=function(t){Ke(n,t);var e=lm(n);function n(){var t;Ae(this,n),(t=e.call(this)).type="browser",t.supportEvent=!0;try{t.supportsTouchEvents="ontouchstart"in globalThis,t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsTouchEvents=!1,t.supportsPointerEvents=!1,t.supportsPointerEvents=!1}return t.applyStyles=!0,t}return Se(n,[{key:"loadImage",value:function(t){return cm(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return cm(t,!0).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"createCanvas",value:function(t){var e,n,i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:Ua.GenAutoIncrementId().toString());var r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width="".concat(t.width,"px"),i.style.height="".concat(t.height,"px"),i.width=t.width*r,i.height=t.height*r),i}},{key:"createOffscreenCanvas",value:function(t){var e,n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}},{key:"releaseCanvas",value:function(t){var e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getRequestAnimationFrame",value:function(){return window.requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return window.cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return document.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return document.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return document.dispatchEvent(t)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"getDocument",value:function(){return document}},{key:"release",value:function(){}}]),n}(_v);function fm(){RC.rebind(sv).toService(Ey)}function pm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}dm=um([po(),hm("design:paramtypes",[])],dm);var vm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},gm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var ym=function(t){Ke(n,t);var e=pm(n);function n(){var t;Ae(this,n),(t=e.call(this)).type="feishu",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Se(n,[{key:"configure",value:function(t,e){var n,i,r,o,a,s;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,s=tt.getSystemInfoSync().pixelRatio,i.forEach((function(t,e){var i=tt.createCanvasContext(t);i.canvas={width:n.width*s,height:n.height*s};var l={width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,id:null!=t?t:"",getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};r.set(t,l),e>=o&&a.push(l)})),fm())}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){setTimeout(t,1e3/60,!0)}}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}}]),n}(_v);function mm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}ym=vm([po(),gm("design:paramtypes",[])],ym);var bm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},wm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var xm=function(t){Ke(n,t);var e=mm(n);function n(){var t;Ae(this,n),(t=e.call(this)).type="taro",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Se(n,[{key:"configure",value:function(t,e){var n,i,r,o,a,s,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,s=e.taro,l=e.pixelRatio,i.forEach((function(t,e){var i=s.createCanvasContext(t);i.canvas={width:n.width*l,height:n.height*l},i.createRadialGradient||(i.createRadialGradient=function(){return i.createCircularGradient.apply(i,arguments)}),!i.getImageData&&s.canvasGetImageData&&(i.getImageData=function(e,n,i,r){return new Promise((function(o,a){try{s.canvasGetImageData({canvasId:t,x:e,y:n,width:i,height:r,success:function(t){o(t)}})}catch(t){a(t)}}))});var u={id:t,width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};return r.set(t,u),e>=o&&a.push(u),u})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,RC.rebind(sv).toService(Ey))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){var e=window||globalThis;if(e.DOMParser){var n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(i));return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){var o=new e.Blob([t],{type:"image/svg+xml"}),a=e.URL.createObjectURL(o);return Promise.resolve({data:a,loadState:"success"})}return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return this.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}]),n}(_v);function Cm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}xm=bm([po(),wm("design:paramtypes",[])],xm);var _m=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},km=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var Sm=function(t){Ke(n,t);var e=Cm(n);function n(){var t;Ae(this,n),(t=e.call(this)).type="lynx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return Se(n,[{key:"configure",value:function(t,e){var n,i,r,o,a;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,o=e.freeCanvasIdx,a=this.freeCanvasList,SystemInfo.pixelRatio,i.forEach((function(t,e){var i=lynx.createCanvas(t).getContext("2d");i.draw=function(t,e){e()};var s={width:n.width,height:n.height,offsetWidth:n.width,offsetHeight:n.height,id:null!=t?t:"",getContext:function(){return i},getBoundingClientRect:function(){return{height:n.height,width:n.width}}};r.set(t,s),e>=o&&a.push(s)})),fm())}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return SystemInfo.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){setTimeout(t,1e3/60,!0)}}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}]),n}(_v);Sm=_m([po(),km("design:paramtypes",[])],Sm);var Am=new lo((function(t){t(dm).toSelf().inSingletonScope(),t(_o).toService(dm),t(ym).toSelf().inSingletonScope(),t(_o).toService(ym),t(xm).toSelf().inSingletonScope(),t(_o).toService(xm),t(Sm).toSelf().inSingletonScope(),t(_o).toService(Sm),Na(t,_o)}));function Bm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Rm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Tm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mm=function(t,e){return function(n,i){e(n,i,t)}},Pm=function(t){Ke(n,t);var e=Bm(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).global=t,i.type="browser",i}return Se(n,[{key:"container",get:function(){return this.canvas.nativeCanvas.parentElement}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return this.canvas.nativeCanvas.getBoundingClientRect()}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e,n=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw new Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(n);var i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:n,container:e,id:Ua.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Pd(i)}},{key:"createWindowByCanvas",value:function(t){var e,n;if("string"==typeof t.canvas){if(!(n=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");var i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){var o=n.getBoundingClientRect();i=o.width,r=o.height}var a=t.dpr;!1===t.canvasControled&&(a&&console.warn("canvasControled为false后,dpr参数将无效"),a=null),null==a&&(a=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new Pd({width:i,height:r,dpr:a,nativeCanvas:n,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this.canvas.nativeCanvas.dispatchEvent(t)}},{key:"getStyle",value:function(){return this.canvas.nativeCanvas.style}},{key:"setStyle",value:function(t){this.canvas.nativeCanvas.style=t}},{key:"getBoundingClientRect",value:function(){var t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Av);function Om(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Pm.env="browser",Pm=Rm([po(),Mm(0,yo(ko)),Tm("design:paramtypes",[Object])],Pm);var Em=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Hm=function(t){Ke(n,t);var e=Om(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}},{key:"getImageData",value:function(t,e,n,i){var r=this;return new Promise((function(o,a){var s;try{tt.canvasGetImageData({canvasId:null!==(s=r.canvas.nativeCanvas.id)&&void 0!==s?s:r.canvas.id,x:t,y:e,width:n,height:i,success:function(t){o(t)}})}catch(t){a(t)}}))}},{key:"draw",value:function(){var t=this,e=this.nativeContext;this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))}))}}]),n}(Sd);Hm.env="feishu",Hm=Em([po()],Hm);var Lm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Im=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dm=500,jm=500,Wm=1,Fm=function(){function t(e){Ae(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?Dm:i,o=e.height,a=void 0===o?jm:o,s=e.dpr,l=void 0===s?Wm:s,u=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},h=u.x,c=u.y;this._x=h,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new Hm(this,this._dpr),this._id=n.id}return Se(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function zm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Fm.env="feishu",Fm=Lm([po(),Im("design:paramtypes",[Object])],Fm);var Nm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Gm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Um=function(t,e){return function(n,i){e(n,i,t)}},Vm=function(){function t(){Ae(this,t),this.cache={}}return Se(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),Km=function(t){Ke(n,t);var e=zm(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).global=t,i.type="feishu",i.eventManager=new Vm,i}return Se(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:Ua.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Fm(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new Fm({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Av);function Ym(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Km.env="feishu",Km=Nm([po(),Um(0,yo(ko)),Gm("design:paramtypes",[Object])],Km);var Xm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},$m=function(t){Ke(n,t);var e=Ym(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}},{key:"draw",value:function(){this.nativeContext.draw()}},{key:"strokeText",value:function(t,e,n){}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.fillAttributes);var a=e.fillOpacity,s=void 0===a?r.fillOpacity:a,l=e.opacity,u=void 0===l?r.opacity:l,h=e.fillColor,c=void 0===h?r.fillColor:h;s>1e-12&&u>1e-12&&(o.setGlobalAlpha(s*u),o.setFillStyle(Wa(this,c,t)))}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var o=this.nativeContext;r||(r=this.strokeAttributes);var a=e.strokeOpacity,s=void 0===a?r.strokeOpacity:a,l=e.opacity,u=void 0===l?r.opacity:l;if(s>1e-12&&u>1e-12){var h=e.lineWidth,c=void 0===h?r.lineWidth:h,d=e.strokeColor,f=void 0===d?r.strokeColor:d,p=e.lineJoin,v=void 0===p?r.lineJoin:p,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,b=void 0===m?r.lineCap:m,w=e.miterLimit,x=void 0===w?r.miterLimit:w;o.setGlobalAlpha(s*u),o.setLineWidth(ja(this,c,this.dpr)),o.setStrokeStyle(Wa(this,f,t)),o.setLineJoin(v),o.setLineDash(y),o.setLineCap(b),o.setMiterLimit(x)}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){var n,i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Ro(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}},{key:"setTextStyle",value:function(t,e){var n,i,r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Ro(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}},{key:"createConicGradient",value:function(t,e,n,i){return null}}]),n}(Sd);$m.env="taro",$m=Xm([po()],$m);var qm=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jm=500,Qm=500,tb=1,eb=function(){function t(e){Ae(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?Jm:i,o=e.height,a=void 0===o?Qm:o,s=e.dpr,l=void 0===s?tb:s,u=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},h=u.x,c=u.y;this._x=h,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new $m(this,this._dpr),this._id=n.id}return Se(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function nb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}eb.env="taro",eb=qm([po(),Zm("design:paramtypes",[Object])],eb);var ib=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ob=function(t,e){return function(n,i){e(n,i,t)}},ab=function(){function t(){Ae(this,t),this.cache={}}return Se(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),sb=function(t){Ke(n,t);var e=nb(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).global=t,i.type="taro",i.eventManager=new ab,i}return Se(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:Ua.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new eb(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new eb({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach((function(e,n){t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach((function(e,n){t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Av);function lb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}sb.env="taro",sb=ib([po(),ob(0,yo(ko)),rb("design:paramtypes",[Object])],sb);var ub=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hb=function(t){Ke(n,t);var e=lb(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}},{key:"draw",value:function(){var t=this,e=this.nativeContext;this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))}))}}]),n}(Sd);hb.env="lynx",hb=ub([po()],hb);var cb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},db=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fb=500,pb=500,vb=1,gb=function(){function t(e){Ae(this,t);var n=e.nativeCanvas,i=e.width,r=void 0===i?fb:i,o=e.height,a=void 0===o?pb:o,s=e.dpr,l=void 0===s?vb:s,u=n.getBoundingClientRect?n.getBoundingClientRect():{x:0,y:0},h=u.x,c=u.y;this._x=h,this._y=c,this._pixelWidth=r*l,this._pixelHeight=a*l,this._visiable=!1!==e.visiable,this._displayWidth=r,this._displayHeight=a,this._dpr=l,this._nativeCanvas=n,this._context=new hb(this,this._dpr),this._id=n.id}return Se(t,[{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x}},{key:"y",get:function(){return this._y}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"displayWidth",get:function(){return this._displayWidth}},{key:"displayHeight",get:function(){return this._displayHeight}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"resetStyle",value:function(t){}},{key:"applyPosition",value:function(){}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){throw new Error("暂未实现")}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){}}]),t}();function yb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}gb.env="lynx",gb=cb([po(),db("design:paramtypes",[Object])],gb);var mb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wb=function(t,e){return function(n,i){e(n,i,t)}},xb=function(){function t(){Ae(this,t),this.cache={}}return Se(t,[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}]),t}(),Cb=function(t){Ke(n,t);var e=yb(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).global=t,i.type="lynx",i.eventManager=new xb,i}return Se(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:Ua.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new gb(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var o=t.dpr;null==o&&(o=e.width/n),this.canvas=new gb({width:n,height:i,dpr:o,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t,e){var n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}}]),n}(Av);Cb.env="lynx",Cb=mb([po(),wb(0,yo(ko)),bb("design:paramtypes",[Object])],Cb);var _b=new lo((function(t){t(Pm).toSelf(),t(yc).toDynamicValue((function(t){return t.container.get(Pm)})).whenTargetNamed(Pm.env),t(Km).toSelf(),t(yc).toDynamicValue((function(t){return t.container.get(Km)})).whenTargetNamed(Km.env),t(sb).toSelf(),t(yc).toDynamicValue((function(t){return t.container.get(sb)})).whenTargetNamed(sb.env),t(Cb).toSelf(),t(yc).toDynamicValue((function(t){return t.container.get(Cb)})).whenTargetNamed(Cb.env)})),kb=new lo((function(t){t(Hg).toSelf().inSingletonScope(),t(Eg).toService(Hg),Na(t,Eg)})),Sb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ab=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bb=function(t,e){return function(n,i){e(n,i,t)}},Rb=function(){function t(e){Ae(this,t),this.global=e,this.offscreen=!1}return Se(t,[{key:"init",value:function(t,e,n){if(this.layer=t,n.main)this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var i;i=n.canvasId?this.global.getElementById(n.canvasId):this.global.createCanvas({width:e.width,height:e.height});var r=e.getContext().getCanvas().nativeCanvas,o=Od({nativeCanvas:i,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});o.applyPosition(),this.canvas=o,this.context=o.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,n){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var n=t.getContext().canvas.nativeCanvas;e.context.drawImage(n,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}]),t}();Rb=Sb([po(),Bb(0,yo(ko)),Ab("design:paramtypes",[Object])],Rb);var Tb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Mb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pb=function(t,e){return function(n,i){e(n,i,t)}},Ob=function(){function t(e){Ae(this,t),this.global=e,this.offscreen=!0}return Se(t,[{key:"init",value:function(t,e,n){this.layer=t;var i=Od({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){this.canvas.resize(t,e)}},{key:"render",value:function(t,e){var n;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"}))}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){this.canvas.release()}},{key:"getContext",value:function(){return this.context}},{key:"drawTo",value:function(t,e,n){var i=t.getContext(),r=t.dpr,o=n.x,a=void 0===o?0:o,s=n.y,l=void 0===s?0:s,u=n.width,h=void 0===u?this.layer.viewWidth:u,c=n.height,d=void 0===c?this.layer.viewHeight:c;i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(a,l,h,d),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,a,l,h,d),i.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();Ob=Tb([po(),Pb(0,yo(ko)),Mb("design:paramtypes",[Object])],Ob);var Eb=new lo((function(t){t(Rb).toSelf(),t(Ob).toSelf(),t(wc).toService(Rb)}));var Hb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Lb=Symbol.for("DrawItemInterceptor"),Ib=new Qe,Db=function(){function t(){Ae(this,t),this.order=1}return Se(t,[{key:"afterDrawItem",value:function(t,e,n,i,r){if(!t.shadowRoot)return!1;var o=n.context;if(o.highPerformanceSave(),o.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){Ib.copy(i.dirtyBounds);var a=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(a)}return i.renderGroup(t.shadowRoot,n),o.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(Ib),!0}}]),t}();Db=Hb([po()],Db);var jb=function(){function t(){Ae(this,t),this.order=1}return Se(t,[{key:"beforeDrawItem",value:function(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var o=e.drawParams,a=o.context,s=o.stage;a.canvas,a.save(),this.initCanvasCtx(a),a.camera=s.camera;var l=a.currentMatrix;l.a/=a.dpr,l.b/=a.dpr,l.c/=a.dpr,l.d/=a.dpr,l.e/=a.dpr,l.f/=a.dpr;var u=HC.allocate();Cg(u,l);var h=a.modelMatrix;if(h){if(u){var c=HC.allocate();a.modelMatrix=_g(c,h,u)}}else a.modelMatrix=u;if(a.setTransform(1,0,0,1,0,0,!0),t.isContainer){var d=!1,f=!1;if(t.forEachChildren((function(t){return!(d=t.numberType===ec)})),t.forEachChildren((function(t){return!(f=!!t.findFace)})),d){var p=t.getChildren(),v=ie(p);v.sort((function(t,e){for(var n,i,r,o,a=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i:0))/2,s=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(o=e.attribute.endAngle)&&void 0!==o?o:0))/2;a<0;)a+=Pe;for(;s<0;)s+=Pe;return s-a})),v.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),v.forEach((function(e){t.appendChild(e)})),n.hack_pieFace="outside",i.renderGroup(t,n),n.hack_pieFace="inside",i.renderGroup(t,n),n.hack_pieFace="top",i.renderGroup(t,n),t.removeAllChild(),p.forEach((function(t){t._next=null,t._prev=null})),p.forEach((function(e){t.appendChild(e)}))}else if(f){var g=t.getChildren(),y=g.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return a.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));y.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),y.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),y.forEach((function(e){t.add(e.g)})),i.renderGroup(t,n),t.removeAllChild(),g.forEach((function(t){t._next=null,t._prev=null})),t.update(),g.forEach((function(e){t.add(e)}))}else i.renderGroup(t,n)}else i.renderItem(t,n);return a.camera=null,a.restore(),a.modelMatrix!==h&&HC.free(a.modelMatrix),a.modelMatrix=h,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();jb=Hb([po()],jb);var Wb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Fb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zb=function(t,e){return function(n,i){e(n,i,t)}},Nb=function(){function t(e,n,i,r){Ae(this,t),this.contributions=e,this.renderSelector=n,this.layerService=i,this.drawItemInterceptorContributions=r,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Je,this.backupDirtyBounds=new Je}return Se(t,[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var n=t.styleRenderMap.get(e.style)||new Map;n.set(e.numberType,e),t.styleRenderMap.set(e.style,n)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"draw",value:function(t,e){var n=this;e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var i=e.context,r=e.stage,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s,u=e.width,h=e.height;if(i){var c,d,f,p,v,g,y,m=this.dirtyBounds.setValue(0,0,u,h);if(r.dirtyBounds&&!r.dirtyBounds.empty()){var b=(c=m,d=r.dirtyBounds,f=!1,null===c?d:null===d?c:(wn=c.x1,xn=c.x2,Cn=c.y1,_n=c.y2,kn=d.x1,Sn=d.x2,An=d.y1,Bn=d.y2,f&&(wn>xn&&(wn=(p=[xn,wn])[0],xn=p[1]),Cn>_n&&(Cn=(v=[_n,Cn])[0],_n=v[1]),kn>Sn&&(kn=(g=[Sn,kn])[0],Sn=g[1]),An>Bn&&(An=(y=[Bn,An])[0],Bn=y[1])),wn>=Sn||xn<=kn||Cn>=Bn||_n<=An?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(wn,kn),y1:Math.max(Cn,An),x2:Math.min(xn,Sn),y2:Math.min(_n,Bn)}));m.x1=Math.floor(b.x1),m.y1=Math.floor(b.y1),m.x2=Math.ceil(b.x2),m.y2=Math.ceil(b.y2)}this.backupDirtyBounds.copy(m),i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0);var w=m.width()*i.dpr!==i.canvas.width||m.height()*i.dpr!==i.canvas.height;i.save(),i.translate(a,l,!0),w&&(i.beginPath(),i.rect(m.x1,m.y1,m.width(),m.height()),i.clip()),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:$s.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:$s.zIndex)})).forEach((function(t){n.renderGroup(t,e)})),i.restore(),i.restore(),i.draw(),i.inuse=!1}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,n=t._uid;e;){var i=fs(e,n,$s.zIndex);if(i)return i;n=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,e){var n=this;if(!e.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(Tn(t.AABBBounds,this.dirtyBounds,!1)){var i=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:function(){var i;cs(t,$s.zIndex,(function(t){e.break||(t.isContainer?n.renderGroup(t,e):n.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.dirtyBounds.copy(i)}}}},{key:"_increaseRender",value:function(t,e){var n=e.layer,i=e.stage,r=n.subLayers,o=r.get(t._uid);o||(o={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,o));var a=o.layer.getNativeHandler().getContext(),s=o.drawContribution||RC.get(Mp);s.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:o.layer,context:a,startAtId:t._uid,break:!1})),o.drawContribution=s;var l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{var u=r.get(l._uid);u||(u={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(l._uid,u));var h=u.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:u.layer,context:h,startAtId:l._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,e,n){if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}var o=this.getRenderContribution(t);if(o&&(t.isContainer||Tn(t.AABBBounds,this.dirtyBounds,!1))){var a=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=a),a?t.isContainer&&o.draw(t,this.currentRenderService,e,n):o.draw(t,this.currentRenderService,e,n),this.InterceptorContributions.length)for(var s=0;s<this.InterceptorContributions.length;s++){var l=this.InterceptorContributions[s];if(l.afterDrawItem&&l.afterDrawItem(t,this.currentRenderService,e,this))return}}}},{key:"selectRenderByType",value:function(t){return console.warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,n){var i=n.clear;if(i){var r=e.getCanvas(),o=n.width,a=void 0===o?r.width:o,s=n.height,l=void 0===s?r.height:s;e.clearRect(0,0,a,l),e.fillStyle=Wa(e,i,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+l}}),e.fillRect(0,0,a,l)}}}]),t}();Wb([xo(),Fb("design:type",Function),Fb("design:paramtypes",[]),Fb("design:returntype",void 0)],Nb.prototype,"init",null),Nb=Wb([po(),zb(0,mo(Lp)),zb(1,yo(Xp)),zb(2,yo(Mv)),zb(3,yo(Fa)),zb(3,vo(Lb)),Fb("design:paramtypes",[Array,Object,Object,Object])],Nb);var Gb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ub=function(){function t(){Ae(this,t)}return Se(t,[{key:"selector",value:function(t){return null}}]),t}();Ub=Gb([po()],Ub);var Vb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Kb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yb=function(t,e){return function(n,i){e(n,i,t)}},Xb=function(){function t(e){Ae(this,t),this.groupRenderContribitions=e,this.numberType=rc}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l=Ml(t,null==o?void 0:o.theme).group,u=t.attribute,h=u.fill,c=void 0===h?null==l.fill?!!t.attribute.fillColor:l.fill:h,d=u.background,f=u.stroke,p=void 0===f?null==l.stroke?!!t.attribute.strokeColor:l.stroke:f,v=u.opacity,g=void 0===v?l.opacity:v,y=u.width,m=void 0===y?l.width:y,b=u.height,w=void 0===b?l.height:b,x=u.clip,C=void 0===x?l.clip:x,_=u.fillOpacity,k=void 0===_?l.fillOpacity:_,S=u.strokeOpacity,A=void 0===S?l.strokeOpacity:S,B=u.borderRadius,R=void 0===B?l.borderRadius:B,T=u.path,M=void 0===T?l.path:T,P=u.lineWidth,O=void 0===P?l.lineWidth:P,E=u.visible,H=void 0===E?l.visible:E,L=kc(g,k,m,w),I=Ac(g,A,m,w),D=c,j=Cc(p,O);if(t.valid&&H){if(!C){if(!(D||j||d))return;if(!(L||I||a||s||d))return}if(M&&M.length&&r.drawContribution){var W=e.disableFill,F=e.disableStroke,z=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,M.forEach((function(t){r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,o)})),e.disableFill=W,e.disableStroke=F,e.disableBeginPath=z}else 0===R||Wt(R)&&R.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,m,w)):(e.beginPath(),Qa(e,n,i,m,w,R));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);var N={doFill:D,doStroke:j};this._groupRenderContribitions.forEach((function(r){r.time===Ed.beforeFillStroke&&r.drawShape(t,e,n,i,D,j,L,I,l,a,s,N)})),C&&e.clip(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),N.doFill&&(a?a(e,t.attribute,l):L&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),N.doStroke&&(s?s(e,t.attribute,l):I&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._groupRenderContribitions.forEach((function(r){r.time===Ed.afterFillStroke&&r.drawShape(t,e,n,i,D,j,L,I,l,a,s)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=t.attribute.clip;o?r.save():r.highPerformanceSave();var a=Ml(t,null==i?void 0:i.theme).group,s=r.modelMatrix;if(r.camera){var l=HC.allocate(),u=HC.allocate();kg(u,t,a),_g(l,s||l,u),r.modelMatrix=l,HC.free(u),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,n);var h,c=t.attribute,d=c.scrollX,f=void 0===d?a.scrollX:d,p=c.scrollY,v=void 0===p?a.scrollY:p;(f||v)&&r.translate(f,v),i&&i.drawingCb&&(h=i.drawingCb()),r.modelMatrix!==s&&HC.free(r.modelMatrix),r.modelMatrix=s,h&&h.then?h.then((function(){o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}}}]),t}();function $b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Xb=Vb([po(),Yb(0,yo(Fa)),Yb(0,vo(bf)),Kb("design:paramtypes",[Object])],Xb);var qb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zb=function(t){Ke(n,t);var e=$b(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).numberType=uh,t}return Se(n,[{key:"drawShape",value:function(t,e,i,r,o,a,s,l){if(t.incremental&&o.multiGraphicOptions){var u=o.multiGraphicOptions,h=u.startAtIdx,c=u.length,d=t.attribute.segments,f=void 0===d?[]:d;if(h>f.length)return;var p=Ml(t).line,v=t.attribute,g=v.fill,y=void 0===g?null==p.fill?!!t.attribute.fillColor:p.fill:g,m=v.stroke,b=void 0===m?null==p.stroke?!!t.attribute.strokeColor:p.stroke:m,w=v.opacity,x=void 0===w?p.opacity:w,C=v.fillOpacity,_=void 0===C?p.fillOpacity:C,k=v.strokeOpacity,S=void 0===k?p.strokeOpacity:k,A=v.lineWidth,B=void 0===A?p.lineWidth:A,R=v.visible,T=void 0===R?p.visible:R,M=_c(x,_),P=Sc(x,S),O=y,E=Cc(b,B);if(!t.valid||!T)return;if(!O&&!E)return;if(!(M||P||s||l))return;for(var H=o.context,L=h;L<h+c;L++)this.drawIncreaseSegment(t,H,f[L-1],f[L],t.attribute.segments[L],[p,t.attribute],i,r)}else Ho($e(n.prototype),"drawShape",this).call(this,t,e,i,r,o,a,s,l)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,o,a,s){i&&(e.beginPath(),function(t,e,n,i){var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,u=e?e.points[e.points.length-1]:n.points[0];t.moveTo(u.x+a,u.y+l),n.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+a,e.y+l):t.moveTo(e.x+a,e.y+l)}))}(e.nativeContext,n,i,{offsetX:a,offsetY:s}),e.setShadowStyle&&e.setShadowStyle(t,r,o),e.setStrokeStyle(t,r,a,s,o),e.stroke())}}]),n}(cf);function Jb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Zb=qb([po()],Zb);var Qb=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},tw=function(t){Ke(n,t);var e=Jb(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).numberType=Xh,t}return Se(n,[{key:"drawShape",value:function(t,e,i,r,o,a,s){if(t.incremental&&o.multiGraphicOptions){var l=o.multiGraphicOptions,u=l.startAtIdx,h=l.length,c=t.attribute.segments,d=void 0===c?[]:c;if(u>d.length)return;var f=Ml(t).area,p=t.attribute,v=p.fill,g=void 0===v?null==f.fill?!!t.attribute.fillColor:f.fill:v,y=p.fillOpacity,m=void 0===y?f.fillOpacity:y,b=p.opacity,w=void 0===b?f.opacity:b,x=p.visible,C=void 0===x?f.visible:x,_=_c(w,m),k=g;if(!t.valid||!C)return;if(!k)return;if(!_&&!s)return;for(var S=u;S<u+h;S++)this.drawIncreaseSegment(t,e,d[S-1],d[S],t.attribute.segments[S],[f,t.attribute],i,r)}else Ho($e(n.prototype),"drawShape",this).call(this,t,e,i,r,o,a,s)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,o,a,s){i&&(e.beginPath(),function(t,e,n,i){for(var r=i||{},o=r.offsetX,a=void 0===o?0:o,s=r.offsetY,l=void 0===s?0:s,u=n.points,h=[],c=0,d=0;d<u.length;d++)!1===u[d].defined&&(c+1!==d&&h.slice(c,d),c=d);h.length,h.push(u),h.forEach((function(n,i){var r,o,s,u,h=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(h.x+a,h.y+l),n.forEach((function(e){!1!==e.defined?t.lineTo(e.x+a,e.y+l):t.moveTo(e.x+a,e.y+l)}));for(var c=n.length-1;c>=0;c--){var d=n[c];t.lineTo(null!==(r=d.x1)&&void 0!==r?r:d.x,null!==(o=d.y1)&&void 0!==o?o:d.y)}t.lineTo(null!==(s=h.x1)&&void 0!==s?s:h.x,null!==(u=h.y1)&&void 0!==u?u:h.y),t.closePath()}))}(e.camera?e:e.nativeContext,n,i,{offsetX:a,offsetY:s}),e.setShadowStyle&&e.setShadowStyle(t,r,o),e.setCommonStyle(t,r,a,s,o),e.fill())}}]),n}(Gf);function ew(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}tw=Qb([po()],tw);var nw,iw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},rw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ow=function(t,e){return function(n,i){e(n,i,t)}},aw=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(nw||(nw={}));var sw=function(t){Ke(n,t);var e=ew(n);function n(t,i,r,o,a,s){var l;return Ae(this,n),(l=e.call(this,t,i,a,s)).contributions=t,l.renderSelector=i,l.lineRender=r,l.areaRender=o,l.layerService=a,l.drawItemInterceptorContributions=s,l.rendering=!1,l.currFrameStartAt=0,l.currentIdx=0,l.status=nw.NORMAL,l.checkingForDrawPromise=null,l.hooks={completeDraw:new Bo([])},l}return Se(n,[{key:"init",value:function(){Ho($e(n.prototype),"init",this).call(this),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}},{key:"draw",value:function(t,e){return aw(this,void 0,void 0,us.mark((function n(){var i,r,o,a,s,l,u=this;return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.checkingForDrawPromise){n.next=2;break}return n.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),n.next=5,this.checkingForDrawPromise;case 5:if(i=n.sent,this.checkingForDrawPromise=null,!i){n.next=8;break}return n.abrupt("return");case 8:this.currentRenderService=t,r=e.context,o=e.x,a=void 0===o?0:o,s=e.y,l=void 0===s?0:s,r&&(r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0),r.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,r,e),r.translate(a,l,!0),r.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:$s.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:$s.zIndex)})).forEach((function(t){u.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){r.restore(),r.restore(),r.draw(),r.inuse=!1,u.rendering=!1})));case 11:case"end":return n.stop()}}),n,this)})))}},{key:"_increaseRender",value:function(t,e){return aw(this,void 0,void 0,us.mark((function n(){return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.rendering=!0,n.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return aw(this,void 0,void 0,us.mark((function n(){var i=this;return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.count=t.count,n.next=3,new Promise((function(n){i.renderItem(t,e,{drawingCb:function(){return aw(i,void 0,void 0,us.mark((function i(){var r,o=this;return us.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(2===t.count){i.next=6;break}return i.next=3,ds(t,$s.zIndex,(function(n,i){if(o.status===nw.STOP)return!0;if(n.isContainer)return!1;if(i<o.currentIdx)return!1;var r=o.currFrameStartAt+t.incremental;return i<r&&(o.currentIdx=i+1,o.renderItem(n,e)),i===r-1&&(o.currFrameStartAt=o.currentIdx,o.waitToNextFrame())}));case 3:n(!1),i.next=21;break;case 6:if(!(r=t.getChildAt(0)).incremental||!r.attribute.segments){i.next=19;break}r.incrementalAt||(r.incrementalAt=0);case 9:if(!(r.incrementalAt<r.attribute.segments.length)){i.next=17;break}return e.multiGraphicOptions={startAtIdx:r.incrementalAt,length:r.incremental},this.renderItem(r,e),r.incrementalAt+=r.incremental,i.next=15,this.waitToNextFrame();case 15:i.next=9;break;case 17:i.next=20;break;case 19:this.renderItem(r,e);case 20:n(!1);case 21:case"end":return i.stop()}}),i,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return n.stop()}}),n,this)})))}},{key:"waitToNextFrame",value:function(){return aw(this,void 0,void 0,us.mark((function t(){var e=this;return us.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return aw(this,void 0,void 0,us.mark((function e(){var n;return us.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return n=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return aw(this,void 0,void 0,us.mark((function t(){var e=this;return us.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=nw.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=nw.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return aw(this,void 0,void 0,us.mark((function n(){var i=this;return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.break||!1===t.attribute.visibleAll){n.next=11;break}if(!t.incremental||e.startAtId!==t._uid){n.next=7;break}return n.next=4,this._increaseRender(t,e);case 4:n.t0=void(e.break=!0),n.next=10;break;case 7:return n.next=9,new Promise((function(n){i.renderItem(t,e,{drawingCb:function(){return aw(i,void 0,void 0,us.mark((function i(){var r=this;return us.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,ds(t,$s.zIndex,(function(t){return aw(r,void 0,void 0,us.mark((function n(){return us.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=e.break,n.t0){n.next=6;break}if(n.t1=t.isContainer,!n.t1){n.next=6;break}return n.next=6,this.renderGroup(t,e);case 6:case"end":return n.stop()}}),n,this)})))}));case 2:n(!1);case 3:case"end":return i.stop()}}),i)})))}})}));case 9:n.t0=void n.sent;case 10:return n.abrupt("return",n.t0);case 11:case"end":return n.stop()}}),n,this)})))}}]),n}(Nb);function lw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}iw([yo(ko),rw("design:type",Object)],sw.prototype,"global",void 0),sw=iw([po(),ow(0,mo(Lp)),ow(1,yo(Xp)),ow(2,yo(Zb)),ow(3,yo(tw)),ow(4,yo(Mv)),ow(5,yo(Fa)),ow(5,vo(Lb)),rw("design:paramtypes",[Array,Object,Object,Object,Object,Object])],sw);var uw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hw=function(t){Ke(n,t);var e=lw(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).type="rect3d",t.numberType=yh,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u=Ml(t,null==o?void 0:o.theme).rect3d,h=t.attribute,c=h.fill,d=void 0===c?null==u.fill?!!t.attribute.fillColor:u.fill:c,f=h.stroke,p=void 0===f?null==u.stroke?!!t.attribute.strokeColor:u.stroke:f,v=h.width,g=void 0===v?u.width:v,y=h.height,m=void 0===y?u.height:y,b=h.opacity,w=void 0===b?u.opacity:b,x=h.fillOpacity,C=void 0===x?u.fillOpacity:x,_=h.lineWidth,k=void 0===_?u.lineWidth:_,S=h.strokeOpacity,A=void 0===S?u.strokeOpacity:S,B=h.visible,R=void 0===B?u.visible:B,T=null!==(l=this.z)&&void 0!==l?l:0,M=kc(w,C,g,m),P=Ac(w,A,g,m),O=d,E=Cc(p,k);if(t.valid&&R&&(O||E)&&(M||P||a||s)){var H=r.stage||{},L=H.light,I=(H.camera,t.findFace());if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,u);var D=t.attribute.fillColor,j=void 0===D?u.fillColor:D;"string"!=typeof j&&(j="black"),this.fill(n,i,T,I,j,e,L,a)}!1!==p&&(e.setStrokeStyle(t,t.attribute,n,i,u),this.stroke(n,i,T,I,e))}}},{key:"stroke",value:function(t,e,n,i,r){var o=i.vertices;i.edges.forEach((function(i){var a=o[i[0]],s={x:t+a[0],y:e+a[1],z:n+a[2]},l=o[i[1]],u={x:t+l[0],y:e+l[1],z:n+l[2]};r.beginPath(),r.moveTo(s.x,s.y,s.z),r.lineTo(u.x,u.y,u.z),r.stroke()}))}},{key:"fill",value:function(t,e,n,i,r,o,a,s){var l=ml.get(r).value,u=i.vertices,h=u.map((function(t){return o.view(t[0],t[1],t[2])[2]})),c=[];i.polygons.forEach((function(t,e){c.push({faceIdx:e,polygon:t});var n=t.polygon,i=(t.normal,h[n[0]]),r=h[n[1]],o=h[n[2]],a=h[n[3]];t.ave_z=i+r+o+a})),c.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),c.forEach((function(i){var h=i.polygon,c=h.polygon,d=h.normal,f=u[c[0]],p=u[c[1]],v=u[c[2]],g=u[c[3]],y={x:t+f[0],y:e+f[1],z:n+f[2]},m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+v[0],y:e+v[1],z:n+v[2]},w={x:t+g[0],y:e+g[1],z:n+g[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(w.x,w.y,w.z),o.closePath(),s?s(o,null,null):(o.fillStyle=a?a.computeColor(d,l):r,o.fill())}))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Ml(t).rect,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix;this.z=l,this.drawShape(t,i,a,s,n),this.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore()}}}]),n}(lf);hw=uw([po()],hw);var cw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},dw=function(){function t(){Ae(this,t),this.numberType=Fh}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r){var o=Ml(t).richtext,a=t.attribute,s=a.width,l=(void 0===s&&o.width,a.height),u=(void 0===l&&o.height,a.opacity),h=void 0===u?o.opacity:u,c=a.fillOpacity,d=void 0===c?o.fillOpacity:c,f=a.visible,p=void 0===f?o.visible:f;t.valid&&p&&_c(h,d)&&(e.translate(n,i),t.getFrameCache().draw(e,this.drawIcon))}},{key:"drawIcon",value:function(t,e,n,i,r){var o,a=Ml(t).richtextIcon,s=t.attribute,l=s.width,u=void 0===l?a.width:l,h=s.height,c=void 0===h?a.height:h,d=s.opacity,f=void 0===d?a.opacity:d,p=s.image,v=s.backgroundFill,g=void 0===v?a.backgroundFill:v,y=s.backgroundFillColor,m=void 0===y?a.backgroundFillColor:y,b=s.backgroundFillOpacity,w=void 0===b?a.backgroundFillOpacity:b,x=s.backgroundStroke,C=void 0===x?a.backgroundStroke:x,_=s.backgroundStrokeColor,k=void 0===_?a.backgroundStrokeColor:_,S=s.backgroundStrokeOpacity,A=void 0===S?a.backgroundStrokeOpacity:S,B=s.backgroundRadius,R=void 0===B?a.backgroundRadius:B,T=s.margin,M=t.attribute,P=M.backgroundWidth,O=void 0===P?u:P,E=M.backgroundHeight,H=void 0===E?c:E;if(T&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){var L=(O-u)/2,I=(H-c)/2;0===R?(e.beginPath(),e.rect(n-L,i-I,O,H)):(e.beginPath(),Qa(e,n-L,i-I,O,H,R)),g&&(e.globalAlpha=w,e.fillStyle=m,e.fill()),C&&(e.globalAlpha=A,e.strokeStyle=k,e.stroke())}var D=p&&(null===(o=null==t?void 0:t.resources)||void 0===o?void 0:o.get(p));D&&"success"===D.state&&(e.globalAlpha=f,e.drawImage(D.data,n,i,u,c))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Ml(t).richtext,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,u,n),i.highPerformanceRestore()}}}]),t}();dw=cw([po()],dw);var fw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pw=function(){function t(){Ae(this,t),this.numberType=wh}return Se(t,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){r.drawContribution&&t.getSubGraphic().forEach((function(t){var l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,n,i,r,o,a,s)}))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r&&(r.highPerformanceSave(),n.drawContribution)){var o=Ml(t),a=t.getSubGraphic();a.length&&a.forEach((function(t){n.drawContribution.renderItem(t,n,{theme:o})})),r.highPerformanceRestore()}}}]),t}();function vw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}pw=fw([po()],pw);var gw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};var yw=function(t){Ke(n,t);var e=vw(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).numberType=ec,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u=Ml(t,null==o?void 0:o.theme).arc,h=t.attribute,c=h.fill,d=void 0===c?null==u.fill?!!t.attribute.fillColor:u.fill:c,f=h.background,p=h.stroke,v=void 0===p?null==u.stroke?!!t.attribute.strokeColor:u.stroke:p,g=h.opacity,y=void 0===g?u.opacity:g,m=h.fillOpacity,b=void 0===m?u.fillOpacity:m,w=h.lineWidth,x=void 0===w?u.lineWidth:w,C=h.strokeOpacity,_=void 0===C?u.strokeOpacity:C,k=h.visible,S=void 0===k?u.visible:k,A=_c(y,b),B=Sc(y,_),R=d,T=Cc(v,x),M=null!==(l=this.z)&&void 0!==l?l:0;if(t.valid&&S&&(R||T||f)&&(A||B||a||s||f)){var P=t.attribute,O=P.outerRadius,E=void 0===O?u.outerRadius:O,H=P.innerRadius,L=void 0===H?u.innerRadius:H,I=P.fillColor,D=void 0===I?u.fillColor:I,j=P.height,W=void 0===j?10:j,F=ml.get(D).value,z=(r.stage||{}).light,N=r.hack_pieFace,G={top:M,bottom:M+W},U={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===N||"top"===N?(e.beginPath(),function(t,e,n,i,r,o,a){var s=t.getParsedAngle(),l=s.startAngle,u=s.endAngle,h=Oe(u-l),c=u>l,d=!1;if(o<a){var f=o;o=a,a=f}if(o<=Be)e.moveTo(n,i,r);else if(h>=Pe-Be)e.moveTo(n+o*He(l),i+o*De(l),r),e.arc(n,i,o,l,u,!c,r),a>Be&&(e.moveTo(n+a*He(u),i+a*De(u),r),e.arc(n,i,a,u,l,c,r));else{var p=t.getParsePadAngle(l,u),v=p.outerDeltaAngle,g=p.innerDeltaAngle,y=p.outerStartAngle,m=p.outerEndAngle,b=p.innerEndAngle,w=p.innerStartAngle,x=o*He(y),C=o*De(y),_=a*He(b),k=a*De(b);v<.001?d=!0:(e.moveTo(n+x,i+C,r),e.arc(n,i,o,y,m,!c,r)),!(a>Be)||g<.001?(e.lineTo(n+_,i+k,r),d=!0):(e.lineTo(n+_,i+k,r),e.arc(n,i,a,b,w,c,r))}e.closePath()}(t,e,n,i,G[N],E,L),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),R&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=z?z.computeColor(U[N],F):D,e.fill())),T&&(s?s(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke()))):"outside"!==N&&"inside"!==N||("inside"===N&&(e.save(),e.beginPath(),e.arc(n,i,L,0,Pe,!0,G.top),e.clip()),e.beginPath(),function(t,e,n,i,r,o,a,s){var l=t.getParsedAngle(),u=l.startAngle,h=l.endAngle,c=Oe(h-u),d=h>u,f=!1;if(a<=Be)e.moveTo(n,i,r);else if(c>=Pe-Be)e.moveTo(n+a*He(u),i+a*De(u),r),e.arc(n,i,a,u,h,!d,r),e.lineTo(n+a*He(h),i+a*De(h),o),e.arc(n,i,a,h,u,d,o);else{var p=s(u,h),v=p.innerouterDeltaAngle,g=p.innerouterStartAngle,y=p.innerouterEndAngle,m=a*He(g),b=a*De(g),w=a*He(y),x=a*De(y);v<.001?f=!0:(e.moveTo(n+m,i+b,r),e.arc(n,i,a,g,y,!d,r),e.lineTo(n+w,i+x,o),e.arc(n,i,a,y,g,d,o))}e.closePath()}(t,e,n,i,G.top,G.bottom,"outside"===N?E:L,(function(e,n){var i=t.getParsePadAngle(e,n),r=i.outerDeltaAngle,o=i.innerDeltaAngle,a=i.outerStartAngle,s=i.outerEndAngle,l=i.innerEndAngle,u=i.innerStartAngle;return"outside"===N?{innerouterDeltaAngle:r,innerouterEndAngle:s,innerouterStartAngle:a}:{innerouterDeltaAngle:o,innerouterEndAngle:l,innerouterStartAngle:u}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,u),R&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=z?z.computeColor(U[N],F):D,e.fill())),T&&(s?s(e,t.attribute,u):B&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke())),"inside"===N&&e.restore())}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var o=Ml(t,null==i?void 0:i.theme).arc;r.save();var a=this.transform(t,o,r),s=a.x,l=a.y,u=a.z,h=a.lastModelMatrix;this.z=u,Bc(t,r,s,l,0,i)||(this.drawShape(t,r,s,l,n,i),this.z=0,r.modelMatrix!==h&&HC.free(r.modelMatrix),r.modelMatrix=h),r.restore()}}}]),n}(lf);function mw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}yw=gw([po()],yw);var bw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},ww=function(t){Ke(n,t);var e=mw(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).type="pyramid3d",t.numberType=hc,t}return Se(n,[{key:"drawShape",value:function(t,e,n,i,r,o,a,s){var l,u=Ml(t,null==o?void 0:o.theme).polygon,h=t.attribute,c=h.fill,d=void 0===c?null==u.fill?!!t.attribute.fillColor:u.fill:c,f=h.stroke,p=void 0===f?null==u.stroke?!!t.attribute.strokeColor:u.stroke:f,v=h.opacity,g=void 0===v?u.opacity:v,y=h.fillOpacity,m=void 0===y?u.fillOpacity:y,b=h.lineWidth,w=void 0===b?u.lineWidth:b,x=h.strokeOpacity,C=void 0===x?u.strokeOpacity:x,_=h.visible,k=void 0===_?u.visible:_,S=h.points,A=h.face,B=void 0===A?[!0,!0,!0,!0,!0,!0]:A,R=null!==(l=this.z)&&void 0!==l?l:0,T=_c(g,m),M=Sc(g,C),P=d,O=Cc(p,w);if(t.valid&&k&&4===S.length&&(P||O)&&(T||M||a||s)){var E=r.stage||{},H=E.light,L=E.camera,I=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,u);var D=t.attribute.fillColor,j=void 0===D?u.fillColor:D;"string"!=typeof j&&(j="black"),this.fill(n,i,R,I,B,j,e,H,L,t,u,a)}!1!==p&&(e.setStrokeStyle(t,t.attribute,n,i,u),this.stroke(n,i,R,I,e))}}},{key:"stroke",value:function(t,e,n,i,r){var o=i.vertices;i.edges.forEach((function(i){var a=o[i[0]],s=o[i[1]],l={x:t+a[0],y:e+a[1],z:n+a[2]},u={x:t+s[0],y:e+s[1],z:n+s[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(u.x,u.y,u.z),r.stroke()}))}},{key:"fill",value:function(t,e,n,i,r,o,a,s,l,u,h,c){var d=ml.get(o).value,f=i.vertices,p=f.map((function(t){return a.view(t[0],t[1],t[2])[2]})),v=[];i.polygons.forEach((function(t,e){if(r[e]){v.push({faceIdx:e,polygon:t});var n=t.polygon,i=(t.normal,p[n[0]]),o=p[n[1]],a=p[n[2]],s=p[n[3]];t.ave_z=i+o+a+s}})),v.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),v.forEach((function(i){var r=i.polygon,l=r.polygon,p=r.normal,v=f[l[0]],g=f[l[1]],y=f[l[2]],m=f[l[3]],b={x:t+v[0],y:e+v[1],z:n+v[2]},w={x:t+g[0],y:e+g[1],z:n+g[2]},x={x:t+y[0],y:e+y[1],z:n+y[2]},C={x:t+m[0],y:e+m[1],z:n+m[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(w.x,w.y,w.z),a.lineTo(x.x,x.y,x.z),a.lineTo(C.x,C.y,C.z),a.closePath(),c?c(a,u.attribute,h):(a.fillStyle=s?s.computeColor(p,d):o,a.fill())}))}},{key:"draw",value:function(t,e,n){var i=n.context;if(i){i.highPerformanceSave();var r=Ml(t).polygon,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix;this.z=l,this.drawShape(t,i,a,s,n),this.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore()}}}]),n}(lf);ww=bw([po()],ww);var xw=new lo((function(t){t(Nb).toSelf(),t($p).toService(Nb),t(sw).toSelf(),t(Mp).toService(sw),t(Ub).toSelf(),t(Xp).toService(Ub),t(af).toSelf().inSingletonScope(),t(Hp).to(af),t(Lp).to(af),t(Qd).toSelf().inSingletonScope(),t(tf).toSelf().inSingletonScope(),t(ef).toSelf().inSingletonScope(),t(Jd).toService(Qd),t(Jd).toService(tf),t(Jd).toService(ef),Na(t,Jd),t(ip).toSelf().inSingletonScope(),t(Fp).to(ip),t(Lp).to(ip),t(hw).toSelf().inSingletonScope(),t(zp).toService(hw),t(Lp).toService(zp),t(Rf).toSelf().inSingletonScope(),t(Tf).toSelf().inSingletonScope(),t(Mf).toSelf().inSingletonScope(),t(Pf).toSelf().inSingletonScope(),t(Of).toSelf().inSingletonScope(),t(Bf).toService(Rf),t(Bf).toService(Tf),t(Bf).toService(Mf),t(Bf).toService(Pf),t(Bf).toService(Of),Na(t,Bf),t(cp).toSelf().inSingletonScope(),t(Gp).to(cp),t(Lp).to(cp),t(Qf).toSelf().inSingletonScope(),t(jp).to(Qf),t(Lp).to(Qf),t(Yf).toSelf().inSingletonScope(),t(Xf).toSelf().inSingletonScope(),t(Kf).toService(Yf),t(Kf).toService(Xf),Na(t,Kf),t(lp).toSelf().inSingletonScope(),t(Np).to(lp),t(Lp).to(lp),t(If).toSelf().inSingletonScope(),t(Df).toSelf().inSingletonScope(),t(jf).toSelf().inSingletonScope(),t(Lf).toService(If),t(Lf).toService(Df),t(Lf).toService(jf),Na(t,Lf),t($d).toSelf().inSingletonScope(),t(Pp).to($d),t(Lp).to($d),t(yw).toSelf().inSingletonScope(),t(Op).toService(yw),t(Lp).toService(Op),t(Fd).toSelf().inSingletonScope(),t(zd).toSelf().inSingletonScope(),t(Nd).toSelf().inSingletonScope(),t(Wd).toService(Fd),t(Wd).toService(zd),t(Wd).toService(Nd),Na(t,Wd),t(cf).toSelf().inSingletonScope(),t(Dp).to(cf),t(Lp).to(cf),t(Zb).toSelf().inSingletonScope(),t(tw).toSelf().inSingletonScope(),t(Gf).toSelf().inSingletonScope(),t(Ep).to(Gf),t(Lp).to(Gf),t(vf).toSelf().inSingletonScope(),t(gf).toSelf().inSingletonScope(),t(pf).toService(vf),t(pf).toService(gf),Na(t,pf),t(Xb).toSelf().inSingletonScope(),t(Ip).to(Xb),t(Lp).to(Xb),t(wf).toSelf().inSingletonScope(),t(bf).toService(wf),Na(t,bf),t(Sp).toSelf().inSingletonScope(),t(Wp).to(Sp),t(Lp).to(Sp),t(wp).toSelf().inSingletonScope(),t(xp).toSelf().inSingletonScope(),t(bp).toService(wp),t(bp).toService(xp),Na(t,bp),t(pw).toSelf().inSingletonScope(),t(Kp).toService(pw),t(Lp).toService(Kp),t(Tp).toSelf().inSingletonScope(),t(Yp).toService(Tp),t(Lp).toService(Yp),t(kf).toSelf().inSingletonScope(),t(_f).toService(kf),Na(t,_f),t(dw).toSelf().inSingletonScope(),t(Up).toService(dw),t(Lp).toService(Up),t(ww).toSelf().inSingletonScope(),t(Vp).toService(ww),t(Lp).toService(Vp),Na(t,Lp),t(Db).toSelf().inSingletonScope(),t(Lb).toService(Db),t(jb).toSelf().inSingletonScope(),t(Lb).toService(jb),Na(t,Lb)}));var Cw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},_w=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kw=function(t,e){return function(n,i){e(n,i,t)}},Sw=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Gl}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).circle,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=ja(i,o,i.dpr),c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();Sw=Cw([po(),kw(0,yo(Hp)),_w("design:paramtypes",[Object])],Sw);var Aw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Bw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rw=function(t,e){return function(n,i){e(n,i,t)}},Tw=new Qe,Mw=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=fh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).rect,o=t.attribute.borderRadius,a=void 0===o?r.borderRadius:o,s=t.attribute,l=s.x,u=void 0===l?r.x:l,h=s.y,c=void 0===h?r.y:h;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);u+=f.x,c+=f.y,i.setTransformForCurrent()}else u=0,c=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!d||Nt(a,!0)&&0!==a||Wt(a)&&a.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,i,u,c,{},null,(function(t,n,i){return!!p||(p=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(p)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=ja(i,o,i.dpr),p=t.isPointInStroke(e.x,e.y)}));else if(p){var v=t.attribute,g=v.fill,y=void 0===g?!!t.attribute.fillColor:g,m=v.stroke,b=void 0===m?!!t.attribute.strokeColor:m,w=v.lineWidth,x=void 0===w?r.lineWidth:w;if(y)p=!0;else if(b){var C=t.AABBBounds;Tw.setValue(C.x1,C.y1,C.x2,C.y2),Tw.expand(-x/2),p=!Tw.containsPoint(e)}}return i.highPerformanceRestore(),p}}]),t}();Mw=Aw([po(),Rw(0,yo(Fp)),Bw("design:paramtypes",[Object])],Mw);var Pw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Ow=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ew=function(t,e){return function(n,i){e(n,i,t)}},Hw=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Jh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).arc;i.highPerformanceSave();var o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=ja(i,o,i.dpr),c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();Hw=Pw([po(),Ew(0,yo(Pp)),Ow("design:paramtypes",[Object])],Hw);var Lw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Iw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dw=function(t,e){return function(n,i){e(n,i,t)}},jw=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Xh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).area,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),c}}]),t}();jw=Lw([po(),Dw(0,yo(Ep)),Iw("design:paramtypes",[Object])],jw);var Ww=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Fw=function(){function t(){Ae(this,t),this.type="image",this.numberType=Oh}return Se(t,[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();function zw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Fw=Ww([po()],Fw);var Nw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Gw=function(t){Ke(n,t);var e=zw(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n)}(lf);function Uw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Vw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Kw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yw=function(t,e){return function(n,i){e(n,i,t)}},Xw=function(t){Ke(n,t);var e=Uw(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="line",i.numberType=uh,i}return Se(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;i.highPerformanceSave();var r=Ml(t).line,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=ja(i,r,i.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw=Nw([po()],Gw));function $w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Xw=Vw([po(),Yw(0,yo(Dp)),Kw("design:paramtypes",[Object])],Xw);var qw=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Zw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jw=function(t,e){return function(n,i){e(n,i,t)}},Qw=function(t){Ke(n,t);var e=$w(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="path",i.numberType=Uh,i}return Se(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).path,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=ja(i,r,i.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw);function tx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Qw=qw([po(),Jw(0,yo(jp)),Zw("design:paramtypes",[Object])],Qw);var ex=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},nx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ix=function(t,e){return function(n,i){e(n,i,t)}},rx=function(t){Ke(n,t);var e=tx(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="symbol",i.numberType=oh,i}return Se(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();var r=Ml(t).symbol,o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth;return i.lineWidth=ja(i,r,i.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw);function ox(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}rx=ex([po(),ix(0,yo(Np)),nx("design:paramtypes",[Object])],rx);var ax=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},sx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lx=function(t,e){return function(n,i){e(n,i,t)}},ux=function(t){Ke(n,t);var e=ox(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="text",i.numberType=Xl,i}return Se(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();var o=Ml(t).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?o.keepDirIn3d:a),l=this.transform(t,o,i,s),u=l.x,h=l.y,c=l.z,d=l.lastModelMatrix;this.canvasRenderer.z=c;var f=e;if(i.camera){f=e.clone();var p=t.parent.globalTransMatrix;f.x=p.a*e.x+p.c*e.y+p.e,f.y=p.b*e.x+p.d*e.y+p.f}var v=!1;return this.canvasRenderer.drawShape(t,i,u,h,{},null,(function(e,n,i){if(v)return!0;var r=t.attribute,a=r.textBaseline,s=void 0===a?o.textBaseline:a,l=r.textAlign,d=void 0===l?o.textAlign:l,p=t.AABBBounds,g=p.height(),y=p.width(),m=Mo(s,g),b=To(d,y);return e.rect(b+u,m+h,y,g,c),v=e.isPointInPath(f.x,f.y)}),(function(t,e,n){return v})),this.canvasRenderer.z=0,i.modelMatrix!==d&&HC.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),v}}]),n}(Gw);ux=ax([po(),lx(0,yo(Gp)),sx("design:paramtypes",[Object])],ux);var hx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},cx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dx=function(t,e){return function(n,i){e(n,i,t)}},fx=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=sc}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).polygon,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();fx=hx([po(),dx(0,yo(Wp)),cx("design:paramtypes",[Object])],fx);var px=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},vx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gx=function(t,e){return function(n,i){e(n,i,t)}},yx=(new Qe,function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Fh}return Se(t,[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}]),t}());yx=px([po(),gx(0,yo(Up)),vx("design:paramtypes",[Object])],yx);var mx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},bx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wx=function(t,e){return function(n,i){e(n,i,t)}},xx=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=wh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,n))})),r}return!1}}]),t}();function Cx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}xx=mx([po(),wx(0,yo(Kp)),bx("design:paramtypes",[Object])],xx);var _x=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},kx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sx=function(t,e){return function(n,i){e(n,i,t)}},Ax=(new Qe,function(t){Ke(n,t);var e=Cx(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="rect3d",i.numberType=yh,i}return Se(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).rect;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(h.x,h.y))})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw));function Bx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Ax=_x([po(),Sx(0,yo(zp)),kx("design:paramtypes",[Object])],Ax);var Rx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Tx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Mx=function(t,e){return function(n,i){e(n,i,t)}},Px=(new Qe,function(t){Ke(n,t);var e=Bx(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="pyramid3d",i.numberType=hc,i}return Se(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).polygon;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,n){return!1})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw));function Ox(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}Px=Rx([po(),Mx(0,yo(Vp)),Tx("design:paramtypes",[Object])],Px);var Ex=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Hx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lx=function(t,e){return function(n,i){e(n,i,t)}},Ix=(new Qe,function(t){Ke(n,t);var e=Ox(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).canvasRenderer=t,i.type="arc3d",i.numberType=ec,i}return Se(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).arc;i.highPerformanceSave();var o=this.transform(t,r,i),a=o.x,s=o.y,l=o.z,u=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,i,a,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(h.x,h.y))})),this.canvasRenderer.z=0,i.modelMatrix!==u&&HC.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}}]),n}(Gw));Ix=Ex([po(),Lx(0,yo(Op)),Hx("design:paramtypes",[Object])],Ix);var Dx=new lo((function(t,e,n,i){t(Sw).toSelf().inSingletonScope(),t(ty).toService(Sw),t(dy).toService(ty),t(Mw).toSelf().inSingletonScope(),t(ry).toService(Mw),t(dy).toService(ry),t(Ax).toSelf().inSingletonScope(),t(oy).toService(Ax),t(dy).toService(oy),t(Hw).toSelf().inSingletonScope(),t(Zg).toService(Hw),t(dy).toService(Zg),t(jw).toSelf().inSingletonScope(),t(Qg).toService(jw),t(dy).toService(Qg),t(Fw).toSelf().inSingletonScope(),t(ey).toService(Fw),t(dy).toService(ey),t(Xw).toSelf().inSingletonScope(),t(ny).toService(Xw),t(dy).toService(ny),t(Qw).toSelf().inSingletonScope(),t(iy).toService(Qw),t(dy).toService(iy),t(rx).toSelf().inSingletonScope(),t(ay).toService(rx),t(dy).toService(ay),t(ux).toSelf().inSingletonScope(),t(sy).toService(ux),t(dy).toService(sy),t(fx).toSelf().inSingletonScope(),t(ly).toService(fx),t(dy).toService(ly),t(Px).toSelf().inSingletonScope(),t(uy).toService(Px),t(dy).toService(uy),t(Ix).toSelf().inSingletonScope(),t(Jg).toService(Ix),t(dy).toService(Jg),t(yx).toSelf().inSingletonScope(),t(hy).toService(yx),t(dy).toService(hy),t(xx).toSelf().inSingletonScope(),t(cy).toService(xx),t(dy).toService(cy),Na(t,dy)})),jx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Wx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fx=function(t,e){return function(n,i){e(n,i,t)}},zx=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="path",this.numberType=Uh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).path,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();zx=jx([po(),Fx(0,yo(jp)),Wx("design:paramtypes",[Object])],zx);var Nx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Gx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ux=function(t,e){return function(n,i){e(n,i,t)}},Vx=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Gl}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).circle,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();Vx=Nx([po(),Ux(0,yo(Hp)),Gx("design:paramtypes",[Object])],Vx);var Kx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Yx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xx=function(t,e){return function(n,i){e(n,i,t)}},$x=new Qe,qx=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=fh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).rect,o=t.attribute.borderRadius,a=void 0===o?r.borderRadius:o,s=t.attribute,l=s.x,u=void 0===l?r.x:l,h=s.y,c=void 0===h?r.y:h;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);u+=f.x,c+=f.y,i.setTransformForCurrent()}else u=0,c=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!d||Nt(a,!0)&&0!==a||Wt(a)&&a.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,i,u,c,{},null,(function(t,n,i){return!!p||(p=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(p)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,p=t.isPointInStroke(e.x,e.y)}));else if(p){var v=t.attribute,g=v.fill,y=void 0===g?!!t.attribute.fillColor:g,m=v.stroke,b=void 0===m?!!t.attribute.strokeColor:m,w=v.lineWidth,x=void 0===w?r.lineWidth:w;if(y)p=!0;else if(b){var C=t.AABBBounds;$x.setValue(C.x1,C.y1,C.x2,C.y2),$x.expand(-x/2),p=!$x.containsPoint(e)}}return i.highPerformanceRestore(),p}}]),t}();qx=Kx([po(),Xx(0,yo(Fp)),Yx("design:paramtypes",[Object])],qx);var Zx=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},Jx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qx=function(t,e){return function(n,i){e(n,i,t)}},tC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Jh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).arc;i.highPerformanceSave();var o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();tC=Zx([po(),Qx(0,yo(Pp)),Jx("design:paramtypes",[Object])],tC);var eC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},nC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iC=function(t,e){return function(n,i){e(n,i,t)}},rC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Xh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).area,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),c}}]),t}();rC=eC([po(),iC(0,yo(Ep)),nC("design:paramtypes",[Object])],rC);var oC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},aC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sC=function(t,e){return function(n,i){e(n,i,t)}},lC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="line",this.numberType=uh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).line,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();lC=oC([po(),sC(0,yo(Dp)),aC("design:paramtypes",[Object])],lC);var uC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},hC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cC=function(t,e){return function(n,i){e(n,i,t)}},dC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=oh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).symbol,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();dC=uC([po(),cC(0,yo(Np)),hC("design:paramtypes",[Object])],dC);var fC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},pC=function(){function t(){Ae(this,t),this.type="text",this.numberType=Xl}return Se(t,[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}]),t}();pC=fC([po()],pC);var vC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},gC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yC=function(t,e){return function(n,i){e(n,i,t)}},mC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=sc}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=Ml(t).polygon,o=t.attribute,a=o.x,s=void 0===a?r.x:a,l=o.y,u=void 0===l?r.y:l;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);s+=h.x,u+=h.y,i.setTransformForCurrent()}else s=0,u=0,i.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,n,i){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(c)return!0;var o=n.lineWidth||r.lineWidth;return i.lineWidth=o,c=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),c}}]),t}();mC=vC([po(),yC(0,yo(Wp)),gC("design:paramtypes",[Object])],mC);var bC=function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},wC=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xC=function(t,e){return function(n,i){e(n,i,t)}},CC=function(){function t(e){Ae(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=wh}return Se(t,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,n))})),r}return!1}}]),t}();CC=bC([po(),xC(0,yo(Kp)),wC("design:paramtypes",[Object])],CC);var _C=new lo((function(t){t(Vx).toSelf().inSingletonScope(),t(vy).toService(Vx),t(_y).toService(vy),t(qx).toSelf().inSingletonScope(),t(my).toService(qx),t(_y).toService(my),t(tC).toSelf().inSingletonScope(),t(fy).toService(tC),t(_y).toService(fy),t(rC).toSelf().inSingletonScope(),t(py).toService(rC),t(_y).toService(py),t(lC).toSelf().inSingletonScope(),t(gy).toService(lC),t(_y).toService(gy),t(zx).toSelf().inSingletonScope(),t(yy).toService(zx),t(_y).toService(yy),t(dC).toSelf().inSingletonScope(),t(by).toService(dC),t(_y).toService(by),t(pC).toSelf().inSingletonScope(),t(wy).toService(pC),t(_y).toService(wy),t(mC).toSelf().inSingletonScope(),t(xy).toService(mC),t(_y).toService(xy),t(CC).toSelf().inSingletonScope(),t(Cy).toService(CC),t(CC).toService(Cy),Na(t,_y)}));var kC=new lo((function(t){t(Rc).toDynamicValue((function(){return function(t){return new Pd(t)}})).whenTargetNamed(Pd.env),t(Tc).toDynamicValue((function(){return function(t,e){return new Sd(t,e)}})).whenTargetNamed(Sd.env)})),SC=new lo((function(t){t(Rc).toDynamicValue((function(){return function(t){return new eb(t)}})).whenTargetNamed(eb.env),t(Tc).toDynamicValue((function(){return function(t,e){return new $m(t,e)}})).whenTargetNamed($m.env)})),AC=new lo((function(t){t(Rc).toDynamicValue((function(){return function(t){return new Fm(t)}})).whenTargetNamed(Fm.env),t(Tc).toDynamicValue((function(){return function(t,e){return new Hm(t,e)}})).whenTargetNamed(Hm.env)})),BC=new lo((function(t){t(Rc).toDynamicValue((function(){return function(t){return new gb(t)}})).whenTargetNamed(gb.env),t(Tc).toDynamicValue((function(){return function(t,e){return new hb(t,e)}})).whenTargetNamed(hb.env)}));var RC=new so;RC.load(Ug),RC.load(am),RC.load(Vg),RC.load(Hy),RC.load(om),RC.load(sm),function(t){t.load(Am),t.load(_b),t.load(kb),t.load(Eb)}(RC),function(t){t.load(xw)}(RC),function(t){t.load(Dx),t.load(_C)}(RC),function(t){t.load(kC),t.load(AC),t.load(SC),t.load(BC)}(RC);var TC=RC.get(ko),MC=RC.get(Wg),PC=RC.get(zg),OC=RC.get(Sg),EC=RC.get(pd),HC=RC.get(vd),LC=RC.get(jy),IC=(RC.get(Vy),RC.get(Yy),RC.get($y),RC.get(Zy),RC.get(Qy),RC.get(Gy),RC.get(em),RC.get(im),RC.get($g)),DC=RC.get(Mv);var jC,WC=function(){function t(){Ae(this,t),this.time=0}return Se(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),FC=function(){function t(){Ae(this,t)}return Se(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;this.timerId=setTimeout((function(){e(n)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),zC=function(){function t(){Ae(this,t)}return Se(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;TC.getRequestAnimationFrame()((function(){n.released||e(n)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!TC.getRequestAnimationFrame()}}]),t}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(jC||(jC={}));var NC=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ae(this,t),this.handleTick=function(t,n){var i=(null!=n?n:{}).once,r=void 0!==i&&i;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var n=e.tickerHandler.getTime(),i=0;e.lastFrameTime>=0&&(i=n-e.lastFrameTime),e.lastFrameTime=n,e.status===jC.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=n,this.autoStop=!0}return Se(t,[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=jC.INITIAL,TC.hooks.onSetEnv.tap("window",(function(){t.initHandler()})),TC.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:zC},{mode:"timeout",cons:FC},{mode:"manual",cons:WC}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new zC;break;case"timeout":t=new FC;break;case"manual":t=new WC;break;default:console.warn("非法的计时器模式"),t=new zC}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==jC.INITIAL&&(this.status=jC.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==jC.INITIAL&&(this.status=jC.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===jC.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===jC.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=jC.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=jC.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}]),t}(),GC=function(){function t(){Ae(this,t)}return Se(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/Pe*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Pe/e)}}},{key:"getElasticOut",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/Pe*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*Pe/e)+1}}},{key:"getElasticInOut",value:function(t,e){return function(n){var i=e/Pe*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Pe/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*Pe/e)*.5+1}}}]),t}();GC.quadIn=GC.getPowIn(2),GC.quadOut=GC.getPowOut(2),GC.quadInOut=GC.getPowInOut(2),GC.cubicIn=GC.getPowIn(3),GC.cubicOut=GC.getPowOut(3),GC.cubicInOut=GC.getPowInOut(3),GC.quartIn=GC.getPowIn(4),GC.quartOut=GC.getPowOut(4),GC.quartInOut=GC.getPowInOut(4),GC.quintIn=GC.getPowIn(5),GC.quintOut=GC.getPowOut(5),GC.quintInOut=GC.getPowInOut(5),GC.backIn=GC.getBackIn(1.7),GC.backOut=GC.getBackOut(1.7),GC.backInOut=GC.getBackInOut(1.7),GC.elasticIn=GC.getElasticIn(1,.3),GC.elasticOut=GC.getElasticOut(1,.3),GC.elasticInOut=GC.getElasticInOut(1,.3*1.5);var UC=new(function(){function t(){Ae(this,t),this.id=Ua.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}return Se(t,[{key:"addAnimate",value:function(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===ys.END?this.removeAnimate(e):e.status===ys.RUNNING||e.status===ys.INITIAL?(this.animateCount++,e.advance(t)):e.status===ys.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){t._onRemove&&t._onRemove.forEach((function(t){return t()})),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),t.release()}}]),t}());function VC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var KC=function(){function t(e,n,i,r,o){Ae(this,t),this.from=e,this.to=n,this.duration=i,this.easing=r,this.params=o,this.updateCount=0}return Se(t,[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}},{key:"update",value:function(t,e,n){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(n,this.step.getLastProps()),this.onUpdate(t,e,n),t&&this.onEnd()}}]),t}(),YC=function(t){Ke(n,t);var e=VC(n);function n(t){var i;return Ae(this,n),(i=e.call(this,null,null,0,"linear")).cb=t,i}return Se(n,[{key:"onUpdate",value:function(t,e,n){}},{key:"onStart",value:function(){this.cb()}}]),n}(KC),XC=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ua.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:UC;Ae(this,t),this.id=e,this.timeline=n,this.status=ys.INITIAL,this.tailAnimate=new $C(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return Se(t,[{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var e=-1/0;return t.forEach((function(t){e=Le(t.getDuration(),e)})),this._startTime=e,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&n&ms.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:gs.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,n=new YC((function(){t(e,n.step.prev)}));return this.tailAnimate.play(n),this}},{key:"customInterpolate",value:function(e,n,i,r,o,a){var s=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!s&&s(e,n,i,r,o,a)}},{key:"pause",value:function(){this.status===ys.RUNNING&&(this.status=ys.PAUSED)}},{key:"resume",value:function(){this.status===ys.PAUSED&&(this.status=ys.RUNNING)}},{key:"to",value:function(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new $C(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===ys.INITIAL&&(this.status=ys.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===ys.RUNNING&&(this.status=ys.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,n=0,i=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var o=t>=r;if(o&&(t=r),t===i)return o;for(var a=0;a<this.subAnimates.length&&!(n+(e=this.subAnimates[a]).totalDuration>=t);a++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),o}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=ys.END}},{key:"stop",value:function(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}],[{key:"AddInterpolate",value:function(e,n){t.interpolateMap.set(e,n)}}]),t}();XC.mode=ms.NORMAL,XC.interpolateMap=new Map;var $C=function(){function t(e,n){Ae(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new qC(0,0,n?Object.assign({},n.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}return Se(t,[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var n=t.easing,i="string"==typeof n?GC[n]:n,r=this._addStep(e,null,i);return r.type=bs.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,n,i){var r=this;(null==e||e<0)&&(e=0);var o="string"==typeof n?GC[n]:n,a=this._addStep(e,null,o);return a.type=bs.to,this._appendProps(t,a,!!i&&i.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),i&&i.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(a.propKeys)})),this}},{key:"from",value:function(t,e,n,i){var r=this;this.to(t,0,n,i);var o={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){o[t]=r.getLastPropByName(t,r.stepTail)})),this.to(o,e,n,i),this.stepTail.type=bs.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=bs.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,n){var i=new qC(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}},{key:"_appendProps",value:function(t,e,n){var i=this;e.props=n?t:Object.assign({},t);var r=e.prev,o=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=i.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===o[t]&&(o[t]=r.props[t])}))),r=r.prev;var a=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(o)),e.propKeys.forEach((function(t){if(void 0===a[t]){var e=i.animate.getStartProps();a[t]=e[t]=i.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,n,i,r=this.duration,o=this.loop,a=this.rawPosition,s=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(r<=0)return s=!0;if(i=(t-=l)-(n=Math.floor(t/r))*r,(s=t>=o*r+r)&&(t=(i=r)*(n=o)+r),t===a)return s;var u=!this.reversed!=!(this.bounce&&n%2);return u&&(i=r-i),this._deltaPosition=i-this.position,this.position=i,this.rawPosition=t+l,this.updatePosition(s,u),s}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var n=this.stepHead.next,i=this.position,r=this.duration;if(this.target&&n){for(var o=n.next;o&&o.position<=i;)o=(n=o).next;var a=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(a=n.easing(a)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,a,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(n,a)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,n){if(t!==e)if(n){for(var i=e.prev;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,e){for(var n=e.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var i=n.customAnimate.getEndProps()[t];if(void 0!==i)return i}n=n.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}},{key:"updateTarget",value:function(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}]),t}(),qC=function(){function t(e,n,i,r){Ae(this,t),this.duration=n,this.position=e,this.props=i,this.easing=r}return Se(t,[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}]),t}(),ZC={duration:200,easing:"cubicOut"};function JC(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var QC,t_=function(t){Ke(n,t);var e=JC(n);function n(t,i,r,o,a){return Ae(this,n),e.call(this,t,i,r,o,a)}return Se(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,e,n,i,r,o;this.fromNumber=Nt(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=Nt(null===(i=this.to)||void 0===i?void 0:i.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(o=this.to)||void 0===o?void 0:o.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1)}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){var i,r;!1!==this.valid&&(n.text=t?this.toNumber.toFixed():(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(null!==(r=null===(i=this.params)||void 0===i?void 0:i.fixed)&&void 0!==r?r:0))}}]),n}(KC);!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(QC||(QC={}));var e_=new NC;e_.addTimeline(UC);e_.setFPS(60);class n_ extends oc{role;col;row;mergeCol;mergeRow;border;needUpdate;clear(){this.removeAllChild()}getChildByName(t,e){let n=null;return this.forEachChildren((e=>e.name===t&&(n=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const i=e.getChildByName(t,!0);if(i)return n=i,!0}return!1})),n}get width(){let t=this.AABBBounds.width();return t!==1/0&&t!==-1/0||(t=0),Math.max(t,this.attribute.width??0)}get height(){let t=this.AABBBounds.height();return t!==1/0&&t!==-1/0||(t=0),Math.max(t,this.attribute.height??0)}setDeltaWidth(t){this.setAttribute("width",(this.attribute.width??0)+t),this.border&&this.border.setAttribute("width",this.border.attribute.width+t)}setDeltaHeight(t){this.setAttribute("height",(this.attribute.height??0)+t),this.border&&this.border.setAttribute("height",this.border.attribute.height+t)}setDeltaX(t){this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t,e="border-rect",n=!1){if(n){let n=this._lastChild,i=0;for(;n;){if(n.name!==e){if(t(n,i++))return}n=n._prev}}else{let n=this._firstChild,i=0;for(;n;){if(n.name!==e){if(t(n,i++))return}n=n._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<this.childrenCount;n++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<this.childrenCount;n++){if(e.row===t)return e;e=e._next}return null}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}}function i_(t,e,n,i,r){const o=e&&_(e[t])?e[t]:null;if("function"==typeof o){return o({col:n,row:i,table:r,value:r.getCellValue(n,i),dataValue:r.getCellOriginValue(n,i),cellHeaderPaths:r.getCellHeaderPaths(n,i)})}return o}function r_(t,e,n,i,r){const o=e&&_(e[t])?e[t]:null;if("function"!=typeof o)return o}function o_(t,e,n,i,r){const o=e&&_(e[t])?e[t]:null;if("function"==typeof o){return o({col:n,row:i,table:r,value:r.getCellValue(n,i),dataValue:r.getCellOriginValue(n,i),cellHeaderPaths:r.getCellHeaderPaths(n,i)})}}function a_(t){let e=Ya(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}var s_={exports:{}},l_=(s_.exports,{}),u_=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),h_=["style","variant","weight","size","lineHeight","family"],c_=/([\.0-9]+)(.*)/,d_=function(t,e,n){var i=t.match(c_);if(i){t=parseFloat(i[1]);var r=i[2].toLowerCase().trim(),o=Math.round(t);switch(o===t&&(t=o),r){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/n);case"pc":return t/(6/n);case"mm":return t*(n/25.4);case"cm":return t*(n/2.54);case"in":return t*n;case"%":if(null===e)return;return e*(t/100)}}},f_={size:d_,lineHeight:d_},p_={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},v_=s_.exports=function(t,e,n){var i=t+"-"+(e||"null")+"@"+n;if(n=n||96,void 0!==l_[i])return l_[i];if(e&&(e=v_(e,null,n)),"inherit"===t)return e;var r=u_.exec(t);if(r){r.shift();for(var o={},a=0;a<r.length;a++){var s=h_[a],l=r[a];if(f_[s]&&l){var u=e&&e[s]||null,h=f_[s](l,u,n);l=void 0===h&&"lineHeight"===s&&l?o.size*parseFloat(l):h}if(l&&"normal"!==l){if("inherit"===l){if(!e)return;l=e[s]}l.trim&&(l=l.trim()),o[s]=l}}Object.keys(o).length||(o=null),l_[i]=o;var c=[];o.style&&c.push(o.style),o.variant&&c.push(o.variant),o.weight&&"400"!==o.weight&&"normal"!==o.weight&&c.push(o.weight),c.push(o.size+"px"),o.lineHeight&&(c[c.length-1]+="/"+o.lineHeight+"px");var d=o.family.split(",");return o.family=d.map((function(t){return t=t.trim(),p_[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(o.family),Object.defineProperty(o,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),o}l_[i]=null},g_=(s_.exports.generics=p_,At(s_.exports));let y_=class extends Hh{role;tooltip;constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.visible=!1),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image)}get backgroundWidth(){return this.attribute.backgroundWidth??this.attribute.width}get backgroundHeight(){return this.attribute.backgroundHeight??this.attribute.height}};const m_=new Map;function b_(t,e){const n=`${t}-${e}`,i=m_.get(n);if(i)return i;const r=(o={fontSize:t,fontFamily:e},new Ln({defaultFontParams:{fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:11},getTextBounds:s?void 0:Rg,specialCharSet:`-/: .,@%'"~${Ln.ALPHABET_CHAR_SET}${Ln.ALPHABET_CHAR_SET.toUpperCase()}`,...a??{}},o));var o,a,s;return m_.set(n,r),r}const w_=new class{measureText(t,e){const{fontSize:n,fontFamily:i}=e;return b_(n,i).measure(t)}measureTextWidth(t,e){const{fontSize:n,fontFamily:i="sans-serif"}=e;return b_(n,i).measure(t).width}clipText(t,e,n){if(0===t.length)return{str:"",width:0};let i=this.measureTextWidth(t,e);return i<=n?{str:t,width:i}:(i=this.measureTextWidth(t[0],e),i>n?{str:"",width:0}:this._clipText(t,e,n,0,t.length-1))}_clipText(t,e,n,i,r){const o=Math.floor((i+r)/2),a=t.substring(0,o+1),s=this.measureTextWidth(a,e);let l;if(s>n){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,o);return l=this.measureTextWidth(r,e),l<=n?{str:r,width:l}:this._clipText(t,e,n,i,o)}if(s<n){if(o>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const i=t.substring(0,o+2);return l=this.measureTextWidth(i,e),l>=n?{str:a,width:s}:this._clipText(t,e,n,o,r)}return{str:a,width:s}}clipTextWithSuffix(t,e,n,i){if(""===i)return this.clipText(t,e,n);if(0===t.length)return{str:"",width:0};const r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};const o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;const a=this._clipText(t,e,n,0,t.length-1);return a.str+=i,a.width+=o,a}},x_=["heightLimit","lineClamp","autoWrapText"];class C_ extends ql{constructor(t){super(t)}updateSingallineAABBBounds(t){const e=Ml(this).text;let n,i;const r=2,o=this.attribute,{maxLineWidth:a=e.maxLineWidth,ellipsis:s=e.ellipsis,textAlign:l=e.textAlign,textBaseline:u=e.textBaseline,fontSize:h=e.fontSize,fontFamily:c=e.fontFamily,stroke:d=e.stroke,lineHeight:f=o.lineHeight??(o.fontSize||e.fontSize)+r,lineWidth:p=e.lineWidth}=o;if(!this.shouldUpdateShape()&&this.cache){n=this.cache.clipedWidth;const t=To(l,n),e=Mo(u,f);return this._AABBBounds.set(t,e,t+n,e+f),d&&this._AABBBounds.expand(p/2),this._AABBBounds}if(Number.isFinite(a)){if(s){const r=!0===s?e.ellipsis:s,o=w_.clipTextWithSuffix(t.toString(),{fontSize:h,fontFamily:c},a,r);i=o.str,n=o.width}else{const e=w_.clipText(t.toString(),{fontSize:h,fontFamily:c},a);i=e.str,n=e.width}this.cache.clipedText=i,this.cache.clipedWidth=n}else n=w_.measureTextWidth(t.toString(),{fontSize:h,fontFamily:c}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();const v=To(l,n),g=Mo(u,f);return this._AABBBounds.set(v,g,v+n,g+f),d&&this._AABBBounds.expand(p/2),this._AABBBounds}updateMultilineAABBBounds(t){const e=Ml(this).text,{fontFamily:n=e.fontFamily,textAlign:i=e.textAlign,textBaseline:r=e.textBaseline,fontSize:o=e.fontSize,lineHeight:a=this.attribute.lineHeight||this.attribute.fontSize||e.fontSize,ellipsis:s=e.ellipsis,maxLineWidth:l,stroke:u=e.stroke,lineWidth:h=e.lineWidth,heightLimit:c=-1,lineClamp:d=e.lineClamp,autoWrapText:f=e.autoWrapText}=this.attribute;if(!this.shouldUpdateShape()&&this.cache?.layoutData){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(h/2),this._AABBBounds}const p=new Kl(n,{fontSize:o,fontFamily:n},w_),v=t.map((t=>t.toString())),g=[],y=[0,0];let m=1/0;if(c>0&&(m=Math.max(Math.floor(c/a),1)),d&&(m=Math.min(m,d)),f)if("number"==typeof l&&l!==1/0){if(l>0)for(let t=0;t<v.length;t++){const e=v[t];if(t===m-1){const t=p.textMeasure.clipTextWithSuffix(e,p.textOptions,l,s);g.push({str:t.str,width:t.width});break}const i=p.textMeasure.clipText(e,p.textOptions,l);if(""!==e&&""===i.str&&(i.str=e.substring(0,1),i.width=w_.measureTextWidth(i.str,{fontSize:o,fontFamily:n})),g.push({str:i.str,width:i.width}),i.str.length===e.length);else{const n=e.substring(i.str.length);v.splice(t+1,0,n)}}let t=0;g.forEach((e=>{t=Math.max(t,e.width)})),y[0]=t}else{let t,e,n=0;for(let i=0,r=v.length;i<r;i++){if(i===m-1){const t=p.textMeasure.clipTextWithSuffix(v[i],p.textOptions,l,s);g.push({str:t.str,width:t.width}),n=Math.max(n,t.width);break}e=v[i],t=p.textMeasure.measureTextWidth(e,p.textOptions),n=Math.max(n,t),g.push({str:e,width:t})}y[0]=n}else{let t=0;for(let e=0,n=v.length;e<n;e++)if(e<m){const n=p.textMeasure.clipTextWithSuffix(v[e],p.textOptions,l,s);g.push({str:n.str,width:n.width}),t=Math.max(t,n.width)}y[0]=t}y[1]=g.length*a;const b={xOffset:0,yOffset:0,width:y[0],height:y[1]};p.LayoutBBox(b,i,r);const w=p.layoutWithBBox(b,g,i,r,a);return this.cache.layoutData=w,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),u&&this._AABBBounds.expand(h/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<x_.length;e++){const n=x_[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<x_.length;e++){if(t===x_[e])return!0}return super.needUpdateTag(t)}}function __(t,e,n,i,r,o,a,s,l){let u,h,f,p,v=!0;if("function"==typeof t){const e=t({col:n,row:i,dataValue:l.getCellOriginValue(n,i),value:l.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:o,width:r,height:o},table:l});f=e.rootContainer.getElements(void 0,!1,!1),v=e.renderDefault}else if("function"==typeof e){const t=e({col:n,row:i,dataValue:l.getCellOriginValue(n,i),value:l.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:o,width:r,height:o},table:l});f=t.elements,v=t.renderDefault,u=t.expectedWidth,h=t.expectedHeight}else e&&(u=e.expectedWidth,h=e.expectedHeight,f=e.elements,v=e.renderDefault);if(f){p=function(t,e,n,i){const r=new n_({x:0,y:0,width:e,height:n,pickable:!1});r.name="custom-container";const o=function(t,e,n,i){const r=[],o=0,a=0,s=[0,0,0,0];for(let l=0;l<t.length;l++){const u=t[l],h=Object.assign({},u);for(const t in h)h.hasOwnProperty(t)&&c(h[t])&&(h[t]=h[t](i));h.x=d(h.x)?k_(h.x,e-s[1]):Number(h.x),h.y=d(h.y)?k_(h.y,n-s[2]):Number(h.y),"width"in h&&(h.width=d(h.width)?k_(h.width,e-s[1]):Number(h.width)),"height"in h&&(h.height=d(h.height)?k_(h.height,n-s[2]):Number(h.height)),"radius"in h&&(h.radius=d(h.radius)?k_(h.radius,Math.min(e-s[1],n-s[2])):Number(h.radius)),"hover"in h&&(h.hover.x=d(h.hover.x)?k_(h.hover.x,e-s[1]):Number(h.hover.x),h.hover.y=d(h.hover.y)?k_(h.hover.y,n-s[2]):Number(h.hover.y),h.hover.width=d(h.hover.width)?k_(h.hover.width,e-s[1]):Number(h.hover.width),h.hover.height=d(h.hover.height)?k_(h.hover.height,n-s[2]):Number(h.hover.height),h.hover.x+=o,h.hover.y+=a),h.x=h.x+o,h.y=h.y+a,r.push(h)}return r}(t,e,n,i);return o.forEach((t=>{switch(t.type){case"arc":const e=Lv({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,fill:!!t.fillColor,fillColor:t.fillColor,stroke:!!t.strokeColor,strokeColor:t.strokeColor,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(e);break;case"text":if(t.background){const e=t.background?.expandX??0,n=t.background?.expandY??0,i=Fv({x:t.x-e,y:t.y-n,dx:t.dx??0,dy:t.dy??0,width:t.width+2*e,height:t.height+2*n,borderRadius:t.background?.borderRadius??0,fill:!0,fillColor:t.background?.fillColor??"#888"});r.appendChild(i)}const n=new C_(Object.assign({fill:!!t.fillColor,stroke:!!t.strokeColor,pickable:!!t.clickable},t));r.appendChild(n);break;case"rect":const i=Fv({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,borderRadius:t.radius,fill:!!t.fillColor,fillColor:t.fillColor,stroke:!!t.strokeColor,strokeColor:t.strokeColor,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(i);break;case"circle":const o=Iv({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,radius:t.radius,fill:!!t.fillColor,fillColor:t.fillColor,stroke:!!t.strokeColor,strokeColor:t.strokeColor,pickable:!!t.clickable,cursor:t.cursor});r.appendChild(o);break;case"icon":const a=new y_({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?t.hover.width??t.width:void 0,backgroundHeight:t.hover?t.hover.width??t.width:void 0,backgroundColor:t.hover?t.hover.bgColor??"rgba(22,44,66,0.2)":void 0,pickable:!!t.clickable,cursor:t.cursor});a.role="icon-custom",r.appendChild(a);break;case"image":const s=new y_({x:t.x,y:t.y,dx:t.dx??0,dy:t.dy??0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?t.hover.width??t.width:void 0,backgroundHeight:t.hover?t.hover.width??t.width:void 0,backgroundColor:t.hover?t.hover.bgColor??"rgba(22,44,66,0.2)":void 0,pickable:!!t.clickable,cursor:t.cursor,shape:t.shape});s.role="image-custom",r.appendChild(s)}})),r}(f,a?u:r,s?h:o,l.getCellValue(n,i))}return{elementsGroup:p,renderDefault:v}}function k_(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}class S_ extends n_{_leftGroup;_rightGroup;_centerGroup;_autoWidth=!1;_autoHeight=!1;_cellWidth;_cellHeight;_align;_baseline;constructor(t){super(t),this._leftGroup=new n_({pickable:!1}),this._leftGroup.role="content-left",this._rightGroup=new n_({pickable:!1}),this._rightGroup.role="content-right",this._centerGroup=new n_({pickable:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){t.setAttribute("x",this._leftGroup.width+(t.attribute.marginLeft??0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((t.attribute.marginLeft??0)+(t.attribute.marginRight??0)+t.attribute.width)}addRightOccupyingIcon(t){t.setAttribute("x",this._rightGroup.width+(t.attribute.marginLeft??0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((t.attribute.marginLeft??0)+(t.attribute.marginRight??0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof C_&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const n=this._centerGroup.width;this._cellWidth=t+e+n,this.setAttribute("width",this._cellWidth)}else{const n=this._cellWidth-t-e;this.updateCenterLayout(n);const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const n=this._leftGroup.height,i=this._rightGroup.height,r=this._centerGroup.height;this._cellHeight=Math.max(n,i,r),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof y_&&(e-=t.AABBBounds.width())}));const n=this._centerGroup.getChildByName("text");n instanceof Nh?n.setAttribute("width",e):n instanceof C_&&n.setAttribute("maxLineWidth",e);let i=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",i),i+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this.layout()}}function A_(t,e,n){const i=t.getCellRange(e,n);return!(i.start.col===i.end.col&&i.start.row===i.end.row)&&i}function B_(t,e){const n={};if("image"===t.type?n.image=t.src:("svg"===t.type||"svg"in t)&&(n.image=t.svg),n.width=t.width,n.height=t.height,n.visibleTime=t.visibleTime??"always",n.funcType=t.funcType,n.marginLeft=t.marginLeft??0,n.marginRight=t.marginRight??0,t.interactive&&(n.pickable=!1),t.hover&&(n.backgroundWidth=t.hover.width??t.width,n.backgroundHeight=t.hover.width??t.width,n.backgroundColor=t.hover.bgColor??"rgba(22,44,66,0.2)",n.hoverImage=t.hover.image),t.cursor&&(n.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(n.shape=t.shape),e)return e.setAttributes(n),e.loadImage(n.image),e;const i=new y_(n);return i.tooltip=t.tooltip,i}function R_(t){const e={};return"image"===t.type?e.image=t.src:("svg"===t.type||"svg"in t)&&(e.image=t.svg),e.visibleTime=t.visibleTime??"always",e.funcType=t.funcType,e.id=t.name,e.width=t.width,e.height=t.height,(t.marginRight||t.marginLeft)&&(e.margin=[0,t.marginRight??0,0,t.marginLeft??0]),t.hover&&(e.backgroundWidth=t.hover.width??t.width,e.backgroundHeight=t.hover.height??t.height,e.backgroundShowMode="hover",e.hoverImage=t.hover.image,e.backgroundStroke=!1,e.backgroundFill=!0,e.backgroundFillColor=t.hover.bgColor??"rgba(22,44,66,0.2)"),t.cursor&&(e.cursor=t.cursor),e.tooltip=t.tooltip,e}function T_(t,e,n,i,r,o,a,s){let l,u=0,h=0,c=0,d=0;t.forEachChildren((t=>{"icon-left"===t.role?(u+=t.AABBBounds.width(),h=Math.max(h,t.AABBBounds.height())):"icon-right"===t.role&&(c+=t.AABBBounds.width(),d=Math.max(d,t.AABBBounds.height()))}));const f=t.getChildByName("text"),p=t.getChildByName("content");let v;f instanceof C_?(l=f.AABBBounds.height(),f.setAttribute("maxLineWidth",e-u-d-(r[1]+r[3])),v=f.AABBBounds.height()):f instanceof Nh?(l=f.AABBBounds.height(),f.setAttribute("width",e-u-d-(r[1]+r[3])),v=f.AABBBounds.height()):p&&(l=p.AABBBounds.height(),p.updateWidth(e-u-d-(r[1]+r[3])),v=p.AABBBounds.height());const g=Math.max(h,d,l)+r[0]+r[2];if(t.forEachChildren((i=>{if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+n);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+n);else if("content"===i.name||"text"===i.name){i.AABBBounds.width();"center"===o?i.setAttribute("x",r[3]+u+(e-(r[1]+r[3])-u-c)/2):"right"===o&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-c)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),i){let e=Math.max(h,v,d);if(function(t,e,n,i){const r=t.table,o=A_(r,e.col,e.row);if(o&&o.end.row-o.start.row){i/=o.end.row-o.start.row+1,n/=o.end.row-o.start.row+1;for(let t=o.start.row;t<=o.end.row;t++){const e=r.getRowHeight(t);if(e===i&&n!==e)return!0;if(n>e)return!0}}else{const t=r.getRowHeight(e.row);if(t===i&&n!==t)return!0;if(n>t)return!0}return!1}(s,t,e+r[0]+r[2],g))return!0;e=t.attribute.height-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==a&&"bottom"!==a||t.forEachChildren((e=>{"rect"!==e.type&&("mark"===e.name?e.setAttribute("y",0):"middle"===a?e.setAttribute("y",(t.attribute.height-r[2]+r[0]-e.AABBBounds.height())/2):"bottom"===a?e.setAttribute("y",t.attribute.height-e.AABBBounds.height()-r[2]):e.setAttribute("y",r[0]))}));return!1}function M_(t,e,n,i,r,a,s,l,u,h,c,d,f,p,v,g){p&&(g=P_(t,r,a,g));const y=t._getCellStyle(r,a),b=o_("padding",y,r,a,t);_(b)&&(h=b),g?.text?.textAlign&&(c=g?.text?.textAlign),g?.text?.textBaseline&&(d=g?.text?.textBaseline);const{autoRowHeight:w}=t.internalProps,x="auto"===s,C=y.autoWrapText??t.internalProps.autoWrapText,k=y.lineClamp,S=new n_({x:n,y:i,width:l,height:u,fill:!0,stroke:!0,lineWidth:g?.group?.lineWidth??void 0,fillColor:g?.group?.fillColor??void 0,strokeColor:g?.group?.strokeColor??void 0,strokeArrayWidth:g?.group?.strokeArrayWidth??void 0,strokeArrayColor:g?.group?.strokeArrayColor??void 0,cursor:g?.group?.cursor??void 0,lineCap:"square",clip:!0});if(S.role="cell",S.col=r,S.row=a,e.addChild(S),v){const e=t.getCellValue(r,a);let n;if(f&&(n=t.getCellIcons(r,a)),function(t,e,n,i,r,a,s,l,u,h,c,d,f){const p=[],v=[],g=[],y=[],b=[],w=[],x=[],C=[];let _,k,S=0,A=0,B=0,R=0,T=0,M=0;if(Array.isArray(e)&&0!==e.length){let P;if(e.forEach((t=>{switch(t.positionType){case o.left:p.push(t);break;case o.right:v.push(t);break;case o.contentLeft:g.push(t);break;case o.contentRight:y.push(t);break;case o.absoluteRight:C.push(t);break;case o.inlineFront:b.push(t);break;case o.inlineEnd:w.push(t)}})),p.forEach((e=>{const n=B_(e);n.role="icon-left",n.name=e.name,n.setAttribute("x",S+(n.attribute.marginLeft??0)),S+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),A=Math.max(A,n.AABBBounds.height()),t.appendChild(n)})),v.forEach((e=>{const n=B_(e);n.role="icon-right",n.name=e.name,n.setAttribute("x",B+(n.attribute.marginLeft??0)),B+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),R=Math.max(R,n.AABBBounds.height()),t.appendChild(n)})),x.forEach((e=>{const n=B_(e);n.role="icon-absolute-left",n.name=e.name,n.setAttribute("x",T+(n.attribute.marginLeft??0)),T+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),t.appendChild(n)})),C.forEach((e=>{const n=B_(e);n.role="icon-absolute-right",n.name=e.name,n.setAttribute("x",M+(n.attribute.marginLeft??0)),M+=n.AABBBounds.width()+(n.attribute.marginLeft??0)+(n.attribute.marginRight??0),t.appendChild(n)})),0===b.length&&0===w.length){const t={text:m(n).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n"),maxLineWidth:r?1/0:u-(i[1]+i[3])-S-B,fill:!0,textBaseline:"top",heightLimit:a?-1:h-(i[0]+i[2]),pickable:!1,autoWrapText:s,lineClamp:l},e=new C_(f&&f.text?Object.assign({},f.text,t):t);e.name="text",P=e}else{const e=Object.assign({fill:!0,text:n?.toString()},t.parent?.theme?.userTheme?.text||{});f&&f.text&&Object.assign(e,f.text),e.textBaseline="middle";const o=[...b.map((t=>R_(t))),e,...w.map((t=>R_(t)))];o[0].textAlign=c;const s=new Nh({width:r?0:u-(i[1]+i[3])-S-B,height:a?0:h-(i[0]+i[2]),textConfig:o,verticalDirection:a?"top":d});s.name="text",P=s,s.bindIconEvent()}if(0!==g.length||0!==y.length){const e=new S_({x:0,y:0});e.name="content",e.setCellContentOption({autoWidth:r,autoHeight:a,cellWidth:u-(i[1]+i[3])-S-B,cellHeight:h-(i[0]+i[2]),align:c,baseline:d}),g.forEach((t=>{const n=B_(t);n.role="icon-content-left",n.name=t.name,e.addLeftOccupyingIcon(n)})),y.forEach((t=>{const n=B_(t);n.role="icon-content-right",n.name=t.name,e.addRightOccupyingIcon(n)})),e.addContent(P),t.appendChild(e),e.layout(),_=e.AABBBounds.width(),k=e.AABBBounds.height()}else t.firstChild?t.insertBefore(P,t.firstChild):t.appendChild(P),_=P.AABBBounds.width(),k=P.AABBBounds.height()}else{const e={text:m(n).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n"),maxLineWidth:r?1/0:u-(i[1]+i[3]),fill:!0,textBaseline:"top",autoWrapText:s,lineClamp:l,heightLimit:a?-1:h-(i[0]+i[2]),pickable:!1},o=new C_(f&&f.text?Object.assign({},f.text,e):e);o.name="text",t.appendChild(o),_=o.AABBBounds.width(),k=o.AABBBounds.height()}const P=r?S+_+B:u-(i[1]+i[3]),O=a?Math.max(A,k,R):h-(i[0]+i[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+i[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+P-B+i[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+P-M+i[3]+i[1]):"content"!==t.name&&"text"!==t.name||("center"===c&&"richtext"!==t.type?t.setAttribute("x",i[3]+S+(P-S-B)/2):"right"===c&&"richtext"!==t.type?t.setAttribute("x",i[3]+P-B):t.setAttribute("x",i[3]+S))})),t.forEachChildren((t=>{"middle"===d?t.setAttribute("y",i[0]+(O-t.AABBBounds.height())/2):"bottom"===d?t.setAttribute("y",i[0]+O-t.AABBBounds.height()):t.setAttribute("y",i[0])})),t.setAttributes({width:P+i[1]+i[3],height:O+i[0]+i[2]})}(S,n,e,h,x,w,C,"number"==typeof k?k:void 0,l,u,c,d,g),g?._vtable?.marked){const t=Lv({x:S.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fillColor:"#3073F2",pickable:!1});t.name="mark",S.appendChild(t)}}return S}function P_(t,e,n,i){const r=Mk(t._getCellStyle(e,n),t,e,n,o_).theme;for(const t in r.group)_(r.group[t])&&(i||(i={}),i.group||(i.group={}),i.group[t]=r.group[t]);for(const t in r.text)_(r.text[t])&&(i||(i={}),i.text||(i.text={}),i.text[t]=r.text[t]);for(const t in r._vtable)_(r._vtable[t])&&(i||(i={}),i._vtable||(i._vtable={}),i._vtable[t]=r._vtable[t]);return i}const O_=Wl();class E_ extends oc{type="chart";chartInstance;activeChartInstance;active;cacheCanvas;constructor(t){if(super(t),this.numberType=O_,t.chartInstance)this.chartInstance=t.chartInstance;else{t.canvas.getContext("2d");this.chartInstance=new t.ClassType(t.spec,{renderCanvas:t.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:t.viewBox,interactive:!1,animation:!1}),this.chartInstance.renderSync()}}activate(t){this.active=!0;const{x1:e,y1:n,x2:i,y2:r}=this.attribute.viewBox,o=t.scenegraph.tableGroup.globalAABBBounds,a=new Je;a.x1=o.x1+t.getFrozenColsWidth(),a.x2=o.x2,a.y1=o.y1+t.getFrozenRowsHeight(),a.y2=o.y2;const s=a.intersect({x1:e-t.scrollLeft,x2:i-t.scrollLeft,y1:n-t.scrollTop,y2:r-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:e-t.scrollLeft,x2:i-t.scrollLeft,y1:n-t.scrollTop,y2:r-t.scrollTop},animation:!1,interactive:!0,beforeRender:t=>{const e=t.window.getContext();e.inuse=!0,e.clearMatrix(),e.setTransformForCurrent(!0),e.beginPath(),e.rect(s.x1,s.y1,s.x2-s.x1,s.y2-s.y1),e.clip()},afterRender(t){t.window.getContext().inuse=!1}}),this.activeChartInstance.renderSync()}deactivate(){this.active=!1,this.activeChartInstance.release(),this.activeChartInstance=null}}const H_={},L_={};function I_(t,e,n,i,r,o,a,s,l,u,h,c,d,f){const p=nt(L_,H_)[h],v=P_(f,r,o),g=o_("padding",f._getCellStyle(r,o),r,o,f);_(g)&&(l=g),t||((t=new n_({x:n,y:i,width:a,height:s,fill:!0,stroke:!0,lineWidth:v?.group?.lineWidth??void 0,fillColor:v?.group?.fillColor??void 0,strokeColor:v?.group?.strokeColor??void 0,strokeArrayWidth:v?.group?.strokeArrayWidth??void 0,strokeArrayColor:v?.group?.strokeArrayColor??void 0,cursor:v?.group?.cursor??void 0,lineCap:"square",clip:!0})).role="cell",t.col=r,t.row=o,e.addChild(t)),t.AABBBounds.width();const y=new E_({x:l[3],y:l[0],canvas:f.canvas,spec:c,ClassType:p,width:a-l[3]-l[1],height:s-l[2]-l[0],chartInstance:d,dataId:"data",data:f.getCellValue(r,o),viewBox:{x1:t.globalAABBBounds.x1+f.tableX+l[3],x2:t.globalAABBBounds.x1+a+f.tableX-l[1],y1:t.globalAABBBounds.y1+f.tableY+l[0],y2:t.globalAABBBounds.y1+s+f.tableY-l[2]}});return t.appendChild(y),e.setAttribute("chartInstance",y.chartInstance),t}const D_={};class j_{static cache=new Map;static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}const W_={get sort_downward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#416EFF"/> </svg>',width:16,height:16,funcType:a.sort,name:"sort_downward",positionType:o.contentRight,marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#416EFF"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:a.sort,positionType:o.contentRight,name:"sort_upward",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="#282F38" fill-opacity="0.35"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="#282F38" fill-opacity="0.35"/></svg> ',width:16,height:16,funcType:a.sort,positionType:o.contentRight,name:"sort_normal",marginLeft:3,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get pin(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="#282F38" fill-opacity="0.2"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>',width:22,height:22,name:"pin",funcType:a.pin,positionType:o.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get pined(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#282F38" fill-opacity="0.35"/></svg>',width:22,height:22,name:"pined",funcType:a.pin,positionType:o.right,marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get pinedCurrent(){return{type:"svg",svg:'<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="#416EFF"/></svg>',width:22,height:22,funcType:a.pin,positionType:o.right,name:"pinedCurrent",marginRight:0,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:a.dropDown,positionType:o.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:a.play,positionType:o.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:a.damagePic,positionType:o.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get expand(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:a.expand,name:"expand",positionType:o.inlineFront,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="#141414" fill-opacity="0.65"/>\n </svg>',width:16,height:16,funcType:a.collapse,name:"collapse",positionType:o.inlineFront,marginLeft:0,marginRight:4,hover:{width:22,height:22,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get drillDown(){return{name:"drillDown",type:"svg",positionType:o.absolute,funcType:a.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:o.absolute,funcType:a.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}}};function F_(){return nt(W_,D_)}function z_(t,e,n,i){let r=t,o=e;return r>n&&(r=n,o=r*e/t),o>i&&(o=i,r=o*t/e),{width:r,height:o}}function N_(t,e,n,i,r,o,a="left",s="middle",l=[0,0,0,0],u=0,h=0,c=0,d=0){const f=t+n,p=e+i;let v=t+l[3]+u;"right"===a||"end"===a?v=f-r-l[1]-h:"center"===a&&(v=t+(n-r+u-h)/2);let g=e+l[0]+c;return"bottom"===s||"alphabetic"===s||"ideographic"===s?g=p-o-l[2]-d:"middle"===s&&(g=e+(i-o+c-d)/2),{x:v,y:g}}const G_=F_();function U_(t,e,n,i,r,o){let a=!1,s=null,l=null;return r.table.getColWidth(t)<n+o[1]+o[3]&&(s=n+o[1]+o[3],a=!0),r.table.getRowHeight(e)<i+o[2]+o[0]&&(l=i+o[2]+o[0],a=!0),!!a&&("number"==typeof s&&r.setColWidth(t,s),"number"==typeof l&&r.setRowHeight(e,l),r.component.updateScrollBar(),!0)}function V_(t,e,n,i){const r=t.getChildByName("image"),o="string"!=typeof r.attribute.image&&r.attribute.image||r.resources.get(r.attribute.image).data;if(!o)return;const a=i._getCellStyle(e,n),s=i_("textAlign",a,e,n,i)??"left",l=i_("textBaseline",a,e,n,i)??"middle",u=a_(i_("padding",a,e,n,i))??[0,0,0,0];if(r.keepAspectRatio){const{width:e,height:n}=z_(o.width||o.videoWidth,o.height||o.videoHeight,t.attribute.width-(u[1]+u[3]),t.attribute.height-(u[0]+u[2])),i=N_(0,0,t.attribute.width,t.attribute.height,e,n,s,l,u);r.setAttributes({x:i.x,y:i.y,width:e,height:n})}else r.setAttributes({x:u[3],y:u[0],width:t.attribute.width-u[1]-u[3],height:t.attribute.height-u[0]-u[2]})}function K_(t,e,n,i,r,o,a,s,l){t.dependField&&(r=l.getCellOriginRecord(o,a)?.[t.dependField]??r),t.barType=t.barType??"default",t.min=t.min??0,t.max=t.max??t.min+100;const u=l.getRowHeight(a);let h=n,c=u;const d=new n_({x:0,y:0,width:h,height:c});d.name="progress-bar";const{showBar:f,barColor:p,barBgColor:v,barPositiveColor:g,barNegativeColor:y,barAxisColor:m,barRightToLeft:b,showBarMark:w,barMarkPositiveColor:x,barMarkNegativeColor:C,barMarkWidth:_,barMarkPosition:k}=e;let{barHeight:S,barBottom:A,barPadding:B}=e;1===B.length?B=[B[0],B[0],B[0],B[0]]:2===B.length?B=[B[0],B[1],B[0],B[1]]:3===B.length&&(B=[B[0],B[1],B[2],B[1]]),B=B.map(((t,e)=>{if("string"==typeof t&&dt.endsWith(t,"%")){const i=Number(t.substr(0,t.length-1));return 0===e||2===e?u*i/100:n*i/100}return Number(t)}));const R=h,T=c,M=a_(i_("borderLineWidth",e,o,a,l));let P=Math.max(B[0],M[0]);const O=Math.max(B[1],M[1]),E=Math.max(B[2],M[2]);let H=Math.max(B[3],M[3]);h-=O+H,c-=E+P,1&P&&(P+=.5),1&H&&(H+=.5),"string"==typeof S&&dt.endsWith(S,"%")?(S=Number(S.substr(0,S.length-1)),S=c*S/100):S=Number(S),"string"==typeof A&&dt.endsWith(A,"%")?(A=Number(A.substr(0,A.length-1)),A=c*A/100):A=Number(A);if(ot(f,{col:o,row:a,table:l,context:null,value:i,dataValue:r})){let e=`${r}`;dt.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const s=Number(e);if(isNaN(s))return d;if("default"===(t.barType??"default")){const e=s<t.min?0:s>t.max?1:(s-t.min)/(t.max-t.min),n=h,u=P+c-S-A,f=0+H,g=ot(v,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:e});if(g){const t=Fv({x:f,y:u,width:n,height:S,fillColor:g});d.addChild(t)}const y=Fv({x:f,y:u,width:Math.min(n*e,n),height:S,fillColor:ot(p,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:e})||"#20a8d8"});d.addChild(y)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,n=t.max>0?t.max:0,f=e/(e+n),p=1-f,B=s>0?s/n:0,R=s<0?-s/e:0,T=h,M=P+c-S-A,O=0+H,E=ot(v,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:B});if(E){const t=Fv({x:O,y:M,width:T,height:S,fillColor:E});d.addChild(t)}const L=b?p*T:f*T,I=Math.min(T*f*R,T),D=b?{left:O+L,top:M,width:I,height:S}:{left:O+L-I,top:M,width:I,height:S},j=ot(y,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:R})||"#20a8d8",W=Fv({x:D.left,y:D.top,width:D.width,height:D.height,fillColor:j});d.addChild(W);const F=Math.min(T*p*B,T),z=b?{left:O+L-F,top:M,width:F,height:S}:{left:O+L,top:M,width:F,height:S},N=ot(g,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:B})||"#20a8d8",G=Fv({x:z.left,y:z.top,width:z.width,height:z.height,fillColor:N});d.addChild(G);const U=b?D.left:z.left,V=jv({x:0,y:0,stroke:!0,strokeColor:ot(m),lineWidth:1,lineDash:[2,2],points:[{x:U,y:0},{x:U,y:u}]});if(d.addChild(V),w&&(B||R)){const t=_,e=[];let n;if(B>0)if(n=ot(x,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:B})||"#20a8d8","right"===k){const t=b?z.left+_/2:z.left+z.width-_/2;e.push({x:t,y:z.top}),e.push({x:t,y:z.top+z.height})}else"bottom"===k&&(e.push({x:z.left,y:z.top+z.height-_/2}),e.push({x:z.left+z.width,y:z.top+z.height-_/2}));else if(R>0)if(n=ot(C,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:R})||"#20a8d8","right"===k){const t=b?D.left+D.width-_/2:D.left+_/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===k&&(e.push({x:D.left,y:D.top+D.height-_/2}),e.push({x:D.left+D.width,y:D.top+D.height-_/2}));const s=jv({x:0,y:0,stroke:!0,strokeColor:n,lineWidth:t,points:e});d.addChild(s)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,u=t.max>0?t.max:0,h=Math.max(e,u),c=0===h?0:Math.abs(s)/h,f=n-H-O-1,p=Math.min(f*c,f),m=T-E-S-A-1,B=b?R-O-p:0+H,M=Fv({x:B,y:m,width:f,height:S,fillColor:ot(v,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:c})||"#f0f3f5"});d.addChild(M);const P={left:B,top:m,width:p,height:S};let L;L=s>=0?ot(g,{col:o,row:a,table:l,context:null,value:i,rate:c,dataValue:r})||"#20a8d8":ot(y,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:c})||"#20a8d8";const I=Fv({x:P.left,y:P.top,width:P.width,height:P.height,fillColor:L});if(d.addChild(I),w&&s){const t=_,e=[];let n;if(n=s>=0?ot(x,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:c})||"#20a8d8":ot(C,{col:o,row:a,table:l,context:null,value:i,dataValue:r,rate:c})||"#20a8d8","right"===k){const t=b?P.left+_/2:P.left+P.width-_/2;e.push({x:t,y:P.top}),e.push({x:t,y:P.top+P.height})}else"bottom"===k&&(e.push({x:P.left,y:P.top+P.height-_/2}),e.push({x:P.left+P.width,y:P.top+P.height-_/2}));const u=jv({x:0,y:0,stroke:!0,strokeColor:n,lineWidth:t,points:e});d.addChild(u)}}}return d}var Y_;!function(t){t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(Y_||(Y_={}));var X_=function(){function t(){Ae(this,t)}return Se(t,[{key:"_calculateRange",value:function(t){if(this._wholeRange)return this._wholeRange;if(this._rangeFactor&&2===t.length){var e=(t[1]-t[0])/(this._rangeFactor[1]-this._rangeFactor[0]),n=t[0]-e*this._rangeFactor[0],i=n,r=e+n;return this._wholeRange=[i,r],this._wholeRange}return t}},{key:"calculateVisibleDomain",value:function(t){return this._rangeFactor&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this.domain()}},{key:"rangeFactor",value:function(t,e){return t?(2===t.length&&t.every((function(t){return t>=0&&t<=1}))&&(this._wholeRange=null,this._rangeFactor=t),this):this._rangeFactor}},{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}}]),t}();function $_(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return q_(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q_(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function q_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function Z_(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var J_=Symbol("implicit"),Q_=function(t){Ke(n,t);var e=Z_(n);function n(){var t;return Ae(this,n),(t=e.call(this)).type=Y_.Ordinal,t._index=new Map,t._domain=[],t._ordinalRange=[],t._unknown=J_,t}return Se(n,[{key:"clone",value:function(){return(new n).domain(this._domain).range(this._ordinalRange).unknown(this._unknown)}},{key:"scale",value:function(t){var e="".concat(t),n=this._index.get(e);if(!n){if(this._unknown!==J_)return this._unknown;n=this._domain.push(t),this._index.set(e,n)}return this._ordinalRange[(n-1)%this._ordinalRange.length]}},{key:"invert",value:function(t){for(var e=0;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}},{key:"domain",value:function(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;var e,n=$_(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,r="".concat(i);this._index.has(r)||this._index.set(r,this._domain.push(i))}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"range",value:function(t){if(!t)return this._ordinalRange.slice();var e=Array.from(t);return this._ordinalRange=e,this}}]),n}(X_);function tk(t){return t}function ek(t,e){if(t=Number(t),e=Number(e),e-=t)return function(n){return(n-t)/e};var n=Number.isNaN(e)?NaN:.5;return function(){return n}}function nk(t,e,n){var i,r,o=t[0],a=t[1],s=e[0],l=e[1];return a<o?(i=ek(a,o),r=n(l,s)):(i=ek(o,a),r=n(s,l)),function(t){return r(i(t))}}function ik(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=ek(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=le(t,e,1,i)-1;return o[n](r[n](e))}}function rk(t,e,n,i){var r,o,a=[];if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(r=e<t){var s=t;t=e,e=s}var l=ye(1,e-t+1)(n);if(o=Math.floor((e-t+1)/l),!i)for(;Math.ceil((e-t+1)/o)>n&&l>1;)l-=1,o=Math.floor((e-t)/l);for(var u=t;u<=e;)a.push(u),u+=o;return r&&a.reverse(),a}function ok(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var ak=function(t){Ke(n,t);var e=ok(n);function n(t){var i;return Ae(this,n),(i=e.call(this)).type=Y_.Band,i._range=[0,1],i._step=void 0,i._bandwidth=void 0,i._round=!1,i._paddingInner=0,i._paddingOuter=0,i._align=.5,i._unknown=void 0,delete i.unknown,i.rescale(t),i}return Se(n,[{key:"rescale",value:function(t){var e=this;if(t)return this;this._wholeRange=null;var i=this._calculateRange(this._range),r=Ho($e(n.prototype),"domain",this).call(this).length,o=i[1]<i[0],a=i[Number(o)-0],s=i[1-Number(o)],l=function(t,e,n){var i;return i=1===t?t+2*n:t-e+2*n,t?i>0?i:1:0}(r,this._paddingInner,this._paddingOuter);this._step=(s-a)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),a+=(s-a-this._step*(r-this._paddingInner))*this._align,this._bandwidth=this._step*(1-this._paddingInner),this._round&&(a=Math.round(a),this._bandwidth=Math.round(this._bandwidth));var u=function(t,e,n){Et(e)||(e=t,t=0),Et(n)||(n=1);for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(r).map((function(t){return a+e._step*t}));return Ho($e(n.prototype),"range",this).call(this,o?u.reverse():u),this}},{key:"calculateVisibleDomain",value:function(t){var e=this.domain();if(this._rangeFactor&&e.length){var n=this._getInvertIndex(t[0]),i=this._getInvertIndex(t[1]);return e.slice(Math.min(n,i),Math.max(n,i)+1)}return e}},{key:"domain",value:function(t,e){return t?(Ho($e(n.prototype),"domain",this).call(this,t),this.rescale(e)):Ho($e(n.prototype),"domain",this).call(this)}},{key:"range",value:function(t,e){return t?(this._range=[se(t[0]),se(t[1])],this.rescale(e)):this._range.slice()}},{key:"rangeRound",value:function(t,e){return this._range=[se(t[0]),se(t[1])],this._round=!0,this.rescale(e)}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return-1===t?e:rk(0,e.length-1,t,!1).map((function(t){return e[t]}))}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(e).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0]+t._bandwidth/2)/(t._range[1]-t._range[0])}}))}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return rk(0,e.length-1,t,!0).filter((function(t){return t<e.length})).map((function(t){return e[t]}))}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r=[];if(n=ye(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){var o=t;t=e,e=o}for(var a=t;a<=e;)r.push(a),a+=n;return i&&r.reverse(),r}(0,e.length-1,t).map((function(t){return e[t]}))}},{key:"_getInvertIndex",value:function(t){var e=0,n=this.step()/2,i=this.bandwidth()/2,r=this._domain.length,o=this.range(),a=o[0]>o[o.length-1];for(e=0;e<r;e++){var s=this.scale(this._domain[e])+i;if(0===e&&(!a&&!de(t,s+n)||a&&!fe(t,s-n)))break;if(e===r-1)break;if(!fe(t,s-n)&&!de(t,s+n))break}return e>=0&&e<=r-1?e:r-1}},{key:"invert",value:function(t){return this._domain[this._getInvertIndex(t)]}},{key:"padding",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}},{key:"paddingInner",value:function(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}},{key:"paddingOuter",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}},{key:"bandwidth",value:function(){return this._bandwidth}},{key:"step",value:function(){return this._step}},{key:"round",value:function(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}},{key:"align",value:function(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}},{key:"rangeFactor",value:function(t,e){return t?(Ho($e(n.prototype),"rangeFactor",this).call(this,t),this.rescale(e)):Ho($e(n.prototype),"rangeFactor",this).call(this)}},{key:"clone",value:function(){return new n(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align)}}]),n}(Q_),sk=bn;function lk(t,e){var n,i=Ht(e);if(Ot(e)||"boolean"===i)return function(){return e};if("number"===i)return we(t,e);if("string"===i){if(n=vn.parseColorString(e)){var r=sk(vn.parseColorString(t),n);return function(t){return r(t).formatRgb()}}return we(Number(t),Number(e))}return e instanceof gn?sk(t,e):e instanceof vn?sk(t.color,e.color):e instanceof Date?function(t,e){var n=t.valueOf(),i=e.valueOf(),r=new Date;return function(t){return r.setTime(n*(1-t)+i*t),r}}(t,e):we(Number(t),Number(e))}function uk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var hk=function(t){Ke(n,t);var e=uk(n);function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tk,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tk;return Ae(this,n),(t=e.call(this))._unknown=void 0,t.transformer=i,t.untransformer=r,t._forceAlign=!0,t._domain=[0,1],t._range=[0,1],t._clamp=tk,t._piecewise=nk,t._interpolate=lk,t}return Se(n,[{key:"scale",value:function(t){return t=Number(t),Number.isNaN(t)?this._unknown:(this._output||(this._output=this._piecewise(this._domain.map(this.transformer),this._calculateRange(this._range),this._interpolate)),this._output(this.transformer(this._clamp(t))))}},{key:"invert",value:function(t){return this._input||(this._input=this._piecewise(this._calculateRange(this._range),this._domain.map(this.transformer),we)),this._clamp(this.untransformer(this._input(t)))}},{key:"domain",value:function(t,e){if(!t)return this._domain.slice();var n=Array.from(t,se);return this._domain=n,this.rescale(e)}},{key:"range",value:function(t,e){if(!t)return this._range.slice();var n=Array.from(t);return this._range=n,this.rescale(e)}},{key:"rangeRound",value:function(t,e){var n=Array.from(t);return this._range=n,this._interpolate=xe,this.rescale(e)}},{key:"rescale",value:function(t){if(t)return this;var e=this._domain.length,n=this._range.length,i=Math.min(e,n);if(e&&e<n&&this._forceAlign){for(var r=n-e+1,o=this._domain[e-1],a=e>=2?(o-this._domain[e-2])/r:0,s=1;s<=r;s++)this._domain[e-2+s]=o-a*(r-s);i=n}return void 0===this._clamp&&(this._clamp=ye(this._domain[0],this._domain[i-1])),this._piecewise=i>2?ik:nk,this._output=this._input=null,this._wholeRange=null,this}},{key:"clamp",value:function(t,e,n){return arguments.length?(this._clamp=e||(t?void 0:tk),this.rescale(n)):this._clamp!==tk}},{key:"interpolate",value:function(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}},{key:"ticks",value:function(){return[]}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.ticks(e);return(null!=n?n:[]).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0])/(t._range[1]-t._range[0])}}))}},{key:"rangeFactor",value:function(t,e){return t?(Ho($e(n.prototype),"rangeFactor",this).call(this,t),this._output=this._input=null,this):Ho($e(n.prototype),"rangeFactor",this).call(this)}},{key:"forceAlignDomainRange",value:function(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}]),n}(X_),ck=Math.sqrt(50),dk=Math.sqrt(10),fk=Math.sqrt(2);function pk(t,e,n){var i,r,o,a,s=-1;if(e=+e,t=+t,n=+n,Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((i=e<t)&&(r=t,t=e,e=r),a=vk(t,e,n),0===e||!isFinite(a))return[];if(a>0){var l=Math.round(t/a),u=Math.round(e/a);for(l*a<t&&++l,u*a>e&&--u,o=new Array(r=u-l+1);++s<r;)o[s]=(l+s)*a}else{a=-a;var h=Math.round(t*a),c=Math.round(e*a);for(h/a<t&&++h,c/a>e&&--c,o=new Array(r=c-h+1);++s<r;)o[s]=(h+s)/a}return i&&o.reverse(),o}function vk(t,e,n){var i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/Math.pow(10,r),a=1;return o>=ck?a=10:o>=dk?a=5:o>=fk&&(a=2),r>=0?a*Math.pow(10,r):-Math.pow(10,-r)/a}function gk(t,e,n){var i;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if(n<=0||0===(i=function(t,e,n){return(e-t)/Math.max(1,n-1)}(t,e,n))||!isFinite(i))return[];for(var r=new Array(n),o=0;o<n;o++)r[o]=t+o*i;return r}function yk(t,e,n){var i,r,o=-1;if(n=+n,(r=(e=+e)<(t=+t))&&(i=t,t=e,e=i),!isFinite(n)||e-t<=n)return[t];for(var a=Math.floor((e-t)/n+1),s=new Array(a);++o<a;)s[o]=t+o*n;return r&&s.reverse(),s}function mk(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=0,o=t.length-1,a=t[r],s=t[o],l=10;for(s<a&&(n=a,a=s,s=n,n=r,r=o,o=n);l-- >0;){if((n=vk(a,s,i))===e)return t[r]=a,t[o]=s,t;if(n>0)a=Math.floor(a/n)*n,s=Math.ceil(s/n)*n;else{if(!(n<0))break;a=Math.ceil(a*n)/n,s=Math.floor(s*n)/n}e=n}}function bk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var wk=function(t){Ke(n,t);var e=bk(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).type=Y_.Linear,t}return Se(n,[{key:"clone",value:function(){return(new n).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}},{key:"tickFormat",value:function(){return function(){}}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return pk(e[0],e[e.length-1],t)}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return gk(e[0],e[e.length-1],t)}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return yk(e[0],e[e.length-1],t)}},{key:"nice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=mk(this.domain(),t);return e?this.domain(e):this}},{key:"niceMin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this._domain[this._domain.length-1],n=mk(this.domain(),t);return n&&(n[n.length-1]=e,this.domain(n)),this}},{key:"niceMax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this._domain[0],n=mk(this.domain(),t);return n&&(n[0]=e,this.domain(n)),this}}]),n}(hk);function xk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Ck=function(t){Ke(n,t);var e=xk(n);function n(t){var i;return Ae(this,n),(i=e.call(this,!1)).type=Y_.Point,i._padding=0,i.paddingInner(1,t),i.padding=i.paddingOuter,i.paddingInner=void 0,i.paddingOuter=void 0,i}return Se(n)}(ak);const _k=new Ck,kk=new wk;function Sk(t,e,n,i,r,o,a,s,l,u){const h=P_(u,r,o);t||((t=new n_({x:n,y:i,width:a,height:s,fill:!0,stroke:!0,lineWidth:h?.group?.lineWidth??void 0,fillColor:h?.group?.fillColor??void 0,strokeColor:h?.group?.strokeColor??void 0,strokeArrayWidth:h?.group?.strokeArrayWidth??void 0,strokeArrayColor:h?.group?.strokeArrayColor??void 0,cursor:h?.group?.cursor??void 0,lineCap:"square",clip:!0})).role="cell",t.col=r,t.row=o,e.addChild(t));const c=function(t,e,n,i,r,o){let a,s;const l=o.internalProps.layoutMap.getBody(t,e).sparklineSpec,u=o.getCellValue(t,e);if(!Array.isArray(u))return;const h=r[3],c=r[0];n-=r[1]+r[3],i-=r[0]+r[2];const d=0,f=i;if("function"==typeof l){const r={col:t,row:e,dataValue:o.getCellOriginValue(t,e)||"",value:o.getCellValue(t,e)||"",rect:o.getCellRangeRelativeRect(o.getCellRange(t,e)),table:o};a=l(r),s=Ak(a,h,c,n,i)}else a=l,s=Ak(l,h,c,n,i);const p=[],v=[];let g,y;if("object"==typeof a.xField)_k.domain(a.xField.domain),g=a.xField.field;else if("string"==typeof a.xField){const t=u.map((t=>t[a.xField]));_k.domain(t),g=a.xField}if(_k.range([0,n]),"object"==typeof a.yField)kk.domain(a.yField.domain),y=a.yField.field;else if("string"==typeof a.yField){const t=u.map((t=>t[a.yField]));kk.domain([Math.min(...t),Math.max(...t)]),y=a.yField}if(kk.range([0,i]),"object"==typeof a.xField&&Array.isArray(a.xField.domain)){const t=u.map((t=>t[a.xField.field])),e=a.xField.domain;for(let n=0;n<e.length;n++){let i=!1;for(let r=0;r<t.length;r++)if(e[n]==t[r]){const t=u[r];if(!_(t[g])||!_(t[y]))break;p.push({x:d+_k.scale(t[g]),y:f-kk.scale(t[y]),defined:_(t[y])}),v.push(t),i=!0;break}i||(p.push({x:d+_k.scale(e[n]),y:0,defined:!1}),v.push({[g]:e[n],[y]:null}))}}else for(let t=0;t<u.length;t++){const e=u[t];p.push({x:d+_k.scale(e[g]),y:f-kk.scale(e[y]),defined:_(e[y]),rawData:e}),v.push(e)}const m=s.getChildByName("sparkline-line");m&&m.setAttribute("points",p);m.bandwidth=_k.step(),m.min=kk.range()[0],m.max=kk.range()[1];const b=s.getChildByName("sparkline-symbol-group");if(b){const t=a.symbol.visible&&"isolatedPoint"===a.pointShowRule;if(a.symbol.visible&&"all"===a.pointShowRule)for(let t=0;t<p.length;t++){const{x:e,y:n,defined:i}=p[t];if(i){const t=Nv({x:e,y:n});b.appendChild(t)}}else if(t)for(let t=0;t<p.length;t++){const{x:e,y:n,defined:i}=p[t];if(i&&(!p[t-1]||!p[t-1].defined)&&(!p[t+1]||!p[t+1].defined)){const t=Nv({x:e,y:n});b.appendChild(t)}}}return s}(r,o,a,s,l,u);return c&&t.appendChild(c),t}function Ak(t,e,n,i,r){let o;o="function"==typeof t?t(null):t;const a=new n_({x:e,y:n,width:i,height:r});if(a.name="sparkline","line"===o.type){const t=jv({x:0,y:0,curveType:o.smooth||"monotone"===o.line.style.interpolate?"monotoneX":"linear",strokeColor:o.line.style.stroke,lineWidth:o.line.style.strokeWidth});t.name="sparkline-line",a.addChild(t),t.hover=o.crosshair.style;const e=new n_({x:0,y:0,width:i,height:r});e.name="sparkline-symbol-group",e.setTheme({symbol:{fill:!0,stroke:!0,strokeColor:o.symbol.style.stroke,lineWidth:o.symbol.style.strokeWidth,fillColor:o.symbol.style.fill,size:2*o.symbol.style.size,symbolType:"circle"}}),a.addChild(e),e.hover=o.symbol.state.hover}return a}const Bk=F_();function Rk(t,e,n,i,r,o,a,s,l,u,h,c,d,f,p,v,g,y,m,b,w){let x;if("text"===t||"link"===t){if("link"===t){const o=n.getCellValue(i,r),a=n._getCellStyle(i,r);"link"===t&&("templateLink"in e&&e.templateLink||!("linkDetect"in e)||!e.linkDetect||Vn.test(o))&&(w?(w.text.fillColor=i_("linkColor",a,i,r,n),w.group.cursor="pointer"):w={text:{fillColor:i_("linkColor",a,i,r,n)},group:{cursor:"pointer"}})}if(a){const t=n.getCellOriginValue(i,r),e=a(n,t);e&&(w?w.group.fillColor=e:w={group:{fillColor:e}})}let C,_=!0;if(l||s){const{autoRowHeight:t}=n.internalProps,e=__(l,s,i,r,n.getColWidth(i),n.getRowHeight(r),!1,t,n);C=e.elementsGroup,_=e.renderDefault}x=M_(n,c,0,d,i,r,o,u,h,f,p,v,g,y,_,w),m&&(x.mergeCol=b.end.col,x.mergeRow=b.end.row),C&&(x.appendChild(C),x.setAttributes({width:Math.max(x.attribute.width,C.attribute.width),height:Math.max(x.attribute.height,C.attribute.height)}))}else if("image"===t)x=function(t,e,n,i,r,o,a,s,l,u,h,c,d,f){f=P_(d,i,r,f);const p=o_("padding",d._getCellStyle(i,r),i,r,d);_(p)&&(u=p),f?.text?.textAlign&&(h=f?.text?.textAlign),f?.text?.textBaseline&&(c=f?.text?.textBaseline);const v=new n_({x:e,y:n,width:o,height:a,fill:!0,stroke:!0,lineWidth:f?.group?.lineWidth??void 0,fillColor:f?.group?.fillColor??void 0,strokeColor:f?.group?.strokeColor??void 0,strokeArrayWidth:f?.group?.strokeArrayWidth??void 0,strokeArrayColor:f?.group?.strokeArrayColor??void 0,cursor:f?.group?.cursor??void 0,lineCap:"square",clip:!0});v.role="cell",v.col=i,v.row=r,t.addChild(v);const g=d.getCellValue(i,r),y=Gv({x:u[3],y:u[0],width:o-u[1]-u[3],height:a-u[0]-u[2],image:g??G_.damage_pic.svg,cursor:"pointer"});return y.name="image",y.keepAspectRatio=s,y.successCallback=s||l?()=>{const t=y.resources.get(y.attribute.image).data;if(l&&U_(i,r,t.width,t.height,d.scenegraph,u),s){const{width:e,height:n}=z_(t.width,t.height,v.attribute.width-u[1]-u[3],v.attribute.height-u[0]-u[2]),i=N_(0,0,v.attribute.width,v.attribute.height,e,n,h,c,u);y.setAttributes({x:i.x,y:i.y,width:e,height:n})}d.scenegraph.updateNextFrame()}:()=>{V_(v,i,r,d)},y.failCallback=()=>{const t=F_();y.image=t.damage_pic.svg},v.appendChild(y),v}(c,0,d,i,r,n.getColWidth(i),n.getRowHeight(r),e.keepAspectRatio,e.imageAutoSizing,f,p,v,n,w);else if("video"===t)x=function(t,e,n,i,r,o,a,s,l,u,h,c,d,f){f=P_(d,i,r,f);const p=o_("padding",d._getCellStyle(i,r),i,r,d);_(p)&&(u=p),f?.text?.textAlign&&(h=f?.text?.textAlign),f?.text?.textBaseline&&(c=f?.text?.textBaseline);const v=new n_({x:e,y:n,width:o,height:a,fill:!0,stroke:!0,lineWidth:f?.group?.lineWidth??void 0,fillColor:f?.group?.fillColor??void 0,strokeColor:f?.group?.strokeColor??void 0,strokeArrayWidth:f?.group?.strokeArrayWidth??void 0,strokeArrayColor:f?.group?.strokeArrayColor??void 0,cursor:f?.group?.cursor??void 0,lineCap:"square",clip:!0});v.role="cell",v.col=i,v.row=r,t.addChild(v);const g=d.getCellValue(i,r),y=document.createElement("video");y.addEventListener("loadeddata",(()=>{l&&U_(i,r,y.videoWidth,y.videoHeight,d.scenegraph,u);const t=v.attribute.width,e=v.attribute.height;if(s){const{width:n,height:i}=z_(y.videoWidth,y.videoHeight,t-u[1]-u[3],e-u[0]-u[2]),r=N_(0,0,t,e,n,i,h,c,u);m.setAttributes({width:n,height:i,x:r.x,y:r.y})}else m.setAttributes({x:u[3],y:u[0],width:t-u[1]-u[3],height:e-u[2]-u[0]});const n=Math.floor(Math.min(t-u[1]-u[3],e-u[2]-u[0])/2),o=0+(t>m.attribute.width?m.attribute.x-0+m.attribute.width/2:t/2),a=0+(e>m.attribute.height?m.attribute.y-0+m.attribute.height/2:e/2),f=new y_({x:o-n/2,y:a-n/2,width:n,height:n,image:Bk.play.svg,cursor:Bk.play.cursor});f.role="play-icon",v.appendChild(f),d.scenegraph.updateNextFrame()})),y.onerror=()=>{m.image=Bk.damage_pic.svg},y.src=g,y.setAttribute("preload","auto");const m=Gv({x:u[3],y:u[0],width:o-u[1]-u[3],height:a-u[2]-u[0],image:y,cursor:"pointer"});return m.name="image",v.appendChild(m),v}(c,0,d,i,r,n.getColWidth(i),n.getRowHeight(r),e.keepAspectRatio,e.imageAutoSizing,f,p,v,n,w);else if("chart"===t)x=I_(null,c,0,d,i,r,n.getColWidth(i),n.getRowHeight(r),f,n.getCellValue(i,r),e.chartType,e.chartSpec,c.attribute.chartInstance,n);else if("progressbar"===t){const t=n._getCellStyle(i,r),a=n.getCellValue(i,r),s=n.getCellOriginValue(i,r);x=M_(n,c,0,d,i,r,o,u,h,f,p,v,!1,!0,!0,w);const l=K_(e,t,o,a,s,i,r,0,n);x.insertBefore(l,x.firstChild)}else"sparkline"===t&&(x=Sk(null,c,0,d,i,r,u,h,f,n));return x}function Tk(t,e,n,i,r,o,a,s,l,u,h,c){let d,f,p,v=0,g=!1;const y=(s.isListTable()&&!s.scenegraph.transpose||s.isPivotTable()&&s.internalProps.layoutMap.indicatorsAsCol)&&"body"===l;if(y)if(t.childrenCount){if(t.theme){const n=s._getCellStyle(e,s.columnHeaderLevelCount),{hasFunctionPros:i}=Mk(n,s,e,s.columnHeaderLevelCount,r_,!1);g=i;const r=t.theme.userTheme;r._vtable.padding&&(d=r._vtable.padding),r.text.textAlign&&(f=r.text.textAlign),r.text.textBaseline&&(p=r.text.textBaseline)}}else{const{theme:i,hasFunctionPros:r}=function(t,e,n){const i=n._getCellStyle(t,n.columnHeaderLevelCount),{theme:r,hasFunctionPros:o}=Mk(i,n,t,n.columnHeaderLevelCount,r_);return r.group.width=e,r.group.height=0,{theme:r,hasFunctionPros:o}}(e,n,s);g=r,i._vtable.padding&&(d=i._vtable.padding),i.text.textAlign&&(f=i.text.textAlign),i.text.textBaseline&&(p=i.text.textBaseline),t.setTheme(i)}let m;s.internalProps?.dataConfig?.mappingRules&&"body"===l&&s.internalProps?.dataConfig?.mappingRules?.forEach(((t,e)=>{t.bgColor&&(m=t.bgColor.mapping)}));let b=0;t.lastChild?.attribute&&(b=t.lastChild.attribute.y+t.lastChild.attribute.height);for(let w=i;w<=r;w++){const i=w,r="body"!==l?s.getHeaderDefine(e,i):s.getBodyColumnDefine(e,i),x="body"!==l||!!r?.icon;let C;if(!y){C=Mk(s._getCellStyle(e,i),s,e,i,i_).theme,C.group.width=n,C.group.height=Array.isArray(a)?a[i]:a,C._vtable.padding&&(d=C._vtable.padding),C.text.textAlign&&(f=C.text.textAlign),C.text.textBaseline&&(p=C.text.textBaseline)}let _=n,k=s.internalProps.autoRowHeight?0:s.getRowHeight(i);const S=(s.isHeader(e,i)?s._getHeaderLayoutMap(e,i).headerType:s.getBodyColumnType(e,i))||"text";let A,B,R;if(("body"!==l||r?.mergeCell)&&(B=s.getCellRange(e,i),R=B.start.col!==B.end.col||B.start.row!==B.end.row,R&&(_=0,k=0,A=o.get(`${B.start.col},${B.start.row};${B.end.col},${B.end.row}`),!A))){for(let t=B.start.col;t<=B.end.col;t++)_+=s.getColWidth(t);for(let t=B.start.row;t<=B.end.row;t++)k+=s.getRowHeight(t);o.set(`${B.start.col},${B.start.row};${B.end.col},${B.end.row}`,{x:0,y:b,cellWidth:_,cellHeight:k})}if(A){const n=new n_({x:0,y:b,width:0,height:0,visible:!1,pickable:!1});n.role="shadow-cell",n.col=e,n.row=i,n.mergeCol=B.start.col,n.mergeRow=B.start.row,t.addChild(n),B=s.getCellRange(e,i),b+=A.cellHeight/(B.end.row-B.start.row+1),v=Math.max(v,A.cellWidth)}else{const o=Rk(S,r,s,e,i,n,m,h,c,_,k,t,b,d,f,p,x,g,R,B,C).attribute.height;b+=R?o/(B.end.row-B.start.row+1):o}if(u&&i>u)break}return t.setAttribute("width",n),{width:n,height:b}}function Mk(t,e,n,i,r,o=!0){const a=a_(r("padding",t,n,i,e)),s=r("bgColor",t,n,i,e),l=r("font",t,n,i,e);let u,h,c;if(l){const{family:t,size:e,weight:n}=function(t){return g_(t)}(l);u=t.join(" "),h=e,c=n}else u=r("fontFamily",t,n,i,e),h=r("fontSize",t,n,i,e),c=r("fontWeight",t,n,i,e);const d=r("textAlign",t,n,i,e),f=r("textBaseline",t,n,i,e),p=r("color",t,n,i,e),v=r("lineHeight",t,n,i,e),g=r("underline",t,n,i,e),y=r("lineThrough",t,n,i,e),m=Math.max(1,Math.floor(h/10)),b=r("textOverflow",t,n,i,e),w=r("borderColor",t,n,i,e),x=r("borderLineWidth",t,n,i,e),C=r("borderLineDash",t,n,i,e),_=r("marked",t,n,i,e),k=!(a&&s&&l&&d&&f&&p&&b&&w&&x&&C&&"boolean"==typeof g&&"boolean"==typeof y&&"boolean"==typeof _);if(!o)return{hasFunctionPros:k};const S={text:{fontFamily:u,fontSize:h,fontWeight:c,fillColor:p,textAlign:d,textBaseline:f,lineHeight:v??h,underline:g?m:void 0,lineThrough:y?m:void 0,ellipsis:b&&"clip"!==b?"ellipsis"===b?"...":b:void 0},group:{fillColor:s,lineDash:C,lineWidth:x,strokeColor:w},_vtable:{padding:a,marked:_}};return Array.isArray(x)&&(S.group.strokeArrayWidth=a_(x)),Array.isArray(w)&&(S.group.strokeArrayColor=a_(w)),{theme:S,hasFunctionPros:k}}function Pk(t,e,n,i,r,o,a,s,l,u){if(i>r||o>a)return;const{layoutMap:h,defaultRowHeight:c,defaultHeaderRowHeight:d,defaultColWidth:f}=l.internalProps,p=new Map;let v=0,g=0;for(let h=i;h<=r;h++){const i=h,r=l.getColWidth(i),f=new n_({x:e+v,y:n,width:r,height:0,clip:!1,pickable:!1});let y,m;if(f.role="column",f.col=h,t.addChild(f),"body"!==s){const t=l.getHeaderDefine(i,o);y=t?.headerCustomRender,m=t?.headerCustomLayout}else{const t=l.getBodyColumnDefine(i,o);y=t?.customRender||l.customRender,m=t?.customLayout}const{width:b,height:w}=Tk(f,i,r,o,a,p,"columnHeader"===s?d??c:c,l,s,u,y,m);v+=b,g=Math.max(g,w)}t.setAttribute("width",v),t.setAttribute("height",g)}function Ok(t,e,n,i,r,o,a){let s,l;const u=A_(t.table,n,i);if(u&&u.end.col-u.start.col&&u.start.col===n){const e=t.getCell(u.start.col,u.start.row),n=e.attribute.height;e.setAttribute("height",n+o),s=e,l=e.attribute.height}else u?(e.setAttribute("height",r+o),s=e,l=r+o):u||(e.setAttribute("height",r+o),s=e,l=r+o);s&&Hk(t,s,n,i,l,o,a)}function Ek(t,e,n,i,r,o,a){let s;const l=A_(t.table,n,i);if(l&&l.end.row-l.start.row){if(e=t.getCell(l.start.col,l.start.row),i===l.start.row)return void(e._tempHeight=r);if(i!==l.end.row)return void(e._tempHeight+=r);e.setAttribute("height",e._tempHeight+r),s=e,r=e.attribute.height}else l?((e=t.getCell(l.start.col,l.start.row)).setAttribute("height",r),s=e):(e.setAttribute("height",r),s=e);Hk(t,s,n,i,r,0,a)}function Hk(t,e,n,i,r,o,a){const s=t.table.isHeader(n,i)?t.table._getHeaderLayoutMap(n,i).headerType:t.table.getBodyColumnType(n,i);if("progressbar"===s){const r=t.table.getBodyColumnDefine(n,i),o=t.table._getCellStyle(n,i),a=t.table.getCellValue(n,i),s=t.table.getCellOriginValue(n,i),l=(a_(i_("padding",o,n,i,t.table)),K_(r,o,e.attribute.width,a,s,n,i,0,t.table)),u=e.getChildByName("progress-bar");e.insertBefore(l,u),e.removeChild(u),u.removeAllChild(),u.release()}else if("sparkline"===s){e.removeAllChild();const r=a_(i_("padding",t.table._getCellStyle(n,i),n,i,t.table));Sk(e,e.parent,e.attribute.x,e.attribute.y,n,i,e.attribute.width,e.attribute.height,r,t.table)}else if("image"===s||"video"===s)V_(e,n,i,t.table);else{const o=t.table._getCellStyle(n,i);!function(t,e,n,i,r,o,a){const s=e-(r[0]+r[2]),l=t.getChildByName("text");l instanceof C_&&!i?l.setAttribute("heightLimit",s):l instanceof Nh&&!i?l.setAttribute("height",s):t.getChildByName("content")&&t.getChildByName("content").updateHeight(s);t.forEachChildren((t=>{"rect"===t.type||("mark"===t.name?t.setAttribute("y",0):"middle"===a?t.setAttribute("y",r[0]+(s-t.AABBBounds.height())/2):"bottom"===a?t.setAttribute("y",r[0]+s-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}(e,r,0,t.table.internalProps.autoRowHeight,a_(o.padding),o.textAlign,o.textBaseline);const a=e.getChildByName("custom-container");if(a){let r,o;a.clear(),e.removeChild(a);if("body"!==t.table.getCellType(n,i)){const e=t.table.getHeaderDefine(n,i);r=e?.headerCustomRender,o=e?.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(n,i);r=e?.customRender||t.table.customRender,o=e?.customLayout}const s=__(o,r,n,i,e.attribute.width,e.attribute.height,!1,!1,t.table);e.appendChild(s.elementsGroup)}}}function Lk(t,e,n,i,r,o,a){const s=A_(e.table,n,i);s&&s.end.row-s.start.row?(t=e.getCell(s.start.col,s.start.row),i===s.start.row&&t.setAttribute("y",o),Ek(e,t,n,i,r,0,e.table.isHeader(n,i))):"shadow-cell"!==t.role&&(t.setAttribute("y",o),Ek(e,t,n,i,r,0,e.table.isHeader(n,i)))}function Ik(t,e,n,i,r,o,a,s){let l,u;const h=A_(t.table,n,i);if(h&&h.end.col-h.start.col){const e=t.getCell(h.start.col,h.start.row),r=e.attribute.width;e.setAttribute("width",r+o),l=e,u=e.attribute.width,n=l.col,i=l.row}else h&&h.start.row===i?(e.setAttribute("width",r+o),l=e,u=r+o,n=l.col,i=l.row):h||(e.setAttribute("width",r+o),l=e,u=r+o);if(!l)return!1;const c=t.table.isHeader(n,i)?t.table._getHeaderLayoutMap(n,i).headerType:t.table.getBodyColumnType(n,i);let d=!1;if("progressbar"===c){const e=t.table.getBodyColumnDefine(n,i),r=t.table._getCellStyle(n,i),o=t.table.getCellValue(n,i),a=t.table.getCellOriginValue(n,i),s=(a_(i_("padding",r,n,i,t.table)),K_(e,r,l.attribute.width,o,a,n,i,0,t.table)),u=l.getChildByName("progress-bar");l.insertBefore(s,u),l.removeChild(u),u.removeAllChild(),u.release()}else if("sparkline"===c){l.removeAllChild();const e=a_(i_("padding",t.table._getCellStyle(n,i),n,i,t.table));Sk(l,l.parent,l.attribute.x,l.attribute.y,n,i,l.attribute.width,l.attribute.height,e,t.table)}else if("image"===c||"video"===c)V_(l,n,i,t.table);else{const e=t.table._getCellStyle(n,i);d=T_(l,u,o,s,a_(e.padding),e.textAlign,e.textBaseline,t)}return d}function Dk(t,e){let n=0;for(let i=0;i<t.table.colCount;i++){let r=jk(t.getCell(i,e),t);const o=A_(t.table,i,e);o&&o.end.row-o.start.row&&(r/=o.end.row-o.start.row+1),n=Math.max(n,r)}for(let i=0;i<t.table.colCount;i++){let r=n;const o=t.getCell(i,e),a=A_(t.table,i,e);if(a&&a.end.row-a.start.row)for(let n=a.start.row;n<=a.end.row;n++)n!==e&&(r+=t.table.getRowHeight(n));Ok(t,o,i,e,r,0,t.table.isHeader(i,e))}const i=n-t.table.getRowHeight(e);let r=0,o=0;e<t.table.columnHeaderLevelCount?(r=e+1,o=t.table.columnHeaderLevelCount-1):(r=e+1,o=t.table.rowCount-1);for(let e=r;e<=o;e++)for(let n=0;n<t.table.colCount;n++){const r=t.getCell(n,e),o=A_(t.table,n,e);(!o||o.start.col===n&&o.start.row===e)&&r.setAttribute("y",r.attribute.y+i)}t.updateContainerHeight(e,i),t.table.setRowHeight(e,n,!0)}function jk(t,e){let n=0;t.forEachChildren((t=>{"icon-left"!==t.role&&"icon-right"!==t.role&&"text"!==t.name&&"content"!==t.name||(n=Math.max(n,t.AABBBounds.height()))}));const i=a_(e.table._getCellStyle(t.col,t.row).padding);return n+i[0]+i[2]}function Wk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Fk=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex"],zk=function(t){Ke(n,t);var e=Wk(n);function n(t){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return Ae(this,n),(i=e.call(this,t)).mode=r,i.setTheme({common:{strokeBoundsBuffer:0}}),i.attribute=t,i.onSetStage((function(){i.render(),i.bindEvents()})),i}return Se(n,[{key:"setAttribute",value:function(t,e,n){It(this.attribute[t])?te(this.attribute[t],e):this.attribute[t]=e,Fk.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"setAttributes",value:function(t,e){var n=Object.keys(t);this._mergeAttributes(t,n),n.every((function(t){return Fk.includes(t)}))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"_mergeAttributes",value:function(t,e){Ot(e)&&(e=Object.keys(t));for(var n=0;n<e.length;n++){var i=e[n];It(this.attribute[i])?te(this.attribute[i],t[i]):this.attribute[i]=t[i]}}},{key:"bindEvents",value:function(){}},{key:"_getNodeId",value:function(t){return"".concat(this.id,"-").concat(this.name,"-").concat(t)}}]),n}(oc);function Nk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var Gk=function(t){Ke(n,t);var e=Nk(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="scrollbar",i._onRailPointerDown=function(t){var e,n,r,o=t.viewX,a=t.viewY,s=i.attribute,l=s.direction,u=s.width,h=s.height,c=s.range,d=i._sliderSize,f=ve(i._getScrollRange(),2),p=f[0],v=f[1];if("vertical"===l){var g=a-i._viewPosition.y,y=pe(g-d/2,p,v);r=g/h,i._slider.setAttribute("y",y,!0)}else{var m=o-i._viewPosition.x,b=pe(m-d/2,p,v);r=m/u,i._slider.setAttribute("x",b,!0)}i.setScrollRange([r-(c[1]-c[0])/2,r+(c[1]-c[0])/2],!1),(null===(e=i.stage)||void 0===e?void 0:e.autoRender)||null===(n=i.stage)||void 0===n||n.renderNextFrame()},i._onSliderPointerDown=function(t){t.stopPropagation();var e=i.attribute.direction;i._prePos="horizontal"===e?t.clientX:t.clientY,"browser"===TC.env?(TC.addEventListener("pointermove",i._onSliderPointerMove),TC.addEventListener("pointerup",i._onSliderPointerUp)):(i._slider.addEventListener("pointermove",i._onSliderPointerMove),i._slider.addEventListener("pointerup",i._onSliderPointerUp),i._slider.addEventListener("pointerupoutside",i._onSliderPointerUp))},i._onSliderPointerMove=function(t){t.stopPropagation();var e,n,r=i.attribute.direction,o=i.getScrollRange(),a=i._getSliderRenderBounds(),s=a.width,l=a.height;"vertical"===r?e=((n=t.clientY)-i._prePos)/l:e=((n=t.clientX)-i._prePos)/s,i.setScrollRange([o[0]+e,o[1]+e],!0),i._prePos=n},i._onSliderPointerUp=function(t){t.preventDefault(),"browser"===TC.env?(TC.removeEventListener("pointermove",i._onSliderPointerMove),TC.removeEventListener("pointerup",i._onSliderPointerUp)):(i._slider.removeEventListener("pointermove",i._onSliderPointerMove),i._slider.removeEventListener("pointerup",i._onSliderPointerUp),i._slider.removeEventListener("pointerupoutside",i._onSliderPointerUp))},i}return Se(n,[{key:"setScrollRange",value:function(t){var e,n,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.attribute,o=r.direction,a=void 0===o?"horizontal":o,s=r.limitRange,l=void 0===s?[0,1]:s,u=r.range,h=ge(t,l[0],l[1]);if(i){var c=this._getSliderPos(h);this._slider&&("horizontal"===a?this._slider.setAttribute("x",c[0],!0):this._slider.setAttribute("y",c[0],!0),(null===(e=this.stage)||void 0===e?void 0:e.autoRender)||null===(n=this.stage)||void 0===n||n.renderNextFrame())}this.attribute.range=h,this._onChange({pre:u,value:h})}},{key:"getScrollRange",value:function(){return this.attribute.range}},{key:"bindEvents",value:function(){this._rail&&this._rail.addEventListener("pointerdown",this._onRailPointerDown),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}},{key:"render",value:function(){this._reset();var t=this.attribute,e=t.direction,n=void 0===e?"horizontal":e,i=t.width,r=t.height,o=t.range,a=t.limitRange,s=void 0===a?[0,1]:a,l=t.railStyle,u=t.sliderStyle,h=t.padding,c=void 0===h?2:h,d=this.createOrUpdateChild("scrollbar-container",{},"group"),f=d.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:r},l),"rect");this._rail=f;var p,v=this._getSliderRenderBounds(),g=this._getSliderPos(ge(o,s[0],s[1])),y=g[1]-g[0];this._sliderSize=y,p="horizontal"===n?{x:g[0],y:v.y1,width:y,height:v.height}:{x:v.x1,y:g[0],width:v.width,height:y};var m=d.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{borderRadius:this._getDefaultSliderBorderRadius()}),u),{boundsPadding:In(c),pickMode:"imprecise"}),"rect");this._slider=m,this._container=d;var b=this._container.AABBBounds;this._viewPosition={x:b.x1,y:b.y1}}},{key:"_getSliderRenderBounds",value:function(){if(this._sliderRenderBounds)return this._sliderRenderBounds;var t=this.attribute,e=t.width,n=t.height,i=t.padding,r=ve(In(void 0===i?2:i),4),o=r[0],a=r[1],s=r[2],l=r[3],u={x1:l,y1:o,x2:e-a,y2:n-s,width:e-(l+a),height:n-(o+s)};return this._sliderRenderBounds=u,u}},{key:"_getDefaultSliderBorderRadius",value:function(){var t=this.attribute,e=t.direction;if(t.round){var n=this._getSliderRenderBounds(),i=n.width,r=n.height;return"horizontal"===e?r:i}return 0}},{key:"_getSliderPos",value:function(t){var e=this.attribute.direction,n=this._getSliderRenderBounds(),i=n.width,r=n.height,o=n.x1,a=n.y1;return"horizontal"===e?[i*t[0]+o,i*t[1]+o]:[r*t[0]+a,r*t[1]+a]}},{key:"_getScrollRange",value:function(){if(this._sliderLimitRange)return this._sliderLimitRange;var t=this.attribute,e=t.limitRange,n=void 0===e?[0,1]:e,i=t.direction,r=ve(ge(n,0,1),2),o=r[0],a=r[1],s=this._getSliderRenderBounds(),l=s.width,u=s.height,h=s.x1,c=s.y1,d=this._sliderSize;return"horizontal"===i?ge([h+o*l,h+a*l],h,l-d):ge([c+o*u,c+a*u],c,u-d)}},{key:"_onChange",value:function(t){var e,n=new Is("scroll",t);n.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(n)}},{key:"_reset",value:function(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}]),n}(zk);function Uk(t,e){t.forEachChildren((function(t){var n=e(t);t.isContainer&&!n&&Uk(t,e)}))}Gk.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:!0,fillColor:"rgba(0, 0, 0, .5)"},railStyle:{fill:!0,fillColor:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1]};var Vk=function(t){return!Ot(t)&&!1!==t.visible},Kk=["#ffffff","#000000"];function Yk(t,e,n,i,r){var o=Zk(t),a=Zk(e);return Xk(o,a,n,i)?o:function(t,e,n,i,r){var o=[];r&&(r instanceof Array?o.push.apply(o,ie(r)):o.push(r)),o.push.apply(o,Kk);for(var a=0,s=o;a<s.length;a++){var l=s[a];if(t!==l&&Xk(l,e,n,i))return l}}(o,a,n,i,r)}function Xk(t,e,n,i){return i?$k(t,e)>i:"largeText"===n?$k(t,e)>3:$k(t,e)>4.5}function $k(t,e){var n=qk(t),i=qk(e);return((n>i?n:i)+.05)/((n>i?i:n)+.05)}function qk(t){var e=yn(t),n=e[0]/255,i=e[1]/255,r=e[2]/255;return.2126*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))}function Zk(t){if(null==t?void 0:t.includes("#"))return t;var e=new vn(t).color;return"#"+mn(e.r,e.g,e.b)}var Jk=1e-6,Qk="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function tS(){var t=new Qk(9);return Qk!=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}function eS(){var t=new Qk(3);return Qk!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function nS(t){var e=t[0],n=t[1],i=t[2];return Math.hypot(e,n,i)}function iS(t,e,n){var i=new Qk(3);return i[0]=t,i[1]=e,i[2]=n,i}function rS(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;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 oS(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function aS(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=r*l-o*s,t[1]=o*a-i*l,t[2]=i*s-r*a,t}var sS,lS=nS;sS=eS();function uS(){var t=new Qk(4);return Qk!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function hS(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=o*a,t}!function(){var t=uS()}();function cS(){var t=new Qk(4);return Qk!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function dS(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function fS(t,e,n,i){var r,o,a,s,l,u=e[0],h=e[1],c=e[2],d=e[3],f=n[0],p=n[1],v=n[2],g=n[3];return(o=u*f+h*p+c*v+d*g)<0&&(o=-o,f=-f,p=-p,v=-v,g=-g),1-o>Jk?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,l=Math.sin(i*r)/a):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*h+l*p,t[2]=s*c+l*v,t[3]=s*d+l*g,t}function pS(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,a=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*a+a]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[a]=(e[3*a+r]+e[3*r+a])*n}return t}var vS,gS,yS,mS,bS,wS,xS=hS;vS=eS(),gS=iS(1,0,0),yS=iS(0,1,0),mS=cS(),bS=cS(),wS=tS();function CS(){var t=new Qk(2);return Qk!=Float32Array&&(t[0]=0,t[1]=0),t}function _S(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function kS(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function SS(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t}function AS(t,e){var n=t[0],i=t[1],r=e[0],o=e[1],a=Math.sqrt(n*n+i*i)*Math.sqrt(r*r+o*o),s=a&&(n*r+i*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}var BS;!function(){var t=CS()}();function RS(t,e,n){var i=AS(t,e),r=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return n?r?2*Math.PI-i:i:r?i:2*Math.PI-i}var TS,MS=-.5*Math.PI,PS=1.5*Math.PI,OS="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(TS||(TS={}));var ES=(Bs(BS={},TS.selectedReverse,{}),Bs(BS,TS.selected,{}),Bs(BS,TS.hover,{}),Bs(BS,TS.hoverReverse,{}),BS),HS=function(t,e,n){return new Ln(Object.assign({defaultFontParams:{fontFamily:OS,fontSize:11},getTextBounds:n?void 0:Rg,specialCharSet:"-/: .,@%'\"~"+Ln.ALPHABET_CHAR_SET+Ln.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)};function LS(t,e){var n,i;if(!t)return{width:0,height:0};var r=Rg({text:t,fontFamily:null!==(n=e.fontFamily)&&void 0!==n?n:"",fontSize:e.fontSize||12,fontWeight:e.fontWeight,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||12});return{width:r.width(),height:r.height()}}function IS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var DS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},jS=function(t){Ke(n,t);var e=IS(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="tag",i}return Se(n,[{key:"render",value:function(){var t,e,n=this.attribute,i=n.text,r=void 0===i?"":i,o=n.textStyle,a=void 0===o?{}:o,s=n.shape,l=void 0===s?{}:s,u=n.panel,h=void 0===u?{}:u,c=n.space,d=void 0===c?4:c,f=n.minWidth,p=n.maxWidth,v=n.padding,g=void 0===v?4:v,y=n.visible,m=n.state,b=In(g),w=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group"),x=b[1]+b[3],C=b[0]+b[2],_=0,k=0,S=l.visible,A=DS(l,["visible"]);if(Mt(S)){var B=(null==A?void 0:A.size)||10,R=Nt(B)?B:Math.max(B[0],B[1]);e=w.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:B,strokeBoundsBuffer:0},A),{visible:S,x:R/2,y:R/2}),"symbol"),Kt(null==m?void 0:m.shape)||(e.states=m.shape),S&&(k=R+d)}x+=k,_+=k;var T=Object.assign(Object.assign({text:r,visible:Et(r)&&!1!==y,lineHeight:null==a?void 0:a.fontSize},a),{x:_,y:0});Ot(T.lineHeight)&&(T.lineHeight=T.fontSize);var M=w.createOrUpdateChild("tag-text",T,"text");Kt(null==m?void 0:m.text)||(M.states=m.text);var P=LS(T.text,a),O=P.width,E=P.height;x+=O;var H=null!==(t=l.size)&&void 0!==t?t:10,L=Nt(H)?H:Math.max(H[0],H[1]);C+=Math.max(E,(null==l?void 0:l.visible)?L:0);var I=a.textAlign,D=a.textBaseline;(Et(f)||Et(p))&&(Et(f)&&x<f&&(x=f),Et(p)&&x>p&&(x=p,M.setAttribute("maxLineWidth",p-b[1]-b[2])));var j=0,W=0;"center"===I?(j-=x/2,e&&e.setAttribute("x",(e.attribute.x||0)-O/2),w.setAttribute("x",-k/2)):"right"===I||"end"===I?(j-=x,e&&e.setAttribute("x",(e.attribute.x||0)-O),w.setAttribute("x",-b[1]-k)):"left"!==I&&"start"!==I||w.setAttribute("x",b[3]),"middle"===D?(W-=C/2,e&&e.setAttribute("y",0)):"bottom"===D?(W-=C,e&&e.setAttribute("y",-E/2),w.setAttribute("y",-b[2])):"top"===D&&(w.setAttribute("y",b[0]),e&&e.setAttribute("y",E/2));var F=h.visible,z=DS(h,["visible"]);if(Mt(F)){var N=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:F&&!!r,x:j,y:W,width:x,height:C}),"rect");Kt(null==m?void 0:m.panel)||(N.states=m.panel)}}}]),n}(zk);function WS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}jS.defaultAttributes={visible:!0,textStyle:{fontSize:12,fillColor:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fillColor:"#000"}};var FS=function(t){Ke(n,t);var e=WS(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).name="crosshair",t}return Se(n,[{key:"render",value:function(){this.renderCrosshair(this)}}]),n}(zk);function zS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var NS=function(t){Ke(n,t);var e=zS(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderCrosshair",value:function(t){var e=this.attribute,n=e.start,i=e.end,r=e.lineStyle;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[n,i]},r),"line")}},{key:"setLocation",value:function(t){var e=t.start,n=t.end;this.setAttributes({start:e,end:n})}}]),n}(FS);function GS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}NS.defaultAttributes={lineStyle:{stroke:!0,strokeColor:"#b2bacf",lineWidth:1,lineDash:[2]}};var US=function(t){Ke(n,t);var e=GS(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderCrosshair",value:function(t){var e=this.attribute,n=e.start,i=e.end,r=e.rectStyle;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:n.x,y:n.y,width:i.x-n.x,height:i.y-n.y},r),"rect")}},{key:"setLocation",value:function(t){var e=t.start,n=t.end;this.setAttributes({start:e,end:n})}}]),n}(FS);function VS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}US.defaultAttributes={rectStyle:{fillColor:"#b2bacf",opacity:.2}};var KS=function(t){Ke(n,t);var e=VS(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderCrosshair",value:function(t){var e=this.attribute,n=e.center,i=e.radius,r=e.lineStyle;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},n),{outerRadius:i}),this.attribute),r),"arc")}},{key:"setLocation",value:function(t){var e=this.attribute.center,n=Ue.distancePP(t,e);this.setAttribute("radius",n)}}]),n}(FS);function YS(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}KS.defaultAttributes={lineStyle:{stroke:[!0,!1,!1,!1],strokeColor:"#b2bacf",lineWidth:1,lineDash:[2]}};var XS=function(t){Ke(n,t);var e=YS(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderCrosshair",value:function(t){var e=this.attribute,n=e.center,i=e.radius,r=e.innerRadius,o=void 0===r?0:r,a=e.sectorStyle,s=this.attribute,l=s.startAngle,u=s.endAngle;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},n),{outerRadius:i,innerRadius:o,startAngle:l,endAngle:u}),a),"arc")}},{key:"setLocation",value:function(t){var e=this.attribute,n=e.center,i=e.startAngle,r=void 0===i?MS:i,o=e.endAngle,a=(void 0===o?PS:o)-r,s=en(on(n,t));this.setAttributes({startAngle:s-a/2,endAngle:s+a/2})}}]),n}(FS);function $S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}XS.defaultAttributes={sectorStyle:{fillColor:"#b2bacf",opacity:.2}};var qS=function(t){Ke(n,t);var e=$S(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderCrosshair",value:function(t){for(var e,n=this.attribute,i=n.center,r=n.radius,o=n.sides,a=void 0===o?6:o,s=n.lineStyle,l=this.attribute,u=l.startAngle,h=l.endAngle,c=(h-u)%(2*Math.PI)==0,d=(h-u)/a,f=0;f<=a;f++){var p=rn(i,r,u+d*f);0===f?e="M".concat(p.x,",").concat(p.y):e+="L".concat(p.x,",").concat(p.y),f===a&&c&&(e+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:e},s),"path")}},{key:"setLocation",value:function(t){var e=this.attribute.center,n=Ue.distancePP(t,e);this.setAttribute("radius",n)}}]),n}(FS);qS.defaultAttributes={lineStyle:{stroke:!0,strokeColor:"#b2bacf",lineWidth:1,lineDash:[2]}};var ZS=new Uint32Array(33),JS=new Uint32Array(33);JS[0]=0,ZS[0]=~JS[0];for(var QS=1;QS<=32;++QS)JS[QS]=JS[QS-1]<<1|1,ZS[QS]=~JS[QS];function tA(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),o=~~((e+2*n+i)/i),a=function(t){return~~((t+n)/i)};return a.invert=function(t){return t*i-n},a.bitmap=function(){return function(t,e){var n=new Uint32Array(~~((t*e+32)/32));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:function(e,i){var r=i*t+e;return n[r>>>5]&1<<(31&r)},set:function(e,n){var r=n*t+e;i(r>>>5,1<<(31&r))},clear:function(e,n){var i=n*t+e;r(i>>>5,~(1<<(31&i)))},getRange:function(e){for(var i,r,o,a,s=e.x1,l=e.y1,u=e.x2,h=e.y2;h>=l;--h)if((o=(i=h*t+s)>>>5)==(a=(r=h*t+u)>>>5)){if(n[o]&ZS[31&i]&JS[1+(31&r)])return!0}else{if(n[o]&ZS[31&i])return!0;if(n[a]&JS[1+(31&r)])return!0;for(var c=o+1;c<a;++c)if(n[c])return!0}return!1},setRange:function(e){for(var n,r,o,a,s,l=e.x1,u=e.y1,h=e.x2,c=e.y2;u<=c;++u)if((o=(n=u*t+l)>>>5)==(a=(r=u*t+h)>>>5))i(o,ZS[31&n]&JS[1+(31&r)]);else for(i(o,ZS[31&n]),i(a,JS[1+(31&r)]),s=o+1;s<a;++s)i(s,4294967295)},clearRange:function(e){for(var n,i,o,a,s,l=e.x1,u=e.y1,h=e.x2,c=e.y2;u<=c;++u)if((o=(n=u*t+l)>>>5)==(a=(i=u*t+h)>>>5))r(o,JS[31&n]|ZS[1+(31&i)]);else for(r(o,JS[31&n]),r(a,ZS[1+(31&i)]),s=o+1;s<a;++s)r(s,0)},outOfBounds:function(n){var i=n.x1,r=n.y1,o=n.x2,a=n.y2;return i<0||r<0||a>=e||o>=t},toImageData:function(i){for(var r=i.createImageData(t,e),o=r.data,a=0;a<e;++a)for(var s=0;s<t;++s){var l=a*t+s,u=4*l,h=n[l>>>5]&1<<(31&l);o[u+0]=255*h,o[u+1]=255*h,o[u+2]=255*h,o[u+3]=31}return r}}}(r,o)},a.ratio=i,a.padding=n,a.width=t,a.height=e,a}function eA(t,e){return{x1:t(e.x1),x2:t(e.x2),y1:t(e.y1),y2:t(e.y2)}}function nA(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=eA(t,n);return!(i&&e.outOfBounds(r)||e.getRange(r))}function iA(t,e){return!(!t||!e)&&e.encloses(t)}function rA(t,e,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=0;o<i.length;o++){var a=zv(n.attribute);if(a.setAttributes(i[o]),a.update(),nA(t,e,eA(t,a.AABBBounds),r))return e.setRange(eA(t,a.AABBBounds)),n.setAttributes(i[o]),!0}}function oA(t,e,n,i,r,o,a){var s,l,u,h;if("bound"===n.type||"position"===n.type){if(Pt(a)){var c=((Pt(n.position)?n.position(r.attribute):n.position)||(h=i.type,"rect"===h?sA:aA)).map((function(t){return a(r.AABBBounds,o,t,i.offset)}));return!!rA(t,e,r,c,null===(s=i.overlap)||void 0===s?void 0:s.clampForce)}return!1}if("moveY"===n.type){var d=(n.offset?Pt(n.offset)?n.offset(r.attribute):n.offset:[]).map((function(t){return{x:r.attribute.x,y:r.attribute.y+t}}));return!!rA(t,e,r,d,null===(l=i.overlap)||void 0===l?void 0:l.clampForce)}if("moveX"===n.type){var f=(n.offset?Pt(n.offset)?n.offset(r.attribute):n.offset:[]).map((function(t){return{x:r.attribute.x+t,y:r.attribute.y}}));return!!rA(t,e,r,f,null===(u=i.overlap)||void 0===u?void 0:u.clampForce)}return!1}var aA=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],sA=["top","inside-top","inside"];var lA={fadeIn:function(){var t,e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(t=i.opacity)&&void 0!==t?t:1,fillOpacity:null!==(e=i.fillOpacity)&&void 0!==e?e:1,strokeOpacity:null!==(n=i.strokeOpacity)&&void 0!==n?n:1}}},fadeOut:function(){var t,e,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{from:{opacity:null!==(t=i.opacity)&&void 0!==t?t:1,fillOpacity:null!==(e=i.fillOpacity)&&void 0!==e?e:1,strokeOpacity:null!==(n=i.strokeOpacity)&&void 0!==n?n:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function uA(t,e){var n,i;return null!==(i=null===(n=lA[e])||void 0===n?void 0:n.call(lA,t))&&void 0!==i?i:{from:{},to:{}}}var hA="same-time",cA=300,dA="linear";function fA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var pA=function(t){Ke(n,t);var e=fA(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).name="label",t._onHover=function(e){var n=e.target;n===t._lastHover||Kt(n.states)||(n.addState(TS.hover,!0),Uk(Ye(t),(function(t){t===n||Kt(t.states)||t.addState(TS.hoverReverse,!0)})),t._lastHover=n)},t._onUnHover=function(e){t._lastHover&&(Uk(Ye(t),(function(t){Kt(t.states)||(t.removeState(TS.hoverReverse),t.removeState(TS.hover))})),t._lastHover=null)},t._onClick=function(e){var n=e.target;if(t._lastSelect===n&&n.hasState("selected"))return t._lastSelect=null,void Uk(Ye(t),(function(t){Kt(t.states)||(t.removeState(TS.selectedReverse),t.removeState(TS.selected))}));Kt(n.states)||(n.addState(TS.selected,!0),Uk(Ye(t),(function(t){t===n||Kt(t.states)||t.addState(TS.selectedReverse,!0)})),t._lastSelect=n)},t}return Se(n,[{key:"setBitmap",value:function(t){this._bitmap=t}},{key:"setBitmapTool",value:function(t){this._bmpTool=t}},{key:"render",value:function(){var t=this._checkMarks(),e=this.layout(t);this._smartInvert(e),this._renderLabels(e)}},{key:"_bindEvent",value:function(t){if(t){var e=this.attribute,n=e.hover,i=e.select;n&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}}},{key:"_setStates",value:function(t){if(t){var e=this.attribute.state;e&&!Kt(e)&&(t.states=e)}}},{key:"_createLabelText",value:function(t){var e=zv(t);return this._bindEvent(e),this._setStates(e),e}},{key:"_checkMarks",value:function(){var t,e=this.getBaseMarks(),n=[];return e.forEach((function(t){"willRelease"!==t.releaseStatus&&n.push(t)})),this._prevRelationMap=new Map(this._relationMap),null===(t=this._relationMap)||void 0===t||t.clear(),n}},{key:"layout",value:function(t){var e=this.attribute,n=e.textStyle,i=e.position,r=e.offset,o=this.attribute.data;if(Pt(o)&&(o=o({})),!o||0===o.length)return[];var a=[];Pt(this.attribute.sort)&&t&&t.length&&(t=t.sort(this.attribute.sort)),this._relationMap||(this._relationMap=new Map);for(var s=0;s<o.length;s++){var l=o[s],u=null==t?void 0:t[s],h=Object.assign(Object.assign(Object.assign({},n),l),{_relatedIndex:s});if(this._relationMap.set(s,u),l){var c=zv(h);c.update();var d=this.getGraphicBounds(c),f=this.getGraphicBounds(u,{x:l.x,y:l.y}),p=this.labeling(d,f,Pt(i)?i(l):i,r);if(!p)continue;h.x=p.x,h.y=p.y,a.push(h)}}return this._baseMarks=t,!1!==this.attribute.overlap&&(a=this.overlapping(a,this.attribute.overlap)),a}},{key:"overlapping",value:function(t){var e,n,i,r,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0===t.length)return[];var s=[],l=this.getBaseMarkGroup(),u=null!==(e=a.size)&&void 0!==e?e:{width:null!==(n=null==l?void 0:l.AABBBounds.width())&&void 0!==n?n:0,height:null!==(i=null==l?void 0:l.AABBBounds.height())&&void 0!==i?i:0};if(0===u.width||0===u.height)return t;var h=a.avoidBaseMark,c=a.strategy,d=void 0===c?[]:c,f=a.hideOnHit,p=void 0===f||f,v=a.clampForce,g=void 0===v||v,y=this._bmpTool||tA(u.width,u.height),m=this._bitmap||y.bitmap(),b=d.some((function(t){return"bound"===t.type}));h&&(null===(r=this._baseMarks)||void 0===r||r.forEach((function(t){t.AABBBounds&&m.setRange(eA(y,t.AABBBounds))})));for(var w=0;w<t.length;w++)if(!1!==t[w].visible){var x=zv(t[w]),C=null===(o=this._baseMarks)||void 0===o?void 0:o[w];if(x.update(),nA(y,m,x.AABBBounds,g)){if(!b){m.setRange(eA(y,x.AABBBounds)),s.push(Object.assign(Object.assign({},x.attribute),{_insideGraphic:iA(x.AABBBounds,null==C?void 0:C.AABBBounds),_computedBound:x.AABBBounds}));continue}if(b&&(null==C?void 0:C.AABBBounds)&&iA(x.AABBBounds,null==C?void 0:C.AABBBounds)){m.setRange(eA(y,x.AABBBounds)),s.push(Object.assign(Object.assign({},x.attribute),{_insideGraphic:!0,_computedBound:x.AABBBounds}));continue}}for(var _=0;_<d.length;_++)if(oA(y,m,d[_],this.attribute,x,this.getGraphicBounds(C,t[w]),this.labeling)){s.push(Object.assign(Object.assign({},x.attribute),{_insideGraphic:iA(x.AABBBounds,null==C?void 0:C.AABBBounds),_computedBound:x.AABBBounds}));break}!p&&s.push(Object.assign(Object.assign({},x.attribute),{_insideGraphic:iA(x.AABBBounds,null==C?void 0:C.AABBBounds),_computedBound:x.AABBBounds}))}return Pt(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(m),s}},{key:"getBaseMarks",value:function(){var t=this.getBaseMarkGroup();if(t)return t.getChildren()}},{key:"getBaseMarkGroup",value:function(){var t=this.attribute.baseMarkGroupName;if(t)return this.getRootNode().find((function(e){return e.name===t}),!0)}},{key:"getGraphicBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}},{key:"_renderLabels",value:function(t){var e,n,i,r,o,a=this,s=null!==(e=this.attribute.animation)&&void 0!==e?e:{},l=!1===this._enableAnimation||!1===s,u=null!==(n=s.mode)&&void 0!==n?n:hA,h=null!==(i=s.duration)&&void 0!==i?i:cA,c=null!==(r=s.easing)&&void 0!==r?r:dA,d=null!==(o=s.delay)&&void 0!==o?o:0,f=new Map,p=this._textMap||new Map,v=[];t.forEach((function(t,e){var n=a._createLabelText(t),i=a._relationMap.get(t._relatedIndex),r=(null==p?void 0:p.get(i))?"update":"enter";if("enter"===r)if(v.push(n),f.set(i,n),!l&&i){var o=uA(t,"fadeIn"),g=o.from,y=o.to;a.add(n),i.onAnimateBind=function(){n.setAttributes(g);var t=a._afterRelatedGraphicAttributeUpdate(n,v,e,i,{mode:u,duration:h,easing:c,to:y,delay:d});i.on("afterAttributeUpdate",t)}}else a.add(n);if("update"===r){var m=p.get(i);p.delete(i),f.set(i,m),l?m.setAttributes(n.attribute):(m.animate().to(n.attribute,h,c),!1!==s.increaseEffect&&m.attribute.text!==n.attribute.text&&Gt(Number(m.attribute.text)*Number(n.attribute.text))&&m.animate().play(new t_({text:m.attribute.text},{text:n.attribute.text},h,c)))}})),p.forEach((function(t){l?a.removeChild(t):null==t||t.animate().to(uA(t.attribute,"fadeOut").to,h,c).onEnd((function(){a.removeChild(t)}))})),this._textMap=f}},{key:"_afterRelatedGraphicAttributeUpdate",value:function(t,e,n,i,r){var o=r.mode,a=r.duration,s=r.easing,l=r.to,u=r.delay;return function r(h){var c,d=h.detail;if(!d)return{};if(!d||d.type!==gs.ANIMATE_UPDATE||!d.animationState||"wait"===(null===(c=d.animationState.step)||void 0===c?void 0:c.type))return{};if(d.type!==gs.ANIMATE_END){var f=function(){i&&(i.onAnimateBind=void 0,i.removeEventListener("afterAttributeUpdate",r))};switch(o){case"after":d.animationState.end&&t.animate({onEnd:f}).wait(u).to(l,a,s);break;case"after-all":n===e.length-1&&d.animationState.end&&e.forEach((function(t){t.animate({onEnd:f}).wait(u).to(l,a,s)}));break;default:d.animationState.isFirstFrameOfStep&&t.animate({onEnd:f}).wait(u).to(l,a,s)}}else t.setAttributes(l)}}},{key:"_smartInvert",value:function(t){var e,n,i,r,o,a,s,l,u,h;if(!1!==this.attribute.smartInvert)for(var c=0;c<t.length;c++){var d=null==t?void 0:t[c];if(d){d.stroke=!1,d.strokeColor="black";var f=d._insideGraphic;if(void 0===f){var p=zv(d);p.update(),f=iA(p.AABBBounds,null===(e=this._relationMap.get(d._relatedIndex))||void 0===e?void 0:e.AABBBounds)}if(d.stroke)d.fillColor=Yk(d.fillColor,d.strokeColor,null===(n=this.attribute.smartInvert)||void 0===n?void 0:n.textType,null===(i=this.attribute.smartInvert)||void 0===i?void 0:i.contrastRatiosThreshold,null===(r=this.attribute.smartInvert)||void 0===r?void 0:r.alternativeColors);else if(f){var v=this._relationMap.get(d._relatedIndex).attribute.fillColor,g=d.fillColor;d.fillColor=Yk(g,v,null===(o=this.attribute.smartInvert)||void 0===o?void 0:o.textType,null===(a=this.attribute.smartInvert)||void 0===a?void 0:a.contrastRatiosThreshold,null===(s=this.attribute.smartInvert)||void 0===s?void 0:s.alternativeColors)}else{var y=this._relationMap.get(d._relatedIndex);d.stroke=!0,d.strokeColor=y.attribute.fillColor;var m=d.strokeColor,b=d.fillColor;d.fillColor=Yk(b,m,null===(l=this.attribute.smartInvert)||void 0===l?void 0:l.textType,null===(u=this.attribute.smartInvert)||void 0===u?void 0:u.contrastRatiosThreshold,null===(h=this.attribute.smartInvert)||void 0===h?void 0:h.alternativeColors)}}}}},{key:"setLocation",value:function(t){this.translateTo(t.x,t.y)}},{key:"disableAnimation",value:function(){this._enableAnimation=!1}},{key:"enableAnimation",value:function(){this._enableAnimation=!0}}]),n}(zk);function vA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var gA=function(t){Ke(n,t);var e=vA(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="symbol-label",i}return Se(n,[{key:"labeling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t){var r=t.x1,o=t.y1,a=t.x2,s=t.y2,l=Math.abs(a-r),u=Math.abs(s-o),h=(e.x1+e.x2)/2,c=(e.y1+e.y2)/2,d=0,f=0,p=0,v=0;e&&(p=Math.abs(e.x1-e.x2)/2,v=Math.abs(e.y1-e.y2)/2);var g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(n){case"top":f=-1;break;case"bottom":f=1;break;case"left":d=-1;break;case"right":d=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":d=Math.sin(g[n]*(Math.PI/180)),f=Math.cos(g[n]*(Math.PI/180));break;case"center":d=0,f=0}return{x:h+d*(i+p)+Math.sign(d)*(l/2),y:c+f*(i+v)+Math.sign(f)*(u/2)}}}}]),n}(pA);function yA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}gA.defaultAttributes={textStyle:{fontSize:12,fillColor:"#000",textAlign:"center",textBaseline:"middle"},position:"top",offset:5,pickable:!1};var mA=function(t){Ke(n,t);var e=yA(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"labeling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t&&e){var r=t.x1,o=t.y1,a=t.x2,s=t.y2,l=Math.abs(a-r),u=Math.abs(s-o),h=Math.abs(e.x2-e.x1),c=Math.abs(e.y2-e.y1),d=(e.x1+e.x2)/2,f=(e.y1+e.y2)/2,p=0,v=0;switch(n){case"top":case"inside-top":v=-.5;break;case"bottom":case"inside-bottom":v=.5;break;case"left":case"inside-left":p=-.5;break;case"right":case"inside-right":p=.5}d+=p*h,f+=v*c;var g=0,y=0,m=n.includes("inside");return n.includes("top")?y=m?1:-1:n.includes("bottom")?y=m?-1:1:n.includes("left")?g=m?1:-1:n.includes("right")&&(g=m?-1:1),{x:d+g*i+g*l/2,y:f+y*i+y*u/2}}}}]),n}(pA);function bA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}mA.tag="rect-label",mA.defaultAttributes={textStyle:{fontSize:12,fillColor:"#000",textAlign:"center",textBaseline:"middle"},position:"top",offset:5,pickable:!1};var wA=function(t){Ke(n,t);var e=bA(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="line-label",i}return Se(n,[{key:"getGraphicBounds",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("line"!==t.type)return Ho($e(n.prototype),"getGraphicBounds",this).call(this,t,i);var r=this.attribute.position,o=void 0===r?"end":r,a=(null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.points)||[i],s="start"===o?0:a.length-1;return{x1:a[s].x,x2:a[s].x,y1:a[s].y,y2:a[s].y}}},{key:"labeling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"end",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(t&&e){var r=t.x1,o=t.x2,a=Math.abs(o-r),s=e.x1,l=s;return"end"===n?l=s+a/2+i:"start"===n&&(l=s-a/2-i),{x:l,y:e.y1}}}}]),n}(pA);function xA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}wA.defaultAttributes={textStyle:{fontSize:12,fillColor:"#000",textAlign:"center",textBaseline:"middle"},position:"end",offset:6,pickable:!1};var CA={rect:mA,symbol:gA},_A=function(t){Ke(n,t);var e=xA(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="data-label",i}return Se(n,[{key:"render",value:function(){var t=this,e=this.attribute,n=e.dataLabels,i=e.size;if(n&&0!==n.length){var r=i||{},o=r.width,a=void 0===o?0:o,s=r.height,l=void 0===s?0:s;if(a&&l&&Gt(l*a)){this._componentMap||(this._componentMap=new Map);for(var u=tA(a,l),h=u.bitmap(),c=new Map,d=this._componentMap,f=0;f<n.length;f++){var p=n[f];if(CA[p.type]){var v=p.baseMarkGroupName,g=this._componentMap.get(v);g?(g.setBitmapTool(u),g.setBitmap(h),g.setAttributes(p),c.set(v,g)):((g=new CA[p.type](p)).setBitmap(h),g.setBitmapTool(u),this.add(g),c.set(v,g))}}d.forEach((function(e,n){c.get(n)||t.removeChild(e)})),this._componentMap=c}}}},{key:"setLocation",value:function(t){this.translateTo(t.x,t.y)}},{key:"disableAnimation",value:function(){this._componentMap.forEach((function(t){t.disableAnimation()}))}},{key:"enableAnimation",value:function(){this._componentMap.forEach((function(t){t.enableAnimation()}))}}]),n}(zk);function kA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function SA(t,e){var n="";return 0===t.length||(t.forEach((function(t,e){0===e?n="M".concat(t.x,",").concat(t.y):n+="L".concat(t.x,",").concat(t.y)})),e&&(n+="Z")),n}function AA(t,e,n,i){var r="";if(!t||0===e.length)return r;var o=e[0],a=Ue.distancePP(t,o),s=n?0:1;return i?r+="M".concat(t.x,",").concat(t.y-a,"A").concat(a,",").concat(a,",0,0,").concat(s,",").concat(t.x,",").concat(t.y+a,"A").concat(a,",").concat(a,",0,0,").concat(s,",").concat(t.x,",").concat(t.y-a,"Z"):e.forEach((function(t,e){0===e?r="M".concat(t.x,",").concat(t.y):r+="A".concat(a,",").concat(a,",0,0,").concat(s,",").concat(t.x,",").concat(t.y)})),r}function BA(t,e,n){var i=n.type,r=n.closed,o=e.slice(0).reverse(),a="",s="";if("line"===i&&n.smoothLink&&n.center){var l=t[0],u=o[0],h=n.center;a=SA(t,!!r),s=SA(o,!!r);var c=Ue.distancePP(u,h),d=Ue.distancePP(l,h);a+="A".concat(c,",").concat(c,",0,0,1,").concat(u.x,",").concat(u.y,"L").concat(u.x,",").concat(u.y),s+="A".concat(d,",").concat(d,",0,0,0,").concat(l.x,",").concat(l.y)}else if("circle"===i){var f=n.center;a=AA(f,t,!1,!!r),s=AA(f,o,!0,!!r)}else"line"!==i&&"polygon"!==i||(a=SA(t,!!r),s=SA(o,!!r));return r?a+=s:(a+=s="L"+s.substring(1),a+="Z"),a}_A.defaultAttributes={pickable:!1};var RA=function(t){Ke(n,t);var e=kA(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="grid",i}return Se(n,[{key:"render",value:function(){var t=this;this.removeAllChild();var e=this.attribute,i=e.type,r=e.items,o=e.style,a=e.closed,s=e.alternateColor,l=e.depth,u=void 0===l?0:l;if(!Kt(r)&&(r.forEach((function(e,r){var s=e.id,l=e.points,h="";if("line"===i||"polygon"===i)h=SA(l,!!a);else if("circle"===i){h=AA(t.attribute.center,l,!1,!!a)}var c=Wv(Object.assign({path:h,z:u},Pt(o)?te({},n.defaultAttributes.style,o(e,r)):o));c.name="".concat(t.name,"-line"),c.id=t._getNodeId("path-".concat(s)),t.add(c)})),u&&"line"===i&&r.forEach((function(e,i){var r=e.id,s=e.points,l=[];l.push(s[0]);var h=s[1].x-s[0].x,c=s[1].y-s[0].y,d=Math.sqrt(h*h+c*c),f=u/d;l.push({x:s[0].x+h*f,y:s[0].y+c*f});var p=SA(l,!!a),v=Oe(l[0].x-l[1].x),g=Oe(l[0].y-l[1].y),y=Wv(Object.assign({path:p,z:0,alpha:v>g?(s[1].x-s[0].x>0?-1:1)*Re/2:0,beta:v<g?-Re/2:0,anchor3d:v>g?[l[0].x,0]:[0,l[0].y]},Pt(o)?te({},n.defaultAttributes.style,o(e,i)):o));y.name="".concat(t.name,"-line"),y.id=t._getNodeId("path-".concat(r)),t.add(y)})),r.length>1&&s))for(var h=Wt(s)?s:[s,"transparent"],c=function(t){return h[t%h.length]},d=0;d<r.length-1;d++){var f=[r[d].points,r[d+1].points],p=Wv({path:BA(f[0],f[1],this.attribute),fill:!0,fillColor:c(d)});p.name="".concat(this.name,"-region"),p.id=this._getNodeId("region-".concat(d)),this.add(p)}}},{key:"_getNodeId",value:function(t){return"".concat(this.id,"-").concat(t)}}]),n}(zk);function TA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}RA.defaultAttributes={style:{lineWidth:1,stroke:!0,strokeColor:"#416180"},zIndex:0};var MA,PA,OA,EA=function(t){Ke(n,t);var e=TA(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="segment",i}return Se(n,[{key:"computeLineAngle",value:function(){var t=this.attribute.points,e=t[0],n=t[1],i=t[t.length-2],r=t[t.length-1],o=[e.x-n.x,e.y-n.y],a=Math.atan2(o[1],o[0]),s=[r.x-i.x,r.y-i.y],l=Math.atan2(s[1],s[0]);this._startAngle=a,this._endAngle=l}},{key:"render",value:function(){this.removeAllChild();var t=this.attribute,e=t.points,n=t.startSymbol,i=t.endSymbol,r=t.lineStyle,o=t.state;e.length>1&&this.computeLineAngle();var a=this.renderSymbol(n,"start"),s=this.renderSymbol(i,"end");this.startSymbol=a,this.endSymbol=s;var l=e;if(null==n?void 0:n.visible){var u=(null==n?void 0:n.clip)?(null==n?void 0:n.size)||10:0;l=[{x:e[0].x-u/2*(Math.cos(this._startAngle)||0),y:e[0].y-u/2*(Math.sin(this._startAngle)||0)}].concat(ie(l.slice(1)))}if(null==i?void 0:i.visible){var h=(null==i?void 0:i.clip)?(null==i?void 0:i.size)||10:0,c={x:e[e.length-1].x-h/2*(Math.cos(this._endAngle)||0),y:e[e.length-1].y-h/2*(Math.sin(this._endAngle)||0)};l=[].concat(ie(l.slice(0,l.length-1)),[c])}var d=jv(Object.assign({points:l,fill:!1},r));d.name="line",d.id=this._getNodeId("line"),Kt(null==o?void 0:o.line)||(d.states=o.line),this.line=d,this.add(d)}},{key:"renderSymbol",value:function(t,e){var n;if(null==t?void 0:t.visible){var i,r,o=this._startAngle,a=this._endAngle,s=this.attribute,l=s.points,u=s.state,h=l[0],c=l[l.length-1],d=t.refX,f=void 0===d?0:d,p=t.refY,v=void 0===p?0:p,g=t.refAngle,y=void 0===g?0:g,m=t.style,b=t.symbolType,w=t.size,x=void 0===w?12:w;"start"===e?(i={x:h.x+(o?f*Math.cos(o)+v*Math.cos(o-Math.PI/2):0),y:h.y+(o?f*Math.sin(o)+v*Math.sin(o-Math.PI/2):0)},r=o+Math.PI/2):(i={x:c.x+(a?f*Math.cos(a)+v*Math.cos(a-Math.PI/2):0),y:c.y+(a?f*Math.sin(a)+v*Math.sin(a-Math.PI/2):0)},r=a+Math.PI/2),(n=Nv(Object.assign(Object.assign(Object.assign({},i),{symbolType:b,size:x,angle:r+y,strokeBoundsBuffer:0}),m))).name="".concat(e,"-symbol"),n.id=this._getNodeId("".concat(e,"-symbol")),Kt(null==u?void 0:u.symbol)||(n.states=u.symbol),this.add(n)}return n}},{key:"getStartAngle",value:function(){return this._startAngle}},{key:"getEndAngle",value:function(){return this._endAngle}}]),n}(zk);EA.defaultAttributes={lineStyle:{lineWidth:1,strokeColor:"#000"},startSymbol:{visible:!1,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fillColor:"#000",zIndex:1}},endSymbol:{visible:!1,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fillColor:"#000",zIndex:1}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background"}(PA||(PA={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(OA||(OA={}));var HA=(Bs(MA={},OA.selectedReverse,{}),Bs(MA,OA.selected,{}),Bs(MA,OA.hover,{}),Bs(MA,OA.hoverReverse,{}),MA),LA={title:{space:4,padding:0,textStyle:{fontSize:12,fillColor:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fillColor:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,strokeColor:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,strokeColor:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,strokeColor:"#000",strokeOpacity:1}},grid:{style:{lineWidth:1,strokeColor:"#999",strokeOpacity:1,lineDash:[4,4]}},subGrid:{visible:!1,style:{lineWidth:1,strokeColor:"#999",strokeOpacity:1,lineDash:[4,4]}}};function IA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var DA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},jA=function(t){Ke(n,t);var e=IA(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).name="axis",t.data=[],t.tickLineItems=[],t.subTickLineItems=[],t.axisLabelLayerSize={},t.axisLabelsContainer=null,t._onHover=function(e){var n=e.target;n!==t._lastHover&&n.name&&!Kt(n.states)&&(n.addState(TS.hover,!0),Uk(t.axisContainer,(function(t){t!==n&&t.name&&!Kt(t.states)&&t.addState(TS.hoverReverse,!0)})),t._lastHover=n)},t._onUnHover=function(e){t._lastHover&&(Uk(t.axisContainer,(function(t){t.name&&!Kt(t.states)&&(t.removeState(TS.hoverReverse),t.removeState(TS.hover))})),t._lastHover=null)},t._onClick=function(e){var n=e.target;if(t._lastSelect===n&&n.hasState(TS.selected))return t._lastSelect=null,void Uk(t.axisContainer,(function(t){t.name&&!Kt(t.states)&&(t.removeState(TS.selectedReverse),t.removeState(TS.selected))}));n.name&&!Kt(n.states)&&(n.addState(TS.selected,!0),Uk(t.axisContainer,(function(t){t!==n&&t.name&&!Kt(t.states)&&t.addState(TS.selectedReverse,!0)})),t._lastSelect=n)},t}return Se(n,[{key:"getInnerView",value:function(){return this._innerView}},{key:"getPrevInnerView",value:function(){return this._prevInnerView}},{key:"getBoundsWithoutRender",value:function(t){var e=qt(this.attribute);te(this.attribute,t);var n=Dv({x:this.attribute.x,y:this.attribute.y});return this.add(n),this._renderInner(n),this.removeChild(n),this.attribute=e,n.AABBBounds}},{key:"render",value:function(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=Dv({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}},{key:"_bindEvent",value:function(){var t=this.attribute,e=t.hover,n=t.select;e&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),n&&this._innerView.addEventListener("pointerdown",this._onClick)}},{key:"_renderInner",value:function(t){var e=this,n=this.attribute,i=n.title,r=n.label,o=n.tick,a=n.line,s=n.grid,l=n.items,u=n.panel,h=Dv({x:0,y:0,zIndex:1});if(h.name=PA.axisContainer,h.id=this._getNodeId("container"),h.setMode(this.mode),this.axisContainer=h,t.add(h),(null==a?void 0:a.visible)&&this.renderLine(h),l&&l.length){if(this.data=this._transformItems(l[0]),(null==o?void 0:o.visible)&&this.renderTicks(h),null==r?void 0:r.visible){var c=Dv({x:0,y:0,pickable:!1});c.name=PA.labelContainer,c.id=this._getNodeId("label-container"),this.axisLabelsContainer=c,h.add(c),l.forEach((function(t,n){e.renderLabels(c,t,n)}))}(null==s?void 0:s.visible)&&this.renderGrid(t)}if((null==i?void 0:i.visible)&&this.renderTitle(h),u&&u.visible){var d=h.AABBBounds,f=Fv(Object.assign({x:d.x1,y:d.y1,width:d.width(),height:d.height()},u.style));f.name=PA.background,f.id=this._getNodeId("background"),Kt(u.state)||(f.states=te({},ES,u.state)),h.insertBefore(f,h.firstChild)}}},{key:"renderTicks",value:function(t){var e,n=this,i=this.getTickLineItems(),r=Dv({x:0,y:0,pickable:!1});r.name=PA.tickContainer,r.id=this._getNodeId("tick-container"),t.add(r);var o=Kt(null===(e=this.attribute.tick)||void 0===e?void 0:e.state)?null:te({},ES,this.attribute.tick.state);i.forEach((function(t,e){var a=jv(Object.assign({},n._getTickLineAttribute("tick",t,e,i)));a.name=PA.tick,a.id=n._getNodeId(t.id),a.states=o,r.add(a)})),this.tickLineItems=i;var a=this.attribute.subTick;if(null==a?void 0:a.visible){var s=this.getSubTickLineItems();if(s.length){var l=Kt(a.state)?null:te({},ES,a.state);s.forEach((function(t,e){var o=jv(Object.assign({},n._getTickLineAttribute("subTick",t,e,i)));o.name=PA.subTick,o.id=n._getNodeId("".concat(e)),o.states=l,r.add(o)}))}this.subTickLineItems=s}}},{key:"renderLabels",value:function(t,e,n){var i,r,o=this;r=0===n?this.data:this._transformItems(e);var a=Dv({x:0,y:0,pickable:!1});a.name="".concat(PA.labelContainer,"-layer-").concat(n),a.id=this._getNodeId("label-container-layer-".concat(n)),t.add(a);var s=0,l=0,u="center",h="middle",c=Kt(null===(i=this.attribute.label)||void 0===i?void 0:i.state)?null:te({},ES,this.attribute.label.state);return r.forEach((function(t,e){var i,d=o._getLabelAttribute(t,e,r,n),f=zv(d);f.name=PA.label,f.id=o._getNodeId("layer".concat(n,"-label-").concat(t.id)),f.states=c,a.add(f);var p=null!==(i=d.angle)&&void 0!==i?i:0;s=Math.max(s,f.AABBBounds.width()),l=Math.max(l,f.AABBBounds.height()),p&&(s=Math.abs(s*Math.cos(p)),l=Math.abs(l*Math.sin(p))),u=d.textAlign,h=d.textBaseline})),this.axisLabelLayerSize[n]={width:s,height:l,textAlign:u,textBaseline:h},a}},{key:"renderTitle",value:function(t){var e=this.getTitleAttribute(),n=new jS(Object.assign({},e));n.name=PA.title,n.id=this._getNodeId("title"),t.add(n)}},{key:"renderGrid",value:function(t){this._renderGridByType("grid",t),(this.attribute.subGrid||{}).visible&&this._renderGridByType("subGrid",t)}},{key:"getVerticalCoord",value:function(t,e,n){var i=this.getVerticalVector(e,n,t);return{x:t.x+i[0],y:t.y+i[1]}}},{key:"getTextAlign",value:function(t){var e="center";return ce(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}},{key:"getTickLineItems",value:function(){var t=this,e=this.attribute.tick,n=this.data,i=[],r=e.alignWithLabel,o=e.inside,a=void 0!==o&&o,s=e.length,l=1;return n.length>=2&&(l=n[1].value-n[0].value),n.forEach((function(e){var n=e.point,o=e.value;if(!r){var u=e.value-l/2;if(t.isInValidValue(u))return;n=t.getTickCoord(u),o=u}var h=t.getVerticalCoord(n,s,a);if("3d"===t.mode){var c=t.getVerticalVector(s,a,n),d=0,f=0;Oe(c[0])>Oe(c[1])?d=Re/2*(h.x>n.x?1:-1):f=Re/2*(h.y>n.y?-1:1),i.push({start:n,end:h,value:o,id:"tick-".concat(e.id),anchor:[n.x,n.y],alpha:d,beta:f})}else i.push({start:n,end:h,value:o,id:"tick-".concat(e.id)})})),i}},{key:"getSubTickLineItems",value:function(){var t=this.attribute.subTick,e=[],n=t.count,i=void 0===n?4:n,r=t.inside,o=void 0!==r&&r,a=t.length,s=void 0===a?2:a,l=this.tickLineItems,u=l.length;if(u>=2)for(var h=0;h<u-1;h++)for(var c=l[h],d=l[h+1],f=0;f<i;f++){var p=(f+1)/(i+1),v=(1-p)*c.value+p*d.value,g=this.getTickCoord(v),y=this.getVerticalCoord(g,s,o);e.push({start:g,end:y,value:v,id:"sub-tick-".concat(v)})}return e}},{key:"_getTickLineAttribute",value:function(t,e,n,i){var r=Yt(this.attribute,"".concat(t,".style")),o=this.data[n];r=Pt(r)?te({},Yt(LA,"".concat(t,".style")),"tick"===t?r(o.rawValue,n,o,this.data):r(e.value,n,e,i)):r;var a=e.start,s=e.end,l=e.anchor,u=e.alpha,h=e.beta;return Object.assign({points:[a,s],anchor:l,alpha:u,beta:h},r)}},{key:"_getLabelAttribute",value:function(t,e,n,i){var r,o,a,s,l,u,h=this.attribute.label,c=h.space,d=void 0===c?4:c,f=h.inside,p=void 0!==f&&f,v=h.formatMethod,g=DA(h,["space","inside","formatMethod"]),y=d,m=0;(null===(r=this.attribute.tick)||void 0===r?void 0:r.visible)&&(null===(o=this.attribute.tick)||void 0===o?void 0:o.inside)===p&&(m=(null===(a=this.attribute.tick)||void 0===a?void 0:a.length)||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&(null===(l=this.attribute.subTick)||void 0===l?void 0:l.inside)===p&&(m=Math.max(m,(null===(u=this.attribute.subTick)||void 0===u?void 0:u.length)||2)),y+=m;var b=this.getRelativeVector(t.point);i>0&&(0===b[1]?y+=(this.axisLabelLayerSize[i-1].height+Yt(this.attribute,"label.space",4))*i:y+=(this.axisLabelLayerSize[i-1].width+Yt(this.attribute,"label.space",4))*i);var w=this.getVerticalCoord(t.point,y,p),x=this.getVerticalVector(y,p,w),C=v?v(t.label,t,e,n,i):t.label,_=g.style;return _=Pt(_)?te({},LA.label.style,_(t,e,n,i)):_,_=te({textAlign:this.getTextAlign(x),textBaseline:this.getTextBaseline(x,p)},_),Pt(_.text)&&(_.text=_.text({label:t.label,value:t.rawValue,index:t.index,layer:i})),Object.assign(Object.assign(Object.assign({},w),{text:C,lineHeight:null==_?void 0:_.fontSize}),_)}},{key:"_transformItems",value:function(t){var e=this,n=[];return t.forEach((function(t){var i;n.push(Object.assign(Object.assign({},t),{point:e.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),n}},{key:"_renderGridByType",value:function(t,e){var n=this.getGridAttribute(t),i=new RA(Object.assign(Object.assign({pickable:!1},n),{zIndex:0}));i.name="subGrid"===t?"".concat(PA.grid,"-sub"):"".concat(PA.grid),i.id=this._getNodeId(t),e.add(i)}}]),n}(zk);function WA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var FA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};var zA=function(t){Ke(n,t);var e=WA(n);function n(t,i){var r;return Ae(this,n),r=e.call(this,te({},n.defaultAttributes,t),i),"3d"===i&&r.setMode(i),r}return Se(n,[{key:"renderLine",value:function(t){var e=this.attribute,n=e.start,i=e.end,r=e.line,o=r.startSymbol,a=r.endSymbol,s=r.style,l=(r.breakRange,r.breakShape,r.breakShapeStyle,r.state),u=FA(r,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),h=Object.assign({points:[n,i],startSymbol:o,endSymbol:a,lineStyle:s},u);Kt(l)||(h.state={line:te({},HA,l),symbol:te({},HA,l)});var c=new EA(h);c.name=PA.line,c.id=this._getNodeId("line"),t.add(c)}},{key:"isInValidValue",value:function(t){return t<0||t>1}},{key:"getTickCoord",value:function(t){var e=this.attribute.start,n=this.getRelativeVector();return{x:e.x+n[0]*t,y:e.y+n[1]*t}}},{key:"getRelativeVector",value:function(){var t=this.attribute,e=t.start,n=t.end;return[n.x-e.x,n.y-e.y]}},{key:"getVerticalVector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.attribute.verticalFactor,i=void 0===n?1:n,r=SS([0,0],this.getRelativeVector());return _S([0,0],[r[1],-1*r[0]],t*(e?1:-1)*i)}},{key:"getTitleAttribute",value:function(){var t,e,n,i,r,o,a,s,l=this,u=this.attribute.title,h=u.position,c=void 0===h?"middle":h,d=u.space,f=void 0===d?4:d,p=u.textStyle,v=void 0===p?{}:p,g=u.autoRotate,y=void 0===g||g,m=u.shape,b=u.background,w=u.state,x=FA(u,["position","space","textStyle","autoRotate","shape","background","state"]),C=.5;"start"===c?C=0:"end"===c&&(C=1);var _=this.attribute.verticalFactor,k=-1*(void 0===_?1:_),S=this.getTickCoord(C),A=this.getRelativeVector(),B=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)){var R=+Yt(this.attribute,"label.space",4);if(B+=R,0===A[1])Object.keys(this.axisLabelLayerSize).forEach((function(t,e){B+=l.axisLabelLayerSize[t].height+(e>0?R:0)}));else{Object.keys(this.axisLabelLayerSize).forEach((function(t,e){B+=l.axisLabelLayerSize[t].width+(e>0?R:0)}));var T=this.axisLabelLayerSize[0].textAlign,M="start"===T||"left"===T,P="center"===T,O=A[1]>0;B=1===k?O?M?B:P?B/2:0:M?R:P?B/2:B:O?M?0:P?B/2:B:M?B:P?B/2:0}}var E=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(i=this.attribute.tick)||void 0===i?void 0:i.inside)&&(E=(null===(r=this.attribute.tick)||void 0===r?void 0:r.length)||4),(null===(o=this.attribute.subTick)||void 0===o?void 0:o.visible)&&!1===(null===(a=this.attribute.subTick)||void 0===a?void 0:a.inside)&&(E=Math.max(E,(null===(s=this.attribute.subTick)||void 0===s?void 0:s.length)||2));var H,L,I=E+B+f,D=this.getVerticalCoord(S,I,!1),j=this.getVerticalVector(I,!1),W=x.angle;if(H="start"===c?"start":"end"===c?"end":"center",Ot(W)&&y){W=RS(A,[1,0],!0);var F=this.attribute.verticalFactor;L=1==-1*(void 0===F?1:F)?"bottom":"top"}else H=this.getTextAlign(j),L=this.getTextBaseline(j,!1);var z=Object.assign(Object.assign(Object.assign({},D),x),{textStyle:Object.assign({textAlign:H,textBaseline:L},v),state:Kt(w)?null:{text:w.text,shape:w.shape,panel:w.background}});return z.angle=W,m&&m.visible&&(z.shape=Object.assign({visible:!0},m.style),m.space&&(z.space=m.space)),b&&b.visible&&(z.panel=Object.assign({visible:!0},b.style)),z}},{key:"_getGridPoint",value:function(t,e){var n;if("line"===t){var i=this.attribute.grid.length;n=[e,this.getVerticalCoord(e,i,!0)]}else if("circle"===t||"polygon"===t){var r=this.attribute.grid,o=r.center,a=r.sides,s=r.startAngle,l=void 0===s?MS:s,u=r.endAngle,h=void 0===u?PS:u;n=function(t,e,n,i,r){for(var o=[],a=r-i,s=0;s<e;s++){var l=i+s*a/e;o.push(rn(t,n,l))}return o}(o,a,Ue.distancePP(o,e),l,h)}return n}},{key:"getGridAttribute",value:function(t){var e,n=this,i=this.attribute.grid,r=i.type,o=i.alignWithLabel,a=void 0===o||o,s=1;this.data.length>=2&&(s=this.data[1].value-this.data[0].value);var l=[];if("grid"===t){e=this.attribute.grid;var u=[];this.data.forEach((function(t){var e=t.point;if(!a){var i=t.value-s/2;if(n.isInValidValue(i))return;e=n.getTickCoord(i)}u.push({id:t.label,datum:t,points:n._getGridPoint(r,e)})})),l=u}else{e=te({},this.attribute.grid,this.attribute.subGrid);var h=[],c=(this.attribute.subTick||{}).count,d=void 0===c?4:c;if(this.data.length>=2){var f=[];this.data.forEach((function(t){var e=t.value;if(!a){var i=t.value-s/2;if(n.isInValidValue(i))return;e=i}f.push({value:e})}));for(var p=0;p<f.length-1;p++){var v=f[p],g=f[p+1];h.push({id:"sub-".concat(p,"-0"),points:this._getGridPoint(r,this.getTickCoord(v.value)),datum:{}});for(var y=0;y<d;y++){var m=(y+1)/(d+1),b=(1-m)*v.value+m*g.value,w=this.getTickCoord(b);h.push({id:"sub-".concat(p,"-").concat(y+1),points:this._getGridPoint(r,w),datum:{}})}p===f.length-2&&h.push({id:"sub-".concat(p,"-").concat(d+1),points:this._getGridPoint(r,this.getTickCoord(g.value)),datum:{}})}l=h}}return Object.assign(Object.assign({},e),{items:l})}},{key:"getTextBaseline",value:function(t,e){var n="middle",i=this.attribute.verticalFactor,r=(e?1:-1)*(void 0===i?1:i);return ce(t[1],0)?n=ce(t[0],0)?1===r?"bottom":"top":"middle":t[1]>0?n="top":t[1]<0&&(n="bottom"),n}}]),n}(jA);function NA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}zA.defaultAttributes=LA;var GA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},UA=function(t){Ke(n,t);var e=NA(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"renderLine",value:function(t){var e=this.attribute,n=e.startAngle,i=void 0===n?MS:n,r=e.endAngle,o=void 0===r?PS:r,a=e.radius,s=e.center,l=e.innerRadius,u=void 0===l?0:l,h=e.line,c=e.inside,d=a,f=u;void 0!==c&&c&&u>0&&(d=u,f=0);var p=Iv(Object.assign(Object.assign(Object.assign({},s),{startAngle:i,endAngle:o,radius:d,innerRadius:f}),null==h?void 0:h.style));p.name=PA.line,p.id=this._getNodeId("line"),Kt(null==h?void 0:h.state)||(p.states=te({},HA,h.state)),t.add(p)}},{key:"isInValidValue",value:function(t){var e=this.attribute,n=e.startAngle,i=void 0===n?MS:n,r=e.endAngle,o=void 0===r?PS:r;return Math.abs(o-i)%(2*Math.PI)==0?t>1:t<0||t>1}},{key:"getTickCoord",value:function(t){var e=this.attribute,n=e.startAngle,i=void 0===n?MS:n,r=e.endAngle,o=void 0===r?PS:r,a=e.center,s=e.radius,l=e.inside,u=void 0!==l&&l,h=e.innerRadius,c=void 0===h?0:h;return rn(a,u&&c>0?c:s,i+(o-i)*t)}},{key:"getVerticalVector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=this.attribute.inside,r=void 0!==i&&i,o=this.attribute.center,a=[n.x-o.x,n.y-o.y];return _S(a,a,(e?-1:1)*(r?-1:1)*t/kS(a)),a}},{key:"getRelativeVector",value:function(t){var e=this.attribute.center;return[t.y-e.y,-1*(t.x-e.x)]}},{key:"getTitleAttribute",value:function(){var t,e,n,i,r,o,a,s,l=this.attribute,u=l.center,h=l.radius,c=l.innerRadius,d=void 0===c?0:c,f=this.attribute.title,p=f.space,v=void 0===p?4:p,g=f.textStyle,y=void 0===g?{}:g,m=f.shape,b=f.background,w=f.state,x=GA(f,["space","textStyle","shape","background","state"]),C=u,_=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(e=this.attribute.label)||void 0===e?void 0:e.inside)&&(_=Yt(this.attribute.label,"style.fontSize",12)+Yt(this.attribute.label,"space",4));var k=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(i=this.attribute.tick)||void 0===i?void 0:i.inside)&&(k=(null===(r=this.attribute.tick)||void 0===r?void 0:r.length)||4),(null===(o=this.attribute.subTick)||void 0===o?void 0:o.visible)&&!1===(null===(a=this.attribute.subTick)||void 0===a?void 0:a.inside)&&(k=Math.max(k,(null===(s=this.attribute.subTick)||void 0===s?void 0:s.length)||2));var S=h+k+_+v,A="middle",B=this.attribute.title.position;Ot(B)&&(B=0===d?"end":"middle"),"start"===B?(A="bottom",C={x:u.x,y:u.y-S}):"end"===B&&(A="top",C={x:u.x,y:u.y+S});var R=Object.assign(Object.assign(Object.assign({},C),x),{textStyle:Object.assign({textBaseline:A,textAlign:"center"},y),state:Kt(w)?null:{text:w.text,shape:w.shape,panel:w.background}}),T=x.angle;return R.angle=T,m&&m.visible&&(R.shape=Object.assign({visible:!0},m.style),m.space&&(R.space=m.space)),b&&b.visible&&(R.panel=Object.assign({visible:!0},b.style)),R}},{key:"getSubTickLineItems",value:function(){var t,e,n=this.attribute.subTick,i=[],r=n.count,o=void 0===r?4:r,a=n.inside,s=void 0!==a&&a,l=n.length,u=void 0===l?2:l,h=this.tickLineItems,c=h.length;if(c>=2)for(var d=this.data[1].value-this.data[0].value,f=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel,p=0;p<c;p++)for(var v=h[p],g=h[p+1],y=0;y<o;y++){var m=(y+1)/(o+1),b=(1-m)*v.value+m*(g?g.value:f?1:v.value+d),w=this.getTickCoord(b),x=this.getVerticalCoord(w,u,s);i.push({start:w,end:x,value:b})}return i}},{key:"getGridAttribute",value:function(t){var e,n=this,i=[],r=this.attribute,o=r.radius,a=r.innerRadius,s=void 0===a?0:a,l=r.startAngle,u=void 0===l?MS:l,h=r.endAngle,c=void 0===h?PS:h,d=r.center,f=(r.grid||{}).alignWithLabel,p=void 0===f||f,v=o-s,g=1;if(this.data.length>=2&&(g=this.data[1].value-this.data[0].value),"grid"===t){e=this.attribute.grid;var y=[];(Math.abs(c-u)%(2*Math.PI)==0?ie(this.data).concat(this.data[0]):this.data).forEach((function(t){var e=t.point;if(!p){var i=t.value-g/2;if(n.isInValidValue(i))return;e=n.getTickCoord(i)}var r=n.getVerticalCoord(e,v,!0);y.push({id:t.id,points:[e,r],datum:t})})),i=y}else{e=te({},this.attribute.grid,this.attribute.subGrid);var m=[],b=(this.attribute.subTick||{}).count,w=void 0===b?4:b,x=this.data.length;if(x>=2){var C=[];this.data.forEach((function(t){var e=t.value;if(!p){var i=t.value-g/2;if(n.isInValidValue(i))return;e=i}C.push({value:e})}));for(var _=0;_<x;_++){var k=C[_],S=C[_+1];m.push({id:"sub-".concat(_,"-0"),points:[this.getTickCoord(k.value),this.getVerticalCoord(this.getTickCoord(k.value),v,!0)],datum:{}});for(var A=0;A<w;A++){var B=(A+1)/(w+1),R=(1-B)*k.value+B*(S?S.value:p?1:k.value+g),T=this.getTickCoord(R),M=this.getVerticalCoord(T,v,!0);m.push({id:"sub-".concat(_,"-").concat(A+1),points:[T,M],datum:{}})}}Math.abs(c-u)%(2*Math.PI)==0&&m.push(m[0]),i=m}}return Object.assign(Object.assign({},e),{items:i,center:d})}},{key:"getTextBaseline",value:function(t){var e="middle";return ce(t[1],0)?e="middle":t[1]>0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}}]),n}(jA);UA.defaultAttributes=LA;var VA;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(VA||(VA={}));function KA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var YA,XA,$A,qA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},ZA=function(t){Ke(n,t);var e=KA(n);function n(t){var i;Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="dataZoom",i._previewData=[],i._activeState=!1,i._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},i._layoutCache={attPos:"x",attSize:"width",max:0},i.state={start:0,end:1},i._statePointToData=function(t){return t},i._onHandlerPointerDown=function(t,e){"start"===e?(i._activeTag=VA.startHandler,i._activeItem=i._startHandler):"end"===e?(i._activeTag=VA.endHandler,i._activeItem=i._endHandler):"middleRect"===e?(i._activeTag=VA.middleHandler,i._activeItem=i._middleHandlerRect):"middleSymbol"===e?(i._activeTag=VA.middleHandler,i._activeItem=i._middleHandlerSymbol):"background"===e&&(i._activeTag=VA.background,i._activeItem=i._background),i._activeState=!0,i._activeCache.startPos=i.eventPosToStagePos(t),i._activeCache.lastPos=i.eventPosToStagePos(t)},i._onHandlerPointerMove=function(t){var e=i.attribute,n=e.start,r=e.end,o=e.brushSelect,a=i.eventPosToStagePos(t),s=i._layoutCache,l=s.attPos,u=s.max,h=(a[l]-i._activeCache.lastPos[l])/u;i._activeState&&(i._activeTag===VA.middleHandler?i.moveZoomWithMiddle((i.state.start+i.state.end)/2+h):i._activeTag===VA.startHandler?i.state.start+h>i.state.end?(i.state.start=i.state.end,i.state.end=i.state.start+h,i._activeTag=VA.endHandler):i.state.start=i.state.start+h:i._activeTag===VA.endHandler&&(i.state.end+h<i.state.start?(i.state.end=i.state.start,i.state.start=i.state.end+h,i._activeTag=VA.startHandler):i.state.end=i.state.end+h),i._activeCache.lastPos=a),i.state.start=Math.min(Math.max(i.state.start,0),1),i.state.end=Math.min(Math.max(i.state.end,0),1),o&&i.renderDragMask(),n===i.state.start&&r===i.state.end||(i.setAttributes({start:i.state.start,end:i.state.end}),i._updateStateCallback&&i._updateStateCallback(i.state.start,i.state.end))};var r=i.attribute,o=r.start,a=r.end,s=r.size,l=r.orient,u=r.showDetail,h=r.position,c=r.previewData,d=r.previewCallbackX,f=r.previewCallbackY,p=r.previewCallbackX1,v=r.previewCallbackY1,g=s.width,y=s.height;return o&&(i.state.start=o),a&&(i.state.end=a),i._isHorizontal="top"===l||"bottom"===l,i._layoutCache.max=i._isHorizontal?g:y,i._layoutCache.attPos=i._isHorizontal?"x":"y",i._layoutCache.attSize=i._isHorizontal?"width":"height",i._activeCache.startPos=h,i._activeCache.lastPos=h,i._showText="auto"!==u&&u,c&&(i._previewData=c),Pt(d)&&(i._previewCallbackX=d),Pt(f)&&(i._previewCallbackY=f),Pt(p)&&(i._previewCallbackX1=p),Pt(v)&&(i._previewCallbackY1=v),i}return Se(n,[{key:"bindEvents",value:function(){var t=this,e=this.attribute,n=e.showDetail,i=e.brushSelect;this._startHandler&&this._startHandler.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"start")})),this._endHandler&&this._endHandler.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"end")})),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"middleSymbol")})),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"middleRect")}));var r=i?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,r)})),i&&this._background&&this._background.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"background")})),i&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,"background")})),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(function(e){return t._onHandlerPointerDown(e,r)})),"browser"===TC.env&&(TC.addEventListener("pointermove",this._onHandlerPointerMove.bind(this)),TC.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerside",this._onHandlerPointerUp),"auto"===n&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}},{key:"dragMaskSize",value:function(){var t=this.attribute.position,e=this._layoutCache,n=e.attPos,i=e.max;return this._activeCache.lastPos[n]-t[n]>i?i+t[n]-this._activeCache.startPos[n]:this._activeCache.lastPos[n]-t[n]<0?t[n]-this._activeCache.startPos[n]:this._activeCache.lastPos[n]-this._activeCache.startPos[n]}},{key:"eventPosToStagePos",value:function(t){var e,n,i,r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(n=this.stage)||void 0===n?void 0:n.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}},{key:"_onHandlerPointerUp",value:function(t){var e=this.attribute,n=e.start,i=e.end,r=e.brushSelect;if(this._activeState&&this._activeTag===VA.background){var o=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,o)}this._activeState=!1,r&&this.renderDragMask(),n===this.state.start&&i===this.state.end||(this.setAttributes({start:this.state.start,end:this.state.end}),this._updateStateCallback&&this._updateStateCallback(this.state.start,this.state.end))}},{key:"_onHandlerPointerEnter",value:function(t){this._showText=!0,this.renderText()}},{key:"_onHandlerPointerLeave",value:function(t){this._showText=!1,this.renderText()}},{key:"backgroundDragZoom",value:function(t,e){var n=this._layoutCache,i=n.attPos,r=n.max,o=this.attribute.position,a=t[i]-o[i],s=e[i]-o[i],l=Math.min(Math.max(Math.min(a,s)/r,0),1),u=Math.min(Math.max(Math.max(a,s)/r,0),1);Math.abs(l-u)<.01?this.moveZoomWithMiddle(l):(this.state.start=l,this.state.end=u)}},{key:"moveZoomWithMiddle",value:function(t){var e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.state.start=this.state.start+e,this.state.end=this.state.end+e)}},{key:"renderDragMask",value:function(){var t=this.attribute.dragMaskStyle,e=this.getLayoutAttrFromConfig(),n=e.position,i=e.width,r=e.height;this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,y:n.y,width:this._activeState&&this._activeTag===VA.background&&Math.abs(this.dragMaskSize())||0,height:r},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:n.x,y:this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,width:i,height:this._activeState&&this._activeTag===VA.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}},{key:"renderText",value:function(){var t=this.attribute,e=t.startTextStyle,n=t.endTextStyle,i=e.formatMethod,r=qA(e,["formatMethod"]),o=n.formatMethod,a=qA(n,["formatMethod"]),s=this.state,l=s.start,u=s.end;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(u);var h=this.getLayoutAttrFromConfig(),c=h.position,d=h.width,f=h.height;this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,te({},r,{text:i?i(this._startValue):this._startValue,x:c.x+l*d,y:c.y+f/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),"data-zoom-start-text-".concat(c)),this._endText=this.maybeAddLabel(this._container,te({},a,{text:o?o(this._endValue):this._endValue,x:c.x+u*d,y:c.y+f/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),"data-zoom-end-text-".concat(c))):(this._startText=this.maybeAddLabel(this._container,te({},r,{text:i?i(this._startValue):this._startValue,x:c.x+d/2,y:c.y+l*f,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),"data-zoom-start-text-".concat(c)),this._endText=this.maybeAddLabel(this._container,te({},a,{text:o?o(this._endValue):this._endValue,x:c.x+d/2,y:c.y+u*f,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),"data-zoom-end-text-".concat(c)))}},{key:"getLayoutAttrFromConfig",value:function(){var t,e,n,i,r,o,a,s,l,u,h,c=this.attribute,d=c.position,f=c.size,p=c.orient,v=c.middleHandlerStyle,g=f.width,y=f.height;return(null==v?void 0:v.visible)?this._isHorizontal?(l=g,u=y-(null!==(e=null===(t=v.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10),h={x:d.x,y:d.y+(null!==(i=null===(n=v.background)||void 0===n?void 0:n.size)&&void 0!==i?i:10)}):(l=g-(null!==(o=null===(r=v.background)||void 0===r?void 0:r.size)&&void 0!==o?o:10),u=y,h={x:d.x+("left"===p?null!==(s=null===(a=v.background)||void 0===a?void 0:a.size)&&void 0!==s?s:10:0),y:d.y}):(l=g,u=y,h=d),{position:h,width:l,height:u}}},{key:"render",value:function(){var t,e,n,i,r,o,a,s,l,u,h,c,d,f,p,v,g,y,m,b,w,x=this.attribute,C=x.orient,_=x.backgroundStyle,k=x.backgroundChartStyle,S=x.selectedBackgroundStyle,A=x.selectedBackgroundChartStyle,B=x.middleHandlerStyle,R=x.startHandlerStyle,T=x.endHandlerStyle,M=x.brushSelect,P=this.state,O=P.start,E=P.end,H=this.getLayoutAttrFromConfig(),L=H.position,I=H.width,D=H.height,j=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=j,this._background=j.createOrUpdateChild("background",Object.assign({x:L.x,y:L.y,width:I,height:D,cursor:M?"crosshair":"auto"},_),"rect"),(null===(t=null==k?void 0:k.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",j),(null===(e=null==k?void 0:k.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",j),M&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=j.createOrUpdateChild("selectedBackground",Object.assign({x:L.x+O*I,y:L.y,width:(E-O)*I,height:D,cursor:M?"crosshair":"move"},S),"rect"):this._selectedBackground=j.createOrUpdateChild("selectedBackground",Object.assign({x:L.x,y:L.y+O*D,width:I,height:(E-O)*D,cursor:M?"crosshair":"move"},S),"rect"),(null===(n=null==A?void 0:A.line)||void 0===n?void 0:n.visible)&&this.setSelectedPreviewAttributes("line",j),(null===(i=null==A?void 0:A.area)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("area",j),this.renderText(),this._isHorizontal?(this._startHandler=j.createOrUpdateChild("startHandler",Object.assign({x:L.x+O*I,y:L.y+D/2,size:D,angle:0,symbolType:null!==(r=null==R?void 0:R.symbolType)&&void 0!==r?r:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},R),"symbol"),this._endHandler=j.createOrUpdateChild("endHandler",Object.assign({x:L.x+E*I,y:L.y+D/2,size:D,angle:0,symbolType:null!==(o=null==T?void 0:T.symbolType)&&void 0!==o?o:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},T),"symbol"),(null==B?void 0:B.visible)&&(this._middleHandlerRect=j.createOrUpdateChild("middleHandlerRect",Object.assign({x:L.x+O*I,y:L.y-((null===(a=null==B?void 0:B.background)||void 0===a?void 0:a.size)||10),width:(E-O)*I,height:(null===(s=null==B?void 0:B.background)||void 0===s?void 0:s.size)||10},null===(l=null==B?void 0:B.background)||void 0===l?void 0:l.style),"rect"),this._middleHandlerSymbol=j.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:L.x+(O+E)/2*I,y:L.y-((null===(u=null==B?void 0:B.background)||void 0===u?void 0:u.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(c=null===(h=null==B?void 0:B.icon)||void 0===h?void 0:h.symbolType)&&void 0!==c?c:"square"},null==B?void 0:B.icon),"symbol"))):(this._startHandler=j.createOrUpdateChild("startHandler",Object.assign({x:L.x+I/2,y:L.y+O*D,size:I,angle:Math.PI/180*90,symbolType:null!==(d=null==R?void 0:R.symbolType)&&void 0!==d?d:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},R),"symbol"),(null==B?void 0:B.visible)&&(this._middleHandlerRect=j.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===C?L.x-((null===(f=null==B?void 0:B.background)||void 0===f?void 0:f.size)||10):L.x+I,y:L.y+O*D,width:(null===(p=null==B?void 0:B.background)||void 0===p?void 0:p.size)||10,height:(E-O)*D},null===(v=null==B?void 0:B.background)||void 0===v?void 0:v.style),"rect"),this._middleHandlerSymbol=j.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===C?L.x-((null===(g=null==B?void 0:B.background)||void 0===g?void 0:g.size)||10)/2:L.x+I+((null===(y=null==B?void 0:B.background)||void 0===y?void 0:y.size)||10)/2,y:L.y+(O+E)/2*D,angle:Math.PI/180*90,symbolType:null!==(b=null===(m=null==B?void 0:B.icon)||void 0===m?void 0:m.symbolType)&&void 0!==b?b:"square",strokeBoundsBuffer:0},null==B?void 0:B.icon),"symbol")),this._endHandler=j.createOrUpdateChild("endHandler",Object.assign({x:L.x+I/2,y:L.y+E*D,size:I,angle:Math.PI/180*90,symbolType:null!==(w=null==T?void 0:T.symbolType)&&void 0!==w?w:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},T),"symbol"))}},{key:"computeBasePoints",value:function(){var t,e,n=this.attribute.orient,i=this.getLayoutAttrFromConfig(),r=i.position,o=i.width,a=i.height;return this._isHorizontal?(t=[{x:r.x,y:r.y+a}],e=[{x:r.x+o,y:r.y+a}]):"left"===n?(t=[{x:r.x+o,y:r.y}],e=[{x:r.x+o,y:r.y+a}]):(t=[{x:r.x,y:r.y+a}],e=[{x:r.x,y:r.y}]),{basePointStart:t,basePointEnd:e}}},{key:"getPreviewLinePoints",value:function(){var t=this,e=this._previewData.map((function(e){return{x:t._previewCallbackX&&t._previewCallbackX(e),y:t._previewCallbackY&&t._previewCallbackY(e)}}));if(0===e.length)return e;var n=this.computeBasePoints(),i=n.basePointStart,r=n.basePointEnd;return i.concat(e).concat(r)}},{key:"getPreviewAreaPoints",value:function(){var t=this,e=this._previewData.map((function(e){return{x:t._previewCallbackX&&t._previewCallbackX(e),y:t._previewCallbackY&&t._previewCallbackY(e),x1:t._previewCallbackX1&&t._previewCallbackX1(e),y1:t._previewCallbackY1&&t._previewCallbackY1(e)}}));if(0===e.length)return e;var n=this.computeBasePoints(),i=n.basePointStart,r=n.basePointEnd;return i.concat(e).concat(r)}},{key:"setPreviewAttributes",value:function(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");var n=this.attribute.backgroundChartStyle;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==n?void 0:n.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==n?void 0:n.area))}},{key:"setSelectedPreviewAttributes",value:function(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");var n=this.attribute,i=n.position,r=n.size,o=n.selectedBackgroundChartStyle,a=r.width,s=r.height,l=this.state,u=l.start,h=l.end,c=this.computeBasePoints();c.basePointStart,c.basePointEnd;this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?i.x+u*a:i.x,y:this._isHorizontal?i.y:i.y+u*s,width:this._isHorizontal?(h-u)*a:a,height:this._isHorizontal?s:(h-u)*s,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?i.x+u*a:i.x),y:-(this._isHorizontal?i.y:i.y+u*s),width:this._isHorizontal?(h-u)*a:a,height:this._isHorizontal?s:(h-u)*s,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==o?void 0:o.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==o?void 0:o.area))}},{key:"maybeAddLabel",value:function(t,e,n){var i=this.find((function(t){return t.name===n}),!0);return i?i.setAttributes(e):(i=new jS(e)).name=n,t.add(i),i}},{key:"setStartAndEnd",value:function(t,e){var n=this.attribute,i=n.start,r=n.end;Et(t)&&Et(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&r===this.state.end||this.setAttributes({start:t,end:e}))}},{key:"setPreviewData",value:function(t){this._previewData=t}},{key:"setText",value:function(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}},{key:"getStartValue",value:function(){return this._startValue}},{key:"getEndTextValue",value:function(){return this._endValue}},{key:"getMiddleHandlerSize",value:function(){var t,e,n,i,r=this.attribute.middleHandlerStyle,o=null!==(e=null===(t=null==r?void 0:r.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,a=null!==(i=null===(n=null==r?void 0:r.icon)||void 0===n?void 0:n.size)&&void 0!==i?i:10;return Math.max.apply(Math,[o].concat(ie(re(a))))}},{key:"setUpdateStateCallback",value:function(t){Pt(t)&&(this._updateStateCallback=t)}},{key:"setPreviewCallbackX",value:function(t){Pt(t)&&(this._previewCallbackX=t)}},{key:"setPreviewCallbackY",value:function(t){Pt(t)&&(this._previewCallbackY=t)}},{key:"setPreviewCallbackX1",value:function(t){Pt(t)&&(this._previewCallbackX1=t)}},{key:"setPreviewCallbackY1",value:function(t){Pt(t)&&(this._previewCallbackY1=t)}},{key:"setStatePointToData",value:function(t){Pt(t)&&(this._statePointToData=t)}}]),n}(zk);function JA(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}ZA.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,backgroundStyle:{fill:!0,fillColor:"white",strokeColor:"#D1DBEE",lineWidth:1,borderRadius:2},dragMaskStyle:{fill:!0,fillColor:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,strokeColor:"#D1DBEE",lineWidth:1,fillColor:"#F6F8FC",fill:!0},line:{visible:!0,strokeColor:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:!0,fillColor:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,strokeColor:"#B0C8F9",lineWidth:1,fillColor:"#fbb934",fill:!0},line:{visible:!0,strokeColor:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!1,background:{size:8,style:{fill:!0,fillColor:"white",strokeColor:"#B0C8F9",borderRadius:2}},icon:{size:6,fill:!0,fillColor:"white",strokeColor:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:!0,fillColor:"white",strokeColor:"#B0C8F9",lineWidth:.5},endHandlerStyle:{symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:!0,fillColor:"white",strokeColor:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},function(t){t.start="start",t.middle="middle",t.end="end",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(YA||(YA={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom"}(XA||(XA={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}($A||($A={}));var QA=function(t){Ke(n,t);var e=JA(n);function n(){return Ae(this,n),e.apply(this,arguments)}return Se(n,[{key:"render",value:function(){var t;this.removeAllChild();var e=null===(t=this.attribute.visible)||void 0===t||t,n=Dv({pickable:!1});n.name="marker-container",this.add(n),e&&this.renderMarker(n)}}]),n}(zk),tB={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:!0,fillColor:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:!0,fillColor:"rgba(46, 47, 50)",lineWidth:0},label:{position:YA.end,refX:0,refY:0,refAngle:0,textStyle:{fill:!0,fillColor:"#fff",strokeColor:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,borderRadius:0,fill:!0,fillColor:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:!0,strokeColor:"#b2bacf",lineWidth:1,lineDash:[2]}},eB={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},nB={label:{position:XA.right,textStyle:{fill:!0,fillColor:"#fff",strokeColor:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,borderRadius:0,fill:!0,fillColor:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fillColor:"#b2bacf",fill:!0,visible:!0}},iB={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},rB={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};function oB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var aB=function(t){Ke(n,t);var e=oB(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"setLabelPos",value:function(){var t,e,n=this.attribute,i=n.points,r=n.label,o=null!==(t=null==r?void 0:r.position)&&void 0!==t?t:"end",a=this._line.getEndAngle(),s=(null==r?void 0:r.refX)*Math.cos(a)+r.refY*Math.cos(a-Math.PI/2),l=(null==r?void 0:r.refX)*Math.sin(a)+r.refY*Math.sin(a-Math.PI/2);o.includes("start")||o.includes("Start")?this._label.setAttributes({x:i[0].x+s,y:i[0].y+l}):o.includes("middle")||o.includes("Middle")?this._label.setAttributes({x:(i[0].x+i[i.length-1].x)/2+s,y:(i[0].y+i[i.length-1].y)/2+l}):this._label.setAttributes({x:i[i.length-1].x+s,y:i[i.length-1].y+l}),this._label.setAttributes({angle:r.autoRotate&&a+(null!==(e=null==r?void 0:r.refAngle)&&void 0!==e?e:0),textStyle:Object.assign(Object.assign({},eB[o]),r.textStyle)})}},{key:"renderMarker",value:function(t){var e=this.attribute,n=e.points,i=e.startSymbol,r=e.endSymbol,o=e.label,a=e.lineStyle,s=new EA({points:n,startSymbol:i,endSymbol:r,lineStyle:a});s.name="mark-line-line",this._line=s,t.add(s);var l=new jS(Object.assign({},o));l.name="mark-line-label",this._label=l,t.add(l),this.setLabelPos()}}]),n}(QA);function sB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}aB.defaultAttributes=tB;var lB=function(t){Ke(n,t);var e=sB(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"getLeftPos",value:function(){return{x:this._area.AABBBounds.x1,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}},{key:"getRightPos",value:function(){return{x:this._area.AABBBounds.x2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}},{key:"getTopPos",value:function(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y1}}},{key:"getBottomPos",value:function(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:this._area.AABBBounds.y2}}},{key:"getMiddlePos",value:function(){return{x:(this._area.AABBBounds.x1+this._area.AABBBounds.x2)/2,y:(this._area.AABBBounds.y1+this._area.AABBBounds.y2)/2}}},{key:"setLabelPos",value:function(){var t,e=this.attribute.label,n=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:"middle";n.includes("left")||n.includes("Left")?this._label.setAttributes(Object.assign({},this.getLeftPos())):n.includes("right")||n.includes("Right")?this._label.setAttributes(Object.assign({},this.getRightPos())):n.includes("top")||n.includes("Top")?this._label.setAttributes(Object.assign({},this.getTopPos())):n.includes("bottom")||n.includes("Bottom")?this._label.setAttributes(Object.assign({},this.getBottomPos())):this._label.setAttributes(Object.assign({},this.getMiddlePos())),this._label.setAttributes({textStyle:Object.assign(Object.assign({},iB[n]),e.textStyle)})}},{key:"renderMarker",value:function(t){var e=this.attribute,n=e.points,i=e.label,r=e.areaStyle,o=Uv(Object.assign({points:n},r));o.name="mark-area-area",this._area=o,t.add(o);var a=new jS(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}}]),n}(QA);function uB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}lB.defaultAttributes=nB;var hB=function(t){Ke(n,t);var e=uB(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"setLabelPos",value:function(){}},{key:"setItemAttributes",value:function(t,e,n,i){var r,o=e.autoRotate,a=void 0===o||o,s=e.refX,l=void 0===s?0:s,u=e.refY,h=void 0===u?0:u,c=e.refAngle,d=void 0===c?0:c,f=e.textStyle,p=e.richTextStyle,v=e.imageStyle,g=e.position,y=void 0===g?$A.middle:g,m=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,b=l*Math.cos(m)+h*Math.cos(m-Math.PI/2),w=l*Math.sin(m)+h*Math.sin(m-Math.PI/2);"text"===i?t.setAttributes(Object.assign(Object.assign({},f),{textStyle:Object.assign(Object.assign({},rB[(null==e?void 0:e.position)||"end"]),null==f?void 0:f.textStyle)})):"richText"===i?t.setAttributes({dx:this.getItemDx(t,y,p)+((null==p?void 0:p.dx)||0),dy:this.getItemDy(t,y,p)+((null==p?void 0:p.dy)||0)}):"image"===i&&t.setAttributes({dx:this.getItemDx(t,y,v)+((null==v?void 0:v.dx)||0),dy:this.getItemDy(t,y,v)+((null==v?void 0:v.dy)||0)}),t.setAttributes({x:n.x+(b||0),y:n.y+(w||0),angle:a&&m+d})}},{key:"getItemDx",value:function(t,e,n){var i,r,o=null!==(r=null===(i=null==t?void 0:t.AABBBounds)||void 0===i?void 0:i.width())&&void 0!==r?r:(null==n?void 0:n.width)||0;return e.includes("inside")?-o:0}},{key:"getItemDy",value:function(t,e,n){var i,r,o=null!==(r=null===(i=null==t?void 0:t.AABBBounds)||void 0===i?void 0:i.height())&&void 0!==r?r:(null==n?void 0:n.height)||0;return e.includes("top")||e.includes("Top")?-o:e.includes("middle")||e.includes("Middle")?-o/2:0}},{key:"renderItem",value:function(t,e){var n,i=t.type,r=void 0===i?"text":i,o=t.symbolStyle,a=t.richTextStyle,s=t.imageStyle,l=t.renderCustomCallback;return"symbol"===r?n=Nv(Object.assign(Object.assign({},e),o)):"text"===r?n=new jS(Object.assign({},e)):"richText"===r?n=Vv(Object.assign(Object.assign({},e),a)):"image"===r?n=Gv(Object.assign(Object.assign({},e),s)):"custom"===r&&l&&(n=l()),this.setItemAttributes(n,t,e,r),n}},{key:"renderItemLine",value:function(t,e,n){var i,r=t.startSymbol,o=t.endSymbol,a=t.lineStyle,s=t.type,l=void 0===s?"type-s":s;return i="type-do"===l?[e,{x:(e.x+n.x)/2,y:n.y},n]:"type-po"===l?[e,{x:n.x,y:e.y},n]:"type-op"===l?[e,{x:e.x,y:n.y},n]:[e,n],new EA({points:i,startSymbol:r,endSymbol:o,lineStyle:a})}},{key:"renderDecorativeLine",value:function(t,e){var n,i=t.lineStyle,r=(null===(n=null==t?void 0:t.decorativeLine)||void 0===n?void 0:n.length)||10,o=this._line.getEndAngle()||0,a=r/2*Math.cos(o-Math.PI/2),s=r/2*Math.sin(o-Math.PI/2),l=-r/2*Math.cos(o-Math.PI/2),u=-r/2*Math.sin(o-Math.PI/2);return jv(Object.assign({points:[{x:e.x+a,y:e.y+s},{x:e.x+l,y:e.y+u}]},i))}},{key:"renderMarker",value:function(t){var e,n=this.attribute,i=n.position,r=n.itemLine,o=n.itemContent,a={x:i.x+((null==o?void 0:o.offsetX)||0),y:i.y+((null==o?void 0:o.offsetY)||0)};if(null==r?void 0:r.visible){var s=this.renderItemLine(r,i,a);if(s.name="mark-point-line",this._line=s,t.add(s),null===(e=null==r?void 0:r.decorativeLine)||void 0===e?void 0:e.visible){var l=this.renderDecorativeLine(r,a);l.name="mark-point-decorativeLine",this._decorativeLine=l,t.add(l)}}var u=this.renderItem(o,a);this._item=u,t.add(u)}}]),n}(QA);function cB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}hB.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,fillColor:"rgba(46, 47, 50)",strokeColor:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,fillColor:"rgba(46, 47, 50)",strokeColor:"rgba(46, 47, 50)"}},lineStyle:{stroke:!0,strokeColor:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:!0,fillColor:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};var dB={space:8,style:{fill:!0,fillColor:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fillColor:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}},fB=function(t){Ke(n,t);var e=cB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="pager",i._current=1,i._onHover=function(t){var e=t.target;e.hasState("disable")||e.addState("hover")},i._onUnHover=function(t){t.target.removeState("hover")},i._onClick=function(t){var e,n,r=t.target;if("preHandler"===r.name){if(1===i._current)return;i._current-=1,1===i._current?r.addState("disable"):r.removeState("disable");var o=new Is("toPrev",{current:i._current,total:i._total,direction:"pre"});o.manager=null===(e=i.stage)||void 0===e?void 0:e.eventSystem.manager,i.dispatchEvent(o)}if("nextHandler"===r.name){if(i._current===i._total)return;i._current+=1,i._current===i._total?r.addState("disable"):r.removeState("disable");var a=new Is("toNext",{current:i._current,total:i._total,direction:"next"});a.manager=null===(n=i.stage)||void 0===n?void 0:n.eventSystem.manager,i.dispatchEvent(a)}i._current>1&&i.preHandler.removeState("disable"),i._current<i._total&&i.nextHandler.removeState("disable"),i.text.setAttribute("text","".concat(i._current,"/").concat(i._total))},i}return Se(n,[{key:"getCurrent",value:function(){return this._current}},{key:"render",value:function(){var t;this._reset();var e=this.attribute,n=e.layout,i=void 0===n?"horizontal":n,r=e.handler,o=void 0===r?dB:r,a=e.total,s=e.defaultCurrent,l=void 0===s?1:s,u=e.textStyle,h=e.padding,c=void 0===h?0:h;this._current=l;var d=In(c),f="horizontal"===i,p=Dv({x:0,y:0}),v=o.style||{},g=v.size||15,y=null!==(t=o.space)&&void 0!==t?t:8,m=o.state||{},b=o.preShape,w=o.nextShape;b||(b=f?"triangleLeft":"triangleUp"),w||(w=f?"triangleRight":"triangleDown");var x=Nv(Object.assign(Object.assign({strokeBoundsBuffer:0},v),{x:0,y:0,symbolType:b,size:g}));x.states=m,x.name="preHandler",this.preHandler=x,p.add(x);var C=LS("".concat(a,"/").concat(a),Object.assign({textAlign:"center",textBaseline:"middle"},u)),_=C.width,k=C.height,S=Nt(g)?g:g[0],A=Nt(g)?g:g[1],B=zv(Object.assign({x:f?S/2+y+_/2:0,y:f?0:A/2+y+k/2,text:"".concat(l,"/").concat(a),textAlign:"center",textBaseline:"middle",lineHeight:null==u?void 0:u.fontSize},u));this.text=B,p.add(B);var R=Nv(Object.assign(Object.assign({strokeBoundsBuffer:0},v),{x:f?S+2*y+_:0,y:f?0:A+2*y+k,symbolType:w,size:g}));R.name="nextHandler",R.states=m,this.nextHandler=R,p.add(R),1===this._total?(x.addState("disable"),R.addState("disable")):1===this._current?x.addState("disable"):this._current===a&&R.addState("disable");var T=p.AABBBounds,M=T.width(),P=T.height();p.translateTo(0-T.x1+d[3],0-T.y1+d[0]),this.add(p),this.attribute.width=M+d[1]+d[3],this.attribute.height=P+d[0]+d[2],this._bindEvents()}},{key:"_bindEvents",value:function(){this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick))}},{key:"_reset",value:function(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}]),n}(zk);fB.defaultAttributes={handler:dB,textStyle:{fillColor:"rgb(51, 51, 51)",fontSize:12}};var pB,vB,gB;function yB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(pB||(pB={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick"}(vB||(vB={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(gB||(gB={}));var mB,bB=function(t){Ke(n,t);var e=yB(n);function n(){var t;return Ae(this,n),(t=e.apply(this,arguments)).name="legend",t._title=null,t}return Se(n,[{key:"render",value:function(){this.removeAllChild();var t=this.attribute,e=t.interactive,n=void 0===e||e,i=t.title,r=t.padding,o=In(void 0===r?0:r),a=Dv({x:o[3],y:o[0],pickable:n,childrenPickable:n});a.name=gB.innerView,this.add(a),this._innerView=a,(null==i?void 0:i.visible)&&this._renderTitle(i),this._renderContent(),this._adjustLayout(),n&&this._bindEvents();var s=this._innerView.AABBBounds;this.attribute.width=s.width()+o[1]+o[3],this.attribute.height=s.height()+o[0]+o[2]}},{key:"_renderTitle",value:function(t){var e=t.text,n=void 0===e?"":e,i=t.textStyle,r=t.padding,o=void 0===r?0:r,a=t.background,s=t.minWidth,l=t.maxWidth,u=t.shape,h={x:0,y:0,text:n,textStyle:i,padding:In(o),minWidth:s,maxWidth:l};u&&u.visible&&(h.shape=Object.assign({visible:!0},u.style),Et(u.space)&&(h.space=u.space)),a&&a.visible&&(h.panel=Object.assign({visible:!0},a.style));var c=new jS(h);c.name=gB.title,this._title=c,this._innerView.add(c)}},{key:"_adjustLayout",value:function(){var t;if(this._title){var e=this._innerView.AABBBounds.width(),n=this._title.AABBBounds.width(),i=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===i?this._title.setAttribute("x",(e-n)/2):"end"===i&&this._title.setAttribute("x",e-n)}}}]),n}(zk);function wB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var xB,CB=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},_B=(Bs(mB={},pB.focus,{}),Bs(mB,pB.selected,{}),Bs(mB,pB.selectedHover,{}),Bs(mB,pB.unSelected,{}),Bs(mB,pB.unSelectedHover,{}),mB),kB=function(t){Ke(n,t);var e=wB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="discreteLegend",i._itemsContainer=null,i._itemHeightByUser=void 0,i._itemHeight=0,i._itemMaxWidth=0,i._onHover=function(t){var e,n=t.target;if(null===(e=null==n?void 0:n.name)||void 0===e?void 0:e.startsWith(gB.item)){var r=n.delegate;r.hasState(pB.selected)?i._setLegendItemState(r,pB.selectedHover):i._setLegendItemState(r,pB.unSelectedHover);var o=r.getChildren()[0].find((function(t){return t.name===gB.focus}),!1);o&&o.setAttribute("visible",!0),i._dispatchEvent(vB.legendItemHover,r)}},i._onUnHover=function(t){var e,n=t.target;if(null===(e=null==n?void 0:n.name)||void 0===e?void 0:e.startsWith(gB.item)){var r=n.delegate;r.removeState(pB.unSelectedHover),r.removeState(pB.selectedHover),r.getChildren()[0].getChildren().forEach((function(t){t.removeState(pB.unSelectedHover),t.removeState(pB.selectedHover)}));var o=r.getChildren()[0].find((function(t){return t.name===gB.focus}),!1);o&&o.setAttribute("visible",!1),i._dispatchEvent(vB.legendItemUnHover,r)}},i._onClick=function(t){var e,n,r,o,a,s=t.target;if(null===(e=null==s?void 0:s.name)||void 0===e?void 0:e.startsWith(gB.item)){var l=s.delegate;if(s.name===gB.focus){var u=l.hasState(pB.focus);l.toggleState(pB.focus),u?null===(n=i._itemsContainer)||void 0===n||n.getChildren().forEach((function(t){i._removeLegendItemState(t,[pB.unSelected,pB.unSelectedHover,pB.focus]),i._setLegendItemState(t,pB.selected)})):(i._setLegendItemState(l,pB.selected),i._removeLegendItemState(l,[pB.unSelected,pB.unSelectedHover]),null===(r=i._itemsContainer)||void 0===r||r.getChildren().forEach((function(t){l!==t&&(i._removeLegendItemState(t,[pB.selected,pB.selectedHover,pB.focus]),i._setLegendItemState(t,pB.unSelected))})))}else{null===(o=i._itemsContainer)||void 0===o||o.getChildren().forEach((function(t){t.removeState(pB.focus)}));var h=i.attribute,c=h.selectMode,d=void 0===c?"multiple":c,f=h.allowAllCanceled,p=void 0===f||f,v=l.hasState(pB.selected),g=i._getSelectedLegends();if("multiple"===d){if(!1===p&&v&&1===g.length)return void i._dispatchEvent(vB.legendItemClick,l);v?(i._removeLegendItemState(l,[pB.selected,pB.selectedHover]),i._setLegendItemState(l,pB.unSelected)):(i._setLegendItemState(l,pB.selected),i._removeLegendItemState(l,[pB.unSelected,pB.unSelectedHover]))}else i._setLegendItemState(l,pB.selected),i._removeLegendItemState(l,[pB.unSelected,pB.unSelectedHover]),null===(a=i._itemsContainer)||void 0===a||a.getChildren().forEach((function(t){l!==t&&(i._removeLegendItemState(t,[pB.selected,pB.selectedHover]),i._setLegendItemState(t,pB.unSelected))}))}i._dispatchEvent(vB.legendItemClick,l)}},i}return Se(n,[{key:"setSelected",value:function(t){var e,n=this;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((function(e){var i=e.data;t.includes(i.label)?(n._setLegendItemState(e,pB.selected),n._removeLegendItemState(e,[pB.unSelected,pB.unSelectedHover])):(n._removeLegendItemState(e,[pB.selected,pB.selectedHover]),n._setLegendItemState(e,pB.unSelected))}))}},{key:"_renderContent",value:function(){var t=this,e=this.attribute,n=e.item,i=void 0===n?{}:n,r=e.items,o=e.reversed,a=e.maxCol,s=void 0===a?1:a,l=e.maxRow,u=void 0===l?2:l;if(!1!==i.visible&&!Kt(r)){var h=r;o&&(h=null==r?void 0:r.reverse());var c=Dv({x:0,y:0});this._itemsContainer=c;var d=this.attribute,f=d.layout,p=d.maxWidth,v=d.maxHeight,g=d.defaultSelected,y=void 0===g?[]:g,m=d.autoPage,b="horizontal"===f,w=i.spaceCol,x=void 0===w?16:w,C=i.spaceRow,_=void 0===C?8:C,k=i.maxWidth,S=i.width,A=i.height;Et(k)?Et(S)?this._itemWidthByUser=Math.min(k,S):this._itemWidthByUser=k:Et(S)&&(this._itemWidthByUser=S),Et(A)&&(this._itemHeightByUser=A);var B=!1,R=0,T=0,M=0,P=1,O=1;h.forEach((function(e,n){e.id||(e.id=e.label),e.index=n;var i=t._renderEachItem(e,!!Kt(y)||(null==y?void 0:y.includes(e.label)),n),r=i.attribute.width,o=i.attribute.height;t._itemHeight=Math.max(t._itemHeight,o),R=Math.max(r,R),t._itemMaxWidth=Math.max(r,t._itemMaxWidth),b?(P=u,Et(p)&&p<T+r&&(B=!0,T=0,M+=o+_,O+=1),n>0&&i.setAttributes({x:T,y:M}),T+=x+r):(P=s,Et(v)&&v<M+o&&(B=!0,M=0,T+=R+x,R=0,O+=1),n>0&&i.setAttributes({x:T,y:M}),M+=_+o),c.add(i)})),B&&m&&O>P?this._renderPager(b):(c.setAttribute("y",this._title?this._title.AABBBounds.height()+Yt(this.attribute,"title.space",8):0),this._innerView.add(c))}}},{key:"_bindEvents",value:function(){if(this._itemsContainer){var t=this.attribute,e=t.hover,n=void 0===e||e,i=t.select,r=void 0===i||i;n&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerout",this._onUnHover)),r&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}}},{key:"_renderEachItem",value:function(t,e,n){t.id;var i,r=t.label,o=t.value,a=t.shape,s=this.attribute.item,l=s.shape,u=void 0===l?{}:l,h=s.label,c=void 0===h?{}:h,d=s.value,f=void 0===d?{}:d,p=s.padding,v=void 0===p?0:p,g=s.background,y=s.focus,m=s.focusIconStyle,b=void 0===m?{}:m,w=In(v);!1===g.visible?(i=Dv({x:0,y:0,cursor:null==g?void 0:g.style.cursor}),this._appendDataToShape(i,gB.item,t,i)):(i=Dv(Object.assign({x:0,y:0},null==g?void 0:g.style)),this._appendDataToShape(i,gB.item,t,i,null==g?void 0:g.state)),i.addState(e?pB.selected:pB.unSelected);var x=Dv({x:0,y:0,pickable:!1});i.add(x);var C,_=0,k=Yt(u,"style.size",10),S=Yt(u,"space",8),A=Nv(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},a),u.style));this._appendDataToShape(A,gB.itemShape,t,i,null==u?void 0:u.state),Object.keys(u.state).forEach((function(t){Mt(a.fill)&&Ot(u.state[t].fill)&&(u.state[t].fill=a.fill),Mt(a.stroke)&&Ot(u.state[t].stroke)&&(u.state[t].stroke=a.stroke)})),A.addState(e?pB.selected:pB.unSelected),x.add(A);var B=0;if(y){var R=Yt(b,"size",10);C=Nv(Object.assign(Object.assign({x:0,y:-R/2-1,strokeBoundsBuffer:0},b),{visible:!1,pickMode:"imprecise",boundsPadding:w})),this._appendDataToShape(C,gB.focus,t,i),B=R}var T=zv(Object.assign(Object.assign({x:k/2+S,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null==c?void 0:c.style.fontSize},null==c?void 0:c.style),{text:c.formatMethod?c.formatMethod(r,t,n):r}));this._appendDataToShape(T,gB.itemLabel,t,i,null==c?void 0:c.state),T.addState(e?pB.selected:pB.unSelected),x.add(T);var M=Yt(c,"space",8);if(_+=k/2+S+T.AABBBounds.width()+M,Et(o)){var P=Yt(f,"space",y?8:0),O=zv(Object.assign(Object.assign({x:_+M,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null==f?void 0:f.style.fontSize},null==f?void 0:f.style),{text:f.formatMethod?f.formatMethod(o,t,n):o}));this._appendDataToShape(O,gB.itemValue,t,i,null==f?void 0:f.state),O.addState(e?pB.selected:pB.unSelected),this._itemWidthByUser&&(O.setAttribute("maxLineWidth",this._itemWidthByUser-w[1]-w[3]-k-S-T.AABBBounds.width()-M-B-P),f.alignRight&&O.setAttributes({textAlign:"right",x:this._itemWidthByUser-k/2-w[1]-w[3]-B-P})),_=O.AABBBounds.x2+P,x.add(O)}else this._itemWidthByUser&&T.setAttribute("maxLineWidth",this._itemWidthByUser-w[1]-w[3]-k-S-B);C&&(C.setAttribute("x",_),x.add(C));var E=x.AABBBounds,H=E.width(),L=E.height(),I=this._itemWidthByUser||H+w[1]+w[3],D=this._itemHeightByUser||L+w[0]+w[2];return i.attribute.width=I,i.attribute.height=D,x.translateTo(-E.x1+w[3],-E.y1+w[0]),i}},{key:"_renderPager",value:function(t){var e,n=this,i=this._title?this._title.AABBBounds.height()+Yt(this.attribute,"title.space",8):0,r=this.attribute,o=r.maxWidth,a=r.maxHeight,s=r.maxCol,l=void 0===s?1:s,u=r.maxRow,h=void 0===u?2:u,c=r.item,d=void 0===c?{}:c,f=r.pager,p=void 0===f?{}:f,v=d.spaceCol,g=void 0===v?16:v,y=d.spaceRow,m=void 0===y?8:y,b=this._itemsContainer,w=p.animation,x=void 0===w||w,C=p.animationDuration,_=void 0===C?450:C,k=p.animationEasing,S=void 0===k?"quadIn":k,A=p.space,B=void 0===A?12:A,R=CB(p,["animation","animationDuration","animationEasing","space"]),T=0,M=0,P=0,O=0,E=1;t?(e=new fB(Object.assign({layout:1===h?"horizontal":"vertical",total:99},te({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},R))),this._pager=e,this._innerView.add(e),T=(h-1)*m+this._itemHeight*h,M=o-e.AABBBounds.width()-B,b.getChildren().forEach((function(t,e){var n=t.attribute,i=n.width,r=n.height;M<P+i&&(P=0,O+=r+m,E+=1),e>0&&t.setAttributes({x:P,y:O}),P+=g+i})),e.setAttributes({total:Math.ceil(E/h),x:M,y:i+T/2-e.AABBBounds.height()/2})):(e=new fB(Object.assign({layout:"horizontal",total:99},R)),this._pager=e,this._innerView.add(e),M=this._itemMaxWidth*l+(l-1)*g,T=a-e.AABBBounds.height()-B-i,b.getChildren().forEach((function(t,e){var i=t.attribute.height;T<O+i&&(O=0,P+=n._itemMaxWidth+g,E+=1),e>0&&t.setAttributes({x:P,y:O}),O+=m+i})),e.setAttributes({total:Math.ceil(E/l),x:(M-e.AABBBounds.width())/2,y:a-e.AABBBounds.height()})),p.defaultCurrent>1&&(t?b.setAttribute("y",-(p.defaultCurrent-1)*(T+m)):b.setAttribute("x",-(p.defaultCurrent-1)*(M+g)));var H=Dv({x:0,y:i,width:M,height:T,clip:!0,pickable:!1});H.add(b),this._innerView.add(H);var L=function(e){var n=e.detail.current;x?b.animate().to(t?{y:-(n-1)*(T+m)}:{x:-(n-1)*(M+g)},_,S):t?b.setAttribute("y",-(n-1)*(T+m)):b.setAttribute("x",-(n-1)*(M+g))};this._pager.addEventListener("toPrev",L),this._pager.addEventListener("toNext",L)}},{key:"_setLegendItemState",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t.addState(e,n),t.getChildren()[0].getChildren().forEach((function(t){t.name!==gB.focus&&t.addState(e,n)}))}},{key:"_removeLegendItemState",value:function(t,e){e.forEach((function(e){t.removeState(e)})),t.getChildren()[0].getChildren().forEach((function(t){t.name!==gB.focus&&e.forEach((function(e){t.removeState(e)}))}))}},{key:"_getSelectedLegends",value:function(){var t,e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((function(t){t.hasState(pB.selected)&&e.push(t.data)})),e}},{key:"_appendDataToShape",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t.name=e,t.data=n,t.delegate=i,t.states=te({},_B,r)}},{key:"_dispatchEvent",value:function(t,e){var n,i=this._getSelectedLegends();i.sort((function(t,e){return t.index-e.index}));var r=i.map((function(t){return t.label})),o=new Is(t,{item:e,data:e.data,selected:e.hasState(pB.selected),currentSelectedItems:i,currentSelected:r});o.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(o)}}]),n}(bB);function SB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function AB(t){return Wt(t)?t:[t,t]}function BB(t){return t?"ew-resize":"ns-resize"}kB.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fillColor:"#2C3542"}},item:{spaceCol:16,spaceRow:8,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fillColor:"#D8D8D8",strokeColor:"#D8D8D8"}}},label:{space:8,style:{fontSize:12,fillColor:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fillColor:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fillColor:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fillColor:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fillColor:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(xB||(xB={}));var RB=function(t){Ke(n,t);var e=SB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="slider",i._isHorizontal=!0,i._startHandler=null,i._endHandler=null,i._startHandlerText=null,i._endHandlerText=null,i._currentHandler=null,i._currentValue={},i._onHandlerPointerdown=function(t){t.stopPropagation(),i._currentHandler=t.target,i._prePos=i._isHorizontal?t.clientX:t.clientY,"browser"===TC.env?(TC.addEventListener("pointermove",i._onHandlerPointerMove),TC.addEventListener("pointerup",i._onHandlerPointerUp)):(i._currentHandler.addEventListener("pointermove",i._onHandlerPointerMove),i._currentHandler.addEventListener("pointerup",i._onHandlerPointerUp),i._currentHandler.addEventListener("pointerupoutside",i._onHandlerPointerUp))},i._onHandlerPointerMove=function(t){var e,n;t.stopPropagation();var r,o,a,s=i.attribute,l=s.railWidth,u=s.railHeight,h=s.min,c=s.max,d=0;i._isHorizontal?(d=(r=t.clientX)-i._prePos,o=null===(n=i._currentHandler)||void 0===n?void 0:n.attribute.x,a=l):(d=(r=t.clientY)-i._prePos,o=null===(e=i._currentHandler)||void 0===e?void 0:e.attribute.y,a=u);var f=pe(o+d,0,a),p=f/a*(c-h)+h;"text"===i._currentHandler.type?i._updateHandlerText(i._currentHandler,f,p):i._updateHandler(i._currentHandler,f,p),i._updateTrack(),i._prePos=r,i._dispatchChangeEvent()},i._onHandlerPointerUp=function(t){if(t.preventDefault(),i._currentHandler=null,"browser"===TC.env)TC.removeEventListener("pointermove",i._onHandlerPointerMove),TC.removeEventListener("pointerup",i._onHandlerPointerUp);else{var e=t.target;e.removeEventListener("pointermove",i._onHandlerPointerMove),e.removeEventListener("pointerup",i._onHandlerPointerUp),e.removeEventListener("pointerupoutside",i._onHandlerPointerUp)}},i._onTrackPointerdown=function(t){t.stopPropagation(),i._prePos=i._isHorizontal?t.clientX:t.clientY,"browser"===TC.env?(TC.addEventListener("pointermove",i._onTrackPointerMove),TC.addEventListener("pointerup",i._onTrackPointerUp)):(i._track.addEventListener("pointermove",i._onTrackPointerMove),i._track.addEventListener("pointerup",i._onTrackPointerUp),i._track.addEventListener("pointerupoutside",i._onTrackPointerUp))},i._onTrackPointerMove=function(t){t.stopPropagation();var e,n,r,o=i.attribute,a=o.railWidth,s=o.railHeight,l=o.min,u=o.max,h=i._getHandlers(),c=h.startHandler,d=h.endHandler;i._isHorizontal?(e=t.clientX,n=i._track.attribute.width,r=a):(e=t.clientY,n=i._track.attribute.height,r=s);var f=e-i._prePos;if(c){var p=i._isHorizontal?c.attribute.x:c.attribute.y,v=pe(p+f,0,r-n),g=v/r*(u-l)+l;i._updateHandler(c,v,g)}if(d){var y=i._isHorizontal?d.attribute.x:d.attribute.y,m=pe(y+f,n,r),b=m/r*(u-l)+l;i._updateHandler(d,m,b),i._track.setAttributes(i._isHorizontal?{x:Math.min(null==c?void 0:c.attribute.x,null==d?void 0:d.attribute.x),width:Math.abs((null==c?void 0:c.attribute.x)-(null==d?void 0:d.attribute.x))}:{y:Math.min(null==c?void 0:c.attribute.y,null==d?void 0:d.attribute.y),height:Math.abs((null==c?void 0:c.attribute.y)-(null==d?void 0:d.attribute.y))})}i._prePos=e,i._dispatchChangeEvent()},i._onTrackPointerUp=function(t){t.preventDefault(),"browser"===TC.env?(TC.removeEventListener("pointermove",i._onTrackPointerMove),TC.removeEventListener("pointerup",i._onTrackPointerUp)):(i._track.removeEventListener("pointermove",i._onTrackPointerMove),i._track.removeEventListener("pointerup",i._onTrackPointerUp),i._track.removeEventListener("pointerupoutside",i._onTrackPointerUp))},i._onRailPointerDown=function(t){t.stopPropagation();var e,n,r,o,a=i.attribute,s=a.railWidth,l=a.railHeight,u=a.min,h=a.max,c=i._startHandler,d=i._endHandler;i._isHorizontal?(e=t.viewX-i._rail.globalAABBBounds.x1,n=null==c?void 0:c.attribute.x,r=null==d?void 0:d.attribute.x,o=s):(e=t.viewY-i._rail.globalAABBBounds.y1,n=null==c?void 0:c.attribute.y,r=null==d?void 0:d.attribute.y,o=l);var f=e/o*(h-u)+u;if(Et(r)){var p=Math.abs(e-n)>Math.abs(e-r)?d:c;i._updateHandler(p,e,f)}else i._updateHandler(c,e,f);i._updateTrack(),i._dispatchChangeEvent()},i}return Se(n,[{key:"track",get:function(){return this._track}},{key:"currentValue",get:function(){return this._currentValue}},{key:"startHandler",get:function(){return this._startHandler}},{key:"endHandler",get:function(){return this._endHandler}},{key:"setValue",value:function(t){var e=ve(re(t),2),n=e[0],i=e[1],r=this.attribute,o=r.layout,a=r.railWidth,s=r.railHeight,l=r.min,u=r.max,h=this._getHandlers(),c=h.startHandler,d=h.endHandler,f="vertical"===o?s:a,p=(n-l)/(u-l)*f;if(c&&this._updateHandler(c,p,n),d){var v=(i-l)/(u-l)*f;this._updateHandler(d,v,i)}this._updateTrack()}},{key:"render",value:function(){var t,e;this.removeAllChild();var n=this.attribute,i=n.layout,r=void 0===i?"horizontal":i,o=n.railWidth,a=n.railHeight,s=n.startText,l=n.endText,u=n.min,h=n.max,c=n.showHandler,d=void 0===c||c,f=this.attribute.value;Ot(f)&&(f=[u,h]),this._currentValue={startValue:AB(f)[0],endValue:AB(f)[1]};var p="horizontal"===r;this._isHorizontal=p;var v=Dv({x:0,y:0});v.name=xB.innerView,this.add(v),this._innerView=v;var g,y=0;if(s&&s.visible){(g=zv(Object.assign({x:p?0:o/2,y:p?a/2:0,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:s.text,lineHeight:null===(t=s.style)||void 0===t?void 0:t.fontSize},s.style))).name=xB.startText,v.add(g);var m=Et(s.space)?s.space:0;y+=(p?g.AABBBounds.width():g.AABBBounds.height())+m}var b=Dv({x:p?y:0,y:p?0:y});v.add(b);var w,x=Dv({x:0,y:0});if(x.name=xB.railContainer,this._railContainer=x,b.add(x),this._renderRail(x),y+=p?o:a,l&&l.visible){var C=Et(l.space)?l.space:0;(w=zv(Object.assign({x:p?y+C:o/2,y:p?a/2:y+C,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:l.text,lineHeight:null===(e=l.style)||void 0===e?void 0:e.fontSize},l.style))).name=xB.endText,v.add(w)}this._renderTrack(x),d&&(this._renderHandlers(b),this._bindEvents())}},{key:"_renderRail",value:function(t){var e=this.attribute,n=e.railWidth,i=e.railHeight,r=e.railStyle,o="default";!1!==e.slidable&&(o="pointer");var a=Fv(Object.assign({x:0,y:0,width:n,height:i,cursor:o},r));return a.name=xB.rail,t.add(a),this._rail=a,a}},{key:"_renderHandlers",value:function(t){var e=this.attribute,n=e.range,i=e.min,r=e.max,o=e.handlerSize,a=void 0===o?14:o,s=e.handlerStyle,l=e.handlerText,u=e.railHeight,h=e.railWidth,c=e.slidable,d=this.attribute.value;Ot(d)&&(d=[i,r]);var f=l&&l.visible,p=this._isHorizontal,v=p?h:u,g=ve(AB(d),2),y=g[0],m=g[1],b=(y-i)/(r-i)*v,w=this._renderHandler(Object.assign({x:p?b:h/2,y:p?u/2:b,size:a,strokeBoundsBuffer:0,cursor:!1===c?"default":BB(p)},s));if(w.name=xB.startHandler,this._startHandler=w,t.add(w),this._currentValue.startPos=b,f){var x=this._renderHandlerText(y);x.name=xB.startHandlerText,t.add(x),this._startHandlerText=x}if(n){var C=(m-i)/(r-i)*v,_=this._renderHandler(Object.assign({x:p?C:h/2,y:p?u/2:C,size:a,strokeBoundsBuffer:0,cursor:!1===c?"default":BB(p)},s));_.name=xB.endHandler,this._endHandler=_,t.add(_),this._currentValue.endPos=C}if(f){var k=this._renderHandlerText(m);k.name=xB.endHandlerText,t.add(k),this._endHandlerText=k}}},{key:"_renderTrack",value:function(t){var e=this.attribute,n=e.range,i=e.min,r=e.max,o=e.railHeight,a=e.railWidth,s=e.trackStyle,l=e.railStyle,u=e.slidable,h=this.attribute.value;Ot(h)&&(h=[i,r]);var c=this._isHorizontal,d=c?a:o,f=ve(AB(h),2),p=f[0],v=f[1];n||(p=i);var g=Dv({x:0,y:0,width:a,height:o,borderRadius:null==l?void 0:l.borderRadius,clip:!0,pickable:!1});g.name=xB.trackContainer;var y,m=Lt(n)&&!0===n.draggableTrack;y=!1===u?"default":!1===n||!1===m?"pointer":BB(c);var b=(v-p)/(r-i)*d,w=Fv(Object.assign({x:c?(p-i)/(r-i)*d:0,y:c?0:(p-i)/(r-i)*d,width:c?b:a,height:c?o:b,cursor:y},s));w.name=xB.track,this._track=w,g.add(w),t.add(g)}},{key:"_renderHandler",value:function(t){return Nv(t)}},{key:"_renderHandlerText",value:function(t){var e,n,i,r=this.attribute,o=r.align,a=r.min,s=r.max,l=r.handlerSize,u=void 0===l?14:l,h=r.handlerText,c=void 0===h?{}:h,d=r.railHeight,f=r.railWidth,p=r.slidable,v=this._isHorizontal,g=(t-a)/(s-a)*(v?f:d),y=null!==(e=c.space)&&void 0!==e?e:4,m=Object.assign({text:(null==c?void 0:c.formatter)?c.formatter(t):t.toFixed(null!==(n=null==c?void 0:c.precision)&&void 0!==n?n:0),lineHeight:null===(i=c.style)||void 0===i?void 0:i.lineHeight,cursor:!1===p?"default":BB(v)},c.style);return v?"top"===o?(m.textBaseline="bottom",m.textAlign="center",m.x=g,m.y=(d-u)/2-y):(m.textBaseline="top",m.textAlign="center",m.x=g,m.y=(d+u)/2+y):"left"===o?(m.textBaseline="middle",m.textAlign="end",m.x=(f-u)/2-y,m.y=g):(m.textBaseline="middle",m.textAlign="start",m.x=(f+u)/2+y,m.y=g),zv(m)}},{key:"_bindEvents",value:function(){var t=this.attribute,e=t.slidable,n=t.range;e&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),Lt(n)&&n.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}},{key:"_updateTrack",value:function(){var t=this._startHandler,e=this._endHandler;if(this._isHorizontal){var n=null==t?void 0:t.attribute.x;if(e){var i=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(n,i),width:Math.abs(n-i)})}else this._track.setAttributes({width:n})}else{var r=null==t?void 0:t.attribute.y;if(e){var o=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(r,o),height:Math.abs(r-o)})}else this._track.setAttributes({height:r})}}},{key:"_updateHandler",value:function(t,e,n){var i,r=this._isHorizontal;t.setAttribute(r?"x":"y",e);var o=t.name===xB.startHandler?this._startHandlerText:this._endHandlerText;if(o){var a=this.attribute.handlerText;null==o||o.setAttributes(Bs({text:(null==a?void 0:a.formatter)?a.formatter(n):n.toFixed(null!==(i=null==a?void 0:a.precision)&&void 0!==i?i:0)},r?"x":"y",e))}t.name===xB.startHandler?(this._currentValue.startValue=n,this._currentValue.startPos=e):(this._currentValue.endValue=n,this._currentValue.endPos=e)}},{key:"_updateHandlerText",value:function(t,e,n){var i,r,o=this._isHorizontal,a=this.attribute.handlerText;t.setAttributes((Bs(i={},o?"x":"y",e),Bs(i,"text",(null==a?void 0:a.formatter)?a.formatter(n):n.toFixed(null!==(r=null==a?void 0:a.precision)&&void 0!==r?r:0)),i));var s=t.name===xB.startHandlerText?this._startHandler:this._endHandler;s&&(null==s||s.setAttributes(Bs({},o?"x":"y",e))),t.name===xB.startHandlerText?(this._currentValue.startValue=n,this._currentValue.startPos=e):(this._currentValue.endValue=n,this._currentValue.endPos=e)}},{key:"_dispatchChangeEvent",value:function(){var t,e=!!this.attribute.range,n=this._currentValue,i=new Is("change",{value:e?[Math.min(n.endValue,n.startValue),Math.max(n.endValue,n.startValue)]:n.startValue,position:e?[Math.min(n.endPos,n.startPos),Math.max(n.endPos,n.startPos)]:n.startPos});i.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(i)}},{key:"_getHandlers",value:function(){var t,e=this._startHandler,n=this._endHandler;return this._isHorizontal?n&&n.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=n,n=t):n&&n.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=n,n=t),{startHandler:e,endHandler:n}}}]),n}(zk);function TB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}RB.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:!0,fillColor:"#fff",stroke:"true",strokeColor:"#91caff",lineWidth:2},railStyle:{fillColor:"rgba(0,0,0,.04)"},trackStyle:{fillColor:"#91caff"},showValue:!0,valueStyle:{fillColor:"#2C3542",fontSize:12},startText:{style:{fillColor:"#2C3542",fontSize:12}},endText:{style:{fillColor:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fillColor:"#2C3542",fontSize:12}}};var MB=function(t){Ke(n,t);var e=TB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="colorLegend",i._onSliderChange=function(t){i._updateColor(),i.dispatchEvent(t)},i}return Se(n,[{key:"setSelected",value:function(t){this._slider&&(this._slider.setValue(t),this._updateColor())}},{key:"_renderContent",value:function(){for(var t=this.attribute,e=t.colors,n=t.slidable,i=t.layout,r=t.align,o=t.min,a=t.max,s=t.value,l=t.railWidth,u=t.railHeight,h=t.showHandler,c=void 0===h||h,d=t.handlerSize,f=t.handlerStyle,p=t.railStyle,v=t.trackStyle,g=t.startText,y=t.endText,m=t.handlerText,b=t.showTooltip,w=t.tooltip,x=[],C=(a-o)/(e.length-1),_=0;_<e.length;_++)x.push(o+C*_);this._colorScale=(new wk).domain(x,!0).range(e),this._color=this._getTrackColor();var k=new RB({x:0,y:0,range:{draggableTrack:!0},slidable:n,layout:i,align:r,min:o,max:a,value:s,railWidth:l,railHeight:u,showHandler:c,handlerSize:d,handlerStyle:f,railStyle:p,trackStyle:Object.assign({fillColor:this._color},v),startText:g,endText:y,handlerText:m,showTooltip:b,tooltip:w});this._innerView.add(k),this._slider=k,k.translateTo(0-k.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+Yt(this.attribute,"title.space",12):0)-k.AABBBounds.y1),this._updateColor()}},{key:"_bindEvents",value:function(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}},{key:"_getTrackColor",value:function(){var t=this.attribute,e=t.colors,n=t.layout;if(!Kt(e)){var i=e.length;if(1===i)return e[0];for(var r=[],o=0;o<i;o++){var a=o/(i-1);r.push({offset:a,color:e[o]})}var s="horizontal"===n;return{gradient:"linear",stops:r,x0:0,y0:0,x1:s?1:0,y1:s?0:1}}}},{key:"_updateColor",value:function(){var t=this.attribute,e=t.layout,n=void 0===e?"horizontal":e,i=t.colors,r=t.railWidth,o=t.railHeight,a=this._slider,s=a.startHandler,l=a.endHandler,u=a.track,h=this._slider.currentValue,c=h.startValue,d=h.endValue,f=h.startPos,p=h.endPos,v=this._colorScale.scale(c),g=this._colorScale.scale(d);null==s||s.setAttribute("fillColor",v),null==l||l.setAttribute("fillColor",g);var y="horizontal"===n?r:o;if(Math.abs(f-p)!==y&&i&&i.length>1){var m=this._color.stops,b=Math.min(f,p),w=Math.max(f,p),x=b/y,C=w/y,_=C-x,k=m.filter((function(t){return t.offset>x&&t.offset<C})),S=Math.min(c,d),A=Math.max(c,d),B=this._colorScale.scale(S),R=this._colorScale.scale(A),T=[{offset:0,color:B}];k.forEach((function(t){T.push({offset:(t.offset-x)/_,color:t.color})})),T.push({offset:1,color:R}),u.setAttribute("fillColor",Object.assign(Object.assign({},this._color),{stops:T}))}}}]),n}(bB);function PB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}function OB(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"bottom",e=0;return"top"===t?"\n M".concat(e,",-6L").concat(e-3.5,",-2.5\n v5\n h7\n v-5\n Z\n"):"left"===t?"\n M".concat((e=1)-6,",0L").concat(e-6+2.5,",-3.5\n h5\n v7\n h-5\n Z\n"):"right"===t?"\n M".concat((e=-1)+6,",0L").concat(e+6-2.5,",-3.5\n h-5\n v7\n h5\n Z\n "):"\n M".concat(e,",6L").concat(e-3.5,",2.5\n v-5\n h7\n v5\n Z\n")}MB.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fillColor:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,strokeColor:"#fff",outerBorder:{distance:2,lineWidth:1,strokeColor:"#ccc"}}};var EB=function(t){Ke(n,t);var e=PB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="sizeLegend",i._onSliderChange=function(t){i.dispatchEvent(t)},i}return Se(n,[{key:"setSelected",value:function(t){this._slider&&this._slider.setValue(t)}},{key:"_renderContent",value:function(){var t=this.attribute,e=t.slidable,n=t.layout,i=t.align,r=t.min,o=t.max,a=t.value,s=t.railWidth,l=t.railHeight,u=t.showHandler,h=void 0===u||u,c=t.handlerSize,d=t.handlerStyle,f=t.railStyle,p=t.trackStyle,v=t.startText,g=t.endText,y=t.handlerText,m=t.showTooltip,b=t.tooltip,w=t.sizeBackground,x=Dv({x:0,y:0});this._innerView.add(x);var C=new RB({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:e,layout:n,align:i,min:r,max:o,value:a,railWidth:s,railHeight:l,showHandler:h,handlerSize:c,handlerStyle:Object.assign({symbolType:OB(i)},d),railStyle:f,trackStyle:p,startText:v,endText:g,handlerText:y,showTooltip:m,tooltip:b});x.add(C);var _,k=0;"horizontal"===n?"top"===i?(_="M0,0L".concat(s,",0L").concat(s,",12Z"),k=l):(_="M0,12L".concat(s,",12L").concat(s,",0Z"),C.setAttribute("y",12)):"left"===i?_="M".concat(s,",0L").concat(s,",0L").concat(s+12,",").concat(l,"L").concat(s,",").concat(l,"Z"):(_="M0,".concat(l,"L12,").concat(l,"L12,0Z"),C.setAttribute("x",12));var S=Wv(Object.assign(Object.assign({x:0,y:k,path:_},w),{zIndex:0}));x.add(S);var A=this._title?this._title.AABBBounds.height()+Yt(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,A-x.AABBBounds.y1),this._slider=C}},{key:"_bindEvents",value:function(){this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}]),n}(bB);function HB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}EB.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fillColor:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,strokeColor:"#ccc",fillColor:"#fff"},sizeBackground:{fillColor:"rgba(20,20,20,0.1)"}};var LB=function(t){Ke(n,t);var e=HB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="title",i}return Se(n,[{key:"render",value:function(){var t,e,n,i,r,o,a,s,l,u,h,c,d,f,p,v,g,y,m,b,w,x,C,_,k,S,A,B,R,T,M,P,O,E,H,L,I,D,j,W,F,z,N,G,U,V,K,Y,X,$,q,Z,J,Q,tt,et,nt,it,rt,ot,at,st,lt=this.attribute,ut=lt.text,ht=lt.textStyle,ct=lt.subtext,dt=lt.subtextStyle,ft=lt.width,pt=lt.height,vt=lt.minWidth,gt=lt.maxWidth,yt=lt.minHeight,mt=lt.maxHeight,bt=lt.align,wt=lt.verticalAlign,xt=lt.padding,Ct=In(void 0===xt?0:xt),_t=this.createOrUpdateChild("title-container",{x:Ct[3],y:Ct[0],zIndex:1},"group");if(!1!==(null===(t=this.attribute)||void 0===t?void 0:t.visible)&&!1!==(null==ht?void 0:ht.visible))if(ht&&Et(null==ht?void 0:ht.character)){var kt={x:null!==(e=ht.x)&&void 0!==e?e:0,y:null!==(n=ht.y)&&void 0!==n?n:0,width:null!==(r=null!==(i=ht.width)&&void 0!==i?i:ft)&&void 0!==r?r:0,height:null!==(a=null!==(o=ht.height)&&void 0!==o?o:pt)&&void 0!==a?a:0,ellipsis:null===(s=ht.ellipsis)||void 0===s||s,wordBreak:null!==(l=ht.wordBreak)&&void 0!==l?l:"break-word",maxHeight:ht.maxHeight,maxWidth:ht.maxWidth,textConfig:ht.character};this._mainTitle=_t.createOrUpdateChild("mainTitle",kt,"richtext")}else Et(ut)&&(this._mainTitle=_t.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:[ut]},ht),{maxLineWidth:null!==(u=null==ht?void 0:ht.maxLineWidth)&&void 0!==u?u:ft,heightLimit:null==ht?void 0:ht.heightLimit,lineClamp:null==ht?void 0:ht.lineClamp,ellipsis:null===(h=null==ht?void 0:ht.ellipsis)||void 0===h||h,x:0,y:0}),"wrapText"));var St=this._mainTitle?null===(c=this._mainTitle)||void 0===c?void 0:c.AABBBounds.height():0,At=this._mainTitle?null===(d=this._mainTitle)||void 0===d?void 0:d.AABBBounds.width():0;if(!1!==(null===(f=this.attribute)||void 0===f?void 0:f.visible)&&!1!==(null==dt?void 0:dt.visible))if(dt&&Et(null==dt?void 0:dt.character)){var Bt={x:null!==(p=dt.x)&&void 0!==p?p:0,y:null!==(v=dt.y)&&void 0!==v?v:St,width:null!==(y=null!==(g=dt.width)&&void 0!==g?g:ft)&&void 0!==y?y:0,height:null!==(b=null!==(m=dt.height)&&void 0!==m?m:pt)&&void 0!==b?b:0,ellipsis:null===(w=dt.ellipsis)||void 0===w||w,wordBreak:null!==(x=dt.wordBreak)&&void 0!==x?x:"break-word",maxHeight:dt.maxHeight,maxWidth:dt.maxWidth,textConfig:dt.character};this._subTitle=_t.createOrUpdateChild("subTitle",Bt,"richtext")}else Et(ct)&&(this._subTitle=_t.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:[ct]},dt),{maxLineWidth:null!==(C=null==dt?void 0:dt.maxLineWidth)&&void 0!==C?C:ft,heightLimit:null==dt?void 0:dt.heightLimit,lineClamp:null==dt?void 0:dt.lineClamp,ellipsis:null===(_=null==dt?void 0:dt.ellipsis)||void 0===_||_,x:0,y:St}),"wrapText"));var Rt=this._subTitle?null===(k=this._subTitle)||void 0===k?void 0:k.AABBBounds.height():0,Tt=this._subTitle?null===(S=this._subTitle)||void 0===S?void 0:S.AABBBounds.width():0,Mt=Math.max(At,Tt),Pt=St+(null!==(A=null==dt?void 0:dt.height)&&void 0!==A?A:Rt);if(Et(ft)&&(Mt=ft,null===(B=this._mainTitle)||void 0===B||B.setAttribute("maxLineWidth",ft),null===(R=this._subTitle)||void 0===R||R.setAttribute("maxLineWidth",ft)),Et(pt)&&(Pt=pt),Et(vt)&&Mt<vt&&(Mt=vt),Et(gt)&&(null===(T=this._mainTitle)||void 0===T||T.setAttribute("maxLineWidth",gt),null===(M=this._subTitle)||void 0===M||M.setAttribute("maxLineWidth",gt),null===(P=this._mainTitle)||void 0===P||P.setAttribute("maxWidth",gt),null===(O=this._subTitle)||void 0===O||O.setAttribute("maxWidth",gt),Mt>gt&&(Mt=gt)),Et(yt)&&Pt<yt&&(Pt=yt),Et(mt)&&(null===(E=this._mainTitle)||void 0===E||E.setAttribute("maxHeight",mt),null===(H=this._subTitle)||void 0===H||H.setAttribute("maxHeight",mt-St),Pt>mt&&(Pt=mt)),_t.attribute.width=Mt+Ct[1]+Ct[3],_t.attribute.height=Pt+Ct[0]+Ct[2],Et(bt)||Et(null==ht?void 0:ht.align)){var Ot=(null==ht?void 0:ht.align)?null==ht?void 0:ht.align:bt,Ht=null!==(L=null==ht?void 0:ht.width)&&void 0!==L?L:At;"left"===Ot?(null===(I=this._mainTitle)||void 0===I||I.setAttribute("x",0),null===(D=this._mainTitle)||void 0===D||D.setAttribute("textAlign","left")):"center"===Ot?(null===(j=this._mainTitle)||void 0===j||j.setAttribute("x",Ht/2),null===(W=this._mainTitle)||void 0===W||W.setAttribute("textAlign","center")):"right"===Ot&&(null===(F=this._mainTitle)||void 0===F||F.setAttribute("x",Ht),null===(z=this._mainTitle)||void 0===z||z.setAttribute("textAlign","right"))}if(Et(wt)||Et(null==ht?void 0:ht.verticalAlign)){var Lt=(null==ht?void 0:ht.verticalAlign)?null==ht?void 0:ht.verticalAlign:wt,It=(null==ht?void 0:ht.height)?null==ht?void 0:ht.height:Mt;"top"===Lt?(null===(N=this._mainTitle)||void 0===N||N.setAttribute("y",0),null===(G=this._mainTitle)||void 0===G||G.setAttribute("textBaseline","top")):"middle"===Lt?(null===(U=this._mainTitle)||void 0===U||U.setAttribute("y",It/2),null===(V=this._mainTitle)||void 0===V||V.setAttribute("textBaseline","middle")):"bottom"===Lt&&(null===(K=this._mainTitle)||void 0===K||K.setAttribute("y",It),null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("textBaseline","bottom"))}if(Et(bt)||Et(null==dt?void 0:dt.align)){var Dt=(null==dt?void 0:dt.align)?null==dt?void 0:dt.align:bt,jt=null!==(X=null==dt?void 0:dt.width)&&void 0!==X?X:Tt;"left"===Dt?(null===($=this._subTitle)||void 0===$||$.setAttribute("x",0),null===(q=this._subTitle)||void 0===q||q.setAttribute("textAlign","left")):"center"===Dt?(null===(Z=this._subTitle)||void 0===Z||Z.setAttribute("x",jt/2),null===(J=this._subTitle)||void 0===J||J.setAttribute("textAlign","center")):"right"===Dt&&(null===(Q=this._subTitle)||void 0===Q||Q.setAttribute("x",jt),null===(tt=this._subTitle)||void 0===tt||tt.setAttribute("textAlign","right"))}if(Et(wt)||Et(null==ht?void 0:ht.verticalAlign)){var Wt=(null==dt?void 0:dt.verticalAlign)?null==dt?void 0:dt.verticalAlign:wt,Ft=St,zt=null!==(et=null==dt?void 0:dt.height)&&void 0!==et?et:0;"top"===Wt?(null===(nt=this._subTitle)||void 0===nt||nt.setAttribute("y",Ft),null===(it=this._subTitle)||void 0===it||it.setAttribute("textBaseline","top")):"middle"===Wt?(null===(rt=this._subTitle)||void 0===rt||rt.setAttribute("y",Ft+zt/2),null===(ot=this._subTitle)||void 0===ot||ot.setAttribute("textBaseline","middle")):"bottom"===Wt&&(null===(at=this._subTitle)||void 0===at||at.setAttribute("y",Ft+zt),null===(st=this._subTitle)||void 0===st||st.setAttribute("textBaseline","bottom"))}}}]),n}(zk);LB.defaultAttributes={textStyle:{ellipsis:"...",fillColor:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fillColor:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};function IB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var DB=function(t,e){var n=t.x0,i=t.x1,r="number"==typeof e?t.thickness*e:t.thickness,o=t.y0-t.thickness/2,a=t.y1-t.thickness/2;"center"===t.align?(o=t.y0-r/2,a=t.y1-r/2):"end"===t.align&&(o=t.y0+t.thickness/2-r,a=t.y1+t.thickness/2-r);var s=(n+i)/2,l=o+r,u=a+r;t.round&&(n=Math.round(n),i=Math.round(i),o=Math.round(o),a=Math.round(a),l=Math.round(l),u=Math.round(u),s=Math.round(s));var h=Math.abs(i-n)>1e-6,c=t.endArrow&&h?"L".concat(i,",").concat(a-r/2,"L").concat(i+r,",").concat((a+u)/2,"L").concat(i,",").concat(u+r/2):"",d=t.startArrow&&h?"L".concat(n,",").concat(l+r/2,"L").concat(n-r,",").concat((o+l)/2,"L").concat(n,",").concat(o-r/2):"";return!1===t.isSmooth?"M".concat(n,",").concat(o,"L").concat(i,",").concat(a).concat(c,"L").concat(i,",").concat(u,"L").concat(n,",").concat(l).concat(d,"Z"):"M".concat(n,",").concat(o,"\n C").concat(s,",").concat(o,",").concat(s,",").concat(a,",").concat(i,",").concat(a,"\n ").concat(c,"\n L").concat(i,",").concat(u,"\n C").concat(s,",").concat(u,",").concat(s,",").concat(l,",").concat(n,",").concat(l,"\n ").concat(d,"\n Z")},jB=function(t,e){var n=t.y0,i=t.y1,r=t.x0-t.thickness/2,o=t.x1-t.thickness/2,a="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(r=t.x0-a/2,o=t.x1-a/2):"end"===t.align&&(r=t.x0+t.thickness/2-a,o=t.x1+t.thickness/2-a);var s=(n+i)/2,l=r+a,u=o+a;t.round&&(n=Math.round(n),i=Math.round(i),r=Math.round(r),o=Math.round(o),l=Math.round(l),u=Math.round(u),s=Math.round(s));var h=Math.abs(i-n)>1e-6,c=t.endArrow&&h?"L".concat(o-a/2,",").concat(i,"L").concat((o+u)/2,",").concat(i+a,"L").concat(u+a/2,",").concat(i):"",d=t.startArrow&&h?"L".concat(l+a/2,",").concat(n,"L").concat((l+r)/2,",").concat(n-a,"L").concat(r-a/2,",").concat(n):"";return!1===t.isSmooth?"M".concat(r,",").concat(n,"L").concat(o,",").concat(i).concat(c,"L").concat(u,",").concat(i,"L").concat(l,",").concat(n).concat(d,"Z"):"M".concat(r,",").concat(n,"\n C").concat(r,",").concat(s,",").concat(o,",").concat(s,",").concat(o,",").concat(i,"\n ").concat(c,"\n L").concat(u,",").concat(i,"\n C").concat(u,",").concat(s,",").concat(l,",").concat(s,",").concat(l,",").concat(n,"\n ").concat(d,"\n Z")};(function(t){Ke(n,t);var e=IB(n);function n(t){return Ae(this,n),e.call(this,te({},n.defaultAttributes,t))}return Se(n,[{key:"render",value:function(){var t=this,e=this.attribute.direction,n="vertical"===(void 0===e?"horizontal":e)?jB:DB,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,r=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],o={};if(Object.keys(this.attribute).forEach((function(e){r.includes(e)||(o[e]=t.attribute[e])})),i){var a=this.createOrUpdateChild("sankey-link-background",Object.assign({},o,this.attribute.backgroudStyle,{path:n(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=a}else this._backPath&&this._backPath.setAttribute("visible",!1);var s=this.createOrUpdateChild("sankey-link-front",Object.assign({},o,{path:n(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=s}}]),n}(zk)).defaultAttributes={direction:"horizontal",align:"start"};function WB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var FB,zB,NB,GB=function(t){Ke(n,t);var e=WB(n);function n(t){return Ae(this,n),e.call(this,t)}return Se(n)}(sh);function UB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(FB||(FB={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(zB||(zB={}));var VB=function(t){Ke(n,t);var e=UB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t)))._isPaused=!0,i._init=function(){i._initAttributes(),i._initLayout(),i._initPlay(),i._initBackward(),i._initForward(),i._initEvents()},i._initAttributes=function(){i._startAttr={style:Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},n.defaultControllerAttr),i.attribute.start.style)},i._pauseAttr={style:Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},n.defaultControllerAttr),i.attribute.pause.style)},i._forwardAttr={style:Object.assign(Object.assign({},n.defaultControllerAttr),i.attribute.forward.style)},i._backwardAttr={style:Object.assign(Object.assign({},n.defaultControllerAttr),i.attribute.backward.style)},i._layout=i.attribute.layout},i._initLayout=function(){var t,e,n,r,o,a,s,l;i._layout=i.attribute.layout,"horizontal"===i._layout?(i._backwardAttr.style.symbolType=null!==(e=null===(t=i._backwardAttr.style)||void 0===t?void 0:t.symbolType)&&void 0!==e?e:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",i._forwardAttr.style.symbolType=null!==(r=null===(n=i._forwardAttr.style)||void 0===n?void 0:n.symbolType)&&void 0!==r?r:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===i._layout&&(i._backwardAttr.style.symbolType=null!==(a=null===(o=i._backwardAttr.style)||void 0===o?void 0:o.symbolType)&&void 0!==a?a:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",i._forwardAttr.style.symbolType=null!==(l=null===(s=i._forwardAttr.style)||void 0===s?void 0:s.symbolType)&&void 0!==l?l:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},i._initPlay=function(){i._playController=new GB(Object.assign({},i._startAttr.style)),i.add(i._playController)},i._initBackward=function(){i._backwardController=new GB(Object.assign({},i._backwardAttr.style)),i.add(i._backwardController)},i._initForward=function(){i._forwardController=new GB(Object.assign({},i._forwardAttr.style)),i.add(i._forwardController)},i._initEvents=function(){i._playController.addEventListener("pointerdown",(function(t){t.stopPropagation(),!0===i._isPaused?i.play():i.pause()})),i._backwardController.addEventListener("pointerdown",(function(t){t.stopPropagation(),i.backward()})),i._forwardController.addEventListener("pointerdown",(function(t){t.stopPropagation(),i.forward()}))},i._createCustomEvent=function(t){var e,n=new Is(t,{eventType:t});return n.manager=null===(e=i.stage)||void 0===e?void 0:e.eventSystem.manager,n},i.play=function(){var t=i._createCustomEvent(FB.OnPlay);i.dispatchEvent(t)},i.pause=function(){var t=i._createCustomEvent(FB.OnPause);i.dispatchEvent(t)},i.forward=function(){var t=i._createCustomEvent(FB.OnForward);i.dispatchEvent(t)},i.backward=function(){var t=i._createCustomEvent(FB.OnBackward);i.dispatchEvent(t)},i.togglePlay=function(){i._playController.setAttributes(i._startAttr.style),i._isPaused=!0},i.togglePause=function(){i._playController.setAttributes(i._pauseAttr.style),i._isPaused=!1},i._init(),i}return Se(n,[{key:"render",value:function(){}}]),n}(zk);VB.defaultControllerAttr={x:0,y:0,size:20,fillColor:"#91caff",pickMode:"imprecise",cursor:"pointer"},VB.defaultAttributes=(Bs(NB={visible:!0},zB.Start,{}),Bs(NB,zB.Pause,{}),Bs(NB,zB.Backward,{}),Bs(NB,zB.Forward,{}),NB);var KB,YB,XB={style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},$B=[200,10];!function(t){t.Default="default",t.Reverse="reverse"}(KB||(KB={})),function(t){t.OnChange="onChange",t.OnPlay="onPlay",t.OnPause="onPause",t.OnBackward="onBackward",t.OnForward="onForward",t.OnEnd="onEnd"}(YB||(YB={}));var qB=function(t){return"top"===t||"bottom"===t};function ZB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var JB=function(t){Ke(n,t);var e=ZB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t)))._data=[],i._layoutInfo={},i._initSlider=function(){var t,e,n,r;Gt(i._handlerStyle.size)?r=i._handlerStyle.size:i._handlerStyle.size&&i._handlerStyle.size.length&&(r=Le(i._handlerStyle.size[0],i._handlerStyle.size[1]));var o={min:i._minIndex,max:i._maxIndex,value:null!==(t=i.attribute.dataIndex)&&void 0!==t?t:0,railWidth:i._railStyle.width,railHeight:i._railStyle.height,railStyle:i._railStyle,trackStyle:i._trackStyle,handlerSize:Gt(r)?r:void 0,handlerStyle:i._handlerStyle,dy:i.attribute.slider.dy,dx:i.attribute.slider.dx,slidable:!0,visible:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1}};if(qB(i._orient)){var a=Math.max(0,i._layoutInfo.slider.size),s=null!==(e=i._railStyle.height)&&void 0!==e?e:$B[1];o.layout="horizontal",o.railHeight=s,o.railWidth=a,o.x=i._layoutInfo.slider.x,o.y=i._layoutInfo.slider.y}else{var l=Math.max(0,i._layoutInfo.slider.size),u=null!==(n=i._railStyle.width)&&void 0!==n?n:$B[1];o.layout="vertical",o.railWidth=u,o.railHeight=l,o.x=i._layoutInfo.slider.x,o.y=i._layoutInfo.slider.y}i._slider=new RB(o),i.add(i._slider)},i._initController=function(){var t={visible:!0,start:i._start,pause:i._pause,forward:i._forward,backward:i._backward};qB(i._orient)?(t.layout="horizontal",t.start={style:Object.assign(Object.assign({},t.start.style),{x:i._layoutInfo.start.x,y:i._layoutInfo.start.y})},t.pause={style:Object.assign(Object.assign({},t.pause.style),{x:i._layoutInfo.start.x,y:i._layoutInfo.start.y})},t.backward={style:Object.assign(Object.assign({},t.backward.style),{x:i._layoutInfo.backward.x,y:i._layoutInfo.backward.y})},t.forward={style:Object.assign(Object.assign({},t.forward.style),{x:i._layoutInfo.forward.x,y:i._layoutInfo.forward.y})}):(t.layout="vertical",t.start={style:Object.assign(Object.assign({},t.start.style),{x:i._layoutInfo.start.x,y:i._layoutInfo.start.y})},t.pause={style:Object.assign(Object.assign({},t.pause.style),{x:i._layoutInfo.start.x,y:i._layoutInfo.start.y})},t.backward={style:Object.assign(Object.assign({},t.backward.style),{x:i._layoutInfo.backward.x,y:i._layoutInfo.backward.y})},t.forward={style:Object.assign(Object.assign({},t.forward.style),{x:i._layoutInfo.forward.x,y:i._layoutInfo.forward.y})}),i._controller=new VB(t),i.add(i._controller)},i._initAttributes(),i._initLayoutInfo(),i._initController(),i._initSlider(),i}return Se(n,[{key:"_initAttributes",value:function(){var t,e,n,i,r,o,a,s,l,u,h,c,d,f;this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1,this._railStyle=Object.assign({},null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.railStyle),this._trackStyle=Object.assign({},null===(i=null===(n=this.attribute)||void 0===n?void 0:n.slider)||void 0===i?void 0:i.trackStyle),this._handlerStyle=Object.assign({},null===(o=null===(r=this.attribute)||void 0===r?void 0:r.slider)||void 0===o?void 0:o.handlerStyle),this._start=Object.assign({},null===(s=null===(a=this.attribute)||void 0===a?void 0:a.controller)||void 0===s?void 0:s.start),this._pause=Object.assign({},null===(u=null===(l=this.attribute)||void 0===l?void 0:l.controller)||void 0===u?void 0:u.pause),this._forward=Object.assign({},null===(c=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===c?void 0:c.forward),this._backward=Object.assign({},null===(f=null===(d=this.attribute)||void 0===d?void 0:d.controller)||void 0===f?void 0:f.backward)}},{key:"_initLayoutInfo",value:function(){var t,e,n,i=this,r=[this._start,this._backward,this._forward].sort((function(t,e){return t.order-e.order})),o=r.filter((function(t){return"end"!==t.position})),a=r.filter((function(t){return"end"===t.position})),s=null!==(t=qB(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:$B[1],l=r.reduce((function(t,e){var n=e.style.size,i=Nt(n)?n:Le(n[0],n[1]);return t+e.space+i}),0),u=(qB(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(n=this._size)||void 0===n?void 0:n.height)-l,h=u-this.attribute.slider.space,c=o.reduce((function(t,e){var n=e.key,r=e.space,o=e.style.size,a=Nt(o)?o:Le(o[0],o[1]);return i._layoutInfo[n]=Object.assign(Object.assign({},i._layoutInfo[n]),{size:a,x:qB(i._orient)?t+r:(i._size.width-a)/2,y:qB(i._orient)?(i._size.height-a)/2:t+r}),t+r+a}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:qB(this._orient)?c+this.attribute.slider.space:(this._size.width-s)/2,y:qB(this._orient)?(this._size.height-s)/2:c+this.attribute.slider.space}),a.reduce((function(t,e){var n=e.key,r=e.space,o=e.style.size,a=Nt(o)?o:Le(o[0],o[1]);return i._layoutInfo[n]=Object.assign(Object.assign({},i._layoutInfo[n]),{size:a,x:qB(i._orient)?t+r:(i._size.width-a)/2,y:qB(i._orient)?(i._size.height-a)/2:t+r}),t+r+a}),c+u)}},{key:"render",value:function(){this._slider.render(),this._controller.render()}},{key:"dispatchCustomEvent",value:function(t,e){var n,i=new Is(t,{eventType:t,index:e,value:this._data[e]});i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}]),n}(zk);JB.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{space:10,dx:0,dy:0,railStyle:{borderRadius:5},trackStyle:{},handlerStyle:{}},controller:{start:Object.assign(Object.assign({},XB),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},XB),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},XB),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},XB),{key:"backward",position:"start"})}};function QB(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var tR={debounce:be,throttle:function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Lt(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),be(t,e,{leading:i,trailing:r,maxWait:e})}},eR=function(t){Ke(n,t);var e=QB(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="brush",i._activeDrawState=!1,i._cacheDrawPoints=[],i._activeMoveState=!1,i._operatingMaskMoveDx=0,i._operatingMaskMoveDy=0,i._operatingMaskMoveRangeX=[-1/0,1/0],i._operatingMaskMoveRangeY=[-1/0,1/0],i._brushMaskAABBBoundsDict={},i._onBrushStart=function(t){var e,n,r=null===(n=null===(e=i.attribute)||void 0===e?void 0:e.brushMoved)||void 0===n||n;i._activeMoveState=r&&i._isPosInBrushMask(t),i._activeDrawState=!i._activeMoveState,i._outOfInteractiveRange(t)||(i._activeDrawState&&i._initDraw(t),i._activeMoveState&&i._initMove(t))},i._onBrushing=function(t){i._outOfInteractiveRange(t)||(i._activeDrawState&&i._drawing(t),i._activeMoveState&&i._moving(t))},i._onBrushEnd=function(t){i._outOfInteractiveRange(t)||(i._updateDragMaskCallback&&i._updateDragMaskCallback({operateType:i._activeDrawState?"brushEnd":"brushMaskUp",operateMask:i._operatingMask,operatedMaskAABBBounds:i._brushMaskAABBBoundsDict}),i._activeDrawState=!1,i._activeMoveState=!1,i._operatingMask.setAttribute("pickable",!1))},i}return Se(n,[{key:"bindBrushEvents",value:function(){var t=this.attribute,e=t.delayType,n=void 0===e?"throttle":e,i=t.delayTime,r=void 0===i?0:i;this.stage.addEventListener("pointerdown",this._onBrushStart),this.stage.addEventListener("pointermove",tR[n](this._onBrushing,r)),this.stage.addEventListener("pointerup",this._onBrushEnd),this.stage.addEventListener("pointerupoutside",this._onBrushEnd)}},{key:"_isPosInBrushMask",value:function(t){for(var e=this,n=this.eventPosToStagePos(t),i=this._container.getChildren(),r=function(){var t=i[o].attribute,r=t.points,a=void 0===r?[]:r,s=t.dx,l=void 0===s?0:s,u=t.dy,h=void 0===u?0:u,c=a.map((function(t){return{x:t.x+l,y:t.y+h}}));if(Pn(c,n.x,n.y))return{v:(e._operatingMask=i[o],!0)}},o=0;o<i.length;o++){var a=r();if("object"===Ht(a))return a.v}return!1}},{key:"_initDraw",value:function(t){var e=this.attribute,n=e.brushMode,i=e.removeOnClick,r=this.eventPosToStagePos(t);this._cacheDrawPoints=[r],this._operatingMask||this._addBrushMask(),"single"===n&&i?(this._container.incrementalClearChild(),this._addBrushMask()):"multiple"===n&&this._addBrushMask(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:"brushStart",operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}},{key:"_initMove",value:function(t){var e,n;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(n=this._operatingMask.attribute.dy)&&void 0!==n?n:0;var i=this.attribute.interactiveRange,r=i.minY,o=void 0===r?-1/0:r,a=i.maxY,s=void 0===a?1/0:a,l=i.minX,u=void 0===l?-1/0:l,h=i.maxX,c=void 0===h?1/0:h,d=this._operatingMask.globalAABBBounds,f=u-d.x1,p=c-d.x2,v=o-d.y1,g=s-d.y2;this._operatingMaskMoveRangeX=[f,p],this._operatingMaskMoveRangeY=[v,g],this._operatingMask.setAttribute("pickable",!0),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:"brushMaskDown",operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}},{key:"_drawing",value:function(t){this.attribute.brushStyle;var e=this.eventPosToStagePos(t);if(this._cacheDrawPoints.length>0){var n=this._cacheDrawPoints[this._cacheDrawPoints.length-1];if(e.x===(null==n?void 0:n.x)&&e.y===(null==n?void 0:n.y))return}if(this._cacheDrawPoints.push(e),this._activeDrawState){var i=this._computeMaskPoints();this._operatingMask.setAttribute("points",i),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:"brushing",operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}}},{key:"_moving",value:function(t){var e=this._cacheMovePoint,n=this.eventPosToStagePos(t);if(n.x!==(null==e?void 0:e.x)||n.y!==(null==e?void 0:e.y)){var i=n.x-e.x,r=n.y-e.y,o=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],i))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],r))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:o,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:"brushMaskMove",operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}}},{key:"_computeMaskPoints",value:function(){var t=this.attribute,e=t.brushType,n=t.xRange,i=void 0===n?[0,0]:n,r=t.yRange,o=void 0===r?[0,0]:r,a=this._cacheDrawPoints[0],s=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return"rect"===e?[a,{x:s.x,y:a.y},s,{x:a.x,y:s.y}]:"x"===e?[{x:a.x,y:o[0]},{x:s.x,y:o[0]},{x:s.x,y:o[1]},{x:a.x,y:o[1]}]:"y"===e?[{x:i[0],y:a.y},{x:i[0],y:s.y},{x:i[1],y:s.y},{x:i[1],y:a.y}]:qt(this._cacheDrawPoints)}},{key:"_addBrushMask",value:function(){var t=this.attribute.brushStyle,e=Uv(Object.assign({points:qt(this._cacheDrawPoints),cursor:"move",pickable:!1},t));e.name="brush-".concat(Date.now()),this._operatingMask=e,this._container.add(e),this._brushMaskAABBBoundsDict[e.name]=e.AABBBounds}},{key:"_outOfInteractiveRange",value:function(t){var e=this.attribute.interactiveRange,n=e.minY,i=void 0===n?-1/0:n,r=e.maxY,o=void 0===r?1/0:r,a=e.minX,s=void 0===a?-1/0:a,l=e.maxX,u=void 0===l?1/0:l,h=this.eventPosToStagePos(t);return h.x>u||h.x<s||h.y>o||h.y<i}},{key:"eventPosToStagePos",value:function(t){var e,n,i,r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(n=this.stage)||void 0===n?void 0:n.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}},{key:"render",value:function(){this.bindBrushEvents();var t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}},{key:"setUpdateDragMaskCallback",value:function(t){Pt(t)&&(this._updateDragMaskCallback=t)}}]),n}(zk);eR.defaultAttributes={brushMode:"single",brushType:"rect",brushStyle:{fill:!0,fillColor:"#B0C8F9",fillOpacity:.2,strokeColor:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}};var nR=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=[t.shape].concat(ie(n.map((function(t){return null==t?void 0:t.shape})))),o=[t.key].concat(ie(n.map((function(t){return null==t?void 0:t.key})))),a=[t.value].concat(ie(n.map((function(t){return null==t?void 0:t.value}))));return te.apply(void 0,[t].concat(n,[{shape:r.every(Ot)?void 0:te.apply(void 0,[{}].concat(ie(r))),key:o.every(Ot)?void 0:te.apply(void 0,[{}].concat(ie(o))),value:a.every(Ot)?void 0:te.apply(void 0,[{}].concat(ie(a)))}]))},iR={panel:{visible:!0,borderRadius:[3,3,3,3],fill:!0,fillColor:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:!0,strokeColor:"white"},titleStyle:{value:{fill:!0,fillColor:"#4E5969",fontFamily:OS,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:!0,fillColor:"black",size:8,symbolType:"circle",spacing:6},key:{fill:!0,fillColor:"#4E5969",fontFamily:OS,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:!0,fillColor:"#4E5969",fontFamily:OS,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new Qe).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},rR=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];function oR(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=$e(t);if(e){var r=$e(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Xe(this,n)}}var aR=function(t){Ke(n,t);var e=oR(n);function n(t){var i;return Ae(this,n),(i=e.call(this,te({},n.defaultAttributes,t))).name="tooltip",i}return Se(n,[{key:"render",value:function(){var t=this,e=this.attribute,i=e.visible,r=e.content,o=e.panel,a=e.keyWidth,s=e.valueWidth,l=e.hasContentShape,u=e.autoCalculatePosition,h=e.autoMeasure;if(i){h&&n.measureTooltip(this.attribute),u&&n.calculateTooltipPosition(this.attribute);var c=In(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},o),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:c[3],y:c[0]},"group");var d=n.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",te({symbolType:"circle"},d.shape,{visible:Vk(d)&&Vk(d.shape)}),"symbol");var f=Vk(d.shape)?d.shape.size+d.shape.spacing:0;this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",te({text:""},d.value,{visible:Vk(d)&&Vk(d.value)}),"text");var p=d.value,v=p.textAlign,g=p.textBaseline,y=o.width-c[3]-c[0]-f;"center"===v?this._tooltipTitle.setAttribute("x",f+y/2):"right"===v||"end"===v?this._tooltipTitle.setAttribute("x",f+y):this._tooltipTitle.setAttribute("x",f),"bottom"===g?this._tooltipTitle.setAttribute("y",d.height):"middle"===g?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);var m=Vk(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==r?void 0:r.length){this._tooltipContent.setAttribute("x",c[3]),this._tooltipContent.setAttribute("y",c[0]+m);var b=0;r.forEach((function(e,i){var r=n.getContentAttr(t.attribute,i);if(Vk(r)){var o="tooltip-content-".concat(i),u=t._tooltipContent.createOrUpdateChild(o,{visible:!0,x:0,y:b},"group"),h=0;if(Vk(r.shape)&&u.createOrUpdateChild("".concat(o,"-shape"),Object.assign({visible:!0},r.shape),"symbol").setAttribute("y",r.height/2),l&&(h+=r.shape.size+r.shape.spacing),Vk(r.key)){var c=u.createOrUpdateChild("".concat(o,"-key"),Object.assign({visible:!0},r.key),"text"),d=r.key.textAlign;"center"===d?c.setAttribute("x",h+a/2):"right"===d||"end"===d?c.setAttribute("x",h+a):c.setAttribute("x",h),c.setAttribute("y",r.height/2),h+=a+r.key.spacing}if(Vk(r.value)){var f=u.createOrUpdateChild("".concat(o,"-value"),Object.assign({visible:!0},r.value),"text"),p="right";Et(r.value.textAlign)?p=r.value.textAlign:Vk(r.key)||(p="left"),f.setAttribute("textAlign",p),"center"===p?f.setAttribute("x",h+s/2):"right"===p||"end"===p?f.setAttribute("x",h+s):f.setAttribute("x",h),h+=s,f.setAttribute("y",r.height/2),u.add(f)}b+=r.height+r.spaceRow}}))}}else this.hideAll()}},{key:"setAttributes",value:function(t,e){var i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every((function(t){return rR.includes(t)}))?(this._mergeAttributes(t,i),Ot(this.attribute.panel.width)&&this.attribute.autoMeasure&&n.measureTooltip(this.attribute),n.calculateTooltipPosition(this.attribute),Ho($e(n.prototype),"setAttributes",this).call(this,{x:this.attribute.x,y:this.attribute.y},e)):Ho($e(n.prototype),"setAttributes",this).call(this,t,e)}}],[{key:"calculateTooltipPosition",value:function(t){var e=t.panel,n=e.width,i=void 0===n?0:n,r=e.height,o=void 0===r?0:r,a=t.offsetX,s=t.offsetY,l=t.pointerX,u=t.pointerY,h=t.positionX,c=t.positionY,d=t.parentBounds,f=l,p=u;return"left"===h?f-=i+a:"center"===h?f-=i/2:f+=a,"top"===c?p-=o+s:"middle"===c?p-=o/2:p+=s,f+i>d.x2&&(f-=i+a),p+o>d.y2&&(p-=o+s),f<d.x1&&(f=d.x1),p<d.y1&&(p=d.y1),t.x=f,t.y=p,t}},{key:"measureTooltip",value:function(t){var e=t.content,i=t.contentStyle,r=In(t.padding),o=n.getTitleAttr(t),a=0,s=r[0]+r[2],l=0,u=o.value,h=o.shape,c=null!=h?h:{},d=c.visible,f=void 0!==d&&d,p=c.symbolType,v=void 0===p?"":p;if(Et(u)){var g=HS(u).quickMeasure(u.text),y=g.width,m=g.height;a=y,l=m}if(f&&ih[v]&&(a+=h.size+h.spacing,l=Math.max(h.size,l)),t.title.width=a,t.title.height=l,Vk(o)&&(s+=l+o.spaceRow),null==e?void 0:e.length){var b=[];if(e.forEach((function(e,i){var r=n.getContentAttr(t,i);(e.key||e.value)&&Vk(r)&&b.push([e,r])})),b.length){var w=!1,x=[],C=[],_=[];b.forEach((function(t,e){var n,r=ve(t,2),o=r[0],a=r[1],l=a.key,u=a.value,h=a.shape,c=a.spaceRow,d=Vk(h),f=null!==(n=null==h?void 0:h.symbolType)&&void 0!==n?n:"",p=HS(l),v=HS(u),g=0;if(Vk(l)){var y=p.quickMeasure(l.text),m=y.width,k=y.height;C.push(m),g=Math.max(g,k)}if(Vk(u)){var S=v.quickMeasure(u.text),A=S.width,B=S.height;_.push(A),g=Math.max(g,B)}d&&ih[f]&&(w=!0,x.push(h.size),g=Math.max(h.size,g)),o.height=g,s+=g,e<b.length-1&&(s+=null!=c?c:i.spaceRow)}));var k=x.length?Math.max.apply(Math,x):0,S=C.length?Math.max.apply(Math,C):0,A=_.length?Math.max.apply(Math,_):0;a=Math.max(S+A+i.key.spacing+i.value.spacing+(w?k+i.shape.spacing:0),a),e.forEach((function(t){t.width=a})),t.hasContentShape=w,t.keyWidth=S,t.valueWidth=A}}return t.panel.width=a+r[1]+r[3],t.panel.height=s,t}},{key:"getTitleAttr",value:function(t){return nR({},n.defaultAttributes.titleStyle,n.defaultAttributes.title,t.titleStyle,t.title)}},{key:"getContentAttr",value:function(t,e){return nR({},n.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}]),n}(zk);aR.defaultAttributes=iR;var sR;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(sR||(sR={}));const lR={fontSize:12,color:"#000",highlightColor:"#2E68CF",hoverBgColor:"#EEE",lineHeight:30,bgColor:"#FFF",borderRadius:4,borderWidth:.5,borderColor:"#CCC",menuPadding:6,menuItemPadding:9,maxLineWidth:200};const uR=F_();class hR{icon;constructor(){const t=uR.drillDown;this.icon=new y_({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,n,i,r,o){if(!t||i&&r)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void o.updateNextFrame();const a=uR.drillDown,s=uR.drillUp;this.icon.setAttributes({x:e,y:n,image:i?a.svg:s.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),o.updateNextFrame()}}class cR{columnMoverLabel;columnMoverLine;columnMoverBack;table;x;constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,n=t.theme.dragHeaderSplitLine.lineColor,i=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=Nv({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fillColor:n}),this.columnMoverLine=jv({visible:!1,pickable:!1,stroke:!0,strokeColor:n,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=Fv({visible:!1,pickable:!1,fill:!0,fillColor:i,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,n){const i=this.table.getCellType(t,e),r=A_(this.table,t,e);r&&(t=r.start.col,e=r.start.row);let o=0,a=0,s=0,l=0,u=0,h=0,c=0,d=0,f=Math.PI;const p=[];"columnHeader"===i?(o=this.table.getColsWidth(0,t-1)-this.table.stateManeger.scroll.horizontalBarPos,a=this.table.getRowsHeight(0,this.table.frozenRowCount-1),l=this.table.tableNoFrameHeight,s=r?this.table.getColsWidth(r.start.col,r.end.col):this.table.getColWidth(t),u=o-n,c=o+s,d=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):"rowHeader"===i&&(a=this.table.getRowsHeight(0,e-1)-this.table.stateManeger.scroll.verticalBarPos,o=this.table.getColsWidth(0,this.table.frozenColCount-1),s=this.table.tableNoFrameWidth,l=r?this.table.getRowsHeight(r.start.row,r.end.row):this.table.getRowHeight(e),h=a-n,c=2,d=a+l,f=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:o-u,y:a-h,width:s,height:l,dx:u,dy:h}),this.columnMoverLine.setAttributes({x:c,y:d,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:d,angle:f})}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,n,i){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e-this.table.stateManeger.scroll.horizontalBarPos),this.columnMoverLine.setAttribute("x",e-this.table.stateManeger.scroll.horizontalBarPos),this.columnMoverBack.setAttribute("x",t)):"number"==typeof n&&"number"==typeof i&&(this.columnMoverLabel.setAttribute("y",i-this.table.stateManeger.scroll.verticalBarPos),this.columnMoverLine.setAttribute("y",i-this.table.stateManeger.scroll.verticalBarPos),this.columnMoverBack.setAttribute("y",n))}}function dR(t,e){let n=e.getColsWidth(0,t);return t>=e.frozenColCount&&(n-=e.scrollLeft),n}class fR{table;border;columnResizerLine;columnResizerBgLine;columnResizerLabel;menu;vScrollBar;hScrollBar;frozenShadowLine;drillIcon;cellMover;constructor(t){this.table=t;const e=this.table.theme;this.createScrollBar();const n=e.columnResize?.lineColor,i=e.columnResize?.lineWidth,r=e.columnResize?.bgColor,o=e.columnResize?.width;this.columnResizerLine=jv({visible:!1,pickable:!1,stroke:!0,strokeColor:n,lineWidth:i,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizerBgLine=jv({visible:!1,pickable:!1,stroke:!0,strokeColor:r,lineWidth:o,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const a=zv({visible:!1,pickable:!1,x:0,y:0,fontSize:10,fillColor:"#FFF",text:"",textBaseline:"top",dx:16,dy:-6}),s=Fv({visible:!1,pickable:!1,fill:!0,fillColor:"#3073F2",x:0,y:0,width:38,height:16,borderRadius:5,dx:12,dy:-8});this.columnResizerLabel=Dv({visible:!1,pickable:!1,x:0,y:0}),this.columnResizerLabel.appendChild(s),this.columnResizerLabel.appendChild(a),this.cellMover=new cR(this.table);const l=e.frozenColumnLine?.shadow?.width,u=e.frozenColumnLine?.shadow?.startColor,h=e.frozenColumnLine?.shadow?.endColor;this.frozenShadowLine=Fv({visible:!0,pickable:!1,x:0,y:0,width:l,height:0,fillColor:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:u,offset:0},{color:h,offset:1}]}}),this.menu=new class{_table;_menuInstance;_menuInfo;constructor(t){this._table=t,this._menuInstance=new n_({x:0,y:0,fill:!0,fillColor:lR.bgColor,stroke:!0,strokeColor:lR.borderColor,borderRadius:lR.borderRadius,lineWidth:lR.borderWidth}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:sR.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}dispose(){}attach(t,e,n,i,r,o){if(r===sR.dropDown&&this.checkDropDownMenuChange(n,i)){const t=this.getMenuInfo(n,i,r);if(!t)return;const{menuInfo:e,highlightIndex:o}=t;this.updateMenuInfo(n,i,r,e,o),this.updateMenuInstance(e,o)}else if(r===sR.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(n,i,r);if(!t)return;const{menuInfo:e,highlightIndex:o}=t;this.updateMenuInfo(n,i,r,e,o),this.updateMenuInstance(e,o)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,n,i,r){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=n,this._menuInfo.menuInfo=i,this._menuInfo.highlightIndex=r}checkDropDownMenuChange(t,e){const{type:n,col:i,row:r}=this._menuInfo;return n!==sR.dropDown||t!==i||e!==r}checkContextMenuChange(t,e){const{type:n,menuInfo:i}=this._menuInfo;return n!==sR.contextmenu||i!==this._table.internalProps.menu?.contextMenuItems}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let n=lR.menuPadding;const i=lR.menuPadding;let r=0;t.forEach(((t,o)=>{const a=e===o;let s,l;"string"==typeof t?l=t:"object"==typeof t&&(l=t.text,s=a?t.selectedIcon:t.icon);const u=new n_({y:n,x:i,height:lR.lineHeight,fill:!0,fillColor:lR.bgColor});u.role="menu-item",this._menuInstance.appendChild(u),u.stateProxy=t=>"hover"===t?{fillColor:lR.hoverBgColor}:{fillColor:lR.bgColor},u.addEventListener("pointerenter",(t=>{u.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),u.addEventListener("pointerleave",(t=>{u.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const h=new ql({x:lR.menuItemPadding,y:lR.menuItemPadding,fill:!0,fillColor:a?lR.highlightColor:lR.color,text:l,textBaseline:"top",fontSize:lR.fontSize,pickable:!1,maxLineWidth:lR.maxLineWidth,ellipsis:"…"});if(u.addChild(h),s){h.AABBBounds.height();const t=s.width??16,e=s.height??16,n=new y_({x:lR.menuItemPadding,y:(lR.lineHeight-e)/2,width:t,height:e,image:s.svg,pickable:!1});n.role="menu-icon",u.insertBefore(n,h),h.setAttribute("x",t+lR.menuItemPadding)}r=Math.max(u.AABBBounds.width(),r),n+=lR.lineHeight})),this._menuInstance.setAttributes({width:r+2*lR.menuItemPadding+2*lR.menuPadding,height:n+lR.menuPadding}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",r+2*lR.menuItemPadding)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===sR.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=sR.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,n){if(n===sR.dropDown){const{dropDownMenu:n=this._table.globalDropDownMenu,pivotInfo:i}=this._table._getHeaderLayoutMap(t,e);let r=-1;if(Array.isArray(n))for(let i=0;i<n.length;i++)if(this._table._dropDownMenuIsHighlight(t,e,i)){r=i;break}return{menuInfo:n,highlightIndex:r}}if(n===sR.contextmenu){const n=this._table.internalProps.menu?.contextMenuItems;let i;if(Array.isArray(n))i=n;else if("function"==typeof n){const{field:r}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);i=n(r,e)}return{menuInfo:i,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const t=this.getEventInfo(e),n=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),i=Object.assign(t,n);this._table.fireListeners(gt.DROPDOWNMENU_CLICK,i)}}))}getEventInfo(t){const e=t.parent;let n=0;e.forEachChildren(((e,i)=>e===t&&(n=i-1,!0)));const i="string"==typeof this._menuInfo.menuInfo[n]?this._menuInfo.menuInfo[n]:this._menuInfo.menuInfo[n].text,r="string"==typeof this._menuInfo.menuInfo[n]?i:this._menuInfo.menuInfo[n].menuKey||i;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:n,highlight:n===this._menuInfo.highlightIndex,text:i,menuKey:r}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new hR}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.columnResizerBgLine),t.addChild(this.columnResizerLine),t.addChild(this.columnResizerLabel),t.addChild(this.hScrollBar),t.addChild(this.vScrollBar),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){const t=this.table.theme,e=t.scrollStyle?.scrollRailColor,n=t.scrollStyle?.scrollSliderColor,i=t.scrollStyle?.width;this.hScrollBar=new Gk({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:i,padding:0,railStyle:{fill:!!e,fillColor:e},sliderStyle:{fill:!0,fillColor:n},range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new Gk({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:i,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:0,railStyle:{fill:!!e,fillColor:e},sliderStyle:{fill:!0,fillColor:n},range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){const t=this.table.stateManeger.scroll.horizontalBarPos,e=this.table.stateManeger.scroll.verticalBarPos,n=this.table.theme,i=n.scrollStyle?.width,r=n.scrollStyle?.visible,o=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),a=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),s=this.table.getAllRowsHeight(),l=this.table.getAllColsWidth(),u=this.table.getFrozenRowsHeight(),h=this.table.getFrozenColsWidth();if(l>o){const t=Math.min(a,s),e=Math.max(.05,(o-h)/(l-h));this.hScrollBar.setAttributes({x:h,y:t-i,width:o-h,range:[0,e],visible:"always"===r});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===r&&this.hScrollBar.showAll()}if(s>a){const t=Math.min(o,l),e=Math.max(.05,(a-u)/(s-u));this.vScrollBar.setAttributes({x:t-i,y:u,height:a-u,range:[0,e],visible:"always"===r});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===r&&this.vScrollBar.showAll()}this.table.stateManeger.setScrollLeft(t),this.table.stateManeger.setScrollTop(e)}hideResizeCol(){this.columnResizerLine.setAttribute("visible",!1),this.columnResizerBgLine.setAttribute("visible",!1),this.columnResizerLabel.setAttribute("visible",!1),this.columnResizerLabel.hideAll()}showResizeCol(t,e){const n=dR(t,this.table);this.columnResizerLine.setAttributes({visible:!0,x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizerBgLine.setAttributes({visible:!0,x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizerLabel.showAll(),this.columnResizerLabel.setAttributes({visible:!0,x:n,y:e}),this.columnResizerLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`)}updateResizeCol(t,e){const n=dR(t,this.table);this.columnResizerLine.setAttributes({x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizerBgLine.setAttributes({x:n,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizerLabel.setAttributes({x:n,y:e}),this.columnResizerLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`)}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,n){this.cellMover.show(t,e,n)}updateMoveCol(t,e,n,i){this.cellMover.update(t,e,n,i)}setFrozenColumnShadow(t){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const e=this.table.getColsWidth(0,t);this.frozenShadowLine.setAttributes({visible:!0,x:e,height:this.table.getRowsHeight(0,this.table.rowCount-1)})}}hideVerticalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){const t=this.table.theme.scrollStyle.visible;"focus"!==t&&"scrolling"!==t||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,n=e[1]-e[0],i=t*(1-n);this.vScrollBar.setAttribute("range",[i,i+n]);const r=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:r.x1,y:r.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,n=e[1]-e[0];this.hScrollBar.setAttribute("range",[t,t+n]);const i=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:i.x1,y:i.y1}}}function pR(t,e,n,i){if(!e)return;const r="table"===n,{shadowBlur:o,shadowOffsetX:a,shadowOffsetY:s,shadowColor:l,roundCornerRadius:u,borderColor:h,borderLineWidth:c,borderLineDash:d}=e,f={},p={pickable:!1};if(o&&r&&(p.shadowBlur=o,p.shadowOffsetX=a,p.shadowOffsetY=s,p.shadowColor=l,p.stroke=!0,p.strokeColor=l,p.lineWidth=1,p.fill=!0,p.fillOpacity=.01),c&&(p.stroke=!0,p.stroke=i||!0,p.fill=!1,p.strokeColor=h,p.lineWidth=c,d&&(p.lineDash=d)),Array.isArray(h)&&(p.strokeArrayColor=h),Array.isArray(c)&&(p.strokeArrayWidth=c,p.lineWidth=1),u&&(p.borderRadius=u,f.borderRadius=u),r&&(p.shadowBlur||p.lineWidth)){const e=(p.shadowBlur??0)+(p.lineWidth??0),n=(p.shadowBlur??0)+(p.lineWidth??0);f.x=t.attribute.x+e,f.y=t.attribute.y+n}if(t.setAttributes(f),p.stroke)if(p.x=p.lineWidth/2,p.y=p.lineWidth/2,p.pickable=!1,r){p.x=t.attribute.x-p.lineWidth/2,p.y=t.attribute.y-p.lineWidth/2,p.width=t.attribute.width+p.lineWidth,p.height=t.attribute.height+p.lineWidth;const e=Fv(p);e.name="table-border-rect",t.parent.insertBefore(e,t),t.border=e}else{p.x=p.lineWidth/2,p.y=p.lineWidth/2,p.width=t.attribute.width-p.lineWidth,p.height=t.attribute.height-p.lineWidth;const e=Fv(p);e.name="border-rect",t.addChild(e),t.border=e}}
4
+ /*! *****************************************************************************
5
+ Copyright (c) Microsoft Corporation.
6
+
7
+ Permission to use, copy, modify, and/or distribute this software for any
8
+ purpose with or without fee is hereby granted.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16
+ PERFORMANCE OF THIS SOFTWARE.
17
+ ***************************************************************************** */function vR(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":Ht(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}Object.create;Object.create;const gR=Symbol.for("ChartRender");Symbol.for("ChartRenderContribution");let yR=class{type;numberType=O_;drawShape(t,e,n,i,r,o,a,s){const l=Ml(t,o?.theme).group,{dataId:u,data:h,viewBox:c}=t.attribute,{width:d=l.width,height:f=l.height}=t.attribute,{chartInstance:p,active:v,cacheCanvas:g,activeChartInstance:y}=t;if(!v&&g)console.log("x,y",n,i,c),e.drawImage(g,n,i,d,f);else if(y)y.updateDataSync("data",h);else{console.log("viewBox",c),p.updateViewBox(c),p.updateDataSync(u,h);const e=p.getStage();t.cacheCanvas=e.toCanvas()}}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{clip:o}=t.attribute;o?r.save():r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,n);const a=Ml(t,i?.theme).group,{scrollX:s=a.scrollX,scrollY:l=a.scrollY}=t.attribute;let u;(s||l)&&r.translate(s,l),i&&i.drawingCb&&(u=i.drawingCb()),u&&u.then?u.then((()=>{o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}};yR=vR([po()],yR);let mR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{shape:d}=t.attribute;if("circle"===d){const{width:r=l.width,height:o=l.height}=t.attribute;e.beginPath(),e.arc(n+r/2,i+o/2,Math.min(r,o)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};mR=vR([po()],mR);let bR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{shape:d}=t.attribute;"circle"===d&&e.restore()}};function wR(t,e,n){const i=t.getCell(e,n);if("shadow-cell"===i.role){t.getCell(i.mergeCol,i.mergeRow).addUpdateBoundTag()}else i.addUpdateBoundTag()}function xR(t,e,n,i,r){const o=t.table;for(let n=0;n<o.columnHeaderLevelCount;n++)wR(t,e,n);const a=t.getCell(e,o.columnHeaderLevelCount);return a?.parent.addUpdateBoundTag(),!0}function CR(t,e,n,i,r,o){const a=t.table;for(let n=0;n<a.columnHeaderLevelCount;n++)wR(t,e,n);const s=t.getCell(e,a.columnHeaderLevelCount);return s?.parent.addUpdateBoundTag(),!0}function _R(t,e,n,i,r){const o=t.table;for(let e=0;e<o.colCount;e++)wR(t,e,n);return!0}function kR(t,e,n,i,r,o){const a=t.table;for(let e=0;e<a.colCount;e++)wR(t,e,n);return!0}function SR(t,e,n){const{table:i}=t,{scenegraph:r}=i,{highlightScope:o,singleStyle:a,disableHeader:s,cellPos:l,cellPosContainHeader:u}=t.hover,h=l.col,c=l.row;if(o===PR.none||s&&(u.col!==e||u.row!==n)){const t=u.col,i=u.row;r.hideHoverIcon(t,i),r.showHoverIcon(e,n),u.col=e,u.row=n}if((s&&i.isHeader(e,n)||o===PR.none)&&(e=-1,n=-1),h===e&&c===n)return;r.deactivateChart(h,c),r.activateChart(e,n);let d=!1;const{ranges:f,highlightScope:p}=t.select;if(-1!==h&&-1!==c&&(d=function(t,e,n,i,r,o,a){let s=!1;o===PR.single?s=!!function(t,e,n,i,r){return wR(t,e,n),!0}(t,e,n)||s:o===PR.row?s=!!_R(t,0,n)||s:o===PR.column?s=!!xR(t,e)||s:o===PR.cross&&(s=!!_R(t,0,n)||s,s=!!xR(t,e)||s);return s}(r,h,c,0,0,o),s||r.hideHoverIcon(h,c)),-1===e||-1===n)return l.col=-1,l.row=-1,void(d&&t.table.scenegraph.updateNextFrame());o===PR.single?d=!!function(t,e,n,i,r){return wR(t,e,n),!0}(r,e,n)||d:o===PR.row?d=!!kR(r,0,n)||d:o===PR.column?d=!!CR(r,e)||d:o===PR.cross&&(d=!!kR(r,0,n)||d,d=!!CR(r,e)||d),o===PR.none||s||r.showHoverIcon(e,n),l.col=e,l.row=n,d&&t.table.scenegraph.updateNextFrame()}function AR(t,e,n){let i,r=null,o=!1;if(Array.isArray(n.sortState))for(let a=0;a<n.sortState.length&&(i=n.sortState[a],i&&(r=n._getHeaderCellBySortState(i)),r&&(o=BR(t,e,r.col,r.row,n)),!o);a++);else i=n.sortState,i&&(r=n._getHeaderCellBySortState(i)),r&&(o=BR(t,e,r.col,r.row,n));const a=n.getHeaderDefine(t,e);i&&o&&a?.sort?i.order="asc"===i.order?"desc":"desc"===i.order?"normal":"asc":a?.sort?i={fieldKey:n.getHeaderFieldKey(t,e),field:n.getHeaderField(t,e),order:"asc"}:o&&a?.showSort||(i={fieldKey:n.getHeaderFieldKey(t,e),field:n.getHeaderField(t,e),order:"normal"}),n.sortState=i,n.stateManeger.setSortState(i),a?.sort&&function(t,e,n){let i;i=t.fieldKey?e.internalProps.layoutMap.headerObjects.find((e=>e&&e.fieldKey===t.fieldKey)):e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));if(!i)return;const{field:r}=i;if(null===r)return;"function"==typeof n.sort?e.dataSource.sort(r,t.order||"asc",n.sort):e.dataSource.sort(r,t.order||"asc",A)}(i,n,a),n.scenegraph.sortCell(),n.stateManeger.updateSelectPos(-1,-1),n.fireListeners(qM.EVENT_TYPE.SORT_CLICK,i)}function BR(t,e,n,i,r){return r._getLayoutCellId(t,e)===r._getLayoutCellId(n,i)}bR=vR([po()],bR);const RR=nt(gt,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function TR(t){if(!t)return;const e=t.role?.startsWith("icon")?t:"richtext"===t.type?t._currentHoverIcon:void 0;return e?"richtext"===t.type?{icon:e,position:{left:t.globalAABBBounds.x1+e.globalAABBBounds.x1,right:t.globalAABBBounds.x1+e.globalAABBBounds.x2,top:t.globalAABBBounds.y1+e.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"richtext-icon"}:{icon:e,position:{left:e.globalAABBBounds.x1,right:e.globalAABBBounds.x2,top:e.globalAABBBounds.y1,bottom:e.globalAABBBounds.y2,width:e.globalAABBBounds.x2-e.globalAABBBounds.x1,height:e.globalAABBBounds.y2-e.globalAABBBounds.y1},type:"icon"}:void 0}var MR,PR,OR;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(MR||(MR={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(PR||(PR={})),function(t){t.asc="asc",t.desc="desc",t.normal="normal"}(OR||(OR={}));class ER{table;interactionState;select;hover;hoverIcon;residentHoverIcon;columnResize;columnMove;menu;sort;frozen;scroll;tablePosition;drill;sparkLine;_clearVerticalScrollBar;_clearHorizontalScrollBar;constructor(t){this.table=t,this.initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this.interactionState=MR.default,this.select={highlightScope:PR.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.hover={highlightScope:PR.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new Je,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort={col:-1,row:-1,order:OR.normal},this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){const{highlightMode:t,disableHover:e,disableHeaderHover:n}=this.table.options.hover??{highlightMode:"cell"};e?this.hover.highlightScope=PR.none:"cross"===t?this.hover.highlightScope=PR.cross:"row"===t?this.hover.highlightScope=PR.row:"column"===t?this.hover.highlightScope=PR.column:"cell"===t&&(this.hover.highlightScope=PR.single),this.hover.singleStyle=!e,this.hover.disableHeader=n,(this.hover.highlightScope===PR.none||n)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{disableSelect:t,disableHeaderSelect:e}=this.table.options?.select??{disableSelect:!1,disableHeaderSelect:!1};this.select.highlightScope=t?PR.none:PR.single,this.select.singleStyle=!t,this.select.disableHeader=e}isSelected(t,e){let n=!1;return this.select.ranges.forEach((i=>{st(i,t,e)&&(n=!0)})),n}setSortState(t){this.sort.field=t.field,this.sort.fieldKey=t.fieldKey,this.sort.order=OR[t.order]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){this.interactionState!==t&&(this.interactionState=t)}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){SR(this,t,e)}updateSelectPos(t,e,n=!1,i=!1,r=!1){-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,n,i,r,o){const{table:a,interactionState:s}=t,{scenegraph:l}=a,{highlightScope:u,disableHeader:h,cellPos:c}=t.select;if((h&&a.isHeader(e,n)||"none"===u)&&(e=-1,n=-1),c.col!==e||c.row!==n){if(-1!==e&&-1!==n&&t.select.ranges.length>0)if(s===MR.grabing){const i=t.select.ranges[t.select.ranges.length-1];e>i.start.col&&e>i.end.col&&a._makeVisibleCell(e+1,n),n>i.start.row&&n>i.end.row&&a._makeVisibleCell(e,n+1),e<i.start.col&&e<i.end.col&&a._makeVisibleCell(e-1,n),n<i.start.row&&n<i.end.row&&a._makeVisibleCell(e,n-1)}else a._makeVisibleCell(e,n);if(o){t.select.ranges=[],l.deleteAllSelectBorder(),t.select.ranges.push({start:{col:0,row:0},end:{col:a.colCount-1,row:a.rowCount-1}});const e=t.select.ranges[t.select.ranges.length-1];l.updateCellSelectBorder(e.start.col,e.start.row,e.end.col,e.end.row)}else if(-1===c.col||-1===c.row||-1!==e&&-1!==n){if(s===MR.default){const o=t.select.ranges[t.select.ranges.length-1];if(i&&o){if(a.isColumnHeader(e,n)){const t=Math.min(o.start.col,o.end.col,e),i=Math.max(o.start.col,o.end.col,e),r=Math.min(o.start.row,o.end.row,n),s=a.rowCount-1;o.start={col:t,row:r},o.end={col:i,row:s}}else if(a.isRowHeader(e,n)){const t=Math.min(o.start.col,o.end.col,e),i=a.colCount-1,r=Math.min(o.start.row,o.end.row,n),s=Math.max(o.start.row,o.end.row,n);o.start={col:t,row:r},o.end={col:i,row:s}}else o.end={col:e,row:n};l.deleteLastSelectedRangeComponents(),l.updateCellSelectBorder(o.start.col,o.start.row,o.end.col,o.end.row)}else{-1===c.col||-1===c.row||r||(t.select.ranges=[],l.deleteAllSelectBorder()),a.isColumnHeader(e,n)?t.select.ranges.push({start:{col:e,row:n},end:{col:e,row:a.rowCount-1}}):a.isRowHeader(e,n)?t.select.ranges.push({start:{col:e,row:n},end:{col:a.colCount-1,row:n}}):t.select.ranges.push({start:{col:e,row:n},end:{col:e,row:n}}),c.col=e,c.row=n;const i=t.select.ranges[t.select.ranges.length-1];l.updateCellSelectBorder(i.start.col,i.start.row,i.end.col,i.end.row)}}else if(s===MR.grabing){-1===c.col&&(c.col=e),-1===c.row&&(c.row=n);const i=t.select.ranges[t.select.ranges.length-1];i.end={col:e,row:n},c.col=e,c.row=n,l.updateCellSelectBorder(i.start.col,i.start.row,e,n)}}else c.col=-1,c.row=-1,t.select.ranges=[],l.deleteAllSelectBorder();l.updateNextFrame()}}(this,t,e,n,i,r)}checkCellRangeInSelect(t,e){return function(t,e,n,i){for(let i=0;i<n.length;i++)if(ut(n[i],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,n,i,r){if(n===this.residentHoverIcon?.icon)return;const o=TR(n);if(o)if("richtext-icon"===o.type){const n=o.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.icon&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),n.attribute.tooltip){const i={content:n.attribute.tooltip.title,referencePosition:{rect:o.position,placement:n.attribute.tooltip.placement},style:Object.assign({},this.table.internalProps.theme?.tooltipStyle,n.tooltip?.style)};this.table.internalProps.tooltipHandler.isBinded(i)||this.table.showTooltip(t,e,i)}}else{const n=o.icon;n!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.icon&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.col=e,this.hoverIcon.icon=n,this.table.scenegraph.setIconHoverStyle(n,t,e,i),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==this.residentHoverIcon?.icon&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isSelecting(){return this.select.selecting}endSelectCells(){if(this.select.selecting=!1,0===this.select.ranges.length)return;this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const t=this.select.ranges[this.select.ranges.length-1].end.col,e=this.select.ranges[this.select.ranges.length-1].end.row;this.table.fireListeners(gt.SELECTED_CELL,{ranges:this.select.ranges,col:t,row:e})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,n){this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.table.scenegraph.component.showResizeCol(t,n),this.table.stateManeger.updateSelectPos(-1,-1),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){let n=t-this.columnResize.x;if(Math.abs(n)<1)return;let i=this.table.colWidthsMap.get(this.columnResize.col);"number"==typeof i||(i=this.table.getColWidth(this.columnResize.col));let r=i;r+=n;const o=this.table.getMinColWidth(this.columnResize.col),a=this.table.getMaxColWidth(this.columnResize.col);if(r<o||r>a){if(i===o||i===a)return;n=i-o>a-i?a-i:o-i}this.table.scenegraph.updateColWidth(this.columnResize.col,n),this.columnResize.x=t,this.table.scenegraph.component.updateResizeCol(this.columnResize.col,e),this.columnResize.col<this.table.frozenColCount&&!this.table.isPivotTable()&&!this.table.transpose&&this.table.scenegraph.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.table.scenegraph.updateNextFrame()}startMoveCol(t,e,n,i){!function(t,e,n,i,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;r.columnMove.moving=!0,r.columnMove.colSource=t,r.columnMove.rowSource=e,r.columnMove.x=n-r.table.tableX,r.columnMove.y=i-r.table.tableY;const o=r.table.getCellType(t,e),a="columnHeader"===o?r.columnMove.x:"rowHeader"===o?r.columnMove.y:0;r.table.scenegraph.component.showMoveCol(t,e,a),r.table.stateManeger.updateSelectPos(-1,-1),r.table.scenegraph.updateNextFrame()}(t,e,n,i,this)}updateMoveCol(t,e,n,i){!function(t,e,n,i,r){if(!("canMoveHeaderPosition"in r.table.internalProps.layoutMap))return;const o=function(t,e,n){const i=n.getCellRange(t.col,t.row);if(n.isColumnHeader(t.col,t.row)){const r=n.getCellRange(e.col,i.start.row);e.row>=n.columnHeaderLevelCount&&(e.row=n.columnHeaderLevelCount-1),e.col>=t.col?e.col=r.end.col:e.col=r.start.col}else if(n.isRowHeader(t.col,t.row)){const r=n.getCellRange(i.start.col,e.row);e.col>=n.rowHeaderLevelCount&&(e.col=n.rowHeaderLevelCount-1),e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:t,row:e},r.table);let a,s,l,u;r.columnMove.x=n-r.table.tableX,r.columnMove.y=i-r.table.tableY,r.columnMove.colTarget=o.col,r.columnMove.rowTarget=o.row,r.table.internalProps.layoutMap.canMoveHeaderPosition({col:r.columnMove.colSource,row:r.columnMove.rowSource},{col:r.columnMove.colTarget,row:r.columnMove.rowTarget})?r.updateCursor("grabbing"):r.updateCursor("not-allowed");const h=r.table.getCellType(t,e);"columnHeader"===h?(s=r.columnMove.x,a=r.columnMove.colTarget>=r.columnMove.colSource?r.table.getColsWidth(0,r.columnMove.colTarget):r.table.getColsWidth(0,r.columnMove.colTarget-1)):"rowHeader"===h&&(u=r.columnMove.y,l=r.columnMove.rowTarget>=r.columnMove.rowSource?r.table.getRowsHeight(0,r.columnMove.rowTarget):r.table.getRowsHeight(0,r.columnMove.rowTarget-1)),r.table.scenegraph.component.updateMoveCol(s,a,u,l),r.table.scenegraph.updateNextFrame()}(t,e,n,i,this)}isMoveCol(){return this.columnMove.moving}endMoveCol(){!function(t){if(!("canMoveHeaderPosition"in t.table.internalProps.layoutMap))return;setTimeout((()=>{t.columnMove.moving=!1}),0),t.table.moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget})&&t.table.scenegraph.updateHeaderPosition(t.columnMove.colSource,t.columnMove.rowSource,t.columnMove.colTarget,t.columnMove.rowTarget),t.updateCursor(),t.table._colRangeWidthsMap.clear(),t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame()}(this)}checkFrozen(){if(this.table.options.frozenColCount){if(this.table.tableNoFrameWidth-this.table.getColsWidth(0,this.table.options.frozenColCount-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==this.table.options.frozenColCount)return this.table._setFrozenColCount(this.table.options.frozenColCount),this.setFrozenCol(this.table.options.frozenColCount),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}updateVerticalScrollBar(t){const e=this.table.getAllRowsHeight();this.scroll.verticalBarPos=t*(e-this.table.scenegraph.height),this.table.scenegraph.setY(-this.scroll.verticalBarPos),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(gt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}updateHorizontalScrollBar(t){const e=this.table.getAllColsWidth();this.scroll.horizontalBarPos=t*(e-this.table.scenegraph.width),this.table.scenegraph.setX(-this.scroll.horizontalBarPos),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(gt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}setScrollTop(t){const e=this.table.getAllRowsHeight();t=Math.max(0,Math.min(t,e-this.table.scenegraph.height)),this.scroll.verticalBarPos=t,this.table.scenegraph.setY(-t),this.table.scenegraph.component.updateVerticalScrollBarPos(t/(e-this.table.scenegraph.height)),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(gt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}setScrollLeft(t){const e=this.table.getAllColsWidth(),n=this.table.getFrozenColsWidth();t=Math.max(0,Math.min(t,e-this.table.scenegraph.width)),this.scroll.horizontalBarPos=t,this.table.scenegraph.setX(-t),this.table.scenegraph.component.updateHorizontalScrollBarPos(t/(e-n)),this.table.stateManeger.updateHoverPos(-1,-1),this.table.fireListeners(gt.SCROLL,{scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:this.table.theme.scrollStyle?.width,scrollWidth:this.table.theme.scrollStyle?.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth})}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{this.table.scenegraph.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{this.table.scenegraph.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,n,i){this.menu.isShow&&this.menu.x===n&&this.menu.y===i?this.hideMenu():this.showContextMenu(t,e,n,i)}showContextMenu(t,e,n,i){this.table.internalProps.menu?.contextMenuItems&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=n,this.menu.y=i,this.table.scenegraph.component.menu.attach(n,i,t,e,sR.contextmenu)),this.table.fireListeners(gt.SHOW_MENU,{x:n,y:i,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,n,i){this.table.fireListeners(gt.DROPDOWN_ICON_CLICK,{col:t,row:e}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,n,i)}showDropDownMenu(t,e,n,i){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(n,i,t,e,sR.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(gt.SHOW_MENU,{x:n,y:i,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const r=this.table.scenegraph.getCell(t,e);let o;r.forEachChildren((t=>t.attribute.funcType===a.dropDown&&(o=t,!0))),o&&(this.residentHoverIcon={col:t,row:e,icon:o},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,r),o.oldVisibleTime=o.attribute.visibleTime,o.setAttribute("visibleTime","always"),o.setAttribute("visible",!0))}hideMenu(){this.table.fireListeners(gt.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(gt.HIDE_MENU),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon.icon.setAttribute("visibleTime",this.residentHoverIcon.icon.oldVisibleTime),this.residentHoverIcon.icon.setAttribute("visible","always"===this.residentHoverIcon.icon.attribute.visibleTime),this.residentHoverIcon=null)}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:n,row:i}=t[e];this.table.scenegraph.updateCellContent(n,i)}}dropDownMenuIsHighlight(t,e,n){const i=this.menu.dropDownMenuHighlight;if(Array.isArray(i))for(let r=0;r<i.length;r++){const o=i[r];let{col:a,row:s}=o;const{field:l,menuKey:u}=o;if("number"!=typeof a||"number"!=typeof s)if(this.table.isPivotTable()&&(Array.isArray(l),1)){const t=this.table.internalProps.layoutMap.getPivotCellAdress(l);if(!t)continue;a=t.col,s=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!t)continue;a=t.col,s=t.row}if(_(a)&&_(s)&&this.table.isCellRangeEqual(t,e,a,s)){const i=this.table._getHeaderLayoutMap(a??t,s??e).dropDownMenu||this.table.globalDropDownMenu;if(i)for(let t=0;t<i.length;t++){const e=i[t];if(h(e)&&(e.menuKey||e.text)===(u||"")&&t===n)return!0;if(d(e)&&e===u&&t===n)return!0}}}return!1}triggerSort(t,e,n){if(this.table.isPivotTable()){const n=this.table.getPivotSortState(t,e);return void this.table.fireListeners(RR.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellType:this.table.getCellType(t,e)})}const i=this.sort.col,r=this.sort.row;AR(t,e,this.table),this.sort.col=t,this.sort.row=e,this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,n,this.sort.order,i,r,this.sort.icon),this.sort.icon=n}updateSortState(t){if(t.field===this.sort.field&&t.order===this.sort.order)return;const e=this.sort.col,n=this.sort.row,i="asc"===this.sort.order?"sort_downward":"desc"===this.sort.order?"sort_upward":"sort_normal";this.setSortState(t);const r=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t.field);this.sort.col=r.col,this.sort.row=r.row;const o=this.table.scenegraph.getCell(this.sort.col,this.sort.row).getChildByName(i,!0);this.table.scenegraph.sortCell(),this.table.scenegraph.updateSortIcon(this.sort.col,this.sort.row,o,this.sort.order,e,n,this.sort.icon)}triggerPin(t,e,n){this.table.isPivotTable()||this.table.transpose||(!function(t,e,n){n.frozenColCount>0?t!==n.frozenColCount-1?n.setFrozenColCount(t+1):n.setFrozenColCount(0):n.setFrozenColCount(t+1)}(t,0,this.table),this.frozen.icon=n)}updateCursor(t="default"){this.table.getElement().style.cursor=t}updateDrillState(t,e,n,i,r,o){this.drill.dimensionKey=t,this.drill.dimensionTitle=e,this.drill.drillDown=n,this.drill.drillUp=i,this.drill.col=r,this.drill.row=o,function(t,e,n,i,r){const o=r.getCellType(t,e);let a=0,s=0,l=!1;"columnHeader"===o?(a=r.getColsWidth(0,r.rowHeaderLevelCount-1)-(0===r.frozenColCount?r.scrollLeft:0),s=r.getRowsHeight(0,e-1)+r.getRowHeight(e)/2,l=!0):"rowHeader"===o&&(s=r.getRowsHeight(0,r.columnHeaderLevelCount-1),a=r.getColsWidth(0,t-1)+r.getColWidth(t)/2,l=!0),r.scenegraph.updateDrill(l,a,s,n,i)}(r,o,n,i,this.table)}updateChartHoverPose(t,e,n,i){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,n){const i=n.scenegraph.getCell(t,e).getChildByName("sparkline"),r=i?.getChildByName("highlight-line"),o=i?.getChildByName("highlight-symbol");r&&r.setAttributes({visible:!1,pickable:!1}),o&&o.setAttributes({visible:!1,pickable:!1}),n.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table),-1!==t&&-1!==e&&function(t,e,n,i,r){const o=r.scenegraph.getCell(t,e).getChildByName("sparkline"),a=o?.getChildByName("sparkline-line"),s=o?.getChildByName("sparkline-symbol-group");if(!a)return;const l=a.bandwidth,u=a.min,h=a.max,c=a.attribute.points;let d;n-=o.globalAABBBounds.x1,o.globalAABBBounds.y1;for(let t=0;t<c.length;t++){const{x:e,y:i,defined:r,rawData:f}=c[t];if(Math.abs(n-e)<l/2&&(d={point:c[t],points:c,pointsBandWidth:l,pointData:f},r)){const t=o.getChildByName("highlight-line");if(t)t.setAttributes({x:e,visible:!0,pickable:!0});else{const t=jv({x:e,y:0,points:[{x:0,y:h},{x:0,y:u}],lineWidth:a.hover.strokeWidth,stroke:a.hover.stroke});t.name="highlight-line",o.addChild(t)}const n=o.getChildByName("highlight-symbol");if(n)n.setAttributes({x:e,y:i,visible:!0,pickable:!0});else{const t=Nv({x:e,y:i,fill:!0,stroke:!0,strokeColor:s.hover.stroke,lineWidth:s.hover.strokeWidth,fillColor:s.hover.fill,size:2*s.hover.size,symbolType:"circle"});t.name="highlight-symbol",o.addChild(t)}break}}if(r.scenegraph.updateNextFrame(),d){const n={col:t,row:e,field:r.getHeaderField(t,e),value:r.getCellValue(t,e),dataValue:r.getCellOriginValue(t,e),cellHeaderPaths:r.internalProps.layoutMap.getCellHeaderPaths(t,e),caption:r.getBodyColumnDefine(t,e).caption,cellRange:r.getCellRelativeRect(t,e),sparkline:{pointData:d.pointData},scaleRatio:r.canvas.getBoundingClientRect().width/r.canvas.offsetWidth};r.fireListeners(gt.MOUSEOVER_CHART_SYMBOL,n)}}(t,e,n,0,this.table),this.sparkLine.col=t,this.sparkLine.row=e}}function HR(t,e,n){const{highlightScope:i,disableHeader:r,cellPos:o}=t.hover;if(!t.table.isHeader(e,n)||!r){if(i===PR.single&&o.col===e&&o.row===n)return"cellBgColor";if(i===PR.column&&o.col===e)return"inlineColumnBgColor";if(i===PR.row&&o.row===n)return"inlineRowBgColor";if(i===PR.cross){if(o.col===e&&o.row===n)return"cellBgColor";if(o.col===e)return"inlineColumnBgColor";if(o.row===n)return"inlineRowBgColor"}}}let LR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{stroke:d=l.stroke,strokeArrayWidth:f=l.strokeArrayWidth,strokeArrayColor:p=l.strokeArrayColor}=t.attribute;d&&(Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};LR=vR([po()],LR);let IR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h){const{width:c=l.width,height:d=l.height,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:v=l.strokeArrayWidth,lineWidth:g=l.lineWidth,strokeColor:y=l.strokeColor}=t.attribute;f&&(Array.isArray(v)||0!==g)&&(Array.isArray(f)||Array.isArray(p)||Array.isArray(v))&&(("number"==typeof g&&1&g||Array.isArray(v)&&v.some((t=>1&t)))&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),DR(t,e,n,i,l,f,v||g,p||y,Math.ceil(c),Math.ceil(d)))}};function DR(t,e,n,i,r,o,a,s,l,u,h,c){const d=function(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let n=0;n<t.length;n++){const i=t[n];if(i)if(e){if(i!==e)return{isSplitDraw:!0}}else e=i}return{isSplitDraw:!1,width:e}}(a),f=!Array.isArray(a),p=!Array.isArray(o),v=Array.isArray(c),g=Array.isArray(s)||d.isSplitDraw;e.setStrokeStyle(t,t.attribute,n,i,r);let y=!1;e.getLineDash().length&&(y=!0),e.beginPath(),e.moveTo(n,i),(p||o[0])&&(f||a[0])?(v&&Array.isArray(c[0])?(e.moveTo(n+l*c[0][0],i),e.lineTo(n+l*(c[0][1]-c[0][0]),i),e.moveTo(n+l,i)):(e.moveTo(n,i),e.lineTo(n+l,i)),!g&&!y||s&&!s[0]||(s&&(e.strokeStyle=s[0]),f||(e.lineWidth=a[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n+l,i))):e.moveTo(n+l,i),(p||o[1])&&(f||a[1])?(v&&Array.isArray(c[1])?(e.moveTo(n+l,i+u*c[1][0]),e.lineTo(n+l,i+u*(c[1][1]-c[1][0])),e.moveTo(n+l,i+u)):(e.moveTo(n+l,i),e.lineTo(n+l,i+u)),!g&&!y||s&&!s[1]||(s&&(e.strokeStyle=s[1]),f||(e.lineWidth=a[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n+l,i+u))):e.moveTo(n+l,i+u),(p||o[2])&&(f||a[2])?(v&&Array.isArray(c[2])?(e.moveTo(n+l*c[2][0],i+u),e.lineTo(n+l*(c[2][1]-c[2][0]),i+u),e.moveTo(n,i+u)):(e.moveTo(n,i+u),e.lineTo(n+l,i+u)),!g&&!y||s&&!s[2]||(s&&(e.strokeStyle=s[2]),f||(e.lineWidth=a[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n,i+u))):e.moveTo(n,i+u),(p||o[3])&&(f||a[3])?(v&&Array.isArray(c[3])?(e.moveTo(n,i+u*c[3][0]),e.lineTo(n,i+u*(c[3][1]-c[3][0])),e.moveTo(n,i)):(e.moveTo(n,i),e.lineTo(n,i+u)),!g&&!y||s&&!s[3]||(s&&(e.strokeStyle=s[3]),f||(e.lineWidth=a[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n,i))):e.moveTo(n,i),g||y||(!f&&d.width&&(e.lineWidth=d.width),e.stroke())}IR=vR([po()],IR);let jR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{lineDash:d=l.lineDash,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:v=l.strokeArrayWidth}=t.attribute;f&&Array.isArray(d)&&d.length&&!Array.isArray(f)&&!Array.isArray(p)&&!Array.isArray(v)&&(c.doStroke=!1)}};jR=vR([po()],jR);let WR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h){const{lineDash:c=l.lineDash,stroke:d=l.stroke,strokeArrayColor:f=l.strokeArrayColor,strokeArrayWidth:p=l.strokeArrayWidth,lineWidth:v=l.lineWidth}=t.attribute;if(!d||!Array.isArray(c)||!c.length||Array.isArray(d)||Array.isArray(f)||Array.isArray(p))return;let{width:g=l.width,height:y=l.height}=t.attribute;g=Math.ceil(g),y=Math.ceil(y),1&v&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),e.lineTo(n+g,i),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n+g,i),e.lineTo(n+g,i+y),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke(),e.beginPath(),e.moveTo(n,i+y),e.lineTo(n+g,i+y),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.stroke(),e.beginPath(),e.moveTo(n,i),e.lineTo(n,i+y),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.stroke()}};WR=vR([po()],WR);let FR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{lineWidth:d=l.lineWidth,stroke:f=l.stroke,lineDash:p=l.lineDash,strokeArrayWidth:v=l.strokeArrayWidth,strokeArrayColor:g=l.strokeArrayColor}=t.attribute;f&&Array.isArray(p)&&!p.length&&!Array.isArray(f)&&!Array.isArray(g)&&!Array.isArray(v)&&1&d&&(c.doStroke=!1)}};FR=vR([po()],FR);let zR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h){const{lineWidth:c=l.lineWidth,stroke:d=l.stroke,lineDash:f=l.lineDash,strokeArrayWidth:p=l.strokeArrayWidth,strokeArrayColor:v=l.strokeArrayColor}=t.attribute;let{width:g=l.width,height:y=l.height}=t.attribute;if(g=Math.ceil(g),y=Math.ceil(y),d&&Array.isArray(f)&&!f.length&&!Array.isArray(d)&&!Array.isArray(v)&&!Array.isArray(p)&&1&c){const r=t.stage.table,o=t.col,a=t.row;(r&&o===r.colCount-1||r&&o===r.frozenColCount-1&&r.scrollLeft)&&(g-=1),(r&&a===r.rowCount-1||r&&a===r.frozenRowCount-1&&r.scrollTop)&&(y-=1),e.beginPath(),n=Math.floor(n)+.5,i=Math.floor(i)+.5,e.rect(n,i,g,y),e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke()}}};zR=vR([po()],zR);let NR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){if("cell"===t.role){const e=function(t,e){let n;if("cell"===t.role&&"number"==typeof t.mergeCol&&"number"==typeof t.mergeRow)for(let i=t.col;i<=t.mergeCol;i++)for(let r=t.row;r<=t.mergeRow;r++){const t=HR(e.stateManeger,i,r);!t||n&&"cellBgColor"!==t||(n=t)}else"cell"===t.role&&(n=HR(e.stateManeger,t.col,t.row));if(!n)return;return i_(n,e.isHeader(t.col,t.row)?e.theme.headerStyle?.hover:e.theme.bodyStyle?.hover,t.col,t.row,e)}(t,t.stage.table);e&&(t.oldColor=t.attribute.fillColor,t.attribute.fillColor=e)}}};NR=vR([po()],NR);let GR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h){"oldColor"in t&&(t.attribute.fillColor=t.oldColor,delete t.oldColor)}};GR=vR([po()],GR);let UR=class{time=Ed.beforeFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h,c){const{stroke:d=l.stroke,strokeArrayWidth:f=l.strokeArrayWidth,strokeArrayColor:p=l.strokeArrayColor}=t.attribute;d&&(Array.isArray(d)||Array.isArray(f)||Array.isArray(p))&&(c.doStroke=!1)}};UR=vR([po()],UR);let VR=class{time=Ed.afterFillStroke;useStyle=!0;order=0;drawShape(t,e,n,i,r,o,a,s,l,u,h){const{width:c=l.width,height:d=l.height,stroke:f=l.stroke,strokeArrayColor:p=l.strokeArrayColor,strokeArrayWidth:v=l.strokeArrayWidth,lineWidth:g=l.lineWidth,strokeColor:y=l.strokeColor}=t.attribute;f&&(Array.isArray(v)||0!==g)&&(Array.isArray(f)||Array.isArray(p)||Array.isArray(v))&&(("number"==typeof g&&1&g||Array.isArray(v)&&v.some((t=>1&t)))&&(n=Math.floor(n)+.5,i=Math.floor(i)+.5),DR(t,e,n,i,l,f,v||g,p||y,Math.ceil(c),Math.ceil(d)))}};VR=vR([po()],VR);var KR=new lo(((t,e,n,i)=>{t(UR).toSelf().inSingletonScope(),t(Bf).toService(UR),t(VR).toSelf().inSingletonScope(),t(Bf).toService(VR),t(IR).toSelf().inSingletonScope(),t(bf).toService(IR),t(LR).toSelf().inSingletonScope(),t(bf).toService(LR),t(yR).toSelf().inSingletonScope(),t(gR).to(yR),t(Lp).to(yR),t(mR).toSelf().inSingletonScope(),t(_f).toService(mR),t(bR).toSelf().inSingletonScope(),t(_f).toService(bR),t(jR).toSelf().inSingletonScope(),t(bf).toService(jR),t(WR).toSelf().inSingletonScope(),t(bf).toService(WR),t(FR).toSelf().inSingletonScope(),t(bf).toService(FR),t(zR).toSelf().inSingletonScope(),t(bf).toService(zR),t(NR).toSelf().inSingletonScope(),t(bf).toService(NR),t(GR).toSelf().inSingletonScope(),t(bf).toService(GR)}));const YR=new Map;class XR{table;scenegraph;currentRow=0;totalRow;rowLimit=1e3;yLimitTop;yLimitBottom;accurateY=0;rowStart=0;rowEnd=0;referenceRow=0;bodyTopRow;bodyBottomRow;bodyLeftCol;bodyRightCol;screenRowCount;firstScreenRowLimit;taskRowCount;rowUpdatePos;rowUpdateDirection;screenTopRow=0;screenTopRowDeltaY;y;cellCache=new Map;constructor(t){this.table=t,this.scenegraph=t.scenegraph}setParams(){this.bodyTopRow=this.table.columnHeaderLevelCount,this.bodyBottomRow=this.table.rowCount-1,this.bodyLeftCol=0,this.bodyRightCol=this.table.colCount-1;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow;const e=this.table.defaultRowHeight;this.taskRowCount=5*Math.ceil(this.table.tableNoFrameHeight/e);const n=e*t,i=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=n/2,this.yLimitBottom=i-n/2;const r=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=this.bodyTopRow+Math.ceil(r/e),this.rowUpdatePos=this.bodyBottomRow}async createColGroupForFirstScreen(t,e,n,i,r){this.setParams(),Pk(t,n,i,0,r.rowHeaderLevelCount-1,r.columnHeaderLevelCount,r.rowCount-1,"rowHeader",r,this.firstScreenRowLimit),Pk(e,n,i,r.rowHeaderLevelCount,r.colCount-1,r.columnHeaderLevelCount,r.rowCount-1,"body",r,this.firstScreenRowLimit),e.firstChild?(this.currentRow=e.firstChild.lastChild.row,this.rowEnd=this.currentRow,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((this.rowEnd-this.rowStart)/2),await this.progress()):(this.currentRow=this.totalRow,this.rowEnd=this.currentRow,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((this.rowEnd-this.rowStart)/2))}async progress(){return new Promise(((t,e)=>{setTimeout((()=>{this.rowUpdatePos<this.rowEnd?(this.updateCellGroupsAsync(),this.progress()):this.currentRow<this.totalRow&&(this.createRow(),this.progress()),t()}),0)}))}async createRow(){this.taskRowCount&&(console.log("createRow",this.currentRow,this.currentRow+this.taskRowCount),this.createRowCellGroup(this.taskRowCount))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const n=this.scenegraph.getColGroup(t),i=t<this.table.rowHeaderLevelCount?"rowHeader":"body";Tk(n,t,n.attribute.width,this.currentRow+1,e,YR,this.table.internalProps.defaultRowHeight,this.table,i)}this.table.internalProps.autoRowHeight&&$R(this.bodyLeftCol,this.bodyRightCol,this.currentRow+1,e,this.table),this.currentRow=e,this.rowEnd=e,this.rowUpdatePos=this.rowEnd,this.referenceRow=Math.floor((e-this.rowStart)/2)}async setY(t){t<this.yLimitTop&&this.rowStart===this.bodyTopRow||t>this.yLimitBottom&&this.rowEnd===this.bodyBottomRow?this.scenegraph.setBodyAndRowHeaderY(-t):this.dynamicSetY(t)}async dynamicSetY(t){const e=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);if(!e)return;const n=e.row;this.y=t,this.screenTopRow=n;const i=n-this.referenceRow;i>0?(this.moveCell(i,"up",n),this.updateBody(t)):i<0?(this.moveCell(-i,"down",n),this.updateBody(t)):this.updateBody(t)}updateBody(t){this.scenegraph.setBodyAndRowHeaderY(-t)}async moveCell(t,e,n){if("up"===e&&this.rowEnd+t>this.bodyBottomRow?t=this.bodyBottomRow-this.rowEnd:"down"===e&&this.rowStart-t<this.bodyTopRow&&(t=this.rowStart-this.bodyTopRow),t<this.rowEnd-this.rowStart){const i="up"===e?this.rowStart:this.rowEnd-t+1,r="up"===e?this.rowStart+t-1:this.rowEnd;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const n=this.scenegraph.getColGroup(t);for(let t=i;t<=r;t++)if("up"===e){const t=n.firstChild;this.updateCellGroupPosition(t,n.lastChild.row+1,n.lastChild.attribute.y+n.lastChild.attribute.height),n.appendChild(t)}else{const t=n.lastChild;this.updateCellGroupPosition(t,n.firstChild.row-1,n.firstChild.attribute.y-t.attribute.height),n.insertBefore(t,n.firstChild)}}const o="up"===e?this.rowEnd+1:this.rowStart-t,a=("up"===e?this.rowEnd:this.rowStart,Math.max(this.bodyTopRow,n-2*this.screenRowCount)),s=Math.min(this.bodyBottomRow,n+3*this.screenRowCount);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=a;e<=s;e++){const n=this.highPerformanceGetCell(t,e);this.updateCellGroupContent(n)}this.table.internalProps.autoRowHeight&&$R(this.bodyLeftCol,this.bodyRightCol,a,s,this.table,e),this.rowStart="up"===e?this.rowStart+t:this.rowStart-t,this.rowEnd="up"===e?this.rowEnd+t:this.rowEnd-t,this.currentRow="up"===e?this.currentRow+t:this.currentRow-t,this.totalRow="up"===e?this.totalRow+t:this.totalRow-t,this.referenceRow=this.rowStart+Math.floor((this.rowEnd-this.rowStart)/2),this.rowUpdatePos=o,this.rowUpdateDirection=e,console.log("move end proxy",this.rowStart,this.rowEnd),console.log("move end cell",this.table.scenegraph.bodyGroup.firstChild.firstChild.row,this.table.scenegraph.bodyGroup.firstChild.lastChild.row),this.table.scenegraph.stage.render(),await this.progress()}else{const i="up"===e?this.rowStart+t:this.rowStart-t,r="up"===e?this.rowEnd+t:this.rowEnd-t,o=this.table.getRowsHeight(this.bodyTopRow,i-1);for(let n=this.bodyLeftCol;n<=this.bodyRightCol;n++){this.scenegraph.getColGroup(n).forEachChildren(((n,i)=>{this.updateCellGroupPosition(n,"up"===e?n.row+t:n.row-t,0===i?o:n._prev.attribute.y+n._prev.attribute.height)}))}let a,s;this.table.internalProps.autoRowHeight?(a=i,s=r):(a=Math.max(this.bodyTopRow,n-2*this.screenRowCount),s=Math.min(this.bodyBottomRow,n+3*this.screenRowCount)),console.log("更新同步范围",a,s);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=a;e<=s;e++){const n=this.highPerformanceGetCell(t,e);this.updateCellGroupContent(n)}console.log("updateAutoRow",r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.table.internalProps.autoRowHeight&&$R(this.bodyLeftCol,this.bodyRightCol,a,s,this.table,r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.rowStart=i,this.rowEnd=r,this.currentRow="up"===e?this.currentRow+t:this.currentRow-t,this.totalRow="up"===e?this.totalRow+t:this.totalRow-t,this.referenceRow=this.rowStart+Math.floor((this.rowEnd-this.rowStart)/2),this.rowUpdatePos=this.rowStart,this.rowUpdateDirection=r>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up",console.log("move total end proxy",this.rowStart,this.rowEnd),console.log("move total end cell",this.table.scenegraph.bodyGroup.firstChild.firstChild.row,this.table.scenegraph.bodyGroup.firstChild.lastChild.row),this.scenegraph.renderSceneGraph(),this.table.internalProps.autoRowHeight||await this.progress()}}async updateCellGroupsAsync(){this.updateCellGroups(this.taskRowCount)}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);console.log("updateCellGroups",this.rowUpdatePos,e);for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let n=this.rowUpdatePos;n<=e;n++){const e=this.highPerformanceGetCell(t,n);this.updateCellGroupContent(e)}this.table.internalProps.autoRowHeight&&$R(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection),this.rowUpdatePos=e+1}updateCellGroupPosition(t,e,n){t.row=e,t.setAttribute("y",n),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){t.needUpdate&&(this.scenegraph.updateCellContent(t.col,t.row),t.needUpdate=!1)}async sortCell(){for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++)for(let e=this.rowStart;e<=this.rowEnd;e++){this.highPerformanceGetCell(t,e).needUpdate=!0}let t,e;this.table.internalProps.autoRowHeight?(t=this.rowStart,e=this.rowEnd):(t=Math.max(this.bodyTopRow,this.screenTopRow-2*this.screenRowCount),e=Math.min(this.bodyBottomRow,this.screenTopRow+3*this.screenRowCount)),console.log("sort更新同步范围",t,e);for(let n=this.bodyLeftCol;n<=this.bodyRightCol;n++)for(let i=t;i<=e;i++){const t=this.highPerformanceGetCell(n,i);this.updateCellGroupContent(t)}if(console.log("updateAutoRow",this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.table.internalProps.autoRowHeight&&$R(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up"),this.rowUpdatePos=this.rowStart,this.rowUpdateDirection=this.rowEnd>this.bodyBottomRow-(this.rowEnd-this.rowStart+1)?"down":"up",this.rowEnd===this.table.scenegraph.proxy.bodyBottomRow&&this.rowStart===this.table.scenegraph.proxy.bodyTopRow);else if(this.rowEnd===this.table.scenegraph.proxy.bodyBottomRow){const t=this.table.getAllRowsHeight()-this.table.scenegraph.height;this.updateBody(t)}else this.rowStart===this.table.scenegraph.proxy.bodyTopRow&&this.updateBody(0);this.table.internalProps.autoRowHeight||await this.progress()}highPerformanceGetCell(t,e){if(this.cellCache.get(t)){const n=this.cellCache.get(t);if((n._next||n._prev)&&Math.abs(n.row-e)<e){let i=qR(n,e);return i||(i=this.scenegraph.getCell(t,e)),i.row&&this.cellCache.set(t,i),i}const i=this.scenegraph.getCell(t,e);return i.row&&this.cellCache.set(t,i),i}const n=this.scenegraph.getCell(t,e);return n.row&&this.cellCache.set(t,n),n}}function $R(t,e,n,i,r,o="up"){for(let o=n;o<=i;o++){let n=0;for(let i=t;i<=e;i++){const t=r.scenegraph.getCell(i,o);if(!t.row)continue;const e=t.getChildByName("text")||t.getChildByName("content"),a=a_(i_("padding",r._getCellStyle(i,o),i,o,r)),s=e.AABBBounds.height()+(a[0]+a[2]);n=Math.max(n,s),t.needUpdateForAutoRowHeight=!1}for(let i=t;i<=e;i++){const t=r.scenegraph.getCell(i,o);Ek(r.scenegraph,t,i,o,n,0,!1)}r.setRowHeight(o,n,!0)}if("up"===o)for(let o=t;o<=e;o++)for(let t=n;t<=i;t++){const e=r.scenegraph.getCell(o,t);if(!e.row)continue;let n;n=e._prev?(e._prev?.attribute.y??0)+(e._prev?.attribute.height??0):r.getRowsHeight(r.columnHeaderLevelCount,e.row-1),e.setAttribute("y",n)}else for(let o=t;o<=e;o++)for(let t=i;t>=n;t--){const e=r.scenegraph.getCell(o,t);if(!e.row)continue;let n;e._next?n=(e._next?.attribute.y??0)-(e.attribute.height??0):(n=r.getRowsHeight(r.columnHeaderLevelCount,e.row)-(e.attribute.height??0),console.log("估计位置",r.getRowsHeight(r.columnHeaderLevelCount,e.row))),e.setAttribute("y",n)}}function qR(t,e){return t?t.row===e?t:t.row>e?qR(t._prev,e):qR(t._next,e):null}const ZR=0,JR=1,QR=2,tT=3,eT=10,nT=11,iT=12,rT=9,oT=13,aT=10,sT=12,lT=32,uT=37,hT=46,cT=48,dT=57,fT=65,pT=90,vT=97,gT=122;function yT(t){return function(t){return t>=vT&&t<=gT}(t)||function(t){return t>=fT&&t<=pT}(t)}function mT(t){return t===rT||t===aT||t===sT||t===oT||t===lT}function bT(t){return t>=cT&&t<=dT}function wT(t){return t===hT}function xT(t){return yT(t)||t===uT}function CT(t){return new Error(`calc parse error: ${t}`)}const _T={"*":3,"/":3,"+":2,"-":2};function kT(t,e){function n(t){const n=t.pop(),i=t.pop(),r=t.pop();if(!(r&&r.nodeType&&i&&i.type===QR&&n&&n.nodeType))throw CT(e);return{nodeType:nT,left:r,op:i,right:n}}const i=[];for(;t.length;){const r=t.shift();if(r.type===ZR&&"("===r.value){let n=0;const r=$.findIndex(t,(t=>{if(t.type===ZR&&"("===t.value)n++;else if(t.type===ZR&&")"===t.value){if(!n)return!0;n--}return!1}));if(-1===r)throw CT(e);i.push(kT(t.splice(0,r),e)),t.shift()}else if(r.type===QR){if(i.length>=3){const t=i[i.length-2].value;_T[r.value]<=_T[t]&&i.push(n(i))}i.push(r)}else if(r.type===JR){const{value:t,unit:e}=r;i.push({nodeType:eT,value:t,unit:e})}else r.type===tT&&i.push({nodeType:iT,value:r.value})}for(;i.length>1;)i.push(n(i));return i[0]}function ST(t){const e=function(t){const e=t.replace(/calc\(/g,"(").trim(),n=[],i=e.length;for(let a=0;a<i;a++){const i=e[a],s=i.charCodeAt(0);if("("===i||")"===i)n.push({value:i,type:ZR});else if("*"===i||"/"===i)n.push({value:i,type:QR});else if("+"===i||"-"===i)a=r(i,a+1)-1;else if(bT(s)||wT(s))a=o(i,a+1)-1;else if(!mT(s))throw CT(t)}function r(t,r){if(r<i){const n=e[r],i=n.charCodeAt(0);if(bT(i)||wT(i))return o(t+n,r+1)}return n.push({value:t,type:QR}),r}function o(r,o){let s=o;for(;s<i;s++){const n=e[s],i=n.charCodeAt(0);if(bT(i))r+=n;else{if("."!==n){if(xT(i))return a(r,n,s+1);break}if(r.indexOf(".")>=0)throw CT(t);r+=n}}if("."===r)throw CT(t);return n.push({value:parseFloat(r),type:tT}),s}function a(t,r,o){let a=o;for(;a<i;a++){const t=e[a];if(!xT(t.charCodeAt(0)))break;r+=t}return n.push({value:parseFloat(t),unit:r,type:JR}),a}return n}(t);return kT(e,t)}function AT(t,e){if(t.nodeType===nT){const n=AT(t.left,e),i=AT(t.right,e);switch(t.op.value){case"+":return n+i;case"-":return n-i;case"*":return n*i;case"/":return n/i;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===eT)switch(t.unit){case"%":return t.value*e.full/100;case"px":return t.value;default:throw new Error(`calc error. unknown unit: ${t.unit}`)}else if(t.nodeType===iT)return t.value;throw new Error("calc error.")}function BT(t,e){return AT(ST(t),e)}function RT(t,e){return"string"==typeof t?BT(t.trim(),e):t-0}function TT(t,e,n,i,r){const{layoutMap:o,transpose:a}=i.internalProps,{width:s}=o.columnWidths?.[t]||{};if(a){if("standard"===i.widthMode)return i.isRowHeader(t,0)||i.isCornerHeader(t,0)?Array.isArray(i.defaultHeaderColWidth)?i.defaultHeaderColWidth[t]??i.defaultColWidth:i.defaultHeaderColWidth:i.defaultColWidth;if(("standard-aeolus"===i.widthMode||"adaptive"===i.widthMode)&&0===t&&"auto"!==s&&(o?.showColumnHeader||o?.showHeader)){if("string"==typeof s)return RT(s,i.internalProps.calcWidthContext);if(s)return s}}else if("auto"!==s&&"autoWidth"!==i.widthMode&&!r)return"string"==typeof s?RT(s,i.internalProps.calcWidthContext):s||i.getColWidth(t);return function(t,e,n,i,r){let o=0,a=1;n-e>5e3&&(a=Math.ceil((n-e)/5e3));for(let s=e;s<=n;s+=a){const e=MT(t,s,r);if("number"==typeof e){o=Math.max(e,o);continue}const n=PT(t,s,i,r);if("number"==typeof n){o=Math.max(n,o);continue}const a=r.isHeader(t,s)?r._getHeaderLayoutMap(t,s).headerType:r.getBodyColumnType(t,s);if("text"!==a&&"link"!==a&&"progressbar"!==a){o=Math.max(o,r.getColWidth(t)||0);continue}const l=OT(t,s,r);o=Math.max(l,o)}const s=r.getMinColWidth(t),l=r.getMaxColWidth(t);if(o<s)return s;if(o>l)return l;return o}(t,e,n,r,i)}function MT(t,e,n){const i=n.getCustomRender(t,e),r=n.getCustomLayout(t,e);if(i||r){let o=1,a=0;if(n.isHeader(t,e)||n.getBodyColumnDefine(t,e).mergeCell){const i=n.getCellRange(t,e);o=i.end.col-i.start.col+1}const s={col:t,row:e,dataValue:n.getCellOriginValue(t,e),value:n.getCellValue(t,e)||"",rect:ET(t,e,n),table:n};if(r){const t=r(s);t.rootContainer.isRoot=!0;a=t.rootContainer.getContentSize().width??0}else if("function"==typeof i){const t=i(s);a=t?.expectedWidth??0}else a=i?.expectedWidth??0;return a/o}}function PT(t,e,n,i){const{layoutMap:r}=i.internalProps;if(i.isPivotTable()&&r.isColumnIndicatorHeader(t,e)){const o=r.getBody(t,e);if(o&&o.width&&"auto"!==o.width&&!n){return Math.round(RT(o.width,i.internalProps.calcWidthContext))}}}function OT(t,e,n){let i=0;const r=n.getCellValue(t,e),a=n._getCellStyle(t,e);let s=0;if("body"!==n.getCellType(t,e)||!!n.getBodyColumnDefine(t,e)?.icon){const i=n.getCellIcons(t,e);i?.forEach((t=>{t.positionType!==o.absoluteRight&&(s+=(t.width??0)+(t.marginLeft??0)+(t.marginRight??0))}))}let l=1;if(n.isHeader(t,e)||n.getBodyColumnDefine(t,e).mergeCell){const i=n.getCellRange(t,e);l=i.end.col-i.start.col+1}const u=a_(i_("padding",a,t,e,n)),h=u[1]+u[3],c=i_("fontSize",a,t,e,n),d=i_("fontFamily",a,t,e,n),f=k(r).split("\n")||[];return f.length>=1?f.forEach((t=>{const e=n.measureText(t.slice(0,n.options.maxCharactersNumber||200),{fontSize:c,fontFamily:d}).width;i=Math.max((e+h+4+s)/l,i)})):i=Math.max((h+4+s)/l,i),!1!==n.internalProps.limitMaxAutoWidth&&(i=Math.min("number"==typeof n.internalProps.limitMaxAutoWidth?n.internalProps.limitMaxAutoWidth:450,i)),i}function ET(t,e,n){return{left:0,top:0,right:n.getColWidth(t),bottom:n.getRowHeight(e),width:n.getColWidth(t),height:n.getRowHeight(e)}}new oc({});RC.load(KR);const HT=new n_({});HT.role="empty";class LT{proxy;tableGroup;colHeaderGroup;cornerHeaderGroup;rowHeaderGroup;bodyGroup;componentGroup;selectedRangeComponents;selectingRangeComponents;lastSelectId;component;stage;table;isPivot;transpose;hasFrozen;frozenColCount;frozenRowCount;clear;constructor(t){var e;this.table=t,this.hasFrozen=!1,this.clear=!0,this.stage=(e={canvas:t.canvas,width:t.canvas.width,height:t.canvas.height,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor},new xv(e)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){return this.tableGroup.attribute?.width??0}get height(){return this.tableGroup.attribute?.height??0}get x(){return this.tableGroup.attribute?.x??0}get y(){return this.tableGroup.attribute?.y??0}get bodyRowStart(){return this.transpose||this.isPivot?this.table.columnHeaderLevelCount:this.proxy.rowStart??0}get bodyRowEnd(){return this.transpose||this.isPivot?this.table.rowCount-1:this.proxy.rowEnd??0}initSceneGraph(){this.isPivot=this.table.isPivotTable(),this.transpose=this.table.options.transpose;const t=this.table.tableNoFrameWidth,e=this.table.tableNoFrameHeight;this.tableGroup=new n_({x:0,y:0,width:t,height:e,clip:!0,pickable:!1}),this.tableGroup.role="table";const n=new n_({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});n.role="col-header",this.colHeaderGroup=n;const i=new n_({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});i.role="corner-header",this.cornerHeaderGroup=i;const r=new n_({x:0,y:0,width:0,height:0,clip:!1,pickable:!1});r.role="row-header",this.rowHeaderGroup=r;const o=new n_({x:0,y:0,width:t,height:0,clip:!1,pickable:!1});o.role="body",this.bodyGroup=o;const a=new n_({x:0,y:0,width:0,height:0,clip:!1,pickable:!1,childrenPickable:!0});a.role="component",this.componentGroup=a,this.tableGroup.addChild(o),this.tableGroup.addChild(r),this.tableGroup.addChild(n),this.tableGroup.addChild(i),this.tableGroup.addChild(a)}createComponent(){this.component=new fR(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}createSceneGraph(){this.clear=!1,function(t){const e="undefined"!=typeof window?window.performance.now():0;t._clearColRangeWidthsMap();for(let e=0;e<t.colCount;e++){let n;if(!t.internalProps.transpose&&"only-header"===t.internalProps.layoutMap.columnWidths?.[e]?.columnWidthComputeMode&&"showHeader"in t.internalProps.layoutMap){const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,n=TT(e,0,t.internalProps.layoutMap.headerLevelCount,t,!1),t.internalProps.layoutMap.showHeader=i}else n=t.internalProps.transpose||"only-body"!==t.internalProps.layoutMap.columnWidths?.[e]?.columnWidthComputeMode?TT(e,0,t.rowCount-1,t,!1):TT(e,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t,!1);t._setColContentWidth(e,n),t.setColWidth(e,n,!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let n=0;for(let e=0;e<t.colCount;e++)n+=t.getColWidth(e);const i=e/n;for(let n=0;n<t.colCount;n++){let r;r=n===t.colCount-1?e-t.getColsWidth(0,t.colCount-2):Math.round(t.getColWidth(n)*i),t.setColWidth(n,r)}}else if("standard-aeolus"===t.widthMode&&t.internalProps.transpose){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let n=0,i=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);e<t.frozenColCount&&(i+=r),n+=r}if(n<e&&n-i>0){const r=(e-i)/(n-i);for(let e=t.frozenColCount;e<t.colCount;e++)t.setColWidth(e,t.getColWidth(e)*r)}}console.log("computeColsWidth time:",("undefined"!=typeof window?window.performance.now():0)-e)}(this.table),this.frozenColCount=this.table.rowHeaderLevelCount,this.frozenRowCount=this.table.columnHeaderLevelCount,this.proxy=new XR(this.table),this.createHeaderSceneGraph(),this.transpose||this.isPivot?this.createBodySceneGraph():this.createBodySceneGraphForFirstScreen()}createHeaderSceneGraph(){var t,e,n,i;t=this.cornerHeaderGroup,e=0,n=0,i=this.table,Pk(t,e,n,0,i.rowHeaderLevelCount-1,0,i.columnHeaderLevelCount-1,"cornerHeader",i),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),function(t,e,n,i){Pk(t,e,n,i.rowHeaderLevelCount,i.colCount-1,0,i.columnHeaderLevelCount-1,"columnHeader",i)}(this.colHeaderGroup,0,0,this.table)}createBodySceneGraph(){var t,e,n,i;this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),t=this.rowHeaderGroup,e=0,n=0,i=this.table,Pk(t,e,n,0,i.rowHeaderLevelCount-1,i.columnHeaderLevelCount,i.rowCount-1,"rowHeader",i),this.bodyGroup.setAttributes({y:this.colHeaderGroup.attribute.height,x:this.rowHeaderGroup.attribute.width}),function(t,e,n,i){Pk(t,e,n,i.rowHeaderLevelCount,i.colCount-1,i.columnHeaderLevelCount,i.rowCount-1,"body",i)}(this.bodyGroup,0,0,this.table),this.afterScenegraphCreated()}createBodySceneGraphForFirstScreen(){this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),this.bodyGroup.setAttributes({y:this.colHeaderGroup.attribute.height,x:this.rowHeaderGroup.attribute.width}),console.log("before-createBodyColGroupForFirstScreen"),this.proxy.createColGroupForFirstScreen(this.rowHeaderGroup,this.bodyGroup,0,0,this.table),console.log("after-createBodyColGroupForFirstScreen"),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCellOld(t,e){let n;if(n=this.hasFrozen&&t<this.table.frozenColCount&&e<this.table.frozenRowCount?this.cornerHeaderGroup.getChildAt(t)?.getChildAt(e):e<this.table.frozenRowCount?this.colHeaderGroup.getChildAt(this.hasFrozen?t-this.table.frozenColCount:t)?.getChildAt(e):t<this.table.frozenColCount?this.rowHeaderGroup.getChildAt(t)?.getChildAt(e-this.table.frozenRowCount):this.bodyGroup.getChildAt(t-this.table.frozenColCount)?.getChildAt(e-this.table.frozenRowCount),n&&"shadow-cell"===n.role){const i=this.table.getCellRange(t,e);n=this.getCell(i.start.col,i.start.row)}return n||void 0}getColGroupOld(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getChildAt(t):t<this.frozenColCount?this.rowHeaderGroup.getChildAt(t):e?this.rowHeaderGroup.getChildAt(t-this.frozenColCount):this.bodyGroup.getChildAt(t-this.frozenColCount),n||void 0}getCell(t,e,n){let i=this.getColGroup(t,e<this.frozenRowCount)?.getRowGroup(e);if(i&&"shadow-cell"===i.role&&!n){const n=this.table.getCellRange(t,e);i=this.getCell(n.start.col,n.start.row)}return i||HT}getColGroup(t,e=!1){let n;return n=t<this.frozenColCount&&e?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):e?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),n||void 0}getCellSize(t,e){const n=this.getCell(t,e),i=A_(this.table,t,e);let r=n.attribute.width,o=n.attribute.height;return i&&(r/=i.end.col-i.start.col+1,o/=i.end.row-i.start.row+1),{width:r,height:o}}updateNextFrame(){this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){this.selectingRangeComponents.forEach(((t,e)=>{const[n,i,r,o]=e.split("-");let a;for(let t=parseInt(n,10);t<=parseInt(r,10);t++)for(let e=parseInt(i,10);e<=parseInt(o,10);e++){const n=this.getCell(t,e);n.AABBBounds.width();const i=n.globalAABBBounds;a?a.union(i):a=i}t.rect.setAttributes({x:a.x1-this.tableGroup.attribute.x,y:a.y1-this.tableGroup.attribute.y,width:a.width(),height:a.height(),visible:!0});const s=parseInt(n,10)===this.table.frozenColCount,l=parseInt(i,10)===this.table.frozenRowCount;s&&t.rect.attribute.stroke[3]||l&&t.rect.attribute.stroke[0]?(s&&this.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?this.cornerHeaderGroup:this.rowHeaderGroup),l&&this.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?this.cornerHeaderGroup:this.colHeaderGroup),t.rect.attribute.x<this.rowHeaderGroup.attribute.width&&this.table.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role)&&t.rect.setAttributes({x:t.rect.attribute.x+(this.rowHeaderGroup.attribute.width-t.rect.attribute.x),width:t.rect.attribute.width-(this.rowHeaderGroup.attribute.width-t.rect.attribute.x)}),t.rect.attribute.y<this.colHeaderGroup.attribute.height&&this.table.scrollTop>0&&("body"===t.role||"rowHeader"===t.role)&&t.rect.setAttributes({y:t.rect.attribute.y+(this.colHeaderGroup.attribute.height-t.rect.attribute.y),height:t.rect.attribute.height-(this.colHeaderGroup.attribute.height-t.rect.attribute.y)})):this.tableGroup.insertAfter(t.rect,"body"===t.role?this.bodyGroup:"columnHeader"===t.role?this.colHeaderGroup:"rowHeader"===t.role?this.rowHeaderGroup:this.cornerHeaderGroup)})),this.selectedRangeComponents.forEach(((t,e)=>{const[n,i,r,o]=e.split("-");let a;for(let t=parseInt(n,10);t<=parseInt(r,10);t++)for(let e=parseInt(i,10);e<=parseInt(o,10);e++){const n=this.getCell(t,e);n.AABBBounds.width();const i=n.globalAABBBounds;a?a.union(i):a=i}t.rect.setAttributes({x:a.x1-this.tableGroup.attribute.x,y:a.y1-this.tableGroup.attribute.y,width:a.width(),height:a.height(),visible:!0});const s=parseInt(n,10)===this.table.frozenColCount,l=parseInt(i,10)===this.table.frozenRowCount;s&&t.rect.attribute.stroke[3]||l&&t.rect.attribute.stroke[0]?(s&&this.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?this.cornerHeaderGroup:this.rowHeaderGroup),l&&this.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?this.cornerHeaderGroup:this.colHeaderGroup),t.rect.attribute.x<this.rowHeaderGroup.attribute.width&&this.table.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role)&&t.rect.setAttributes({x:t.rect.attribute.x+(this.rowHeaderGroup.attribute.width-t.rect.attribute.x),width:t.rect.attribute.width-(this.rowHeaderGroup.attribute.width-t.rect.attribute.x)}),t.rect.attribute.y<this.colHeaderGroup.attribute.height&&this.table.scrollTop>0&&("body"===t.role||"rowHeader"===t.role)&&t.rect.setAttributes({y:t.rect.attribute.y+(this.colHeaderGroup.attribute.height-t.rect.attribute.y),height:t.rect.attribute.height-(this.colHeaderGroup.attribute.height-t.rect.attribute.y)})):this.tableGroup.insertAfter(t.rect,"body"===t.role?this.bodyGroup:"columnHeader"===t.role?this.colHeaderGroup:"rowHeader"===t.role?this.rowHeaderGroup:this.cornerHeaderGroup)}))}removeInteractionBorder(t,e){const n=this.getCell(t,e);n.setAttribute("highlightStroke",void 0),n.setAttribute("highlightStrokeArrayWidth",void 0),n.setAttribute("highlightStrokeArrayColor",void 0)}hideHoverIcon(t,e){if(-1===t||-1===e)return;DT(this,this.getCell(t,e),"mouseenter_cell")}showHoverIcon(t,e){if(-1===t||-1===e)return;IT(this,this.getCell(t,e),"mouseenter_cell")}hideClickIcon(t,e){if(-1===t||-1===e)return;DT(this,this.getCell(t,e),"click_cell")}showClickIcon(t,e){if(-1===t||-1===e)return;IT(this,this.getCell(t,e),"click_cell")}deactivateChart(t,e){if(-1===t||-1===e)return;const n=this.getCell(t,e);n?.firstChild?.deactivate?.()}activateChart(t,e){if(-1===t||-1===e)return;const n=this.getCell(t,e);n?.firstChild?.activate?.(this.table)}createCellSelectBorder(t,e,n,i,r,o,a){const s=Math.min(t,n),l=Math.min(e,i),u=Math.max(t,n),h=Math.max(e,i);let c;for(let t=s;t<=u;t++)for(let e=l;e<=h;e++){const n=this.getCell(t,e);if("shadow-cell"===n.role)continue;const i=n.globalAABBBounds;c?c.union(i):c=i}const d=this.table.theme,f=d.selectionStyle?.cellBorderColor,p=d.selectionStyle?.cellBorderLineWidth,v=Fv({pickable:!1,fill:!0,fillColor:d.selectionStyle?.cellBgColor??"rgba(0, 0, 255,0.1)",strokeColor:f,lineWidth:p,stroke:a,x:c.x1-this.tableGroup.attribute.x,y:c.y1-this.tableGroup.attribute.y,width:c.width(),height:c.height(),visible:!0});this.lastSelectId=o,this.selectingRangeComponents.set(`${s}-${l}-${u}-${h}-${o}`,{rect:v,role:r}),this.tableGroup.insertAfter(v,"body"===r?this.bodyGroup:"columnHeader"===r?this.colHeaderGroup:"rowHeader"===r?this.rowHeaderGroup:this.cornerHeaderGroup)}moveSelectingRangeComponentsToSelectedRangeComponents(){this.selectingRangeComponents.forEach(((t,e)=>{this.selectedRangeComponents.get(e)&&this.selectedRangeComponents.get(e).rect.delete(),this.selectedRangeComponents.set(e,t)})),this.selectingRangeComponents=new Map,this.updateNextFrame()}deleteLastSelectedRangeComponents(){this.selectedRangeComponents.forEach(((t,e)=>{e.split("-")[4]===this.lastSelectId&&(t.rect.delete(),this.selectedRangeComponents.delete(e))}))}deleteAllSelectBorder(){this.selectedRangeComponents.forEach(((t,e)=>{t.rect.delete()})),this.selectedRangeComponents=new Map}updateCellSelectBorder(t,e,n,i){let r=Math.min(n,t),o=Math.min(i,e),a=Math.max(n,t),s=Math.max(i,e);const l=()=>{let t=!1;for(let e=r;e<=a;e++){if(e===r)for(let n=o;n<=s;n++){const i=A_(this.table,e,n);if(i&&i.start.col<r){r=i.start.col,t=!0;break}}if(!t&&e===a)for(let n=o;n<=s;n++){const i=A_(this.table,e,n);if(i&&i.end.col>a){a=i.end.col,t=!0;break}}if(t)break}if(!t)for(let e=o;e<=s;e++){if(e===o)for(let n=r;n<=a;n++){const i=A_(this.table,n,e);if(i&&i.start.row<o){o=i.start.row,t=!0;break}}if(!t&&e===s)for(let n=r;n<=a;n++){const i=A_(this.table,n,e);if(i&&i.end.row>s){s=i.end.row,t=!0;break}}if(t)break}t&&l()};l(),this.selectingRangeComponents.forEach(((t,e)=>{t.rect.delete()})),this.selectingRangeComponents=new Map;let u=!1,h=!1,c=!1,d=!1;if(r<=this.table.frozenColCount-1&&o<=this.table.frozenRowCount-1&&(d=!0),r<=this.table.frozenColCount-1&&s>=this.table.frozenRowCount&&(u=!0),o<=this.table.frozenRowCount-1&&a>=this.table.frozenColCount&&(h=!0),a>=this.table.frozenColCount&&s>=this.table.frozenRowCount&&(c=!0),d){const t=Math.min(a,this.table.frozenColCount-1),e=Math.min(s,this.table.frozenRowCount-1),n=[!0,!h,!u,!0];this.createCellSelectBorder(r,o,t,e,"cornerHeader",`${r}${o}${a}${s}`,n)}if(h){const t=Math.max(r,this.table.frozenColCount),e=Math.min(s,this.table.frozenRowCount-1),n=[!0,!0,!c,!d];this.createCellSelectBorder(t,o,a,e,"columnHeader",`${r}${o}${a}${s}`,n)}if(u){const t=Math.max(o,this.table.frozenRowCount),e=Math.min(a,this.table.frozenColCount-1),n=[!d,!c,!0,!0];this.createCellSelectBorder(r,t,e,s,"rowHeader",`${r}${o}${a}${s}`,n)}if(c){const t=Math.max(r,this.table.frozenColCount),e=Math.max(o,this.table.frozenRowCount),n=[!h,!0,!0,!u];this.createCellSelectBorder(t,e,a,s,"body",`${r}${o}${a}${s}`,n)}}getIcon(t,e,n,i){let r;return this.getCell(t,e).forEachChildren((t=>{"icon"===t.role&&t.containsPoint(n,i,vs.GLOBAL)&&(r=t)})),r}setIconHoverStyle(t,e,n,i){if(t.attribute.backgroundColor){let e=t.parent.getChildByName("icon-back");e?e.setAttributes({x:(t.attribute.x??0)+(t.attribute.dx??0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(t.attribute.y??0)+(t.AABBBounds.height()-t.backgroundHeight)/2,width:t.backgroundWidth,height:t.backgroundHeight,fillColor:t.attribute.backgroundColor,borderRadius:5,visible:!0}):(e=Fv({x:(t.attribute.x??0)+(t.attribute.dx??0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(t.attribute.y??0)+(t.AABBBounds.height()-t.backgroundHeight)/2,width:t.backgroundWidth,height:t.backgroundHeight,fillColor:t.attribute.backgroundColor,borderRadius:5,pickable:!1,visible:!0}),e.name="icon-back"),t.parent.insertBefore(e,t)}if(t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage),t.tooltip){const{x1:i,x2:r,y1:o,y2:a}=t.globalAABBBounds,s={content:t.tooltip.title,referencePosition:{rect:{left:i-this.table.tableX,right:r-this.table.tableX,top:o-this.table.tableY,bottom:a-this.table.tableY,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},style:Object.assign({},this.table.internalProps.theme?.tooltipStyle,t.tooltip?.style)};this.table.internalProps.tooltipHandler.isBinded(s)||this.table.showTooltip(e,n,s)}}setIconNormalStyle(t,e,n){const i=t.parent.getChildByName("icon-back");i&&i.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}updateColWidth(t,e){!function(t,e,n){const{autoRowHeight:i}=t.table.internalProps,r=t.getColGroup(e,!0),o=r.attribute.width;r?.setAttribute("width",o+n),r?.forEachChildren(((r,a)=>{if(Ik(t,r,e,r.row,o,n,t.table.columnHeaderLevelCount,i)){const e=A_(t.table,r.col,r.row);if(e&&e.end.row-e.start.row)for(let n=e.start.row;n<=e.end.row;n++)Dk(t,n);else Dk(t,r.row)}}));const a=t.getColGroup(e),s=a.attribute.width;a?.setAttribute("width",s+n),a?.forEachChildren(((e,r)=>{if(Ik(t,e,e.col,e.row,s,n,t.table.rowHeaderLevelCount,i)){const n=A_(t.table,e.col,e.row);if(n&&n.end.row-n.start.row)for(let e=n.start.row;e<=n.end.row;e++)Dk(t,e);else Dk(t,e.row)}})),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)})),t.bodyGroup.forEachChildrenSkipChild(((t,i)=>{t.col>e&&t.setAttribute("x",t.attribute.x+n)}))),t.table.setColWidth(e,a.attribute.width,!0)}(this,t,e),this.updateContainerWidth(t,e)}updateAutoColWidth(t){const e=this.table.getColWidth(t),n=TT(t,0,this.table.rowCount-1,this.table,!0);n!==e&&this.updateColWidth(t,n-e)}updateTableSize(){this.tableGroup.setAttributes({width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,(this.colHeaderGroup.attribute.height??0)+(this.bodyGroup.attribute.height??0))}),this.tableGroup.border&&this.tableGroup.border.setAttributes({width:this.tableGroup.attribute.width+this.tableGroup.border.attribute.lineWidth,height:this.tableGroup.attribute.height+this.tableGroup.border.attribute.lineWidth})}updateRowHeight(t,e){!function(t,e,n){for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=A_(t.table,i,e);o&&o.start.col!==i||(Ok(t,r,i,e,r.attribute.height,n,t.table.isHeader(i,e)),t.updateCellContentWhileResize(i,e))}let i=0,r=0;e<t.table.columnHeaderLevelCount?(t.colHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height+n),t.rowHeaderGroup.setAttribute("y",t.colHeaderGroup.attribute.y+n),t.bodyGroup.setAttribute("y",t.bodyGroup.attribute.y+n),i=e+1,r=t.table.columnHeaderLevelCount-1):(i=e+1,r=t.bodyRowEnd);for(let e=i;e<=r;e++)for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=A_(t.table,i,e);(!o||o.start.col===i&&o.start.row===e)&&r.setAttribute("y",r.attribute.y+n)}t.table.setRowHeight(e,t.table.getRowHeight(e)+n,!0)}(this,t,e),this.updateContainerHeight(t,e)}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerHeight(t,e){t<this.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const n=this.table.getColWidth(t);n!==e&&this.updateColWidth(t,e-n)}setRowHeight(t,e){const n=this.table.getRowHeight(t);this.updateRowHeight(t,e-n)}setX(t){this.colHeaderGroup.attribute.width+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width+t),this.colHeaderGroup.setAttribute("x",this.rowHeaderGroup.attribute.width+t),this.updateNextFrame())}setY(t){if(this.transpose||this.isPivot){if(this.colHeaderGroup.attribute.height+t===this.bodyGroup.attribute.y)return;this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.updateNextFrame()}else this.table.scenegraph.proxy&&this.table.scenegraph.proxy.setY(-t)}setBodyAndRowHeaderY(t){this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.updateNextFrame())}afterScenegraphCreated(){const{autoRowHeight:t}=this.table.internalProps;t&&function(t,e){const n=t.colHeaderGroup,i=t.rowHeaderGroup,r=t.cornerHeaderGroup,o=t.bodyGroup;for(let e=0;e<=t.bodyRowEnd;e++){let n=0;for(let i=0;i<t.table.colCount;i++){const r=t.getCell(i,e),o=A_(t.table,r.col,r.row);if(o){const e=t.getCell(o.start.col,o.start.row);n=Math.max(n,e.attribute.height/(o.end.row-o.start.row+1))}else n=Math.max(n,r.attribute.height)}t.table.setRowHeight(e,n,!0)}let a=0;for(let e=0;e<=t.bodyRowEnd;e++){const s=t.table.getRowHeight(e);if(e===t.table.columnHeaderLevelCount){let t=0;n?.firstChild?.forEachChildren((e=>{t+=e.attribute.height})),n.setAttribute("height",t),r.setAttribute("height",t),i.setAttribute("y",t),o.setAttribute("y",t),a=0}for(let n=0;n<t.table.colCount;n++)Lk(t.getCell(n,e),t,n,e,s,a);a+=s}i.setAttribute("height",a),o.setAttribute("height",a)}(this),this.dealWidthMode(),this.dealFrozen(),this.createFrameBorder(),this.component.updateScrollBar()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){const e=t.tableNoFrameWidth;let n=0;for(let e=0;e<t.colCount;e++)n+=t.getColWidth(e);const i=e/n;for(let n=0;n<t.colCount;n++){let r;r=n===t.colCount-1?e-t.getColsWidth(0,t.colCount-2):Math.round(t.getColWidth(n)*i),this.setColWidth(n,r)}}else if("standard-aeolus"===t.widthMode&&this.transpose){const e=t.tableNoFrameWidth;let n=0,i=0;for(let e=0;e<t.colCount;e++){const r=t.getColWidth(e);e<t.frozenColCount&&(i+=r),n+=r}if(n<e&&n-i>0){const r=(e-i)/(n-i);for(let e=t.frozenColCount;e<t.colCount;e++)this.setColWidth(e,t.getColWidth(e)*r)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let n=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",n);let i=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",i);let r=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{r+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",r),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.colHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealFrozen(){if(this.table.frozenColCount>this.table.rowHeaderLevelCount){this.rowHeaderGroup.setAttribute("height",this.bodyGroup.attribute.height),this.rowHeaderGroup.setAttribute("y",this.bodyGroup.attribute.y),this.cornerHeaderGroup.setAttribute("height",this.colHeaderGroup.attribute.height);for(let t=0;t<this.table.frozenColCount-this.table.rowHeaderLevelCount;t++){const t=this.bodyGroup.firstChild;t&&(this.rowHeaderGroup.appendChild(t),this.rowHeaderGroup.setAttribute("width",this.rowHeaderGroup.attribute.width+t.attribute.width),this.bodyGroup.setAttribute("width",this.bodyGroup.attribute.width-t.attribute.width));const e=this.colHeaderGroup.firstChild;e&&(this.cornerHeaderGroup.appendChild(e),this.cornerHeaderGroup.setAttribute("width",this.cornerHeaderGroup.attribute.width+e.attribute.width),this.colHeaderGroup.setAttribute("width",this.colHeaderGroup.attribute.width-e.attribute.width))}}this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width);const t=this.bodyGroup.firstChild?.attribute.x??0;this.bodyGroup.forEachChildrenSkipChild((e=>{e.setAttribute("x",e.attribute.x-t)}));const e=this.colHeaderGroup.firstChild?.attribute.x??0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{t.setAttribute("x",t.attribute.x-e)})),this.updateBorderSizeAndPosition(),this.isPivot||this.transpose||this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.hasFrozen=!0,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.colHeaderGroup.firstChild?.childrenCount??0}resetFrozen(){if(this.frozenColCount>this.table.rowHeaderLevelCount)for(let t=0;t<this.frozenColCount-this.table.rowHeaderLevelCount;t++){const t=this.rowHeaderGroup.lastChild instanceof n_?this.rowHeaderGroup.lastChild:this.rowHeaderGroup.lastChild._prev;t&&(this.bodyGroup.insertBefore(t,this.bodyGroup.firstChild),this.bodyGroup.setAttribute("width",this.bodyGroup.attribute.width+t.attribute.width),this.rowHeaderGroup.setAttribute("width",this.rowHeaderGroup.attribute.width-t.attribute.width));const e=this.cornerHeaderGroup.lastChild instanceof n_?this.cornerHeaderGroup.lastChild:this.cornerHeaderGroup.lastChild._prev;e&&(this.colHeaderGroup.insertBefore(e,this.colHeaderGroup.firstChild),this.colHeaderGroup.setAttribute("width",this.colHeaderGroup.attribute.width+e.attribute.width),this.cornerHeaderGroup.setAttribute("width",this.cornerHeaderGroup.attribute.width-e.attribute.width))}this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width);let t=0;this.bodyGroup.forEachChildrenSkipChild((e=>{e.setAttribute("x",t),t+=e.attribute.width}));let e=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{t.setAttribute("x",e),e+=t.attribute.width})),this.updateBorderSizeAndPosition(),this.isPivot||this.transpose||this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.hasFrozen=!0,this.frozenColCount=this.table.rowHeaderLevelCount,this.frozenRowCount=this.colHeaderGroup.firstChild?.childrenCount??0}updateCellLayoutWidthCertainWidth(t,e,n){const i=t.attribute.width;let r=!1;return t.forEachChildren(((t,o)=>{o+=e;const a=A_(this.table,n,o);a?t=this.getCell(a.start.col,a.start.row):t.setAttribute("width",i);const s=a_(i_("padding",this.table._getCellStyle(n,o),n,o,this.table)),l=t.getChildByName("text");let u=0,h=0;if(l)u=l.AABBBounds.height()+(s[0]+s[2]),l.setAttribute("maxLineWidth",i-(s[1]+s[3])),h=l.AABBBounds.height()+(s[0]+s[2]);else{const e=t.getChildAt(1);u=e.AABBBounds.height()+(s[0]+s[2]),e._cellWidth=i-(s[1]+s[3]),e.layout(),h=e.AABBBounds.height()+(s[0]+s[2])}const c=this.table.getRowHeight(o);t.attribute.height!==h&&(t.setAttribute("height",h),(c===u||h>c)&&(r=!0))})),r}updateHeaderPosition(t,e,n,i){!function(t,e,n,i,r){const o=r.scenegraph,a=r.getCellType(n,i),s="columnHeader"===a?"column":"rowHeader"===a?"row":void 0;let l=0,u=0,h=0,c=0,d=0,f=0,p=0,v=0;if("column"===s){const o=A_(r,t,e),a=A_(r,n,i);o&&a?(l=o.start.col,h=o.end.col,d=a.start.col,p=a.end.col):(l=t,h=t,d=n,p=n),u=e,c=r.rowCount-1,f=i,v=r.rowCount-1}else if("row"===s){const o=A_(r,t,e),a=A_(r,t,e);o&&a?(u=o.start.row,c=o.end.row,f=a.start.row,v=a.end.row):(u=e,c=e,f=i,v=i),l=t,h=r.colCount-1,d=n,p=r.colCount-1}const g=Math.min(l,d),y=Math.max(h,p),m=Math.min(u,f),b=Math.max(c,v);for(let t=g;t<=y;t++)for(let e=m;e<=b;e++)o.updateCellContent(t,e);for(let t=g;t<=y;t++){const e=r.scenegraph.getColGroup(t,!0),n=r.scenegraph.getColGroup(t);e&&e.setAttribute("width",r.getColWidth(t)),n&&n.setAttribute("width",r.getColWidth(t))}o.updateContainer()}(t,e,n,i,this.table)}updateContainer(){let t=0;this.cornerHeaderGroup.forEachChildrenSkipChild(((e,n)=>{e.setAttribute("x",t),t+=e.attribute.width}));let e=0;this.rowHeaderGroup.forEachChildrenSkipChild(((t,n)=>{t.setAttribute("x",e),e+=t.attribute.width}));let n=0;this.colHeaderGroup.forEachChildrenSkipChild(((t,e)=>{t.setAttribute("x",n),n+=t.attribute.width}));let i=0;this.bodyGroup.forEachChildrenSkipChild(((t,e)=>{t.setAttribute("x",i),i+=t.attribute.width})),this.cornerHeaderGroup.setDeltaWidth(t-this.cornerHeaderGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(n-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(e-this.rowHeaderGroup.attribute.width),this.bodyGroup.setDeltaWidth(i-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width);const r=this.table.stateManeger.scroll.horizontalBarPos,o=this.table.stateManeger.scroll.verticalBarPos;this.component.updateScrollBar(),this.table.stateManeger.setScrollLeft(r),this.table.stateManeger.setScrollTop(o),this.updateNextFrame()}clearCells(){this.clear=!0,this.hasFrozen=!1,this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.tableGroup.setAttributes({x:0,y:0,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border)}updateCellContentWhileResize(t,e){const n=this.table.getBodyColumnType(t,e),i=this.getCell(t,e);"image"!==n&&"video"!==n||V_(i,t,e,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&this.rowHeaderGroup.attribute.width;pR(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),pR(this.rowHeaderGroup,this.isPivot?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),pR(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),pR(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),pR(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role)}getResizeColAt(t,e,n,i=8){if(n){if(t<n.globalAABBBounds.x1+i)return{col:n.col-1,row:n.row,x:n.globalAABBBounds.x1};if(n.globalAABBBounds.x2-i<t)return{col:n.col,row:n.row,x:n.globalAABBBounds.x2}}else;return{col:-1,row:-1}}updateIcon(t,e){B_(e,t),t.name=e.name,this.updateNextFrame()}updateFrozen(){this.clear||(this.resetFrozen(),this.dealFrozen(),this.component.updateScrollBar())}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),this.bodyGroup.border?.setAttribute("width",this.bodyGroup.attribute.width-(this.bodyGroup.border.attribute.lineWidth??0)),0===this.rowHeaderGroup.attribute.width?this.bodyGroup.border?.setAttribute("stroke",[!0,!0,!0,!0]):this.bodyGroup.border?.setAttribute("stroke",[!0,!0,!0,!1])),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),this.colHeaderGroup.border?.setAttribute("width",this.colHeaderGroup.attribute.width-(this.colHeaderGroup.border.attribute.lineWidth??0)),0===this.cornerHeaderGroup.attribute.width?this.colHeaderGroup.border?.setAttribute("stroke",[!0,!0,!0,!0]):this.colHeaderGroup.border?.setAttribute("stroke",[!0,!0,!0,!1])),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),this.rowHeaderGroup.border?.setAttribute("width",this.rowHeaderGroup.attribute.width-(this.rowHeaderGroup.border.attribute.lineWidth??0))),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),this.cornerHeaderGroup.border?.setAttribute("width",this.cornerHeaderGroup.attribute.width-(this.cornerHeaderGroup.border.attribute.lineWidth??0)))}updateSortIcon(t,e,n,i,r,o,a){const s=this.table.internalProps.headerHelper.getSortIcon(i,this.table,t,e);if(n&&this.updateIcon(n,s),a!==n){const t=this.table.internalProps.headerHelper.getSortIcon(OR.normal,this.table,r,o);if(a)this.updateIcon(a,t);else{let e;this.getCell(r,o).forEachChildren((t=>"sort"===t.attribute.funcType&&(e=t,!0))),e&&this.updateIcon(e,t)}}}updateFrozenIcon(t,e){const n=Math.max(t,e);this.colHeaderGroup.forEachChildrenSkipChild((t=>!(t.col<=n)||(t.forEachChildren((t=>{t.forEachChildren((e=>{if("pin"===e.attribute.funcType){const n=this.table.internalProps.headerHelper.getPinIcon(t.col,t.row);return this.updateIcon(e,n),!0}return!1}))})),!1))),this.cornerHeaderGroup.forEachChildrenSkipChild((t=>!(t.col<=n)||(t.forEachChildren((t=>{t.forEachChildren((e=>{if("pin"===e.attribute.funcType){const n=this.table.internalProps.headerHelper.getPinIcon(t.col,t.row);return this.updateIcon(e,n),!0}return!1}))})),!1)))}sortCell(){this.isPivot||(this.transpose?setTimeout((()=>{this.clearCells(),this.createSceneGraph()}),10):this.proxy.sortCell())}getCellOverflowText(t,e){const n=this.getCell(t,e).getChildByName("text",!0);if(n){const t=n.attribute.text.join("");let e="";if(n.cache.layoutData.lines.forEach((t=>{e+=t.str})),e!==t)return t}return null}updateDrill(t,e,n,i,r){this.component.drillIcon.update(t,e,n,i,r,this)}updateCellContent(t,e){this.clear||function(t,e,n){const i=n.scenegraph.getCell(t,e,!0),r=n.isHeader(t,e)?n._getHeaderLayoutMap(t,e).headerType:n.getBodyColumnType(t,e),o=n.getCellType(t,e),a="body"!==o?n.getHeaderDefine(t,e):n.getBodyColumnDefine(t,e);let s,l,u;if(("body"!==o||a?.mergeCell)&&(l=n.getCellRange(t,e),s=l.start.col!==l.end.col||l.start.row!==l.end.row),!s||t===l.start.col&&e===l.start.row){const h="body"!==o||!!a?.icon,c=Mk(n._getCellStyle(t,e),n,t,e,i_).theme,d=c._vtable.padding,f=c._vtable.textAlign,p=c._vtable.textBaseline;let v,g,y,m,b;n.internalProps?.dataConfig?.mappingRules&&"body"===o&&n.internalProps?.dataConfig?.mappingRules?.forEach(((t,e)=>{t.bgColor&&(v=t.bgColor.mapping)})),"body"!==o?(g=a?.headerCustomRender,y=a?.headerCustomLayout):(g=a?.customRender||n.customRender,y=a?.customLayout),l?(m=n.getColsWidth(l.start.col,l.end.col),b=n.getRowsHeight(l.start.row,l.end.row)):(m=n.getColWidth(t),b=n.getRowHeight(e)),u=Rk(r,a,n,t,e,n.getColWidth(t),v,g,y,m,b,i.parent,i.attribute.y,d,f,p,h,!1,s,l,c)}else u=new n_({x:0,y:i.attribute.y,width:0,height:0,visible:!1,pickable:!1}),u.role="shadow-cell",u.col=t,u.row=e,u.mergeCol=l.start.col,u.mergeRow=l.start.row;i.parent.insertAfter(u,i),i.parent.removeChild(i)}(t,e,this.table)}}function IT(t,e,n){e.forEachChildren((e=>{"group"===e.type?IT(t,e,n):e.attribute.visibleTime===n&&(e.attribute.visible=!0,t.updateNextFrame())}))}function DT(t,e,n){e.forEachChildren((e=>{"group"===e.type?DT(t,e,n):e.attribute.visibleTime===n&&(e.attribute.visible=!1,t.updateNextFrame())}))}function jT(t,e){let{deltaX:n,deltaY:i}=t;t.shiftKey&&t.deltaY&&(n=i,i=0);const[r,o]=function(t,e,n){const i=2,r=Math.abs(t/e),o=r<=1/i?0:t,a=r>i?0:e;return[o*n.horizontal,a*n.vertical]}(n,i,{horizontal:1,vertical:1});r&&(e.setScrollLeft(e.scroll.horizontalBarPos+r),e.showHorizontalScrollBar(!0)),o&&(e.setScrollTop(e.scroll.verticalBarPos+o),e.showVerticalScrollBar(!0)),t.preventDefault()}class WT{table;constructor(t){this.table=t,this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0)}bindOuterEvent(){const t=this.table.internalProps.handler,e=this.table.stateManeger,n=this.table.scenegraph;this.table.scenegraph.tableGroup.addEventListener("pointermove",(t=>{const n=FT(t);if(e.interactionState!==MR.scrolling)if(e.interactionState!==MR.grabing){if(this.checkColumnResizer(n)?e.updateCursor("col-resize"):e.updateCursor(),this.table.hasListeners(gt.MOUSELEAVE_CELL)){const e=n?.eventArgs?.target;"cell"!==e?.role||-1===this.table.stateManeger.hover.cellPos.col||-1===this.table.stateManeger.hover.cellPos.row||e.col===this.table.stateManeger.hover.cellPos.col&&e.row===this.table.stateManeger.hover.cellPos.row||this.table.fireListeners(gt.MOUSELEAVE_CELL,{col:this.table.stateManeger.hover.cellPos.col,row:this.table.stateManeger.hover.cellPos.row,cellRange:this.table.getCellRangeRelativeRect({col:this.table.stateManeger.hover.cellPos.col,row:this.table.stateManeger.hover.cellPos.row}),scaleRatio:this.table.canvas.getBoundingClientRect().width/this.table.canvas.offsetWidth,event:t.nativeEvent})}if(this.table.hasListeners(gt.MOUSEENTER_CELL)){const e=n?.eventArgs?.target;"cell"===e?.role&&_(e.col)&&_(e.row)&&(e.col!==this.table.stateManeger.hover.cellPos.col||e.row!==this.table.stateManeger.hover.cellPos.row)&&this.table.fireListeners(gt.MOUSEENTER_CELL,{col:e.col,row:e.row,cellRange:this.table.getCellRangeRelativeRect({col:e.col,row:e.row}),scaleRatio:this.table.canvas.getBoundingClientRect().width/this.table.canvas.offsetWidth,event:t.nativeEvent})}if(this.dealIconHover(n),this.dealTableHover(n),n.eventArgs&&this.table.hasListeners(gt.MOUSEMOVE_CELL)){let e,i;if(n.eventArgs?.target){const t=TR(n.eventArgs?.target);t&&(e=t.icon,i=t.position)}this.table.fireListeners(gt.MOUSEMOVE_CELL,{col:n.eventArgs.col,row:n.eventArgs.row,x:n.abstractPos.x,y:n.abstractPos.y,event:t.nativeEvent,targetIcon:e?{name:e.name,position:i,funcType:e.attribute.funcType}:void 0})}}else e.isResizeCol()?(this.dealColumnResizer(n),n.eventArgs&&this.table.hasListeners(gt.RESIZE_COLUMN)&&this.table.fireListeners(gt.RESIZE_COLUMN,{col:this.table.stateManeger.columnResize.col,colWidth:this.table.getColWidth(this.table.stateManeger.columnResize.col)})):e.isMoveCol()?this.dealColumnMover(n):this.dealTableSelect(n)})),this.table.scenegraph.tableGroup.addEventListener("pointerout",(t=>{const e=FT(t),n=e?.eventArgs?.target;"table"===n?.role&&this.dealTableHover()})),this.table.scenegraph.tableGroup.addEventListener("pointerover",(t=>{const e=FT(t),n=e?.eventArgs?.target;if(this.table.hasListeners(gt.MOUSEOVER_CHART_SYMBOL)&&"symbol"===n.type){const e=t.composedPath().find((t=>"cell"===t.roll));if(e){const{col:n,row:i}=e,r={col:n,row:i,field:this.table.getHeaderField(n,i),value:this.table.getCellValue(n,i),dataValue:this.table.getCellOriginValue(n,i),cellHeaderPaths:this.table.internalProps.layoutMap.getCellHeaderPaths(n,i),caption:this.table.getBodyColumnDefine(n,i).caption,cellRange:this.table.getCellRelativeRect(n,i),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:this.table.canvas.getBoundingClientRect().width/this.table.canvas.offsetWidth};this.table.fireListeners(gt.MOUSEOVER_CHART_SYMBOL,r)}}})),this.table.scenegraph.tableGroup.addEventListener("pointerleave",(t=>{e.updateInteractionState(MR.default),this.dealTableHover(),e.updateCursor();const n=t.target;n&&!n.isDescendantsOf(this.table.scenegraph.tableGroup)&&this.table.fireListeners(gt.MOUSELEAVE_TABLE,{col:-1,row:-1,event:t.nativeEvent})})),t.on(this.table.getElement(),"blur",(t=>{console.log("blur"),this.dealTableHover()})),this.table.scenegraph.tableGroup.addEventListener("pointerupoutside",(t=>{console.log("pointerupoutside"),e.updateInteractionState(MR.default),this.dealTableHover(),this.dealTableSelect()})),this.table.scenegraph.tableGroup.addEventListener("pointerdown",(t=>{if(0!==t.button)return;const n=FT(t);if(e.interactionState!==MR.default)return;e.menu.isShow&&n.eventArgs&&n.eventArgs.target!==e.residentHoverIcon?.icon&&e.hideMenu();if(!(n?.eventArgs?.target?.role?.startsWith("icon")?n.eventArgs.target:void 0)){if(this.checkColumnResizer(n,!0))return void e.updateInteractionState(MR.grabing);if(this.chechColumnMover(n))return void e.updateInteractionState(MR.grabing);this.dealTableSelect(n)&&e.updateInteractionState(MR.grabing)}if(this.table.hasListeners(gt.MOUSEDOWN_CELL)){const e=FT(t);e.eventArgs&&this.table.fireListeners(gt.MOUSEDOWN_CELL,{col:e.eventArgs.col,row:e.eventArgs.row,event:t.nativeEvent})}})),this.table.scenegraph.tableGroup.addEventListener("pointerup",(t=>{if(0===t.button){if("grabing"===e.interactionState){if(e.updateInteractionState(MR.default),e.isResizeCol()){if(this.table.stateManeger.endResizeCol(),this.table.hasListeners(gt.RESIZE_COLUMN_END)){const t=[];for(let e=0;e<this.table.colCount;e++)t.push(this.table.getColWidth(e));this.table.fireListeners(gt.RESIZE_COLUMN_END,{col:this.table.stateManeger.columnResize.col,columns:t})}}else if(e.isMoveCol()){this.table.stateManeger.endMoveCol();const e=FT(t);e.eventArgs&&this.table.hasListeners(gt.CHANGE_HEADER_POSITION)&&this.table.fireListeners(gt.CHANGE_HEADER_POSITION,{target:{col:e.eventArgs.col,row:e.eventArgs.row},source:{col:this.table.stateManeger.columnMove.colSource,row:this.table.stateManeger.columnMove.colSource}})}else if(e.isSelecting()){this.table.stateManeger.endSelectCells();const e=FT(t);if(e.eventArgs&&this.table.hasListeners(gt.DRAG_SELECT_END)){const n={event:t.nativeEvent,cells:[],col:e.eventArgs.target.col,row:e.eventArgs.target.row,scaleRatio:this.table.canvas.getBoundingClientRect().width/this.table.canvas.offsetWidth};n.cells=this.table.getSelectedCellInfos(),this.table.fireListeners(gt.DRAG_SELECT_END,n)}}}else e.interactionState===MR.scrolling&&e.updateInteractionState(MR.default);if(this.table.hasListeners(gt.MOUSEUP_CELL)){const e=FT(t);e.eventArgs&&this.table.fireListeners(gt.MOUSEUP_CELL,{col:e.eventArgs.col,row:e.eventArgs.row,event:t.nativeEvent})}}})),this.table.scenegraph.tableGroup.addEventListener("rightdown",(t=>{const n=FT(t);if(n.eventArgs){e.triggerContextMenu(n.eventArgs.col,n.eventArgs.row,n.abstractPos.x,n.abstractPos.y);const{col:i,row:r}=n.eventArgs;if(this.table.hasListeners(gt.CONTEXTMENU_CELL)){const e=this.table.getCellInfo(i,r);let o,a;if(n.eventArgs?.target){const t=TR(n.eventArgs?.target);t&&(o=t.icon,a=t.position)}const s={...e,event:t.nativeEvent,cells:[],targetIcon:o?{name:o.name,position:a,funcType:o.attribute.funcType}:void 0};!function(t,e,n){for(let i=0;i<t.length;i++){const r=t[i];if(r.start.col<=e&&e<=r.end.col&&r.start.row<=n&&n<=r.end.row||r.end.col<=e&&e<=r.start.col&&r.end.row<=n&&n<=r.start.row)return!0}return!1}(this.table.stateManeger.select.ranges,i,r)?s.cells=[[e]]:s.cells=this.table.getSelectedCellInfos(),this.table.fireListeners(gt.CONTEXTMENU_CELL,s)}}})),this.table.scenegraph.tableGroup.addEventListener("click",(t=>{if(console.log("click",t),this.table.stateManeger.columnResize.resizing||this.table.stateManeger.columnMove.moving)return;const e=FT(t);if(this.dealIconClick(t,e),!e?.eventArgs)return;const{col:n,row:i}=e.eventArgs;if(this.table.hasListeners(gt.CLICK_CELL)){const r=this.table.getCellInfo(n,i);let o,a;if(e.eventArgs?.target){const t=TR(e.eventArgs?.target);t&&(o=t.icon,a=t.position)}const s={...r,event:t.nativeEvent,cells:[],targetIcon:o?{name:o.name,position:a,funcType:o.attribute.funcType}:void 0};this.table.fireListeners(gt.CLICK_CELL,s)}})),this.table.scenegraph.stage.addEventListener("click",(t=>{console.log("stage click");const n=t.target;n&&!n.isDescendantsOf(this.table.scenegraph.tableGroup)&&n!==this.table.scenegraph.tableGroup&&(console.log("pointerup outside table"),e.updateInteractionState(MR.default),this.dealTableHover(),this.dealTableSelect(),e.updateCursor())})),this.table.scenegraph.tableGroup.addEventListener("dblclick",(t=>{const e=FT(t),n=e.eventArgs.targetCell.globalAABBBounds,{col:i,row:r}=e.eventArgs,o=this.table.getCellValue(i,r);if(this.table.internalProps.focusControl.setFocusRect(new Dn(n.x1+this.table.scrollLeft,n.y1+this.table.scrollTop,n.x2-n.x1,n.y2-n.y1),o),this.table.hasListeners(gt.DBLCLICK_CELL)){const n=this.table.getCellInfo(i,r);let o,a;if(e.eventArgs?.target){const t=TR(e.eventArgs?.target);t&&(o=t.icon,a=t.position)}const s={...n,event:t.nativeEvent,cells:[],targetIcon:o?{name:o.name,position:a,funcType:o.attribute.funcType}:void 0};this.table.fireListeners(gt.DBLCLICK_CELL,s)}})),n.component.vScrollBar.addEventListener("pointerover",(t=>{e.showVerticalScrollBar()})),n.component.hScrollBar.addEventListener("pointerover",(t=>{e.showHorizontalScrollBar()})),n.component.vScrollBar.addEventListener("pointerout",(t=>{e.interactionState!==MR.scrolling&&e.hideVerticalScrollBar()})),n.component.hScrollBar.addEventListener("pointerout",(t=>{e.interactionState!==MR.scrolling&&e.hideHorizontalScrollBar()})),n.component.vScrollBar._slider.addEventListener("pointerdown",(()=>{e.interactionState!==MR.scrolling&&e.updateInteractionState(MR.scrolling)})),n.component.vScrollBar.addEventListener("pointerup",(()=>{e.interactionState===MR.scrolling&&e.updateInteractionState(MR.default)})),n.component.vScrollBar.addEventListener("pointerupoutside",(()=>{e.interactionState===MR.scrolling&&e.updateInteractionState(MR.default)})),n.component.hScrollBar._slider.addEventListener("pointerdown",(()=>{e.interactionState!==MR.scrolling&&e.updateInteractionState(MR.scrolling)})),n.component.hScrollBar.addEventListener("pointerup",(()=>{e.interactionState===MR.scrolling&&e.updateInteractionState(MR.default)})),n.component.hScrollBar.addEventListener("pointerupoutside",(()=>{e.interactionState===MR.scrolling&&e.updateInteractionState(MR.default)}));const i=w(e.updateVerticalScrollBar,20),r=w(e.updateHorizontalScrollBar,20);n.component.vScrollBar.addEventListener("scroll",(t=>{const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);i(e,t)})),n.component.hScrollBar.addEventListener("scroll",(t=>{const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e)})),t.on(this.table.getElement(),"wheel",(t=>{jT(t,e)})),t.on(this.table.getElement(),"keydown",(t=>{if(this.table.keyboardOptions?.selectAllOnCtrlA&&"a"===t.key&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.deelTableSelectAll()),this.table.hasListeners(gt.KEYDOWN)){const e={keyCode:t.keyCode??t.which,code:t.code,event:t,cells:this.table.getSelectedCellInfos(),scaleRatio:this.table.canvas.getBoundingClientRect().width/this.table.canvas.offsetWidth};this.table.fireListeners(gt.KEYDOWN,e)}})),t.on(this.table.getElement(),"copy",(t=>{if(this.table.keyboardOptions?.copySelected){const e=this.table.getCopyValue();_(e)&&(t.preventDefault(),ht?window.clipboardData.setData("Text",e):t.clipboardData.setData("text/plain",e))}})),t.on(this.table.getElement(),"contextmenu",(t=>{t.preventDefault()}))}bindSelfEvent(){const t=this.table.stateManeger;var e;this.table.listen(gt.ICON_CLICK,(e=>{const{col:n,row:i,x:r,y:o,funcType:s,icon:l}=e;var u;s===a.dropDown?t.triggerDropDownMenu(n,i,r,o):s===a.sort?t.triggerSort(n,i,l):s===a.pin?t.triggerPin(n,i,l):s===a.drillDown&&(u=this.table).fireListeners(RR.DRILLMENU_CLICK,u.stateManeger.drill)})),this.table.listen(gt.DROPDOWNMENU_CLICK,(()=>{t.hideMenu()})),e=this.table,"browser"===bt.mode&&e.listen(gt.CLICK_CELL,(t=>{const{col:n,row:i}=t;let r;r=e.internalProps.layoutMap.isHeader(n,i)?e.isPivotTable()?e._getHeaderLayoutMap(n,i).headerType:e.getHeaderDefine(n,i).headerType:e.getBodyColumnType(n,i);const o=e.isHeader(n,i)?e.getHeaderDefine(n,i):e.getBodyColumnDefine(n,i),a=e.getCellValue(n,i),s=e.getCellOriginValue(n,i);if("link"===o.columnType){if(!1===o.linkJump)return;const t=o.templateLink,r=!1!==o.linkDetect;let l;if(t){const r=e.getCellOriginRecord(n,i),o=Object.assign({__value:a,__dataValue:s},r),u=/\{\s*(\S+?)\s*\}/g;l=t.replace(u,((t,e)=>o[e]))}else if(r){if(!Vn.test(a))return;l=a}else l=a;window.open(l)}else if("image"===r){const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(30, 30, 30, 0.4)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",t.style.zIndex="9999",t.addEventListener("click",(e=>{e.target===t&&document.body.removeChild(t)}));const e=new Image;e.src=a,e.style.maxWidth="80%",e.style.maxHeight="80%",t.appendChild(e),document.body.appendChild(t)}else if("video"===r){const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.backgroundColor="rgba(30, 30, 30, 0.4)",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.overflow="hidden",t.style.zIndex="9999",t.addEventListener("click",(e=>{e.target===t&&document.body.removeChild(t)}));const e=document.createElement("video");e.src=a,e.style.maxWidth="80%",e.style.maxHeight="80%",e.setAttribute("preload","auto"),e.setAttribute("controls","true"),t.appendChild(e),document.body.appendChild(t)}})),this.table.listen(gt.DBLCLICK_CELL,(t=>{this.table._canResizeColumn(t.col,t.row)&&this.table.scenegraph.updateAutoColWidth(t.col)})),this.table.isPivotTable()&&function(t){t.listen(gt.MOUSEENTER_CELL,(e=>{const{col:n,row:i}=e;if(-1===n||-1===i)return;const r=t.internalProps.layoutMap.getHeaderDimension(n,i);r?.drillDown||r?.drillUp?t.stateManeger.updateDrillState(r.dimensionKey,r.dimensionTitle,r.drillDown,r.drillUp,n,i):t.stateManeger.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),function(t){let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.columnType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.columnType));e&&t.listen(gt.MOUSEMOVE_CELL,(e=>{const{col:n,row:i,x:r,y:o}=e;"sparkline"!==t.getBodyColumnType(n,i)&&t.stateManeger.updateChartHoverPose(-1,-1,0,0),t.stateManeger.updateChartHoverPose(n,i,r,o)}))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManeger.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManeger.updateHoverPos(e.col,e.row):this.table.stateManeger.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManeger.updateHoverIcon(e.col,e.row,e.target,e.targetCell,e.event):this.table.stateManeger.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t){if(!t)return this.table.stateManeger.updateSelectPos(-1,-1),!1;const{eventArgs:e}=t;return!!e&&(this.table.stateManeger.updateHoverPos(-1,-1),this.table.stateManeger.updateSelectPos(e.col,e.row,e.event.shiftKey,e.event.ctrlKey||e.event.metaKey),!0)}deelTableSelectAll(){this.table.stateManeger.updateSelectPos(-1,-1,!1,!1,!0)}dealMenuSelect(t){}checkColumnResizer(t,e){const{eventArgs:n}=t;if(n){const i=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,n.targetCell);if(this.table._canResizeColumn(i.col,i.row)&&i.col>=0)return e&&this.table.stateManeger.startResizeCol(i.col,t.abstractPos.x,t.abstractPos.y),!0}return!1}dealColumnResizer(t){this.table.stateManeger.updateResizeCol(t.abstractPos.x,t.abstractPos.y)}chechColumnMover(t){const{eventArgs:e}=t;return!!(e&&this.table.isHeader(e.col,e.row)&&function(t,e,n){for(let i=0;i<n.length;i++)if(st(n[i],t,e))return!0;return!1}(e.col,e.row,this.table.stateManeger.select.ranges)&&this.table._canDragHeaderPosition(e.col,e.row))&&(this.table.stateManeger.startMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y),!0)}dealColumnMover(t){const{eventArgs:e}=t;this.table.stateManeger.updateMoveCol(e.col,e.row,t.abstractPos.x,t.abstractPos.y)}startColumnResizer(t){}dealIconClick(t,e){const{eventArgs:n}=e,{target:i,event:r,col:o,row:a}=n||{target:t.target,event:t,col:-1,row:-1},s=i;if(s.role&&s.role.startsWith("icon-"))return this.table.fireListeners(gt.ICON_CLICK,{name:s.name,x:(s.globalAABBBounds.x1+s.globalAABBBounds.x2)/2,y:s.globalAABBBounds.y2,col:o,row:a,funcType:s.attribute.funcType,icon:s}),!0;if(i instanceof Nh){const t=i.pickIcon(r.global);if(t)return this.table.fireListeners(gt.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:o,row:a,funcType:t.attribute.funcType,icon:t}),!0}return!1}}function FT(t){const e={abstractPos:{x:t.x,y:t.y}},n=function(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}(t.target);return n&&(e.eventArgs={col:n.col,row:n.row,event:t,targetCell:n,target:t.target}),e}let zT;const NT=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class GT extends E{_showBar;_barColor;_barBgColor;_barPositiveColor;_barNegativeColor;_barAxisColor;_barHeight;_barBottom;_barPadding;_showBarMark;_barMarkPositiveColor;_barMarkNegativeColor;_barMarkWidth;_barMarkPosition;_barRightToLeft;static get DEFAULT(){return zT||(zT=new GT)}constructor(t={},e={}){super(t,e),this._showBar=t.showBar||!0,this._barColor=t.barColor||NT,this._barPositiveColor=t.barPositiveColor||"#4dbd74",this._barNegativeColor=t.barNegativeColor||"#f86c6b",this._barAxisColor=t.barAxisColor||"black",this._barBgColor=t.barBgColor,this._barHeight=t.barHeight||3,this._barHeight=t.barHeight||3,this._barBottom=t.barBottom||0,this._barPadding=t.barPadding||[1,1,1,1],this._showBarMark=t.showBarMark||!1,this._barMarkPositiveColor=t.barMarkPositiveColor||"#4dbd74",this._barMarkNegativeColor=t.barMarkNegativeColor||"#f86c6b",this._barMarkWidth=t.barMarkWidth||2,this._barMarkPosition=t.barMarkPosition||"right",this._barRightToLeft=t.barRightToLeft||!1}get showBar(){return this._showBar}set showBar(t){this._showBar=t,this.doChangeStyle()}get barColor(){return this._barColor}set barColor(t){this._barColor=t,this.doChangeStyle()}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t,this.doChangeStyle()}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t,this.doChangeStyle()}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t,this.doChangeStyle()}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t,this.doChangeStyle()}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t,this.doChangeStyle()}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t,this.doChangeStyle()}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t,this.doChangeStyle()}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t,this.doChangeStyle()}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t,this.doChangeStyle()}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t,this.doChangeStyle()}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t,this.doChangeStyle()}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t,this.doChangeStyle()}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t,this.doChangeStyle()}clone(){return new GT(this,null)}}const UT=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive"];class VT{expandIcon;collapseIcon;_table;constructor(t){this._table=t;const e=F_();this.expandIcon=e[s.expandIconName],this.collapseIcon=e[s.collapseIconName]}getIcons(t,e,i,r,o){const a=[],{icon:s}=this._table.getBodyColumnDefine(t,e);if(s){let n;if("function"==typeof s){n=s({col:t,row:e,value:i,dataValue:r,table:this._table})}else n=s;const o=F_(),l=t=>{let e;e="string"==typeof t?o[t]:t,e&&a.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{l(t)})):l(n)}const l=this._table.getHierarchyState(t,e);return l===n.expand?a.push(this.expandIcon):l===n.collapse&&a.push(this.collapseIcon),o&&a.forEach(((n,i)=>{(n.content||n.src)&&(a[i]=this.getCellIconFromRecordValue(n,t,e))})),a}getStyleClass(t){switch(t){case"text":case"link":return L;case"image":case"video":return H;case"chart":case"sparkline":return E;case"progressbar":return GT}}getCellIconFromRecordValue(t,e,n){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,n)));if(!ct.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,n);const i={},r=t;return UT.forEach((t=>{if(void 0!==r[t]){const o=this._table.getFieldData(r[t],e,n);null!=o?i[t]=o:this._table._hasField(r[t],e,n)||(i[t]=r[t])}})),i}}function KT(t,e){const n=document.createElement(t);return e&&n.classList.add(...e),n}U("@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n");const YT="vtable__menu-element",XT=`${YT}__item`,$T=`${YT}__content`,qT=`${YT}--hidden`,ZT=`${YT}--shown`,JT=`${YT}--normal`,QT=`${YT}--select`,tM=`${YT}__icon`,eM=`${YT}__split`,nM=`${YT}__title`,iM=`${YT}__arrow`,rM=`${YT}__no-event`,oM=`${YT}__item-text`;function aM(){return KT("div",[YT,qT])}function sM(t,e,n,i,r,o){const a=t.getCellRange(i,r);for(let i=0;i<e.length;i++){const r=e[i];let{col:o,row:s}=r;const{field:l,menuKey:u}=r;if("number"!=typeof o||"number"!=typeof s)if(t.isPivotTable()&&(Array.isArray(l),1)){const e=t.internalProps.layoutMap.getPivotCellAdress(l);if(!e)continue;o=e.col,s=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(l);if(!e)continue;o=e.col,s=e.row}if(_(o)&&_(s)&&st(a,o,s)&&n===u)return!0}return!1}class lM{_handler;_rootElement;_secondElement;_menuInstanceInfo;_showChildrenIndex;_mouseEnterSecondElement;constructor(t){this._handler=new Ct,this._rootElement=aM(),this._secondElement=aM(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._rootElement?.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(qT))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),u=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(gt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:u,cellType:t.getCellType(n,i)}),t.fireListeners(gt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(gt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(qT))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),u=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(gt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:u,cellType:t.getCellType(n,i)}),t.fireListeners(gt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(gt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("mousemove",(e=>{if(this._rootElement.classList.contains(qT))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:i,col:r,row:o,sub:a}=e.target;if(n){this._showChildrenIndex=i;const n=this._secondElement;n?.classList.remove(qT),n?.classList.add(ZT),n.innerHTML="";const a=this._menuInstanceInfo.content[i]?.children;for(let e=0;e<a.length;e++){const i=a[e],s=uM(i,!!t.stateManeger.menu.dropDownMenuHighlight&&sM(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof i?i?.menuKey||i?.text:i,r,o));s.col=r,s.row=o,s.dropDownIndex=e,"string"==typeof i?(s.text=i,s.menuKey=i):"object"==typeof i&&(s.text=i.text,s.menuKey=i.menuKey||i.text),s.sub=!0,s.sub=!0,n.appendChild(s)}const s=e.target.getBoundingClientRect();this._bindSecondElement(t,r,o,s.right,s.top)}else if(n&&this._showChildrenIndex===i){const t=this._secondElement;t?.classList.remove(qT),t?.classList.add(ZT)}else!a&&this._secondElement?.classList.contains(ZT)&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;t?.classList.remove(ZT),t?.classList.add(qT)}}),300)})),this._secondElement?.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(qT)||t.stopPropagation()})),this._secondElement?.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),this._secondElement?.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),this._secondElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._secondElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(qT))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i);let u=!1;this._menuInstanceInfo.content.forEach(((e,r)=>{if("object"==typeof e&&e.children&&e.children.length)for(let r=0;r<e.children.length;r++){const a=e.children[r];if(sM(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof a?a?.menuKey:a,n,i)&&o===("object"==typeof a?a?.menuKey:a))return void(u=!0)}})),t.fireListeners(gt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(n,i):void 0,menuKey:o,text:a,highlight:u,cellType:t.getCellType(n,i)}),t.fireListeners(gt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(gt.HIDE_MENU),e.stopPropagation()}))}get rootElement(){return this._rootElement}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler.dispose(),delete this._rootElement}bindToCell(t,e,n,i){const r=this._rootElement,o=this._secondElement;if(this._menuInstanceInfo=i,r?.classList.remove(ZT),r?.classList.add(qT),o?.classList.remove(ZT),o?.classList.add(qT),this._canBindToCell(t,e,n)){if(r.innerHTML="",Array.isArray(i.content)){const o=i.content;for(let i=0;i<o?.length;i++){const a=o[i];let s=!!t.stateManeger.menu.dropDownMenuHighlight&&sM(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof a?a?.menuKey||a?.text:a,e,n);if(t.stateManeger.menu.dropDownMenuHighlight&&"object"==typeof a&&Array.isArray(a.children)&&a.children.length)for(let i=0;i<a.children.length;i++){const r=a.children[i];if(sM(t,t.stateManeger.menu.dropDownMenuHighlight,"object"==typeof r?r?.menuKey||r?.text:r,e,n)){s=!0;break}}const l=uM(a,s);l.col=e,l.row=n,l.dropDownIndex=i,"string"==typeof a?(l.text=a,l.menuKey=a):"object"==typeof a&&(l.text=a.text,l.menuKey=a.menuKey||a.text,a.children?.length&&(l.hasChildren=!0)),r.appendChild(l)}}if(this._bindToCell(t,e,n,i.position,i.referencePosition))return r?.classList.add(ZT),r?.classList.remove(qT),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,t?.parentElement&&(t.classList.remove(ZT),t.classList.add(qT)),e?.parentElement&&(e.classList.remove(ZT),e.classList.add(qT))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:o,bottom:a,left:s,right:l}=i,{frozenRowCount:u,frozenColCount:h}=t;if(n>=u&&u>0){if(a<t.getCellRangeRelativeRect({col:e,row:u-1}).bottom)return!1}else if(a<0)return!1;if(e>=h&&h>0){if(l<t.getCellRangeRelativeRect({col:h-1,row:n}).right)return!1}else if(l<0)return!1;const{offsetHeight:c,offsetWidth:d}=r;return!(c<o)&&!(d<s)}_bindToCell(t,e,n,i,r){const o=this._rootElement,a=t.getElement(),{width:s,height:l}=t.internalProps.element.getBoundingClientRect();if(o){o.parentElement!==a&&a.appendChild(o),o.style.left="0px";const e=.8*s;o.style.maxWidth=`${e}px`;const n=o.clientWidth,u=o.clientHeight;let h,c;return i?(h=i.x+t.tableX,c=i.y+t.tableY):r&&(h=r.rect.right-n+t.tableX,c=r.rect.bottom+t.tableY),c+u>l&&(c=l-u,h+=n-2),c<0&&(c/=2),o.style.top=`${c}px`,h<0?h=0:h+n>s&&(h=s-n),o.style.left=`${h}px`,!0}return!1}_bindSecondElement(t,e,n,i,r){const o=this._secondElement,a=this._rootElement,s=t.getElement(),{width:l,left:u,top:h}=t.internalProps.element.getBoundingClientRect(),{x:c,y:d,width:f}=a.getBoundingClientRect();if(o){o.parentElement!==s&&s.appendChild(o),o.style.left="0px";const t=.8*l;o.style.maxWidth=`${t}px`;const e=o.clientWidth,n=r-4-h,a=i-u;o.style.top=`${n}px`;let c=a;return c+e>l?c=c-e-f:c+=4,o.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();if(t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5)return!0;if(this._secondElement){const{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();if(t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5)return!0}return!1}}function uM(t,e){const n=KT("div",[XT,e?QT:JT]);if("string"==typeof t){const e=KT("span",[$T,rM,oM]);e.innerHTML=t,n.appendChild(e)}else if("object"==typeof t){const i=t.type??"item";if("split"===i)return n?.classList.add(eM),n;if(t?.icon?.svg)if(Vn.test(t.icon.svg)){const e=new Image;t.icon.width?e.style.width=t.icon.width.toString()+"px":e.style.width="16px",t.icon.height?e.style.height=t.icon.height.toString()+"px":e.style.height="16px",e.src=t.icon.svg,n.appendChild(e)}else{const i=KT("span",[tM,rM]);i.innerHTML=e&&t.selectedIcon&&t.selectedIcon.svg?t.selectedIcon.svg:t.icon.svg,t.icon.width&&i.children[0].setAttribute("width",t.icon.width.toString()),t.icon.height&&i.children[0].setAttribute("height",t.icon.height.toString()),n.appendChild(i)}const r=KT("span",[$T,rM,oM]);if(r.innerHTML=t.text,n.appendChild(r),"title"===i)n?.classList.add(rM,nM);else if(t?.children?.length){const t=KT("span",[$T,rM,iM]);t.innerHTML=e?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',n.appendChild(t)}}return n}let hM;class cM extends F{static get DEFAULT(){return hM||(hM=new cM)}constructor(t={},e={}){super(t,e),this.textAlign=(t.textAlign??e?.textAlign)||"center"}clone(){return new cM(this)}}class dM{normalIcon;upIcon;downIcon;pinIcon;pinedIcon;pinedHoverIcon;pinedCurrentIcon;dropDownAbsoluteIcon;expandIcon;collapseIcon;_table;constructor(t){this._table=t;const e=F_();this.pinIcon=e[s.pinIconName],this.pinedIcon=e[s.pinedIconName],this.pinedHoverIcon=e[s.pinedHoverIconName],this.pinedCurrentIcon=e[s.pinedCurrentIconName],this.normalIcon=e[s.normalIconName],this.upIcon=e[s.upwardIconName],this.downIcon=e[s.downwardIconName],this.dropDownAbsoluteIcon=e[s.dropdownIconName],this.expandIcon=e[s.expandIconName],this.collapseIcon=e[s.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:n}=this._table.internalProps.layoutMap.getHeader(t,e);if(n){const n=this._table.getPivotSortState(t,e),r="asc"===n?this.downIcon:"desc"===n?this.upIcon:this.normalIcon;r&&i.push(r)}}else{const n=this._table.sortState;let r;r=void 0;const o=this._table.getCellRange(t,e);if(n)if(Array.isArray(n))for(let t=0;t<n.length;t++){const e=n[t],i=this._table._getHeaderCellBySortState(e);if(i&&st(o,i.col,i.row)){({order:r}=e);break}}else{const t=this._table._getHeaderCellBySortState(n);t&&st(o,t.col,t.row)&&({order:r}=n)}const a=this.getSortIcon(r,this._table,t,e);a&&i.push(a)}if(this._table.showPin&&t<this._table.allowFrozenColCount){const n=this.getPinIcon(t,e);n&&i.push(n)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const r=this.getDropDownStateIcons(this._table,t,e);r.length&&i.push(...r);const{captionIcon:o,hierarchyState:a,headerIcon:s}=this._table._getHeaderLayoutMap(t,e);if(o&&i.push(o),a&&(a===n.expand?i.push(this.expandIcon):a===n.collapse&&i.push(this.collapseIcon)),s){let n;if("function"==typeof s){n=s({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table})}else n=s;const r=F_(),o=t=>{let e;e="string"==typeof t?r[t]:t,e&&i.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{o(t)})):o(n)}return i}getPinIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;const n=this._table.getHeaderDefine(t,e);if(n.columns&&n.columns.length>0)return null;let i=this.pinIcon;return this._table.options.frozenColCount-1>t?i=this.pinedIcon:this._table.options.frozenColCount-1===t&&(i=this.pinedCurrentIcon),i}getPinRect(t,e){const n=t.right-(this.pinIcon.hover?.width||0)-e,i=t.right-e,r=t.top+t.height/2-(this.pinIcon.hover?.width||0)/2;return{left:n,right:i,top:r,bottom:(this.pinIcon.hover?.width||e)+r}}getSortIcon(t,e,n,i){const r="asc"===t?this.downIcon:"desc"===t?this.upIcon:this.normalIcon,o=e.getHeaderDefine(n,i);return!o||!o.showSort&&!o.sort||o.columns&&o.columns.length>0?null:r}getDropDownStateIcons(t,e,n){const i=t.getHeaderDefine(e,n),r=t._getHeaderLayoutMap(e,n),{dropDownMenu:s}=r,l=[];if(Array.isArray(s)&&s.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!i?.columns?.length){const i=s||t.globalDropDownMenu;let r=-1,u=-1;for(let o=0;o<i.length;o++){const a=i[o];if("object"==typeof a&&a.children&&a.children.length)for(let i=0;i<a.children.length;i++){const s=a.children[i];if(t.stateManeger.menu?.dropDownMenuHighlight&&sM(t,t.stateManeger.menu?.dropDownMenuHighlight,"object"==typeof s?s?.menuKey:s,e,n)){r=o,u=i;break}}if(t._dropDownMenuIsHighlight(e,n,o)){r=o;break}}if(-1!==r){let e;e=-1!==u?(s||t.globalDropDownMenu)[r].children[u]:(s||t.globalDropDownMenu)[r],e.stateIcon&&(e.stateIcon.svg?l.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:o.right,marginRight:0,funcType:a.dropDownState,interactive:!1}):e.stateIcon.src&&l.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:o.right,marginRight:0,funcType:a.dropDownState,interactive:!1}))}}return l}getDropDownIconRect(t,e,n){const i=this.downIcon.hover?.width??this.downIcon?.width??0,r=this.downIcon.hover?.height??this.downIcon?.height??0,o=t.right-2-i,a=t.right-2;let s;s="middle"===n?t.top+t.height/2-i/2:"top"===n?t.top+e/2:"bottom"===n?t.bottom-2*e:t.top;return{left:o,right:a,top:s,bottom:r+s,width:i,height:r}}checkDropDownIcon(t,e,n){if(t.isPivotTable()){const i=t._getHeaderLayoutMap(e,n);if(Array.isArray(i.dropDownMenu)&&i.dropDownMenu.length)return!0}else{const i=t.getHeaderDefine(e,n);if(Array.isArray(i.dropDownMenu)&&i.dropDownMenu.length||(!Array.isArray(i.dropDownMenu)||0!==i.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!i?.columns?.length)return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return N;case"image":case"video":return cM}}}class fM{_table;_tooltipElement;constructor(t){this._table=t}dispose(){this.unbindTooltipElement(),this._tooltipElement&&this._tooltipElement.dispose?.(),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,n,i){return this._getTooltipElement().bindToCell(this._table,t,e,n,i)}moveTooltipElement(t,e,n,i){this._getTooltipElement().move(this._table,t,e,n,i)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,n,i,r){this._getTooltipElement()._locate(this._table,t,e,n,i,r)}}U("@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\tpointer-events: none;\n\tuser-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n");const pM="vtable__bubble-tooltip-element",vM=`${pM}__content`,gM=`${pM}__triangle`,yM=`${pM}--hidden`,mM=`${pM}--shown`;class bM{_handler;_rootElement;_messageElement;_triangleElement;constructor(){this._handler=new Ct;const t=this._rootElement=KT("div",[pM,yM]),e=KT("span",[vM]),n=KT("span",[gM]);t.appendChild(n),t.appendChild(e),this._messageElement=t.querySelector(`.${vM}`)||void 0,this._triangleElement=t.querySelector(`.${gM}`)||void 0}bindToCell(t,e,n,i,r){const o=this._rootElement,a=this._messageElement,s=this._triangleElement;if(o?.classList.remove(mM),o?.classList.add(yM),this._canBindToCell(t,e,n)){a.setAttribute("style",""),s.setAttribute("style",""),i?.className&&o.classList.add(i.className),i?.style?.bgColor&&(a.style.backgroundColor=i?.style?.bgColor),i?.style?.bgColor&&(s.style.backgroundColor=i?.style?.bgColor),s.style.display=!0===i?.style?.arrowMark?"block":"none",i?.style?.font&&(a.style.font=i?.style?.font),i?.style?.color&&(a.style.color=i?.style?.color),i?.style?.padding&&(a.style.padding=`${i?.style?.padding.join("px ")}px`),a&&(a.textContent=i?.content);if(this._bindToCell(t,e,n,i?.position,i?.referencePosition,r,i?.style?.arrowMark))return o?.classList.add(mM),o?.classList.remove(yM),!0}else this.unbindFromCell();return!1}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler?.dispose?.(),delete this._rootElement,delete this._messageElement}move(t,e,n,i,r){const o=this._rootElement;this._canBindToCell(t,e,n)?(this._bindToCell(t,e,n,i?.position,i?.referencePosition,r),o?.classList.add(mM),o?.classList.remove(yM)):this.unbindFromCell()}unbindFromCell(){const t=this._rootElement;t?.parentElement&&(t.classList.remove(mM),t.classList.add(yM))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{bottom:o,left:a,right:s}=i,{frozenRowCount:l,frozenColCount:u}=t;if(n>=l&&l>0){if(o<t.getCellRangeRelativeRect({col:e,row:l-1}).bottom)return!1}else if(o<0)return!1;if(e>=u&&u>0){if(s<t.getCellRangeRelativeRect({col:u-1,row:n}).right)return!1}else if(a<0)return!1;const{offsetHeight:h,offsetWidth:c}=r;return!(h<o)&&!(c<a)}_bindToCell(t,e,n,i,r,o,a){const s=this._rootElement,l=t.getCellRangeRelativeRect({col:e,row:n}),u=t.getElement(),h=t.internalProps.element.offsetWidth,{width:c}=l;if(s){let l,d;s.parentElement!==u&&u.appendChild(s),s.style.left="0px";const f=Math.min(.8*h,4*c);s.style.maxWidth=`${f}px`;const p=s.clientWidth,v=s.clientHeight;if(!i&&!r)return!1;{const s=this.getComputedPosition(t,e,n,i,r,o,a);d=s.x,l=s.y}s.style.left=`${d}px`,s.style.top=`${l}px`,S()&&(s.style.fontSize="11px");const{x1:g,x2:y,y1:m,y2:b}=t.stateManeger.menu.bounds,w=d,x=w+p,C=l,_=w+v;return!(t.stateManeger.menu.isShow&&g<x&&y>w&&b>C&&m<_)}return!1}getComputedPosition(t,n,i,r,o,a,s){const l=this._rootElement,u=t.getCellRangeRelativeRect({col:n,row:i}),{width:h,height:c}=t.internalProps.element.getBoundingClientRect(),{width:d}=u;let f,p;const v=Math.min(.8*h,4*d);l.style.maxWidth=`${v}px`;const g=l.clientWidth,y=l.clientHeight,m=s?6:0;if(r)p=r.x,f=r.y+m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(o){let n=o.placement??e.bottom;const i=o.rect.left+o.rect.width/2+t.tableX,r=o.rect.top+o.rect.height/2+t.tableY,s=o.rect.top+t.tableY,l=o.rect.bottom+t.tableY,u=o.rect.left+t.tableX,d=o.rect.right+t.tableX;let v=0;const b=()=>{v++,v>=4||(this.removeStyleFromTriangle(),n===e.top?(p=i-g/2,f=s-y-m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",a&&f<0&&(n=e.right,b())):n===e.bottom?(p=i-g/2,f=l+m,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",a&&f+y>c&&(n=e.left,b())):n===e.left?(f=r-y/2,p=u-g-m,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",a&&p<0&&(n=e.top,b())):n===e.right&&(f=r-y/2,p=d+m,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",a&&p+g>h&&(n=e.bottom,b())))};b()}return a&&(p<0?p=0:p+l.offsetWidth>h&&(p=h-l.offsetWidth)),{x:p,y:f}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,n,i,r,o){const a=this.getComputedPosition(t,e,n,i,r,o),s=a.x,l=a.y;this._rootElement.style.left=`${s}px`,this._rootElement.style.top=`${l}px`}}class wM extends fM{createTooltipElementInternal(){return new bM}}const xM={"bubble-tooltip":function(t){return new wM(t)}};class CM{_table;_tooltipInstances;_attachInfo;confine;constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}dispose(){const t=this._tooltipInstances;for(const e in t)t[e]?.dispose?.();delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,n){const i=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!i||r&&i.instance===r||(i.instance?.unbindTooltipElement(),this._attachInfo=null),!r)return;if(r&&r.bindTooltipElement(t,e,n,this.confine)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:r,tooltipOptions:n}}}_move(t,e,n){const i=this._attachInfo;if(!i||!st(i.range,t,e))return;const{instance:r}=i;r?.moveTooltipElement(t,e,n,this.confine)}moveToPosition(t,e,n,i){const r=this._attachInfo;if(!r||!st(r.range,t,e))return;const{instance:o}=r;this._attachInfo.tooltipOptions.position=n,this._attachInfo.tooltipOptions.referencePosition=i,o?.locateTooltipElement(t,e,n,i,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e?.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const n=this._attachInfo;return!!n&&st(n.range,t,e)}_bindTableEvent(t){t.listen(gt.MOUSEENTER_CELL,(n=>{if(S())return;const{x1:i,x2:r,y1:o,y2:a}=t.stateManeger.menu.bounds;if(t.stateManeger.menu.isShow&&"number"==typeof n.x&&"number"==typeof n.y&&n.x>i&&n.x<r&&n.y>o&&n.y<a)return;const{col:s,row:l}=n;if((!n.related||!this._isBindCell(s,l))&&t.internalProps.tooltip?.isShowOverflowTextTooltip){const i=t.getCellOverflowText(s,l),r=t.getHeaderDescription(s,l),o=t.getCellRangeRelativeRect({col:s,row:l});let a;i&&(a={content:r?`${r}\n ${i}`:i,referencePosition:{placement:e.bottom,rect:o},style:{arrowMark:!1}}),r&&(a={content:r,referencePosition:{placement:e.bottom,rect:o},style:{arrowMark:!1}}),a&&this._bindToCell(n.col,n.row,a)}})),t.listen(gt.MOUSEMOVE_CELL,(e=>{if(!S()){if(this._attachInfo?.tooltipOptions?.referencePosition){const n=this._attachInfo.tooltipOptions.referencePosition,{event:i}=e,{left:r,right:o,top:a,bottom:s}=n.rect,l=t._getMouseAbstractPoint(i,!1);l&&l.x>=r-5&&l.x<=o+5&&l.y>=a-5&&l.y<=s+5||this._unbindFromCell()}this._attachInfo&&t.stateManeger.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.listen(gt.MOUSELEAVE_CELL,(t=>{t.related&&this._isBindCell(t.related.col,t.related.row)||this._unbindFromCell()})),t.listen(gt.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.listen(gt.SCROLL,(e=>{const n=this._attachInfo;if(n?.tooltipOptions&&n?.range?.start){const{col:e,row:i}=n.range.start,r=t.getCellRangeRelativeRect({col:e,row:i});n.tooltipOptions.referencePosition.rect=r,this._move(n.range.start.col,n.range.start.row,n.tooltipOptions)}}))}_getTooltipInstanceInfo(t,e){const n=this._table,i=this._tooltipInstances,r="bubble-tooltip";return i&&i[r]||i&&(i[r]=xM[r](n))}isBinded(t){return JSON.stringify(t)===JSON.stringify(this._attachInfo?.tooltipOptions)}}function _M(t,e,n,i,r,o){const a=function(t,e){const n=new Array(e);for(let i=0;i<e;i++)n[i]=t(i);return n}(t,n);a.sort(((t,e)=>i(o(t),o(e),r)));for(let t=0;t<n;t++)e(t,a[t])}const kM={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function SM(t,e){const n=ot(t);if(at(n)){const t=n.then((t=>(e(t),t)));return e(t),t}return n}function AM(t,e,n){if(null===t)return;if(at(t))return t.then((t=>AM(t,e,n)));const i=function(t){if(ct.isObject(t)){const e=t;if(_(e.get)&&_(e.set))return!0}return!1}(e)?e.get:e;if(i in t){return SM(t[i],n)}if("function"==typeof i){return SM(i(t),n)}if(Array.isArray(i)){const e=function(t,e){let n,i=t;for(;n=e.shift();)i=i[n];return i}(t,[...i]);return SM(e,n)}const r=`${i}`.split(".");if(r.length<=1){return SM(t[i],n)}const o=it(t,((t,e)=>AM(t,e,vt)),...r);return SM(o,n)}function BM(t,e){if(!t)return e;const n=t[e];return _(n)?n:e}class RM extends T{_get;_sourceLength;_source;sortedIndexMap;lastOrder;lastOrderFn;lastOrderField;currentIndexedData=[];pagerConf;_currentPagerIndexedData;enableHierarchyState=!1;static get EVENT_TYPE(){return kM}treeDataHierarchyState=new Map;constructor(t,e,i){if(super(),this._get=t?.get.bind(t)||void 0,this._sourceLength=t?.length||0,this._source=t?.source??t,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.pagerConf=e||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},i>=1&&(this.enableHierarchyState=!0),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.enableHierarchyState)for(let t=0;t<this._sourceLength;t++){this.getOriginalRecord(t).children&&this.treeDataHierarchyState.set(t,n.collapse)}if(i>1){let t=this._sourceLength;for(let e=0;e<t;e++){const r=this.currentIndexedData[e],o=this.getOriginalRecord(r);if(o.children?.length>0){this.treeDataHierarchyState.set(Array.isArray(r)?r.join(","):r,n.expand);const a=this.initChildrenNodeHierarchy(r,i,2,o);e+=a,t+=a}}}this.updatePagerData()}initChildrenNodeHierarchy(t,e,i,r){if(i>e)return 0;let o=0;const a=r.children?.length??0;for(let s=0;s<a;s++){o+=1;const a=r.children[s],l=Array.isArray(t)?t.concat(s):[t,s];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+o,0,l),a.children?.length>0&&(i<e?this.treeDataHierarchyState.set(Array.isArray(l)?l.join(","):l,n.expand):this.treeDataHierarchyState.set(Array.isArray(l)?l.join(","):l,n.collapse)),o+=this.initChildrenNodeHierarchy(l,e,i+1,a)}return o}updatePager(t){this.pagerConf=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:n}=this.pagerConf,i=e*(n||0),r=i+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let n=0;n<t.length;n++)if((Array.isArray(t[n])&&1===t[n].length||!Array.isArray(t[n]))&&e++,e>=i&&e<r)this._currentPagerIndexedData.push(t[n]);else if(e>=r)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get source(){return this._source}get(t){return this.getOriginalRecord(BM(this.currentPagerIndexedData,t))}getIndexKey(t){return BM(this.currentPagerIndexedData,t)}getField(t,e){return this.getOriginalField(BM(this.currentPagerIndexedData,t),e)}hasField(t,e){return this.hasOriginalField(BM(this.currentPagerIndexedData,t),e)}getHierarchyState(t){const e=this.getIndexKey(t);return this.treeDataHierarchyState.get(Array.isArray(e)?e.join(","):e)??null}toggleHierarchyState(t){const e=this.getIndexKey(t),i=this.getHierarchyState(t),r=this.getOriginalRecord(e);if(this.clearSortedIndexMap(),i===n.collapse)this.treeDataHierarchyState.set(Array.isArray(e)?e.join(","):e,n.expand),this.pushChildrenNode(e,n.expand,r);else if(i===n.expand){let t=0;const o=(e,i,r)=>{if(i&&i!==n.collapse&&i!==n.none&&r.children)for(let n=0;n<r.children.length;n++){t+=1;const i=Array.isArray(e)?e.concat([n]):[e,n];o(i,this.treeDataHierarchyState.get(i.join(",")),r.children[n])}};o(e,i,r),this.currentIndexedData.splice(this.currentIndexedData.indexOf(e)+1,t),this.treeDataHierarchyState.set(Array.isArray(e)?e.join(","):e,n.collapse)}this.updatePagerData()}pushChildrenNode(t,e,i){if(!e||e===n.collapse||e===n.none)return 0;let r=0;if(i.children){const e=Array.from({length:i.children.length},((t,e)=>e));this.lastOrder&&"normal"!==this.lastOrder&&this.lastOrderField&&_M((t=>_(e[t])?e[t]:e[t]=t),((t,n)=>{e[t]=n}),i.children.length,this.lastOrderFn,this.lastOrder,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],this.lastOrderField)));for(let o=0;o<e.length;o++){r+=1;const a=Array.isArray(t)?t.concat([e[o]]):[t,e[o]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,a);const s=this.treeDataHierarchyState.get(a.join(",")),l=this.getOriginalRecord(a);!s&&l.children&&this.treeDataHierarchyState.set(a.join(","),n.collapse),r+=this.pushChildrenNode(a,this.treeDataHierarchyState.get(a.join(",")),i.children[e[o]])}}return r}setRecord(t,e){const n=this.getIndexKey(e);if(Array.isArray(n)){const e=n[n.length-1];this.getOriginalRecord(n.slice(0,n.length-1)).children.splice(e,1,t)}else this.source.splice(n,1,t)}sort(t,e,n=("desc"!==e?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1)){this.lastOrderField=t,this.lastOrder=e,this.lastOrderFn=n;let i,r=this.sortedIndexMap.get(t);if(r&&(i=r[e],i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(kM.CHANGE_ORDER);const o=[];if("normal"===e)for(let t=0;t<this._sourceLength;t++)o[t]=t;else _M((t=>_(o[t])?o[t]:o[t]=t),((t,e)=>{o[t]=e}),this._sourceLength,n,e,(e=>this.getOriginalField(e,t)));if(this.currentIndexedData=o,this.enableHierarchyState){let t=o.length;window.performance.now();for(let e=0;e<t;e++){const n=this.pushChildrenNode(o[e],this.treeDataHierarchyState.get(o[e]),this.getOriginalRecord(o[e]));t+=n,e+=n}}r||(r={asc:[],desc:[],normal:[]},this.sortedIndexMap.set(t,r)),r[e]=o,this.updatePagerData(),this.fireListeners(kM.CHANGE_ORDER)}clearSortedIndexMap(){this.lastOrderField&&this.lastOrder&&this.sortedIndexMap.forEach(((t,e)=>{e!==this.lastOrderField?this.sortedIndexMap.delete(e):"asc"===this.lastOrder?(t.desc=[],t.normal=[]):"desc"===this.lastOrder?(t.asc=[],t.normal=[]):(t.desc=[],t.asc=[])}))}get sourceLenght(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(kM.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}dispose(){super.dispose?.()}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){return SM(this._get(t),(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e){if(null===e)return;return AM(this.getOriginalRecord(t),e,(n=>{this.fieldPromiseCallBack(t,e,n)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const n=this.getOriginalRecord(t);return Boolean(n&&e in n)}fieldPromiseCallBack(t,e,n){}recordPromiseCallBack(t,e){}static EMPTY=new RM({get(){},length:0})}class TM extends RM{_recordCache;_fieldCache;static get EVENT_TYPE(){return RM.EVENT_TYPE}static ofArray(t,e,n){return new TM({get:e=>Array.isArray(e)?function(t,e){let n=t;for(let t=0;t<e.length;t++){const i=e[t];if(!n[i])return;n=n[i],n&&n.children&&t+1<e.length&&(n=n.children)}return n}(t,e):t[e],length:t.length,source:t},e,n)}constructor(t,e,n){super(t,e,n),this._recordCache={},this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getOriginalField(t,e){const n=this._fieldCache&&this._fieldCache[t];if(n){const t=n.get(e);if(t)return t}return super.getOriginalField(t,e)}clearCache(){this._recordCache&&(this._recordCache={}),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,n){!function(t,e,n,i){(t[e]||(t[e]=new Map)).set(n,i)}(this._fieldCache,t,e,n)}recordPromiseCallBack(t,e){this._recordCache[t]=e}dispose(){super.dispose?.()}}var MM=Object.freeze({__proto__:null,CachedDataSource:TM,DataSource:RM});function PM(t,e){const{dataSourceEventIds:n}=t.internalProps;n&&n.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,RM.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.enableHierarchyState&&t.refreshRowColCount(),t.invalidate()}))]}function OM(t,e=[]){PM(t,(()=>{const n=e;t.internalProps.records=e;const i=t.internalProps.dataSource=TM.ofArray(n,t.pagerConf,t.options.hierarchyExpandLevel??(t.hasHierarchyTreeHeader?.()?1:void 0));t.addDisposable(i)}))}function EM(t,e){PM(t,(()=>{if(e)if(e instanceof RM)t.internalProps.dataSource=e;else{const n=t.internalProps.dataSource=new TM(e);t.addDisposable(n)}else t.internalProps.dataSource=RM.EMPTY;t.internalProps.records=null}))}function HM(t,e){return Math.round(RT(e,t.internalProps.calcWidthContext))}function LM(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}function IM(t){return Boolean(t&&"string"==typeof t&&"auto"===t.toLowerCase())}class DM{_table;_menuElement;constructor(t){this._table=t}dispose(){this.unbindMenuElement(),this._menuElement&&this._menuElement.dispose(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,n){return this._getMenuElement().bindToCell(this._table,t,e,n)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const jM="vtable__menu-element",WM=`${jM}--hidden`,FM=`${jM}--shown`;class zM{_handler;_rootElement;_menuInstanceInfo;constructor(t){this._handler=new Ct,this._rootElement=KT("div",[jM,WM]),this._rootElement?.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),this._rootElement?.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(WM))return;const{col:n,row:i,dropDownIndex:r,menuKey:o,text:a,hasChildren:s}=e.target;if("number"!=typeof r||s)return void e.stopPropagation();const l=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(n,i):t.getHeaderField(n,i),u=t._dropDownMenuIsHighlight(n,i,r);t.fireListeners(gt.DROPDOWNMENU_CLICK,{col:n,row:i,field:l,menuKey:o,text:a,highlight:u,cellType:t.getCellType(n,i)}),t.fireListeners(gt.DROPDOWN_MENU_CLEAR,null),t.fireListeners(gt.HIDE_MENU),e.stopPropagation()})),this._rootElement?.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(WM)||t.stopPropagation()}))}get rootElement(){return this._rootElement}dispose(){this.unbindFromCell();const t=this._rootElement;t?.parentElement&&t.parentElement.removeChild(t),this._handler.dispose(),delete this._rootElement}bindToCell(t,e,n,i){const r=this._rootElement;if(this._menuInstanceInfo=i,r?.classList.remove(FM),r?.classList.add(WM),this._canBindToCell(t,e,n)){r.innerHTML="",r.appendChild(i.content);if(this._bindCell(t,e,n,i.position,i.referencePosition))return r?.classList.add(FM),r?.classList.remove(WM),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,t?.parentElement&&(t.classList.remove(FM),t.classList.add(WM))}_canBindToCell(t,e,n){const i=t.getCellRangeRelativeRect({col:e,row:n}),r=t.getElement(),{top:o,bottom:a,left:s,right:l}=i,{frozenRowCount:u,frozenColCount:h}=t;if(n>=u&&u>0){if(a<t.getCellRangeRelativeRect({col:e,row:u-1}).bottom)return!1}else if(a<0)return!1;if(e>=h&&h>0){if(l<t.getCellRangeRelativeRect({col:h-1,row:n}).right)return!1}else if(l<0)return!1;const{offsetHeight:c,offsetWidth:d}=r;return!(c<o)&&!(d<s)}_bindCell(t,e,n,i,r){const o=this._rootElement,a=t.getElement(),{width:s,height:l}=t.internalProps.element.getBoundingClientRect();if(o){o.parentElement!==a&&a.appendChild(o),o.style.left="0px";const t=.8*s;o.style.maxWidth=`${t}px`;const e=o.clientWidth,n=o.clientHeight;let u,h;return i&&(u=i.x,h=i.y),r&&(u=r.rect.right-e,h=r.rect.bottom),h+n>l&&(h=l-n,u+=e-2),h<0&&(h/=2),o.style.top=`${h}px`,u<0?u=0:u+e>s&&(u=s-e),o.style.left=`${u}px`,!0}return!1}pointInMenuElement(t,e){const n=this._rootElement,{x:i,y:r,width:o,height:a}=n.getBoundingClientRect();return t>i-5&&t<i+o+5&&e>r-5&&e<r+a+5}}class NM extends DM{createMenuElementInternal(){return new lM(this._table)}}let GM=class extends DM{createMenuElementInternal(){return new zM(this._table)}};const UM={"dropdown-menu":function(t){return new NM(t)},"context-menu":function(t){return new NM(t)},container:t=>new GM(t)};class VM{_table;_menuInstances;_attachInfo;constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}dispose(){const t=this._menuInstances;for(const e in t)t[e].dispose();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,n,i){const r=this._attachInfo,o=this._getMenuInstanceInfo(t,e,n,i);if(!r||o&&r.instance===o.instance||(r.instance?.unbindMenuElement(),this._attachInfo=null),!o)return;const{instance:a,info:s}=o;if(a&&a.bindMenuElement(t,e,s)){const n=this._table.getCellRange(t,e);this._attachInfo={range:n,instance:a}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;e?.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const n=this._attachInfo;return!!n&&st(n.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const n=this._attachInfo,{instance:i}=n;return i.pointInMenuElement(t,e)}_bindTableEvent(t){t.listen(gt.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.listen(gt.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.listen(gt.CONTEXTMENU_CELL,(e=>{if("html"===t.internalProps.menu?.renderMode){const n=t._getMouseAbstractPoint(e.event,!1);let i=null;n&&"function"==typeof t.internalProps.menu?.contextMenuItems?i=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row):n&&Array.isArray(t.internalProps.menu?.contextMenuItems)&&(i=t.internalProps.menu?.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:i,position:{x:n.x,y:n.y}})}}))}_getMenuInstanceInfo(t,e,n,i){const r=this._table,o=this._menuInstances,a=function(t,e,n,i,r){const{lineHeight:o,textBaseline:a,textStick:s}=t._getCellStyle(e,n);let l=t.getCellRangeRelativeRect(t.getCellRange(e,n));s&&(l=t.getVisibleCellRangeRelativeRect({col:e,row:n}));let{left:u,right:h,bottom:c,top:d,width:f,height:p}=l;if(t.isHeader(e,n)&&({left:u,right:h,bottom:c,top:d,width:f,height:p}=t.internalProps.headerHelper.getDropDownIconRect(l,o,a||"middle")),r?.content)return{type:i,position:r.position,referencePosition:r.referencePosition??{rect:{left:u,right:h,top:d,bottom:c,width:f,height:p}},content:r.content};if("dropdown-menu"===i){const{dropDownMenu:r=t.globalDropDownMenu,pivotInfo:o}=t._getHeaderLayoutMap(e,n);return{type:i,referencePosition:{rect:{left:u,right:h,top:d,bottom:c,width:f,height:p}},content:r,pivotInfo:o}}return null}(r,t,e,n,i);if(!a)return null;return{instance:o&&o[n]||o&&(o[n]=UM[n](r)),type:n,info:a}}}class KM extends EventTarget{_table;_input;constructor(t,e){if(super(),this._table=t,"node"===bt.mode)return;const n=document.createElement("div");n.style.opacity="0",n.dataset.vtable="vtable",n.style.pointerEvents="none",n.classList.add("input-container");const i=this._input=document.createElement("input");n.appendChild(i),i.classList.add("table-focus-control"),i.dataset.vtable="vtable",i.readOnly=!0,e.appendChild(n)}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const n=this._input;n.value=e,n.select();const i=t.top-this._table.scrollTop,r=t.left-this._table.scrollLeft;n.style.top=`${i.toFixed()}px`,n.style.left=`${r.toFixed()}px`,n.style.width=`${t.width.toFixed()}px`,n.style.height=`${t.height.toFixed()}px`}get input(){return this._input}dispose(){}}const{toBoxArray:YM}=pt,{isTouchEvent:XM}=ft,$M=/^\$(\d+)\$(\d+)$/;class qM extends T{internalProps;showPin=!0;showSort=!0;padding;globalDropDownMenu;tableNoFrameWidth;tableNoFrameHeight;tableX;tableY;_widthMode;customRender;canvasWidth;canvasHeight;scenegraph;stateManeger;eventManeger;_pixelRatio;_cellToBeInvalidatedNextFrame;_willNextFrameInvalidate;static get EVENT_TYPE(){return gt}options;pagerConf;id=`VTable${Date.now()}`;headerStyleCache;bodyStyleCache;constructor(t={}){super();const{frozenColCount:e=0,defaultRowHeight:n=40,defaultHeaderRowHeight:i,defaultColWidth:r=80,defaultHeaderColWidth:o,widthMode:a="standard",keyboardOptions:s,parentElement:l,columnResizeMode:u,dragHeaderMode:h,showPin:c,allowFrozenColCount:d,padding:f,hover:p,menu:v,select:g,customRender:y,pixelRatio:m=1}=t;this.options=t,this._widthMode=a,this.customRender=y,this.padding={top:0,right:0,left:0,bottom:0},f&&("number"==typeof f?(this.padding.top=f,this.padding.left=f,this.padding.bottom=f,this.padding.right=f):(f.top&&(this.padding.top=f.top),f.bottom&&(this.padding.bottom=f.bottom),f.left&&(this.padding.left=f.left),f.right&&(this.padding.right=f.right))),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0;const b=this.internalProps={};void 0!==c&&(this.showPin=c),"number"==typeof d&&d<=0&&(this.showPin=!1),b.autoRowHeight=t.autoRowHeight??!1,b.handler=new Ct,b.element=function(t){const e=document.createElement("div");e.setAttribute("tabindex","0"),e.classList.add("vtable"),e.style.outline="none",e.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const n=(e.offsetWidth||e.parentElement?.offsetWidth||1)-1,i=(e.offsetHeight||e.parentElement?.offsetHeight||1)-1;return e.style.width=n&&n-t.left-t.right+"px"||"0px",e.style.height=i&&i-t.top-t.bottom+"px"||"0px",e}(this.padding),b.focusControl=new KM(this,b.element),b.pixelRatio=m,b.canvas=document.createElement("canvas"),b.element.appendChild(b.canvas),b.context=b.canvas.getContext("2d"),b.frozenColCount=e,b.defaultRowHeight=n,b.defaultHeaderRowHeight=i??n,b.defaultColWidth=r,b.defaultHeaderColWidth=o??r,b.keyboardOptions=s,b.columnResizeMode=u,b.dragHeaderMode=h,b._rowHeightsMap=new kt,b._rowRangeHeightsMap=new Map,b._colRangeWidthsMap=new Map,this.colWidthsMap=new kt,this.colContentWidthsMap=new kt,this.colWidthsLimit={},b.calcWidthContext={_:b,get full(){return this._.canvas.width/(this._.context.pixelRatio??window.devicePixelRatio)}},b.cellTextOverflows={},b.focusedTable=!1,b.theme=ai.of(t.theme??ai.DEFAULT),l?(l.innerHTML="",l.appendChild(b.element),this._updateSize()):this._updateSize(),this._cellToBeInvalidatedNextFrame=new Set,this._willNextFrameInvalidate=!1,this.options=t,b.theme=ai.of(t.theme??ai.DEFAULT),b.bodyHelper=new VT(this),b.headerHelper=new dM(this),b.autoWrapText=t.autoWrapText,b.allowFrozenColCount=t.allowFrozenColCount??b.colCount,b.limitMaxAutoWidth=t.limitMaxAutoWidth??450,this.scenegraph=new LT(this),this.stateManeger=new ER(this),this.eventManeger=new WT(this),b.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===b.tooltip.renderMode&&(b.tooltipHandler=new CM(this,b.tooltip.confine)),b.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(t.menu?.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(t.menu?.dropDownMenuHighlight),Array.isArray(t.menu?.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===b.menu.renderMode&&(b.menuHandler=new VM(this)),this.headerStyleCache=new Map,this.bodyStyleCache=new Map}throttleInvalidate=function(t,e){let n=null;return function(...i){n||(n=setTimeout((()=>{t.apply(this,i),n=null}),e))}}(this.invalidate.bind(this),200);getParentElement(){return this.options.parentElement}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){return this.internalProps.colCount??0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){return this.internalProps.frozenColCount??0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManeger.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManeger.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){return this.internalProps.frozenRowCount??0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){return this.internalProps.keyboardOptions??null}set keyboardOptions(t){this.internalProps.keyboardOptions=t??void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t)}_colWidthDefineToPxWidth(t){return IM(t)?HM(this,this._calculateAutoColWidthExpr()):HM(this,t)}_calculateAutoColWidthExpr(){const t=this.internalProps.calcWidthContext.full;let e=0;const n=[];let i=0;const r=[];for(let o=0;o<this.internalProps.colCount;o++){const a=this.getColWidthDefine(o),s=this._getColWidthLimits(o);if(IM(a))s&&(r.push(s),s.min&&(e+=s.min)),i++;else{let t=a;if(s){const n=HM(this,t),i=LM(s,n);n!==i&&(t=`${i}px`),e+=i}n.push(t)}if(e>t)return"0px"}if(r.length&&n.length){const e=(t-HM(this,`calc(${n.map((t=>"number"==typeof t?`${t}px`:t)).join(" + ")})`))/i;if(r.forEach((t=>{t.min&&e<t.min?(n.push(t.minDef),i--):t.max&&t.max<e&&(n.push(t.maxDef),i--)})),i<=0)return`${e}px`}if(n.length){const t=[];let e=0;return n.forEach((n=>{"number"==typeof n?e+=n:t.push(n)})),t.push(`${e}px`),`calc((100% - (${t.join(" + ")})) / ${i})`}return 100/i+"%"}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const n={};return e.min&&(n.min=HM(this,e.min),n.minDef=e.min),e.max&&(n.max=HM(this,e.max),n.maxDef=e.max),n}_adjustColWidth(t,e){const n=this._getColWidthLimits(t);return Math.max(LM(n,e),0)}setPixelRatio(t){}_updateSize(){const{padding:t}=this;let e=0,n=0;if("browser"===bt.mode){const i=this.getElement(),r=i.parentElement?.offsetWidth??0,o=i.parentElement?.offsetHeight??0;i.style.width=r&&r-t.left-t.right+"px"||"0px",i.style.height=o&&o-t.top-t.bottom+"px"||"0px";const{canvas:a}=this.internalProps;a.style.width="",a.style.height="",e=a.parentElement?.offsetWidth??0,n=a.parentElement?.offsetHeight??0,a.width=e,a.height=n,a.style.width=`${e}px`,a.style.height=`${n}px`}else"node"===bt.mode&&(e=this.canvasWidth-1,n=this.canvasHeight-1);const i=Math.floor(e-V(this.getTheme().scrollStyle)),r=Math.floor(n-V(this.getTheme().scrollStyle));if(this.internalProps.theme?.frameStyle){const t=YM(this.internalProps.theme.frameStyle?.borderLineWidth??[null]),e=YM(this.internalProps.theme.frameStyle?.shadowBlur??[0]);this.tableX=(t[3]??0)+(e[3]??0),this.tableY=(t[0]??0)+(e[0]??0),this.tableNoFrameWidth=i-((t[1]??0)+(e[1]??0))-((t[3]??0)+(e[3]??0)),this.tableNoFrameHeight=r-((t[0]??0)+(e[0]??0))-((t[2]??0)+(e[2]??0))}}get rowHierarchyType(){return"grid"}setColWidths(t){t.forEach(((t,e)=>this.setColWidth(e,t)))}getColsWidth(t,e){e=Math.min(e,this.colCount-1);const n=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=n)return n;const i=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=i){const n=this.colWidthsMap.get(e);let r;r=n?"adaptive"===this.widthMode||this.transpose?Number(n):this._adjustColWidth(e,this._colWidthDefineToPxWidth(n)):0;const o=i+r;return t>=0&&e>=0&&!Number.isNaN(o)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(o)),Math.round(o)}let r=0;for(let n=t;n<=e;n++)r+=this.isRowHeader(n,0)||this.isCornerHeader(n,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[n]??this.internalProps.defaultColWidth:this.defaultHeaderColWidth:this.internalProps.defaultColWidth;this.colWidthsMap.each(t,e,((t,e)=>{r+=("adaptive"===this.widthMode||this.transpose?Number(t):this._adjustColWidth(e,this._colWidthDefineToPxWidth(t)))-(this.isRowHeader(e,0)||this.isCornerHeader(e,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[e]??this.internalProps.defaultColWidth:this.defaultHeaderColWidth:this.internalProps.defaultColWidth)}));for(let n=t;n<=e;n++){if(this.colWidthsMap.has(n))continue;const t=this._adjustColWidth(n,this.internalProps.defaultColWidth);t!==this.internalProps.defaultColWidth&&(r+=t-this.internalProps.defaultColWidth)}return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){return this.rowHeightsMap.get(t)||(this.isColumnHeader(0,t)||this.isCornerHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[t]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight)}setRowHeight(t,e,n){this.rowHeightsMap.put(t,Math.round(e)),n&&this._clearRowRangeHeightsMap(t)}fillRowsHeight(t,e,n){for(let i=t;i<=e;i++)this.rowHeightsMap.put(i,Math.round(n)),this._rowRangeHeightsMap.set(`$0$${i}`,Math.round((this._rowRangeHeightsMap.get("$0$"+(i-1))??0)+n))}getRowsHeight(t,e){const n=this._rowRangeHeightsMap.get(`$${t}$${e}`);if(null!=n)return n;const i=this._rowRangeHeightsMap.get(`$${t}$${e-1}`);if(null!=i){const n=Math.round(i+(this.rowHeightsMap.get(e)??(this.isColumnHeader(0,e)||this.isCornerHeader(0,e)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[e]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight)));return t>=0&&e>=0&&this._rowRangeHeightsMap.set(`$${t}$${e}`,Math.round(n)),n}let r=0;for(let n=t;n<=e;n++)r+=this.rowHeightsMap.get(n)||(this.isColumnHeader(0,n)||this.isCornerHeader(0,n)?Array.isArray(this.defaultHeaderRowHeight)?this.defaultHeaderRowHeight[n]??this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight);return t>=0&&e>=0&&r>0&&this._rowRangeHeightsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getColWidthDefine(t){const e=this.colWidthsMap.get(t);return"number"==typeof e&&e<=0?0:e||(this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?this.defaultHeaderColWidth[t]??this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth)}getColWidth(t){const e=this.getColWidthDefine(t);return"adaptive"===this.widthMode&&"number"==typeof e||this.transpose&&"number"==typeof e?this._colWidthDefineToPxWidth(e):this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}setColWidth(t,e,n,i){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),n&&this._clearColRangeWidthsMap(t),i||this.stateManeger.checkFrozen()}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const n of e){const e=$M.exec(n);if(e){const i=Number(e[1]),r=Number(e[2]);t>=i&&t<=r&&this._colRangeWidthsMap.delete(n)}}}}_clearRowRangeHeightsMap(t){const e=this._rowRangeHeightsMap.keys();for(const n of e){const e=$M.exec(n);if(e){const i=Number(e[1]),r=Number(e[2]);t>=i&&t<=r&&this._rowRangeHeightsMap.delete(n)}}}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){if(this.internalProps.rowCount<=0)return 0;return this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){if(this.internalProps.colCount<=0)return 0;return this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){const e=this.colWidthsLimit[t];let n=(e&&e.max)??1/0;return"string"==typeof n&&(n=HM(this,n)),n}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){const e=this.colWidthsLimit[t];let n=(e&&e.min)??0;return"string"==typeof n&&(n=HM(this,n)),n}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){const n=this.isFrozenCell(t,e);let i=this.getColsWidth(0,t-1)||0;const r=this.getColWidth(t);n&&n.col&&(i+=this.scrollLeft);let o=this.getRowsHeight(0,e-1);const a=this.getRowHeight(e);return n&&n.row&&(o+=this.scrollTop),new Dn(Math.round(i),Math.round(o),Math.round(r),Math.round(a))}getMergeCellRect(t,e){const n=this.getCellRange(t,e),i=this.getColsWidth(0,n.start.col-1)||0,r=this.getColsWidth(n.start.col,n.end.col),o=this.getRowsHeight(0,n.start.row-1)||0,a=this.getRowsHeight(n.start.row,n.end.row);return new Dn(Math.round(i),Math.round(o),Math.round(r),Math.round(a))}getCellRelativeRect(t,e){return this._toRelativeRect(this.getCellRect(t,e))}getCellRangeRelativeRect(t){if(t.start)return this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row));const e=this.getCellRange(t.col,t.row);return this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row))}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const n=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,i=Math.min(t.right,this.tableNoFrameWidth),r=t.copy();r.left=n,r.right=i;const o=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,a=Math.min(t.bottom,this.tableNoFrameHeight);return r.top=o,r.bottom=a,r}getCellsRect(t,e,n,i){const r=this.isFrozenCell(t,e),o=this.isFrozenCell(n,i);let a=this.getColsWidth(0,t-1)||0,s=this.getColsWidth(t,n);if(r&&r.col){const e=this.scrollLeft;a+=e,o&&o.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}let l=this.getRowsHeight(0,e-1),u=this.getRowsHeight(e,i);if(r&&r.row){const t=this.scrollTop;l+=t,o&&o.row||(u-=t,u=Math.max(u,this.getRowsHeight(e,this.frozenRowCount-1)))}return new Dn(Math.round(a),Math.round(l),Math.round(s),Math.round(u))}getCellsRectWidth(t,e,n,i){const r=this.isFrozenCell(t,e),o=this.isFrozenCell(n,i);let a=this.getColsWidth(t,n);if(r&&r.col){const e=this.scrollLeft;o&&o.col||(a-=e,a=Math.max(a,this.getColsWidth(t,this.frozenColCount-1)))}return a}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const{frozenRowCount:n,frozenColCount:i}=this.internalProps,r=n>0&&e<n,o=i>0&&t<i;return r||o?{row:r,col:o}:null}getRowAt(t){const e=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:n}=t;const i=t.internalProps.frozenRowCount;for(let r=0;r<i;r++){const i=t.getRowHeight(r),o=n+i;if(o>e)return{top:n,row:r,bottom:o,height:i};n=o}return null}(this,t);if(e)return e;let n=this.getTargetRowAt(t);return n||(n={top:-1,row:-1,bottom:-1,height:-1}),n}getColAt(t){const e=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:n}=t;const i=t.internalProps.frozenColCount;for(let r=0;r<i;r++){const i=t.getColWidth(r),o=n+i;if(o>e)return{left:n,col:r,right:o,width:i};n=o}return null}(this,t);if(e)return e;let n=this.getTargetColAt(t);return n||(n={left:-1,col:-1,right:-1,width:1}),n}getCellAt(t,e){const n=this.getRowAt(e),{row:i,top:r,bottom:o,height:a}=n,s=this.getColAt(t),{col:l,left:u,right:h,width:c}=s;return{row:i,col:l,rect:{left:u,right:h,top:r,bottom:o,width:c,height:a}}}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const n=this.isFrozenCell(t,e);if(n&&n.col&&n.row)return;const i=this.getCellRect(t,e),r=function(t){let e=0;t.internalProps.frozenColCount>0&&(e=t.getFrozenColsWidth());let n=0;return t.internalProps.frozenRowCount>0&&(n=t.getFrozenRowsHeight()),new Dn(t.scrollLeft+e,t.scrollTop+n,t.tableNoFrameWidth-e,t.tableNoFrameHeight-n)}(this);if(r.contains(i))return;n&&n.col||this.getColsWidth(0,this.frozenColCount-1)+i.width>this.canvas.width||(i.left<r.left?this.scrollLeft-=r.left-i.left:r.right<i.right&&(this.scrollLeft-=r.right-i.right)),n&&n.row||this.getRowsHeight(0,this.frozenRowCount-1)+i.height>this.canvas.height||(i.top<r.top?this.scrollTop-=r.top-i.top:r.bottom<i.bottom&&(this.scrollTop-=r.bottom-i.bottom))}}invalidate(){this.scenegraph.renderSceneGraph()}_toRelativeRect(t){const e=t.copy(),n=this.getVisibleRect();return e.offsetLeft(-n.left),e.offsetTop(-n.top),e}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,n=this.tableNoFrameWidth,i=this.tableNoFrameHeight;return new Dn(e,t,n,i)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),n=t>0?e.top+this.getRowsHeight(0,t-1):e.top,i=this.getTargetRowAt(n);if(!i)return 0;const r=Math.max(i.top>=n?i.row:i.row+1,t);let o=this.getRowsHeight(0,r-1),a=0;const{rowCount:s}=this;for(let t=r;t<s;t++){const n=o+this.getRowHeight(t);if(e.bottom<n)break;a++,o=n}return a}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),n=t>0?e.left+this.getColsWidth(0,t-1):e.left,i=this.getTargetColAt(n);if(!i)return 0;const r=Math.max(i.left>=n?i.col:i.col+1,t);let o=this.getColsWidth(0,r-1),a=0;const{colCount:s}=this;for(let t=r;t<s;t++){const n=o+this.getColWidth(t);if(e.right<n)break;a++,o=n}return a}get scrollTop(){return this.stateManeger.scroll.verticalBarPos}set scrollTop(t){this.stateManeger.setScrollTop(t)}get scrollLeft(){return this.stateManeger.scroll.horizontalBarPos}set scrollLeft(t){this.stateManeger.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=t}setScrollTop(t){this.scrollTop=t}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addDisposable(t){if(!t||!t.dispose||"function"!=typeof t.dispose)throw new Error("not disposable!");(this.internalProps.disposables=this.internalProps.disposables||[]).push(t)}dispose(){const t=this.internalProps;t.tooltipHandler?.dispose?.(),t.menuHandler?.dispose?.(),j_.clearAll(),super.dispose?.(),t.handler?.dispose?.(),t.focusControl?.dispose?.(),t.disposables&&(t.disposables.forEach((t=>t?.dispose?.())),t.disposables=null),this.scenegraph.stage.release();const{parentElement:e}=t.element;e&&e.removeChild(t.element)}fireListeners(t,...e){return super.fireListeners(t,...e)}updateOption(t){this.options=t;const{frozenColCount:e=0,defaultRowHeight:n=40,defaultHeaderRowHeight:i,defaultColWidth:r=80,defaultHeaderColWidth:o=80,keyboardOptions:a,columnResizeMode:s,dragHeaderMode:l,showPin:u,allowFrozenColCount:h,padding:c,hover:d,menu:f,select:p,pixelRatio:v,widthMode:g}=t;v&&v!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=v),c&&("number"==typeof c?(this.padding.top=c,this.padding.left=c,this.padding.bottom=c,this.padding.right=c):(c.top&&(this.padding.top=c.top),c.bottom&&(this.padding.bottom=c.bottom),c.left&&(this.padding.left=c.left),c.right&&(this.padding.right=c.right))),this.showPin="boolean"!=typeof u||u,"number"==typeof h&&h<=0&&(this.showPin=!1),this.widthMode=g??"standard";const y=this.internalProps;"node"!==bt.mode&&function(t,e){t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||t.parentElement?.offsetWidth||1)-1,i=(t.offsetHeight||t.parentElement?.offsetHeight||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=i&&i-e.top-e.bottom+"px"||"0px"}(y.element,this.padding),y.frozenColCount=e,y.defaultRowHeight=n,y.defaultHeaderRowHeight=i??n,y.defaultColWidth=r,y.defaultHeaderColWidth=o??r,y.keyboardOptions=a,y.columnResizeMode=s,y.dragHeaderMode=l,y.cellTextOverflows={},y.theme=ai.of(t.theme??ai.DEFAULT),y.autoRowHeight=t.autoRowHeight??!1,y.autoWrapText=t.autoWrapText,y.allowFrozenColCount=t.allowFrozenColCount??y.colCount,y.limitMaxAutoWidth=t.limitMaxAutoWidth??450,y.tooltip=Object.assign({renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"!==y.tooltip.renderMode||y.tooltipHandler||(y.tooltipHandler=new CM(this,y.tooltip.confine)),y.menu=Object.assign({renderMode:"html"},t.menu),"html"!==y.menu.renderMode||y.menuHandler||(y.menuHandler=new VM(this))}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new Dn(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t,e=!0){const n=this;let i;if(!t)return null;i=XM(t)?t.changedTouches[0]:t;const r=i.clientX||i.pageX+window.scrollX,o=i.clientY||i.pageY+window.scrollY,a=n.internalProps.canvas.getBoundingClientRect();if(a.right<=r)return null;if(a.bottom<=o)return null;const s=a.width,l=s/(this.canvas.offsetWidth||s),u=a.height,h=u/(this.canvas.offsetHeight||u);return{x:(r-a.left)/l+(e?n.scrollLeft:0)-n.tableX,y:(o-a.top)/h+(e?n.scrollTop:0)-n.tableY}}_getCellEventArgsSet(t){const e=this._getMouseAbstractPoint(t);if(!e)return{};const n=this.getCellAt(e.x,e.y);if(n.col<0||n.row<0)return{abstractPos:e,cell:n};return{abstractPos:e,cell:n,eventArgs:{col:n.col,row:n.row,event:t,rect:n.rect}}}getTheme(){return this.internalProps.theme}getTargetColAt(t){if(0===t)return{left:0,col:0,right:0,width:0};const e=(e,n)=>{let i=n-this.getColWidth(e);const{colCount:r}=this.internalProps;for(let n=e;n<r;n++){const e=this.getColWidth(n),r=i+e;if(Math.round(i)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:i,col:n,right:r,width:e};i=r}return null},n=this.computeTargetColByX(t),i=this.getColsWidth(0,n);return t>=i?e(n,i):((e,n)=>{let i=n;for(let n=e;n>=0;n--){const e=this.getColWidth(n),r=i-e;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(i))return{left:r,col:n,right:i,width:e};i=r}return null})(n,i)}getTargetRowAt(t){if(0===t)return{top:0,row:0,bottom:0,height:0};const e=(e,n)=>{let i=n-this.getRowHeight(e);const{rowCount:r}=this.internalProps;for(let n=e;n<r;n++){const e=this.getRowHeight(n),r=i+e;if(Math.round(i)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:i,row:n,bottom:r,height:e};i=r}return null},n=this.computeTargetRowByY(t),i=this.getRowsHeight(0,n);return t>=i?e(n,i):((e,n)=>{let i=n;for(let n=e;n>=0;n--){const e=this.getRowHeight(n),r=i-e;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(i))return{top:r,row:n,bottom:i,height:e};i=r}return null})(n,i)}computeTargetRowByY(t){if(this._rowRangeHeightsMap.get("$0$"+(this.rowCount-1))){let e=0,n=this.rowCount-1;for(;n-e>1;){const i=Math.floor((e+n)/2);if(t<this._rowRangeHeightsMap.get(`$0$${i}`))n=i;else{if(!(t>this._rowRangeHeightsMap.get(`$0$${i}`)))return i;e=i}}return n}return Math.min(Math.ceil(t/this.internalProps.defaultRowHeight),this.rowCount-1)}computeTargetColByX(t){if(this._colRangeWidthsMap.get("$0$"+(this.colCount-1))){let e=0,n=this.colCount-1;for(;n-e>1;){const i=Math.floor((e+n)/2);if(t<this._colRangeWidthsMap.get(`$0$${i}`))n=i;else{if(!(t>this._colRangeWidthsMap.get(`$0$${i}`)))return i;e=i}}return n}return Math.min(Math.ceil(t/this.internalProps.defaultColWidth),this.colCount-1)}clearSelected(){}selectCell(t,e){}updatePager(t){this.pagerConf&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagerConf.currentPage=t.currentPage),t.perPageCount&&(this.pagerConf.perPageCount=t.perPageCount||this.pagerConf.perPageCount),this.scenegraph.clearCells(),this.dataSource.updatePager(this.pagerConf),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.invalidate())}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records||null}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),EM(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.invalidate()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.internalProps.layoutMap&&(this.refreshHeader(),this.invalidate()))}get theme(){return this.internalProps.theme}set theme(t){const e=ai.of(t);this.internalProps.theme=e||ai.DEFAULT,this.options.theme=t,this._updateSize(),this._resetFrozenColCount(),this.invalidate()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const n=this.internalProps.layoutMap.getBody(t,e);return n?.define}getBodyColumnType(t,e){return this.internalProps.layoutMap.getBody(t,e).columnType}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderFieldKey(t,e){return this.internalProps.layoutMap.getHeaderFieldKey(t,e)}getHeaderDefine(t,e){const n=this.internalProps.layoutMap.getHeader(t,e);return n?.define}getCellType(t,e){return this.internalProps.layoutMap.getCellType(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const n=[];for(;;){const i=this.getHeaderDefine(t,e);if(!i||!i.field&&!i.columns)break;n.push(i),e++}return n}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByRowCol(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.internalProps.dataSource?.get(this.getRecordIndexByRow(t,e))}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps;let n;if(n=t.fieldKey?e.headerObjects.find((e=>e&&e.fieldKey===t.fieldKey)):e.headerObjects.find((e=>e&&e.field===t.field)),n){return e.getHeaderCellAdress(n.id)}}getCellRange(t,e){return this.internalProps.layoutMap.getCellRange(t,e)}isCellRangeEqual(t,e,n,i){return this.internalProps.layoutMap.isCellRangeEqual(t,e,n,i)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){const n=this._getHeaderLayoutMap(t,e),i=n?.define,r=i?.description??n?.description;if("function"==typeof r){return r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)})}return r}setRecords(t,e){const n="undefined"!=typeof window?window.performance.now():0;if(this.scenegraph.clearCells(),void 0!==e&&(this.sortState=e,this.stateManeger.setSortState(this.sortState)),t){if(OM(this,t),this.sortState){let t,e,n;if(Array.isArray(this.sortState)?0!==this.sortState.length&&({order:t,field:e,fieldKey:n}=this.sortState?.[0]):({order:t,field:e,fieldKey:n}=this.sortState),t&&e&&"normal"!==t){const i=this.getSortFuncFromHeaderOption(void 0,e,n);let r;r=n?this.internalProps.layoutMap.headerObjects.find((t=>t&&t.fieldKey===n)):this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===e)),r?.define?.sort&&this.dataSource.sort(r.field,t,i??A)}}this.refreshRowColCount()}else OM(this,t);this.scenegraph.createSceneGraph(),this.invalidate(),console.log("setRecords cost time:",("undefined"!=typeof window?window.performance.now():0)-n)}setDropDownMenuHighlight(t){this.stateManeger.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,n){return this.stateManeger.dropDownMenuIsHighlight(t,e,n)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){return this.internalProps.layoutMap?.isColumnHeader(t,e)}isRowHeader(t,e){return this.internalProps.layoutMap?.isRowHeader(t,e)}isCornerHeader(t,e){return this.internalProps.layoutMap?.isCornerHeader(t,e)}getCellInfo(t,e){const n=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),caption:n.caption,columnType:n.columnType?"string"==typeof n.columnType?n.columnType:"progressbar":"text",originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellType:this.getCellType(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}_hasField(t,e,n){if(null==t)return!1;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return!1;const r=i.getRecordIndexByRow(e,n);return i.internalProps.dataSource.hasField(r,t)}_getCellStyle(t,e){const{layoutMap:n}=this.internalProps;if(n.isHeader(t,e)){let i=this.headerStyleCache.get(`${t}-${e}`);if(i)return i;const r=n.getHeader(t,e),o=this.internalProps.headerHelper.getStyleClass(r.headerType),{style:a}=r;return i=G(a,n.isColumnHeader(t,e)?this.theme.headerStyle:n.isRowHeader(t,e)?this.theme.rowHeaderStyle:this.theme.cornerHeaderStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText),this.headerStyleCache.set(`${t}-${e}`,i),i}let i;i=this.isListTable()&&!this.transpose||this.isPivotTable()&&this.internalProps.layoutMap.indicatorsAsCol?t:e;let r=this.bodyStyleCache.get(i);if(r)return r;const o=n.getBody(t,e),a=this.internalProps.bodyHelper.getStyleClass(o.columnType),s=o?.style;return r=D(s,this.theme.bodyStyle,{col:t,row:e,table:this,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},a,this.options.autoWrapText),this.bodyStyleCache.set(i,r),r}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const n=this.colWidthsLimit[t];return!(n&&n.min&&n.max)||n.max!==n.min}_canDragHeaderPosition(t,e){if(this.isHeader(t,e)&&this.stateManeger.isSelected(t,e)){const n=this.stateManeger.select.ranges[0];if(this.isColumnHeader(t,e)){if(n.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(n.end.col!==this.colCount-1)return!1}const i=this.getHeaderDefine(t,e);if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){let n;if(this.isHeader(t,e))n=this.internalProps.headerHelper.getIcons(t,e);else{const i=this.getCellValue(t,e),r=this.getCellOriginValue(t,e),o=this.internalProps.context;n=this.internalProps.bodyHelper.getIcons(t,e,i,r,o)}return n}showDropDownMenu(t,e,n){let i="dropdown-menu";n&&(i=Array.isArray(n.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManeger.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,i,n))}showTooltip(t,e,n){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,n)}getCellStyle(t,e){const n=this._getCellStyle(t,e),i=Mk(n,this,t,e,i_).theme,{autoWrapText:r,lineClamp:o,textOverflow:a}=n;return{textAlign:i.text.textAlign,textBaseline:i.text.textBaseline,bgColor:i.group.fillColor,color:i.text.fillColor,fontFamily:i.text.fontFamily,fontSize:i.text.fontSize,fontWeight:i.text.fontWeight,fontVariant:i.text.fontVariant,fontStyle:i.text.fontStyle,lineHeight:i.text.lineHeight,autoWrapText:r??!1,lineClamp:o??"auto",textOverflow:a,borderColor:i.group.strokeColor,borderLineWidth:i.group.lineWidth,borderLineDash:i.group.lineDash,underline:i.text.underline,underlineDash:i.text.underlineDash,lineThrough:i.text.lineThrough,lineThroughDash:i.text.lineThroughDash}}getAllBodyCells(t,e){const n=this.rowHeaderLevelCount,i=this.columnHeaderLevelCount,r=this.colCount-1,o=this.rowCount-1;return Array(Math.min(e??2e3,o-i+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+n,o+i)))))}getAllCells(t,e){const n=0,i=0,r=this.colCount-1,o=this.rowCount-1;return Array(Math.min(e??2e3,o-i+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(t??2e3,r-n+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+n,o+i)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=0,n=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-e+1).fill(0).map(((i,r)=>Array(n-t+1).fill(0).map(((n,i)=>this.getCellInfo(i+t,r+e)))))}getAllRowHeaderCells(){const t=0,e=this.columnHeaderLevelCount,n=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-e+1).fill(0).map(((i,r)=>Array(n-t+1).fill(0).map(((n,i)=>this.getCellInfo(i+t,r+e)))))}scrollToCell(t){const e=this.getDrawRange();if(_(t.col)&&t.col>=this.frozenColCount){const n=this.getFrozenColsWidth(),i=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(i-n,this.getAllColsWidth()-e.width)}if(_(t.row)&&t.row>=this.frozenRowCount){const n=this.getFrozenRowsHeight(),i=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(i-n,this.getAllRowsHeight()-e.height)}this.invalidate()}getCopyValue(){const t=this.stateManeger.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),n=Math.max(t[0].start.col,t[0].end.col),i=Math.min(t[0].start.row,t[0].end.row),r=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),n=Math.max(n,t.start.col,t.end.col),i=Math.min(i,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const o=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);i<=e&&r>=e&&(n=!0)})),n},a=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);i<=e&&r>=e&&(n=!0)})),n},s=(e,n)=>{let i;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),o=Math.max(t.start.row,t.end.row),a=Math.min(t.start.col,t.end.col),s=Math.max(t.start.col,t.end.col);a<=e&&s>=e&&r<=n&&o>=n&&(i=t)})),i},l=(t,e,n)=>{const i=this.getCellRange(t,e);let r=i.start.col,o=i.start.row;if(n){const t=Math.min(n.start.col,n.end.col),e=Math.min(n.start.row,n.end.row);r=Math.max(t,i.start.col),o=Math.max(e,i.start.row)}if(r!==t||o!==e)return"";return this.getCellValue(t,e)};let u="";for(let t=i;t<=r;t++){if(o(t)){for(let i=e;i<=n;i++){if(a(i)){const e=s(i,t);if(e){const r=l(i,t,e);if("undefined"!=typeof Promise&&r instanceof Promise);else{const t=`${r}`;/^\[object .*\]$/.exec(t)||(u+=t)}(i<e.end.col||i<n)&&(u+="\t")}else u+="\t"}}u+="\n"}}return u}getSelectedCellInfos(){const t=this.stateManeger.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),n=Math.max(t[0].start.col,t[0].end.col),i=Math.min(t[0].start.row,t[0].end.row),r=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),n=Math.max(n,t.start.col,t.end.col),i=Math.min(i,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const o=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row);i<=e&&r>=e&&(n=!0)})),n},a=e=>{let n=!1;return t.forEach((t=>{const i=Math.min(t.start.col,t.end.col),r=Math.max(t.start.col,t.end.col);i<=e&&r>=e&&(n=!0)})),n},s=(e,n)=>{let i;return t.forEach((t=>{const r=Math.min(t.start.row,t.end.row),o=Math.max(t.start.row,t.end.row),a=Math.min(t.start.col,t.end.col),s=Math.max(t.start.col,t.end.col);a<=e&&s>=e&&r<=n&&o>=n&&(i=t)})),i},l=[];for(let t=i;t<=r;t++){if(o(t)){const i=[];for(let r=e;r<=n;r++){if(a(r)){if(s(r,t)){const e=this.getCellInfo(r,t);i.push(e)}}}l.push(i)}}return l}measureText(t,e){return w_.measureText(t,e)}measureTextBounds(t){const e=new C_(t);return{width:e.AABBBounds.width(),height:e.AABBBounds.height()}}getCustomRender(t,e){let n;if("body"!==this.getCellType(t,e)){const i=this.getHeaderDefine(t,e);n=i?.headerCustomRender}else{const i=this.getBodyColumnDefine(t,e);n=i?.customRender||this.customRender}return n}getCustomLayout(t,e){let n;if("body"!==this.getCellType(t,e)){const i=this.getHeaderDefine(t,e);n=i?.headerCustomLayout}else{const i=this.getBodyColumnDefine(t,e);n=i?.customLayout}return n}}var ZM=Object.freeze({__proto__:null,BaseTable:qM,EVENT_TYPE:gt});function JM(t,e,n){const i=t[e];return t[e]=n,i}function QM(t){for(const e in t)delete t[e]}function tP(){QM(Gn),QM(D_),QM(H_)}var eP=Object.freeze({__proto__:null,chartType:function(t,e){return null!=e?JM(H_,t,e):H_[t]},clearAll:tP,icon:function(t,e){return null!=e?JM(D_,t,e):D_[t]},theme:function(t,e){return null!=e?JM(Gn,t,e):Gn[t]}});var nP=Object.freeze({__proto__:null,dateFormat:function(t,e,n,i,r){null==n&&(n=!1),null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==r&&(r=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);const o=n?"UTC":"",a=function(t){return`0${t}`.substring(0,2)};return function(n){const s=new Date(Date.parse(n[t]));return e.replace(/%(.)/g,(function(t,e){switch(e){case"y":return s[`get${o}FullYear`]();case"m":return a(s[`get${o}Month`]()+1);case"n":return i[s[`get${o}Month`]()];case"d":return a(s[`get${o}Date`]());case"w":return r[s[`get${o}Day`]()];case"x":return s[`get${o}Day`]();case"H":return a(s[`get${o}Hours`]());case"M":return a(s[`get${o}Minutes`]());case"S":return a(s[`get${o}Seconds`]());default:return`%${e}`}}))}},numberFormat:function(t){return t=Object.assign({},{digitsAfterDecimal:2,scaler:1,thousandsSep:",",decimalSep:".",prefix:"",suffix:""},t),function(e){if(isNaN(e)||!isFinite(e))return"";const n=function(t,e,n){const i=(t+="").split(".");let r=i[0];const o=i.length>1?n+i[1]:"";return r=function(t,e){const n=t.replace(/\d+/,(function(t){return t.replace(/(\d)(?=(\d{3})+$)/g,(function(t){return`${t}${e}`}))}));return n}(r,e),r+o}((t.scaler*e).toFixed(t.digitsAfterDecimal),t.thousandsSep,t.decimalSep);return`${t.prefix}${n}${t.suffix}`}}});let iP=0;class rP{_headerObjects;_headerObjectMap;_headerCellIds;_columns;bodyRowCount=1;hierarchyIndent;_transpose=!1;_showHeader=!0;_recordsCount=0;_table;_cellRangeMap;constructor(t,e,n,i){this._cellRangeMap=new Map,this._showHeader=n,this._table=t,this._columns=[],this._headerCellIds=[],this.hierarchyIndent=i??20,this._headerObjects=this._addHeaders(0,e,[]),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{})}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isHeader(t,e){return!!(this.transpose&&t<this.headerLevelCount)||!this.transpose&&e<this.headerLevelCount}getCellType(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isColumnHeader(t,e){return!this.transpose&&e<this.headerLevelCount}isCornerHeader(t,e){return!1}isRowHeader(t,e){return!!(this.transpose&&t<this.headerLevelCount)}getColumnHeaderRange(){return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:0},end:{col:(this.colCount??0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:0},end:{col:(this.colCount??0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(this.colCount??0)-1,row:(this.rowCount??0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(this.colCount??0)-1,row:(this.rowCount??0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount:this._columns.length}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get columnWidths(){return this._columns}getCellId(t,e){return this.transpose?this.headerLevelCount<=t?this._columns[e]?.id:this._headerCellIds[t]?.[e]:this.headerLevelCount<=e?this._columns[t]?.id:this._headerCellIds[e]?.[t]}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderFieldKey(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.fieldKey||(this.transpose?this._columns[e]?.fieldKey:this._columns[t]?.fieldKey)}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t]&&this._columns[t].field)}getHeaderCellAdress(t){for(let e=0;e<this._headerCellIds.length;e++){const n=this._headerCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return this.transpose?{col:e,row:i}:{col:i,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return this.getHeaderCellAdress(e.id)}getBody(t,e){return this.transpose?this._columns[e]:this._columns[t]}getBodyLayoutRangeById(t){if(this.transpose){for(let e=0;e<(this.rowCount??0);e++)if(t===this._columns[e].id)return{start:{col:0,row:e},end:{col:0,row:e}}}else for(let e=0;e<(this.colCount??0);e++)if(t===this._columns[e].id)return{start:{col:e,row:0},end:{col:e,row:0}};throw new Error(`can not found body layout @id=${t}`)}getBodyCellValue(t,e){if(this.isHeader(t,e))return null;const{field:n,fieldFormat:i}=this.getBody(t,e);return this._table.getFieldData(i||n,t,e)}getCellRange(t,e){if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(this._cellRangeMap.has(`$${t}$${e}`))return this._cellRangeMap.get(`$${t}$${e}`);let n={start:{col:t,row:e},end:{col:t,row:e}};if(this.transpose)n=this.getCellRangeTranspose(t,e);else if(this.headerLevelCount<=e){if(this.headerLevelCount<=e&&this.columnObjects[t]?.define?.mergeCell){const i=this.getBodyCellValue(t,e);for(let r=e-1;r>=this.headerLevelCount&&i===this.getBodyCellValue(t,r);r--)n.start.row=r;for(let r=e+1;r<this.rowCount&&i===this.getBodyCellValue(t,r);r++)n.end.row=r}}else{const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<this.headerLevelCount&&i===this.getCellId(t,r);r++)n.end.row=r}return this._cellRangeMap.set(`$${t}$${e}`,n),n}getCellRangeTranspose(t,e){const n={start:{col:t,row:e},end:{col:t,row:e}};if(this.headerLevelCount<=t||-1===t&&-1===e){if(this.headerLevelCount<=t&&this.columnObjects[e]?.define?.mergeCell){const i=this.getBodyCellValue(t,e);for(let r=t-1;r>=this.headerLevelCount&&i===this.getBodyCellValue(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getBodyCellValue(r,e);r++)n.end.col=r}return n}const i=this.getCellId(t,e);for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r;for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<this.headerLevelCount&&i===this.getCellId(r,e);r++)n.end.col=r;return n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t,e){return this.transpose?t<this.headerLevelCount?-1:t-this.headerLevelCount:e<this.headerLevelCount?-1:e-this.headerLevelCount}getRecordStartRowByRecordIndex(t){return this.headerLevelCount+t}_addHeaders(t,e,n,i){const r=[],o=this._newRow(t,i);return e.forEach((e=>{const a=this._columns.length,s=iP++,{captionIcon:l}=e,u={id:s,caption:e.caption,captionIcon:l,headerIcon:e.headerIcon,field:e.field,fieldKey:e?.fieldKey,fieldFormat:e.fieldFormat,style:e.headerStyle,headerType:e.headerType??"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};r[s]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e][a]=n[e];if(o[a]=i?this._headerCellIds[t-1][a]:s,e.columns)this._addHeaders(t+1,e.columns,[...n,s],e.hideColumnsSubHeader).forEach((t=>r.push(t)));else{const n=e;this._columns.push({id:iP++,field:n.field,fieldKey:n.fieldKey,fieldFormat:n.fieldFormat,width:n.width,minWidth:n.minWidth,maxWidth:n.maxWidth,icon:n.icon,columnType:n.columnType??"text",chartType:"chartType"in n?n.chartType:null,chartSpec:"chartSpec"in n?n.chartSpec:null,sparklineSpec:"sparklineSpec"in n?n.sparklineSpec:null,style:n.style,define:n,columnWidthComputeMode:n.columnWidthComputeMode,disableColumnResize:n?.disableColumnResize});for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][a]=s}})),r}_newRow(t,e=!1){if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let n=this._headerCellIds[t].length;n<e.length;n++)this._headerCellIds[t][n]=e[n];return this._headerCellIds[t]}if(e)return[];const n=this._headerCellIds[t]=[];if(!this._columns.length)return n;const i=this._headerCellIds[t-1];for(let t=0;t<i.length;t++)n[t]=i[t];return n}getCellHeaderPaths(t,e){let n=[],i=[];return this.transpose?i=[{field:this._columns[e].field}]:n=[{field:this._columns[t].field}],{colHeaderPaths:n,rowHeaderPaths:i}}getParentCellId(t,e){if(0!==e)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}canMoveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row)}if(this.isRowHeader(t.col,t.row)){return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row)}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const i=n.end.col-n.start.col+1;let r;const o=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?o.end.col-i+1:o.start.col,r===n.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(n.start.col,i);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const a=this._columns.splice(n.start.col,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columns,a),this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,moveSize:i,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){const i=n.end.row-n.start.row+1;let r;const o=this.getCellRange(n.start.col,e.row);if(r=e.row>=t.row?o.end.row-i+1:o.start.row,r===n.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(n.start.row,i);e.unshift(r,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const a=this._columns.splice(n.start.row,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columns,a),this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:r,moveSize:i,moveType:"row"}}}return null}toggleHierarchyState(t,e){}}class oP{sizeIncludeParent=!1;rowExpandLevel;hierarchyType;tree={id:0,dimensionKey:"",value:"",children:[],level:-1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0};totalLevel=0;dimensionKeys=new kt;constructor(t,e="grid",n=void 0){this.sizeIncludeParent=null!=n,this.rowExpandLevel=n,this.hierarchyType=e,this.reset(t)}reset(t,e=!1){this.dimensionKeys=new kt,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree),this.totalLevel=this.dimensionKeys.count()}setTreeNode(t,e,i){t.startIndex=e,t.startInTotal=(i.startInTotal??0)+t.startIndex,(t.dimensionKey??t.indicatorKey)&&(!this.dimensionKeys.contain(t.indicatorKey?Kn:t.dimensionKey)&&this.dimensionKeys.put(t.level,t.indicatorKey?Kn:t.dimensionKey),t.id||(t.id=++aP));let r=t.dimensionKey&&this.sizeIncludeParent?1:0;return"grid"===this.hierarchyType?t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,r+=this.setTreeNode(e,r,t)})):r=1:t.hierarchyState===n.expand&&t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,r+=this.setTreeNode(e,r,t)})):t.hierarchyState===n.collapse&&t.children?t.children.forEach((e=>{e.level=(t.level??0)+1,this.setTreeNode(e,r,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&t.children?(t.hierarchyState=n.expand,t.children.forEach((e=>{e.level=(t.level??0)+1,r+=this.setTreeNode(e,r,t)}))):t.children?(t.hierarchyState=n.collapse,t.children.forEach((e=>{e.level=(t.level??0)+1,this.setTreeNode(e,r,t)}))):(t.hierarchyState=n.none,r=1),t.size=r,r}getTreePath(t,e=30){const n=[];return this.searchPath(t,this.tree,n,e),n.shift(),n}searchPath(t,e,n,i){if(!e)return!1;if(t<e.startIndex||t>=e.startIndex+e.size)return!1;if(n.push(e),!e.children||0===e.children.length)return!0;if(e.level>=i)return!0;const r=t-e.startIndex;return e.children.some((t=>this.searchPath(r,t,n,i))),!0}movePosition(t,e,n){let i,r,o;const a=(s,l)=>{if((void 0===r||void 0===o)&&(s.level===t&&(s.startInTotal===e&&(r=l),s.startInTotal<=n&&n<=s.startInTotal+s.size-1&&(o=l)),s.children&&s.level<t)){i=s;for(let t=0;t<s.children.length;t++)(e>=s.children[t].startInTotal&&e<=s.children[t].startInTotal+s.children[t].size||n>=s.children[t].startInTotal&&n<=s.children[t].startInTotal+s.children[t].size)&&a(s.children[t],t)}};a(this.tree,0);const s=i.children.splice(r,1);s.unshift(o,0),Array.prototype.splice.apply(i.children,s)}}let aP=0,sP=0;class lP{_showHeader=!0;rowDimensionTree;columnDimensionTree;rowTree;columnTree;cornerHeaderObjs;columnHeaderObjs=[];rowHeaderObjs=[];_cornerHeaderCellIds=[];_columnHeaderCellIds=[];_rowHeaderCellIds=[];_columnWidths=[];rowsDefine;columnsDefine;indicatorsDefine;columnPaths=[];_headerObjects=[];_headerObjectMap={};_indicators=[];indicatorTitle;indicatorsAsCol=!0;hideIndicatorName=!1;_showRowHeader=!0;_showColumnHeader=!0;_rowHeaderTitle;_columnHeaderTitle;cornerSetting;_indicatorShowType="column";rowHierarchyType;rowExpandLevel;rowHierarchyIndent;rowDimensionKeys=[];colDimensionKeys=[];indicatorKeys=[];indicatorDimensionKey=Kn;_cellRangeMap;_CellHeaderPathMap;_table;constructor(t){if(this._table=t,this._cellRangeMap=new Map,this._CellHeaderPathMap=new Map,this.rowTree=t.options.rowTree,this.columnTree=t.options.columnTree,this.rowsDefine=t.options.rows??[],this.columnsDefine=t.options.columns??[],this.indicatorsDefine=t.options.indicators??[],this.indicatorTitle=t.options.indicatorTitle,this.hideIndicatorName=t.options.hideIndicatorName??!1,this.showRowHeader=t.options.showRowHeader??!0,this.showColumnHeader=t.options.showColumnHeader??!0,this.rowHeaderTitle=t.options.rowHeaderTitle,this.columnHeaderTitle=t.options.columnHeaderTitle,this.rowHierarchyType=t.options.rowHierarchyType??"grid",this.rowExpandLevel=t.options.rowExpandLevel??1,this.rowHierarchyIndent=t.options.rowHierarchyIndent??20,this.cornerSetting=t.options.corner??{titleOnDimension:"column"},this.indicatorsDefine?.forEach((t=>{"string"==typeof t?this.indicatorKeys.push(t):this.indicatorKeys.push(t.indicatorKey)})),this.columnDimensionTree=new oP(this.columnTree??[]),this.rowDimensionTree=new oP(this.rowTree??[],this.rowHierarchyType,"tree"===this.rowHierarchyType?this.rowExpandLevel:void 0),this.colDimensionKeys=this.columnDimensionTree.dimensionKeys.valueArr(),this.rowDimensionKeys=this.rowDimensionTree.dimensionKeys.valueArr(),this.cornerHeaderObjs="column"===this.cornerSetting.titleOnDimension?this._addCornerHeaders(this.columnHeaderTitle?[""].concat(this.colDimensionKeys):this.colDimensionKeys):"row"===this.cornerSetting.titleOnDimension?this._addCornerHeaders(this.rowHeaderTitle?[""].concat(this.rowDimensionKeys):this.rowDimensionKeys):this._addCornerHeaders(null),this.columnDimensionTree.tree.children&&(this.columnHeaderObjs=this._addHeaders(this._columnHeaderCellIds,0,this.columnDimensionTree.tree.children,[]),this.columnHeaderTitle)){const t=++aP,e=Array(this.colCount-this.rowHeaderLevelCount).fill(t);this._columnHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.columnHeaderTitle.title?this.columnHeaderTitle.title:this.columnsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.columnHeaderTitle.headerType??"text",style:this.columnHeaderTitle.headerStyle,define:{id:t}};this.columnHeaderObjs.push(n),this._headerObjects[t]=n}if(sP=0,this.rowDimensionTree.tree.children&&(this.rowHeaderObjs="tree"===this.rowHierarchyType?this._addHeadersForTreeMode(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0):this._addHeaders(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[])),this.rowHeaderTitle){const t=++aP,e=Array(this.rowCount-this.columnHeaderLevelCount).fill(t);this._rowHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.rowHeaderTitle.title?this.rowHeaderTitle.title:this.rowsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.rowHeaderTitle.headerType??"text",style:this.rowHeaderTitle.headerStyle,define:{id:t}};this.rowHeaderObjs.push(n),this._headerObjects[t]=n}sP=0,this.indicatorsAsCol=!_(this.rowDimensionKeys.find((t=>t===this.indicatorDimensionKey))),this._rowHeaderCellIds=b(this._rowHeaderCellIds),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.setColumnWidths()}_addHeaders(t,e,n,i){const r=[];return t[e]||function(e){const n=t[e]=[];if(0===sP)return n;const i=t[e-1];for(let t=0;t<i?.length;t++)n[t]=i[t]}(e),n.forEach((n=>{const o=n.id,a=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.dimensionKey)),s=this.indicatorsDefine?.find((t=>"string"!=typeof t&&(n.indicatorKey?t.indicatorKey===n.indicatorKey:t.caption===n.value))),l={id:o,caption:n.value??s.caption,field:n.dimensionKey,style:"function"==typeof(s??a)?.headerStyle?(s??a)?.headerStyle:Object.assign({},(s??a)?.headerStyle),headerType:s?.headerType??a?.headerType??"text",headerIcon:s?.headerIcon??a?.headerIcon,define:Object.assign({},n,s??a),fieldFormat:s?.headerFormat??a?.headerFormat,dropDownMenu:s?.dropDownMenu??a?.dropDownMenu,pivotInfo:{value:n.value,dimensionKey:n.dimensionKey,isPivotCorner:!1},width:a?.width,minWidth:a?.minWidth,maxWidth:a?.maxWidth,showSort:s?.showSort??a?.showSort,description:a?.description};s?(s.customRender&&(n.customRender=s.customRender),_(this._indicators.find((t=>t.indicatorKey===s.indicatorKey)))||this._indicators.push({id:++aP,indicatorKey:s.indicatorKey,field:s.indicatorKey,fieldFormat:s?.format,columnType:s?.columnType??"text",chartType:"chartType"in s?s.chartType:null,chartSpec:"chartSpec"in s?s.chartSpec:null,sparklineSpec:"sparklineSpec"in s?s.sparklineSpec:null,style:s?.style,icon:s?.icon,define:Object.assign({},n,s,{dragHeader:a?.dragHeader}),width:s?.width,minWidth:s?.minWidth,maxWidth:s?.maxWidth,disableColumnResize:s?.disableColumnResize})):n.indicatorKey&&(_(this._indicators.find((t=>t.indicatorKey===n.indicatorKey)))||this._indicators.push({id:++aP,indicatorKey:n.indicatorKey,field:n.indicatorKey,columnType:"text",define:Object.assign({},n)})),r[o]=l,this._headerObjects[o]=l,t[e][sP]=o;for(let n=e-1;n>=0;n--)t[n][sP]=i[n];if(n.children)this._addHeaders(t,e+1,n.children??[],[...i,o]).forEach((t=>r.push(t)));else{for(let n=e+1;n<t.length;n++)t[n][sP]=o;sP++}})),r}_addHeadersForTreeMode(t,e,i,r,o,a){const s=[];return t[e]||function(e){const n=t[e]=[];if(0===sP)return n;const i=t[e-1];for(let t=0;t<i?.length;t++)n[t]=i[t]}(e),i.forEach((i=>{const l=i.id,u=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===i.dimensionKey))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===i.dimensionKey)),h={id:l,caption:i.value,field:i.dimensionKey,style:i.level+1===o||"function"==typeof u?.headerStyle?u?.headerStyle:Object.assign({},u?.headerStyle,{textAlign:"left"}),headerType:u?.headerType??"text",headerIcon:u?.headerIcon,define:Object.assign(i,{linkJump:"linkJump"in u?u.linkJump:null,linkDetect:"linkDetect"in u?u.linkDetect:null,templateLink:"templateLink"in u?u.templateLink:null,keepAspectRatio:"keepAspectRatio"in u&&u.keepAspectRatio,imageAutoSizing:"imageAutoSizing"in u?u.imageAutoSizing:null,headerCustomRender:u?.headerCustomRender,headerCustomLayout:u?.headerCustomLayout,dragHeader:u?.dragHeader}),fieldFormat:u?.headerFormat,dropDownMenu:u?.dropDownMenu,pivotInfo:{value:i.value,dimensionKey:i.dimensionKey,isPivotCorner:!1},hierarchyLevel:i.level,dimensionTotalLevel:o,hierarchyState:i.level+1===o?void 0:i.hierarchyState,width:u?.width,minWidth:u?.minWidth,maxWidth:u?.maxWidth};s[l]=h,this._headerObjects[l]=h,t[e][sP]=l;for(let n=e-1;n>=0;n--)t[n][sP]=r[n];if(i.hierarchyState===n.expand&&i.children)a&&sP++,this._addHeadersForTreeMode(t,e,i.children??[],[...r,l],o,a&&i.hierarchyState===n.expand).forEach((t=>s.push(t)));else{a&&sP++;for(let n=e+1;n<t.length;n++)t[n][sP]=l}})),s}_addCornerHeaders(t){const e=[];if(t)t.forEach(((t,n)=>{const i=++aP,r=this.rowsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))??this.columnsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t)),o={id:i,caption:t===this.indicatorDimensionKey?this.indicatorTitle:r?.dimensionTitle??"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:this.cornerSetting.headerType??"text",define:{dimensionKey:"维度名称",id:i,value:t},dropDownMenu:r?.cornerDropDownMenu,pivotInfo:{value:r?.dimensionTitle??"",dimensionKey:t,isPivotCorner:!0},description:r?.cornerDescription};if(e[i]=o,this._headerObjects[i]=o,"column"===this.cornerSetting.titleOnDimension){this._cornerHeaderCellIds[n]||(this._cornerHeaderCellIds[n]=[]);for(let t=0;t<this.rowHeaderLevelCount;t++)this._cornerHeaderCellIds[n][t]=i}else if("row"===this.cornerSetting.titleOnDimension)for(let t=0;t<this.columnHeaderLevelCount;t++)this._cornerHeaderCellIds[t]||(this._cornerHeaderCellIds[t]=[]),this._cornerHeaderCellIds[t][n]=i}));else{const t=++aP,n={id:t,caption:"",field:"维度名称",style:this.cornerSetting.headerStyle,headerType:this.cornerSetting.headerType??"text",define:{dimensionKey:"维度名称",id:t,value:""}};e[t]=n,this._headerObjects[t]=n;for(let e=0;e<this.columnHeaderLevelCount;e++)for(let n=0;n<this.rowHeaderLevelCount;n++)this._cornerHeaderCellIds[e]||(this._cornerHeaderCellIds[e]=[]),this._cornerHeaderCellIds[e][n]=t}return e}get columnWidths(){return this._columnWidths}setColumnWidths(){const t=new Array(this.colCount).fill(void 0);if(this.showHeader&&this.showRowHeader&&(this.rowHeaderTitle&&(t[0]={}),this.rowDimensionKeys.forEach(((e,n)=>{const i=this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===e));i&&(t[n+(this.rowHeaderTitle?1:0)]={width:i.width,minWidth:i.minWidth,maxWidth:i.maxWidth})}))),this.indicatorsAsCol)for(let e=this.rowHeaderLevelCount;e<this.colCount;e++){const n=this.getBody(e,this.columnHeaderLevelCount);t[e]={width:n?.width,minWidth:n?.minWidth,maxWidth:n?.maxWidth}}else{let e,n,i,r=0;this._indicators.forEach(((t,o)=>{"number"==typeof t.width?r=Math.max(t.width,r):"auto"===t.width&&(i=!0),"number"==typeof t.minWidth&&(n=Math.max(t.minWidth,n)),"number"==typeof t.maxWidth&&(e=Math.max(t.maxWidth,e))})),r=r>0?r:i?"auto":void 0,t.fill({width:r,minWidth:n,maxWidth:e},this.rowHeaderLevelCount,this.colCount)}this._columnWidths=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}get columnHeaderTitle(){return this._columnHeaderTitle}set columnHeaderTitle(t){this._columnHeaderTitle=t}get rowHeaderTitle(){return this._rowHeaderTitle}set rowHeaderTitle(t){this._rowHeaderTitle=t}getHeaderFieldKey(t,e){}getCellType(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t<this.rowHeaderLevelCount||e<this.columnHeaderLevelCount}isCornerHeader(t,e){return t<this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t<this.rowHeaderLevelCount&&e>=this.columnHeaderLevelCount}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get headerLevelCount(){return this.columnHeaderLevelCount}get columnHeaderLevelCount(){if(this.showHeader&&this.showColumnHeader){let t=this.indicatorsAsCol&&this.hideIndicatorName&&this.colDimensionKeys[this.colDimensionKeys.length-1]===this.indicatorDimensionKey?this.columnDimensionTree.totalLevel-1:this.columnDimensionTree.totalLevel;return this.columnHeaderTitle&&(t+=1),t}return 0}get rowHeaderLevelCount(){if(this.showHeader&&this.showRowHeader){if("tree"===this.rowHierarchyType)return this.rowHeaderTitle?2:1;let t=this.indicatorsAsCol?this.rowDimensionTree.totalLevel:this.hideIndicatorName&&this.rowDimensionKeys[this.rowDimensionKeys.length-1]===this.indicatorDimensionKey?this.rowDimensionTree.totalLevel-1:this.rowDimensionTree.totalLevel;return this.rowHeaderTitle&&(t+=1),t}return 0}get colCount(){return this.columnDimensionTree.tree.size+this.rowHeaderLevelCount}get rowCount(){return this.rowDimensionTree.tree.size+this.columnHeaderLevelCount}get bodyRowCount(){return this.rowDimensionTree.tree.size}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicators}getCellId(t,e){if(e>=0&&t>=0){if(this.isCornerHeader(t,e))return this._cornerHeaderCellIds[e][t];if(this.isColumnHeader(t,e))return this._columnHeaderCellIds[e][t-this.rowHeaderLevelCount];if(this.isRowHeader(t,e))return this._rowHeaderCellIds[e-this.columnHeaderLevelCount]?.[t]}}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||this.getBody(t,e)?.field}getHeaderCellAdress(t){for(let e=0;e<this._columnHeaderCellIds.length;e++){const n=this._columnHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i,row:e}}for(let e=0;e<this._rowHeaderCellIds.length;e++){const n=this._rowHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i,row:e}}for(let e=0;e<this._cornerHeaderCellIds.length;e++){const n=this._cornerHeaderCellIds[e];for(let i=0;i<n.length;i++)if(n[i]===t)return{col:i,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return this.getHeaderCellAdress(e.id)}getBody(t,e){const n=this.getCellHeaderPaths(t,e);if(this.indicatorsAsCol){const t=n.colHeaderPaths.find((t=>t.indicatorKey))?.indicatorKey;return this._indicators.find((e=>e.indicatorKey===t))??this._indicators[0]??{id:"",field:void 0,indicatorKey:void 0,columnType:void 0,define:void 0}}const i=n.rowHeaderPaths.find((t=>t.indicatorKey))?.indicatorKey;return this._indicators.find((t=>t.indicatorKey===i))??this._indicators[0]??{id:"",field:void 0,indicatorKey:void 0,columnType:void 0,define:void 0}}getBodyLayoutRangeById(t){for(let e=0;e<(this.colCount??0);e++)if(t===this.columnObjects[e].id)return{start:{col:e,row:0},end:{col:e,row:0}};throw new Error(`can not found body layout @id=${t}`)}getCellRange(t,e){if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(this._cellRangeMap.has(`${t}-${e}`))return this._cellRangeMap.get(`${t}-${e}`);const n={start:{col:t,row:e},end:{col:t,row:e}};if(this.isHeader(t,e)&&-1!==t&&-1!==e){const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r}return this._cellRangeMap.set(`${t}-${e}`,n),n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t){return t<this.columnHeaderLevelCount?-1:t-this.columnHeaderLevelCount}getRecordIndexByCol(t){return t<this.rowHeaderLevelCount?-1:t-this.rowHeaderLevelCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getCellHeaderPathsWidthTreeNode(t,e){if(this._CellHeaderPathMap.has(`${t}-${e}`))return this._CellHeaderPathMap.get(`${t}-${e}`);const n=this.getRecordIndexByCol(t),i=this.getRecordIndexByRow(e);let r,o;if(t>=0&&(r=this.columnDimensionTree.getTreePath(n,this.showHeader&&this.showColumnHeader?e-(this.columnHeaderTitle?1:0):this.columnDimensionTree.totalLevel)),e>=0)if("tree"===this.rowHierarchyType)if(t>=this.rowHeaderLevelCount)o=this.rowDimensionTree.getTreePath(i,t+this.rowDimensionTree.totalLevel);else{const n=this.getHeader(t,e);o=this.rowDimensionTree.getTreePath(i,t+n.hierarchyLevel)}else o=this.rowDimensionTree.getTreePath(i,this.showHeader&&this.showRowHeader?t-(this.rowHeaderTitle?1:0):this.rowDimensionTree.totalLevel);const a={colHeaderPaths:r,rowHeaderPaths:o};return this._CellHeaderPathMap.set(`${t}-${e}`,a),a}getCellHeaderPaths(t,e){const n=this.getCellHeaderPathsWidthTreeNode(t,e),i={colHeaderPaths:[],rowHeaderPaths:[]};return n.colHeaderPaths.forEach((t=>{const e={};e.dimensionKey=t.dimensionKey,e.indicatorKey=t.indicatorKey,e.value=t.value??this.getIndicatorInfoByIndicatorKey(t.indicatorKey)?.caption??"",i.colHeaderPaths.push(e)})),n.rowHeaderPaths.forEach((t=>{const e={};e.dimensionKey=t.dimensionKey,e.indicatorKey=t.indicatorKey,e.value=t.value??this.getIndicatorInfoByIndicatorKey(t.indicatorKey)?.caption??"",i.rowHeaderPaths.push(e)})),i}getIndicatorInfoByIndicatorKey(t){const e=this.indicatorsDefine?.find((e=>"string"!=typeof e&&(!!t&&e.indicatorKey===t)));return e}getHeaderDimension(t,e){if(this.isHeader(t,e)){const n=this.getHeader(t,e);return this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))}}isColumnIndicatorHeader(t,e){return"column"===this._indicatorShowType&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return"row"===this._indicatorShowType&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}toggleHierarchyState(t,e){const i=this.getHeader(t,e);if(i.define.hierarchyState=i.define.hierarchyState===n.collapse?n.expand:n.collapse,this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._rowHeaderCellIds=[],this.rowHeaderObjs=this._addHeadersForTreeMode(this._rowHeaderCellIds,0,this.rowDimensionTree.tree.children,[],this.rowDimensionTree.totalLevel,!0),this.rowHeaderTitle){const t=++aP,e=Array(this.rowCount-this.columnHeaderLevelCount).fill(t);this._rowHeaderCellIds.unshift(e);const n={id:t,caption:"string"==typeof this.rowHeaderTitle.title?this.rowHeaderTitle.title:this.rowsDefine.reduce(((t,e)=>"string"==typeof e?t:t+(t?`/${e.dimensionTitle}`:`${e.dimensionTitle}`)),""),field:void 0,headerType:this.rowHeaderTitle.headerType??"text",style:this.rowHeaderTitle.headerStyle,define:{field:"",headerType:"text",columnType:"text"}};this.rowHeaderObjs.push(n),this._headerObjects[t]=n}sP=0,this._rowHeaderCellIds=b(this._rowHeaderCellIds),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this._CellHeaderPathMap=new Map}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}getPivotCellAdress(t){if(!Array.isArray(t))return;let e,n,i=this.rowTree,r=this.columnTree;for(let o=0;o<t.length;o++){const a=t[o];if((a.isPivotCorner||!a.value)&&o===t.length-1){if("row"===this?.cornerSetting?.titleOnDimension){let t=0;return"grid"===this.rowHierarchyType&&(t=this.rowDimensionKeys.indexOf(a.dimensionKey)),-1===t?void 0:{col:this.rowHeaderTitle?t+1:t,row:0}}const t=this.colDimensionKeys.indexOf(a.dimensionKey);return-1===t?void 0:{col:0,row:this.columnHeaderTitle?t+1:t}}let s=!1;for(let t=0;t<r.length;t++){const e=r[t];if((_(a.dimensionKey)&&e.dimensionKey===a.dimensionKey||_(a.indicatorKey)&&e.indicatorKey===a.indicatorKey)&&e.value===a.value){r=e.children,n=e,s=!0;break}}if(!s)for(let t=0;t<i.length;t++){const n=i[t];if((_(a.dimensionKey)&&n.dimensionKey===a.dimensionKey||_(a.indicatorKey)&&n.indicatorKey===a.indicatorKey)&&n.value===a.value){i=n.children,e=n;break}}}let o=0,a=0;if(e){a=this.columnHeaderLevelCount;const{startInTotal:t,level:n}=e;return a+=t,o="grid"===this.rowHierarchyType?this.rowHeaderTitle?n+1:n:0,{col:o,row:a}}if(n){o=this.rowHeaderLevelCount;const{startInTotal:t,level:e}=n;return o+=t,a=this.columnHeaderTitle?e+1:e,{col:o,row:a}}}getPivotDimensionInfo(t,e){const{colHeaderPaths:n,rowHeaderPaths:i}=this.getCellHeaderPaths(t,e),r=[];return n.length?n.forEach(((t,e)=>{r.push({dimensionKey:t.dimensionKey,value:t.value,isPivotCorner:!1,indicatorKey:t.indicatorKey})})):i.length?i.forEach(((t,e)=>{r.push({dimensionKey:t.dimensionKey,value:t.value,isPivotCorner:!1,indicatorKey:t.indicatorKey})})):this.isCornerHeader(t,e)&&("row"===this?.cornerSetting?.titleOnDimension?r.push({dimensionKey:this.rowDimensionKeys[this.rowHeaderTitle?t-1:t],isPivotCorner:!0}):r.push({dimensionKey:this.colDimensionKeys[this.columnHeaderTitle?e-1:e],isPivotCorner:!0})),r}getIndicatorKey(t,e){return this.getBody(t,e)?.indicatorKey}getParentCellId(t,e){if(0!==e)return this.isColumnHeader(t,e)?this.getCellId(t,e-1):this.isRowHeader(t,e)?this.getCellId(t-1,e):void 0}canMoveHeaderPosition(t,e){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){return this.getParentCellId(t.col,n.start.row)===this.getParentCellId(e.col,n.start.row)}if(this.isRowHeader(t.col,t.row)){if("tree"!==this.rowHierarchyType){return this.getParentCellId(n.start.col,t.row)===this.getParentCellId(n.start.col,e.row)}{const n=y(this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths),i=y(this.getCellHeaderPathsWidthTreeNode(e.col,e.row).rowHeaderPaths);if(n.pop(),i.pop(),n.length<=i.length)return n.length!==i.length||!n.find(((t,e)=>t.dimensionKey!==i[e].dimensionKey||t.value!==i[e].value))}}return!1}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)&&!this.isCellRangeEqual(t.col,t.row,e.col,e.row)){const n=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const i=n.end.col-n.start.col+1;let r;const o=this.getCellRange(e.col,n.start.row);if(r=e.col>=t.col?o.end.col-i+1:o.start.col,r===n.end.col)return null;for(let t=0;t<this._columnHeaderCellIds.length;t++){const e=this._columnHeaderCellIds[t].splice(n.start.col-this.rowHeaderLevelCount,i);e.unshift(r-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this._columnHeaderCellIds[t],e)}const a=this._columnWidths.splice(n.start.col,i);return a.unshift(r,0),Array.prototype.splice.apply(this._columnWidths,a),this.columnDimensionTree.movePosition(t.row,n.start.col-this.rowHeaderLevelCount,r-this.rowHeaderLevelCount),this.columnDimensionTree.reset(this.columnDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._cellRangeMap=new Map,{sourceIndex:n.start.col,targetIndex:r,moveSize:i,moveType:"column"}}if(this.isRowHeader(t.col,t.row)){let i;const r=this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths,o=this.getCellHeaderPathsWidthTreeNode(e.col,e.row).rowHeaderPaths,a=r[r.length-1],s=o[r.length-1],l=a.size;if(i=e.row>=t.row?s.startInTotal+s.size-l:s.startInTotal,i===t.row||i===n.end.row)return null;const u=this._rowHeaderCellIds.splice(n.start.row-this.columnHeaderLevelCount,l);return u.unshift(i,0),Array.prototype.splice.apply(this._rowHeaderCellIds,u),this.rowDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(t.col,t.row).rowHeaderPaths.length-1,n.start.row-this.columnHeaderLevelCount,i+(e.row>t.row?a.size-1:0)),this.rowDimensionTree.reset(this.rowDimensionTree.tree.children,!0),this._CellHeaderPathMap=new Map,this._cellRangeMap=new Map,{sourceIndex:n.start.row,targetIndex:i+this.columnHeaderLevelCount,moveSize:l,moveType:"row"}}}return null}getCellAdressByHeaderPath(t){let e,n;if(Array.isArray(t)){if(t.length>this.rowDimensionKeys.length+this.colDimensionKeys.length)return;e=t.filter((t=>this.colDimensionKeys.indexOf(t.dimensionKey)>=0)),n=t.filter((t=>this.rowDimensionKeys.indexOf(t.dimensionKey)>=0))}else e=t.colHeaderPaths,n=t.rowHeaderPaths;if(!Array.isArray(e)&&!Array.isArray(n))return;e?.sort(((t,e)=>this.colDimensionKeys.indexOf(t.dimensionKey??this.indicatorDimensionKey)-this.colDimensionKeys.indexOf(e.dimensionKey??this.indicatorDimensionKey))),n?.sort(((t,e)=>this.rowDimensionKeys.indexOf(t.dimensionKey??this.indicatorDimensionKey)-this.rowDimensionKeys.indexOf(e.dimensionKey??this.indicatorDimensionKey)));let i,r,o,a,s=!1;e?.length>=1&&n?.length>=1&&(s=!0);let l,u,h=this.rowTree,c=this.columnTree;if(e)for(let t=0;t<e.length;t++){const n=e[t];for(let t=0;t<c.length;t++){const e=c[t];if((_(n.dimensionKey)&&e.dimensionKey===n.dimensionKey||_(n.indicatorKey)&&e.indicatorKey===n.indicatorKey)&&e.value===n.value){c=e.children,s&&!c?u=e:s||(u=e);break}}}if(n)for(let t=0;t<n.length;t++){const e=n[t];for(let t=0;t<h.length;t++){const n=h[t];if((_(e.dimensionKey)&&n.dimensionKey===e.dimensionKey||_(e.indicatorKey)&&n.indicatorKey===e.indicatorKey)&&n.value===e.value){h=n.children,s&&!h?l=n:s||(l=n);break}}}if(!s||l&&u){if(l){r=this.columnHeaderLevelCount;const{startInTotal:t,level:e}=l;r+=t,o="grid"===this.rowHierarchyType?this.rowHeaderTitle?e+1:e:0}if(u){i=this.rowHeaderLevelCount;const{startInTotal:t,level:e}=u;i+=t,a=this.columnHeaderTitle?e+1:e}return _(i)||_(r)?{col:i??o,row:r??a}:void 0}}}class uP{_headerObjects=[];_headerObjectMap={};_indicatorObjects=[];rowsDefine;columnsDefine;indicatorsDefine;indicators;_showRowHeader=!0;_showColumnHeader=!0;_indicatorShowType="column";indicatorsAsCol=!0;hideIndicatorName=!1;indicatorDimensionKey;indicatorTitle;rowKeysPath;colKeysPath;convertColKeys;rows;columns;rowShowAttrs;colShowAttrs;tree;dataset;dataConfig;_rowCount;_colCount;_bodyRowCount;cornerSetting;_table;constructor(t,e){this._table=t,this.rowsDefine=t.options.rows??[],this.columnsDefine=t.options.columns??[],this.indicatorsDefine=t.options.indicators??[],this.indicatorTitle=t.options.indicatorTitle,this.dataset=e,this.dataConfig=e.dataConfig,this.indicators=e.indicators,this.indicatorsAsCol=t.options.indicatorsAsCol??!0,this.hideIndicatorName=t.options.hideIndicatorName??!1,this.indicatorDimensionKey=Kn,this.cornerSetting=t.options.corner??{titleOnDimension:"column"},this.columns=e.columns,this.rows=e.rows,this.rowKeysPath=e.rowKeysPath,this.colKeysPath=e.colKeysPath,this.convertColKeys=b(this.colKeysPath),this.tree=e.tree,this.initState()}initState(){this.indicatorsAsCol&&!this.hideIndicatorName?this._indicatorShowType="column":this.indicatorsAsCol||this.hideIndicatorName?this._indicatorShowType="none":this._indicatorShowType="row",this.colShowAttrs="column"===this._indicatorShowType?this.columns.concat(this.indicatorDimensionKey):this.columns,this.rowShowAttrs="row"===this._indicatorShowType?this.rows.concat(this.indicatorDimensionKey):this.rows,this._colCount=(0===this.colKeysPath.length?1:this.colKeysPath.length)*(this.indicatorsAsCol?this.indicators.length:1)+this.rowHeaderLevelCount,this._rowCount=(0===this.rowKeysPath.length?1:this.rowKeysPath.length)*(this.indicatorsAsCol?1:this.indicators.length)+this.columnHeaderLevelCount,this._bodyRowCount=this.rowKeysPath.length*(this.indicatorsAsCol?1:this.indicators.length),this.initHeaderObjects(),this.initIndicatorObjects()}getDimensionInfo(t){return this.rowsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))??this.columnsDefine?.find((e=>"string"!=typeof e&&e.dimensionKey===t))}getIndicatorInfo(t,e=""){const n=this.indicatorsDefine?.find((n=>"string"!=typeof n&&(t?n.indicatorKey===t:!!e&&n.caption===e)));return n}initHeaderObjects(){for(let t=0,e=this.rowKeysPath.length;t<=e-1;t++){const e=this.rowKeysPath[t];for(let t=0,n=e.length;t<=n-1;t++)if(!this._headerObjectMap[e[t]]){const n=e[t].split(this.dataset.stringJoinChar),i=this.getDimensionInfo(this.rows[n.length-1]);this._headerObjectMap[e[t]]={id:e[t],field:i?.dimensionKey??this.rows[n.length-1],caption:n[n.length-1],style:i?.headerStyle,define:{field:i?.dimensionKey??this.rows[n.length-1],headerType:i?.headerType??"text",columnType:"text"},fieldFormat:i?.headerFormat,dropDownMenu:i?.dropDownMenu,headerType:i?.headerType??"text",width:i?.width},this._headerObjects.push(this._headerObjectMap[e[t]])}}for(let t=0,e=this.colKeysPath.length;t<=e-1;t++){const e=this.colKeysPath[t];for(let t=0,n=e.length;t<=n-1;t++)if(!this._headerObjectMap[e[t]]){const n=e[t].split(this.dataset.stringJoinChar),i=this.getDimensionInfo(this.columns[n.length-1]);this._headerObjectMap[e[t]]={id:e[t],field:i?.dimensionKey??this.columns[n.length-1],caption:n[n.length-1],style:i?.headerStyle,define:{field:i?.dimensionKey??this.columns[n.length-1],headerType:i?.headerType??"text",columnType:"text"},fieldFormat:i?.headerFormat,dropDownMenu:i?.dropDownMenu,headerType:i?.headerType??"text",width:i?.width},this._headerObjects.push(this._headerObjectMap[e[t]])}}let t;this.indicatorsDefine.forEach((t=>{const e="string"==typeof t?t:t.indicatorKey,n="string"==typeof t?void 0:t;this._headerObjectMap[e]||(this._headerObjectMap[e]={id:e,field:this.indicatorDimensionKey,caption:e,style:n?.headerStyle,define:{field:this.indicatorDimensionKey,headerType:n?.headerType??"text",columnType:"text"},dropDownMenu:n?.dropDownMenu,headerType:n?.headerType??"text",width:n?.width},this._headerObjects.push(this._headerObjectMap[e]))})),"column"===this.cornerSetting.titleOnDimension?t=this.colShowAttrs:"row"===this.cornerSetting.titleOnDimension&&(t=this.rowShowAttrs),t.forEach((t=>{if(!this._headerObjectMap[t]){const e=this.getDimensionInfo(t);this._headerObjectMap[t]={id:t,field:t,caption:t===this.indicatorDimensionKey?this.indicatorTitle:e?.dimensionTitle??t,style:this.cornerSetting?.headerStyle,define:{field:t,headerType:this.cornerSetting?.headerType??"text",columnType:"text"},dropDownMenu:e?.dropDownMenu,headerType:this.cornerSetting?.headerType??"text",width:e?.width},this._headerObjects.push(this._headerObjectMap[t])}}))}initIndicatorObjects(){this.indicators.forEach((t=>{const e=this.indicatorsDefine?.find((e=>"string"!=typeof e&&e.caption===t));this._indicatorObjects.push({id:t,indicatorKey:t,field:t,define:{field:t,headerType:"text",columnType:e?.columnType??"text"},fieldFormat:e?.format,columnType:e?.columnType??"text",style:e?.style})}))}get columnWidths(){const t=[];for(let e=0;e<this.rowHeaderLevelCount;e++){const n=this.getDimensionInfo(this.rowShowAttrs[e])??this.getIndicatorInfo(this.rowShowAttrs[e]);t.push({width:n?.width})}for(let e=0;e<this.colCount-this.rowHeaderLevelCount;e++){const n=this._indicatorObjects[e%this._indicatorObjects.length];t.push({width:n?.width})}return t}get showColumnHeader(){return this._showColumnHeader}set showColumnHeader(t){this._showColumnHeader=t}get showRowHeader(){return this._showRowHeader}set showRowHeader(t){this._showRowHeader=t}getCellType(t,e){return this.isCornerHeader(t,e)?"cornerHeader":this.isColumnHeader(t,e)?"columnHeader":this.isRowHeader(t,e)?"rowHeader":"body"}isHeader(t,e){return t<this.rowHeaderLevelCount||e<this.columnHeaderLevelCount}isCornerHeader(t,e){return t<this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isColumnHeader(t,e){return t>=this.rowHeaderLevelCount&&e<this.columnHeaderLevelCount}isRowHeader(t,e){return t<this.rowHeaderLevelCount&&e>=this.columnHeaderLevelCount}isColumnIndicatorHeader(t,e){return"column"===this._indicatorShowType&&e===this.columnHeaderLevelCount-1&&t>=this.rowHeaderLevelCount}isRowIndicatorHeader(t,e){return"row"===this._indicatorShowType&&t===this.rowHeaderLevelCount-1&&e>=this.columnHeaderLevelCount}isIndicatorHeader(t,e){return this.isColumnIndicatorHeader(t,e)||this.isRowIndicatorHeader(t,e)}getColumnHeaderRange(){return{start:{col:this.rowHeaderLevelCount,row:0},end:{col:this.colCount-1,row:this.columnHeaderLevelCount-1}}}getRowHeaderRange(){return{start:{col:0,row:this.columnHeaderLevelCount},end:{col:this.rowHeaderLevelCount-1,row:this.rowCount-1}}}getCornerHeaderRange(){return{start:{col:0,row:0},end:{col:this.rowHeaderLevelCount-1,row:this.columnHeaderLevelCount-1}}}getBodyRange(){return{start:{col:this.rowHeaderLevelCount,row:this.columnHeaderLevelCount},end:{col:this.colCount-1,row:this.rowCount-1}}}resetCellIds(){}get headerLevelCount(){return this.columnHeaderLevelCount}get columnHeaderLevelCount(){const t=this.colShowAttrs.length;return this.showColumnHeader?t:0}get rowHeaderLevelCount(){const t=this.rowShowAttrs.length;return this.showRowHeader?t:0}get colCount(){return this._colCount}get rowCount(){return this._rowCount}get bodyRowCount(){return this._bodyRowCount}get headerObjects(){return this._headerObjects}get columnObjects(){return this._indicatorObjects}getCellId(t,e){if(e>=0&&t>=0)if(this.isCornerHeader(t,e)){if("column"===this.cornerSetting.titleOnDimension)return this.colShowAttrs[e];if("row"===this.cornerSetting.titleOnDimension)return this.rowShowAttrs[t]}else{if(this.isColumnHeader(t,e))return e<this.columns.length?this.convertColKeys[e][this.indicatorsAsCol?Math.floor((t-this.rowHeaderLevelCount)/this.indicators.length):t-this.rowHeaderLevelCount]:this.indicators[(t-this.rowHeaderLevelCount)%this.indicators.length];if(this.isRowHeader(t,e))return t<this.rows.length?this.rowKeysPath[this.indicatorsAsCol?e-this.columnHeaderLevelCount:Math.floor((e-this.columnHeaderLevelCount)/this.indicators.length)][t]:this.indicators[(e-this.columnHeaderLevelCount)%this.indicators.length]}return 0}getIndicatorName(t,e){if(this.isHeader(t,e))return"";if(this.indicatorsAsCol){const e=t-this.rowHeaderLevelCount;return this.indicators[e%this.indicators.length]}const n=e-this.columnHeaderLevelCount;return this.indicators[n%this.indicators.length]}getHeader(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]}getHeaderField(t,e){const n=this.getCellId(t,e);return this._headerObjectMap[n]?.field||this.getBody(t,e)?.field}getHeaderFieldKey(t,e){}getHeaderCellAdress(t){}getHeaderCellAddressByField(t){throw new Error(`Method not implemented.${t}`)}getBody(t,e){let n;return n=this.indicatorsAsCol?this.getIndicatorInfo(this?.indicators?.[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)]):this.getIndicatorInfo(this?.indicators?.[(e-this.columnHeaderLevelCount)%(this.indicators?.length??0)]),{id:0,indicatorKey:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],field:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],columnType:n?.columnType??"text",style:n?.style,define:{field:this.indicators[(t-this.rowHeaderLevelCount)%(this.indicators?.length??0)],headerType:"text",columnType:n?.columnType??"text"}}}getBodyLayoutRangeById(t){for(let e=0;e<(this.colCount??0);e++)if(t===this.columnObjects[e].id)return{start:{col:e,row:0},end:{col:e,row:0}};throw new Error(`can not found body layout @id=${t}`)}getCellRange(t,e){const n={start:{col:t,row:e},end:{col:t,row:e}};if(!this.isHeader(t,e)||-1===t||-1===e||this.isIndicatorHeader(t,e))return n;const i=this.getCellId(t,e);for(let r=t-1;r>=0&&i===this.getCellId(r,e);r--)n.start.col=r;for(let r=t+1;r<(this.colCount??0)&&i===this.getCellId(r,e);r++)n.end.col=r;for(let r=e-1;r>=0&&i===this.getCellId(t,r);r--)n.start.row=r;for(let r=e+1;r<(this.rowCount??0)&&i===this.getCellId(t,r);r++)n.end.row=r;return n}isCellRangeEqual(t,e,n,i){const r=this.getCellRange(t,e),o=this.getCellRange(n,i);return r.start.col===o.start.col&&r.end.col===o.end.col&&r.start.row===o.start.row&&r.end.row===o.end.row}getRecordIndexByRow(t){return t<this.columnHeaderLevelCount?-1:this.indicatorsAsCol?t-this.columnHeaderLevelCount:Math.floor((t-this.columnHeaderLevelCount)/this.indicators.length)}getRecordIndexByCol(t){return t<this.rowHeaderLevelCount?-1:this.indicatorsAsCol?Math.floor((t-this.rowHeaderLevelCount)/this.indicators.length):t-this.rowHeaderLevelCount}getRecordStartRowByRecordIndex(t){return this.columnHeaderLevelCount+t}getCellHeaderPaths(t,e){const n=this.getRecordIndexByCol(t),i=this.getRecordIndexByRow(e);let r,o,a,s;return n>=0&&(r=this.colKeysPath[n],a=r?.[r.length-1]?.split(this.dataset.stringJoinChar),e<this.columns.length-1&&(a=a.slice(0,e+1))),i>=0&&(o=this.rowKeysPath[i],s=o?.[o.length-1]?.split(this.dataset.stringJoinChar),t<this.rows.length-1&&(s=s.slice(0,t+1))),{colHeaderPaths:a.map((t=>{const e=this._indicatorObjects.find((t=>{t.indicatorKey}));return{dimensionKey:e?void 0:t,indicatorKey:e?t:void 0,value:t}}))??[],rowHeaderPaths:s.map((t=>{const e=this._indicatorObjects.find((t=>{t.indicatorKey}));return{dimensionKey:e?void 0:t,indicatorKey:e?t:void 0,value:t}}))??[]}}getHeaderDimension(t,e){if(this.isHeader(t,e)){const n=this.getHeader(t,e);return this.rowsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))??this.columnsDefine?.find((t=>"string"!=typeof t&&t.dimensionKey===n.field))}}updateDataset(t){this.dataset=t,this.dataConfig=t.dataConfig,this.rowKeysPath=t.rowKeysPath,this.colKeysPath=t.colKeysPath,this.convertColKeys=b(this.colKeysPath),this.tree=t.tree,this.initState()}isHeaderForColWidth(t,e){return this.isHeader(t,e)}getHeaderForColWidth(t,e){return this.getHeader(t,e)}}class hP{dataConfig;records;tree={};colFlatKeys={};rowFlatKeys={};stringJoinChar=String.fromCharCode(0);rowsIsTotal=[];colsIsTotal=[];colGrandTotalLabel;colSubTotalLabel;rowGrandTotalLabel;rowSubTotalLabel;constructor(t,e){if(this.dataConfig=t,e){this.records=e;const t="undefined"!=typeof window?window.performance.now():0;this.setRecords(e);const n="undefined"!=typeof window?window.performance.now():0;console.log("processRecords:",n-t)}delete this.rowFlatKeys,delete this.colFlatKeys}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const e=this.records[t];this.processRecord(e)}}processRecord(t){const e=[],n=[];for(let e=0,i=this.dataConfig.rows.length;e<i;e++){const i=this.dataConfig.rows[e];void 0!==t[i]&&i!==this.dataConfig.indicatorDimensionKey&&n.push(t[i])}for(let n=0,i=this.dataConfig.columns.length;n<i;n++){const i=this.dataConfig.columns[n];void 0!==t[i]&&i!==this.dataConfig.indicatorDimensionKey&&e.push(t[i])}this.dataConfig.indicators.forEach((i=>{const r=t[i];void 0!==r&&(this.dataConfig.indicatorsAsCol?e.push(i):n.push(i));const o=n.join(this.stringJoinChar),a=e.join(this.stringJoinChar);0!==n.length&&(this.rowFlatKeys[o]||(this.rowFlatKeys[o]=1)),0!==e.length&&(this.colFlatKeys[a]||(this.colFlatKeys[a]=1)),0===e.length&&0===n.length||(this.tree[o]||(this.tree[o]={}),void 0!==r&&(this.tree[o][a]={value:r,record:t},this.dataConfig.indicatorsAsCol?e.pop():n.pop()))}))}getTreeNode(t=[],e=[],n){let i,r;if("string"==typeof t)i=t;else{let e=!1;t.map(((i,r)=>{i===n&&(t.splice(r,1),e=!0)})),e&&t.push(n),i=t.join(this.stringJoinChar)}if("string"==typeof e)r=e;else{let t=!1;e.map(((i,r)=>{i===n&&(e.splice(r,1),t=!0)})),t&&e.push(n),r=e.join(this.stringJoinChar)}return this.tree?.[i]?.[r]??void 0}}class cP{dataConfig;records;tree={};colFlatKeys={};rowFlatKeys={};colKeys=[];rowKeys=[];rowKeysPath;colKeysPath;rowOrder="key_a_to_z";colOrder="key_a_to_z";sorted=!1;sortRules;filterRules;aggregationRules;derivedFieldRules;mappingRules;totals;indicatorStatistics=[];aggregators={};stringJoinChar=String.fromCharCode(0);rowsIsTotal=[];colsIsTotal=[];colGrandTotalLabel;colSubTotalLabel;rowGrandTotalLabel;rowSubTotalLabel;rows;columns;indicators;constructor(t,e,n,i,r){this.registerAggregators(),this.dataConfig=t,this.sortRules=this.dataConfig.sortRules,this.aggregationRules=this.dataConfig.aggregationRules,this.derivedFieldRules=this.dataConfig.derivedFieldRules,this.mappingRules=this.dataConfig.mappingRules,this.totals=t.totals,this.rows=e,this.columns=n,this.indicators=i,this.colGrandTotalLabel=this.totals?.column?.grandTotalLabel??"总计",this.colSubTotalLabel=this.totals?.column?.subTotalLabel??"小计",this.rowGrandTotalLabel=this.totals?.row?.grandTotalLabel??"总计",this.rowSubTotalLabel=this.totals?.row?.subTotalLabel??"小计",this.rowsIsTotal=new Array(this.rows.length).fill(!1),this.colsIsTotal=new Array(this.columns.length).fill(!1);for(let t=0,e=this.totals?.row?.subTotalsDimensions?.length;t<e;t++){const e=this.totals.row.subTotalsDimensions[t],n=this.rows.indexOf(e);this.rowsIsTotal[n]=!0}for(let t=0,e=this.totals?.column?.subTotalsDimensions?.length;t<e;t++){const e=this.totals.column.subTotalsDimensions[t],n=this.columns.indexOf(e);this.colsIsTotal[n]=!0}if(r){this.records=r;const t="undefined"!=typeof window?window.performance.now():0;this.setRecords(r);const e="undefined"!=typeof window?window.performance.now():0;console.log("processRecords:",e-t);const n="undefined"!=typeof window?window.performance.now():0;this.totalStatistics();const i="undefined"!=typeof window?window.performance.now():0;console.log("totalStatistics:",i-n);const o="undefined"!=typeof window?window.performance.now():0;this.sortKeys();const a="undefined"!=typeof window?window.performance.now():0;console.log("sortKeys:",a-o);const s="undefined"!=typeof window?window.performance.now():0;this.rowKeysPath=this.TreeToArr(this.ArrToTree(this.rowKeys,this.rowsIsTotal,this?.totals?.row?.showGrandTotals||0===this.columns.length,this.rowGrandTotalLabel,this.rowSubTotalLabel)),this.colKeysPath=this.TreeToArr(this.ArrToTree(this.colKeys,this.colsIsTotal,this.totals?.column?.showGrandTotals||0===this.rows.length,this.colGrandTotalLabel,this.colSubTotalLabel));const l="undefined"!=typeof window?window.performance.now():0;console.log("TreeToArr:",l-s)}delete this.rowFlatKeys,delete this.colFlatKeys}registerAggregator(t,e){this.aggregators[t]=e}registerAggregators(){this.registerAggregator(i.SUM,fP),this.registerAggregator(i.COUNT,pP),this.registerAggregator(i.MAX,gP),this.registerAggregator(i.MIN,yP),this.registerAggregator(i.AVG,vP)}setRecords(t){this.processRecords()}processRecords(){for(let t=0,e=this.records.length;t<e;t++){const e=this.records[t];this.filterRecord(e)&&this.processRecord(e)}}filterRecord(t){let e=!0;for(let n=0;n<this.dataConfig.filterRules?.length;n++){const i=this.dataConfig.filterRules[n];if(!i.filterFunc?.(t)){e=!1;break}}return e}processRecord(t){this.derivedFieldRules?.forEach(((e,n)=>{t[e.fieldName]=e.derivedFunc(t)}));const e=[],n=[];for(let e=0,i=this.rows.length;e<i;e++){const i=this.rows[e];n.push(t[i])}for(let n=0,i=this.columns.length;n<i;n++){const i=this.columns[n];e.push(t[i])}const r=n.join(this.stringJoinChar),o=e.join(this.stringJoinChar);if(0!==n.length&&(this.rowFlatKeys[r]||(this.rowKeys.push(n),this.rowFlatKeys[r]=1)),0!==e.length&&(this.colFlatKeys[o]||(this.colKeys.push(e),this.colFlatKeys[o]=1)),0!==e.length||0!==n.length){this.tree[r]||(this.tree[r]={}),this.tree[r]?.[o]||(this.tree[r][o]=[]);for(let e=0;e<this.indicators.length;e++){if(!this.tree[r]?.[o]?.[e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[r][o][e]=new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[r]?.[o]?.[e].push(t)}}if(this.mappingRules)for(let e=0;e<this.indicators.length;e++){if(!this.indicatorStatistics[e]){const t=this.getAggregatorRule(this.indicators[e]);this.indicatorStatistics[e]={max:new this.aggregators[i.MAX](this.indicators[e]),min:new this.aggregators[i.MIN](this.indicators[e]),total:new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[e],t?.formatFun)}}this.indicatorStatistics[e].max.push(this.tree[r]?.[o]?.[e].value()),this.indicatorStatistics[e].min.push(this.tree[r]?.[o]?.[e].value()),this.indicatorStatistics[e].total.push(t)}}updateSortRules(t){this.sorted=!1,this.sortRules=t,this.sortKeys(),this.rowKeysPath=this.TreeToArr(this.ArrToTree(this.rowKeys,this.rowsIsTotal,this?.totals?.row?.showGrandTotals||0===this.columns.length,this.rowGrandTotalLabel,this.rowSubTotalLabel)),this.colKeysPath=this.TreeToArr(this.ArrToTree(this.colKeys,this.colsIsTotal,this.totals?.column?.showGrandTotals||0===this.rows.length,this.colGrandTotalLabel,this.colSubTotalLabel))}getAggregatorRule(t){return this.aggregationRules?.find(((e,n)=>t===e.indicatorKey))}getAggregator(t=[],e=[],n){const i=this.indicators.indexOf(n);let r,o,a;return o="string"==typeof t?t:t.join(this.stringJoinChar),a="string"==typeof e?e:e.join(this.stringJoinChar),0===t.length&&0===e.length||(r=this.tree[o]?.[a]?.[i]),r||{className:"",push(){},value:()=>null,formatValue:()=>""}}sortKeys(){const t=this;if(!this.sorted){this.sorted=!0;const e=function(e,n){return t.getAggregator(e,n,"").value()};switch(this.rowOrder){case"value_a_to_z":this.rowKeys.sort((function(t,n){return bP(e(t,[]),e(n,[]))}));break;case"value_z_to_a":this.rowKeys.sort((function(t,n){return-bP(e(t,[]),e(n,[]))}));break;default:this.rowKeys.sort(this.arrSort(this.rows,!0))}switch(this.colOrder){case"value_a_to_z":this.colKeys.sort((function(t,n){return bP(e([],t),e([],n))}));break;case"value_z_to_a":this.colKeys.sort((function(t,n){return-bP(e([],t),e([],n))}));break;default:const t=this.arrSort(this.columns,!1);this.colKeys.sort(t)}}}arrSort(t,e){let n;const i=this,o=function(r){const o=[];for(let r=0,a=t.length;r<a;r++){n=t[r];let a=!1;if(i.sortRules)for(let t=0,s=i.sortRules.length;t<s;t++)i.sortRules[t].sortField===n&&(a=!0,o.push({field:n,fieldIndex:r,sortRule:i.sortRules[t],func:i.getSort(i.sortRules[t],e)}));a||o.push({field:n,fieldIndex:r,func:bP})}return o}.call(this);return function(n,a){let s,l;for(let u=0;u<o.length;u++){if(l=o[u],l.sortRule?.sortByIndicator){let r=n,o=a;l.fieldIndex<t.length-1&&(r=n.slice(0,l.fieldIndex+1),r.push(e?i.totals?.row?.subTotalLabel:i.totals?.column?.subTotalLabel),o=a.slice(0,l.fieldIndex+1),o.push(e?i.totals?.row?.subTotalLabel:i.totals?.column?.subTotalLabel)),s=l.func(r,o)}else s=l.func(n[l.fieldIndex],a[l.fieldIndex]);if(0!==s)return s*(l.sortRule?.sortType===r.DESC?-1:1)}return 0}}getSort(t,e){const n=this;return t.sortByIndicator?(i,r)=>{const o=function(e,i){return e.length<n.rows.length&&e[e.length-1]!==n.rowSubTotalLabel&&e[e.length-1]!==n.rowGrandTotalLabel&&e.push(n.rowSubTotalLabel),i.length<n.columns.length&&i[i.length-1]!==n.colSubTotalLabel&&i[i.length-1]!==n.colGrandTotalLabel&&i.push(n.colSubTotalLabel),n.getAggregator(e,i,t.sortByIndicator).value()};return e?bP(o(i,t.query),o(r,t.query)):bP(o(t.query,i),o(t.query,r))}:t.sortBy?function(t){let e;const n={},i={};for(let r=0;r<t.length;r++)e=t[r],n[e]=r,"string"==typeof e&&(i[e.toLowerCase()]=r);return function(t,e){return null!==n[t]&&void 0!==n[t]&&null!==n[e]&&void 0!==n[e]?n[t]-n[e]:null!==n[t]&&void 0!==n[t]?-1:null!==n[e]&&void 0!==n[e]?1:null!==i[t]&&void 0!==n[t]&&null!==i[e]&&void 0!==n[e]?i[t]-i[e]:null===i[t]||void 0===n[t]||null===i[e]||void 0===n[e]?0:null!==i[t]&&void 0!==n[t]?-1:null!==i[e]&&void 0!==n[e]?1:bP(t,e)}}(t.sortBy):t.sortType?mP:t.sortFunc?t.sortFunc:bP}totalStatistics(){const t=this;if(t?.totals?.column?.showSubTotals&&t?.totals?.column?.subTotalsDimensions?.length>=1||t?.totals?.row?.showSubTotals&&t?.totals?.row?.subTotalsDimensions?.length>=1||t?.totals?.column?.showGrandTotals||t?.totals?.row?.showGrandTotals||0===t.rows.length||0===t.columns.length){const e=[],n=(e,n)=>{const r=n.split(this.stringJoinChar);for(let o=0,a=t.totals?.column?.subTotalsDimensions?.length;o<a;o++){const a=t.totals.column.subTotalsDimensions[o],s=t.columns.indexOf(a);if(s>=0){const o=r.slice(0,s+1);o.push(t.totals?.column?.subTotalLabel??"小计");const a=o.join(this.stringJoinChar);this.tree[e][a]||(this.tree[e][a]=[]);for(let r=0;r<this.indicators.length;r++){if(!this.tree[e][a][r]){const t=this.getAggregatorRule(this.indicators[r]);this.tree[e][a][r]=new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[r],t?.formatFun)}this.tree[e][a][r].push(t.tree[e]?.[n]?.[r])}}}if(t.totals?.column?.showGrandTotals||0===this.rows.length){const r=t.colGrandTotalLabel;this.tree[e][r]||(this.tree[e][r]=[]);for(let o=0;o<this.indicators.length;o++){if(!this.tree[e][r][o]){const t=this.getAggregatorRule(this.indicators[o]);this.tree[e][r][o]=new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[o],t?.formatFun)}this.tree[e][r][o].push(t.tree[e]?.[n]?.[o])}}};Object.keys(t.tree).forEach((r=>{const o=r.split(this.stringJoinChar);Object.keys(t.tree[r]).forEach((a=>{for(let s=0,l=t.totals?.row?.subTotalsDimensions?.length;s<l;s++){const l=t.totals.row.subTotalsDimensions[s],u=t.rows.indexOf(l);if(u>=0){const n=o.slice(0,u+1);n.push(t.totals?.row?.subTotalLabel??"小计");const s=n.join(this.stringJoinChar);if(this.tree[s]||(this.tree[s]={},e.push(s)),!this.tree[s][a]){this.tree[s][a]=[];for(let e=0;e<this.indicators.length;e++){if(!this.tree[s][a][e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[s][a][e]=new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[s][a][e].push(t.tree[r]?.[a]?.[e])}}}if(t.totals?.row?.showGrandTotals||0===this.columns.length){const n=t.rowGrandTotalLabel;this.tree[n]||(this.tree[n]={},e.push(n)),this.tree[n][a]||(this.tree[n][a]=[]);for(let e=0;e<this.indicators.length;e++){if(!this.tree[n][a][e]){const t=this.getAggregatorRule(this.indicators[e]);this.tree[n][a][e]=new this.aggregators[t?.aggregationType??i.SUM](t?.field??this.indicators[e],t?.formatFun)}this.tree[n][a][e].push(t.tree[r]?.[a]?.[e])}}n(r,a)}}))})),e.forEach((e=>{Object.keys(t.tree[e]).forEach((t=>{n(e,t)}))}))}}ArrToTree(t,e,n,i,r){const o=[],a=this.stringJoinChar,s=new Map;if(t.forEach((t=>function(t){const n=[];let i;t.forEach(((l,u)=>{n.push(l);const h=n.join(a);let c=s.get(h);if(!c){if(c={id:h,child:[]},e[u]){let e=c.child;for(let n=u;n<t.length-1;n++){const t={id:`${h}${a}${r}`,child:[]};e.push(t),e=t.child}}s.set(h,c),i?e[u-1]?i.child.splice(i.child.length-1,0,c):i.child.push(c):o.push(c)}i=c}))}(t))),n){const t={id:i,child:[]};let n=t.child;for(let t=1;t<e.length;t++){const t={id:i,child:[]};n.push(t),n=t.child}o.push(t)}return o}TreeToArr(t){const e=[];function n(t,i){i.push(t.id),t.child.length>0?t.child?.forEach((t=>n(t,[...i]))):e.push(i)}return t.forEach((t=>n(t,[]))),e}}class dP{className="Aggregator";isRecord=!0;records=[];type;field;formatFun;_formatedValue;constructor(t,e,n){this.field=t,this.formatFun=e,this.isRecord=n??this.isRecord}formatValue(){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value()):this._formatedValue=this.value()),this._formatedValue}}class fP extends dP{type=i.SUM;sum=0;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.sum+=t.value():isNaN(parseFloat(t[this.field]))||(this.sum+=parseFloat(t[this.field]))}value(){return this.sum}}class pP extends dP{type=i.COUNT;count=0;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++}value(){return this.count}}class vP extends dP{type=i.AVG;sum=0;count=0;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===i.AVG?(this.sum+=t.sum,this.count+=t.count):isNaN(parseFloat(t[this.field]))||(this.sum+=parseFloat(t[this.field]),this.count++)}value(){return this.sum/this.count}}class gP extends dP{type=i.MAX;max=Number.MIN_SAFE_INTEGER;isRecord=!1;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"number"==typeof t?this.max=t>this.max?t:this.max:"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:isNaN(t[this.field])||(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)}value(){return this.max}}class yP extends dP{type=i.MIN;min=Number.MAX_SAFE_INTEGER;isRecord=!1;push(t){this.isRecord&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"number"==typeof t?this.min=t<this.min?t:this.min:"number"==typeof t[this.field]&&(this.min=t[this.field]<this.min?t[this.field]:this.min)}value(){return this.min}}function mP(t,e){return t&&e?t.toString().localeCompare(e.toString(),"zh"):t?1:-1}function bP(t,e){const n=/(\d+)|(\D+)/g,i=/\d/,r=/^0/;let o,a,s,l,u=0,h=0;if(null!==e&&null===t)return-1;if(null!==t&&null===e)return 1;if("number"==typeof t&&isNaN(t))return-1;if("number"==typeof e&&isNaN(e))return 1;if(u=+t,h=+e,u<h)return-1;if(u>h)return 1;if("number"==typeof t&&"number"!=typeof e)return-1;if("number"==typeof e&&"number"!=typeof t)return 1;if("number"==typeof t&&"number"==typeof e)return 0;if(isNaN(h)&&!isNaN(u))return-1;if(isNaN(u)&&!isNaN(h))return 1;if(o=String(t),s=String(e),o===s)return 0;if(!i.test(o)||!i.test(s))return o>s?1:-1;for(o=o.match(n),s=s.match(n);o.length&&s.length;)if(a=o.shift(),l=s.shift(),a!==l)return i.test(a)&&i.test(l)?a.replace(r,".0")-l.replace(r,".0"):a>l?1:-1;return o.length-s.length}function wP(t){return null===t?"null":Ht(t)}function xP(t){return!!t&&"object"==Ht(t)}function CP(t){if(void 0===t)return"";if(null===t)return"Object";if("object"==Ht(t)&&!t.constructor)return"Object";var e=/function ([^(]*)/.exec(t.constructor.toString());return e&&e.length>1?e[1]:""}function _P(t,e,n){return"null"===t||"undefined"===t?t:("string"!==t&&"stringifiable"!==t||(n='"'+n.replace(/"/g,'\\"')+'"'),"function"===t?e.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":n)}function kP(t){var e="";return xP(t)?(e=CP(t),Array.isArray(t)&&(e+="["+t.length+"]")):e=_P(wP(t),t,t),e}function SP(t){return"json-formatter-"+t}function AP(t,e,n){var i=document.createElement(t);return e&&i.classList.add(SP(e)),void 0!==n&&(n instanceof Node?i.appendChild(n):i.appendChild(document.createTextNode(String(n)))),i}!function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");e.setAttribute("media","screen"),e.innerHTML=t,document.head.appendChild(e)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var BP=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,RP=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,TP=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,MP=window.requestAnimationFrame||function(t){return t(),0},PP={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null},OP=function(){function t(t,e,n,i){void 0===e&&(e=1),void 0===n&&(n=PP),this.json=t,this.open=e,this.config=n,this.key=i,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=PP.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=PP.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=PP.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=PP.useToJSON),""===this.key&&(this.key='""')}return Object.defineProperty(t.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(t){this._isOpen=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(BP.test(this.json)||TP.test(this.json)||RP.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isUrl",{get:function(){return"string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isObject",{get:function(){return xP(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"constructorName",{get:function(){return CP(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":wP(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"keys",{get:function(){if(this.isObject){var t=Object.keys(this.json);return!this.isArray&&this.config.sortPropertiesBy?t.sort(this.config.sortPropertiesBy):t}return[]},enumerable:!0,configurable:!0}),t.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(SP("open")))},t.prototype.openAtDepth=function(t){void 0===t&&(t=1),t<0||(this.open=t,this.isOpen=0!==t,this.element&&(this.removeChildren(!1),0===t?this.element.classList.remove(SP("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(SP("open")))))},t.prototype.getInlinepreview=function(){var t=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(kP).join(", ")+"]";var e=this.keys,n=e.slice(0,this.config.hoverPreviewFieldCount).map((function(e){return e+":"+kP(t.json[e])})),i=e.length>=this.config.hoverPreviewFieldCount?"…":"";return"{"+n.join(", ")+i+"}"},t.prototype.render=function(){this.element=AP("div","row");var t=this.isObject?AP("a","toggler-link"):AP("span");if(this.isObject&&!this.useToJSON&&t.appendChild(AP("span","toggler")),this.hasKey&&t.appendChild(AP("span","key",this.key+":")),this.isObject&&!this.useToJSON){var e=AP("span","value"),n=AP("span"),i=AP("span","constructor-name",this.constructorName);if(n.appendChild(i),this.isArray){var r=AP("span");r.appendChild(AP("span","bracket","[")),r.appendChild(AP("span","number",this.json.length)),r.appendChild(AP("span","bracket","]")),n.appendChild(r)}e.appendChild(n),t.appendChild(e)}else{(e=this.isUrl?AP("a"):AP("span")).classList.add(SP(this.type)),this.isDate&&e.classList.add(SP("date")),this.isUrl&&(e.classList.add(SP("url")),e.setAttribute("href",this.json));var o=_P(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);e.appendChild(document.createTextNode(o)),t.appendChild(e)}if(this.isObject&&this.config.hoverPreviewEnabled){var a=AP("span","preview-text");a.appendChild(document.createTextNode(this.getInlinepreview())),t.appendChild(a)}var s=AP("div","children");return this.isObject&&s.classList.add(SP("object")),this.isArray&&s.classList.add(SP("array")),this.isEmpty&&s.classList.add(SP("empty")),this.config&&this.config.theme&&this.element.classList.add(SP(this.config.theme)),this.isOpen&&this.element.classList.add(SP("open")),this.element.appendChild(t),this.element.appendChild(s),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&t.addEventListener("click",this.toggleOpen.bind(this)),this.element},t.prototype.appendChildren=function(e){var n=this;void 0===e&&(e=!1);var i=this.element.querySelector("div."+SP("children"));if(i&&!this.isEmpty)if(e){var r=0;MP((function e(){var o=n.keys[r],a=new t(n.json[o],n.open-1,n.config,o);i.appendChild(a.render()),(r+=1)<n.keys.length&&(r>10?e():MP(e))}))}else this.keys.forEach((function(e){var r=new t(n.json[e],n.open-1,n.config,e);i.appendChild(r.render())}))},t.prototype.removeChildren=function(t){void 0===t&&(t=!1);var e=this.element.querySelector("div."+SP("children"));if(t){var n=0;MP((function t(){e&&e.children.length&&(e.removeChild(e.children[0]),(n+=1)>10?t():MP(t))}))}else e&&(e.innerHTML="")},t}();class EP{_stage;_infoContainer;_highlightRect;_target;_rect;_mode="hover";_customGrapicKeys;_modeTip;_callback;constructor(t,e){this._stage=t,this._callback={},e?.customGrapicKeys&&(this._customGrapicKeys=e.customGrapicKeys),e?.container?this._infoContainer=e.container:this.createInfoContainer(e),this.createHighlightRect(),this.bindStageEvent(),this.bindKeyEvent()}createInfoContainer(t){const e=t?.infoPosition||"tr",n=t?.infoWidth||300,i=t?.infoPosition||400;switch(this._infoContainer=document.createElement("div"),this._infoContainer.style.position="fixed",this._infoContainer.style.width=`${n}px`,this._infoContainer.style.height=`${i}px`,this._infoContainer.style.backgroundColor="rgba(210, 210, 210, 0.3)",this._infoContainer.style.overflow="auto",this._infoContainer.style.display="none",e){case"tl":this._infoContainer.style.top="0px",this._infoContainer.style.left="0px";break;case"tr":this._infoContainer.style.top="0px",this._infoContainer.style.right="0px";break;case"bl":this._infoContainer.style.bottom="0px",this._infoContainer.style.left="0px";break;case"br":this._infoContainer.style.bottom="0px",this._infoContainer.style.right="0px"}const r=document.createElement("div"),o=document.createElement("span");o.innerText="debug 模式:",r.appendChild(o),this._modeTip=document.createElement("span"),this._modeTip.innerText=this._mode,r.appendChild(this._modeTip);const a=document.createElement("span");a.innerText="(shift + s改变模式;shift + d控制台输出target graphic)",r.appendChild(a),this._infoContainer.appendChild(r),this._stage.window.getContainer().append(this._infoContainer)}createHighlightRect(){const t=this._stage.window.getContainer();this._highlightRect=document.createElement("div"),this._highlightRect.style.display="absolute",this._highlightRect.style.border="1px solid red",this._highlightRect.style.pointerEvents="none",this._highlightRect.style.position="absolute",t.appendChild(this._highlightRect)}bindStageEvent(){this._rect=Fv({x:0,y:0,width:0,height:0,fill:!1,stroke:!0,strokeColor:"red",lineWidth:1,pickable:!1,visible:!1}),this._stage.defaultLayer.appendChild(this._rect),this._callback.pointermove=t=>{"hover"!==this._mode||(t.target&&t.target!==this._target?(this._target=t.target,this.addHighlightBounds(this._target.globalAABBBounds),setTimeout((()=>{this.updateInfo()}),100)):t.target||(this._target=void 0,this.removeHighlightBounds(),this.clearInfo()))},this._stage.addEventListener("pointermove",this._callback.pointermove),this._callback.pointerup=t=>{"click"!==this._mode||(t.target&&t.target!==this._target?(this._target=t.target,this.addHighlightBounds(this._target.globalAABBBounds),setTimeout((()=>{this.updateInfo()}),100)):t.target||(this._target=void 0,this.removeHighlightBounds(),this.clearInfo()))},this._stage.addEventListener("pointerup",this._callback.pointerup),this._callback.pointerleave=t=>{"hover"===this._mode&&(this._target=void 0,this.removeHighlightBounds(),this.clearInfo())},this._stage.addEventListener("pointerleave",this._callback.pointerleave)}addHighlightBounds(t){this._highlightRect.style.left=`${t.x1}px`,this._highlightRect.style.top=`${t.y1}px`,this._highlightRect.style.width=`${t.width()}px`,this._highlightRect.style.height=`${t.height()}px`}removeHighlightBounds(){this._rect.setAttribute("visible",!1),this._stage.renderNextFrame()}updateInfo(){if(!this._target)return;this._infoContainer.children.length>1&&this._infoContainer.removeChild(this._infoContainer.children[1]),this._infoContainer.style.display="block";const t={customKeys:{},type:this._target.type,globalX:this._target.globalTransMatrix.e,globalY:this._target.globalTransMatrix.f,attribute:this._target.attribute,theme:Ml(this._target)[this._target.type],target:this._target};this._customGrapicKeys?this._customGrapicKeys.forEach((e=>{t.customKeys[e]=this._target[e]})):delete t.customKeys;const e=new OP(t,2);this._infoContainer.appendChild(e.render())}clearInfo(){this._infoContainer.style.display="none"}updateMode(){this._modeTip.innerText=this._mode}bindKeyEvent(){this._callback.keydown=t=>{if("D"===t.key)console.log(this._target);else if("S"===t.key){switch(this._mode){case"click":this._mode="hover";break;case"hover":this._mode="click"}this.updateMode()}},window.addEventListener("keydown",this._callback.keydown)}release(){document.body.removeChild(this._infoContainer),this._highlightRect.parentElement.removeChild(this._highlightRect),this._stage.defaultLayer.removeChild(this._rect),this._stage.removeEventListener("pointermove",this._callback.pointermove),this._stage.removeEventListener("pointerup",this._callback.pointerup),this._stage.removeEventListener("pointerleave",this._callback.pointerleave),window.removeEventListener("keydown",this._callback.keydown)}}class HP{type;id;x=0;y=0;width=0;height=0;marginLeft;marginRight;marginTop;marginBottom;layoutWidth;layoutHeight;dx=0;dy=0;background;constructor(t){this.id=t.id,this.marginLeft=t.marginLeft??0,this.marginRight=t.marginRight??0,this.marginTop=t.marginTop??0,this.marginBottom=t.marginBottom??0,this.background=t.background||void 0}getSize(t){this.initLayoutSize()}initLayoutSize(){this.layoutWidth=this.width+this.marginLeft+this.marginRight,this.layoutHeight=this.height+this.marginTop+this.marginBottom,this.background&&(this.layoutWidth+=2*(this.background.expandX||0),this.layoutHeight+=2*(this.background.expandY||0)),this.dx=this.marginLeft,this.dy=this.marginTop}}const LP={row:{x:"x",y:"y",width:"width",height:"height",layoutWidth:"layoutWidth",layoutHeight:"layoutHeight",widthLimit:"widthLimit",heightLimit:"heightLimit",parentX:"parentX",parentY:"parentY",dx:"dx",dy:"dy"},column:{x:"y",y:"x",width:"height",height:"width",layoutWidth:"layoutHeight",layoutHeight:"layoutWidth",widthLimit:"heightLimit",heightLimit:"widthLimit",parentX:"parentY",parentY:"parentX",dx:"dy",dy:"dx"}};class IP{width=0;height=0;y=0;x=0;children=[];addAble=!0;widthLimit=0;heightLimit=0;direction;directionKey;offsetX=0;justifyContent;alignItems;constructor(t,e,n,i){this.direction=e,this.directionKey=LP[this.direction],this.justifyContent=n,this.alignItems=i,this[this.directionKey.widthLimit]=t}add(t){t[this.directionKey.x]=this[this.directionKey.width],this[this.directionKey.width]+=t[this.directionKey.layoutWidth],this.children.push(t),this.updateHeight(t)}canAdd(t){return!(this[this.directionKey.width]+t[this.directionKey.layoutWidth]>this[this.directionKey.widthLimit])}updateHeight(t){t[this.directionKey.layoutHeight]>this[this.directionKey.height]&&(this[this.directionKey.height]=t[this.directionKey.layoutHeight])}lineFinish(){this.updateXAlign()}updateXAlign(){const t=this[this.directionKey.widthLimit]-this[this.directionKey.width];"center"===this.justifyContent?this.offsetX=t/2:"start"===this.justifyContent?this.offsetX=0:this.offsetX=t}getOffsetY(t){switch(this.alignItems){case"start":default:return 0;case"center":return(this[this.directionKey.height]-t[this.directionKey.layoutHeight])/2;case"end":return this[this.directionKey.height]-t[this.directionKey.layoutHeight]}}getContentSize(){const t={width:0,height:0};for(let e=0;e<this.children.length;e++){const n=this.children[e];let i;i="container"===n.type?n.getContentSize():{width:n.layoutWidth,height:n.layoutHeight},t[this.directionKey.height]<i[this.directionKey.height]&&(t[this.directionKey.height]=i[this.directionKey.height]),t[this.directionKey.width]+=i[this.directionKey.width]}return t}getElements(t={parentX:0,parentY:0},e=!1,n=!1){const i=[];for(let r=0;r<this.children.length;r++){const o=this.children[r];if("container"===o.type||"group-element"===o.type){const r=o.getElements({[this.directionKey.parentX]:this.offsetX+this[this.directionKey.x]+t.parentX,[this.directionKey.parentY]:this.getOffsetY(o)+this[this.directionKey.y]+t.parentY},e,n);i.push(...r)}else{if("icon"===o.type&&("mouseenter_cell"===o.cache?.visibleTime&&!e||"click_cell"===o.cache?.visibleTime&&!n))continue;o[this.directionKey.x]+=this.offsetX+this[this.directionKey.x]+t.parentX,o[this.directionKey.y]+=this.getOffsetY(o)+this[this.directionKey.y]+t.parentY,i.push(o)}}return i}}class DP extends HP{type="rect";lineWidth;borderRadius;radius;fillColor;strokeColor;constructor(t){super(t),this.width=t.width,this.height=t.height,this.lineWidth=t.lineWidth||0,this.borderRadius=t.borderRadius||0,this.radius=this.borderRadius,this.fillColor=t.fillColor||"#777",this.strokeColor=t.strokeColor||void 0,this.initLayoutSize()}}var jP=Object.freeze({__proto__:null,Circle:class extends HP{type="circle";radius;radian;lineWidth;fillColor;strokeColor;constructor(t){super(t),this.radius=t.radius,this.radian=t.radian,this.lineWidth=t.lineWidth,this.fillColor=t.fillColor,this.strokeColor=t.strokeColor,this.width=2*this.radius,this.height=2*this.radius,this.initLayoutSize(),this.dx+=this.radius,this.dy+=this.radius}},Container:class extends HP{type="container";_widthObj;_heightObj;needCalcSize=!1;direction;justifyContent;alignItems;alignContent;lines=[];currentLine;currentLineY=0;table;directionKey;showBounds;offsetY=0;isRoot;constructor(t){super(t),this.direction=t.direction||"row",this.justifyContent=t.justifyContent||"start",this.alignItems=t.alignItems||"start",this.alignContent=t.alignContent||"start",f(t.width)?this.width=t.width:(this._widthObj=t.width,this.needCalcSize=!0),f(t.height)?this.height=t.height:(this._heightObj=t.height,this.needCalcSize=!0),this.directionKey=LP[this.direction],this.showBounds=t.showBounds||!1,this.initLayoutSize()}add(t){if(this.needCalcSize)throw new Error("Need to specify a parent element before adding a child element when use percent size!");"container"===t.type&&t.calcSize(this.width,this.height),this.currentLine&&this.currentLine.canAdd(t)?this.currentLine.add(t):(this.currentLine&&(this.currentLine.addAble=!1,this.currentLineY+=this.currentLine[this.directionKey.height],this.currentLine.lineFinish()),this.currentLine=new IP(this[this.directionKey.width],this.direction,this.justifyContent,this.alignItems),this.currentLine[this.directionKey.y]=this.currentLineY,this.currentLine.add(t),this.lines.push(this.currentLine))}updateYAlign(){const t=this[this.directionKey.height]-this.currentLineY;"center"===this.alignContent?this.offsetY=t/2:"start"===this.alignContent?this.offsetY=0:this.offsetY=t}getSize(){const t={width:0,height:0};this.currentLine&&this.currentLine.addAble?t[this.directionKey.height]=this.currentLineY+this.currentLine[this.directionKey.height]:t[this.directionKey.height]=this.currentLineY;for(let e=0;e<this.lines.length;e++){const n=this.lines[e];t[this.directionKey.width]<n[this.directionKey.width]&&(t[this.directionKey.width]=n[this.directionKey.width])}return t}getContentSize(){const t={width:0,height:0},e={width:!0,height:!0};this.isRoot||this._heightObj||(e.height=!1,t.height=this.height),this.isRoot||this._widthObj||(e.width=!1,t.width=this.width);for(let n=0;n<this.lines.length;n++){const i=this.lines[n].getContentSize();e[this.directionKey.width]&&t[this.directionKey.width]<i[this.directionKey.width]&&(t[this.directionKey.width]=i[this.directionKey.width]),e[this.directionKey.height]&&(t[this.directionKey.height]+=i[this.directionKey.height])}return t}calcSize(t,e){this._heightObj&&(this.height=e*this._heightObj.percent/100+this._heightObj.delta,this.needCalcSize=!1,this.initLayoutSize()),this._widthObj&&(this.width=t*this._widthObj.percent/100+this._widthObj.delta,this.needCalcSize=!1,this.initLayoutSize())}getElements(t={parentX:0,parentY:0},e=!1,n=!1){this.currentLine&&this.currentLine.addAble&&(this.currentLine.addAble=!1,this.currentLineY+=this.currentLine[this.directionKey.height],this.currentLine.lineFinish()),this.updateYAlign();const i=[];if(this.showBounds){const e=new DP({width:this.width,height:this.height,borderRadius:0,strokeColor:"red",fillColor:"rgba(255, 0, 0, 0.2)",lineWidth:4});e.x+=this.x+t.parentX,e.y+=this.y+t.parentY,i.push(e)}for(let r=0;r<this.lines.length;r++){const o=this.lines[r];o[this.directionKey.y]+=this.offsetY;const a=o.getElements({[this.directionKey.parentX]:this.x+t.parentX,[this.directionKey.parentY]:this.y+t.parentY},e,n);i.push(...a)}return i}},GroupElement:class extends HP{type="group-element";direction;alignItems;width=0;height=0;children=[];directionKey;constructor(t){super(t),this.direction=t.direction||"row",this.alignItems=t.alignItems||"start",this.directionKey=LP[this.direction]}add(t){t.x=this.width,this.width+=t.layoutWidth,this.children.push(t),this.updateHeight(t),this.initLayoutSize()}updateHeight(t){t.layoutHeight>this.height&&(this.height=t.layoutHeight)}getOffsetY(t){switch(this.alignItems){case"start":default:return 0;case"center":return(this[this.directionKey.height]-t[this.directionKey.layoutHeight])/2;case"end":return this[this.directionKey.height]-t[this.directionKey.layoutHeight]}}getElements(t={parentX:0,parentY:0},e=!1,n=!1){const i=[];for(let r=0;r<this.children.length;r++){const o=this.children[r];"icon"===o.type&&("mouseenter_cell"===o.cache?.visibleTime&&!e||"click_cell"===o.cache?.visibleTime&&!n)||(o[this.directionKey.x]+=this[this.directionKey.dx]+this[this.directionKey.x]+t.parentX,o[this.directionKey.y]+=this.getOffsetY(o)+this[this.directionKey.dy]+this[this.directionKey.y]+t.parentY,i.push(o))}return i}},Icon:class extends HP{type="icon";svg;iconName;cursor;cache;constructor(t){if(super(t),this.iconName=t.iconName,d(this.iconName)){const t=F_()[this.iconName];t&&(this.cache=t,this.width=t.width,this.height=t.height,this.svg=t.svg,this.cursor=t.cursor)}this.width=t.width??this.width,this.height=t.height??this.height,this.svg=t.svg??this.svg,this.initLayoutSize()}},Image:class extends HP{type="image";src;cursor;cache;shape;constructor(t){super(t),this.width=t.width??this.width,this.height=t.height??this.height,this.src=t.src??this.src,this.shape=t.shape??this.shape,this.initLayoutSize()}},Rect:DP,Sector:class extends HP{type="arc";radius;startDegree=0;endDegree=360;clockWise=!0;lineWidth;fillColor;strokeColor;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.clockWise=t.clockWise,this.lineWidth=t.lineWidth,this.fillColor=t.fillColor,this.strokeColor=t.strokeColor,this.width=2*this.radius,this.height=2*this.radius,this.initLayoutSize(),this.dx+=this.radius,this.dy+=this.radius}},Text:class extends HP{type="text";text;fontSize;fontFamily;fillColor;color;textBaseline="top";textAlign="left";constructor(t){super(t),this.text=t.text,this.fontSize=t.fontSize||12,this.fontFamily=t.fontFamily||"sans-serif",this.color=this.fillColor=t.fillColor||"black"}getSize(t){const{width:e,height:n}=t.measureText(this.text,{fontSize:this.fontSize,fontFamily:this.fontFamily});this.width=e,this.height=n,this.initLayoutSize(),this.background&&(this.dx+=this.background.expandX||0,this.dy+=this.background.expandY||0)}},percentCalc:function(t,e=0){return{percent:t,delta:e}}});t.CustomLayout=jP,t.DataStatistics=nP,t.ListTable=class extends qM{showHeader=!0;constructor(t={}){super(t);const e=this.internalProps;this.pagerConf=t.pagerConf,e.sortState=t.sortState,e.columns=t.columns?y(t.columns):t.header?y(t.header):[],this.showHeader=t.showHeader??!0,this.transpose=t.transpose??!1,this.refreshHeader(),t.dataSource?EM(this,t.dataSource):t.records?this.setRecords(t.records,e.sortState):this.setRecords([])}isListTable(){return!0}isPivotTable(){return!1}get sortState(){return this.internalProps.sortState}set sortState(t){this.internalProps.sortState=t}get columns(){return this.internalProps.columns}set columns(t){this.internalProps.columns=t,this.options.columns=t,this.refreshHeader(),setTimeout((()=>{this.invalidate()}),0)}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,this.options.header=t,this.refreshHeader(),setTimeout((()=>{this.invalidate()}),0)}get transpose(){return this.internalProps.transpose??!1}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.options.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.invalidate()))}getCellValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}const{field:i,fieldFormat:r}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(r||i,t,e)}getCellOriginValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}const{field:i}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(i,t,e)}getRecordIndexByRow(t,e){const{layoutMap:n}=this.internalProps;return n.getRecordIndexByRow(t,e)}getCellOriginRecord(t,e){const n=this,i=n.getRecordIndexByRow(t,e);if(i>-1)return n.dataSource.get(i)}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.transpose){const e=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(e?.disableColumnResize)return!1}return n}updateOption(t,e=!1){const n=this.internalProps;return super.updateOption(t),this.pagerConf=t.pagerConf,this.showHeader=t.showHeader??!0,n.columns=t.columns?y(t.columns):t.header?y(t.header):[],this.transpose=t.transpose??!1,this.refreshHeader(),n.disposables&&(n.disposables.forEach((t=>t?.dispose?.())),n.disposables=null),this._updateSize(),t.dataSource?EM(this,t.dataSource):t.records?this.setRecords(t.records,t.sortState):this._resetFrozenColCount(),new Promise((t=>{setTimeout(t,0)}))}refreshHeader(){const t=this,e=t.internalProps,n=t.transpose,i=t.showHeader;e.headerEvents&&e.headerEvents.forEach((e=>t.unlisten(e)));const r=e.layoutMap=new rP(this,e.columns??[],i,t.options.hierarchyIndent);r.transpose=n;for(let e=0;e<r.columnWidths.length;e++){const{width:n,minWidth:i,maxWidth:o}=r.columnWidths?.[e]??{};n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&t.setColWidth(e,n),i&&("number"==typeof i&&i>0||"string"==typeof i)&&t.setMinColWidth(e,i),o&&("number"==typeof o&&o>0||"string"==typeof o)&&t.setMaxColWidth(e,o)}this.refreshRowColCount()}refreshRowColCount(){const t=this,{layoutMap:e}=t.internalProps;e&&(e.recordsCount=t.internalProps.dataSource?.length??0,t.transpose?(t.rowCount=e.rowCount??0,t.colCount=(t.internalProps.dataSource?.length??0)*e.bodyRowCount+e.headerLevelCount,t.frozenRowCount=0,t.frozenColCount=e.headerLevelCount):(t.colCount=e.colCount??0,t.rowCount=(t.internalProps.dataSource?.length??0)*e.bodyRowCount+e.headerLevelCount,t.frozenColCount=t.options.frozenColCount??0,t.frozenRowCount=e.headerLevelCount))}getFieldData(t,e,n){if(null===t)return null;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return null;const r=i.getRecordIndexByRow(e,n);return i.internalProps.dataSource.getField(r,t)}moveHeaderPosition(t,e){const n=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(n){if("column"===n.moveType){this.colWidthsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize),this.colWidthsLimit={};for(let t=0;t<this.internalProps.layoutMap.columnWidths.length;t++){const{minWidth:e,maxWidth:n}=this.internalProps.layoutMap.columnWidths?.[t]??{};e&&("number"==typeof e&&e>0||"string"==typeof e)&&this.setMinColWidth(t,e),n&&("number"==typeof n&&n>0||"string"==typeof n)&&this.setMaxColWidth(t,n)}const t=Math.min(n.sourceIndex,n.targetIndex),e=Math.max(n.sourceIndex,n.targetIndex);for(let n=t;n<=e;n++)this._clearColRangeWidthsMap(n)}else{const t=Math.min(n.sourceIndex,n.targetIndex),e=Math.max(n.sourceIndex,n.targetIndex);for(let n=t;n<=e;n++)this._clearRowRangeHeightsMap(n)}return!0}return!1}getCellAddress(t,e){let n;for(let e=0;e<this.records.length;e++){const i=this.records[e];if("function"==typeof t)t(i)&&(n=e);else{let r=!0;for(const e in t)if(i[e]!==t[e]){r=!1;break}r&&(n=e)}if(_(n))break}const i=this.getCellRangeByField(e,n);if(i)return{row:i.start.row,col:i.start.col}}getCellRangeByField(t,e){const{layoutMap:n}=this.internalProps,i=n.columnObjects.find((e=>e.field===t));if(i){const t=n.getBodyLayoutRangeById(i.id);let r;return _(e)&&(r=n.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:_(r)?r+t.start.col:void 0},end:{row:t.end.row,col:_(r)?r+t.end.col:void 0}}:{start:{col:t.start.col,row:_(r)?r+t.start.row:void 0},end:{col:t.end.col,row:_(r)?r+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.getBodyColumnDefine(t,e).tree)return n.none;const i=this.getRecordIndexByRow(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){const n=this.getRecordIndexByRow(t,e);this.dataSource.toggleHierarchyState(n),this.internalProps.layoutMap.toggleHierarchyState(t,e),this.refreshRowColCount(),this._resetFrozenColCount(),this.invalidate()}hasHierarchyTreeHeader(){return(this.options.columns??this.options.header)?.some(((t,e)=>t.tree))}getMenuInfo(t,e,n){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellType:this.getCellType(t,e)}}getSortFuncFromHeaderOption(t,e,n){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let i=0;i<t.length;i++){const r=t[i];if((n&&n===r.fieldKey||!n&&r.field===e)&&r.sort&&"function"==typeof r.sort)return r.sort;if(r.columns){const t=this.getSortFuncFromHeaderOption(r.columns,e,n);if(t)return t}}}updateSortState(t){if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let t=0;t<this.internalProps.sortState.length;t++){this.internalProps.sortState[t].order="normal"}else this.internalProps.sortState.order="normal";let e,n,i;if(Array.isArray(this.internalProps.sortState)?({order:e,field:n,fieldKey:i}=this.internalProps.sortState?.[0]):({order:e,field:n,fieldKey:i}=this.internalProps.sortState),n){const t=this.getSortFuncFromHeaderOption(this.internalProps.columns,n,i);let r;r=i?this.internalProps.layoutMap.headerObjects.find((t=>t&&t.fieldKey===i)):this.internalProps.layoutMap.headerObjects.find((t=>t&&t.field===n)),r?.define?.sort&&(this.dataSource.sort(r.field,e,t),this.scenegraph.sortCell())}this.stateManeger.updateSortState(t)}},t.PivotTable=class extends qM{pivotSortState;dataset;flatDataToObjects;constructor(t){if(super(t),t.layout&&Object.assign(t,t.layout),this.internalProps.dataConfig=t.dataConfig,this.internalProps.enableDataAnalysis=t.enableDataAnalysis,this.internalProps.enableDataAnalysis&&(t.rows||t.columns)){const e=t.rows.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),n=t.columns.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),i=t.indicators?.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.indicatorKey),t)),[])??[];this.dataset=new cP(this.internalProps.dataConfig,e,n,i,t.records)}this.refreshHeader(),this.pivotSortState=[],t.pivotSortState&&this.updatePivotSortState(t.pivotSortState),t.dataSource?EM(this,t.dataSource):t.records?this.setRecords(t.records,this.internalProps.sortState):this.setRecords([])}static get EVENT_TYPE(){return RR}isListTable(){return!1}isPivotTable(){return!0}_canResizeColumn(t,e){const n=super._canResizeColumn(t,e);if(n&&!this.internalProps.layoutMap.indicatorsAsCol){const e=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount);if(e?.disableColumnResize)return!1}return n}updateOption(t,e=!1){const n=this.internalProps;if(super.updateOption(t),n.dataConfig=t.dataConfig,n.enableDataAnalysis=t.enableDataAnalysis,"tree"===t?.rowHierarchyType&&"tree"===this.internalProps.layoutMap.rowHierarchyType&&this.internalProps.layoutMap.rowExpandLevel===t?.rowExpandLevel){const t=this.internalProps.layoutMap.rowDimensionTree.tree.children;this.internalProps.layoutMap.rowTree.forEach(((e,n)=>{this.syncHierarchyState(t[n],e)}))}if(this.internalProps.enableDataAnalysis&&(t.rows||t.columns)){const e=t.rows.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),i=t.columns.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.dimensionKey),t)),[]),r=t.indicators.reduce(((t,e)=>("string"==typeof e?t.push(e):t.push(e.indicatorKey),t)),[]);this.dataset=new cP(n.dataConfig,e,i,r,t.records)}return this.refreshHeader(),n.disposables&&(n.disposables.forEach((t=>t?.dispose?.())),n.disposables=null),this._updateSize(),t.dataSource?EM(this,t.dataSource):t.records?this.setRecords(t.records,void 0):this._resetFrozenColCount(),this.pivotSortState=[],t.pivotSortState&&this.updatePivotSortState(t.pivotSortState),new Promise((t=>{setTimeout(t,0)}))}refreshHeader(){const t=this.internalProps;t.headerEvents&&t.headerEvents.forEach((t=>this.unlisten(t))),this.options.enableDataAnalysis?t.layoutMap=new uP(this,this.dataset):(Array.isArray(this.options.columnTree)||Array.isArray(this.options.rowTree))&&(t.layoutMap=new lP(this),this.options.records?.[0]?.constructor!==Array&&(this.flatDataToObjects=new hP({rows:t.layoutMap.rowDimensionKeys,columns:t.layoutMap.colDimensionKeys,indicators:t.layoutMap.indicatorKeys,indicatorsAsCol:t.layoutMap.indicatorsAsCol,indicatorDimensionKey:t.layoutMap.indicatorDimensionKey},this.options.records)));for(let e=0;e<t.layoutMap.columnWidths.length;e++){const{width:n,minWidth:i,maxWidth:r}=t.layoutMap.columnWidths?.[e]??{};n&&("string"==typeof n&&"auto"!==n||"number"==typeof n&&n>0)&&this.setColWidth(e,n),i&&("number"==typeof i&&i>0||"string"==typeof i)&&this.setMinColWidth(e,i),r&&("number"==typeof r&&r>0||"string"==typeof r)&&this.setMaxColWidth(e,r)}this.refreshRowColCount()}refreshRowColCount(){const t=this,{layoutMap:e}=t.internalProps;e&&(t.colCount=e.colCount??0,t.rowCount=e.rowCount??0,t.frozenColCount=e.rowHeaderLevelCount,t.frozenRowCount=e.headerLevelCount)}getSortFuncFromHeaderOption(t,e,n){}get rowHierarchyType(){return this.internalProps.layoutMap.rowHierarchyType}syncHierarchyState(t,e){t.value===e.value&&t.dimensionKey===e.dimensionKey&&(e.hierarchyState=e.hierarchyState??(e?.children?t.hierarchyState:void 0),e?.children?.forEach(((e,n)=>{t?.children?.[n]&&e&&this.syncHierarchyState(t.children[n],e)})))}getRecordIndexByRow(t){const{layoutMap:e}=this.internalProps;return e.getRecordIndexByRow(t)}getRecordIndexByCol(t){const{layoutMap:e}=this.internalProps;return e.getRecordIndexByCol(t)}getFieldData(t,e,n){if(null==t)return null;const i=this;if(i.internalProps.layoutMap.isHeader(e,n))return null;const r=this.getRecordIndexByRow(n),o=this.getRecordIndexByCol(e),a=i.dataSource?.getField(r,o);if("string"!=typeof t){return AM({dataValue:a,...i.internalProps.layoutMap.getCellHeaderPaths(e,n)},t,vt)}return a}getCellValue(t,e){if(this.internalProps.layoutMap.isHeader(t,e)){const{caption:n,fieldFormat:i}=this.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i(n):n}if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[],r=this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e));return r.formatValue?r.formatValue():""}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey),{fieldFormat:a}=this.internalProps.layoutMap.getBody(t,e);return"function"==typeof a?a(o?.record):o?.value??""}const{field:n,fieldFormat:i}=this.internalProps.layoutMap.getBody(t,e);return this.getFieldData(i||n,t,e)}getCellOriginValue(t,e){const n=this;if(n.internalProps.layoutMap.isHeader(t,e)){const{caption:i}=n.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[],r=this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e));return r.value?r.value():void 0}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return o?.value}const{field:i}=n.internalProps.layoutMap.getBody(t,e);return n.getFieldData(i,t,e)}getCellOriginRecord(t,e){if(!this.internalProps.layoutMap.isHeader(t,e)){if(this.dataset){const n=this.dataset.colKeysPath[this.internalProps.layoutMap.getRecordIndexByCol(t)]??[],i=this.dataset.rowKeysPath[this.internalProps.layoutMap.getRecordIndexByRow(e)]??[];return this.dataset.getAggregator(i[i.length-1],n[n.length-1],this.internalProps.layoutMap.getIndicatorName(t,e)).records}if(this.flatDataToObjects){const n=this.internalProps.layoutMap.getCellHeaderPaths(t,e),i=n.colHeaderPaths.map((t=>t.indicatorKey??t.value)),r=n.rowHeaderPaths.map((t=>t.indicatorKey??t.value)),o=this.flatDataToObjects.getTreeNode(r,i,this.internalProps.layoutMap.getBody(t,e).indicatorKey);return o?.record}}}updateSortRules(t){this.internalProps.dataConfig.sortRules=t,this.dataset.updateSortRules(t),this.internalProps.layoutMap.updateDataset(this.dataset),this.invalidate()}updatePivotSortState(t){for(let e=0;e<t.length;e++){const{dimensions:n,order:i}=t[e],r=this.internalProps.layoutMap.getPivotCellAdress(n);r&&this.pivotSortState.push({col:r.col,row:r.row,order:i})}}getPivotSortState(t,e){if(!this.pivotSortState)return;const n=this.getCellRange(t,e);for(let t=0;t<this.pivotSortState.length;t++){const{col:e,row:i,order:r}=this.pivotSortState[t];if(st(n,e,i))return r}}moveHeaderPosition(t,e){const n=this.internalProps.layoutMap.moveHeaderPosition(t,e);if(n){if("column"===n.moveType){if(this.options.records?.[0]?.constructor===Array)for(let t=0;t<this.records.length;t++){const e=this.records[t].splice(n.sourceIndex-this.rowHeaderLevelCount,n.moveSize);e.unshift(n.targetIndex-this.rowHeaderLevelCount,0),Array.prototype.splice.apply(this.records[t],e)}this.colWidthsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize);for(let t=0;t<this.internalProps.layoutMap.columnWidths.length;t++){const{minWidth:e,maxWidth:n}=this.internalProps.layoutMap.columnWidths?.[t]??{};e&&("number"==typeof e&&e>0||"string"==typeof e)&&this.setMinColWidth(t,e),n&&("number"==typeof n&&n>0||"string"==typeof n)&&this.setMaxColWidth(t,n)}}else if("row"===n.moveType){if(this.options.records?.[0]?.constructor===Array){const t=this.records.splice(n.sourceIndex-this.columnHeaderLevelCount,n.moveSize);t.unshift(n.targetIndex-this.columnHeaderLevelCount,0),Array.prototype.splice.apply(this.records,t)}this.rowHeightsMap.adjustOrder(n.sourceIndex,n.targetIndex,n.moveSize)}return!0}return!1}toggleHierarchyState(t,e){this.internalProps.layoutMap.toggleHierarchyState(t,e),this.refreshRowColCount(),this._resetFrozenColCount(),this.invalidate()}getHeaderCellAddressByPath(t){return this.internalProps.layoutMap.getPivotCellAdress(t)}getCellAddressByHeaderPaths(t){return this.internalProps.layoutMap.getCellAdressByHeaderPath(t)}getHeaderPathByXY(t){let e;e=t?this.getCellAt(t.x+this.getFrozenColsWidth()+this.scrollLeft+1,t.y+this.getFrozenRowsHeight()+this.scrollTop+1):this.getCellAt(this.getFrozenColsWidth()+this.scrollLeft+1,this.getFrozenRowsHeight()+this.scrollTop+1);return this.internalProps.layoutMap.getCellHeaderPaths(e.col,e.row)}getHierarchyState(t,e){return this._getHeaderLayoutMap(t,e)?.hierarchyState}hasHierarchyTreeHeader(){return"tree"===this.internalProps.layoutMap.rowHierarchyType}getMenuInfo(t,e,n){const i=this.internalProps.layoutMap.getPivotDimensionInfo(t,e);return{dimensionKey:i[i.length-1].dimensionKey,value:this.getCellValue(t,e),cellType:this.getCellType(t,e),isPivotCorner:this.isCornerHeader(t,e)}}},t.TYPES=l,t.bindDebugTool=function(t,e){return new EP(t,e)},t.clearGlobal=function(){tP()},t.core=ZM,t.data=MM,t.getIcons=function(){return F_()},t.register=eP,t.themes=si}));