@visactor/vchart-extension 1.13.22 → 1.13.23-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.
- package/build/index.js +14540 -0
- package/build/index.min.js +15 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.d.ts +21 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js +118 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.d.ts +2 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.js +21 -0
- package/cjs/charts/compare-sankey/compare-sankey-sub-nodes.js.map +1 -0
- package/cjs/charts/compare-sankey/compare-sankey-transformer.d.ts +7 -0
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js +25 -0
- package/cjs/charts/compare-sankey/compare-sankey-transformer.js.map +1 -0
- package/cjs/charts/compare-sankey/compare-sankey.d.ts +46 -0
- package/cjs/charts/compare-sankey/compare-sankey.js +202 -0
- package/cjs/charts/compare-sankey/compare-sankey.js.map +1 -0
- package/cjs/charts/compare-sankey/index.d.ts +2 -0
- package/cjs/charts/compare-sankey/index.js +21 -0
- package/cjs/charts/compare-sankey/index.js.map +1 -0
- package/cjs/charts/compare-sankey/interface.d.ts +24 -0
- package/cjs/charts/compare-sankey/interface.js +6 -0
- package/cjs/charts/compare-sankey/interface.js.map +1 -0
- package/cjs/charts/compare-sankey/utils.d.ts +9 -0
- package/cjs/charts/compare-sankey/utils.js +48 -0
- package/cjs/charts/compare-sankey/utils.js.map +1 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-data.d.ts +8 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-data.js +85 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-data.js.map +1 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-transformer.d.ts +7 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-transformer.js +25 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff-transformer.js.map +1 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff.d.ts +34 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff.js +98 -0
- package/cjs/charts/compare-sankey-diff/compare-sankey-diff.js.map +1 -0
- package/cjs/charts/compare-sankey-diff/index.d.ts +2 -0
- package/cjs/charts/compare-sankey-diff/index.js +21 -0
- package/cjs/charts/compare-sankey-diff/index.js.map +1 -0
- package/cjs/charts/compare-sankey-diff/interface.d.ts +24 -0
- package/cjs/charts/compare-sankey-diff/interface.js +5 -0
- package/cjs/charts/compare-sankey-diff/interface.js.map +1 -0
- package/cjs/charts/conversion-funnel/arrow-data-transform.d.ts +24 -0
- package/cjs/charts/conversion-funnel/arrow-data-transform.js +99 -0
- package/cjs/charts/conversion-funnel/arrow-data-transform.js.map +1 -0
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.d.ts +7 -0
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +196 -0
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -0
- package/cjs/charts/conversion-funnel/conversion-funnel.d.ts +40 -0
- package/cjs/charts/conversion-funnel/conversion-funnel.js +78 -0
- package/cjs/charts/conversion-funnel/conversion-funnel.js.map +1 -0
- package/cjs/charts/conversion-funnel/index.d.ts +2 -0
- package/cjs/charts/conversion-funnel/index.js +21 -0
- package/cjs/charts/conversion-funnel/index.js.map +1 -0
- package/cjs/charts/conversion-funnel/interface.d.ts +35 -0
- package/cjs/charts/conversion-funnel/interface.js +6 -0
- package/cjs/charts/conversion-funnel/interface.js.map +1 -0
- package/cjs/charts/conversion-funnel/util.d.ts +3 -0
- package/cjs/charts/conversion-funnel/util.js +17 -0
- package/cjs/charts/conversion-funnel/util.js.map +1 -0
- package/cjs/charts/ranking-bar/interface.d.ts +45 -0
- package/cjs/charts/ranking-bar/interface.js +6 -0
- package/cjs/charts/ranking-bar/interface.js.map +1 -0
- package/cjs/charts/ranking-bar/ranking-bar-transformer.d.ts +10 -0
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js +291 -0
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js.map +1 -0
- package/cjs/charts/ranking-bar/ranking-bar.d.ts +16 -0
- package/cjs/charts/ranking-bar/ranking-bar.js +34 -0
- package/cjs/charts/ranking-bar/ranking-bar.js.map +1 -0
- package/cjs/charts/ranking-list/constant.d.ts +2 -0
- package/cjs/charts/ranking-list/constant.js +75 -0
- package/cjs/charts/ranking-list/constant.js.map +1 -0
- package/cjs/charts/ranking-list/interface.d.ts +74 -0
- package/cjs/charts/ranking-list/interface.js +6 -0
- package/cjs/charts/ranking-list/interface.js.map +1 -0
- package/cjs/charts/ranking-list/ranking-list-transformer.d.ts +459 -0
- package/cjs/charts/ranking-list/ranking-list-transformer.js +383 -0
- package/cjs/charts/ranking-list/ranking-list-transformer.js.map +1 -0
- package/cjs/charts/ranking-list/ranking-list.d.ts +16 -0
- package/cjs/charts/ranking-list/ranking-list.js +34 -0
- package/cjs/charts/ranking-list/ranking-list.js.map +1 -0
- package/cjs/charts/ranking-list/utils.d.ts +7 -0
- package/cjs/charts/ranking-list/utils.js +51 -0
- package/cjs/charts/ranking-list/utils.js.map +1 -0
- package/cjs/charts/sequence-scatter-kde/constant.d.ts +3 -0
- package/cjs/charts/sequence-scatter-kde/constant.js +7 -0
- package/cjs/charts/sequence-scatter-kde/constant.js.map +1 -0
- package/cjs/charts/sequence-scatter-kde/interface.d.ts +29 -0
- package/cjs/charts/sequence-scatter-kde/interface.js +5 -0
- package/cjs/charts/sequence-scatter-kde/interface.js.map +1 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.d.ts +6 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +142 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +1 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +16 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.js +34 -0
- package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +1 -0
- package/cjs/charts/sequence-scatter-kde/utils.d.ts +9 -0
- package/cjs/charts/sequence-scatter-kde/utils.js +42 -0
- package/cjs/charts/sequence-scatter-kde/utils.js.map +1 -0
- package/cjs/charts/sequence-scatter-link/interface.d.ts +59 -0
- package/cjs/charts/sequence-scatter-link/interface.js +6 -0
- package/cjs/charts/sequence-scatter-link/interface.js.map +1 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.d.ts +6 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +328 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +1 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.d.ts +16 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.js +34 -0
- package/cjs/charts/sequence-scatter-link/sequence-scatter-link.js.map +1 -0
- package/cjs/charts/sequence-scatter-link/utils.d.ts +9 -0
- package/cjs/charts/sequence-scatter-link/utils.js +108 -0
- package/cjs/charts/sequence-scatter-link/utils.js.map +1 -0
- package/cjs/charts/sequence-scatter-pixel/constant.d.ts +3 -0
- package/cjs/charts/sequence-scatter-pixel/constant.js +7 -0
- package/cjs/charts/sequence-scatter-pixel/constant.js.map +1 -0
- package/cjs/charts/sequence-scatter-pixel/interface.d.ts +29 -0
- package/cjs/charts/sequence-scatter-pixel/interface.js +6 -0
- package/cjs/charts/sequence-scatter-pixel/interface.js.map +1 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.d.ts +4 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js +68 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +1 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +16 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.js +34 -0
- package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +1 -0
- package/cjs/charts/sequence-scatter-pixel/utils.d.ts +3 -0
- package/cjs/charts/sequence-scatter-pixel/utils.js +54 -0
- package/cjs/charts/sequence-scatter-pixel/utils.js.map +1 -0
- package/cjs/components/bar-link/bar-link.d.ts +7 -0
- package/cjs/components/bar-link/bar-link.js +87 -0
- package/cjs/components/bar-link/bar-link.js.map +1 -0
- package/cjs/components/bar-link/constant.d.ts +1 -0
- package/cjs/components/bar-link/constant.js +6 -0
- package/cjs/components/bar-link/constant.js.map +1 -0
- package/cjs/components/bar-link/index.d.ts +4 -0
- package/cjs/components/bar-link/index.js +49 -0
- package/cjs/components/bar-link/index.js.map +1 -0
- package/cjs/components/bar-link/type.d.ts +27 -0
- package/cjs/components/bar-link/type.js +6 -0
- package/cjs/components/bar-link/type.js.map +1 -0
- package/cjs/components/bar-link/util.d.ts +22 -0
- package/cjs/components/bar-link/util.js +183 -0
- package/cjs/components/bar-link/util.js.map +1 -0
- package/cjs/components/series-break/constant.d.ts +1 -0
- package/cjs/components/series-break/constant.js +6 -0
- package/cjs/components/series-break/constant.js.map +1 -0
- package/cjs/components/series-break/index.d.ts +4 -0
- package/cjs/components/series-break/index.js +49 -0
- package/cjs/components/series-break/index.js.map +1 -0
- package/cjs/components/series-break/series-break.d.ts +7 -0
- package/cjs/components/series-break/series-break.js +118 -0
- package/cjs/components/series-break/series-break.js.map +1 -0
- package/cjs/components/series-break/type.d.ts +14 -0
- package/cjs/components/series-break/type.js +6 -0
- package/cjs/components/series-break/type.js.map +1 -0
- package/cjs/components/series-break/util.d.ts +13 -0
- package/cjs/components/series-break/util.js +248 -0
- package/cjs/components/series-break/util.js.map +1 -0
- package/cjs/components/series-label/constant.d.ts +1 -0
- package/cjs/components/series-label/constant.js +5 -0
- package/cjs/components/series-label/constant.js.map +1 -0
- package/cjs/components/series-label/index.d.ts +3 -0
- package/cjs/components/series-label/index.js +49 -0
- package/cjs/components/series-label/index.js.map +1 -0
- package/cjs/components/series-label/series-label.d.ts +7 -0
- package/cjs/components/series-label/series-label.js +114 -0
- package/cjs/components/series-label/series-label.js.map +1 -0
- package/cjs/components/series-label/type.d.ts +41 -0
- package/cjs/components/series-label/type.js +6 -0
- package/cjs/components/series-label/type.js.map +1 -0
- package/cjs/components/series-label/util.d.ts +33 -0
- package/cjs/components/series-label/util.js +152 -0
- package/cjs/components/series-label/util.js.map +1 -0
- package/cjs/index.d.ts +11 -0
- package/cjs/index.js +26 -0
- package/cjs/index.js.map +1 -0
- package/cjs/type/index.d.ts +1 -0
- package/cjs/type/index.js +21 -0
- package/cjs/type/index.js.map +1 -0
- package/cjs/type/type.d.ts +8 -0
- package/cjs/type/type.js +6 -0
- package/cjs/type/type.js.map +1 -0
- package/cjs/utils/element.d.ts +7 -0
- package/cjs/utils/element.js +21 -0
- package/cjs/utils/element.js.map +1 -0
- package/cjs/utils/mark.d.ts +2 -0
- package/cjs/utils/mark.js +14 -0
- package/cjs/utils/mark.js.map +1 -0
- package/cjs/utils/math.d.ts +1 -0
- package/cjs/utils/math.js +10 -0
- package/cjs/utils/math.js.map +1 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-data.d.ts +21 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js +106 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-data.js.map +1 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.d.ts +2 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.js +13 -0
- package/esm/charts/compare-sankey/compare-sankey-sub-nodes.js.map +1 -0
- package/esm/charts/compare-sankey/compare-sankey-transformer.d.ts +7 -0
- package/esm/charts/compare-sankey/compare-sankey-transformer.js +17 -0
- package/esm/charts/compare-sankey/compare-sankey-transformer.js.map +1 -0
- package/esm/charts/compare-sankey/compare-sankey.d.ts +46 -0
- package/esm/charts/compare-sankey/compare-sankey.js +205 -0
- package/esm/charts/compare-sankey/compare-sankey.js.map +1 -0
- package/esm/charts/compare-sankey/index.d.ts +2 -0
- package/esm/charts/compare-sankey/index.js +4 -0
- package/esm/charts/compare-sankey/index.js.map +1 -0
- package/esm/charts/compare-sankey/interface.d.ts +24 -0
- package/esm/charts/compare-sankey/interface.js +2 -0
- package/esm/charts/compare-sankey/interface.js.map +1 -0
- package/esm/charts/compare-sankey/utils.d.ts +9 -0
- package/esm/charts/compare-sankey/utils.js +39 -0
- package/esm/charts/compare-sankey/utils.js.map +1 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-data.d.ts +8 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-data.js +77 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-data.js.map +1 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-transformer.d.ts +7 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-transformer.js +17 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff-transformer.js.map +1 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff.d.ts +34 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff.js +97 -0
- package/esm/charts/compare-sankey-diff/compare-sankey-diff.js.map +1 -0
- package/esm/charts/compare-sankey-diff/index.d.ts +2 -0
- package/esm/charts/compare-sankey-diff/index.js +4 -0
- package/esm/charts/compare-sankey-diff/index.js.map +1 -0
- package/esm/charts/compare-sankey-diff/interface.d.ts +24 -0
- package/esm/charts/compare-sankey-diff/interface.js +1 -0
- package/esm/charts/compare-sankey-diff/interface.js.map +1 -0
- package/esm/charts/conversion-funnel/arrow-data-transform.d.ts +24 -0
- package/esm/charts/conversion-funnel/arrow-data-transform.js +94 -0
- package/esm/charts/conversion-funnel/arrow-data-transform.js.map +1 -0
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.d.ts +7 -0
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +192 -0
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -0
- package/esm/charts/conversion-funnel/conversion-funnel.d.ts +40 -0
- package/esm/charts/conversion-funnel/conversion-funnel.js +81 -0
- package/esm/charts/conversion-funnel/conversion-funnel.js.map +1 -0
- package/esm/charts/conversion-funnel/index.d.ts +2 -0
- package/esm/charts/conversion-funnel/index.js +4 -0
- package/esm/charts/conversion-funnel/index.js.map +1 -0
- package/esm/charts/conversion-funnel/interface.d.ts +35 -0
- package/esm/charts/conversion-funnel/interface.js +2 -0
- package/esm/charts/conversion-funnel/interface.js.map +1 -0
- package/esm/charts/conversion-funnel/util.d.ts +3 -0
- package/esm/charts/conversion-funnel/util.js +10 -0
- package/esm/charts/conversion-funnel/util.js.map +1 -0
- package/esm/charts/ranking-bar/interface.d.ts +45 -0
- package/esm/charts/ranking-bar/interface.js +2 -0
- package/esm/charts/ranking-bar/interface.js.map +1 -0
- package/esm/charts/ranking-bar/ranking-bar-transformer.d.ts +10 -0
- package/esm/charts/ranking-bar/ranking-bar-transformer.js +285 -0
- package/esm/charts/ranking-bar/ranking-bar-transformer.js.map +1 -0
- package/esm/charts/ranking-bar/ranking-bar.d.ts +16 -0
- package/esm/charts/ranking-bar/ranking-bar.js +27 -0
- package/esm/charts/ranking-bar/ranking-bar.js.map +1 -0
- package/esm/charts/ranking-list/constant.d.ts +2 -0
- package/esm/charts/ranking-list/constant.js +69 -0
- package/esm/charts/ranking-list/constant.js.map +1 -0
- package/esm/charts/ranking-list/interface.d.ts +74 -0
- package/esm/charts/ranking-list/interface.js +2 -0
- package/esm/charts/ranking-list/interface.js.map +1 -0
- package/esm/charts/ranking-list/ranking-list-transformer.d.ts +459 -0
- package/esm/charts/ranking-list/ranking-list-transformer.js +383 -0
- package/esm/charts/ranking-list/ranking-list-transformer.js.map +1 -0
- package/esm/charts/ranking-list/ranking-list.d.ts +16 -0
- package/esm/charts/ranking-list/ranking-list.js +27 -0
- package/esm/charts/ranking-list/ranking-list.js.map +1 -0
- package/esm/charts/ranking-list/utils.d.ts +7 -0
- package/esm/charts/ranking-list/utils.js +41 -0
- package/esm/charts/ranking-list/utils.js.map +1 -0
- package/esm/charts/sequence-scatter-kde/constant.d.ts +3 -0
- package/esm/charts/sequence-scatter-kde/constant.js +6 -0
- package/esm/charts/sequence-scatter-kde/constant.js.map +1 -0
- package/esm/charts/sequence-scatter-kde/interface.d.ts +29 -0
- package/esm/charts/sequence-scatter-kde/interface.js +1 -0
- package/esm/charts/sequence-scatter-kde/interface.js.map +1 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.d.ts +6 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js +137 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +1 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +16 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.js +28 -0
- package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +1 -0
- package/esm/charts/sequence-scatter-kde/utils.d.ts +9 -0
- package/esm/charts/sequence-scatter-kde/utils.js +34 -0
- package/esm/charts/sequence-scatter-kde/utils.js.map +1 -0
- package/esm/charts/sequence-scatter-link/interface.d.ts +59 -0
- package/esm/charts/sequence-scatter-link/interface.js +2 -0
- package/esm/charts/sequence-scatter-link/interface.js.map +1 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.d.ts +6 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +321 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +1 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.d.ts +16 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.js +28 -0
- package/esm/charts/sequence-scatter-link/sequence-scatter-link.js.map +1 -0
- package/esm/charts/sequence-scatter-link/utils.d.ts +9 -0
- package/esm/charts/sequence-scatter-link/utils.js +100 -0
- package/esm/charts/sequence-scatter-link/utils.js.map +1 -0
- package/esm/charts/sequence-scatter-pixel/constant.d.ts +3 -0
- package/esm/charts/sequence-scatter-pixel/constant.js +6 -0
- package/esm/charts/sequence-scatter-pixel/constant.js.map +1 -0
- package/esm/charts/sequence-scatter-pixel/interface.d.ts +29 -0
- package/esm/charts/sequence-scatter-pixel/interface.js +2 -0
- package/esm/charts/sequence-scatter-pixel/interface.js.map +1 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.d.ts +4 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js +64 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +1 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +16 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.js +28 -0
- package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +1 -0
- package/esm/charts/sequence-scatter-pixel/utils.d.ts +3 -0
- package/esm/charts/sequence-scatter-pixel/utils.js +46 -0
- package/esm/charts/sequence-scatter-pixel/utils.js.map +1 -0
- package/esm/components/bar-link/bar-link.d.ts +7 -0
- package/esm/components/bar-link/bar-link.js +85 -0
- package/esm/components/bar-link/bar-link.js.map +1 -0
- package/esm/components/bar-link/constant.d.ts +1 -0
- package/esm/components/bar-link/constant.js +2 -0
- package/esm/components/bar-link/constant.js.map +1 -0
- package/esm/components/bar-link/index.d.ts +4 -0
- package/esm/components/bar-link/index.js +8 -0
- package/esm/components/bar-link/index.js.map +1 -0
- package/esm/components/bar-link/type.d.ts +27 -0
- package/esm/components/bar-link/type.js +2 -0
- package/esm/components/bar-link/type.js.map +1 -0
- package/esm/components/bar-link/util.d.ts +22 -0
- package/esm/components/bar-link/util.js +178 -0
- package/esm/components/bar-link/util.js.map +1 -0
- package/esm/components/series-break/constant.d.ts +1 -0
- package/esm/components/series-break/constant.js +2 -0
- package/esm/components/series-break/constant.js.map +1 -0
- package/esm/components/series-break/index.d.ts +4 -0
- package/esm/components/series-break/index.js +8 -0
- package/esm/components/series-break/index.js.map +1 -0
- package/esm/components/series-break/series-break.d.ts +7 -0
- package/esm/components/series-break/series-break.js +115 -0
- package/esm/components/series-break/series-break.js.map +1 -0
- package/esm/components/series-break/type.d.ts +14 -0
- package/esm/components/series-break/type.js +2 -0
- package/esm/components/series-break/type.js.map +1 -0
- package/esm/components/series-break/util.d.ts +13 -0
- package/esm/components/series-break/util.js +244 -0
- package/esm/components/series-break/util.js.map +1 -0
- package/esm/components/series-label/constant.d.ts +1 -0
- package/esm/components/series-label/constant.js +1 -0
- package/esm/components/series-label/constant.js.map +1 -0
- package/esm/components/series-label/index.d.ts +3 -0
- package/esm/components/series-label/index.js +6 -0
- package/esm/components/series-label/index.js.map +1 -0
- package/esm/components/series-label/series-label.d.ts +7 -0
- package/esm/components/series-label/series-label.js +110 -0
- package/esm/components/series-label/series-label.js.map +1 -0
- package/esm/components/series-label/type.d.ts +41 -0
- package/esm/components/series-label/type.js +2 -0
- package/esm/components/series-label/type.js.map +1 -0
- package/esm/components/series-label/util.d.ts +33 -0
- package/esm/components/series-label/util.js +144 -0
- package/esm/components/series-label/util.js.map +1 -0
- package/esm/index.d.ts +11 -0
- package/esm/index.js +21 -0
- package/esm/index.js.map +1 -0
- package/esm/type/index.d.ts +1 -0
- package/esm/type/index.js +2 -0
- package/esm/type/index.js.map +1 -0
- package/esm/type/type.d.ts +8 -0
- package/esm/type/type.js +2 -0
- package/esm/type/type.js.map +1 -0
- package/esm/utils/element.d.ts +7 -0
- package/esm/utils/element.js +15 -0
- package/esm/utils/element.js.map +1 -0
- package/esm/utils/mark.d.ts +2 -0
- package/esm/utils/mark.js +4 -0
- package/esm/utils/mark.js.map +1 -0
- package/esm/utils/math.d.ts +1 -0
- package/esm/utils/math.js +4 -0
- package/esm/utils/math.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart)}(this,(function(t,e){"use strict";function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new s(n,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,r=n.length,a=new Array(r);s<r;s++)a[s]=n[s].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,s,r,a){var o=i?i+t:t;if(!this._events[o])return!1;var l,h,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,a),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,p=c.length;for(h=0;h<p;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,n);break;case 4:c[h].fn.call(c[h].context,e,n,s);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},o.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==e||s&&!o.once||n&&o.context!==n||a(this,r);else{for(var l=0,h=[],c=o.length;l<c;l++)(o[l].fn!==e||s&&!o[l].once||n&&o[l].context!==n)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(n);var s=i(n.exports);var r=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var a=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||r(t,"Boolean");var o=t=>"function"==typeof t;var l=t=>null==t;var h=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var u=t=>"object"==typeof t&&null!==t;var d=function(t){if(!u(t)||!r(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var p=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||r(t,"String")};var f=t=>Array.isArray?Array.isArray(t):r(t,"Array");var g=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var y=t=>r(t,"Date");var m=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||r(t,"Number")};var b=t=>m(t)&&Number.isFinite(t);var v=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var x=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);var _=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var S=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function B(t){if(l(t))return!0;if(g(t))return!t.length;const e=_(t);if("Map"===e||"Set"===e)return!t.size;if(S(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}var w=(t,e,i)=>{const n=p(e)?e.split("."):e;for(let e=0;e<n.length;e++)t=t?t[n[e]]:void 0;return void 0===t?i:t};const M=Object.prototype.hasOwnProperty;var k=(t,e)=>null!=t&&M.call(t,e);function C(t,e,i){let n;if(!h(t)||"object"!=typeof t||e&&e(t))return t;const s=f(t),r=t.length;n=s?new Array(r):"object"==typeof t?{}:a(t)||m(t)||p(t)?t:y(t)?new Date(+t):void 0;const o=s?void 0:Object.keys(Object(t));let l=-1;if(n)for(;++l<(o||t).length;){const s=o?o[l]:l,r=t[s];i&&i.includes(s.toString())?n[s]=r:n[s]=C(r,e,i)}return n}function O(t,e,i=!1,n=!1){if(e){if(t===e)return;if(h(e)&&"object"==typeof e){const s=Object(e),r=[];for(const t in s)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!h(s[a])||"object"!=typeof s[a]||n&&f(t[a])?L(t,a,s[a]):P(t,e,a,i,n)}}}}function P(t,e,i,n=!1,s=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(f(a)){if(n)o=[];else if(f(r))o=r;else if(g(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)o[t]=r[t]}}else d(a)?(o=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(o={})):l=!1;l&&O(o,a,n,s),L(t,i,o)}function L(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function E(t,...e){let i=-1;const n=e.length;for(;++i<n;)O(t,e[i],!0);return t}function R(t,e){if(!t||!d(t))return t;const i={};return Object.keys(t).forEach((n=>{const s=t[n];let r=!1;e.forEach((t=>{(p(t)&&t===n||t instanceof RegExp&&n.match(t))&&(r=!0)})),r||(i[n]=s)})),i}function D(t){return h(t)?f(t)?t:[t]:[]}function I(t){if(!f(t))return[t];const e=[];for(const i of t)e.push(...I(i));return e}const N="undefined"!=typeof console;function U(t,e,i){const n=[e].concat([].slice.call(i));N&&console[t].apply(console,n)}var j;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(j||(j={}));class F{static getInstance(t,e){return F._instance&&m(t)?F._instance.level(t):F._instance||(F._instance=new F(t,e)),F._instance}static setInstance(t){return F._instance=t}static setInstanceLevel(t){F._instance?F._instance.level(t):F._instance=new F(t)}static clearInstance(){F._instance=null}constructor(t=j.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=j.Info}canLogDebug(){return this._level>=j.Debug}canLogError(){return this._level>=j.Error}canLogWarn(){return this._level>=j.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=j.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):U(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=j.Warn&&U(this._method||"warn","WARN",t),this}info(...t){return this._level>=j.Info&&U(this._method||"log","INFO",t),this}debug(...t){return this._level>=j.Debug&&U(this._method||"log","DEBUG",t),this}}F._instance=null;var z=function(t,e,i){return t<e?e:t>i?i:t};function W(t){if(b(t))return t;const e=+t;return b(e)?e:0}const G=t=>e=>w(e,t),H=(t,e={})=>{if(o(t))return t;const i=[t];return(e&&e.get||G)(i)},Y=Math.PI,V=Y/2,X=2*Y,$=2*Math.PI,q=Math.abs,K=Math.atan2,Z=Math.cos,J=Math.max,Q=Math.min,tt=Math.sin,et=Math.sqrt,it=Math.pow;function nt(t,e,i,n,s){let r=i,a=n;return"number"==typeof t&&"number"==typeof i&&(r=(1-s)*t+s*i),"number"==typeof e&&"number"==typeof n&&(a=(1-s)*e+s*n),{x:r,y:a}}function st(t,e){return t[0]*e[1]-t[1]*e[0]}class rt{constructor(t=0,e=0,i,n){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new rt(this.x,this.y)}copyFrom(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}set(t,e){return this.x=t,this.y=e,this}add(t){return m(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return m(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class at{static distancePP(t,e){return et(it(t.x-e.x,2)+it(t.y-e.y,2))}static distanceNN(t,e,i,n){return et(it(t-i,2)+it(e-n,2))}static distancePN(t,e,i){return et(it(e-t.x,2)+it(i-t.y,2))}static pointAtPP(t,e,i){return new rt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function ot(t){return t*(Math.PI/180)}function lt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function ht(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function ct(t,e,i,n){if(!function(t,e,i,n){let s=t[0],r=e[0],a=i[0],o=n[0];return r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),!(r<a||o<s||(s=t[1],r=e[1],a=i[1],o=n[1],r<s&&([s,r]=[r,s]),o<a&&([o,a]=[a,o]),r<a||o<s))}(t,e,i,n))return!1;const s=[0,0],r=[0,0],a=[0,0];if(ht(s,e,t),ht(r,n,i),q((o=s)[0]-(l=r)[0])+q(o[1]-l[1])<1e-12)return!0;var o,l;ht(a,i,t);const h=st(a,r)/st(s,r);return h>=0&&h<=1&&[t[0]+s[0]*h,t[1]+s[1]*h]}var ut;function dt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function pt({x:t,y:e},i,n={x:0,y:0}){return{x:(t-n.x)*Math.cos(i)-(e-n.y)*Math.sin(i)+n.x,y:(t-n.x)*Math.sin(i)+(e-n.y)*Math.cos(i)+n.y}}function ft(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function gt(t,e){const i=e?ot(t.angle):t.angle,n=ft(t);return[pt({x:t.x1,y:t.y1},i,n),pt({x:t.x2,y:t.y1},i,n),pt({x:t.x2,y:t.y2},i,n),pt({x:t.x1,y:t.y2},i,n)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(ut||(ut={}));const yt=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function mt(t,e={},i){i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class bt{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=mt(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:f,limit:g}=this._userSpec;let{lineHeight:y=o}=this._userSpec;if(p(y)&&"%"===y[y.length-1]){const t=Number.parseFloat(y.substring(0,y.length-1))/100;y=o*t}return{fontStyle:s,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:f,limit:g,lineHeight:y}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let s=this._measureSpecialChar(n);l(s)&&bt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),l(s)&&["F","W"].includes(yt(n))&&(s=this._measureFullSizeChar()),l(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!l(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!l(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(yt(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(f(t)){const a=t.filter(h).map((t=>t.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(bt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/bt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(bt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(bt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/bt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function vt(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}bt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",bt.NUMBERS_CHAR_SET="0123456789",bt.FULL_SIZE_CHAR="字";class xt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new xt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,n=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(t=0,e=0,i=0,n=0){return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(t=0,e=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}expand(t=0){return f(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}round(){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}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(t=0,e=0,i=0,n=0){const s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[3])}union(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}intersect(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}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return vt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:s,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,c=i-e*l-i*o;return[o*n-l*s+h,l*n+o*s+c,o*n-l*a+h,l*n+o*a+c,o*r-l*s+h,l*r+o*s+c,o*r-l*a+h,l*r+o*a+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:a,y2:o}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class _t extends xt{}class At extends xt{constructor(t,e=0){var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e,i=!1){const n=gt(t,i),s=gt(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],a=r(ft(t),ft(e)),o=r(n[0],n[1]),l=r(n[1],n[2]),h=r(s[0],s[1]),c=r(s[1],s[2]),u=i?ot(t.angle):t.angle;let d=i?ot(90-t.angle):t.angle+V;const p=i?ot(e.angle):e.angle;let f=i?ot(90-e.angle):e.angle+V;d>$&&(d-=$),f>$&&(f-=$);const g=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(dt(s,i)+dt(s,n))/2>dt(s,a)};return g((t.x2-t.x1)/2,u,h,c)&&g((t.y2-t.y1)/2,d,h,c)&&g((e.x2-e.x1)/2,p,o,l)&&g((e.y2-e.y1)/2,f,o,l)}(this,t)}setValue(t=0,e=0,i=0,n=0,s=0){return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new At(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[pt({x:this.x1,y:this.y1},this.angle,t),pt({x:this.x2,y:this.y1},this.angle,t),pt({x:this.x1,y:this.y2},this.angle,t),pt({x:this.x2,y:this.y2},this.angle,t)]}}class St{constructor(t=1,e=0,i=0,n=1,s=0,r=0){this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}equalToMatrix(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)}equalTo(t,e,i,n,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.e,r=this.f,a=new St,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-n*s)/o,a.f=-(t*r-e*s)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,a=(1-n)*i-s*e,o=n*this.a-s*this.b,l=s*this.a+n*this.b,h=n*this.c-s*this.d,c=s*this.c+n*this.d,u=n*this.e-s*this.f+r,d=s*this.e+n*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,s,r){return this.multiply(t,e,i,n,s,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const a=this.a,o=this.b,l=this.c,h=this.d,c=a*t+l*e,u=o*t+h*e,d=a*i+l*n,p=o*i+h*n,f=a*s+l*r+this.e,g=o*s+h*r+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new St;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:s,d:r,e:a,f:o}=this,l=i*r-n*s,h=r/l,c=-n/l,u=-s/l,d=i/l,p=(s*o-r*a)/l,f=-(i*o-n*a)/l,{x:g,y:y}=t;e.x=g*h+y*u+p,e.y=g*c+y*d+f}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new St(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=s/a,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=s/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function Tt(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=n,o=s,l=0):60<=t&&t<120?(a=s,o=n,l=0):120<=t&&t<180?(a=0,o=n,l=s):180<=t&&t<240?(a=0,o=s,l=n):240<=t&&t<300?(a=s,o=0,l=n):300<=t&&t<360&&(a=n,o=0,l=s),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Bt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let a=0,o=0,l=0;return a=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(s+n)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const wt=/^#([0-9a-f]{3,8})$/,Mt={transparent:4294967040},kt={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 Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Ot(t){return m(t)?new Dt(t>>16,t>>8&255,255&t,1):f(t)?new Dt(t[0],t[1],t[2]):new Dt(255,255,255)}function Pt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Lt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Et=(t,e)=>{const i=wt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Dt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Ot(t):8===e?new Dt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Rt{static Brighter(t,e=1){return 1===e?t:new Rt(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Rt(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof Rt?t:new Rt(t);switch(e){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();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(h(Mt[t]))return function(t){return m(t)?new Dt(t>>>24,t>>>16&255,t>>>8&255,255&t):f(t)?new Dt(t[0],t[1],t[2],t[3]):new Dt(255,255,255,1)}(Mt[t]);if(h(kt[t]))return Ot(kt[t]);const e=`${t}`.trim().toLowerCase(),i=Et(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Dt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Tt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Dt(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Rt.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Dt(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*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(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){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)}setHsl(t,e,i){const n=this.color.opacity,s=Bt(this.color.r,this.color.g,this.color.b),r=Tt(l(t)?s.h:z(t,0,360),l(e)?s.s:e>=0&&e<=1?100*e:e,l(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new Dt(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!l(t)&&(this.color.r=t),!l(e)&&(this.color.g=e),!l(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Et(e,!0);return null!=i?i:this}setColorName(t){const e=kt[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new Rt(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Pt(t.color.r),this.color.g=Pt(t.color.g),this.color.b=Pt(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Lt(t.color.r),this.color.g=Lt(t.color.g),this.color.b=Lt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Dt{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),h(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Ct(this.r)+Ct(this.g)+Ct(this.b)+(1===this.opacity?"":Ct(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=Bt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}class It extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:i}=function(t){const{xField:e,yField:i,timeField:n,data:s,topN:r=10,icon:a}=t,o=new Set,l=new Map;return s.sort(((t,i)=>Number(i[e])-Number(t[e]))),s.forEach((t=>{const e=t[n];h(e)&&o.add(e),l.has(e)||l.set(e,[]);const s=l.get(e);if(s.length<r){const e=Object.assign({},t);a&&a[e[i]]&&(e.icon=a[e[i]]),s.push(e)}})),{timeData:l,timeNodes:Array.from(o).sort()}}(t),{interval:n,xField:s,yField:r,color:a,icon:o,iconPosition:l,iconShape:c,timeLabel:u,label:d,nameLabel:p,xAxis:f,yAxis:g}=t,y=n||1e3,m=Math.min(y,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(i[0])},{id:"time",values:[{time:i[0]}]}],t.color={specified:Object.assign({},a)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:r,xField:s,seriesField:r,extensionMark:[],label:Nt(d,Object.assign(Object.assign({},p),{yField:r}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(f,g),t.player={type:"continuous",auto:!0,loop:!1,interval:y,specs:i.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:y,exchangeDuration:m}),u&&!1===u.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(u.style)),o){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:Ut(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(l,c,{interval:y,exchangeDuration:m});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function Nt(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function Ut(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class jt extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=It}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}jt.type="rankingBar",jt.view="singleDefault",jt.transformerConstructor=It;const Ft=1e3,zt="#21252c",Wt={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:zt,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:zt,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:Ft,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:Ft,easing:"linear"},animationNormal:{interval:Ft}},Gt="dataKey",Ht="VCHART_ORDER",Yt="SUPPLY_DATA_KEY";class Vt extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Yt]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[Ht]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[Yt]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[Gt]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,Wt),((t,e)=>{e.forEach((e=>{var i,n,s,r,a,o,l;f(t[e])?null===(i=t[e])||void 0===i||i.forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,i,n,s,r,a,o,l,h;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(i=this.valueLabelTextMeasure)||void 0===i||i.release(),null===(n=this.orderLabelTextMeasure)||void 0===n||n.release(),this.nameLabelTextMeasure=new bt({defaultFontParams:null!==(r=null===(s=t.nameLabel)||void 0===s?void 0:s.style)&&void 0!==r?r:{}}),this.valueLabelTextMeasure=new bt({defaultFontParams:null!==(o=null===(a=t.valueLabel)||void 0===a?void 0:a.style)&&void 0!==o?o:{}}),this.orderLabelTextMeasure=new bt({defaultFontParams:null!==(h=null===(l=t.orderLabel)||void 0===l?void 0:l.style)&&void 0!==h?h:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[Ht]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=C(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=Gt,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[Yt]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:Gt,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[Yt]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:Gt,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[Yt]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:Gt,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(Ht,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(Ht,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[Yt]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:Gt,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,Ht,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:Gt,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(Ht,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:Gt,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[Yt]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,Ht,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[Yt]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,c,u,d,p,f;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicItem().attribute.x}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(d=null===(u=t.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==d?d:1e3,easing:null!==(f=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==f?f:"linear"})}getAnimationUpdate(t){var e,i,n,s;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class Xt extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=Vt}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Xt.type="rankingList",Xt.view="singleDefault",Xt.transformerConstructor=Vt;const $t=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};let qt=0;const Kt="_data-view-diff-rank";class Zt{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new s,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={pushHistory:!0,emitMessage:!0})=>(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()})),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:function(t="dataset"){return qt>1e8&&(qt=0),t+"_"+qt++}("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:i,emitMessage:n}=e,s=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(s),this.latestData=s,!1!==n&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[Kt]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[Kt]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[Kt]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof Zt||!0!==(null==e?void 0:e.clone)||(i=!0),i?C(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?E({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!l(this._fields)&&l(i)?(this.dataSet.registerTransform("fields",$t),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function Jt(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}class Qt extends e.FunnelChart.transformerConstructor{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Jt(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=te(s,i),a=te(n,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=Jt(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},de),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function te(t,e){if(0===(null==t?void 0:t.length))return null;const{line:i,symbol:n,text:s,margin:r}=e,a=[],l={type:"group",children:[]},h=function(t={},e){const{style:i={}}=t,n=Jt(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},he),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=ee(t,i,e),n}})})}(i,r);h&&a.push(h);const c=function(t={},e){const{style:i={}}=t,n=Jt(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},ce),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=ee(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=ee(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(n,r);c&&a.push(c);const u=function(t={},e){const{style:i={},formatMethod:n,textMargin:s=4}=t,r=Jt(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},ue),{text:(t,e)=>{var i,s,r,a,l,h,c;const{text:u}=t;let d=u;if(o(n)){const{vchart:o}=e,{from:p,to:f}=t,{field:g}=t.context,y=null!==(r=null===(s=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==r?r:[],m=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=m.find((t=>t[g]===y[p][g])),v=m.find((t=>t[g]===y[f][g]));d=n(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var n,r;let a=t.layout.points;return a=ee(t,i,e),null!==(r=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-s:s))&&void 0!==r?r:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=ee(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(s,r);return u&&a.push(u),l.children=a,l}function ee(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let f=[];if(d&&d.length){const n=p.find((t=>t[u]===d[h][u])),s=p.find((t=>t[u]===d[c][u])),r=p[0];if(n&&s&&r){f=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,f=p?e[1]:e[0],g=p?e[2]:e[3],y=Math.abs(f.y-g.y),m=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(m.y-b.y),x=p?n[1]:n[0],_=y/(u+1),A=v/(d+1),S=f.y+_*(h+1),T=m.y+A*(c+1),B=p?-1:1,w=[{x:f.x-s*B,y:S},{x:x.x-(s+(l+1)*a)*B,y:S},{x:x.x-(s+(l+1)*a)*B,y:T},{x:m.x-s*B,y:T}];return w}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=f}}return f}function ie(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function ne(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const se=(t,e)=>{var i,n,s;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(n=re(o))&&void 0!==n?n:[],...null!==(s=re(l))&&void 0!==s?s:[]]};function re(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>ne(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(h(n)){const e=n.toArrows.find((e=>ne(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var n;const s=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let n=t[0];for(let s=1;s<t.length;s++){const r=t[s];(null!==(i=null==e?void 0:e(r,n))&&void 0!==i?i:r-n)>0&&(n=r)}return n})(s,((t,e)=>t.layout.level-e.layout.level));let a=null!==(n=null==r?void 0:r.layout.level)&&void 0!==n?n:0;for(;a>=0;){if(s.some((t=>t.layout.level===a&&ie(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ae(i,e.get(i.from).totalArrows),i.layout.toIndex=ae(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ae(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class oe extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=Qt}}oe.type="conversionFunnel",oe.transformerConstructor=Qt;class le extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Zt(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",se),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.getProduct().transform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.getProduct().transform([{type:"filter",callback:t=>"left"===t.position}])}))}}const he={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},ce={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},ue={fill:"#606773",fontSize:12},de={fill:"#eff1f9"},pe="dataKey";class fe extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[pe]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=pe,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class ge extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=fe}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}ge.type="sequenceScatterLink",ge.view="singleDefault",ge.transformerConstructor=fe;const ye=.2;function me(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const be="dataKey";class ve extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[be]:e}))),s=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),s=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),o=n.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*ye,p=c-(u-c)*ye;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=me(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=n.length*r*r,s.push({x:e,y:o,kde:l,label:t})}})),s}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:s}]})})),e}(t);t.type="common",t.dataKey=be,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class xe extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ve}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}xe.type="sequenceScatterKDE",xe.view="singleDefault",xe.transformerConstructor=ve;const _e="dataKey";function Ae(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const s=n.getContext("2d");if(!s)throw new Error("Failed to get 2D rendering context from canvas");const r=s.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const s=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*s[0]),r.data[a+1]=Math.round(255*s[1]),r.data[a+2]=Math.round(255*s[2]),r.data[a+3]=255}return s.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[_e]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class Se extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=Ae(t);t.type="common",t.dataKey=_e,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(s=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==s?s:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class Te extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=Se}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}Te.type="sequenceScatterPixel",Te.view="singleDefault",Te.transformerConstructor=Se;class Be extends e.SankeyChartSpecTransformer{constructor(){super(...arguments),this.seriesType="compareSankey"}transformSpec(t){super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.subNodeGap=t.subNodeGap,e.subNodeMinSize=t.subNodeMinSize,e.compareNodeColor=t.compareNodeColor,e.compareLinkColor=t.compareLinkColor,e.activeLink=t.activeLink,e}}const we=t=>{const e=t[0];if(!e.latestData)return[];const i=Object.keys(e.latestData);if(!i.length)return{};const n=[];return i.forEach((t=>{n.push(...e.latestData[t].nodes)})),[{nodes:n}]},Me=t=>{let e=0;return t.forEach((t=>{var i;l(t.value)&&((null===(i=t.children)||void 0===i?void 0:i.length)?t.value=Me(t.children):t.value=0),e+=Math.abs(t.value)})),e};function ke(t,e){const i=[],n=[],s={},r={},a=[];return function(t,e,i=[],n={},s){Me(t);const r=(t,a,o)=>{t.forEach(((t,h)=>{const c=e?e(t):o?`${o[o.length-1].key}-${h}`:`${a}-${h}`,u=l(t.value)?0:W(t.value);if(n[c])n[c].value=void 0;else{const e={depth:a,datum:t,index:h,key:c,value:u,sourceLinks:[],targetLinks:[]};n[c]=e,i.push(e)}o&&s&&s.push({source:o[o.length-1].key,target:c,value:u,parents:o}),t.children&&t.children.length&&r(t.children,a+1,o?o.concat([n[c]]):[n[c]])}))};r(t,0,null)}(t,e,i,s,a),a.forEach(((t,e)=>{const i=`${t.source}-${t.target}`,a=R(t,["parents"]);if(a.parents=t.parents.map((t=>R(t,["sourceLinks","targetLinks"]))),r[i])return r[i].value+=W(t.value),void r[i].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};n.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),r[i]=o})),{nodes:i,links:n,nodeMap:s}}const Ce=(t,e)=>{var i,n;const s=t[0];if(!(null===(i=s.latestData)||void 0===i?void 0:i.length))return{};const r=null!==(n=e.subNodeMinSize)&&void 0!==n?n:0,a=e.rawData().latestData[0],h=e.subNodeGap,c=o(e.nodeKey)?e.nodeKey:e.nodeKey?((t,e={})=>{if(f(t)){const i=t.map((t=>H(t,e)));return t=>i.map((e=>e(t)))}return H(t,e)})(e.nodeKey):null,u={};a.subNode.forEach((t=>{u[t.type]=ke(t.nodes,c),function(t){for(let e=0,i=t.length;e<i;e++){const i=t[e];i.value=Math.max(l(i.value)?0:W(i.value),i.sourceLinks.reduce(((t,e)=>{var i;return t+(null!==(i=W(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=W(e.value))&&void 0!==i?i:0)}),0))}}(u[t.type].nodes)}));const d=Object.keys(u).length;return s.latestData[0].nodes.forEach((t=>{let e=[];if(t.targetLinks.length){e=[...t.targetLinks[0].parents]}e.push(t.key);let i=t.y0;const n=t.y1-t.y0-(d-1)*h,s=t.value;a.subNode.forEach((e=>{const a=u[e.type].nodes.find((e=>e.key===t.key));if(!a)return;const o=0===s?0:a.value/s,l=Math.max(r,n*o);a.x0=t.x0,a.x1=t.x1,a.y0=i,a.y1=i+l,a.type=e.type,a.sourceNode=t,i+=l+h}))})),u},Oe=t=>"line"===t||"area"===t,Pe=(t,e)=>{t.forEach((t=>{e(t),t.children&&t.children.length&&Pe(t.children,e)}))};function Le(t,e){return t.filter((t=>e(t.data[0])))}function Ee(t,e){const i=[];return t.forEach((t=>{Pe([t],(t=>{e(t)&&i.push(t)}))})),i}function Re(t,e){const i=[];return t.forEach((t=>{const{nodes:n}=t,s=Jt(t,["nodes"]);s.datum=[],n.forEach((t=>{e(t)&&s.datum.push(t)})),i.push(s)})),i}class De extends e.SankeyChart{constructor(){super(...arguments),this.type="compareSankey",this.seriesType=Ie.type,this.transformerConstructor=Be}}De.type="compareSankey",De.transformerConstructor=Be;class Ie extends e.SankeySeries{constructor(){super(...arguments),this.type="compareSankey",this._fillCompareNode=t=>{var e,i,n;return(null===(e=this._spec.compareNodeColor)||void 0===e?void 0:e[t.type])?this._spec.compareNodeColor[t.type]:null!==(n=null===(i=this._spec.node.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this._fillByNode(t)},this._fillActiveLink=t=>{var e,i,n;return(null===(e=this._spec.compareLinkColor)||void 0===e?void 0:e[t.type])?this._spec.compareLinkColor[t.type]:null!==(n=null===(i=this._spec.link.style)||void 0===i?void 0:i.fill)&&void 0!==n?n:this._fillByLink(t)}}initData(){var t,i;super.initData();const{dataSet:n}=this._option,s=new Zt(n,{name:`compare-sankey-sub-data-${this.id}-data`});s.parse([this.getViewData()],{type:"dataview"}),this._subData=s;const r=new Zt(n,{name:`compare-sankey-node-${this.id}-data`});r.parse([s],{type:"dataview"}),e.registerDataSetInstanceTransform(this._dataSet,"compareSankeySubData",Ce),s.transform({type:"compareSankeySubData",options:{rawData:()=>this.getRawData(),valueField:this._valueField,nodeKey:this._spec.nodeKey,subNodeGap:null!==(t=this._spec.subNodeGap)&&void 0!==t?t:2,subNodeMinSize:null!==(i=this._spec.subNodeMinSize)&&void 0!==i?i:0}}),e.registerDataSetInstanceTransform(this._dataSet,"compareSankeySubNodes",we),r.transform({type:"compareSankeySubNodes"}),this._nodesSeriesData.getDataView().parse([r],{type:"dataview"}),this._activeLinkData=new Zt(n,{name:`compare-sankey-link-${this.id}-data`})}initEvent(){var t;super.initEvent(),null===(t=this._activeLinkData)||void 0===t||t.target.addListener("change",this.activeLinkDataUpdate.bind(this))}initMark(){super.initMark();const t=this._createMark(Object.assign(Object.assign({},e.SankeySeries.mark.link),{name:"activeLink"}),{dataView:this._activeLinkData});t&&(this._activeLinkMark=t)}compileData(){var t;super.compileData(),null===(t=this._activeLinkMark)||void 0===t||t.compileData()}_initLinkMarkStyle(){super._initLinkMarkStyle(),this._activeLinkMark.setAttribute("direction",this.direction),this.setMarkStyle(this._activeLinkMark,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this.setMarkStyle(this._activeLinkMark,{fill:this._fillActiveLink},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.User_Mark)}_initNodeMarkStyle(){super._initNodeMarkStyle(),this._spec.compareNodeColor&&this.setMarkStyle(this._nodeMark,{fill:this._fillCompareNode},"normal",e.AttributeLevel.User_Mark)}activeLinkDataUpdate(){this._activeLinkMark.getData().updateData()}_handleNodeRelatedClick(t,i,n){const s=t.getDatum(),r=this._nodeMark.getProductElements();if(!r||!r.length)return;const a=this._linkMark.getProductElements();if(!a||!a.length)return;a.forEach((t=>{t.removeState([e.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS])})),this._highLightElements(a,[],i,n);const o=r.map((t=>{return(e=t)&&e.graphicItem?Oe(e.graphicItem.type)?e.data:e.data[0]:null;var e})),l=o.filter((t=>t.key===s.key)),h=[],c=l.map((t=>t.key));this._activeTargetLink(s,l,r,a,c,h,i,n),this._activeSourceLink(s,l,o,r,c,h,i,n),this._highLightElements(r,c,i,n),this._activeLinkData.parseNewData(h),this._needClear=!0}_activeTargetLink(t,i,n,s,r,a,o,l){this._handleClearEmpty(o,l);const h=t.sourceNode.targetLinks[0];if(!h)return;let c=0;i.forEach((t=>{const i=t.targetLinks.find((t=>t.key===h.key));if(i){const n=i.value/h.value,s=h.key+"_"+t.type,r=Object.assign(Object.assign({},h),{y0:h.y0-h.thickness/2+(c+n/2)*h.thickness,y1:t.y0+n*h.thickness/2,thickness:n*h.thickness,key:s,type:t.type,[e.DEFAULT_DATA_INDEX]:a.length,[e.DEFAULT_DATA_KEY]:s});a.push(r),c+=n}})),r.push(...h.parents,t.key);const u=[];for(let t=0;t<h.parents.length-1;t++)u.push(h.parents[t]+"-"+h.parents[t+1]);this._highLightElements(s,u,o,l)}_activeSourceLink(t,i,n,s,r,a,o,l){this._handleClearEmpty(o,l);const h=t.sourceNode.sourceLinks;if(!(null==h?void 0:h.length))return;const c={};h.forEach((t=>{r.push(t.target),i.forEach(((i,s)=>{var r;c[i.type]=null!==(r=c[i.type])&&void 0!==r?r:0;const o=i.sourceLinks.find((e=>e.key===t.key));if(o){const r=o.value/i.value,l=i.y1-i.y0,h=l*r,u=t.key+"_"+i.type,d=Object.assign(Object.assign({},t),{y0:i.y0+c[i.type]*l+h/2,thickness:h,key:u,type:i.type,[e.DEFAULT_DATA_INDEX]:a.length,[e.DEFAULT_DATA_KEY]:u});if(0===s)d.y1=t.y1-t.thickness/2+h/2;else{const t=n.find((t=>t.key===o.target&&t.type===i.type));if(!t)return;d.y1=t.y0+h/2}a.push(d),c[i.type]+=r}}))}))}_handleClearEmpty(t,i){super._handleClearEmpty(t,i),this._activeLinkData.parseNewData([]);const n=this._nodeMark.getProductElements();!n&&n.length||n.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}));const s=this._linkMark.getProductElements();!s&&s.length||s.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}))}_handlePointerOutElement(){this._activeLinkData.parseNewData([])}_clearAllSelectedState(){super._clearAllSelectedState(),this._activeLinkData.parseNewData([])}getSubNodeDatum(t){return Le(this._nodeMark.getProductElements(),t)}getNodeDatumInTree(t){return Ee(this._rawData.latestData[0].nodes,t)}getNodeDatumInSubTree(t){return Re(this._rawData.latestData[0].subNode,t)}}Ie.type="compareSankey";class Ne extends e.SankeyChartSpecTransformer{constructor(){super(...arguments),this.seriesType="compareSankeyDiff"}transformSpec(t){super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.subNodeGap=t.subNodeGap,e.subNodeMinSize=t.subNodeMinSize,e.compareNodeColor=t.compareNodeColor,e.compareLinkColor=t.compareLinkColor,e}}const Ue=(t,e)=>{var i,n,s,r,a,o,l;const h=t[0];if(!(null===(i=h.latestData)||void 0===i?void 0:i.length))return{};const c=null!==(n=e.subNodeMinSize)&&void 0!==n?n:0,u=e.subNodeGap,d=[],p=h.dataSet.getTransform("sankeyLayout"),f=Object.assign({},h.transformsArr.find((t=>"sankeyLayout"===t.type)).options);delete f.customLayout;const g=h.latestData[0];null===(l=null===(o=null===(a=null===(r=null===(s=h.rawData)||void 0===s?void 0:s[0])||void 0===r?void 0:r.latestData)||void 0===a?void 0:a[0])||void 0===o?void 0:o.subNode)||void 0===l||l.forEach((t=>{const{nodes:e}=t,i=Jt(t,["nodes"]),n=p([Object.assign({nodes:e},i)],f);Object.keys(i).forEach((t=>{n[0].nodes.forEach((e=>{e[t]=i[t]}))})),d.push({data:n,external:i})}));const y=d.length;h.latestData[0].nodes.forEach(((t,e)=>{let i=t.y0;const n=t.y1-t.y0-(y-1)*u,s=t.value;d.forEach((r=>{var a;let o=r.data[0].nodes[e];if(o.key!==t.key&&(o=r.data[0].nodes.find((t=>t.key==t.key))),!o)return;const l=0===s?0:o.value/s,h=Math.max(c,n*l),d=t.x0-o.x0,p=o.y0,f=o.y1-o.y0,g=h/f;o._compare_compute_temp={diffX:d,lastY0:p,lastSize:f,sizeMultiply:g},o.x0=t.x0,o.x1=t.x1,o.y0=i,o.y1=i+h,i+=h+u,null===(a=o.sourceLinks)||void 0===a||a.forEach((t=>{var e;t.type=o.type,t.x0=(null!==(e=t.x0)&&void 0!==e?e:0)+d,t.thickness=t.thickness*g,t.y0=(t.y0-p)*g+o.y0,t.sourceRect&&(t.sourceRect.x0=o.x0,t.sourceRect.x1=o.x1,t.sourceRect.y0=o.y0,t.sourceRect.y1=o.y1)}))}))})),d.forEach((t=>{t.data[0].nodes.forEach((t=>{var e;const{diffX:i,lastY0:n,sizeMultiply:s}=t._compare_compute_temp;null===(e=t.targetLinks)||void 0===e||e.forEach((e=>{var r;e.x1=(null!==(r=e.x1)&&void 0!==r?r:0)+i,e.y1=(e.y1-n)*s+t.y0,e.targetRect&&(e.targetRect.x0=t.x0,e.targetRect.x1=t.x1,e.targetRect.y0=t.y0,e.targetRect.y1=t.y1)}))}))}));const m={columns:[],links:[],nodes:[]};return m.columns=g.columns.reduce(((t,e,i)=>(t.push(d.reduce(((t,e)=>t.concat(e.data[0].columns[i])),[])),t)),[]),m.links=d.reduce(((t,e)=>t.concat(e.data[0].links)),[]),m.nodes=d.reduce(((t,e)=>t.concat(e.data[0].nodes)),[]),[m]};class je extends e.SankeyChart{constructor(){super(...arguments),this.type="compareSankeyDiff",this.seriesType=Fe.type,this.transformerConstructor=Ne}}je.type="compareSankeyDiff",je.transformerConstructor=Ne;class Fe extends e.SankeySeries{constructor(){super(...arguments),this.type="compareSankeyDiff",this._fillCompareNode=t=>{var e,i,n,s;const r=this._spec;return(null===(e=r.compareNodeColor)||void 0===e?void 0:e[t.type])?r.compareNodeColor[t.type]:null!==(s=null===(n=null===(i=this._spec.node)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill)&&void 0!==s?s:this._fillByNode(t)},this._fillCompareLink=t=>{var e,i,n,s;const r=this._spec;return(null===(e=r.compareLinkColor)||void 0===e?void 0:e[t.type])?r.compareLinkColor[t.type]:null!==(s=null===(n=null===(i=this._spec.link)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fill)&&void 0!==s?s:this._fillByLink(t)}}initData(){var t,i;super.initData();const{dataSet:n}=this._option,s=new Zt(n,{name:`compare-sankey-diff-compare-data-${this.id}-data`});s.parse([this.getViewData()],{type:"dataview"}),e.registerDataSetInstanceTransform(this._dataSet,"compareSankeyDiffSubData",Ue),s.transform({type:"compareSankeyDiffSubData",options:{rawData:()=>this.getRawData(),valueField:this._valueField,nodeKey:this._spec.nodeKey,subNodeGap:null!==(t=this._spec.subNodeGap)&&void 0!==t?t:2,subNodeMinSize:null!==(i=this._spec.subNodeMinSize)&&void 0!==i?i:0}}),this._nodesSeriesData.getDataView().parse([s],{type:"dataview"}),this._linksSeriesData.getDataView().parse([s],{type:"dataview"})}compileData(){super.compileData()}_initLinkMarkStyle(){super._initLinkMarkStyle(),this._spec.compareLinkColor&&this.setMarkStyle(this._linkMark,{fill:this._fillCompareLink},"normal",e.AttributeLevel.User_Mark)}_initNodeMarkStyle(){super._initNodeMarkStyle(),this._spec.compareNodeColor&&this.setMarkStyle(this._nodeMark,{fill:this._fillCompareNode},"normal",e.AttributeLevel.User_Mark)}_handleClearEmpty(t,i){super._handleClearEmpty(t,i);const n=this._nodeMark.getProductElements();!n&&n.length||n.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}));const s=this._linkMark.getProductElements();!s&&s.length||s.forEach((t=>{t.removeState(e.STATE_VALUE_ENUM.STATE_HOVER)}))}getSubNodeDatum(t){return Le(this._nodeMark.getProductElements(),t)}getNodeDatumInTree(t){return Ee(this._rawData.latestData[0].nodes,t)}getNodeDatumInSubTree(t){return Re(this._rawData.latestData[0].subNode,t)}}Fe.type="compareSankeyDiff";class ze{static GenAutoIncrementId(){return ze.auto_increment_id++}}ze.auto_increment_id=0;class We{constructor(t){this.id=ze.GenAutoIncrementId(),this.registry=t}}const Ge="named",He="inject",Ye="inversify:tagged",Ve="inversify:paramtypes";class Xe{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Ge?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var $e=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=g(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=g(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof 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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!f(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(f(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(f(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function f(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function qe(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};$e.hasOwnMetadata(t,e)&&(r=$e.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,$e.defineMetadata(t,r,e)}(Ye,t,i.toString(),n)}function Ke(t){return(e,i,n)=>{qe(e,0,n,t)}}const Ze=(Je=He,t=>(e,i,n)=>Ke(new Xe(Je,t))(e,i,n));var Je;function Qe(){return function(t){return $e.defineMetadata(Ve,null,t),t}}function ti(t){return Ke(new Xe(Ge,t))}const ei="Singleton",ii="Transient",ni="ConstantValue",si="DynamicValue",ri="Factory",ai="Function",oi="Instance",li="Invalid";class hi{constructor(t,e){this.id=ze.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=li,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===ei&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class ci{getConstructorMetadata(t){return{compilerGeneratedMetadata:$e.getMetadata(Ve,t),userGeneratedMetadata:$e.getMetadata(Ye,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ui=(di=Ge,t=>{const e=e=>{if(null==e)return!1;if(e.key===di&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===di&&i[e].value===t)return!0;return!1};return e.metaData=new Xe(di,t),e});var di;class pi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=ei,this}inTransientScope(){return this._binding.scope=ii,this}whenTargetNamed(t){return this._binding.constraint=ui(t),this}}class fi{constructor(t){this._binding=t}to(t){return this._binding.type=oi,this._binding.implementationType=t,new pi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=si,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new pi(this._binding)}toConstantValue(t){return this._binding.type=ni,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ei,new pi(this._binding)}toFactory(t){return this._binding.type=ri,this._binding.factory=t,this._binding.scope=ei,new pi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const gi=Symbol("ContributionProvider");class yi{constructor(t,e){this.serviceIdentifier=t,this.container=e,bi.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function mi(t,e){t(gi).toDynamicValue((({container:t})=>new yi(e,t))).inSingletonScope().whenTargetNamed(e)}class bi{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}bi.store=new Map;class vi{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class xi extends vi{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}var _i;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(_i||(_i={}));const Ai=X-1e-8;class Si{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>Ai)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(f(n),f(s),s!==n)if((n%=X)<0&&(n+=X),(s%=X)<0&&(s+=X),s<n&&(r=!r,a=n,n=s,s=a),r)for(s-=X,a=n-n%V,o=0;o<4&&a>s;++o,a-=V)f(a);else for(a=n-n%V+V,o=0;o<4&&a<s;++o,a+=V)f(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(...t){}}class Ti{constructor(){this._curves=[],this.bounds=new _t}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Bi=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,wi={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},Mi=0,ki=1,Ci=2,Oi=3,Pi=4,Li=5,Ei=6,Ri=7,Di=8;let Ii,Ni,Ui,ji,Fi,zi;var Wi,Gi,Hi,Yi,Vi,Xi,$i,qi,Ki;function Zi(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(n),f=Math.sin(n),g=Math.cos(s),y=Math.sin(s),m=.5*(s-n),b=Math.sin(.5*m),v=8/3*b*b/Math.sin(m),x=e+p-v*f,_=i+f+v*p,A=e+g,S=i+y,T=A+v*y,B=S-v*g;return[h*x+c*_,u*x+d*_,h*T+c*B,u*T+d*B,h*A+c*S,u*A+d*S]}function Ji(t,e,i,n){const s=function(t,e,i,n,s,r,a,o,l){const h=ot(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,y=c/i,m=-c/n,b=u/n,v=g*o+y*l,x=m*o+b*l,_=g*t+y*e,A=m*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===s&&(T=-T);const B=.5*(v+_)-T*(A-x),w=.5*(x+A)+T*(_-v),M=Math.atan2(x-w,v-B);let k=Math.atan2(A-w,_-B)-M;k<0&&1===r?k+=X:k>0&&0===r&&(k-=X);const C=Math.ceil(Math.abs(k/(V+.001))),O=[];for(let t=0;t<C;++t){const e=M+t*k/C,s=M+(t+1)*k/C;O[t]=[B,w,e,s,i,n,c,u]}return O}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=Zi(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!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=179]="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",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Wi||(Wi={})),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"}(Gi||(Gi={})),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"}(Hi||(Hi={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Yi||(Yi={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Vi||(Vi={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Xi||(Xi={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}($i||($i={})),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"}(qi||(qi={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ki||(Ki={}));const Qi=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function tn(t,e,i=0,n=0,s=1,r=1,a){for(let o=0;o<t.length;o++){const l=t[o];Qi[l[0]](l,e,i,n,s,r,a)}}class en{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function nn(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],a=e[s],o=t[(s+1)%n],l=e[(s+1)%n];i+=at.distanceNN(r,a,o,l)}return i/2}function sn(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function rn(t,e,i,n,s){const r=sn(t.x,e.x,i.x,n.x,s),a=sn(t.y,e.y,i.y,n.y,s);return new rt(r,a)}function an(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function on(t,e,i,n){const s=an(t.x,e.x,i.x,n),r=an(t.y,e.y,i.y,n);return new rt(s,r)}class ln extends en{constructor(t,e,i){super(),this.type=qi.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return on(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,nn([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===$i.ROW?q(this.p0.x-this.p2.x):t===$i.COLUMN?q(this.p0.y-this.p2.y):0}getAngleAt(t){const e=J(t-.01,0),i=Q(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return K(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=on(i,n,s,e),a=at.pointAtPP(i,n,e),o=at.pointAtPP(n,s,e);return[new ln(i,a,r),new ln(r,o,s)]}(this,r);t.quadraticCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}function hn(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,a=rn(i,n,s,r,e),o=at.pointAtPP(i,n,e),l=at.pointAtPP(n,s,e),h=at.pointAtPP(s,r,e),c=at.pointAtPP(o,l,e),u=at.pointAtPP(l,h,e);return[new cn(i,o,c,a),new cn(a,u,h,r)]}class cn extends en{constructor(t,e,i,n){super(),this.type=qi.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){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)}getPointAt(t){if(!1!==this.defined)return rn(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,nn([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===$i.ROW?q(this.p0.x-this.p3.x):t===$i.COLUMN?q(this.p0.y-this.p3.y):0}getAngleAt(t){const e=J(t-.01,0),i=Q(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return K(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[a]=hn(this,r);t.bezierCurveTo(a.p1.x*n+e,a.p1.y*s+i,a.p2.x*n+e,a.p2.y*s+i,a.p3.x*n+e,a.p3.y*s+i)}}includeX(t){const e=Q(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=J(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=Q(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(J(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class un extends en{constructor(t,e){super(),this.type=qi.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return at.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=K(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?at.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===$i.ROW?q(this.p0.x-this.p1.x):t===$i.COLUMN?q(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*n+e,a.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class dn{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,s,r,a,o){const l=new cn(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n),new rt(s,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=s,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,s){const r=new un(new rt(this._lastX,this._lastY),new rt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===$i.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return q(t.p0.y-n.y)}if(t===$i.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return q(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class pn extends dn{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function fn(t,e,i=1){let n=!1;for(let i=0,s=e.length;i<=s;i++)i>=s===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function gn(t,e,i){const n=null!=e?e:q(i[i.length-1].x-i[0].x)>q(i[i.length-1].y-i[0].y)?$i.ROW:$i.COLUMN;return"monotoneY"===t?new pn(t,n):new dn(t,n)}class yn{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function mn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=gn("linear",i,t);return function(t,e){fn(t,e,1)}(new yn(s,n),t),s}function bn(t,e,i,n,s){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+i)/6,n,t.lastPoint1)}class vn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&bn(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:bn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function xn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return mn(t,e);const s=gn("basis",i,t);return function(t,e){fn(t,e,2)}(new vn(s,n),t),s}function _n(t){return t<0?-1:1}function An(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(_n(r)+_n(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Sn(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Tn(t,e,i,n,s){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,n,t.lastPoint1)}class Bn{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Tn(this,this._t0,Sn(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Tn(this,Sn(this,e=An(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Tn(this,this._t0,e=An(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class wn extends Bn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Mn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return mn(t,e);const s=gn("monotoneX",i,t);return function(t,e){fn(t,e,2)}(new Bn(s,n),t),s}function kn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return mn(t,e);const s=gn("monotoneY",i,t);return function(t,e){fn(t,e,2)}(new wn(s,n),t),s}let Cn=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class On extends Cn{lineEnd(){this.context.closePath()}}function Pn(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new dn("step",null!=n?n:q(t[t.length-1].x-t[0].x)>q(t[t.length-1].y-t[0].y)?$i.ROW:$i.COLUMN);return Ln(new Cn(r,e,s),t),r}function Ln(t,e){return fn(t,e,1)}class En extends yn{lineEnd(){this.context.closePath()}}function Rn(t,e={}){const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=gn("linear",i,t);return function(t,e){fn(t,e,1)}(new En(s,n),t),s}function Dn(t,e,i,n,s){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>1e-12){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/s,l=(l*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,n,t.lastPoint1)}function In(t,e){return function(i,n,s={}){const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return mn(i,s);const o=gn(t,r,i);return fn(new e(o,n,a),i,2),o}}const Nn=In("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Dn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Un=In("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Dn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class jn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new un(new rt(this._lastX,this._lastY),new rt(t,e))}quadraticCurveTo(t,e,i,n){const s=new ln(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const a=new cn(new rt(this._lastX,this._lastY),new rt(t,e),new rt(i,n),new rt(s,r));this.path.addCurve(a),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Fn(t,e,i){var n,s;switch(e){case"linear":default:return mn(t,i);case"basis":return xn(t,i);case"monotoneX":return Mn(t,i);case"monotoneY":return kn(t,i);case"step":return Pn(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new dn("step",null!=n?n:q(t[t.length-1].x-t[0].x)>q(t[t.length-1].y-t[0].y)?$i.ROW:$i.COLUMN);return Ln(new On(r,e,s),t),r}(t,.5,i);case"stepBefore":return Pn(t,0,i);case"stepAfter":return Pn(t,1,i);case"catmullRom":return Nn(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Un(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return Rn(t,i)}}class zn extends Ti{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Si(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ei,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Li,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Ri,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([Ci,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([ki,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([Pi,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([Di,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([Mi,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([Oi]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new jn(this);tn(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Ei]=t=>`M${t[1]} ${t[2]}`,t[Li]=t=>`L${t[1]} ${t[2]}`,t[Ri]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Ci]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Mi]=t=>{const e=[];((t,e,i,n,s,r,a)=>{const o=Math.abs(i-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(i-e)/l;for(let i=0;i<l;i++){const o=e+h*i,l=e+h*(i+1),c=4*Math.tan(Math.abs(h)/4)/3,u=l<o?-1:1,d=Math.cos(o),p=Math.sin(o),f=Math.cos(l),g=Math.sin(l),y=d*r+n,m=p*a+s,b=f*r+n,v=g*a+s,x=r*c*u,_=a*c*u;t.push(y-x*p,m+_*d,b+x*g,v-_*f,b,v)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Di]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Oi]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(Ii=e[t],Ni=Ii.slice(1),Ui=Ii[0],i=[Ui],n=Ni.match(Bi),null!==n){for(let t=0,e=n.length;t<e;t++)ji=n[t],Fi=parseFloat(ji),Number.isNaN(Fi)||i.push(Fi);if(zi=wi[Ui],i.length-1>zi){let t,e=Ui;for(let n=1,r=i.length;n<r;n+=zi){t=[e];for(let e=n,s=n+zi;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=Fn(e,i);"x"===n?this.direction=$i.ROW:"y"===n?this.direction=$i.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[Ei]=this.moveToTransform,t[Li]=this.lineToTransform,t[Ri]=this.quadraticCurveToTransform,t[Ci]=this.bezierCurveToTransform,t[ki]=this.arcToTransform,t[Pi]=this.ellipseTransform,t[Di]=this.rectTransform,t[Mi]=this.arcTransform,t[Oi]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,n=1,s=1){let r,a,o,l,h,c=null,u=0,d=0,p=0,f=0;for(let g=0,y=t.length;g<y;++g){switch(r=t[g],1===n&&1===s||(r=Gn(r,n,s)),r[0]){case"l":u+=r[1],d+=r[2],this.lineTo(u+e,d+i);break;case"L":u=r[1],d=r[2],this.lineTo(u+e,d+i);break;case"h":u+=r[1],this.lineTo(u+e,d+i);break;case"H":u=r[1],this.lineTo(u+e,d+i);break;case"v":d+=r[1],this.lineTo(u+e,d+i);break;case"V":d=r[1],this.lineTo(u+e,d+i);break;case"m":u+=r[1],d+=r[2],this.moveTo(u+e,d+i);break;case"M":u=r[1],d=r[2],this.moveTo(u+e,d+i);break;case"c":a=u+r[5],o=d+r[6],p=u+r[3],f=d+r[4],this.bezierCurveTo(u+r[1]+e,d+r[2]+i,p+e,f+i,a+e,o+i),u=a,d=o;break;case"C":u=r[5],d=r[6],p=r[3],f=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,f+i,u+e,d+i);break;case"s":a=u+r[3],o=d+r[4],null===c[0].match(/[CcSs]/)?(p=u,f=d):(p=2*u-p,f=2*d-f),l=u+r[1],h=d+r[2],this.bezierCurveTo(p+e,f+i,l+e,h+i,a+e,o+i),p=l,f=h,u=a,d=o;break;case"S":a=r[3],o=r[4],null===c[0].match(/[CcSs]/)?(p=u,f=d):(p=2*u-p,f=2*d-f),l=r[1],h=r[2],this.bezierCurveTo(p+e,f+i,l+e,h+i,a+e,o+i),p=l,f=h,u=a,d=o;break;case"q":a=u+r[3],o=d+r[4],p=u+r[1],f=d+r[2],this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),u=a,d=o,p=r[1],f=r[2];break;case"t":a=u+r[1],o=d+r[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-l,f=2*d-h):"q"===c[0]&&(p=2*u-p,f=2*d-f),l=p,h=f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o,p=u+r[1],f=d+r[2];break;case"T":a=r[1],o=r[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+e,f+i,a+e,o+i),u=a,d=o;break;case"a":Ji(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+u+e,r[7]+d+i]),u+=r[6],d+=r[7];break;case"A":Ji(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),u=r[6],d=r[7];break;case"z":case"Z":this.closePath()}c=r}}_runCommandList(t,e=0,i=0,n=1,s=1){if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case Li:this.lineToTransform(a,e,i,n,s);break;case Ei:this.moveToTransform(a,e,i,n,s);break;case Ci:this.bezierCurveToTransform(a,e,i,n,s);break;case Ri:this.quadraticCurveToTransform(a,e,i,n,s);break;case Mi:this.arcToTransform(a,e,i,n,s);break;case Pi:this.ellipseTransform(a,e,i,n,s);break;case Di:this.rectTransform(a,e,i,n,s);break;case ki:this.arcToTransform(a,e,i,n,s);break;case Oi:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),tn(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===$i.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return q(t.p0.y-e.p1.y)}if(this.direction===$i.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return q(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this._curves.length;n++){e=this._curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let a=0;for(let s=0;s<this._curves.length;s++){const o=this._curves[s],l=o.getLength(this.direction);if(!(a+l<=r)){const s=1-(a+l-r)/l;o.draw(t,i,n,e,e,s);break}o.draw(t,i,n,e,e,1),a+=l}}}const Wn=["l",0,0,0,0,0,0,0];function Gn(t,e,i){const n=Wn[0]=t[0];if("a"===n||"A"===n)Wn[1]=e*t[1],Wn[2]=i*t[2],Wn[3]=t[3],Wn[4]=t[4],Wn[5]=t[5],Wn[6]=e*t[6],Wn[7]=i*t[7];else if("h"===n||"H"===n)Wn[1]=e*t[1];else if("v"===n||"V"===n)Wn[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Wn[n]=(n%2==1?e:i)*t[n];return Wn}const Hn={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,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new St},Yn={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Vn=Object.assign({outerBorder:Object.assign(Object.assign({},Yn),{distance:0}),innerBorder:Object.assign(Object.assign({},Yn),{distance:0})},Yn),Xn={text:"",maxLineWidth:1/0,maxWidth: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:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:_i.fontBounding,keepCenterInLine:!1},$n=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Vn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),qn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Kn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),$n),Hn),Zn=Object.assign(Object.assign({},Kn),{startAngle:0,endAngle:$,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Jn=Object.assign(Object.assign(Object.assign({},Kn),qn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Qn=Object.assign(Object.assign({},Kn),{radius:1,startAngle:0,endAngle:$}),ts=Object.assign(Object.assign({},Kn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),es=Object.assign(Object.assign({},Kn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),is=Object.assign(Object.assign(Object.assign({},Kn),qn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),ns=Object.assign(Object.assign({},Kn),{path:new zn,fillStrokeOrder:1,clipRange:1,customPath:()=>{F.getInstance().warn("空函数")}}),ss=Object.assign(Object.assign({},Kn),{points:[],cornerRadius:0,closePath:!0}),rs=Object.assign(Object.assign({},Kn),{width:100,height:100,spikes:5,thickness:.5}),as=Object.assign(Object.assign({},Kn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Kn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const os=Object.assign(Object.assign({},Kn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),ls=Object.assign(Object.assign(Object.assign({},Kn),Xn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),hs=Object.assign(Object.assign(Object.assign({},Kn),Xn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),cs=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Kn),{fill:!0,cornerRadius:0,cornerType:"round"}),us=Object.assign(Object.assign({},cs),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const ds=new class{};function ps(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}const fs=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ii,this.options=e,this.id=ze.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new ci}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,Ge,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new hi(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new fi(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[He],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case ni:case ai:e=t.cache;break;case oi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===ei&&(t.cache=e,t.activated=!0)}},gs=Symbol.for("CanvasFactory");function ys(t){return fs.getNamed(gs,ds.global.env)(t)}const ms=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=ys(Object.assign({nativeCanvas:ds.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=ys(Object.assign({nativeCanvas:ds.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},bs={arc:Zn,area:Jn,circle:Qn,line:is,path:ns,symbol:os,text:ls,rect:as,polygon:ss,star:rs,richtext:hs,richtextIcon:us,image:cs,group:ts,glyph:es},vs=Object.keys(bs);function xs(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const _s={arc:Object.assign({},bs.arc),area:Object.assign({},bs.area),circle:Object.assign({},bs.circle),line:Object.assign({},bs.line),path:Object.assign({},bs.path),symbol:Object.assign({},bs.symbol),text:Object.assign({},bs.text),rect:Object.assign({},bs.rect),polygon:Object.assign({},bs.polygon),star:Object.assign({},bs.star),richtext:Object.assign({},bs.richtext),richtextIcon:Object.assign({},bs.richtextIcon),image:Object.assign({},bs.image),group:Object.assign({},bs.group),glyph:Object.assign({},bs.glyph)};class As{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},vs.forEach((t=>{this._defaultTheme[t]=Object.create(_s[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,F.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;vs.forEach((n=>{const s=Object.create(_s[n]);t&&t[n]&&xs(s,t[n]),i[n]&&xs(s,i[n]),e[n]&&xs(s,e[n]),this.combinedTheme[n]=s})),e.common&&vs.forEach((t=>{xs(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ss=new As;function Ts(t,e){return t.glyphHost?Ts(t.glyphHost):e?(t.isContainer,e):function(t){let 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)):Ss.getTheme()}return null}(t)||t.attachedThemeGraphic&&Ts(t.attachedThemeGraphic)||Ss.getTheme()}var Bs=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class ws extends s{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=ze.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Bs(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&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}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)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)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)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)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&F.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)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{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._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}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>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}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=c(i)&&i.once,r=o(e)?void 0:e;return t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=a(i,!0)&&i||c(i)&&i.capture,s=o(e)?void 0:e;t=n?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Ms{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Ms.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class ks extends Ms{constructor(t,e){super(),this.type=t,this.detail=e}}const Cs={dispatchEvent(t){var e;if(!(t instanceof Ms))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new ks(t,e))}};class Os{constructor(){}static linear(t){return t}static none(){return this.linear}static get(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))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(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)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(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}static bounceIn(t){return 1-Os.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Os.bounceIn(2*t):.5*Os.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/$*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*$/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/$*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*$/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/$*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*$/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*$/e)*.5+1}}static registerFunc(t,e){Os[t]=e}}function Ps(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Os.quadIn=Os.getPowIn(2),Os.quadOut=Os.getPowOut(2),Os.quadInOut=Os.getPowInOut(2),Os.cubicIn=Os.getPowIn(3),Os.cubicOut=Os.getPowOut(3),Os.cubicInOut=Os.getPowInOut(3),Os.quartIn=Os.getPowIn(4),Os.quartOut=Os.getPowOut(4),Os.quartInOut=Os.getPowInOut(4),Os.quintIn=Os.getPowIn(5),Os.quintOut=Os.getPowOut(5),Os.quintInOut=Os.getPowInOut(5),Os.backIn=Os.getBackIn(1.7),Os.backOut=Os.getBackOut(1.7),Os.backInOut=Os.getBackInOut(1.7),Os.elasticIn=Os.getElasticIn(1,.3),Os.elasticOut=Os.getElasticOut(1,.3),Os.elasticInOut=Os.getElasticInOut(1,.3*1.5),Os.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Os.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Os.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Os[`flicker${t}`]=e=>Ps(e,t);for(let t=2;t<10;t++)Os[`aIn${t}`]=e=>t*e*e+(1-t)*e;const Ls=new class{constructor(){this.id=ze.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(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++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Yi.END?this.removeAnimate(e):e.status===Yi.RUNNING||e.status===Yi.INITIAL?(this.animateCount++,e.advance(t)):e.status===Yi.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>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),e&&t.release()}};class Es{constructor(t,e,i,n,s){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=s,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const 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}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class Rs extends Es{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Ds{constructor(t=ze.GenAutoIncrementId(),e=Ls,i){this.id=t,this.timeline=e||Ls,this.status=Yi.INITIAL,this.tailAnimate=new Is(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=J(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ds.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Ds.mode){t&&e&Vi.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Hi.ANIMATE_PLAY})}runCb(t){const e=new Rs((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,s,r){const a=Ds.interpolateMap.get(t)||Ds.interpolateMap.get("");return!!a&&a(t,e,i,n,s,r)}pause(){this.status===Yi.RUNNING&&(this.status=Yi.PAUSED)}resume(){this.status===Yi.PAUSED&&(this.status=Yi.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Is(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(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===Yi.INITIAL&&(this.status=Yi.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Yi.RUNNING&&(this.status=Yi.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,s=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=s;if(r&&(t=s),t===n)return r;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Yi.END}stop(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()}}Ds.mode=Vi.NORMAL,Ds.interpolateMap=new Map;class Is{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new Ns(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,n="string"==typeof i?Os[i]:i,s=this._addStep(e,null,n);return s.type=Xi.customAnimate,this._appendProps(t.getEndProps(),s,!1),this._appendCustomAnimate(t,s),this}to(t,e,i,n){(null==e||e<0)&&(e=0);const s="string"==typeof i?Os[i]:i,r=this._addStep(e,null,s);return r.type=Xi.to,this._appendProps(t,r,!!n&&n.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),n&&n.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,n){this.to(t,0,i,n);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,e,i,n),this.stepTail.type=Xi.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Xi.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new Ns(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const s=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===s[t]&&(s[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(s)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,s=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=n*i+i,o&&(a=i,r=n,t=a*r+i),t===s)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,s=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=n;)i=r,r=i.next;let a=t?0===s?1:n/s:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;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{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return F.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Ns{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Us=200,js="cubicOut";var Fs;!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"}(Fs||(Fs={}));const zs=[0,0,0,0];function Ws(t,e,i){const{x:n,y:s}=nt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=nt(t.x1,t.y1,e.x1,e.y1,i),o=new rt(n,s,r,a);return o.defined=e.defined,o}function Gs(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new rt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<e.length;s++)n[s]=Ws(t[s],e[s],i)}else{n=e.map((t=>{const e=new rt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let s=0;s<t.length;s++)n[s]=Ws(t[s],e[s],i)}return n}const Hs=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};var Ys;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Ys||(Ys={}));class Vs{static Get(t,e=Ys.Color1,i=[0,0,0,1]){if(e===Ys.Color1){const e=Vs.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=Rt.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];Vs.store1[t]=e,Vs.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=Vs.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=Rt.parseColorString(t);return s&&(Vs.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],Vs.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===Ys.Color1){if(Vs.store1[t])return;Vs.store1[t]=i,Vs.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Vs.store255[t])return;Vs.store255[t]=i,Vs.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Xs(t,e=!1){return Array.isArray(t)&&m(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function $s(t,e,i,n,s){return Array.isArray(t)&&!m(t[0])||Array.isArray(e)&&!m(e[0])?new Array(4).fill(0).map(((s,r)=>qs(f(t)?t[r]:t,f(e)?e[r]:e,i,n))):qs(t,e,i,n,s)}function qs(t,e,i,n,s){if(!t||!e)return t&&Xs(t)||e&&Xs(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Vs.Get(t,Ys.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Vs.Get(e,Ys.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:Xs(a)})))});return o?$s(r,l,i,n,s):$s(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Js(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Js(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:Js(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),Xs(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),n)}Vs.store255={},Vs.store1={};const Ks=[0,0,0,0],Zs=[0,0,0,0];function Js(t,e,i){return Vs.Get(t,Ys.Color255,Ks),Vs.Get(e,Ys.Color255,Zs),`rgba(${Math.round(Ks[0]+(Zs[0]-Ks[0])*i)},${Math.round(Ks[1]+(Zs[1]-Ks[1])*i)},${Math.round(Ks[2]+(Zs[2]-Ks[2])*i)},${Ks[3]+(Zs[3]-Ks[3])*i})`}class Qs{static GetImage(t,e){var i;const n=Qs.cache.get(t);n?"fail"===n.loadState?ds.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Qs.loadImage(t,e)}static GetSvg(t,e){var i;let n=Qs.cache.get(t);n?"fail"===n.loadState?ds.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Qs.cache.set(t,n),n.dataPromise=ds.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Qs.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Qs.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ds.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ds.global.loadBlob(t):"json"===e&&(i.dataPromise=ds.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Qs.isLoading&&Qs.toLoadAueue.length){Qs.isLoading=!0;const t=Qs.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Qs.cache.set(i,s),s.dataPromise=ds.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Qs.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Qs.loading()})).catch((t=>{console.error(t),Qs.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Qs.loading()}))}}),0)}static loadImage(t,e){const i=tr(t,Qs.toLoadAueue);if(-1!==i)return Qs.toLoadAueue[i].marks.push(e),void Qs.loading();Qs.toLoadAueue.push({url:t,marks:[e]}),Qs.loading()}static improveImageLoading(t){const e=tr(t,Qs.toLoadAueue);if(-1!==e){const t=Qs.toLoadAueue.splice(e,1);Qs.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function tr(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Qs.cache=new Map,Qs.isLoading=!1,Qs.toLoadAueue=[],Qs.onLoadSuccessCb=[];class er{bounds(t,e){if(m(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return m(t)?t:Math.min(t[0],t[1])}}function ir(t,e,i,n,s){return s?t.arc(i,n,e,0,X,!1,s):t.arc(i,n,e,0,X),!1}var nr=new class extends er{constructor(){super(...arguments),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"}draw(t,e,i,n,s){return ir(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return ir(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var sr=new class extends er{constructor(){super(...arguments),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"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function rr(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var ar=new class extends er{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return rr(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return rr(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return rr(t,this.parseSize(e)/2+s,i,n,r)}};function or(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var lr=new class extends er{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return or(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return or(t,this.parseSize(e)/2+s,i,n)}};function hr(t,e,i,n,s=0){return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class cr extends er{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return hr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return hr(t,this.parseSize(e)/2,i,n,s)}}var ur=new cr;var dr=new class extends cr{constructor(){super(...arguments),this.type="triangle"}};const pr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),fr=Math.sin(X/10)*pr,gr=-Math.cos(X/10)*pr;function yr(t,e,i,n){const s=fr*e,r=gr*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let a=1;a<5;++a){const o=X*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+n),t.lineTo(l*s-h*r+i,h*s+l*r+n)}return t.closePath(),!0}var mr=new class extends er{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return yr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return yr(t,this.parseSize(e)/2+s,i,n)}};const br=et(3);function vr(t,e,i,n){const s=e,r=s/br,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var xr=new class extends er{constructor(){super(...arguments),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"}draw(t,e,i,n){return vr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return vr(t,this.parseSize(e)/2+s,i,n)}};function _r(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var Ar=new class extends er{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return _r(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return _r(t,this.parseSize(e)/2+s,i,n)}};function Sr(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Tr=new class extends er{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Sr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Sr(t,this.parseSize(e)/2+s,i,n)}};const Br=-.5,wr=et(3)/2,Mr=1/et(12);function kr(t,e,i,n){const s=e/2,r=e*Mr,a=s,o=e*Mr+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(Br*s-wr*r+i,wr*s+Br*r+n),t.lineTo(Br*a-wr*o+i,wr*a+Br*o+n),t.lineTo(Br*l-wr*h+i,wr*l+Br*h+n),t.lineTo(Br*s+wr*r+i,Br*r-wr*s+n),t.lineTo(Br*a+wr*o+i,Br*o-wr*a+n),t.lineTo(Br*l+wr*h+i,Br*h-wr*l+n),t.closePath(),!1}var Cr=new class extends er{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return kr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return kr(t,this.parseSize(e)/2+s,i,n)}};function Or(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Pr=new class extends er{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return Or(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Or(t,this.parseSize(e)/2,i,n,s)}};function Lr(t,e,i,n,s=0){return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var Er=new class extends er{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Lr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Lr(t,this.parseSize(e)/2,i,n,s)}};function Rr(t,e,i,n,s=0){return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var Dr=new class extends er{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Rr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Rr(t,this.parseSize(e)/2,i,n,s)}};const Ir=et(3);function Nr(t,e,i,n){const s=e*Ir;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Ur=new class extends er{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Nr(t,this.parseSize(e)/2/Ir,i,n)}drawOffset(t,e,i,n,s){return Nr(t,this.parseSize(e)/2/Ir+s,i,n)}};function jr(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Fr=new class extends er{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return jr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return jr(t,this.parseSize(e)/4+s,i,n)}};function zr(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var Wr=new class extends er{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return zr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return zr(t,this.parseSize(e)/4+s,i,n)}};function Gr(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Hr=new class extends er{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return Gr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Gr(t,this.parseSize(e)/4+s,i,n)}};function Yr(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Vr=new class extends er{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return Yr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Yr(t,this.parseSize(e)/4+s,i,n)}};function Xr(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var $r=new class extends er{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return Xr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Xr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function qr(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Kr=new class extends er{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return qr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return qr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function Zr(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Jr=new class extends er{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return Zr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Zr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function Qr(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ta(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var ea=new class extends er{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return m(e)?ta(t,e,i,n):Qr(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,a){m(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*s,l=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+n>o){const e=(i.x-c.x)*(o-h)/n,s=(i.y-c.y)*(o-h)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,h+=n}return!1}drawOffset(t,e,i,n,s){return m(e)?ta(t,e+2*s,i,n):Qr(t,[e[0]+2*s,e[1]+2*s],i,n)}};const ia=new _t;class na{constructor(t,e,i=!1){this.pathStr="",this.type=t,f(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),tn(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(tn(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return m(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{ia.x1=i.bounds.x1*t,ia.y1=i.bounds.y1*t,ia.x2=i.bounds.x2*t,ia.y2=i.bounds.y2*t,e.union(ia)}))}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)}}const sa={};[nr,sr,ar,lr,Ur,dr,mr,xr,Ar,Tr,Cr,Pr,Er,ur,Dr,Fr,Wr,Hr,Vr,ea,$r,Kr,Jr].forEach((t=>{sa[t.type]=t}));const ra={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"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",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class aa{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function oa(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function la(t,e,i,n=">"){const s=function(t,e,i=">"){let n,s="";for(let r=e;r<t.length;r++){let e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:s,index:r};if(t[r+1]===i[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,n);if(!s)return;let r=s.data;const a=s.index,o=r.search(/\s/);let l=r,h=!0;-1!==o&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:c}}const ha=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class ca{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,ha),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new aa("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=oa(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=la(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=oa(t,"--\x3e",r+4,"Comment is not closed.");else{const a=la(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new aa(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new aa(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function ua(t,e){return da(t)}function da(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=pa(s);if(void 0!==r&&s[r]){const t=da(s[r]);n=t,Object.keys(n).length,s[":@"]&&fa(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function pa(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function fa(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class ga{constructor(t){this.options=Object.assign({},ga.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return ua(new ca(this.options).parseXml(t),this.options)}}function ya(t,e,i,n=0){return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}ga.defaultOptions={};let ma=0;function ba(){return ma++}var va;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(va||(va={}));const xa=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>xa.set(t,!0)));const _a=new Map;function Aa(t){if(xa.has(t))return!0;if(_a.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>_a.set(t,!0))),ba(),ba();const Sa=ba();ba(),ba();const Ta=ba();ba();const Ba=ba(),wa=ba(),Ma=ba();ba(),ba(),ba(),ba(),ba();const ka=ba(),Ca=ba(),Oa=Symbol.for("GraphicCreator"),Pa={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},La=Object.keys(Pa),Ea=new _t,Ra=new St;new _t;const Da=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ia=["x","y"],Na=["scaleX","scaleY"],Ua=["angle"],ja=new rt,Fa={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class za extends ws{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(za.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new _t,this._updateTag=Wi.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;ja.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),ja.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else ja.x=s,ja.y=r;return ja}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ds.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ds.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new At),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(!this.shadowRoot)return;const e=this.shadowRoot.AABBBounds.clone();t.union(e)}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=sa[t];if(e)return e;if(e=za.userSymbolMap[t],e)return e;if(!0===((i=t=ra[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new ga,{svg:i}=e.parse(t);if(!i)return null;const n=f(i.path)?i.path:[i.path];Ea.clear();const s=[];n.forEach((t=>{const e=(new zn).fromString(t.d),i={};La.forEach((e=>{t[e]&&(i[Pa[e]]=t[e])})),s.push({path:e,attribute:i}),Ea.union(e.bounds)}));const r=Ea.width(),a=Ea.height(),o=1/J(r,a);s.forEach((t=>t.path.transform(0,0,o,o)));const l=new na(t,s,!0);return za.userSymbolMap[t]=l,l}var i;const n=(new zn).fromString(t),s=n.bounds.width(),r=n.bounds.height(),a=1/J(s,r);n.transform(0,0,a,a);const o=new na(t,n);return za.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=(a=s)?f(a)?0===a.length?0:1===a.length?a[0]:2===a.length?(zs[0]=a[0],zs[2]=a[0],zs[1]=a[1],zs[3]=a[1],zs):a:a:0;var a;return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Si(t);return tn(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){const 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}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new St),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Wi.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ds.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Wi.UPDATE_BOUNDS)&&ds.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Wi.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Wi.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Wi.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Wi.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Wi.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Gi.GLOBAL){const i=new rt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):l(null===(s=this.normalAttrs)||void 0===s?void 0:s[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=Da){for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t,e=Da){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Hi.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Wi.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Hi.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ia,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?ds.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:Hn.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:Hn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Hi.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ia,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Hi.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Na,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new St,o.postMatrix=n),ds.transformUtil.fromMatrix(n,n).scale(t,e,i)}else o.scaleX=(null!==(n=o.scaleX)&&void 0!==n?n:Hn.scaleX)*t,o.scaleY=(null!==(s=o.scaleY)&&void 0!==s?s:Hn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Hi.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Na,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Hi.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ua,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new St,r.postMatrix=i),ds.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:Hn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Hi.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ua,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new Ds(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:n,onEnd:s,onRemove:r}=t;null!=e&&i.onStart(e),null!=n&&i.onFrame(n),null!=s&&i.onEnd(s),null!=r&&i.onRemove(r),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ds.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let c;i.forEach((e=>{l[e]?(c||(c={}),c[e]=t[e]):h[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const u=this.animate({slience:!0});u.stateNames=e,u.to(h,null!==(r=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==r?r:Us,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:js),c&&this.setAttributes(c,!1,{type:Hi.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Hi.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();k(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=f(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=Wi.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Wi.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Wi.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Wi.UPDATE_SHAPE_AND_BOUNDS)===Wi.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Wi.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Wi.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Wi.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Wi.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Wi.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Wi.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Wi.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Wi.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=Hn.x,y:e=Hn.y,scaleX:i=Hn.scaleX,scaleY:n=Hn.scaleY,angle:s=Hn.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&s&&(l=this.getAnchor(a,h)),!r||1===i&&1===n)!function(t,e,i,n,s,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,f=Z(a),g=tt(a);let y,m;o?(y=o[0],m=o[1]):(y=i,m=n);const b=y-i,v=m-n,x=l*f+c*g,_=h*f+u*g,A=c*f-l*g,S=u*f-h*g;t.a=s*x,t.b=s*_,t.c=r*A,t.d=r*S,t.e=d+l*y+c*m-x*b-A*v,t.f=p+h*y+u*m-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(s),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),ds.transformUtil.fromMatrix(a,a).scale(i,n,{x:l[0],y:l[1]})}const c=this.getOffsetXY(Hn);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=Ra.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===Ls&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ds.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Hi.ANIMATE_END})}onStep(t,e,i,n,s){const r={};if(i.customAnimate)i.customAnimate.update(s,n,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,n,s,a,void 0,o,l)}this.setAttributes(r,!1,{type:Hi.ANIMATE_UPDATE,animationState:{ratio:n,end:s,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,s,r,a,o,l,h){h||(h=Object.keys(a),n.propKeys=h),r?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const c=a[r],u=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,n);if(null==c||null==u||c===u)return void(i[r]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(r,s,u,c,i),d||(d=e.customInterpolate(r,s,u,c,this,i),d||this.defaultInterpolate(c,u,r,i,l,s)||this._interpolate(r,s,u,c,i))})),n.parsedProps=l}defaultInterpolate(t,e,i,n,s,r){if(Number.isFinite(t)&&Number.isFinite(e))return n[i]=e+(t-e)*r,!0;if("fill"===i){s||(s={});const a=s.fillColorArray,o=$s(e,null!=a?a:t,r,!1,((t,e)=>{s.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){s||(s={});const a=s.strokeColorArray,o=$s(e,null!=a?a:t,r,!1,((t,e)=>{s.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){s||(s={});const a=s.shadowColorArray,o=$s(e,null!=a?a:t,r,!0,((t,e)=>{s.shadowColorArray=e}));return o&&(n[i]=o),!0}if(Array.isArray(t)&&t.length===e.length){const s=[];let a=!0;for(let i=0;i<t.length;i++){const n=e[i],o=n+(t[i]-n)*r;if(!Number.isFinite(o)){a=!1;break}s.push(o)}a&&(n[i]=s)}return!1}_interpolate(t,e,i,n,s){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ds.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return p(t,!0)?this.pathProxy=(new zn).fromString(t):this.pathProxy=new zn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Qs.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Qs.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),ds.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new ks(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}}var Wa;za.userSymbolMap={},za.mixin(Cs),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Wa||(Wa={}));class Ga extends za{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Ta,this._childUpdateTag=Wi.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new As),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new As)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===Gi.GLOBAL){const i=new rt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Wi.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ds.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ds.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Hn.x,y:e=Hn.y,dx:i=Hn.dx,dy:n=Hn.dy,scaleX:s=Hn.scaleX,scaleY:r=Hn.scaleY,angle:a=Hn.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Ts(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return ds.graphicService.updateTempAABBBounds(i),ds.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=Wi.CLEAR_BOUNDS,this._childUpdateTag&=Wi.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Wi.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Wi.UPDATE_BOUNDS||(this._childUpdateTag|=Wi.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),ds.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ds.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,ds.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{ds.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),ds.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const 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();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&Wi.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=ds.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Ga(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ga.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Ha(t){return new Ga(t)}function Ya(t,e){return!(!t&&!e)}function Va(t,e){let i;return i=f(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Xa(t,e,i){return i&&t*e>0}function $a(t,e){return t*e>0}Ga.NOWORK_ANIMATE_ATTR=Fa;const qa=Symbol.for("PolygonRenderContribution"),Ka=Symbol.for("SymbolRenderContribution"),Za=Symbol.for("InteractiveSubRenderContribution");function Ja(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Qa(t,e,i,n=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?n-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function to(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function eo(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,u,d,p,f,g,y,m;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],y=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=y,t[11]=m,t[12]=a*n+c*s+f*r+e[12],t[13]=o*n+u*s+g*r+e[13],t[14]=l*n+d*s+y*r+e[14],t[15]=h*n+p*s+m*r+e[15]),t}function io(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],y=e[13],m=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*u+A*g,t[1]=v*s+x*l+_*d+A*y,t[2]=v*r+x*h+_*p+A*m,t[3]=v*a+x*c+_*f+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*u+A*g,t[5]=v*s+x*l+_*d+A*y,t[6]=v*r+x*h+_*p+A*m,t[7]=v*a+x*c+_*f+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*u+A*g,t[9]=v*s+x*l+_*d+A*y,t[10]=v*r+x*h+_*p+A*m,t[11]=v*a+x*c+_*f+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*u+A*g,t[13]=v*s+x*l+_*d+A*y,t[14]=v*r+x*h+_*p+A*m,t[15]=v*a+x*c+_*f+A*b,t}class no{constructor(){this.pools=[]}static identity(t){return to(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return no.identity(t),t}allocateByObj(t){let 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(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const so=new no;var ro=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ao=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oo=function(t,e){return function(i,n){e(i,n,t)}};function lo(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:y=e.attribute.anchor,anchor:m}=e.attribute,b=[0,0,0];if(y){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=y[1];b[2]=null!==(n=y[2])&&void 0!==n?n:0}if(to(t),eo(t,t,[s+o,r+l,a+h]),eo(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11];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]=r*s+h*n,t[5]=a*s+c*n,t[6]=o*s+u*n,t[7]=l*s+d*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=u*s-o*n,t[11]=d*s-l*n}(t,t,f),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=e[11];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]=r*s-h*n,t[1]=a*s-c*n,t[2]=o*s-u*n,t[3]=l*s-d*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+u*s,t[11]=l*n+d*s}(t,t,p),eo(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),g){const i=so.allocate(),n=[0,0];if(m){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=y[1]}eo(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],u=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]=r*s+h*n,t[1]=a*s+c*n,t[2]=o*s+u*n,t[3]=l*s+d*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=u*s-o*n,t[7]=d*s-l*n}(i,i,g),eo(i,i,[-n[0],-n[1],0]),io(t,t,i)}}let ho=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new xi(["graphic"]),onSetStage:new xi(["graphic","stage"]),onRemove:new xi(["graphic"]),onRelease:new xi(["graphic"]),onAddIncremental:new xi(["graphic","group","stage"]),onClearIncremental:new xi(["graphic","group","stage"]),beforeUpdateAABBBounds:new xi(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new xi(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new xi(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new _t,this.tempAABBBounds2=new _t}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Si(t);return tn(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=m(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=Qa(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=m(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=Ja(s,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){ya(u,(l+h)/Math.abs(s+r),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;ya(u,o/Math.abs(s+r)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const a=s.transMatrix;s&&s.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&vt(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),ds.graphicService.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};ho=ro([Qe(),oo(0,Ze(Oa)),ao("design:paramtypes",[Object])],ho);class co{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n,s="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=_i.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;u.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=n}d[1]=u.length*n,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const uo=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Da];class po extends za{get font(){const t=this.getGraphicTheme();return this._font||(this._font=mt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))return!1;const{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Ca,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return f(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Ts(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new po({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:s,y:r}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=pt(a,i,{x:s,y:r});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:s}=ds.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){ya(s,o/Math.abs(r+a),!0,l),i.union(s)}return ds.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ds.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:f=i.lineWidth,whiteSpace:g=i.whiteSpace,suffixPosition:y=i.suffixPosition,ignoreBuf:m=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=m?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===g||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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(f/2),this._AABBBounds}const _=ds.graphicUtil.textMeasure,A=new co(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:y,measureMode:p,keepCenterInLine:b}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const s=this.getGraphicTheme(),{fontFamily:r=s.fontFamily,textAlign:a=s.textAlign,textBaseline:o=s.textBaseline,fontSize:l=s.fontSize,ellipsis:h=s.ellipsis,maxLineWidth:c,stroke:u=s.stroke,lineWidth:d=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:y=s.ignoreBuf,measureMode:m=s.measureMode,suffixPosition:b=s.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=s.keepCenterInLine}=this.attribute,A=y?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,s,A);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.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(d/2),this._AABBBounds}const T=ds.graphicUtil.textMeasure,B={fontSize:l,fontWeight:g,fontFamily:r,lineHeight:S},w=new co(r,B,T),M=f(t)?t.map((t=>t.toString())):[t.toString()],k=[],C=[0,0];let O=1/0;if(v>0&&(O=Math.max(Math.floor(v/S),1)),x&&(O=Math.min(O,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<M.length;t++){const e=M[t];let s=!0;if(t===O-1){const i=T.clipTextWithSuffix(e,B,c,h,!1,b,t!==M.length-1),n=T.measureTextPixelADscentAndWidth(i.str,B,m);k.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,B,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,B,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;s=!1}const a=T.measureTextPixelADscentAndWidth(r.str,B,m);k.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(s=!0,o=r.wordBreaked),r.str.length===e.length);else if(s){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),M.splice(t+1,0,i)}}let t=0;k.forEach((e=>{t=Math.max(t,e.width)})),C[0]=t}else{let t,e,i=0;for(let n=0,s=M.length;n<s;n++){if(n===O-1){const t=T.clipTextWithSuffix(M[n],B,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,B,m);k.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=M[n],t=T.measureTextWidth(e,B),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,B,m);k.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}C[0]=i}C[1]=k.length*S;const P={xOffset:0,yOffset:0,width:C[0],height:C[1]};w.LayoutBBox(P,a,o,k);const L=w.layoutWithBBox(P,k,a,o,S);return this.cache.layoutData=L,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const n=this.getGraphicTheme(),s=ds.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=n.maxLineWidth,ellipsis:l=n.ellipsis,fontFamily:h=n.fontFamily,fontSize:c=n.fontSize,fontWeight:u=n.fontWeight,stroke:d=n.stroke,lineWidth:p=n.lineWidth,verticalMode:f=n.verticalMode,suffixPosition:g=n.suffixPosition}=a,y=this.getLineHeight(a,n,0);let{textAlign:m=n.textAlign,textBaseline:b=n.textBaseline}=a;if(!f){const t=m;m=null!==(e=po.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=po.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=J(e,r)}));const t=Ja(m,r),e=this.cache.verticalList.length*y,i=Qa(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)Aa(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:va.VERTICAL}),n="",i=0),e.push({text:t[s],direction:va.HORIZONTAL}));return n&&e.push({text:n,direction:va.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?n.ellipsis:l,a=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,g);v[e]=a.verticalList,r=a.width}else{const i=s.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===va.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=J(e,r)}));const x=Ja(m,r),_=this.cache.verticalList.length*y,A=Qa(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=Hs(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=uo){return super.needUpdateTags(t,e)}needUpdateTag(t,e=uo){return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new po(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return po.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return po.baselineMapAlign}getAlignMapBaseline(){return po.alignMapBaseline}}function fo(t){return new po(t)}po.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Fa),po.baselineMapAlign={top:"left",bottom:"right",middle:"center"},po.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const go=["symbolType","size",...Da];let yo=class t extends za{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=ka}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return f(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Ts(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=ds.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;ya(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return ds.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(f(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,go)}needUpdateTag(t){return super.needUpdateTag(t,go)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=f(e)?e:[e,e];return t.path?(new zn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new zn).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function mo(t){return new yo(t)}yo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Fa);const bo=["segments","points","curveType","curveTension",...Da];class vo extends za{constructor(t={}){super(t),this.type="line",this.numberType=Ba}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gs(i,n,e))}getGraphicTheme(){return Ts(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ds.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return ds.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,bo)}needUpdateTag(t){return super.needUpdateTag(t,bo)}toCustomPath(){const t=this.attribute,e=new zn,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new vo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vo.NOWORK_ANIMATE_ATTR}}function xo(t){return new vo(t)}vo.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Fa);const _o=["path","customPath",...Da];class Ao extends za{constructor(t){super(t),this.type="path",this.numberType=wa}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof zn?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof zn?this.cache:t.path)}getGraphicTheme(){return Ts(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=ds.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}})(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return ds.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new zn).fromString(t.path):t.customPath&&(this.cache=new zn,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,_o)}needUpdateTag(t){return super.needUpdateTag(t,_o)}toCustomPath(){return(new zn).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Ao(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ao.NOWORK_ANIMATE_ATTR}}function So(t){return new Ao(t)}Ao.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Fa);const To=["segments","points","curveType","curveTension",...Da];class Bo extends za{constructor(t){super(t),this.type="area",this.numberType=Sa}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Ts(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ds.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return ds.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments}=t,r=i;return s.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,To)}needUpdateTag(t){return super.needUpdateTag(t,To)}toCustomPath(){const t=new zn,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new Bo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bo.NOWORK_ANIMATE_ATTR}}Bo.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Fa);const wo=["points","cornerRadius",...Da];class Mo extends za{constructor(t){super(t),this.type="polygon",this.numberType=Ma}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Ts(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ds.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return ds.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Gs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,wo)}needUpdateTag(t){return super.needUpdateTag(t,wo)}toCustomPath(){const t=this.attribute.points,e=new zn;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Mo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Mo.NOWORK_ANIMATE_ATTR}}function ko(t){return new Mo(t)}Mo.NOWORK_ANIMATE_ATTR=Fa;const Co=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};var Oo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Po=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lo=function(t,e){return function(i,n){e(i,n,t)}};const Eo=new class{constructor(){this.time=Ki.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:y=l.opacity,backgroundMode:m=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const s=t.resources.get(f);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Ts(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*y,this.doDrawImage(e,s.data,r,{backgroundMode:m,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=g*y,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=n,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*n*o,e.height*n*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*o,s=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(d=i*(u/n),p=u):"repeat-y"===s&&(p=n*(c/i),d=c);const r=t.dpr,a=ms.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),ms.free(a)}const n=t.dpr,a=t.createPattern(e,s);a.setTransform&&a.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}};let Ro=class{constructor(t){this.subRenderContribitions=t,this.time=Ki.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}};Ro=Oo([Qe(),Lo(0,Ze(gi)),Lo(0,ti(Za)),Po("design:paramtypes",[Object])],Ro);const Do=new class{constructor(){this.time=Ki.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){var p,f;const{clipConfig:g}=t.attribute;if(!g)return;const y=t.getClipPath();if(!y)return;const m=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(f=t.attribute.height)&&void 0!==f?f:b.height();m&&e.save(),e.beginPath(),!1===y.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),m&&e.clip()}};const Io=new class{constructor(){this.time=Ki.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const No=new class{constructor(){this.time=Ki.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=ms.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),ms.free(o),h}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,$),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:f=l.textureColor,textureSize:g=l.textureSize,texturePadding:y=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,f,g,y)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,f=e.AABBBounds;n=f.x1,s=f.y1;const g=i;let y;if(p){y=ms.allocate({width:f.width(),height:f.height(),dpr:i.dpr});const t=y.getContext("2d");t.clearRect(0,0,f.width(),f.height()),n=0,s=0,i=t}if(g.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;g.setTransformFromMatrix(e.parent.globalTransMatrix),g.translate(t,i,!0)}g.setCommonStyle(e,e.attribute,n,s,r),g.clip();const m=f.width(),b=f.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(m/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=mo({}));const B=d.columns?m/d.columns:x,w=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[B-S,w-T],symbolType:t});const M=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=n+x/2+r*x,l=s+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,f.width(),f.height()),i.beginPath(),!1===M.draw(i,Math.min(B-S,w-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,f.width(),f.height())}p&&(g.globalAlpha=1,g.drawImage(y.nativeCanvas,0,0,y.nativeCanvas.width,y.nativeCanvas.height,f.x1,f.y1,f.width()*g.dpr,f.height()*g.dpr)),g.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=s;let{amplitude:d=10}=s;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),f=i,g=Math.max(Math.round(f/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const y=f/h*e,m=f/Math.PI/(2*h);for(let e=0;e<f;e+=g){const i=d*Math.sin((e+y+u)/m+u);t.lineTo(e+r,p+i+a)}t.lineTo(f+r,n+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const Uo=new class{constructor(){this.time=Ki.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,y=f&&!1!==f.visible;if(!g&&!y)return;const{size:m=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=S?o:ps(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,m,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/_,(x-n)/A,l[r]),l[r].opacity=a,e.stroke()}};g&&T(p,"outerBorder"),y&&T(f,"innerBorder")}},jo=new class{constructor(){this.time=Ki.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:f=l.x,y:g=l.y,z:y=l.z,size:m=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,m,i,n,p,y,((s,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(f-i)/b,(g-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(f-i)/b,(g-n)/v,l),e.stroke())))}},Fo=No,zo=Eo,Wo={x:0,y:0,z:0,lastModelMatrix:null};class Go{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Do),this.builtinContributions.push(Io),this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ki.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ki.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Ts(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:f=l.strokeOpacity,visible:g=l.visible,x:y=l.x,y:m=l.y}=t.attribute,b=Xa(u,d,h),v=$a(u,f),x=Ya(h),_=Va(c,p);if(!g)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return tn(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-y,n-m,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-y,n-m,l),e.fill())),this.afterRenderStep(t,e,i,n,x,_,b,v,l,s,a,o),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Xa(o,l,s),p=$a(o,c),f=Ya(s,r),g=Va(a,h);return!(!t.valid||!u)&&!(!f&&!g)&&!!(d||p||i||n||r)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i,n=!1){const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Wo.x=s,Wo.y=r,Wo.z=a,Wo.lastModelMatrix=u;const p=d&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const n=so.allocate(),s=so.allocate();lo(s,t,e),io(n,u||n,s),Wo.x=0,Wo.y=0,Wo.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),so.free(s)}if(f&&!u){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,Wo.z=a,i.setTransformForCurrent()}else if(p)Wo.x=0,Wo.y=0,Wo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,this.transformWithoutTranslate(i,Wo.x,Wo.y,Wo.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Wo.x=0,Wo.y=0,Wo.z=0;return Wo}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},c={x:s,y:0},u={x:s,y:r};n.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,f=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,g=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,y=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,m=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,f,g,y,m,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s){const{context:r}=n;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:c,lastModelMatrix:u}=o;this.z=c,this.drawPathProxy(t,r,l,h,n,s)||(this.drawShape(t,r,l,h,n,s),this.z=0,r.modelMatrix!==u&&so.free(r.modelMatrix),r.modelMatrix=u),r.highPerformanceRestore()}}function Ho(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,a):t.lineTo(s+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[n]=hn(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,a)}}function Yo(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+s,o+r,a)}else d&&(h=!n,t.lineTo(d.x+s,d.y+r,a))}return h}var Vo=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Xo=class extends Go{constructor(){super(...arguments),this.numberType=Ba}draw(t,e,i,n){const s=Ts(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,a,o,l,h,c,u,d,p,g){var y;if(!e)return;t.beginPath();const m=null!==(y=this.z)&&void 0!==y?y:0;(function(t,e,i,n,s){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=s||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Yo(t,n,e,i,r,a,o),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Ho(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===n?d=$i.ROW:"y"===n?d=$i.COLUMN:"auto"===n&&(d=e.direction);const p=i*e.tryUpdateLength(d);let f=0,g=!0,y=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],n=i.getLength(d),l=(p-f)/n;if(f+=n,l<0)break;if(h){if(i.originP1===i.originP2){y=i;continue}g=Yo(t,i,y,g,r,a,o),y=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Ho(t,i,Q(l,1),s),c=!1}}})(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:m}),d.cache&&!f(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:b=0,x:v=0}=a;return!1!==i&&(p?p(t,a,o):s&&(t.setCommonStyle(d,a,b-c,v-u,o),t.fill())),!1!==n&&(g?g(t,a,o):r&&(t.setStrokeStyle(d,a,b-c,v-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,u,d){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,y=g[0];e.moveTo(y.x+a,y.y+o,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+a,i.y+o,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:m=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,m-a,b-o,l),e.fill())),!1!==n&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,m-a,b-o,l),e.stroke()))}drawShape(t,e,i,n,s,r,a,o){const l=Ts(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:f,closePath:g,curveTension:y=l.curveTension,connectedType:m=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;g&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!f.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,n,l,s,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=Fn(_(t.points,m),b,{startPoint:e,curveTension:y});return n=s,s})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Fn(_(n,m),b,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,f)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,s[f],[l,t.attribute],v,x,i,n,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let f=0,g=!1;t.cache.forEach(((r,y)=>{if(g)return;const m=r.getLength(),b=(p-f)/m;f+=m,b>0&&(g=this.drawSegmentItem(e,r,!!h,!!c,u,d,s[y],[l,t.attribute],Q(b,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,n,t,a,o)}};Xo=Vo([Qe()],Xo);var $o=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ko=function(t,e){return function(i,n){e(i,n,t)}};let Zo=class extends Go{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=ka,this.builtinContributions=[Uo,zo,Fo,jo],this.init(t)}drawShape(t,e,i,n,s,r,a,o){var l;const h=Ts(t,null==r?void 0:r.theme).symbol,{size:c=h.size,x:u=h.x,y:d=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY,fillStrokeOrder:y=h.fillStrokeOrder,clipRange:m=h.clipRange}=t.attribute,b=this.valid(t,h,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=h.keepDirIn3d}=t.attribute,B=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();let w=i,M=n,k=B;const C=e.camera;if(T&&C&&e.project){const t=e.project(i,n,B);e.camera=null,f(c)&&(c[0],c[1]),w=t.x,M=t.y,k=void 0}!1===S.draw(e,c,w,M,k,((s,r)=>{var l,c,f,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(f=r.stroke)&&void 0!==f?f:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,u-i,d-n,h),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,h):x&&m>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-n)/g,h),e.stroke()))};y?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=C,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,_,A,v,x,h,s,a,o);const O=()=>{_&&!S.isSvg&&(a?a(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},P=()=>{A&&!S.isSvg&&(o?o(e,t.attribute,h):x&&m>=1&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/g,h),e.stroke()))};y?(P(),O()):(O(),P()),this.afterRenderStep(t,e,i,n,_,A,v,x,h,s,a,o)}draw(t,e,i,n){const s=Ts(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};function Jo(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}function Qo(t,e){return Math.sqrt(t*t+e*e)}function tl(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Zo=$o([Qe(),Ko(0,Ze(gi)),Ko(0,ti(Ka)),qo("design:paramtypes",[Object])],Zo);const el=No,il=Eo;var nl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rl=function(t,e){return function(i,n){e(i,n,t)}};let al=class extends Go{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Ma,this.builtinContributions=[il,el],this.init(t)}drawShape(t,e,i,n,s,r,a,o){const l=Ts(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,y=this.valid(t,l,a,o);if(!y)return;const{fVisible:m,sVisible:b,doFill:v,doStroke:x}=y;e.beginPath(),c<=0||f(c)&&c.every((t=>0===t))?Jo(e.camera?e:e.nativeContext,h,i,n):function(t,e,i,n,s,r=!0){var a;if(e.length<3)return void Jo(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,f=h.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,y=Math.abs(Math.tan(g));let m=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=m/y;const v=Qo(u,d),x=Qo(p,f),_=Math.min(v,x);b>_&&(b=_,m=_*y);const A=tl(h,b,v,u,d),S=tl(h,b,x,p,f),T=2*h.x-A.x-S.x,B=2*h.y-A.y-S.y,w=Qo(T,B),M=tl(h,Qo(b,m),w,T,B);let k=Math.atan2(A.y-M.y,A.x-M.x);const C=Math.atan2(S.y-M.y,S.x-M.x);let O=C-k;O<0&&(k=C,O=-O),O>Math.PI&&(O-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),O&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,h,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,v,x,m,b,l,s,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,l),e.stroke()))};g?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,n,v,x,m,b,l,s,a,o)}draw(t,e,i,n){const s=Ts(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};al=nl([Qe(),rl(0,Ze(gi)),rl(0,ti(qa)),sl("design:paramtypes",[Object])],al);const ol=Symbol.for("GraphicRender"),ll=Symbol.for("LineRender"),hl=Symbol.for("PolygonRender"),cl=Symbol.for("SymbolRender");var ul=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let dl,pl=class extends Xo{constructor(){super(...arguments),this.numberType=Ba}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Ts(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:f=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:y=h.visible}=t.attribute,m=Xa(d,p,c),b=$a(d,f),v=Ya(c),x=Va(u,g);if(!t.valid||!y)return;if(!v&&!x)return;if(!(m||b||a||o))return;const{context:_}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,_,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};pl=ul([Qe()],pl);let fl=!1;const gl=new We((t=>{fl||(fl=!0,t(Xo).toSelf().inSingletonScope(),t(pl).toSelf().inSingletonScope(),t(ll).to(Xo).inSingletonScope(),t(ol).toService(ll))}));let yl=!1;const ml=new We((t=>{yl||(yl=!0,t(Zo).toSelf().inSingletonScope(),t(cl).to(Zo).inSingletonScope(),t(ol).toService(cl),t(Ka).toService(Ro),mi(t,Ka))}));let bl=!1;const vl=new We((t=>{bl||(bl=!0,t(hl).to(al).inSingletonScope(),t(ol).toService(hl),t(qa).toService(Ro),mi(t,qa))}));const xl=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class _l extends Ga{constructor(t,e){super(t),this._skipRenderAttributes=xl,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,n){const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(s)return this._setAttributes(s,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?E(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const n=e[i];!d(this.attribute[n])||o(this.attribute[n])||o(t[n])?this.attribute[n]=t[n]:E(this.attribute[n],t[n])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const n=new ks(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}eventPosToStagePos(t){var e,i;const n={x:0,y:0},s=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(s,n),n}}const Al=Symbol.for("MathPickerContribution"),Sl=Symbol.for("MathLinePicker"),Tl=Symbol.for("MathSymbolPicker"),Bl=Symbol.for("MathPolygonPicker"),wl=Symbol.for("CanvasLinePicker"),Ml=Symbol.for("CanvasSymbolPicker"),kl=Symbol.for("CanvasPolygonPicker"),Cl=Symbol.for("CanvasPickerContribution");class Ol{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n,s)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=s||l,o)),((t,i,s,r)=>{if(o||l)return!0;const a=i.lineWidth||s.lineWidth,h=i.pickStrokeBuffer||s.pickStrokeBuffer,c=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=c?a+h:ps(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var Pl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ll=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},El=function(t,e){return function(i,n){e(i,n,t)}};let Rl=class extends Ol{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ba}};Rl=Pl([Qe(),El(0,Ze(ll)),Ll("design:paramtypes",[Object])],Rl);let Dl=!1;const Il=new We(((t,e,i,n)=>{Dl||(Dl=!0,t(Sl).to(Rl).inSingletonScope(),t(Al).toService(Sl))}));var Nl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ul=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jl=function(t,e){return function(i,n){e(i,n,t)}};let Fl=class extends Ol{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Ma}};Fl=Nl([Qe(),jl(0,Ze(hl)),Ul("design:paramtypes",[Object])],Fl);let zl=!1;const Wl=new We(((t,e,i,n)=>{zl||(zl=!0,t(Bl).to(Fl).inSingletonScope(),t(Al).toService(Bl))}));var Gl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Hl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yl=function(t,e){return function(i,n){e(i,n,t)}};let Vl=class extends Ol{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ka}};Vl=Gl([Qe(),Yl(0,Ze(cl)),Hl("design:paramtypes",[Object])],Vl);let Xl=!1;const $l=new We(((t,e,i,n)=>{Xl||(Xl=!0,t(Tl).to(Vl).inSingletonScope(),t(Al).toService(Tl))}));class ql extends Go{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:ps(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==h&&so.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var Kl=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Zl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jl=function(t,e){return function(i,n){e(i,n,t)}};let Ql=class extends ql{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ba}};Ql=Kl([Qe(),Jl(0,Ze(ll)),Zl("design:paramtypes",[Object])],Ql);let th=!1;const eh=new We(((t,e,i,n)=>{th||(th=!0,t(wl).to(Ql).inSingletonScope(),t(Cl).toService(wl))}));class ih extends Go{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==h&&so.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),u}}var nh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},sh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rh=function(t,e){return function(i,n){e(i,n,t)}};let ah=class extends ih{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ka}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:ps(n,s+r,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&so.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};ah=nh([Qe(),rh(0,Ze(cl)),sh("design:paramtypes",[Object])],ah);let oh=!1;const lh=new We(((t,e,i,n)=>{oh||(oh=!0,t(Ml).to(ah).inSingletonScope(),t(Cl).toService(Ml))}));var hh=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ch=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uh=function(t,e){return function(i,n){e(i,n,t)}};let dh=class extends Ol{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Ma}};dh=hh([Qe(),uh(0,Ze(hl)),ch("design:paramtypes",[Object])],dh);let ph=!1;const fh=new We(((t,e,i,n)=>{ph||(ph=!0,t(kl).to(dh).inSingletonScope(),t(Cl).toService(kl))})),gh=function(){!function(){if(null==dl)try{const t=document.createElement("canvas"),e=t.getContext("2d");dl=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),dl&&(dl=!!document.createElement)}catch(t){dl=!1}}();const t=ds.global&&ds.global.env;return t?"browser"===t:dl}();function yh(){yh.__loaded||(yh.__loaded=!0,Co.RegisterGraphicCreator("group",Ha))}yh.__loaded=!1;const mh=yh;function bh(){bh.__loaded||(bh.__loaded=!0,Co.RegisterGraphicCreator("line",xo),fs.load(gl),fs.load(gh?eh:Il))}bh.__loaded=!1;const vh=bh;function xh(){xh.__loaded||(xh.__loaded=!0,Co.RegisterGraphicCreator("polygon",ko),fs.load(vl),fs.load(gh?fh:Wl))}xh.__loaded=!1;const _h=xh;function Ah(){Ah.__loaded||(Ah.__loaded=!0,Co.RegisterGraphicCreator("symbol",mo),fs.load(ml),fs.load(gh?lh:$l))}Ah.__loaded=!1;const Sh=Ah;mh(),vh(),_h(),Sh();class Th extends _l{getStartAngle(){return lt(this._startAngle)}getEndAngle(){return lt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},Th.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:n,visible:s=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!s)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(I(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var s,r;const a=Co.line(Object.assign(Object.assign({points:t},f(i)?null!==(s=i[e])&&void 0!==s?s:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),B(null==n?void 0:n.line)||(a.states=f(n.line)?null!==(r=n.line[e])&&void 0!==r?r:n.line[n.line.length-1]:n.line),this.add(a),this.lines.push(a)}))}else{let t=Co.line;D(i)[0].cornerRadius&&(t=Co.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},D(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),B(null==n?void 0:n.line)||(e.states=[].concat(n.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:n=!0}=t;let s;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:f,size:g=12}=t;let y,m;"start"===i?(y={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},m=this._computeStartRotate(this._startAngle)):(y={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},m=this._computeEndRotate(this._endAngle)),s=Co.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:f,size:g,angle:n?m+d:0,strokeBoundsBuffer:0}),p)),s.name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),B(null==o?void 0:o.symbol)||(s.states=o.symbol),"start"===i?B(null==o?void 0:o.startSymbol)||(s.states=o.startSymbol):B(null==o?void 0:o.endSymbol)||(s.states=o.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let n;return n=e?b(i)?t[i]:I(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}Th.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}};class Bh{constructor(t,e,i,n){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(n)}getMarks(){return this.marks}registerChannelEncoder(t,e){return p(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=D(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class wh{static registerPlotMarks(t,e){wh._plotMarks[t]=e}static createPlotMark(t,e){return wh._plotMarks[t]?new wh._plotMarks[t](e):null}static registerMark(t,e){wh._marks[t]=e}static createMark(t,e,i){return wh._marks[t]?new wh._marks[t](e,t,i):null}static hasMark(t){return!!wh._marks[t]}static getMark(t){return wh._marks[t]}static registerComponent(t,e){wh._components[t]=e}static createComponent(t,e,i,n){const s=wh._components[t];return s?new s(e,i,n):null}static hasComponent(t){return!!wh._components[t]}static registerGraphicComponent(t,e){wh._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const n=wh._graphicComponents[t];return n?n(e,i):null}static registerTransform(t,e,i){wh._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return wh._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(wh._transforms).forEach((t=>{wh._transforms[t]&&!wh._transforms[t].isBuiltIn&&(wh._transforms[t]=null)}))}static registerGrammar(t,e,i){wh._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var n;const s=null===(n=wh._grammars[t])||void 0===n?void 0:n.grammarClass;return s?new s(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return wh._glyphs[t]}static createInteraction(t,e,i){const n=wh._interactions[t];return n?new n(e,i):null}static hasInteraction(t){return!!wh._interactions[t]}}wh._plotMarks={},wh._marks={},wh._components={},wh._graphicComponents={},wh._transforms={},wh._grammars={},wh._glyphs={},wh._animations={},wh._interactions={},wh._graphics={},wh._stageEventPlugins={},wh.registerGlyph=(t,e,i,n,s)=>(wh._glyphs[t]=new Bh(e,i,n,s),wh._glyphs[t]),wh.registerAnimationType=(t,e)=>{wh._animations[t]=e},wh.getAnimationType=t=>wh._animations[t],wh.registerInteraction=(t,e)=>{wh._interactions[t]=e},wh.registerGraphic=(t,e)=>{wh._graphics[t]=e},wh.getGraphicType=t=>wh._graphics[t],wh.createGraphic=(t,e)=>{const i=wh._graphics[t];return i?i(e):null},wh.registerDefaultLayout=t=>{wh.defaultLayout=t},wh.getDefaultLayout=()=>wh.defaultLayout,wh.registerStageEventPlugin=(t,e)=>{wh._stageEventPlugins[t]=e},wh.getStageEventPlugin=t=>wh._stageEventPlugins[t];const Mh="seriesBreak";function kh(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*n,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?d:-d):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}const Ch=(t,e)=>{const{start:i,end:n}=e,s=i.x===n.x,r=s?"x":"y",a=s?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e,i=1e-10,n=1e-10){const s=n,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(s,r)}(t.start[r],i[r])){const e=Math.min(i[a],n[a]),s=Math.max(i[a],n[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(s<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,s),void(o=!1)}})),o&&t.push(e)};class Oh extends _l{constructor(){super(...arguments),this.name=Mh}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(B(t))return;const e=[],i=[];t.forEach((t=>{const{start:n,end:s}=t,r=n.x===s.x;Ch(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:n,end:s,size:r=4,gap:a=5,style:o={}}=t,l=Jt(t,["start","end","size","gap","style"]),c=Ha({}),u=n.x===s.x;let d,p,f,g;u?(d={x:n.x-a/2,y:n.y},p={x:s.x-a/2,y:s.y},f={x:n.x+a/2,y:n.y},g={x:s.x+a/2,y:s.y}):(d={x:n.x,y:n.y-a/2},p={x:s.x,y:s.y-a/2},f={x:n.x,y:n.y+a/2},g={x:s.x,y:s.y+a/2});const y=kh(d,p,r,u?75:15,u),m=kh(n,s,r,u?75:15,u),b=kh(f,g,r,u?75:15,u);c.add(So(Object.assign(Object.assign({path:y,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(So(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(So({path:m,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function Ph(t,e,i=1){return Math.abs(t-e)<i}function Lh(t,e){return{type:"component",componentType:Mh,interactive:!0,zIndex:500,style:{data:(i,n)=>{const s=[],r=n.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var n,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(n=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,c+l)}return{x1:e,y1:i,x2:n,y2:s}}(c.getRegions());D(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getProduct().elements.forEach((t=>{const r=t.getBounds();let c,p,f,g,y=!1;a?(y=r.x1<(o+l-n)/2&&r.x2>(o+l+n)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),f=h,g=Math.min(r.y2+d.y1+2,d.y2)):(y=r.y1<(o+l-n)/2&&r.y2>(o+l+n)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,f=Math.min(r.x2+d.x1+2,d.x2),g=h),y&&s.push({start:{x:c,y:p},end:{x:f,y:g},gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getProduct().elements.forEach((t=>{Rh(t.graphicItem,"line").forEach((t=>{Eh(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),s.push({start:r,end:o,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getProduct().elements.forEach((t=>{Rh(t.graphicItem,"area").forEach((t=>{const r=Eh(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Dh(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),s.push({start:t,end:r,gap:n,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),s}}}}function Eh(t,e){const i=[];for(let n=1;n<e.length;n++){const s=ct([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);s&&!i.find((t=>Ph(at.distancePP({x:t[0],y:t[1]},{x:s[0],y:s[1]}),0)))&&i.push(s)}return i}function Rh(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function Dh(t,e){const{x:i,y:n}=t;let s=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const Ih="barLink";class Nh extends _l{constructor(){super(...arguments),this.name=Ih}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:s,label:r,linkType:a="total"}=this.attribute;B(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:f,id:g=o,color:y,data:m}=t;if(f&&!1!==(null===(l=null==s?void 0:s[`area-${g}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:f,fillOpacity:.3,fill:y,zIndex:0},n),null==s?void 0:s[`area-${g}`]),new Bo(b));t.name="bar-link-area",t.id=`area-${g}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==s?void 0:s[`line-${g}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==s?void 0:s[`line-${g}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=i||{},r=C(t),a=C(e);(null==s?void 0:s[`line-${g}`])&&s[`line-${g}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:s[`line-${g}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:s[`line-${g}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new Th({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==s?void 0:s[`line-${g}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${g}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==s?void 0:s[`label-${g}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[n,o]=m;let l=n[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=fo(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,m):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==s?void 0:s[`label-${g}`]));d.name="bar-link-label",d.id=`label-${g}`,this.add(d)}})))}}function Uh(t,e,i){const{isHorizontal:n,isXAxisInverse:s,isYAxisInverse:r,linkType:a,doFill:o,regionStartX:l,regionStartY:h}=i,c=t.getGraphicItem(),u=e.getGraphicItem(),d=c.AABBBounds,p=u.AABBBounds;let f,g;return n?(f=[{x:(d.x1+d.x2)/2+l,y:d.y1+h},{x:(p.x1+p.x2)/2+l,y:p.y2+h}],s?("total"===a&&(f=[{x:d.x1+l,y:d.y1+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:d.x1+l,x1:d.x2+l,y:d.y1+h},{x:p.x1+l,x1:p.x2+l,y:p.y2+h}])):("total"===a&&(f=[{x:d.x2+l,y:d.y1+h},{x:p.x2+l,y:p.y2+h}]),o&&(g=[{x:d.x2+l,x1:d.x1+l,y:d.y1+h},{x:p.x2+l,x1:p.x1+l,y:p.y2+h}]))):(f=[{x:d.x2+l,y:(d.y1+d.y2)/2+h},{x:p.x1+l,y:(p.y1+p.y2)/2+h}],r?("total"===a&&(f=[{x:d.x2+l,y:d.y2+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:d.x2+l,y:d.y2+h,y1:d.y1+h},{x:p.x1+l,y:p.y2+h,y1:p.y1+h}])):("total"===a&&(f=[{x:d.x2+l,y:d.y1+h},{x:p.x1+l,y:p.y1+h}]),o&&(g=[{x:d.x2+l,y:d.y1+h,y1:d.y2+h},{x:p.x1+l,y:p.y1+h,y1:p.y2+h}]))),{areaPoints:g,linePoints:f,data:[t.data[0],e.data[0]],color:c.attribute.fill}}function jh(t={},i){const{linkType:n="total",doFill:s}=t,r=Jt(t,["linkType","doFill"]);return{type:"component",componentType:Ih,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e,i;(null===(i=null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getProduct())||void 0===i?void 0:i.elements).forEach((t=>{l.push(t)}))}));const h=function(t,e){var i;const n={};for(let s=0;s<t.length;s++){const r=t[s],a=null===(i=r.data)||void 0===i?void 0:i[0],o=e.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>t.data[0][e.STACK_FIELD_END]-i.data[0][e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),f=Object.values(h);if(f.length)if(u){f[0][0].getGraphicItem().AABBBounds.y1<f[f.length-1][0].getGraphicItem().AABBBounds.y1&&f.reverse()}else{f[0][0].getGraphicItem().AABBBounds.x1>f[f.length-1][0].getGraphicItem().AABBBounds.x1&&f.reverse()}for(let t=0;t<f.length-1;t++){const e=f[t],i=f[t+1];if(e.forEach(((t,e)=>{var l;const h=Uh(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=Uh(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Fh="seriesLabel";function zh(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function Wh(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Gh(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(Wh(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function Hh(t,e){const{label:i,line:n}=e;return{type:"component",componentType:Fh,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var n;const s=i.vchart.getChart(),r=s.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(n=o.getScale)||void 0===n?void 0:n.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=s.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(g(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:n,y:o}=i.getLayoutStartPoint();let f=0;s.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getProduct().elements.forEach((s=>{var r;const l=s.data.find((t=>t[c]===e));if(l){const e=s.getGraphicItem(),g=e.AABBBounds;let y,m,b,v;"bar"===d[0]||"waterfall"===d[0]?(y="end"===t?{x:a?(g.x1+g.x2)/2:h?g.x1:g.x2,y:a?h?g.y2:g.y1:(g.y1+g.y2)/2}:{x:a?(g.x1+g.x2)/2:h?g.x2:g.x1,y:a?h?g.y1:g.y2:(g.y1+g.y2)/2},m=e.attribute.fill):(y=i.dataToPosition(l),m=e.attribute.stroke||e.attribute.fill),"end"===t?(b=a?"center":h?"end":"start",v=a?h?"top":"bottom":"middle"):(b=a?"center":h?"start":"end",v=a?h?"bottom":"top":"middle");const x=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:y.x+n,y:y.y+o},label:x,color:m,textAlign:b,textBaseline:v,series:i,datum:l,id:`${t}-${f}`,position:t}),f++}}))}))}))}return p},line:n,label:Object.assign({space:12},i)}}}class Yh extends _l{constructor(){super(...arguments),this.name=Fh}render(){var t,e,i,n;this.removeAllChild();const{data:s,layout:r,label:a,line:o={}}=this.attribute;if(B(s))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=s.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),n=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:f,id:g}=t,y=null!==(s=null===(n=i[g])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,m=fo(Object.assign(Object.assign(Object.assign(Object.assign({text:y?y(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:f,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[g])||void 0===c?void 0:c.style));return m.name="series-label-text",m.id=g,this.add(m),m};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),s=zh(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:s[e]};n(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:f,id:g,position:y}=i,m={x:c.x,y:c.y},b=null!==(s=null===(n=l[g])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==a?void 0:a.formatMethod,v=fo(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),m),{textAlign:p,textBaseline:f,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[g])||void 0===h?void 0:h.style));v.id=g,v.name="series-label-text",this.add(v),"start"===y?t.push(v):"end"===y&&e.push(v)})),t.length&&Gh(t,4,10),e.length&&Gh(e,4,10);const i=null!==(n=null==a?void 0:a.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,n,s,a,c;const{point:u,color:d,id:p}=t,f={x:h[p].x+(null!==(n=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:h[p].y+(null!==(c=null===(a=null===(s=l[p])||void 0===s?void 0:s.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==f.y||"horizontal"===r&&u.x!==f.x){const t=xo(Object.assign({points:[u,f],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=xo(Object.assign({points:[u,f],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}t.BAR_LINK=Ih,t.BarLinkComponent=Nh,t.CompareSankeyChart=De,t.CompareSankeyDiffChart=je,t.CompareSankeyDiffSeries=Fe,t.CompareSankeySeries=Ie,t.ConversionFunnelChart=oe,t.ConversionFunnelSeries=le,t.DEFAULT_ARROW_MARK_STYLE=he,t.DEFAULT_ARROW_SYMBOL_MARK_STYLE=ce,t.DEFAULT_ARROW_TEXT_MARK_STYLE=ue,t.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE=de,t.RankingBar=jt,t.RankingList=Xt,t.SERIES_BREAK=Mh,t.SequenceScatterKDE=xe,t.SequenceScatterLink=ge,t.SequenceScatterPixel=Te,t.SeriesBreakComponent=Oh,t.SeriesLabelComponent=Yh,t.appendBarLinkConfig=function(t,e){t.customMark=D(t.customMark).filter((t=>t.componentType!==Ih)),t.customMark.push(jh(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=D(t.customMark).filter((t=>t.componentType!==Mh)),t.customMark.push(Lh(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,n,s;if(t.customMark=D(t.customMark).filter((t=>t.componentType!==Fh)),e||(e=null!==(s=null!==(i=w(t,Fh))&&void 0!==i?i:w(null===(n=t.series)||void 0===n?void 0:n[0],Fh))&&void 0!==s?s:{}),e.visible){const{position:i="end"}=e,n=Jt(e,["position"]);t.customMark.push(Hh(i,n))}},t.getBarLinkConfig=jh,t.getSeriesBreakConfig=Lh,t.getSeriesLabelConfig=Hh,t.registerBarLink=()=>{wh.registerGraphicComponent(Ih,(t=>new Nh(t)))},t.registerCompareSankeyChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([De]),i.useSeries([Ie]))},t.registerCompareSankeyDiffChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([je]),i.useSeries([Fe]))},t.registerConversionFunnelChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([oe]),i.useSeries([le]))},t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([jt])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Xt,e.BarChart])},t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([xe,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([ge,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.ScatterChart])},t.registerSeriesBreak=()=>{wh.registerGraphicComponent("seriesBreak",(t=>new Oh(t)))},t.registerSeriesLabel=()=>{wh.registerGraphicComponent("seriesLabel",(t=>new Yh(t)))}}));
|