@visactor/vchart-extension 2.0.0-alpha.0 → 2.0.0-alpha.2
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 +17737 -4761
- package/build/index.min.js +2 -2
- package/cjs/charts/3d/arc-3d.d.ts +11 -0
- package/cjs/charts/3d/arc-3d.js +30 -0
- package/cjs/charts/3d/arc-3d.js.map +1 -0
- package/cjs/charts/3d/enum.d.ts +33 -0
- package/cjs/charts/3d/enum.js +28 -0
- package/cjs/charts/3d/enum.js.map +1 -0
- package/cjs/charts/3d/interface.d.ts +13 -0
- package/cjs/charts/3d/interface.js +6 -0
- package/cjs/charts/3d/interface.js.map +1 -0
- package/cjs/charts/3d/layout.d.ts +21 -0
- package/cjs/charts/3d/layout.js +97 -0
- package/cjs/charts/3d/layout.js.map +1 -0
- package/cjs/charts/3d/plugin.d.ts +12 -0
- package/cjs/charts/3d/plugin.js +35 -0
- package/cjs/charts/3d/plugin.js.map +1 -0
- package/cjs/charts/3d/pyramid-3d.d.ts +11 -0
- package/cjs/charts/3d/pyramid-3d.js +31 -0
- package/cjs/charts/3d/pyramid-3d.js.map +1 -0
- package/cjs/charts/3d/rect-3d.d.ts +13 -0
- package/cjs/charts/3d/rect-3d.js +36 -0
- package/cjs/charts/3d/rect-3d.js.map +1 -0
- package/cjs/charts/3d/util.d.ts +3 -0
- package/cjs/charts/3d/util.js +19 -0
- package/cjs/charts/3d/util.js.map +1 -0
- package/cjs/charts/axis-3d/band-axis.d.ts +46 -0
- package/cjs/charts/axis-3d/band-axis.js +27 -0
- package/cjs/charts/axis-3d/band-axis.js.map +1 -0
- package/cjs/charts/axis-3d/index.d.ts +1 -0
- package/cjs/charts/axis-3d/index.js +14 -0
- package/cjs/charts/axis-3d/index.js.map +1 -0
- package/cjs/charts/axis-3d/linear-axis.d.ts +42 -0
- package/cjs/charts/axis-3d/linear-axis.js +32 -0
- package/cjs/charts/axis-3d/linear-axis.js.map +1 -0
- package/cjs/charts/axis-3d/log-axis.d.ts +46 -0
- package/cjs/charts/axis-3d/log-axis.js +26 -0
- package/cjs/charts/axis-3d/log-axis.js.map +1 -0
- package/cjs/charts/axis-3d/symlog-axis.d.ts +46 -0
- package/cjs/charts/axis-3d/symlog-axis.js +27 -0
- package/cjs/charts/axis-3d/symlog-axis.js.map +1 -0
- package/cjs/charts/axis-3d/theme.d.ts +2 -0
- package/cjs/charts/axis-3d/theme.js +10 -0
- package/cjs/charts/axis-3d/theme.js.map +1 -0
- package/cjs/charts/axis-3d/time-axis.d.ts +45 -0
- package/cjs/charts/axis-3d/time-axis.js +27 -0
- package/cjs/charts/axis-3d/time-axis.js.map +1 -0
- package/cjs/charts/axis-3d/util.d.ts +2 -0
- package/cjs/charts/axis-3d/util.js +45 -0
- package/cjs/charts/axis-3d/util.js.map +1 -0
- package/cjs/charts/bar-3d/animation.d.ts +1 -0
- package/cjs/charts/bar-3d/animation.js +17 -0
- package/cjs/charts/bar-3d/animation.js.map +1 -0
- package/cjs/charts/bar-3d/chart-spec-transformer.d.ts +6 -0
- package/cjs/charts/bar-3d/chart-spec-transformer.js +19 -0
- package/cjs/charts/bar-3d/chart-spec-transformer.js.map +1 -0
- package/cjs/charts/bar-3d/chart.d.ts +13 -0
- package/cjs/charts/bar-3d/chart.js +25 -0
- package/cjs/charts/bar-3d/chart.js.map +1 -0
- package/cjs/charts/bar-3d/constant.d.ts +12 -0
- package/cjs/charts/bar-3d/constant.js +15 -0
- package/cjs/charts/bar-3d/constant.js.map +1 -0
- package/cjs/charts/bar-3d/index.d.ts +5 -0
- package/cjs/charts/bar-3d/index.js +23 -0
- package/cjs/charts/bar-3d/index.js.map +1 -0
- package/cjs/charts/bar-3d/interface.d.ts +13 -0
- package/cjs/charts/bar-3d/interface.js +6 -0
- package/cjs/charts/bar-3d/interface.js.map +1 -0
- package/cjs/charts/bar-3d/series-spec-transformer.d.ts +5 -0
- package/cjs/charts/bar-3d/series-spec-transformer.js +16 -0
- package/cjs/charts/bar-3d/series-spec-transformer.js.map +1 -0
- package/cjs/charts/bar-3d/series.d.ts +17 -0
- package/cjs/charts/bar-3d/series.js +28 -0
- package/cjs/charts/bar-3d/series.js.map +1 -0
- package/cjs/charts/bar-3d/theme.d.ts +2 -0
- package/cjs/charts/bar-3d/theme.js +19 -0
- package/cjs/charts/bar-3d/theme.js.map +1 -0
- package/cjs/charts/conversion-funnel/arrow-data-transform.js.map +1 -1
- package/cjs/charts/conversion-funnel/constants.d.ts +21 -0
- package/cjs/charts/conversion-funnel/constants.js +24 -0
- package/cjs/charts/conversion-funnel/constants.js.map +1 -0
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.d.ts +2 -3
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +7 -7
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel.d.ts +0 -21
- package/cjs/charts/conversion-funnel/conversion-funnel.js +2 -19
- package/cjs/charts/conversion-funnel/conversion-funnel.js.map +1 -1
- package/cjs/charts/conversion-funnel/index.js.map +1 -1
- package/cjs/charts/conversion-funnel/interface.js.map +1 -1
- package/cjs/charts/conversion-funnel/util.d.ts +1 -1
- package/cjs/charts/conversion-funnel/util.js.map +1 -1
- package/cjs/charts/funnel-3d/chart.d.ts +12 -0
- package/cjs/charts/funnel-3d/chart.js +25 -0
- package/cjs/charts/funnel-3d/chart.js.map +1 -0
- package/cjs/charts/funnel-3d/constant.d.ts +80 -0
- package/cjs/charts/funnel-3d/constant.js +31 -0
- package/cjs/charts/funnel-3d/constant.js.map +1 -0
- package/cjs/charts/funnel-3d/index.d.ts +4 -0
- package/cjs/charts/funnel-3d/index.js +22 -0
- package/cjs/charts/funnel-3d/index.js.map +1 -0
- package/cjs/charts/funnel-3d/interface.d.ts +18 -0
- package/cjs/charts/funnel-3d/interface.js +6 -0
- package/cjs/charts/funnel-3d/interface.js.map +1 -0
- package/cjs/charts/funnel-3d/series-spec-transformer.d.ts +5 -0
- package/cjs/charts/funnel-3d/series-spec-transformer.js +16 -0
- package/cjs/charts/funnel-3d/series-spec-transformer.js.map +1 -0
- package/cjs/charts/funnel-3d/series.d.ts +99 -0
- package/cjs/charts/funnel-3d/series.js +83 -0
- package/cjs/charts/funnel-3d/series.js.map +1 -0
- package/cjs/charts/funnel-3d/theme.d.ts +1 -0
- package/cjs/charts/funnel-3d/theme.js +10 -0
- package/cjs/charts/funnel-3d/theme.js.map +1 -0
- package/cjs/charts/histogram-3d/chart.d.ts +12 -0
- package/cjs/charts/histogram-3d/chart.js +31 -0
- package/cjs/charts/histogram-3d/chart.js.map +1 -0
- package/cjs/charts/histogram-3d/index.d.ts +2 -0
- package/cjs/charts/histogram-3d/index.js +21 -0
- package/cjs/charts/histogram-3d/index.js.map +1 -0
- package/cjs/charts/histogram-3d/interface.d.ts +5 -0
- package/cjs/charts/histogram-3d/interface.js +6 -0
- package/cjs/charts/histogram-3d/interface.js.map +1 -0
- package/cjs/charts/image-cloud/image-cloud-transformer.d.ts +6 -0
- package/cjs/charts/image-cloud/image-cloud-transformer.js +19 -0
- package/cjs/charts/image-cloud/image-cloud-transformer.js.map +1 -0
- package/cjs/charts/image-cloud/image-cloud.d.ts +12 -0
- package/cjs/charts/image-cloud/image-cloud.js +23 -0
- package/cjs/charts/image-cloud/image-cloud.js.map +1 -0
- package/cjs/charts/image-cloud/index.d.ts +2 -0
- package/cjs/charts/image-cloud/index.js +21 -0
- package/cjs/charts/image-cloud/index.js.map +1 -0
- package/cjs/charts/image-cloud/interface.d.ts +6 -0
- package/cjs/charts/image-cloud/interface.js +6 -0
- package/cjs/charts/image-cloud/interface.js.map +1 -0
- package/cjs/charts/image-cloud/series/animation.d.ts +23 -0
- package/cjs/charts/image-cloud/series/animation.js +100 -0
- package/cjs/charts/image-cloud/series/animation.js.map +1 -0
- package/cjs/charts/image-cloud/series/constant.d.ts +76 -0
- package/cjs/charts/image-cloud/series/constant.js +25 -0
- package/cjs/charts/image-cloud/series/constant.js.map +1 -0
- package/cjs/charts/image-cloud/series/image-cloud.d.ts +137 -0
- package/cjs/charts/image-cloud/series/image-cloud.js +196 -0
- package/cjs/charts/image-cloud/series/image-cloud.js.map +1 -0
- package/cjs/charts/image-cloud/series/index.d.ts +2 -0
- package/cjs/charts/image-cloud/series/index.js +21 -0
- package/cjs/charts/image-cloud/series/index.js.map +1 -0
- package/cjs/charts/image-cloud/series/interface.d.ts +25 -0
- package/cjs/charts/image-cloud/series/interface.js +6 -0
- package/cjs/charts/image-cloud/series/interface.js.map +1 -0
- package/cjs/charts/image-cloud/series/tooltip-helper.d.ts +10 -0
- package/cjs/charts/image-cloud/series/tooltip-helper.js +30 -0
- package/cjs/charts/image-cloud/series/tooltip-helper.js.map +1 -0
- package/cjs/charts/pictogram/element-highlight-by-graphic-name.d.ts +12 -0
- package/cjs/charts/pictogram/element-highlight-by-graphic-name.js +53 -0
- package/cjs/charts/pictogram/element-highlight-by-graphic-name.js.map +1 -0
- package/cjs/charts/pictogram/element-select-by-graphic-name.d.ts +8 -0
- package/cjs/charts/pictogram/element-select-by-graphic-name.js +31 -0
- package/cjs/charts/pictogram/element-select-by-graphic-name.js.map +1 -0
- package/cjs/charts/pictogram/index.d.ts +5 -0
- package/cjs/charts/pictogram/index.js +23 -0
- package/cjs/charts/pictogram/index.js.map +1 -0
- package/cjs/charts/pictogram/interface.d.ts +6 -0
- package/cjs/charts/pictogram/interface.js +6 -0
- package/cjs/charts/pictogram/interface.js.map +1 -0
- package/cjs/charts/pictogram/pictogram-transformer.d.ts +8 -0
- package/cjs/charts/pictogram/pictogram-transformer.js +24 -0
- package/cjs/charts/pictogram/pictogram-transformer.js.map +1 -0
- package/cjs/charts/pictogram/pictogram.d.ts +12 -0
- package/cjs/charts/pictogram/pictogram.js +25 -0
- package/cjs/charts/pictogram/pictogram.js.map +1 -0
- package/cjs/charts/pictogram/series/constant.d.ts +73 -0
- package/cjs/charts/pictogram/series/constant.js +22 -0
- package/cjs/charts/pictogram/series/constant.js.map +1 -0
- package/cjs/charts/pictogram/series/interface.d.ts +13 -0
- package/cjs/charts/pictogram/series/interface.js +6 -0
- package/cjs/charts/pictogram/series/interface.js.map +1 -0
- package/cjs/charts/pictogram/series/pictogram-transformer.d.ts +4 -0
- package/cjs/charts/pictogram/series/pictogram-transformer.js +23 -0
- package/cjs/charts/pictogram/series/pictogram-transformer.js.map +1 -0
- package/cjs/charts/pictogram/series/pictogram.d.ts +129 -0
- package/cjs/charts/pictogram/series/pictogram.js +296 -0
- package/cjs/charts/pictogram/series/pictogram.js.map +1 -0
- package/cjs/charts/pictogram/series/svg-source.d.ts +7 -0
- package/cjs/charts/pictogram/series/svg-source.js +38 -0
- package/cjs/charts/pictogram/series/svg-source.js.map +1 -0
- package/cjs/charts/pictogram/series/tooltip-helper.d.ts +7 -0
- package/cjs/charts/pictogram/series/tooltip-helper.js +26 -0
- package/cjs/charts/pictogram/series/tooltip-helper.js.map +1 -0
- package/cjs/charts/pictogram/series/transform.d.ts +76 -0
- package/cjs/charts/pictogram/series/transform.js +150 -0
- package/cjs/charts/pictogram/series/transform.js.map +1 -0
- package/cjs/charts/pie-3d/animation.d.ts +1 -0
- package/cjs/charts/pie-3d/animation.js +17 -0
- package/cjs/charts/pie-3d/animation.js.map +1 -0
- package/cjs/charts/pie-3d/chart-spec-transformer.d.ts +6 -0
- package/cjs/charts/pie-3d/chart-spec-transformer.js +18 -0
- package/cjs/charts/pie-3d/chart-spec-transformer.js.map +1 -0
- package/cjs/charts/pie-3d/chart.d.ts +13 -0
- package/cjs/charts/pie-3d/chart.js +25 -0
- package/cjs/charts/pie-3d/chart.js.map +1 -0
- package/cjs/charts/pie-3d/constant.d.ts +70 -0
- package/cjs/charts/pie-3d/constant.js +19 -0
- package/cjs/charts/pie-3d/constant.js.map +1 -0
- package/cjs/charts/pie-3d/index.d.ts +5 -0
- package/cjs/charts/pie-3d/index.js +23 -0
- package/cjs/charts/pie-3d/index.js.map +1 -0
- package/cjs/charts/pie-3d/interface.d.ts +17 -0
- package/cjs/charts/pie-3d/interface.js +6 -0
- package/cjs/charts/pie-3d/interface.js.map +1 -0
- package/cjs/charts/pie-3d/series-spec-transformer.d.ts +5 -0
- package/cjs/charts/pie-3d/series-spec-transformer.js +16 -0
- package/cjs/charts/pie-3d/series-spec-transformer.js.map +1 -0
- package/cjs/charts/pie-3d/series.d.ts +88 -0
- package/cjs/charts/pie-3d/series.js +42 -0
- package/cjs/charts/pie-3d/series.js.map +1 -0
- package/cjs/charts/pie-3d/theme.d.ts +2 -0
- package/cjs/charts/pie-3d/theme.js +19 -0
- package/cjs/charts/pie-3d/theme.js.map +1 -0
- package/cjs/charts/range-column-3d/chart-spec-transformer.d.ts +5 -0
- package/cjs/charts/range-column-3d/chart-spec-transformer.js +19 -0
- package/cjs/charts/range-column-3d/chart-spec-transformer.js.map +1 -0
- package/cjs/charts/range-column-3d/chart.d.ts +13 -0
- package/cjs/charts/range-column-3d/chart.js +31 -0
- package/cjs/charts/range-column-3d/chart.js.map +1 -0
- package/cjs/charts/range-column-3d/constant.d.ts +19 -0
- package/cjs/charts/range-column-3d/constant.js +19 -0
- package/cjs/charts/range-column-3d/constant.js.map +1 -0
- package/cjs/charts/range-column-3d/index.d.ts +5 -0
- package/cjs/charts/range-column-3d/index.js +23 -0
- package/cjs/charts/range-column-3d/index.js.map +1 -0
- package/cjs/charts/range-column-3d/interface.d.ts +8 -0
- package/cjs/charts/range-column-3d/interface.js +6 -0
- package/cjs/charts/range-column-3d/interface.js.map +1 -0
- package/cjs/charts/range-column-3d/series-spec-transformer.d.ts +6 -0
- package/cjs/charts/range-column-3d/series-spec-transformer.js +17 -0
- package/cjs/charts/range-column-3d/series-spec-transformer.js.map +1 -0
- package/cjs/charts/range-column-3d/series.d.ts +30 -0
- package/cjs/charts/range-column-3d/series.js +27 -0
- package/cjs/charts/range-column-3d/series.js.map +1 -0
- package/cjs/charts/ranking-bar/interface.js +1 -1
- package/cjs/charts/ranking-bar/interface.js.map +1 -1
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js +1 -1
- package/cjs/charts/ranking-bar/ranking-bar-transformer.js.map +1 -1
- package/cjs/charts/ranking-bar/ranking-bar.js +1 -1
- package/cjs/charts/ranking-bar/ranking-bar.js.map +1 -1
- 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 +460 -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 +6 -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-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/charts/word-cloud-3d/animation.d.ts +4 -0
- package/cjs/charts/word-cloud-3d/animation.js +24 -0
- package/cjs/charts/word-cloud-3d/animation.js.map +1 -0
- package/cjs/charts/word-cloud-3d/chart-spec-transformer.d.ts +5 -0
- package/cjs/charts/word-cloud-3d/chart-spec-transformer.js +17 -0
- package/cjs/charts/word-cloud-3d/chart-spec-transformer.js.map +1 -0
- package/cjs/charts/word-cloud-3d/chart.d.ts +14 -0
- package/cjs/charts/word-cloud-3d/chart.js +31 -0
- package/cjs/charts/word-cloud-3d/chart.js.map +1 -0
- package/cjs/charts/word-cloud-3d/index.d.ts +4 -0
- package/cjs/charts/word-cloud-3d/index.js +22 -0
- package/cjs/charts/word-cloud-3d/index.js.map +1 -0
- package/cjs/charts/word-cloud-3d/interface.d.ts +22 -0
- package/cjs/charts/word-cloud-3d/interface.js +6 -0
- package/cjs/charts/word-cloud-3d/interface.js.map +1 -0
- package/cjs/charts/word-cloud-3d/series.d.ts +37 -0
- package/cjs/charts/word-cloud-3d/series.js +80 -0
- package/cjs/charts/word-cloud-3d/series.js.map +1 -0
- package/cjs/charts/word-cloud-3d/theme.d.ts +2 -0
- package/cjs/charts/word-cloud-3d/theme.js +14 -0
- package/cjs/charts/word-cloud-3d/theme.js.map +1 -0
- package/cjs/components/bar-link/bar-link.d.ts +1 -1
- package/cjs/components/bar-link/bar-link.js +6 -6
- package/cjs/components/bar-link/bar-link.js.map +1 -1
- package/cjs/components/bar-link/constant.js +1 -1
- package/cjs/components/bar-link/constant.js.map +1 -1
- package/cjs/components/bar-link/index.js +2 -1
- package/cjs/components/bar-link/index.js.map +1 -1
- package/cjs/components/bar-link/type.js +1 -1
- package/cjs/components/bar-link/type.js.map +1 -1
- package/cjs/components/bar-link/util.d.ts +3 -4
- package/cjs/components/bar-link/util.js +11 -11
- package/cjs/components/bar-link/util.js.map +1 -1
- package/cjs/components/map-label/index.d.ts +2 -0
- package/cjs/components/map-label/index.js +21 -0
- package/cjs/components/map-label/index.js.map +1 -0
- package/cjs/components/map-label/layout.d.ts +23 -0
- package/cjs/components/map-label/layout.js +154 -0
- package/cjs/components/map-label/layout.js.map +1 -0
- package/cjs/components/map-label/map-label-transformer.d.ts +5 -0
- package/cjs/components/map-label/map-label-transformer.js +16 -0
- package/cjs/components/map-label/map-label-transformer.js.map +1 -0
- package/cjs/components/map-label/map-label.d.ts +53 -0
- package/cjs/components/map-label/map-label.js +266 -0
- package/cjs/components/map-label/map-label.js.map +1 -0
- package/cjs/components/map-label/theme.d.ts +2 -0
- package/cjs/components/map-label/theme.js +63 -0
- package/cjs/components/map-label/theme.js.map +1 -0
- package/cjs/components/map-label/type.d.ts +39 -0
- package/cjs/components/map-label/type.js +6 -0
- package/cjs/components/map-label/type.js.map +1 -0
- package/cjs/components/series-break/constant.js +1 -1
- package/cjs/components/series-break/constant.js.map +1 -1
- package/cjs/components/series-break/index.js +1 -1
- package/cjs/components/series-break/index.js.map +1 -1
- package/cjs/components/series-break/series-break.js +1 -1
- package/cjs/components/series-break/series-break.js.map +1 -1
- package/cjs/components/series-break/type.js +1 -1
- package/cjs/components/series-break/type.js.map +1 -1
- package/cjs/components/series-break/util.d.ts +2 -2
- package/cjs/components/series-break/util.js +1 -1
- package/cjs/components/series-break/util.js.map +1 -1
- package/cjs/components/series-label/constant.js +1 -1
- package/cjs/components/series-label/constant.js.map +1 -1
- package/cjs/components/series-label/index.js +1 -1
- package/cjs/components/series-label/index.js.map +1 -1
- package/cjs/components/series-label/series-label.js +3 -3
- package/cjs/components/series-label/series-label.js.map +1 -1
- package/cjs/components/series-label/type.js +1 -1
- package/cjs/components/series-label/type.js.map +1 -1
- package/cjs/components/series-label/util.js +5 -5
- package/cjs/components/series-label/util.js.map +1 -1
- package/cjs/index.d.ts +15 -0
- package/cjs/index.js +19 -2
- package/cjs/index.js.map +1 -1
- package/cjs/type/index.js.map +1 -1
- package/cjs/type/type.js.map +1 -1
- package/cjs/utils/element.js.map +1 -1
- package/cjs/utils/math.js.map +1 -1
- package/esm/charts/3d/arc-3d.d.ts +11 -0
- package/esm/charts/3d/arc-3d.js +25 -0
- package/esm/charts/3d/arc-3d.js.map +1 -0
- package/esm/charts/3d/enum.d.ts +33 -0
- package/esm/charts/3d/enum.js +36 -0
- package/esm/charts/3d/enum.js.map +1 -0
- package/esm/charts/3d/interface.d.ts +13 -0
- package/esm/charts/3d/interface.js +2 -0
- package/esm/charts/3d/interface.js.map +1 -0
- package/esm/charts/3d/layout.d.ts +21 -0
- package/esm/charts/3d/layout.js +87 -0
- package/esm/charts/3d/layout.js.map +1 -0
- package/esm/charts/3d/plugin.d.ts +12 -0
- package/esm/charts/3d/plugin.js +31 -0
- package/esm/charts/3d/plugin.js.map +1 -0
- package/esm/charts/3d/pyramid-3d.d.ts +11 -0
- package/esm/charts/3d/pyramid-3d.js +26 -0
- package/esm/charts/3d/pyramid-3d.js.map +1 -0
- package/esm/charts/3d/rect-3d.d.ts +13 -0
- package/esm/charts/3d/rect-3d.js +32 -0
- package/esm/charts/3d/rect-3d.js.map +1 -0
- package/esm/charts/3d/util.d.ts +3 -0
- package/esm/charts/3d/util.js +10 -0
- package/esm/charts/3d/util.js.map +1 -0
- package/esm/charts/axis-3d/band-axis.d.ts +46 -0
- package/esm/charts/axis-3d/band-axis.js +25 -0
- package/esm/charts/axis-3d/band-axis.js.map +1 -0
- package/esm/charts/axis-3d/index.d.ts +1 -0
- package/esm/charts/axis-3d/index.js +19 -0
- package/esm/charts/axis-3d/index.js.map +1 -0
- package/esm/charts/axis-3d/linear-axis.d.ts +42 -0
- package/esm/charts/axis-3d/linear-axis.js +30 -0
- package/esm/charts/axis-3d/linear-axis.js.map +1 -0
- package/esm/charts/axis-3d/log-axis.d.ts +46 -0
- package/esm/charts/axis-3d/log-axis.js +24 -0
- package/esm/charts/axis-3d/log-axis.js.map +1 -0
- package/esm/charts/axis-3d/symlog-axis.d.ts +46 -0
- package/esm/charts/axis-3d/symlog-axis.js +25 -0
- package/esm/charts/axis-3d/symlog-axis.js.map +1 -0
- package/esm/charts/axis-3d/theme.d.ts +2 -0
- package/esm/charts/axis-3d/theme.js +6 -0
- package/esm/charts/axis-3d/theme.js.map +1 -0
- package/esm/charts/axis-3d/time-axis.d.ts +45 -0
- package/esm/charts/axis-3d/time-axis.js +25 -0
- package/esm/charts/axis-3d/time-axis.js.map +1 -0
- package/esm/charts/axis-3d/util.d.ts +2 -0
- package/esm/charts/axis-3d/util.js +39 -0
- package/esm/charts/axis-3d/util.js.map +1 -0
- package/esm/charts/bar-3d/animation.d.ts +1 -0
- package/esm/charts/bar-3d/animation.js +11 -0
- package/esm/charts/bar-3d/animation.js.map +1 -0
- package/esm/charts/bar-3d/chart-spec-transformer.d.ts +6 -0
- package/esm/charts/bar-3d/chart-spec-transformer.js +11 -0
- package/esm/charts/bar-3d/chart-spec-transformer.js.map +1 -0
- package/esm/charts/bar-3d/chart.d.ts +13 -0
- package/esm/charts/bar-3d/chart.js +25 -0
- package/esm/charts/bar-3d/chart.js.map +1 -0
- package/esm/charts/bar-3d/constant.d.ts +12 -0
- package/esm/charts/bar-3d/constant.js +11 -0
- package/esm/charts/bar-3d/constant.js.map +1 -0
- package/esm/charts/bar-3d/index.d.ts +5 -0
- package/esm/charts/bar-3d/index.js +10 -0
- package/esm/charts/bar-3d/index.js.map +1 -0
- package/esm/charts/bar-3d/interface.d.ts +13 -0
- package/esm/charts/bar-3d/interface.js +2 -0
- package/esm/charts/bar-3d/interface.js.map +1 -0
- package/esm/charts/bar-3d/series-spec-transformer.d.ts +5 -0
- package/esm/charts/bar-3d/series-spec-transformer.js +8 -0
- package/esm/charts/bar-3d/series-spec-transformer.js.map +1 -0
- package/esm/charts/bar-3d/series.d.ts +17 -0
- package/esm/charts/bar-3d/series.js +30 -0
- package/esm/charts/bar-3d/series.js.map +1 -0
- package/esm/charts/bar-3d/theme.d.ts +2 -0
- package/esm/charts/bar-3d/theme.js +15 -0
- package/esm/charts/bar-3d/theme.js.map +1 -0
- package/esm/charts/conversion-funnel/arrow-data-transform.js.map +1 -1
- package/esm/charts/conversion-funnel/constants.d.ts +21 -0
- package/esm/charts/conversion-funnel/constants.js +25 -0
- package/esm/charts/conversion-funnel/constants.js.map +1 -0
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.d.ts +2 -3
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +5 -5
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel.d.ts +0 -21
- package/esm/charts/conversion-funnel/conversion-funnel.js +0 -25
- package/esm/charts/conversion-funnel/conversion-funnel.js.map +1 -1
- package/esm/charts/conversion-funnel/index.js.map +1 -1
- package/esm/charts/conversion-funnel/interface.js.map +1 -1
- package/esm/charts/conversion-funnel/util.d.ts +1 -1
- package/esm/charts/conversion-funnel/util.js.map +1 -1
- package/esm/charts/funnel-3d/chart.d.ts +12 -0
- package/esm/charts/funnel-3d/chart.js +25 -0
- package/esm/charts/funnel-3d/chart.js.map +1 -0
- package/esm/charts/funnel-3d/constant.d.ts +80 -0
- package/esm/charts/funnel-3d/constant.js +25 -0
- package/esm/charts/funnel-3d/constant.js.map +1 -0
- package/esm/charts/funnel-3d/index.d.ts +4 -0
- package/esm/charts/funnel-3d/index.js +8 -0
- package/esm/charts/funnel-3d/index.js.map +1 -0
- package/esm/charts/funnel-3d/interface.d.ts +18 -0
- package/esm/charts/funnel-3d/interface.js +2 -0
- package/esm/charts/funnel-3d/interface.js.map +1 -0
- package/esm/charts/funnel-3d/series-spec-transformer.d.ts +5 -0
- package/esm/charts/funnel-3d/series-spec-transformer.js +8 -0
- package/esm/charts/funnel-3d/series-spec-transformer.js.map +1 -0
- package/esm/charts/funnel-3d/series.d.ts +99 -0
- package/esm/charts/funnel-3d/series.js +84 -0
- package/esm/charts/funnel-3d/series.js.map +1 -0
- package/esm/charts/funnel-3d/theme.d.ts +1 -0
- package/esm/charts/funnel-3d/theme.js +4 -0
- package/esm/charts/funnel-3d/theme.js.map +1 -0
- package/esm/charts/histogram-3d/chart.d.ts +12 -0
- package/esm/charts/histogram-3d/chart.js +30 -0
- package/esm/charts/histogram-3d/chart.js.map +1 -0
- package/esm/charts/histogram-3d/index.d.ts +2 -0
- package/esm/charts/histogram-3d/index.js +4 -0
- package/esm/charts/histogram-3d/index.js.map +1 -0
- package/esm/charts/histogram-3d/interface.d.ts +5 -0
- package/esm/charts/histogram-3d/interface.js +2 -0
- package/esm/charts/histogram-3d/interface.js.map +1 -0
- package/esm/charts/image-cloud/image-cloud-transformer.d.ts +6 -0
- package/esm/charts/image-cloud/image-cloud-transformer.js +11 -0
- package/esm/charts/image-cloud/image-cloud-transformer.js.map +1 -0
- package/esm/charts/image-cloud/image-cloud.d.ts +12 -0
- package/esm/charts/image-cloud/image-cloud.js +21 -0
- package/esm/charts/image-cloud/image-cloud.js.map +1 -0
- package/esm/charts/image-cloud/index.d.ts +2 -0
- package/esm/charts/image-cloud/index.js +4 -0
- package/esm/charts/image-cloud/index.js.map +1 -0
- package/esm/charts/image-cloud/interface.d.ts +6 -0
- package/esm/charts/image-cloud/interface.js +2 -0
- package/esm/charts/image-cloud/interface.js.map +1 -0
- package/esm/charts/image-cloud/series/animation.d.ts +23 -0
- package/esm/charts/image-cloud/series/animation.js +94 -0
- package/esm/charts/image-cloud/series/animation.js.map +1 -0
- package/esm/charts/image-cloud/series/constant.d.ts +76 -0
- package/esm/charts/image-cloud/series/constant.js +23 -0
- package/esm/charts/image-cloud/series/constant.js.map +1 -0
- package/esm/charts/image-cloud/series/image-cloud.d.ts +137 -0
- package/esm/charts/image-cloud/series/image-cloud.js +198 -0
- package/esm/charts/image-cloud/series/image-cloud.js.map +1 -0
- package/esm/charts/image-cloud/series/index.d.ts +2 -0
- package/esm/charts/image-cloud/series/index.js +4 -0
- package/esm/charts/image-cloud/series/index.js.map +1 -0
- package/esm/charts/image-cloud/series/interface.d.ts +25 -0
- package/esm/charts/image-cloud/series/interface.js +2 -0
- package/esm/charts/image-cloud/series/interface.js.map +1 -0
- package/esm/charts/image-cloud/series/tooltip-helper.d.ts +10 -0
- package/esm/charts/image-cloud/series/tooltip-helper.js +22 -0
- package/esm/charts/image-cloud/series/tooltip-helper.js.map +1 -0
- package/esm/charts/pictogram/element-highlight-by-graphic-name.d.ts +12 -0
- package/esm/charts/pictogram/element-highlight-by-graphic-name.js +49 -0
- package/esm/charts/pictogram/element-highlight-by-graphic-name.js.map +1 -0
- package/esm/charts/pictogram/element-select-by-graphic-name.d.ts +8 -0
- package/esm/charts/pictogram/element-select-by-graphic-name.js +25 -0
- package/esm/charts/pictogram/element-select-by-graphic-name.js.map +1 -0
- package/esm/charts/pictogram/index.d.ts +5 -0
- package/esm/charts/pictogram/index.js +10 -0
- package/esm/charts/pictogram/index.js.map +1 -0
- package/esm/charts/pictogram/interface.d.ts +6 -0
- package/esm/charts/pictogram/interface.js +2 -0
- package/esm/charts/pictogram/interface.js.map +1 -0
- package/esm/charts/pictogram/pictogram-transformer.d.ts +8 -0
- package/esm/charts/pictogram/pictogram-transformer.js +18 -0
- package/esm/charts/pictogram/pictogram-transformer.js.map +1 -0
- package/esm/charts/pictogram/pictogram.d.ts +12 -0
- package/esm/charts/pictogram/pictogram.js +22 -0
- package/esm/charts/pictogram/pictogram.js.map +1 -0
- package/esm/charts/pictogram/series/constant.d.ts +73 -0
- package/esm/charts/pictogram/series/constant.js +23 -0
- package/esm/charts/pictogram/series/constant.js.map +1 -0
- package/esm/charts/pictogram/series/interface.d.ts +13 -0
- package/esm/charts/pictogram/series/interface.js +2 -0
- package/esm/charts/pictogram/series/interface.js.map +1 -0
- package/esm/charts/pictogram/series/pictogram-transformer.d.ts +4 -0
- package/esm/charts/pictogram/series/pictogram-transformer.js +19 -0
- package/esm/charts/pictogram/series/pictogram-transformer.js.map +1 -0
- package/esm/charts/pictogram/series/pictogram.d.ts +129 -0
- package/esm/charts/pictogram/series/pictogram.js +305 -0
- package/esm/charts/pictogram/series/pictogram.js.map +1 -0
- package/esm/charts/pictogram/series/svg-source.d.ts +7 -0
- package/esm/charts/pictogram/series/svg-source.js +33 -0
- package/esm/charts/pictogram/series/svg-source.js.map +1 -0
- package/esm/charts/pictogram/series/tooltip-helper.d.ts +7 -0
- package/esm/charts/pictogram/series/tooltip-helper.js +18 -0
- package/esm/charts/pictogram/series/tooltip-helper.js.map +1 -0
- package/esm/charts/pictogram/series/transform.d.ts +76 -0
- package/esm/charts/pictogram/series/transform.js +144 -0
- package/esm/charts/pictogram/series/transform.js.map +1 -0
- package/esm/charts/pie-3d/animation.d.ts +1 -0
- package/esm/charts/pie-3d/animation.js +11 -0
- package/esm/charts/pie-3d/animation.js.map +1 -0
- package/esm/charts/pie-3d/chart-spec-transformer.d.ts +6 -0
- package/esm/charts/pie-3d/chart-spec-transformer.js +10 -0
- package/esm/charts/pie-3d/chart-spec-transformer.js.map +1 -0
- package/esm/charts/pie-3d/chart.d.ts +13 -0
- package/esm/charts/pie-3d/chart.js +26 -0
- package/esm/charts/pie-3d/chart.js.map +1 -0
- package/esm/charts/pie-3d/constant.d.ts +70 -0
- package/esm/charts/pie-3d/constant.js +13 -0
- package/esm/charts/pie-3d/constant.js.map +1 -0
- package/esm/charts/pie-3d/index.d.ts +5 -0
- package/esm/charts/pie-3d/index.js +10 -0
- package/esm/charts/pie-3d/index.js.map +1 -0
- package/esm/charts/pie-3d/interface.d.ts +17 -0
- package/esm/charts/pie-3d/interface.js +2 -0
- package/esm/charts/pie-3d/interface.js.map +1 -0
- package/esm/charts/pie-3d/series-spec-transformer.d.ts +5 -0
- package/esm/charts/pie-3d/series-spec-transformer.js +8 -0
- package/esm/charts/pie-3d/series-spec-transformer.js.map +1 -0
- package/esm/charts/pie-3d/series.d.ts +88 -0
- package/esm/charts/pie-3d/series.js +45 -0
- package/esm/charts/pie-3d/series.js.map +1 -0
- package/esm/charts/pie-3d/theme.d.ts +2 -0
- package/esm/charts/pie-3d/theme.js +15 -0
- package/esm/charts/pie-3d/theme.js.map +1 -0
- package/esm/charts/range-column-3d/chart-spec-transformer.d.ts +5 -0
- package/esm/charts/range-column-3d/chart-spec-transformer.js +11 -0
- package/esm/charts/range-column-3d/chart-spec-transformer.js.map +1 -0
- package/esm/charts/range-column-3d/chart.d.ts +13 -0
- package/esm/charts/range-column-3d/chart.js +32 -0
- package/esm/charts/range-column-3d/chart.js.map +1 -0
- package/esm/charts/range-column-3d/constant.d.ts +19 -0
- package/esm/charts/range-column-3d/constant.js +13 -0
- package/esm/charts/range-column-3d/constant.js.map +1 -0
- package/esm/charts/range-column-3d/index.d.ts +5 -0
- package/esm/charts/range-column-3d/index.js +10 -0
- package/esm/charts/range-column-3d/index.js.map +1 -0
- package/esm/charts/range-column-3d/interface.d.ts +8 -0
- package/esm/charts/range-column-3d/interface.js +2 -0
- package/esm/charts/range-column-3d/interface.js.map +1 -0
- package/esm/charts/range-column-3d/series-spec-transformer.d.ts +6 -0
- package/esm/charts/range-column-3d/series-spec-transformer.js +9 -0
- package/esm/charts/range-column-3d/series-spec-transformer.js.map +1 -0
- package/esm/charts/range-column-3d/series.d.ts +30 -0
- package/esm/charts/range-column-3d/series.js +24 -0
- package/esm/charts/range-column-3d/series.js.map +1 -0
- package/esm/charts/ranking-bar/interface.js +1 -1
- package/esm/charts/ranking-bar/interface.js.map +1 -1
- package/esm/charts/ranking-bar/ranking-bar-transformer.js +1 -1
- package/esm/charts/ranking-bar/ranking-bar-transformer.js.map +1 -1
- package/esm/charts/ranking-bar/ranking-bar.js +1 -1
- package/esm/charts/ranking-bar/ranking-bar.js.map +1 -1
- 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 +460 -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 +2 -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-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/charts/word-cloud-3d/animation.d.ts +4 -0
- package/esm/charts/word-cloud-3d/animation.js +18 -0
- package/esm/charts/word-cloud-3d/animation.js.map +1 -0
- package/esm/charts/word-cloud-3d/chart-spec-transformer.d.ts +5 -0
- package/esm/charts/word-cloud-3d/chart-spec-transformer.js +9 -0
- package/esm/charts/word-cloud-3d/chart-spec-transformer.js.map +1 -0
- package/esm/charts/word-cloud-3d/chart.d.ts +14 -0
- package/esm/charts/word-cloud-3d/chart.js +29 -0
- package/esm/charts/word-cloud-3d/chart.js.map +1 -0
- package/esm/charts/word-cloud-3d/index.d.ts +4 -0
- package/esm/charts/word-cloud-3d/index.js +8 -0
- package/esm/charts/word-cloud-3d/index.js.map +1 -0
- package/esm/charts/word-cloud-3d/interface.d.ts +22 -0
- package/esm/charts/word-cloud-3d/interface.js +2 -0
- package/esm/charts/word-cloud-3d/interface.js.map +1 -0
- package/esm/charts/word-cloud-3d/series.d.ts +37 -0
- package/esm/charts/word-cloud-3d/series.js +74 -0
- package/esm/charts/word-cloud-3d/series.js.map +1 -0
- package/esm/charts/word-cloud-3d/theme.d.ts +2 -0
- package/esm/charts/word-cloud-3d/theme.js +10 -0
- package/esm/charts/word-cloud-3d/theme.js.map +1 -0
- package/esm/components/bar-link/bar-link.d.ts +1 -1
- package/esm/components/bar-link/bar-link.js +2 -2
- package/esm/components/bar-link/bar-link.js.map +1 -1
- package/esm/components/bar-link/constant.js +1 -1
- package/esm/components/bar-link/constant.js.map +1 -1
- package/esm/components/bar-link/index.js +2 -1
- package/esm/components/bar-link/index.js.map +1 -1
- package/esm/components/bar-link/type.js +1 -1
- package/esm/components/bar-link/type.js.map +1 -1
- package/esm/components/bar-link/util.d.ts +3 -4
- package/esm/components/bar-link/util.js +11 -12
- package/esm/components/bar-link/util.js.map +1 -1
- package/esm/components/map-label/index.d.ts +2 -0
- package/esm/components/map-label/index.js +4 -0
- package/esm/components/map-label/index.js.map +1 -0
- package/esm/components/map-label/layout.d.ts +23 -0
- package/esm/components/map-label/layout.js +143 -0
- package/esm/components/map-label/layout.js.map +1 -0
- package/esm/components/map-label/map-label-transformer.d.ts +5 -0
- package/esm/components/map-label/map-label-transformer.js +10 -0
- package/esm/components/map-label/map-label-transformer.js.map +1 -0
- package/esm/components/map-label/map-label.d.ts +53 -0
- package/esm/components/map-label/map-label.js +265 -0
- package/esm/components/map-label/map-label.js.map +1 -0
- package/esm/components/map-label/theme.d.ts +2 -0
- package/esm/components/map-label/theme.js +57 -0
- package/esm/components/map-label/theme.js.map +1 -0
- package/esm/components/map-label/type.d.ts +39 -0
- package/esm/components/map-label/type.js +2 -0
- package/esm/components/map-label/type.js.map +1 -0
- package/esm/components/series-break/constant.js +1 -1
- package/esm/components/series-break/constant.js.map +1 -1
- package/esm/components/series-break/index.js +1 -1
- package/esm/components/series-break/index.js.map +1 -1
- package/esm/components/series-break/series-break.js +1 -1
- package/esm/components/series-break/series-break.js.map +1 -1
- package/esm/components/series-break/type.js +1 -1
- package/esm/components/series-break/type.js.map +1 -1
- package/esm/components/series-break/util.d.ts +2 -2
- package/esm/components/series-break/util.js +1 -1
- package/esm/components/series-break/util.js.map +1 -1
- package/esm/components/series-label/constant.js +1 -1
- package/esm/components/series-label/constant.js.map +1 -1
- package/esm/components/series-label/index.js +1 -1
- package/esm/components/series-label/index.js.map +1 -1
- package/esm/components/series-label/series-label.js +2 -2
- package/esm/components/series-label/series-label.js.map +1 -1
- package/esm/components/series-label/type.js +1 -1
- package/esm/components/series-label/type.js.map +1 -1
- package/esm/components/series-label/util.js +5 -5
- package/esm/components/series-label/util.js.map +1 -1
- package/esm/index.d.ts +15 -0
- package/esm/index.js +31 -1
- package/esm/index.js.map +1 -1
- package/esm/type/index.js.map +1 -1
- package/esm/type/type.js.map +1 -1
- package/esm/utils/element.js.map +1 -1
- package/esm/utils/math.js.map +1 -1
- package/package.json +9 -8
package/build/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class s extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:s}=function(t){const{xField:e,yField:s,timeField:n,data:r,topN:a=10,icon:o}=t,l=new Set,h=new Map;return r.sort(((t,i)=>Number(i[e])-Number(t[e]))),r.forEach((t=>{const e=t[n];i.isValid(e)&&l.add(e),h.has(e)||h.set(e,[]);const r=h.get(e);if(r.length<a){const e=Object.assign({},t);o&&o[e[s]]&&(e.icon=o[e[s]]),r.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:o,yField:l,color:h,icon:c,iconPosition:d,iconShape:u,timeLabel:p,label:f,nameLabel:g,xAxis:m,yAxis:y}=t,b=a||1e3,x=Math.min(b,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(s[0])},{id:"time",values:[{time:s[0]}]}],t.color={specified:Object.assign({},h)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:n(f,Object.assign(Object.assign({},g),{yField:l}))}],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}},s={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&&(s.label=t.label);return[i,s]}(m,y),t.player={type:"continuous",auto:!0,loop:!1,interval:b,specs:s.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:b,exchangeDuration:x}),p&&!1===p.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)}}(p.style)),c){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:s}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,s;const n=e.vchart,r=null===(i=n.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(n&&r){const t=null!==(s=r.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var s,n;const r=i.vchart,a=null===(s=r.getChart())||void 0===s?void 0:s.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(n=a.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,s;const n=e.vchart,r=null===(i=n.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(n&&r){const e=null!==(s=r.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:r(i,s),animationEnter:[{type:"moveIn",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(d,u,{interval:b,exchangeDuration:x});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function n(t={},e){var i,s,n,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===(s=t.style)||void 0===s?void 0:s.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(n=e.style)||void 0===n?void 0:n.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 r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=s}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,timeField:a,data:o}=this._spec;return n&&r&&a?!!o||(null===(s=(i=this._option).onError)||void 0===s||s.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)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=s;const o=(t,e)=>{var i,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],a={},o=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const l=n[e];if(!l.type){let s=r;e in r||(s=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof s[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===(s=l.domain)||void 0===s?void 0:s.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 s=0;s<i.length;s++){const n=i[s];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};let l=0;const h="_data-view-diff-rank";class c{constructor(t,e){var s=this;let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new i.EventEmitter,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return s.isRunning=!0,s.resetTransformData(),s.transformsArr.forEach((e=>{s.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),s.isLastTransform(e)&&s.diffLastData()})),s.isRunning=!1,!1!==t.emitMessage&&s.target.emit("change",[]),s},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=(null==e?void 0:e.name)?e.name:function(){return l>1e8&&(l=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+l++}("dataview"),this.name=n,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var s;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(s=this.dataSet.getParser(e.type))&&void 0!==s?s:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:s}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==s&&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[h]=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[h]=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[h]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let s=!1;return t instanceof c||!0!==(null==e?void 0:e.clone)||(s=!0),s?i.cloneDeep(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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?i.merge({},this._fields,t):t;const s=this.transformsArr.find((t=>"fields"===t.type));!i.isNil(this._fields)&&i.isNil(s)?(this.dataSet.registerTransform("fields",o),this.transform({type:"fields",options:{fields:this._fields}},!1)):s&&(s.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}}
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class n extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:n}=function(t){const{xField:e,yField:n,timeField:s,data:r,topN:a=10,icon:o}=t,l=new Set,h=new Map;return r.sort(((t,i)=>Number(i[e])-Number(t[e]))),r.forEach((t=>{const e=t[s];i.isValid(e)&&l.add(e),h.has(e)||h.set(e,[]);const r=h.get(e);if(r.length<a){const e=Object.assign({},t);o&&o[e[n]]&&(e.icon=o[e[n]]),r.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:o,yField:l,color:h,icon:c,iconPosition:d,iconShape:u,timeLabel:p,label:g,nameLabel:f,xAxis:m,yAxis:y}=t,b=a||1e3,v=Math.min(b,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(n[0])},{id:"time",values:[{time:n[0]}]}],t.color={specified:Object.assign({},h)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:s(g,Object.assign(Object.assign({},f),{yField:l}))}],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]}(m,y),t.player={type:"continuous",auto:!0,loop:!1,interval:b,specs:n.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:b,exchangeDuration:v}),p&&!1===p.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)}}(p.style)),c){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:r(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"}}]}}(d,u,{interval:b,exchangeDuration:v});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function s(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 r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=n}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)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=n;const o=1e3,l="#21252c",h={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:l,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:o,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:o,easing:"linear"},animationNormal:{interval:o}},c="dataKey",d="VCHART_ORDER",u="SUPPLY_DATA_KEY";class p 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,[u]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[d]=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,[u]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[c]: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,h),((t,e)=>{e.forEach((e=>{var n,s,r,a,o,l,h;i.isArray(t[e])?null===(n=t[e])||void 0===n||n.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===(s=t[e])||void 0===s?void 0:s.style),{visible:null===(h=null!==(o=null===(a=null===(r=t[e])||void 0===r?void 0:r.style)||void 0===a?void 0:a.visible)&&void 0!==o?o:null===(l=t[e])||void 0===l?void 0:l.visible)||void 0===h||h})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,n,s,r,a,o,l,h,c;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(n=this.valueLabelTextMeasure)||void 0===n||n.release(),null===(s=this.orderLabelTextMeasure)||void 0===s||s.release(),this.nameLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(a=null===(r=t.nameLabel)||void 0===r?void 0:r.style)&&void 0!==a?a:{}}),this.valueLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(l=null===(o=t.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(c=null===(h=t.orderLabel)||void 0===h?void 0:h.style)&&void 0!==c?c:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[d]=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=i.cloneDeep(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=c,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[u]&&(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:c,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[u]&&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:c,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[u]&&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:c,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(d,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(d,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[u]&&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:c,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,d,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[u]&&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:c,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(d,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[u]&&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:c,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[u]&&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,d,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[u]?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,d,u,p,g;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.getGraphicAttribute("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!==(u=null===(d=t.animationAppear)||void 0===d?void 0:d.duration)&&void 0!==u?u:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"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 g extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=p}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)}}g.type="rankingList",g.view="singleDefault",g.transformerConstructor=p;const f=(t,e)=>{var n,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const r=e.fields,a=t[0],o={},l=[];for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const h=r[e];if(h.sort&&(i.isValidNumber(h.sortIndex)||(h.sortIndex=0),i.isValid(h.sortReverse)||(h.sortReverse="desc"===h.sort)),!h.type){let i=a;e in a||(i=null!==(n=t.find((t=>e in t)))&&void 0!==n?n:a),h.type="number"==typeof i[e]?"linear":"ordinal"}let c;if("number"==typeof h.sortIndex&&(c={key:e,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===h.sortReverse},l.push(c)),(null===(s=h.domain)||void 0===s?void 0:s.length)>0)if("ordinal"===h.type){h._domainCache={},o[e]=h;const t={};h.domain.forEach(((e,i)=>{t[e]=i,h._domainCache[e]=i})),c&&(c.sortIndex=t,c.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(o[e]=h)}return Object.keys(o).length>0&&(t=t.filter((t=>{for(const e in o){const i=o[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}))),l.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,l))),t};const m={svg:"group",rect:"rect",line:"rule",polygon:"polygon",path:"path",polyline:"line",g:"group",circle:"arc",ellipse:"arc"},y=Object.keys(m),b=["g","svg","text","tspan","switch"],v=["font-size","font-family","font-weight","font-style","text-align","text-anchor"],x=["visibility","x","y","width","height","d","points","stroke","stroke-width","fill","fill-opacity","stroke-opacity",...v,"cx","cy","r","cx","cy","rx","ry","x1","x2","y1","y2"],_=["visible","fill","stroke","stroke-width","fill-opacity","stroke-opacity",...v],A=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;const S=function(t){let e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).customDOMParser;if(e||(null===window||void 0===window?void 0:window.DOMParser)&&(e=t=>(new DOMParser).parseFromString(t,"text/xml")),!e)throw new Error("No Available DOMParser!");const n=e(t);let s=9===n.nodeType?n.firstChild:n;for(;s&&("svg"!==s.nodeName.toLowerCase()||1!==s.nodeType);)s=s.nextSibling;return s?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[],s=B(t,null);let r=parseFloat(t.getAttribute("width")||e.width),a=parseFloat(t.getAttribute("height")||e.height);!i.isValidNumber(r)&&(r=null),!i.isValidNumber(a)&&(a=null);const o=t.getAttribute("viewBox");let l;if(o){const t=o.match(A)||[];if(t.length>=4&&(l={x:parseFloat(t[0]||0),y:parseFloat(t[1]||0),width:parseFloat(t[2]),height:parseFloat(t[3])},r||a)){const t={x:0,y:0,width:r,height:a},e=t.width/l.width,n=t.height/l.height,o=Math.min(e,n),h=-(l.x+l.width/2)*o+(t.x+t.width/2),c=-(l.y+l.height/2)*o+(t.y+t.height/2),d=(new i.Matrix).translate(h,c).scale(o,o);s.transform=d}}return k(t,s,n),{root:s,width:r,height:a,elements:n,viewBoxRect:l}}(s):null};let T=0;function w(t){let e;const{parent:n,attributes:s}=t,r=t=>t?_.reduce(((e,n)=>{const s=i.toCamelCase(n);return i.isValid(t[s])&&(e[s]=t[s]),e}),{}):{};return n?(n._inheritStyle||(n._inheritStyle=r(n.attributes)),e=i.merge({},n._inheritStyle,r(s))):e=r(s),e}function M(t){var e,n,s;const r={},a=null!==(e=t.attributes)&&void 0!==e?e:{},o=null!==(n=t.style)&&void 0!==n?n:{};for(let t=0;t<x.length;t++){const e=x[t],n=i.isValid(o[e])&&""!==o[e]?o[e]:null===(s=a[e])||void 0===s?void 0:s.value;i.isValid(n)&&(r[i.toCamelCase(e)]=isNaN(+n)?n:parseFloat(n))}return"none"===o.display&&(r.visible=!1),["fontSize","strokeWidth","width","height"].forEach((t=>{const e=r[t];i.isString(r[t])&&(r[t]=parseFloat(e))})),r}function B(t,e){var n,s,r,a,o;const l=null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase();if(3===t.nodeType||"text"===l||"tspan"===l)return function(t,e){var n,s,r,a,o,l;if(!e)return null;const h=null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase();if(!h&&"group"!==e.graphicType)return null;const c="text"===h||"tspan"===h,d=c?"group":"text",u=c||null===(s=t.textContent)||void 0===s?void 0:s.replace(/\n/g," ").replace(/\s+/g," ");if(" "===u)return null;let p;return p=c?{tagName:h,graphicType:d,attributes:M(t),parent:e,name:t.getAttribute("name"),id:null!==(r=t.getAttribute("id"))&&void 0!==r?r:`${h}-${T++}`,transform:C(t),value:u}:{tagName:h,graphicType:"text",attributes:M(t),parent:e,name:null==e?void 0:e.name,id:null!==(o=null===(a=t.getAttribute)||void 0===a?void 0:a.call(t,"id"))&&void 0!==o?o:`${h}-${T++}`,value:u},p._inheritStyle=w(p),i.isValid(p.name)||(p._nameFromParent=null!==(l=e.name)&&void 0!==l?l:e._nameFromParent),c?e._textGroupStyle?p._textGroupStyle=i.merge({},e._textGroupStyle,M(t)):p._textGroupStyle=M(t):p.attributes=p._inheritStyle,p}(t,e);if(!y.includes(l))return null;const h={tagName:l,graphicType:m[l],attributes:M(t),parent:e,name:null!==(s=t.getAttribute("name"))&&void 0!==s?s:null===(r=null==e?void 0:e.attributes)||void 0===r?void 0:r.name,id:null!==(a=t.getAttribute("id"))&&void 0!==a?a:`${l}-${T++}`,transform:C(t)};return h._inheritStyle=w(h),e&&!i.isValid(h.name)&&(h._nameFromParent=null!==(o=e.name)&&void 0!==o?o:e._nameFromParent),h}function C(t){var e,n;const s=null===(e=t.transform)||void 0===e?void 0:e.baseVal;if(!s)return null;const r=null===(n=s.consolidate())||void 0===n?void 0:n.matrix;if(!r)return null;const{a:a,b:o,c:l,d:h,e:c,f:d}=r;return new i.Matrix(a,o,l,h,c,d)}function k(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];var n;if(!t)return;let s;"svg"!==t.nodeName&&(s=B(t,e)),s&&i.push(s);let r=b.includes(null===(n=t.tagName)||void 0===n?void 0:n.toLocaleLowerCase())?t.firstChild:null;for(;r;)k(r,null!=s?s:e,i),r=r.nextSibling}let P=0;function O(){return P>1e8&&(P=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+P++}class R{constructor(t){var e;let n;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new i.EventEmitter,n=(null==t?void 0:t.name)?t.name:O("dataset"),this.name=n,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:i.Logger.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let n=this._callMap.get(i);n||(n=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,n)})),this._callMap.set(i,n)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const n=this._callMap.get(i);n&&t.forEach((t=>{t.target.removeListener(e,n)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}class L{constructor(t,e){var n=this;let s;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new i.EventEmitter,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=n.latestData;return n.isRunning=!0,n.resetTransformData(),n.transformsArr.forEach((e=>{n.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})})),n.isRunning=!1,!1===t.emitMessage||t.skipEqual&&i.isEqual(e,n.latestData)||n.target.emit("change",{latestData:n.latestData}),n},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},s=(null==e?void 0:e.name)?e.name:O("dataview"),this.name=s,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(s,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{pushHistory:n,emitMessage:s,skipEqual:r}=e,a=this.dataSet.getTransform(t.type),o=this.latestData,l=a(o,t.options);this.history&&!1!==n&&this.historyData.push(l),this.latestData=l,!1===s||r&&i.isEqual(o,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let n=!1;return t instanceof L||!0!==(null==e?void 0:e.clone)||(n=!0),n?i.cloneDeep(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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?i.merge({},this._fields,t):t;const n=this.transformsArr.find((t=>"fields"===t.type));!i.isNil(this._fields)&&i.isNil(n)?(this.dataSet.registerTransform("fields",f),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function d(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}class u extends e.FunnelChart.transformerConstructor{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:s}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=d(t,["arrows"]),s=e.filter((t=>"left"===t.position)),n=e.filter((t=>"right"===t.position)),r=p(n,i),a=p(s,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(s&&s.visible){const t=function(t){const{style:e={}}=t,i=d(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},S),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:s}=i.getLayoutRect();return s},height:(t,e)=>{const i=e.getPoints(t),s=i[0];return i[3].y-s.y}})})}(s);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 p(t,e){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:n,text:r,margin:a}=e,o=[],l={type:"group",children:[]},h=function(t={},e){const{style:i={}}=t,s=d(t,["style"]),n=(t,e)=>{var i,s;const{from:n,to:r}=t,{vchart:a}=e,o=null===(s=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData;return!(r>o.length-1||n>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},s),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},A),i),{renderable:n,points:(t,i)=>{if(!n(t,i))return[];let s=t.layout.points;return s=f(t,i,e),s}})})}(s,a);h&&o.push(h);const c=function(t={},e){const{style:i={}}=t,s=d(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},s),{style:Object.assign(Object.assign(Object.assign({},B),i),{x:(t,i)=>{var s,n;let r=t.layout.points;return r=f(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.x)&&void 0!==n?n:NaN},y:(t,i)=>{var s,n;let r=t.layout.points;return r=f(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.y)&&void 0!==n?n:NaN},angle:t=>"left"===t.position?90:-90})})}(n,a);c&&o.push(c);const u=function(t={},e){const{style:s={},formatMethod:n,textMargin:r=4}=t,a=d(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},T),{text:(t,e)=>{var s,r,a,o,l,h,c;const{text:d}=t;let u=d;if(i.isFunction(n)){const{vchart:i}=e,{from:p,to:f}=t,{field:g}=t.context,m=null!==(a=null===(r=null===(s=null==i?void 0:i.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],y=null!==(c=null===(h=null===(l=null===(o=null==i?void 0:i.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[g]===m[p][g])),x=y.find((t=>t[g]===m[f][g]));u=n(d,{arrow:t,from:b,to:x})}return u},x:(t,i)=>{var s,n;let a=t.layout.points;return a=f(t,i,e),null!==(n=(null===(s=a[1])||void 0===s?void 0:s.x)+("left"===t.position?-r:r))&&void 0!==n?n:NaN},y:(t,i)=>{var s,n,r;let a=t.layout.points;return a=f(t,i,e),null!==(r=((null===(s=a[1])||void 0===s?void 0:s.y)+(null===(n=a[2])||void 0===n?void 0:n.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),s)})}(r,a);return u&&o.push(u),l.children=o,l}function f(t,e,i){var s,n,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:d}=t.context,u=null===(n=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===n?void 0:n.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(u&&u.length){const s=p.find((t=>t[d]===u[h][d])),n=p.find((t=>t[d]===u[c][d])),r=p[0];if(s&&n&&r){f=function(t,e,i,s,n=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:d,toTotal:u}=r,p="right"===o,f=p?e[1]:e[0],g=p?e[2]:e[3],m=Math.abs(f.y-g.y),y=p?i[1]:i[0],b=p?i[2]:i[3],x=Math.abs(y.y-b.y),v=p?s[1]:s[0],_=m/(d+1),A=x/(u+1),B=f.y+_*(h+1),T=y.y+A*(c+1),S=p?-1:1,w=[{x:f.x-n*S,y:B},{x:v.x-(n+(l+1)*a)*S,y:B},{x:v.x-(n+(l+1)*a)*S,y:T},{x:y.x-n*S,y:T}];return w}(t,e.getPoints(s),e.getPoints(n),e.getPoints(r),i),t.layout.points=f}}return f}function g(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return s>n&&r>i}function m(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return i===n&&s===r}const y=(t,e)=>{var s,n,r;if(!t||!(null===(s=t.arrows)||void 0===s?void 0:s.length))return[];const{arrows:a}=t,o=function(t,e){return t.filter((t=>i.isValidNumber(t.from*t.to))).map(((t,i)=>{const{from:s,to:n,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(s,n),to:Math.max(s,n),span:Math.abs(s-n),isLayout:!1,context:{field:e},layout:{level:0},id:`${s}-${n}-${r}-${i}`})}))}(a,e.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(n=b(l))&&void 0!==n?n:[],...null!==(r=b(h))&&void 0!==r?r:[]]};function b(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const s=e.get(t.from);if(i.isValid(s)){const e=s.fromArrows.find((e=>m(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(i.isValid(n)){const e=n.toArrows.find((e=>m(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((s=>{var n;const r=t.filter((t=>t.layout.isLayout)),a=i.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let o=null!==(n=null==a?void 0:a.layout.level)&&void 0!==n?n:0;for(;o>=0;){if(r.some((t=>t.layout.level===o&&g(t,s)))){o+=1;break}--o}s.layout.level=Math.max(0,o),s.layout.fromTotal=e.get(s.from).degree,s.layout.toTotal=e.get(s.to).degree;const l=s.layout.duplicateNode;l?(s.layout.fromIndex=l.layout.fromIndex,s.layout.toIndex=l.layout.toIndex):(s.layout.fromIndex=x(s,e.get(s.from).totalArrows),s.layout.toIndex=x(s,e.get(s.to).totalArrows)),s.layout.isLayout=!0})),t}function x(t,e){let i=0,s=0;for(let n=0;n<e.length;n++){const r=e[n];if(r===t){i=n-s;break}r.layout.duplicateNode&&s++}return i}class v extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=u}}v.type="conversionFunnel",v.transformerConstructor=u;class _ 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 c(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",y),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.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const A={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},B={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},T={fill:"#606773",fontSize:12},S={fill:"#eff1f9"};class w{static GenAutoIncrementId(){return w.auto_increment_id++}}w.auto_increment_id=0;class P{constructor(t){this.id=w.GenAutoIncrementId(),this.registry=t}}const M="named",O="inject",C="inversify:tagged",k="inversify:paramtypes";class L{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===M?`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),s=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new s,n.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new s,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const s=g(e);return!c(s)&&a(t,s,i)}function o(t,e,i){const s=r(e,i,!1);return!h(s)&&!!s.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const s=r(e,i,!1);if(!h(s))return s.get(t)}(t,e,i);const s=g(e);return c(s)?void 0:l(t,s,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(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 s=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!f(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,s);if(d(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(!d(i))return i}const i=t.valueOf;if(f(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(f(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(f(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}function p(t){const e=u(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 s=t.prototype,n=s&&Object.getPrototypeOf(s);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!d(i))throw new TypeError;return n=t,a=e,void r(i,s,!0).set(n,a);var n,a})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(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 I(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};E.hasOwnMetadata(t,e)&&(r=E.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,E.defineMetadata(t,r,e)}(C,t,i.toString(),s)}function R(t){return(e,i,s)=>{I(e,0,s,t)}}const U=(D=O,t=>(e,i,s)=>R(new L(D,t))(e,i,s));var D;function N(){return function(t){return E.defineMetadata(k,null,t),t}}function j(t){return R(new L(M,t))}const F="Singleton",z="Transient",W="ConstantValue",G="DynamicValue",$="Factory",Y="Function",V="Instance",X="Invalid";class H{constructor(t,e){this.id=w.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=X,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new H(this.serviceIdentifier,this.scope);return t.activated=t.scope===F&&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 K{getConstructorMetadata(t){return{compilerGeneratedMetadata:E.getMetadata(k,t),userGeneratedMetadata:E.getMetadata(C,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const q=(Z=M,t=>{const e=e=>{if(null==e)return!1;if(e.key===Z&&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===Z&&i[e].value===t)return!0;return!1};return e.metaData=new L(Z,t),e});var Z;class J{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=F,this}inTransientScope(){return this._binding.scope=z,this}whenTargetNamed(t){return this._binding.constraint=q(t),this}}class Q{constructor(t){this._binding=t}to(t){return this._binding.type=V,this._binding.implementationType=t,new J(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=G,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new J(this._binding)}toConstantValue(t){return this._binding.type=W,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F,new J(this._binding)}toFactory(t){return this._binding.type=$,this._binding.factory=t,this._binding.scope=F,new J(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const tt=Symbol("ContributionProvider");class et{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function it(t,e){t(tt).toDynamicValue((t=>{let{container:i}=t;return new et(e,i)})).inSingletonScope().whenTargetNamed(e)}class st{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 s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_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 s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class nt extends st{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}var rt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(rt||(rt={}));const at=i.tau-1e-8;class ot{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,s,n,r,a){if(Math.abs(r-n)>at)return this.bounds.add(t-s,e-s),void this.bounds.add(t+s,e+s);let o,l,h,c,d=1/0,u=-1/0,p=1/0,f=-1/0;function g(t){h=s*Math.cos(t),c=s*Math.sin(t),h<d&&(d=h),h>u&&(u=h),c<p&&(p=c),c>f&&(f=c)}if(g(n),g(r),r!==n)if((n%=i.tau)<0&&(n+=i.tau),(r%=i.tau)<0&&(r+=i.tau),r<n&&(a=!a,o=n,n=r,r=o),a)for(r-=i.tau,o=n-n%i.halfPi,l=0;l<4&&o>r;++l,o-=i.halfPi)g(o);else for(o=n-n%i.halfPi+i.halfPi,l=0;l<4&&o<r;++l,o+=i.halfPi)g(o);this.bounds.add(t+d,e+p),this.bounds.add(t+u,e+f)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,r){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,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,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(){}}class lt{constructor(){this.curves=[],this.bounds=new i.AABBBounds}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ht=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ct={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},dt=0,ut=1,pt=2,ft=3,gt=4,mt=5,yt=6,bt=7,xt=8;let vt,_t,At,Bt,Tt,St;var wt,Pt,Mt,Ot,Ct,kt,Lt,Et,It;function Rt(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,d=o*r,u=l*a,p=Math.cos(s),f=Math.sin(s),g=Math.cos(n),m=Math.sin(n),y=.5*(n-s),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),v=e+p-x*f,_=i+f+x*p,A=e+g,B=i+m,T=A+x*m,S=B-x*g;return[h*v+c*_,d*v+u*_,h*T+c*S,d*T+u*S,h*A+c*B,d*A+u*B]}function Ut(t,e,s,n){const r=function(t,e,s,n,r,a,o,l,h){const c=i.degreeToRadian(o),d=Math.sin(c),u=Math.cos(c),p=u*(l-t)*.5+d*(h-e)*.5,f=u*(h-e)*.5-d*(l-t)*.5;let g=p*p/((s=Math.abs(s))*s)+f*f/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),s*=g,n*=g);const m=u/s,y=d/s,b=-d/n,x=u/n,v=m*l+y*h,_=b*l+x*h,A=m*t+y*e,B=b*t+x*e;let T=1/((A-v)*(A-v)+(B-_)*(B-_))-.25;T<0&&(T=0);let S=Math.sqrt(T);a===r&&(S=-S);const w=.5*(v+A)-S*(B-_),P=.5*(_+B)+S*(A-v),M=Math.atan2(_-P,v-w);let O=Math.atan2(B-P,A-w)-M;O<0&&1===a?O+=i.tau:O>0&&0===a&&(O-=i.tau);const C=Math.ceil(Math.abs(O/(i.halfPi+.001))),k=[];for(let t=0;t<C;++t){const e=M+t*O/C,i=M+(t+1)*O/C;k[t]=[w,P,e,i,s,n,d,u]}return k}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,s);for(let e=0;e<r.length;++e){const i=Rt(r[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"}(wt||(wt={})),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"}(Pt||(Pt={})),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"}(Mt||(Mt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ot||(Ot={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ct||(Ct={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(kt||(kt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Lt||(Lt={})),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"}(Et||(Et={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(It||(It={}));const Dt=[(t,e,i,s,n,r,a)=>e.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function Nt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];Dt[l[0]](l,e,i,s,n,r,a)}}class jt{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ft(t,e,s,n,r){return function(t,e){let s=0;const n=t.length;for(let r=0;r<n;r++){const a=t[r],o=e[r],l=t[(r+1)%n],h=e[(r+1)%n];s+=i.PointService.distanceNN(a,o,l,h)}return s/2}([t.x,e.x,s.x,n.x],[t.y,e.y,s.y,n.y])}function zt(t,e,i,s,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+s*n*n*n}function Wt(t,e,s,n,r){const a=zt(t.x,e.x,s.x,n.x,r),o=zt(t.y,e.y,s.y,n.y,r);return new i.Point(a,o)}class Gt extends jt{constructor(t,e,i,s){super(),this.type=Et.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_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 Wt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ft(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Lt.ROW?i.abs(this.p0.x-this.p3.x):t===Lt.COLUMN?i.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=i.max(t-.01,0),s=i.min(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(s);return i.atan2(r.y-n.y,r.x-n.x)}}class $t extends jt{constructor(t,e){super(),this.type=Et.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=i.atan2(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()?i.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Lt.ROW?i.abs(this.p0.x-this.p1.x):t===Lt.COLUMN?i.abs(this.p0.y-this.p1.y):0}}class Yt{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,s,n,r,a,o,l){const h=new Gt(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(s,n),new i.Point(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}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,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}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,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,s,n,r){const a=new $t(new i.Point(this._lastX,this._lastY),new i.Point(t,e));return a.originP1=n,a.originP2=r,a.defined=s,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,s;if(t===Lt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],s=this.curves[this.curves.length-1],n=null!==(e=s.p3)&&void 0!==e?e:s.p1;return i.abs(t.p0.y-n.y)}if(t===Lt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(s=e.p3)&&void 0!==s?s:e.p1;return i.abs(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Vt extends Yt{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Xt(t,e){let i=!1;for(let s=0,n=e.length;s<=n;s++)s>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[s])}function Ht(t,e,s){const n=null!=e?e:i.abs(s[s.length-1].x-s[0].x)>i.abs(s[s.length-1].y-s[0].y)?Lt.ROW:Lt.COLUMN;return"monotoneY"===t?new Vt(t,n):new Yt(t,n)}class Kt{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 qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Ht("linear",i,t);return function(t,e){Xt(t,e)}(new Kt(n,s),t),n}function Zt(t,e,i,s,n){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,s,t.lastPoint1)}class Jt{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&&Zt(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:Zt(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 Qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("basis",i,t);return function(t,e){Xt(t,e)}(new Jt(n,s),t),n}function te(t){return t<0?-1:1}function ee(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(te(r)+te(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ie(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function se(t,e,i,s,n){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,s,t.lastPoint1)}class ne{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:se(this,this._t0,ie(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,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,se(this,ie(this,e=ee(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:se(this,this._t0,e=ee(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,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 re extends ne{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function ae(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("monotoneX",i,t);return function(t,e){Xt(t,e)}(new ne(n,s),t),n}function oe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("monotoneY",i,t);return function(t,e){Xt(t,e)}(new re(n,s),t),n}let le=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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 s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,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()}};function he(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:r}=s;if(t.length<2-Number(!!r))return null;const a=new Yt("step",null!=n?n:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?Lt.ROW:Lt.COLUMN);return function(t,e){Xt(t,e)}(new le(a,e,r),t),a}class ce extends Kt{lineEnd(){this.context.closePath()}}function de(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Ht("linear",i,t);return function(t,e){Xt(t,e)}(new ce(n,s),t),n}function ue(t,e,s,n,r){let a=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>i.epsilon){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);a=(a*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>i.epsilon){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*i+t._x1*t._l23_2a-e*t._l12_2a)/n,h=(h*i+t._y1*t._l23_2a-s*t._l12_2a)/n}t.context.bezierCurveTo(a,o,l,h,t._x2,t._y2,n,t.lastPoint1)}function pe(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return qt(i,n);const o=Ht(t,r,i);return Xt(new e(o,s,a),i),o}}const fe=pe("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,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:ue(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 ge=pe("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,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:ue(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()}});function me(t,e,i){var s,n;switch(e){case"linear":default:return qt(t,i);case"basis":return Qt(t,i);case"monotoneX":return ae(t,i);case"monotoneY":return oe(t,i);case"step":return he(t,.5,i);case"stepBefore":return he(t,0,i);case"stepAfter":return he(t,1,i);case"catmullRom":return fe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return ge(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return de(t,i)}}class ye extends lt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ot(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([yt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([mt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([bt,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([pt,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([ut,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([gt,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([xt,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([dt,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([ft]),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()}toString(){if(!this.toStringCbList){const t=[];t[yt]=t=>`M${t[1]} ${t[2]}`,t[mt]=t=>`L${t[1]} ${t[2]}`,t[bt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[pt]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[dt]=t=>{const e=[];((t,e,i,s,n,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,d=l<o?-1:1,u=Math.cos(o),p=Math.sin(o),f=Math.cos(l),g=Math.sin(l),m=u*r+s,y=p*a+n,b=f*r+s,x=g*a+n,v=r*c*d,_=a*c*d;t.push(m-v*p,y+_*u,b+v*g,x-_*f,b,x)}})(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[xt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ft]=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,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;t<r;t++)if(vt=e[t],_t=vt.slice(1),At=vt[0],i=[At],s=_t.match(ht),null!==s){for(let t=0,e=s.length;t<e;t++)Bt=s[t],Tt=parseFloat(Bt),Number.isNaN(Tt)||i.push(Tt);if(St=ct[At],i.length-1>St){let t,e=At;for(let s=1,r=i.length;s<r;s+=St){t=[e];for(let e=s,n=s+St;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(r,e,i,s,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const n=me(e,i);"x"===s?this.direction=Lt.ROW:"y"===s?this.direction=Lt.COLUMN:"auto"===s&&(this.direction=n.direction),this.curves=n.curves}fromCustomPath2D(t,e,i,s,n){return this.clear(),this._runCommandList(t.commandList,e,i,s,n),this._updateBounds(),this}transform(t,e,i,s){const n=this.commandList;if(!this.transformCbList){const t=[];t[yt]=this.moveToTransform,t[mt]=this.lineToTransform,t[bt]=this.quadraticCurveToTransform,t[pt]=this.bezierCurveToTransform,t[ut]=this.arcToTransform,t[gt]=this.ellipseTransform,t[xt]=this.rectTransform,t[dt]=this.arcTransform,t[ft]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t){let e,i,s,n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,d=0,u=0,p=0,f=0;for(let g=0,m=t.length;g<m;++g){switch(e=t[g],1===l&&1===h||(e=xe(e,l,h)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+a,u+o);break;case"L":d=e[1],u=e[2],this.lineTo(d+a,u+o);break;case"h":d+=e[1],this.lineTo(d+a,u+o);break;case"H":d=e[1],this.lineTo(d+a,u+o);break;case"v":u+=e[1],this.lineTo(d+a,u+o);break;case"V":u=e[1],this.lineTo(d+a,u+o);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+a,u+o);break;case"M":d=e[1],u=e[2],this.moveTo(d+a,u+o);break;case"c":i=d+e[5],s=u+e[6],p=d+e[3],f=u+e[4],this.bezierCurveTo(d+e[1]+a,u+e[2]+o,p+a,f+o,i+a,s+o),d=i,u=s;break;case"C":d=e[5],u=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,f+o,d+a,u+o);break;case"s":i=d+e[3],s=u+e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+a,f+o,d+e[1]+a,u+e[2]+o,i+a,s+o),p=d+e[1],f=u+e[2],d=i,u=s;break;case"S":i=e[3],s=e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+a,f+o,e[1]+a,e[2]+o,i+a,s+o),d=i,u=s,p=e[1],f=e[2];break;case"q":i=d+e[3],s=u+e[4],p=d+e[1],f=u+e[2],this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,s+o),d=i,u=s,p=e[1],f=e[2];break;case"t":i=d+e[1],s=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,f=u):"t"===c[0]?(p=2*d-n,f=2*u-r):"q"===c[0]&&(p=2*d-p,f=2*u-f),n=p,r=f,this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s,p=d+e[1],f=u+e[2];break;case"T":i=e[1],s=e[2],p=2*d-p,f=2*u-f,this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s;break;case"a":Ut(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+a,e[7]+u+o]),d+=e[6],u+=e[7];break;case"A":Ut(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),d=e[6],u=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case mt:this.lineToTransform(a,e,i,s,n);break;case yt:this.moveToTransform(a,e,i,s,n);break;case pt:this.bezierCurveToTransform(a,e,i,s,n);break;case bt:this.quadraticCurveToTransform(a,e,i,s,n);break;case dt:this.arcToTransform(a,e,i,s,n);break;case gt:this.ellipseTransform(a,e,i,s,n);break;case xt:this.rectTransform(a,e,i,s,n);break;case ut:this.arcToTransform(a,e,i,s,n);break;case ft:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Nt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Lt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.y-e.p1.y)}if(this.direction===Lt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this.curves.length;s++){e=this.curves[s];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}}const be=["l",0,0,0,0,0,0,0];function xe(t,e,i){const s=be[0]=t[0];if("a"===s||"A"===s)be[1]=e*t[1],be[2]=i*t[2],be[3]=t[3],be[4]=t[4],be[5]=t[5],be[6]=e*t[6],be[7]=i*t[7];else if("h"===s||"H"===s)be[1]=e*t[1];else if("v"===s||"V"===s)be[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)be[s]=(s%2==1?e:i)*t[s];return be}const ve={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 i.Matrix},_e={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ae=Object.assign({outerBorder:Object.assign(Object.assign({},_e),{distance:0}),innerBorder:Object.assign(Object.assign({},_e),{distance:0})},_e),Be={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:rt.fontBounding,keepCenterInLine:!1},Te=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ae),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Se={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},we=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},{_debug_bounds:!1}),Te),ve),Pe=Object.assign(Object.assign({},we),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Me=Object.assign(Object.assign(Object.assign({},we),Se),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Oe=Object.assign(Object.assign({},we),{radius:1,startAngle:0,endAngle:i.pi2}),Ce=Object.assign(Object.assign({},we),{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}),ke=Object.assign(Object.assign({},we),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Le=Object.assign(Object.assign(Object.assign({},we),Se),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ee=Object.assign(Object.assign({},we),{path:new ye,fillStrokeOrder:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),Ie=Object.assign(Object.assign({},we),{points:[],cornerRadius:0,closePath:!0}),Re=Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Ue=Object.assign(Object.assign({},we),{symbolType:"circle",size:10,keepDirIn3d:!0}),De=Object.assign(Object.assign(Object.assign({},we),Be),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ne=Object.assign(Object.assign(Object.assign({},we),Be),{editable:!1,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}),je=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},we),{fill:!0,cornerRadius:0}),Fe=Object.assign(Object.assign({},je),{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 ze=new class{};function We(t,e,i){let s=e;const{a:n,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}const Ge=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||z,this.options=e,this.id=w.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new K}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 s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,M,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new H(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Q(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 s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_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),s=Object.keys(i),n=[];for(let t=0;t<s.length;t++){const e=i[t],s={};e.forEach((t=>{s[t.key]=t.value}));const r={inject:s[O],multiInject:s.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};n.push(t)}}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case W:case Y:e=t.cache;break;case V: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===F&&(t.cache=e,t.activated=!0)}},$e=Symbol.for("CanvasFactory");function Ye(t){return Ge.getNamed($e,ze.global.env)(t)}const Ve=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=Ye(Object.assign({nativeCanvas:ze.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=Ye(Object.assign({nativeCanvas:ze.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(){this.pools=[]}},Xe={arc:Pe,area:Me,circle:Oe,line:Le,path:Ee,symbol:Ue,text:De,rect:Re,polygon:Ie,richtext:Ne,richtextIcon:Fe,image:je,group:Ce,glyph:ke},He=Object.keys(Xe);function Ke(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const qe={arc:Object.assign({},Xe.arc),area:Object.assign({},Xe.area),circle:Object.assign({},Xe.circle),line:Object.assign({},Xe.line),path:Object.assign({},Xe.path),symbol:Object.assign({},Xe.symbol),text:Object.assign({},Xe.text),rect:Object.assign({},Xe.rect),polygon:Object.assign({},Xe.polygon),richtext:Object.assign({},Xe.richtext),richtextIcon:Object.assign({},Xe.richtextIcon),image:Object.assign({},Xe.image),group:Object.assign({},Xe.group),glyph:Object.assign({},Xe.glyph)};class Ze{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},He.forEach((t=>{this._defaultTheme[t]=Object.create(qe[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){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||s)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,i.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;He.forEach((s=>{const n=Object.create(qe[s]);t&&t[s]&&Ke(n,t[s]),i[s]&&Ke(n,i[s]),e[s]&&Ke(n,e[s]),this.combinedTheme[s]=n})),e.common&&He.forEach((t=>{Ke(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 Je=new Ze;function Qe(t,e){return t.glyphHost?Qe(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)):Je.getTheme()}return null}(t)||t.attachedThemeGraphic&&Qe(t.attachedThemeGraphic)||Je.getTheme()}var ti=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class ei extends i.EventEmitter{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=w.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ti(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){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&&i.Logger.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 s=this.insertInto(t,0);return this._ignoreWarn=!1,s}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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,s){const n=i.isBoolean(s,!0)&&s||i.isObject(s)&&s.capture,r=i.isObject(s)&&s.once,a=i.isFunction(e)?void 0:e;return t=n?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,s){const n=i.isBoolean(s,!0)&&s||i.isObject(s)&&s.capture,r=i.isFunction(e)?void 0:e;t=n?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent;const a=i.isObject(s)&&s.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,s){return i.isObject(s)?(s.once=!0,this.addEventListener(t,e,s)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class ii{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=ii.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=this.pickParams.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&&i.isFunction(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&&i.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class si extends ii{constructor(t,e){super(),this.type=t,this.detail=e}}const ni={dispatchEvent(t){var e;if(!(t instanceof ii))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 si(t,e))}};class ri{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-ri.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ri.bounceIn(2*t):.5*ri.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(s){if(0===s||1===s)return s;const n=e/i.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(s-=1))*Math.sin((s-n)*i.pi2/e)}}static getElasticOut(t,e){return function(s){if(0===s||1===s)return s;const n=e/i.pi2*Math.asin(1/t);return t*Math.pow(2,-10*s)*Math.sin((s-n)*i.pi2/e)+1}}static getElasticInOut(t,e){return function(s){const n=e/i.pi2*Math.asin(1/t);return(s*=2)<1?t*Math.pow(2,10*(s-=1))*Math.sin((s-n)*i.pi2/e)*-.5:t*Math.pow(2,-10*(s-=1))*Math.sin((s-n)*i.pi2/e)*.5+1}}}ri.quadIn=ri.getPowIn(2),ri.quadOut=ri.getPowOut(2),ri.quadInOut=ri.getPowInOut(2),ri.cubicIn=ri.getPowIn(3),ri.cubicOut=ri.getPowOut(3),ri.cubicInOut=ri.getPowInOut(3),ri.quartIn=ri.getPowIn(4),ri.quartOut=ri.getPowOut(4),ri.quartInOut=ri.getPowInOut(4),ri.quintIn=ri.getPowIn(5),ri.quintOut=ri.getPowOut(5),ri.quintInOut=ri.getPowInOut(5),ri.backIn=ri.getBackIn(1.7),ri.backOut=ri.getBackOut(1.7),ri.backInOut=ri.getBackInOut(1.7),ri.elasticIn=ri.getElasticIn(1,.3),ri.elasticOut=ri.getElasticOut(1,.3),ri.elasticInOut=ri.getElasticInOut(1,.3*1.5);const ai=new class{constructor(){this.id=w.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===Ot.END?this.removeAnimate(e):e.status===Ot.RUNNING||e.status===Ot.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ot.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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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 oi{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,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 li extends oi{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class hi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ai,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||ai,this.status=Ot.INITIAL,this.tailAnimate=new ci(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=i.max(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){hi.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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hi.mode;t&&e&Ct.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Mt.ANIMATE_PLAY})}runCb(t){const e=new li((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=hi.interpolateMap.get(t)||hi.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Ot.RUNNING&&(this.status=Ot.PAUSED)}resume(){this.status===Ot.PAUSED&&(this.status=Ot.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),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 ci(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===Ot.INITIAL&&(this.status=Ot.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ot.RUNNING&&(this.status=Ot.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===s)return r;for(let s=0;s<this.subAnimates.length&&(e=this.subAnimates[s],!(i+e.totalDuration>=t));s++)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=Ot.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()}}hi.mode=Ct.NORMAL,hi.interpolateMap=new Map;class ci{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 di(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,s="string"==typeof i?ri[i]:i,n=this._addStep(e,null,s);return n.type=kt.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?ri[i]:i,r=this._addStep(e,null,n);return r.type=kt.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=kt.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=kt.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 s=new di(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=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))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),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,s=this.loop,n=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>=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)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 s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-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 s=e.prev;for(;s;){if(s.props&&void 0!==s.props[t])return s.props[t];if(s.customAnimate){const e=s.customAnimate.getEndProps()[t];if(void 0!==e)return e}s=s.prev}return i.Logger.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 di{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}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 ui=200,pi="cubicOut";var fi;!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"}(fi||(fi={}));const gi=[0,0,0,0];function mi(t,e,s){const{x:n,y:r}=i.pointAt(t.x,t.y,e.x,e.y,s),{x:a,y:o}=i.pointAt(t.x1,t.y1,e.x1,e.y1,s),l=new i.Point(n,r,a,o);return l.defined=e.defined,l}function yi(t,e,s){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 i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<e.length;i++)n[i]=mi(t[i],e[i],s)}else{n=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<t.length;i++)n[i]=mi(t[i],e[i],s)}return n}const bi=(t,e)=>{const s=((t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(s)?s:Math.max(e,s)};var xi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(xi||(xi={}));class vi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xi.Color1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===xi.Color1){const e=vi.store1[t];if(e)return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s;const n=i.Color.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];vi.store1[t]=e,vi.store255[t]=[n.r,n.g,n.b,n.opacity],s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3]}return s}const n=vi.store255[t];if(n)return s[0]=n[0],s[1]=n[1],s[2]=n[2],s[3]=n[3],s;const r=i.Color.parseColorString(t);return r&&(vi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],vi.store255[t]=[r.r,r.g,r.b,r.opacity],s[0]=r.r,s[1]=r.g,s[2]=r.b,s[3]=r.opacity),s}static Set(t,e,i){if(e===xi.Color1){if(vi.store1[t])return;vi.store1[t]=i,vi.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(vi.store255[t])return;vi.store255[t]=i,vi.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function _i(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&i.isNumber(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 Ai(t,e,s,n,r){return Array.isArray(t)&&!i.isNumber(t[0])||Array.isArray(e)&&!i.isNumber(e[0])?new Array(4).fill(0).map(((r,a)=>Bi(i.isArray(t)?t[a]:t,i.isArray(e)?e[a]:e,s,n))):Bi(t,e,s,n,r)}function Bi(t,e,i,s,n){if(!t||!e)return t&&_i(t)||e&&_i(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=vi.Get(t,xi.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=vi.Get(e,xi.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:_i(a)})))});return o?Ai(r,l,i,s,n):Ai(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=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(s.length).fill(0).map(((t,e)=>({color:wi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=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(s.length).fill(0).map(((t,e)=>({color:wi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=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(s.length).fill(0).map(((t,e)=>({color:wi(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),_i(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),s)}vi.store255={},vi.store1={};const Ti=[0,0,0,0],Si=[0,0,0,0];function wi(t,e,i){return vi.Get(t,xi.Color255,Ti),vi.Get(e,xi.Color255,Si),`rgba(${Math.round(Ti[0]+(Si[0]-Ti[0])*i)},${Math.round(Ti[1]+(Si[1]-Ti[1])*i)},${Math.round(Ti[2]+(Si[2]-Ti[2])*i)},${Ti[3]+(Si[3]-Ti[3])*i})`}class Pi{static GetImage(t,e){var i;const s=Pi.cache.get(t);s?"fail"===s.loadState?ze.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Pi.loadImage(t,e)}static GetSvg(t,e){var i;let s=Pi.cache.get(t);s?"fail"===s.loadState?ze.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Pi.cache.set(t,s),s.dataPromise=ze.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Pi.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"},Pi.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ze.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ze.global.loadBlob(t):"json"===e&&(i.dataPromise=ze.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Pi.isLoading&&Pi.toLoadAueue.length){Pi.isLoading=!0;const t=Pi.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Pi.cache.set(i,n),n.dataPromise=ze.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Pi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Pi.loading()})).catch((t=>{console.error(t),Pi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Pi.loading()}))}}),0)}static loadImage(t,e){const i=Mi(t,Pi.toLoadAueue);if(-1!==i)return Pi.toLoadAueue[i].marks.push(e),void Pi.loading();Pi.toLoadAueue.push({url:t,marks:[e]}),Pi.loading()}static improveImageLoading(t){const e=Mi(t,Pi.toLoadAueue);if(-1!==e){const t=Pi.toLoadAueue.splice(e,1);Pi.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Mi(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Pi.cache=new Map,Pi.isLoading=!1,Pi.toLoadAueue=[],Pi.onLoadSuccessCb=[];const Oi=new i.Matrix,Ci=new i.AABBBounds,ki=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Li=["x","y"],Ei=["scaleX","scaleY"],Ii=["angle"],Ri=new i.Point,Ui={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 Di extends ei{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(Di.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new i.AABBBounds,this._updateTag=wt.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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,s;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ri.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ri.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else Ri.x=n,Ri.y=r;return Ri}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ze.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ze.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new i.OBBBounds),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){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const s=this.attribute,n=this.updateAABBBounds(s,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=s,a=(o=r)?i.isArray(o)?0===o.length?0:1===o.length?o[0]:2===o.length?(gi[0]=o[0],gi[2]=o[0],gi[1]=o[1],gi[3]=o[1],gi):o:o:0;var o;return a&&n.expand(a),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ot(t);return Nt(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(){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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new i.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&wt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&wt.UPDATE_BOUNDS)&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&wt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&wt.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&wt.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&wt.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=wt.CLEAR_SHAPE}containsPoint(t,e,s,n){if(!n)return!1;if(s===Pt.GLOBAL){const s=new i.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(s,s),t=s.x,e=s.y}return n.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const s=Object.keys(t);for(let e=0;e<s.length;e++){const i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(s)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,s,n){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);a?this._setAttributes(a,s,n):i.isNil(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ki;for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ki;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Mt.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=wt.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Mt.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Li,n);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?ze.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:ve.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:ve.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const s={type:Mt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Li,s);return n?(this._setAttributes(n,!1,s),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}scale(t,e,s){var n,r;if(1===t&&1===e)return this;const a={type:Mt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:s},this.attribute,Ei,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(s){let{postMatrix:n}=this.attribute;n||(n=new i.Matrix,l.postMatrix=n),ze.transformUtil.fromMatrix(n,n).scale(t,e,s)}else l.scaleX=(null!==(n=l.scaleX)&&void 0!==n?n:ve.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:ve.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Mt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Ei,s);return n?(this._setAttributes(n,!1,s),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}rotate(t,e){var s;if(0===t)return this;const n={type:Mt.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ii,n);r&&(delete r.angle,this._setAttributes(r,!1,n));const a=this.attribute;if(e){let{postMatrix:s}=this.attribute;s||(s=new i.Matrix,a.postMatrix=s),ze.transformUtil.fromMatrix(s,s).rotate(t,e)}else a.angle=(null!==(s=a.angle)&&void 0!==s?s:ve.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:Mt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ii,i);return s?(this._setAttributes(s,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new hi(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:s,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=s&&e.onFrame(s),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ze.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!i.isNil(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,s){var n,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]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const d=this.animate({slience:!0});d.stateNames=e,d.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:ui,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:pi),c&&this.setAttributes(c,!1,{type:Mt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Mt.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"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((s=>{if(s.stateNames){const n=s.getEndProps();i.has(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?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,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 s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,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 s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=wt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=wt.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=wt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&wt.UPDATE_SHAPE_AND_BOUNDS)===wt.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=wt.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=wt.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=wt.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=wt.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=wt.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=wt.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=wt.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&wt.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],s=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:s}=this.attribute;return Ci.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Ci),this.setAttributes({scaleX:t,scaleY:i,angle:s}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=s();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=s();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=ve.x,y:e=ve.y,scaleX:s=ve.scaleX,scaleY:n=ve.scaleY,angle:r=ve.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const c={};if(o&&(h=this.getAnchor(o,c)),!a||1===s&&1===n)i.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,s,n,r,o&&h);else{const i=this._transMatrix;i.reset(),i.translate(h[0],h[1]),i.rotate(r),i.translate(-h[0],-h[1]),i.translate(t,e),h=this.getAnchor(a,c),ze.transformUtil.fromMatrix(i,i).scale(s,n,{x:h[0],y:h[1]})}const d=this.getOffsetXY(ve);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=Oi.setValue(l.a,l.b,l.c,l.d,l.e,l.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.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ze.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Mt.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,l)}this.setAttributes(r,!1,{type:Mt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,l,h){h||(h=Object.keys(a),s.propKeys=h),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const c=a[r],d=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==c||null==d||c===d)return void(i[r]=c);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,d,c,i),u||(u=e.customInterpolate(r,n,d,c,this,i),u||this.defaultInterpolate(c,d,r,i,l,n)||this._interpolate(r,n,d,c,i))})),s.parsedProps=l}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=Ai(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=Ai(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=Ai(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}return!1}_interpolate(t,e,i,s,n){}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ze.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),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 i.isString(t,!0)?this.pathProxy=(new ye).fromString(t):this.pathProxy=new ye,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const s=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(s,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Pi.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(Pi.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):i.isObject(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 s=this.resources.get(t);s&&(s.state="success",s.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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",ze.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new si(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}}Di.mixin(ni);class Ni{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 ji(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function Fi(t,e,i){const s=function(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===s[0]){if(!s[1])return{data:n,index:r};if(t[r+1]===s[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!s)return;let n=s.data;const r=s.index,a=n.search(/\s/);let o=n,l=!0;-1!==a&&(o=n.substr(0,a).replace(/\s\s*$/,""),n=n.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==s.data.substr(t+1))}return{tagName:o,tagExp:n,closeIndex:r,attrExpPresent:l,rawTagName:h}}const zi=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Wi{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const n=function(t,e){const i=[];let s=e.exec(t);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const r=s.length;for(let t=0;t<r;t++)n.push(s[t]);i.push(n),s=e.exec(t)}return i}(t,zi),r=n.length;for(let t=0;t<r;t++){const e=n[t][1],i=n[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Ni("!xml");let i=e,s="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=ji(t,">",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=Fi(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=ji(t,"--\x3e",r+4,"Comment is not closed.");else{const a=Fi(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new Ni(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new Ni(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=c}else s+=t[r];return e.child}}function Gi(t,e){return $i(t)}function $i(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=Yi(n);if(void 0!==r&&n[r]){const t=$i(n[r]);s=t,Object.keys(s).length,n[":@"]&&Vi(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var s;return i}function Yi(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Vi(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let n=0;n<s;n++){const s=i[n];t[s]=e[s]}}}class Xi{constructor(t){this.options=Object.assign({},Xi.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Gi(new Wi(this.options).parseXml(t),this.options)}}function Hi(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Xi.defaultOptions={};let Ki=0;function qi(){return Ki++}var Zi;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Zi||(Zi={}));const Ji=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ji.set(t,!0)));const Qi=new Map;function ts(t){if(Ji.has(t))return!0;if(Qi.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Qi.set(t,!0))),qi(),qi();const es=qi();qi(),qi();const is=qi();qi();const ss=qi(),ns=qi(),rs=qi();qi(),qi(),qi(),qi();const as=qi(),os=qi(),ls=Symbol.for("GraphicCreator"),hs={"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"},cs=Object.keys(hs);var ds;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ds||(ds={}));class us extends Di{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=is,this._childUpdateTag=wt.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 Ze),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ze)}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,s){if(s===Pt.GLOBAL){const s=new i.Point(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(s,s),this.AABBBounds.contains(s.x,s.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&wt.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ze.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ze.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=ve.x,y:e=ve.y,dx:i=ve.dx,dy:s=ve.dy,scaleX:n=ve.scaleX,scaleY:r=ve.scaleY,angle:a=ve.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Qe(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:s=0}=t;i.translate(e,s)}return ze.graphicService.updateTempAABBBounds(i),ze.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=wt.CLEAR_BOUNDS,this._childUpdateTag&=wt.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=wt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&wt.UPDATE_BOUNDS||(this._childUpdateTag|=wt.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(),ze.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ze.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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,ze.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{ze.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),ze.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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[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&wt.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=ze.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new us(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return us.NOWORK_ANIMATE_ATTR}}function ps(t){return new us(t)}function fs(t,e){return!(!t&&!e)}function gs(t,e){let s;return s=i.isArray(t)?t.some((t=>t||void 0===t)):!!t,s&&e>0}function ms(t,e,i){return i&&t*e>0}function ys(t,e){return t*e>0}us.NOWORK_ANIMATE_ATTR=Ui;const bs=Symbol.for("PolygonRenderContribution"),xs=Symbol.for("SymbolRenderContribution"),vs=Symbol.for("InteractiveSubRenderContribution");function _s(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function As(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Bs(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 Ts(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,c,d,u,p,f,g,m,y;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],d=e[5],u=e[6],p=e[7],f=e[8],g=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=f,t[9]=g,t[10]=m,t[11]=y,t[12]=a*s+c*n+f*r+e[12],t[13]=o*s+d*n+g*r+e[13],t[14]=l*s+u*n+m*r+e[14],t[15]=h*s+p*n+y*r+e[15]),t}function Ss(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],d=e[8],u=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],b=e[15];let x=i[0],v=i[1],_=i[2],A=i[3];return t[0]=x*s+v*o+_*d+A*g,t[1]=x*n+v*l+_*u+A*m,t[2]=x*r+v*h+_*p+A*y,t[3]=x*a+v*c+_*f+A*b,x=i[4],v=i[5],_=i[6],A=i[7],t[4]=x*s+v*o+_*d+A*g,t[5]=x*n+v*l+_*u+A*m,t[6]=x*r+v*h+_*p+A*y,t[7]=x*a+v*c+_*f+A*b,x=i[8],v=i[9],_=i[10],A=i[11],t[8]=x*s+v*o+_*d+A*g,t[9]=x*n+v*l+_*u+A*m,t[10]=x*r+v*h+_*p+A*y,t[11]=x*a+v*c+_*f+A*b,x=i[12],v=i[13],_=i[14],A=i[15],t[12]=x*s+v*o+_*d+A*g,t[13]=x*n+v*l+_*u+A*m,t[14]=x*r+v*h+_*p+A*y,t[15]=x*a+v*c+_*f+A*b,t}class ws{constructor(){this.pools=[]}static identity(t){return Bs(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 ws.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(){this.pools=[]}}const Ps=new ws;var Ms=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Os=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cs=function(t,e){return function(i,s){e(i,s,t)}};function ks(t,e,i){var s;const{x:n=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:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(s=m[2])&&void 0!==s?s:0}if(Bs(t),Ts(t,t,[n+o,r+l,a+h]),Ts(t,t,[b[0],b[1],b[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],d=e[10],u=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*n+h*s,t[5]=a*n+c*s,t[6]=o*n+d*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=c*n-a*s,t[10]=d*n-o*s,t[11]=u*n-l*s}(t,t,f),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],d=e[10],u=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*n-h*s,t[1]=a*n-c*s,t[2]=o*n-d*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+c*n,t[10]=o*s+d*n,t[11]=l*s+u*n}(t,t,p),Ts(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,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,d,u]),g){const i=Ps.allocate(),s=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=m[1]}Ts(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],d=e[6],u=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*n+h*s,t[1]=a*n+c*s,t[2]=o*n+d*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=c*n-a*s,t[6]=d*n-o*s,t[7]=u*n-l*s}(i,i,g),Ts(i,i,[-s[0],-s[1],0]),Ss(t,t,i)}}let Ls=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new nt(["graphic"]),onSetStage:new nt(["graphic","stage"]),onRemove:new nt(["graphic"]),onRelease:new nt(["graphic"]),onAddIncremental:new nt(["graphic","group","stage"]),onClearIncremental:new nt(["graphic","group","stage"]),beforeUpdateAABBBounds:new nt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new nt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new i.AABBBounds,this.tempAABBBounds2=new i.AABBBounds}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,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}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 s=new ot(t);return Nt(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,s,n){const{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){const e=i.isNumber(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=As(a,e,e);s.set(s.x1,n,s.x2,n+e)}if(null!=t.forceBoundsWidth){const e=i.isNumber(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=_s(r,e);s.set(n,s.y1,n+e,s.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,s,n,r){if(!e.empty()){const{scaleX:i=s.scaleX,scaleY:r=s.scaleY,stroke:a=s.stroke,shadowBlur:o=s.shadowBlur,lineWidth:l=s.lineWidth,pickStrokeBuffer:h=s.pickStrokeBuffer,strokeBoundsBuffer:c=s.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){Hi(d,(l+h)/Math.abs(i+r),n,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:n=s.shadowOffsetX,shadowOffsetY:a=s.shadowOffsetY}=t;Hi(d,o/Math.abs(i+r)*2,!1,c+1),d.translate(n,a),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0;const o=r.transMatrix;r&&r.isContainer&&(a=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),a&&i.transformBoundsWithMatrix(e,e,o)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot||s.isContainer)return!0;const{visible:n=e.visible}=t;return!(!s.valid||!n)||(i.empty()||(s.parent&&i.transformWithMatrix(s.parent.globalTransMatrix),ze.graphicService.clearAABBBounds(s,s.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}}};Ls=Ms([N(),Cs(0,U(ls)),Os("design:paramtypes",[Object])],Ls);const Es={x:0,y:0,z:0,lastModelMatrix:null};class Is{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&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===It.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===It.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){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,s,n,r,a,o,l,h,c,d,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){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,s,n,r,a,o,l,h,c,d,u)}))}valid(t,e,i,s){const{fill:n=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:d=e.visible}=t.attribute,u=ms(o,l,n),p=ys(o,c),f=fs(n,r),g=gs(a,h);return!(!t.valid||!d)&&!(!f&&!g)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:n=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,d=i.modelMatrix,u=i.camera;Es.x=n,Es.y=r,Es.z=a,Es.lastModelMatrix=d;const p=u&&(s||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 s=Ps.allocate(),n=Ps.allocate();ks(n,t,e),Ss(s,d||s,n),Es.x=0,Es.y=0,Es.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Ps.free(n)}if(f&&!d){const s=t.getOffsetXY(e);Es.x+=s.x,Es.y+=s.y,Es.z=a,i.setTransformForCurrent()}else if(p)Es.x=0,Es.y=0,Es.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);Es.x+=s.x,Es.y+=s.y,this.transformWithoutTranslate(i,Es.x,Es.y,Es.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Es.x=0,Es.y=0,Es.z=0;return Es}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},c={x:n,y:0},d={x:n,y:r};s.camera=null;const u=1/(h.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+d.y*o.x+(c.y-d.y)*a.x)*u,f=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*a.y)*u,g=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*a.x)*u,m=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*a.y)*u,y=(h.x*(d.y*o.x-c.y*l.x)+h.y*(c.x*l.x-d.x*o.x)+(d.x*c.y-c.x*d.y)*a.x)*u,b=(h.x*(d.y*o.y-c.y*l.y)+h.y*(c.x*l.y-d.x*o.y)+(d.x*c.y-c.x*d.y)*a.y)*u;s.setTransform(p,f,g,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n){const{context:r}=s;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:d}=o;this.z=c,function(t,e,i,s,n,r,a,o){if(!t.pathProxy)return!1;const l=Qe(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:d=l.opacity,fillOpacity:u=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:f=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=ms(d,u,h),x=ys(d,f),v=fs(h),_=gs(c,p);return!g||(!v&&!_||(!(b||x||a||o)||(e.beginPath(),Nt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,i-m,s-y,l),e.stroke())),v&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,s-y,l),e.fill())),!0)))}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==d&&Ps.free(r.modelMatrix),r.modelMatrix=d),r.highPerformanceRestore()}}var Rs=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ds=function(t,e){return function(i,s){e(i,s,t)}};const Ns=new class{constructor(){this.time=It.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const n=t.resources.get(f);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Qe(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=g*m,this.doDrawImage(e,n.data,r,y,b),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=g*m,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s,n){if("no-repeat"===s)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),a=i.height();let o=r,l=a;if(n&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(o=i*(a/n),l=a):"repeat-y"===s&&(l=n*(r/i),o=r);const h=t.dpr,c=Ve.allocate({width:o,height:l,dpr:h}),d=c.getContext("2d");d&&(d.inuse=!0,d.clearMatrix(),d.setTransformForCurrent(!0),d.clearRect(0,0,o,l),d.drawImage(e,0,0,o,l),e=c.nativeCanvas),Ve.free(c)}const h=t.dpr,c=t.createPattern(e,s);c.setTransform&&c.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}};let js=class{constructor(t){this.subRenderContribitions=t,this.time=It.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}};js=Rs([N(),Ds(0,U(tt)),Ds(0,j(vs)),Us("design:paramtypes",[Object])],js);const Fs=new class{constructor(){this.time=It.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Ve.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),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Ve.free(o),h}createCirclePattern(t,e,s,n){return this.createCommonPattern(t,e,s,n,((t,e)=>{e.fillStyle=s,e.arc(t,t,t,0,i.pi2),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:f=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,f,g,m)}drawTexture(t,e,i,s,n,r,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}};const zs=new class{constructor(){this.time=It.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,m=f&&!1!==f.visible;if(!g&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:x=l.x,y:v=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:B=l.keepStrokeScale}=t.attribute,T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=B?o:We(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,y,i,s,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/_,(v-s)/A,l[r]),l[r].opacity=a,e.stroke()}};g&&T(p,"outerBorder"),m&&T(f,"innerBorder")}},Ws=Fs,Gs=Ns;function $s(t,e,s,n){if(!e.p1)return;const{offsetX:r=0,offsetY:a=0,offsetZ:o=0}=n||{};if(1===s)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,a+e.p1.y,r+e.p2.x,a+e.p2.y,r+e.p3.x,a+e.p3.y,o):t.lineTo(r+e.p1.x,a+e.p1.y,o);else if(e.p2&&e.p3){const[n]=function(t,e){const{p0:s,p1:n,p2:r,p3:a}=t,o=Wt(s,n,r,a,e),l=i.PointService.pointAtPP(s,n,e),h=i.PointService.pointAtPP(n,r,e),c=i.PointService.pointAtPP(r,a,e),d=i.PointService.pointAtPP(l,h,e),u=i.PointService.pointAtPP(h,c,e);return[new Gt(s,l,d,o),new Gt(o,u,c,a)]}(e,s);t.bezierCurveTo(r+n.p1.x,a+n.p1.y,r+n.p2.x,a+n.p2.y,r+n.p3.x,a+n.p3.y,o)}else{const i=e.getPointAt(s);t.lineTo(r+i.x,a+i.y,o)}}function Ys(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:c,originP2:d}=e;let u;if(c&&!1!==c.defined&&!i?u=l:c&&!1!==d.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+n,o+r,a)}else u&&(h=!s,t.lineTo(u.x+n,u.y+r,a))}return h}var Vs=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Xs=class extends Is{constructor(){super(...arguments),this.numberType=ss}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).line;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,s,n,r,a,o,l,h,c,d,u,p,f,g){var m;if(!e)return;t.beginPath();const y=null!==(m=this.z)&&void 0!==m?m:0;(function(t,e,s,n,r){const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1}=r||{};if(c&&"none"===h)return;if(!e)return;let d=!0;const{curves:u}=e;if(s>=1){if(c){let e,i=!0;u.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Ys(t,s,e,i,a,o,l),e=s):e=s}))}else u.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+a,e.p0.y+o,l),$s(t,e,1,r),d=!1):d=!0}));return}if(s<=0)return;let p;"x"===n?p=Lt.ROW:"y"===n?p=Lt.COLUMN:"auto"===n&&(p=e.direction);const f=s*e.tryUpdateLength(p);let g=0,m=!0,y=null;for(let e=0,s=u.length;e<s;e++){const s=u[e],n=s.getLength(p),h=(f-g)/n;if(g+=n,h<0)break;if(c){if(s.originP1===s.originP2){y=s;continue}m=Ys(t,s,y,m,a,o,l),y=s}else{if(!s.defined){d=!0;continue}d&&t.moveTo(s.p0.x+a,s.p0.y+o,l),$s(t,s,i.min(h,1),r),d=!1}}})(t.camera?t:t.nativeContext,e,h,c,{offsetX:d,offsetY:u,offsetZ:y}),p.cache&&!i.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,l);const{x:b=0,x:x=0}=o;return!1!==s&&(f?f(t,o,l):r&&(t.setCommonStyle(p,o,b-d,x-u,l),t.fill())),!1!==n&&(g?g(t,o,l):a&&(t.setStrokeStyle(p,o,b-d,x-u,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,m=g[0];e.moveTo(m.x+a,m.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:y=0,x:b=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==s&&(u?u(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,s,n,r,a,o,l){const h=Qe(t,null==a?void 0:a.theme).line,{fill:c=h.fill,stroke:d=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,segments:f,points:g,closePath:m,curveTension:y=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,l))return;let{curveType:x=h.curveType}=t.attribute;m&&"linear"===x&&(x="linearClosed");const{clipRange:v=h.clipRange,clipRangeByDimension:_=h.clipRangeByDimension}=t.attribute;if(1===v&&!f&&!g.some((t=>!1===t.defined))&&"linear"===x)return this.drawLinearLineHighPerformance(t,e,!!c,!!d,u,p,s,n,h,r,a,o,l);function A(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=me(A(t.points,b),x,{startPoint:e,curveTension:y});return s=n,n})).filter((t=>!!t)),"linearClosed"===x){let e;for(let i=0;i<t.cache.length;i++){const s=t.cache[i];for(let t=0;t<s.curves.length;t++)if(s.curves[t].defined){e=s.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=me(A(s,b),x,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===v){let i=!1;t.cache.forEach(((a,f)=>{i||(i=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[f],[h,t.attribute],v,_,s,n,t,o,l))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),f=v*a;let g=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),x=(f-g)/b;g+=b,x>0&&(m=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[y],[h,t.attribute],i.min(x,1),_,s,n,t,o,l))}))}}else this.drawSegmentItem(e,t.cache,!!c,!!d,u,p,t.attribute,h,v,_,s,n,t,o,l)}};Xs=Vs([N()],Xs);var Hs=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ks=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qs=function(t,e){return function(i,s){e(i,s,t)}};let Zs=class extends Is{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=as,this.builtinContributions=[zs,Gs,Ws],this.init(t)}drawShape(t,e,s,n,r,a,o,l){var h;const c=Qe(t,null==a?void 0:a.theme).symbol,{size:d=c.size,x:u=c.x,y:p=c.y,scaleX:f=c.scaleX,scaleY:g=c.scaleY,fillStrokeOrder:m=c.fillStrokeOrder}=t.attribute,y=this.valid(t,c,o,l);if(!y)return;const{fVisible:b,sVisible:x,doFill:v,doStroke:_}=y,A=t.getParsedPath();if(!A)return;const{keepDirIn3d:B=c.keepDirIn3d}=t.attribute,T=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();const S=(i,r)=>{var a,h,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!==(d=r.stroke)&&void 0!==d?d:t.attribute.stroke,r=e}const y=()=>{r.fill&&(o?o(e,t.attribute,c):(e.setCommonStyle(t,r,u-s,p-n,c),e.fill()))},b=()=>{r.stroke&&(l?l(e,t.attribute,c):(e.setStrokeStyle(t,r,(u-s)/f,(p-n)/g,c),e.stroke()))};m?(b(),y()):(y(),b())};if(B&&e.camera&&e.project){const t=e.project(s,n,T),r=e.camera;e.camera=null,!1===A.draw(e,i.isArray(d)?[d[0]*f,d[1]*g]:d*f,t.x,t.y,void 0,S)&&e.closePath(),e.camera=r}else!1===A.draw(e,d,s,n,T,S)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,s,n,v,_,b,x,c,r,o,l);const w=()=>{v&&!A.isSvg&&(o?o(e,t.attribute,c):b&&(e.setCommonStyle(t,t.attribute,u-s,p-n,c),e.fill()))},P=()=>{_&&!A.isSvg&&(l?l(e,t.attribute,c):x&&(e.setStrokeStyle(t,t.attribute,(u-s)/f,(p-n)/g,c),e.stroke()))};m?(P(),w()):(w(),P()),this.afterRenderStep(t,e,s,n,v,_,b,x,c,r,o,l)}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Zs=Hs([N(),qs(0,U(tt)),qs(0,j(xs)),Ks("design:paramtypes",[Object])],Zs);const Js=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}};function Qs(t,e,i,s){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+s)}function tn(t,e){return Math.sqrt(t*t+e*e)}function en(t,e,i,s,n){const r=e/i;return{x:t.x-s*r,y:t.y-n*r}}const sn=Fs,nn=Ns;var rn=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},an=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},on=function(t,e){return function(i,s){e(i,s,t)}};let ln=class extends Is{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=rs,this.builtinContributions=[nn,sn],this.init(t)}drawShape(t,e,s,n,r,a,o,l){const h=Qe(t,null==a?void 0:a.theme).polygon,{points:c=h.points,cornerRadius:d=h.cornerRadius,x:u=h.x,y:p=h.y,closePath:f=h.closePath,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,m=this.valid(t,h,o,l);if(!m)return;const{fVisible:y,sVisible:b,doFill:x,doStroke:v}=m;e.beginPath(),d<=0||i.isArray(d)&&d.every((t=>0===t))?Qs(e.camera?e:e.nativeContext,c,s,n):function(t,e,i,s,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Qs(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));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],d=h.x-o.x,u=h.y-o.y,p=h.x-c.x,f=h.y-c.y,g=(Math.atan2(u,d)-Math.atan2(f,p))/2,m=Math.abs(Math.tan(g));let y=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,b=y/m;const x=tn(d,u),v=tn(p,f),_=Math.min(x,v);b>_&&(b=_,y=_*m);const A=en(h,b,x,d,u),B=en(h,b,v,p,f),T=2*h.x-A.x-B.x,S=2*h.y-A.y-B.y,w=tn(T,S),P=en(h,tn(b,y),w,T,S);let M=Math.atan2(A.y-P.y,A.x-P.x);const O=Math.atan2(B.y-P.y,B.x-P.x);let C=O-M;C<0&&(M=O,C=-C),C>Math.PI&&(C-=Math.PI),0===r?t.moveTo(A.x+i,A.y+s):t.lineTo(A.x+i,A.y+s),C&&t.arcTo(h.x+i,h.y+s,B.x+i,B.y+s,y),t.lineTo(B.x+i,B.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,c,s,n,d,f),f&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,s,n,x,v,y,b,h,r,o,l);const _=()=>{x&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,u-s,p-n,h),e.fill()))},A=()=>{v&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,u-s,p-n,h),e.stroke()))};g?(A(),_()):(_(),A()),this.afterRenderStep(t,e,s,n,x,v,y,b,h,r,o,l)}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};ln=rn([N(),on(0,U(tt)),on(0,j(bs)),an("design:paramtypes",[Object])],ln);const hn=Symbol.for("GraphicRender"),cn=Symbol.for("LineRender"),dn=Symbol.for("PolygonRender"),un=Symbol.for("SymbolRender");class pn{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,s){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===s.length){const t=s[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=rt.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const d=[],u=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,s=t.length;i<s;i++){const s=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(s.width>o){const s=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,n,r,l);a=s.str,e=s.width}else e=s.width;d.push({str:a,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:c})}u[0]=o}else{let e,i,s=0;for(let n=0,r=t.length;n<r;n++){i=t[n];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,h);e=r.width,s=Math.max(s,e),d.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}u[0]=s}u[1]=d.length*s,u[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,s,n,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:s}}lineOffset(t,e,i,s,n,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=n/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<n-t&&("bottom"===s?e.topOffset+=(n-i)/2:"top"===s&&(e.topOffset-=(n-i)/2)),"alphabetic"===s){const t=n/(e.ascent+e.descent);e.topOffset=n/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=n,e}}const fn=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ki];class gn extends Di{get font(){const t=this.getGraphicTheme();return this._font||(this._font=i.getContextFont(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),s=this.getMaxWidth(i);return Number.isFinite(s)?(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(),s=this.attribute,n=this.getMaxWidth(i);if(!Number.isFinite(n))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"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=os,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return i.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Qe(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:s=t.angle}=e;if(!s){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new gn({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:r,y:a}=e,o={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},l=i.rotatePoint(o,s,{x:r,y:a});return this._OBBBounds.copy(n),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=s,this._OBBBounds}updateAABBBounds(t,e,s){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:r}=ze.graphicService.updateTempAABBBounds(s),{scaleX:a=e.scaleX,scaleY:o=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(l){Hi(r,l/Math.abs(a+o),!0,h),s.union(r)}return ze.graphicService.combindShadowAABBBounds(s,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ze.graphicService.updateHTMLTextAABBBounds(t,e,s),i.transformBoundsWithMatrix(s,s,this.transMatrix),s}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:s=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),n}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),s=this.attribute,{fontFamily:n=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:d=i.stroke,wrap:u=i.wrap,measureMode:p=i.measureMode,lineWidth:f=i.lineWidth,whiteSpace:g=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=s,x=y?0:this.guessLineHeightBuf(o),v=this.getLineHeight(s,i,x);if("normal"===g||u)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),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const _=ze.graphicUtil.textMeasure,A=new pn(n,{fontSize:o,fontWeight:l,fontFamily:n,lineHeight:v},_).GetLayoutByLines(t,r,a,v,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:B}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:d,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:y=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:x=0,lineClamp:v,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(h),B=this.getLineHeight(this.attribute,r,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(p/2),this._AABBBounds}const T=ze.graphicUtil.textMeasure,S={fontSize:h,fontWeight:g,fontFamily:a,lineHeight:B},w=new pn(a,S,T),P=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],M=[],O=[0,0];let C=1/0;if(x>0&&(C=Math.max(Math.floor(x/B),1)),v&&(C=Math.min(C,v)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<P.length;t++){const e=P[t];let i=!0;if(t===C-1){const i=T.clipTextWithSuffix(e,S,d,c,!1,b,t!==P.length-1),s=T.measureTextPixelADscentAndWidth(i.str,S,y);M.push({str:i.str,width:i.width,ascent:s.ascent,descent:s.descent,keepCenterInLine:_});break}const r=T.clipText(e,S,d,"break-all"!==f,"keep-all"===f);if(""!==e&&""===r.str||r.wordBreaked){if(c){const t=T.clipTextWithSuffix(e,S,d,c,!1,b);r.str=null!==(s=t.str)&&void 0!==s?s:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}const a=T.measureTextPixelADscentAndWidth(r.str,S,y);M.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||(i=!0,o=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(o);"keep-all"===f&&(i=i.replace(/^\s+/g,"")),P.splice(t+1,0,i)}}let t=0;M.forEach((e=>{t=Math.max(t,e.width)})),O[0]=t}else{let t,e,i=0;for(let s=0,n=P.length;s<n;s++){if(s===C-1){const t=T.clipTextWithSuffix(P[s],S,d,c,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,S,y);M.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=P[s],t=T.measureTextWidth(e,S),i=Math.max(i,t);const n=T.measureTextPixelADscentAndWidth(e,S,y);M.push({str:e,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:_})}O[0]=i}O[1]=M.length*B;const k={xOffset:0,yOffset:0,width:O[0],height:O[1]};w.LayoutBBox(k,o,l,M);const L=w.layoutWithBBox(k,M,o,l,B);return this.cache.layoutData=L,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,s;const n=this.getGraphicTheme(),r=ze.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,fontFamily:c=n.fontFamily,fontSize:d=n.fontSize,fontWeight:u=n.fontWeight,stroke:p=n.stroke,lineWidth:f=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:m=n.suffixPosition}=o,y=this.getLineHeight(o,n,0);let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!g){const t=b;b=null!==(e=gn.baselineMapAlign[x])&&void 0!==e?e:"left",x=null!==(s=gn.alignMapBaseline[t])&&void 0!==s?s:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const t=_s(b,a),e=this.cache.verticalList.length*y,s=As(x,e,d);return this._AABBBounds.set(s,t,s+e,t+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,s="";for(let n=0;n<t.length;n++)ts(t[n])?i?s+=t[n]:(i=1,s=t[n]):(i&&(e.push({text:s,direction:Zi.VERTICAL}),s="",i=0),e.push({text:t[n],direction:Zi.HORIZONTAL}));return s&&e.push({text:s,direction:Zi.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const i=!0===h?n.ellipsis:h,s=r.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,i,!1,m);v[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,!1);v[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Zi.HORIZONTAL?d:r.measureTextWidth(t.text,{fontSize:d,fontWeight:u,fontFamily:c});a+=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);a=i.max(e,a)}));const _=_s(b,a),A=this.cache.verticalList.length*y,B=As(x,A,d);return this._AABBBounds.set(B,_,B+A,_+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}getMaxWidth(t){var e,i;const s=this.attribute;return null!==(i=null!==(e=s.maxLineWidth)&&void 0!==e?e:s.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var s;return null!==(s=bi(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==s?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn;return super.needUpdateTag(t,e)}clone(){return new gn(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gn.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return gn.baselineMapAlign}getAlignMapBaseline(){return gn.alignMapBaseline}}function mn(t){return new gn(t)}gn.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ui),gn.baselineMapAlign={top:"left",bottom:"right",middle:"center"},gn.alignMapBaseline={left:"top",right:"bottom",center:"middle"};class yn{bounds(t,e){if(i.isNumber(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 i.isNumber(t)?t:Math.min(t[0],t[1])}}function bn(t,e,s,n,r){return r?t.arc(s,n,e,0,i.tau,!1,r):t.arc(s,n,e,0,i.tau),!1}var xn=new class extends yn{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,s,n){return bn(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return bn(t,this.parseSize(e)/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var vn=new class extends yn{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,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,r)}};function _n(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var An=new class extends yn{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return _n(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return _n(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return _n(t,this.parseSize(e)/2+n,i,s,r)}};function Bn(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var Tn=new class extends yn{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return Bn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Bn(t,this.parseSize(e)/2+n,i,s)}};function Sn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class wn extends yn{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,s){return Sn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Sn(t,this.parseSize(e)/2,i,s,n)}}var Pn=new wn;var Mn=new class extends wn{constructor(){super(...arguments),this.type="triangle"}};const On=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Cn=Math.sin(i.tau/10)*On,kn=-Math.cos(i.tau/10)*On;function Ln(t,e,s,n){const r=Cn*e,a=kn*e;t.moveTo(s,-e+n),t.lineTo(r+s,a+n);for(let o=1;o<5;++o){const l=i.tau*o/5,h=Math.cos(l),c=Math.sin(l);t.lineTo(c*e+s,-h*e+n),t.lineTo(h*r-c*a+s,c*r+h*a+n)}return t.closePath(),!0}var En=new class extends yn{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,s){return Ln(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ln(t,this.parseSize(e)/2+n,i,s)}};const In=i.sqrt(3);function Rn(t,e,i,s){const n=e,r=n/In,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}var Un=new class extends yn{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,s){return Rn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Rn(t,this.parseSize(e)/2+n,i,s)}};function Dn(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var Nn=new class extends yn{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Dn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Dn(t,this.parseSize(e)/2+n,i,s)}};function jn(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Fn=new class extends yn{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return jn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return jn(t,this.parseSize(e)/2+n,i,s)}};const zn=-.5,Wn=i.sqrt(3)/2,Gn=1/i.sqrt(12);function $n(t,e,i,s){const n=e/2,r=e*Gn,a=n,o=e*Gn+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(zn*n-Wn*r+i,Wn*n+zn*r+s),t.lineTo(zn*a-Wn*o+i,Wn*a+zn*o+s),t.lineTo(zn*l-Wn*h+i,Wn*l+zn*h+s),t.lineTo(zn*n+Wn*r+i,zn*r-Wn*n+s),t.lineTo(zn*a+Wn*o+i,zn*o-Wn*a+s),t.lineTo(zn*l+Wn*h+i,zn*h-Wn*l+s),t.closePath(),!1}var Yn=new class extends yn{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,s){return $n(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return $n(t,this.parseSize(e)/2+n,i,s)}};function Vn(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var Xn=new class extends yn{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,s){return Vn(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return Vn(t,this.parseSize(e)/2,i,s,n)}};function Hn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var Kn=new class extends yn{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,s){return Hn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Hn(t,this.parseSize(e)/2,i,s,n)}};function qn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var Zn=new class extends yn{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,s){return qn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return qn(t,this.parseSize(e)/2,i,s,n)}};const Jn=i.sqrt(3);function Qn(t,e,i,s){const n=e*Jn;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var tr=new class extends yn{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Qn(t,this.parseSize(e)/2/Jn,i,s)}drawOffset(t,e,i,s,n){return Qn(t,this.parseSize(e)/2/Jn+n,i,s)}};function er(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var ir=new class extends yn{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,s){return er(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return er(t,this.parseSize(e)/4+n,i,s)}};function sr(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var nr=new class extends yn{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,s){return sr(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return sr(t,this.parseSize(e)/4+n,i,s)}};function rr(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var ar=new class extends yn{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,s){return rr(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return rr(t,this.parseSize(e)/4+n,i,s)}};function or(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var lr=new class extends yn{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,s){return or(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return or(t,this.parseSize(e)/4+n,i,s)}};function hr(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var cr=new class extends yn{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return hr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return hr(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function dr(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var ur=new class extends yn{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return dr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return dr(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function pr(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var fr=new class extends yn{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,s,n){return pr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return pr(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function gr(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function mr(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}var yr=new class extends yn{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,s,n){return i.isNumber(e)?mr(t,e,s,n):gr(t,e,s,n)}drawOffset(t,e,s,n,r){return i.isNumber(e)?mr(t,e+2*r,s,n):gr(t,[e[0]+2*r,e[1]+2*r],s,n)}};const br=new i.AABBBounds;class xr{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,i.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=s}drawOffset(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),Nt(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(Nt(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,r)}parseSize(t){return i.isNumber(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:s}=i;br.x1=s.bounds.x1*t,br.y1=s.bounds.y1*t,br.x2=s.bounds.x2*t,br.y2=s.bounds.y2*t,e.union(br)}))}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 vr={};[xn,vn,An,Tn,tr,Mn,En,Un,Nn,Fn,Yn,Xn,Kn,Pn,Zn,ir,nr,ar,lr,yr,cr,ur,fr].forEach((t=>{vr[t.type]=t}));const _r={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"},Ar=new i.AABBBounds,Br=["symbolType","size",...ki];let Tr=class t extends Di{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=as}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return i.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:s=e.symbolType}=this.attribute,n=vr[s];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[s],n)return this._parsedPath=n,n;if(s=_r[s]||s,!0===((r=s).startsWith("<svg")||r.startsWith("<?xml"))){const e=new Xi,{svg:n}=e.parse(s);if(!n)return null;const r=i.isArray(n.path)?n.path:[n.path];Ar.clear();const a=[];r.forEach((t=>{const e=(new ye).fromString(t.d),i={};cs.forEach((e=>{t[e]&&(i[hs[e]]=t[e])})),a.push({path:e,attribute:i}),Ar.union(e.bounds)}));const o=Ar.width(),l=Ar.height(),h=1/i.max(o,l);return a.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new xr(s,a,!0),t.userSymbolMap[s]=this._parsedPath,this._parsedPath}var r;const a=(new ye).fromString(s),o=a.bounds.width(),l=a.bounds.height(),h=1/i.max(o,l);return a.transform(0,0,h,h),this._parsedPath=new xr(s,a),t.userSymbolMap[s]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Qe(this).symbol}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=ze.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;Hi(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,s){const{size:n=e.size}=t;if(i.isArray(n))s.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;s.set(-t,-t,t,t)}return s}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Br)}needUpdateTag(t){return super.needUpdateTag(t,Br)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,s=i.isArray(e)?e:[e,e];return t.path?(new ye).fromCustomPath2D(t.path,0,0,s[0],s[1]):(new ye).fromString(t.pathStr,0,0,s[0],s[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Sr(t){return new Tr(t)}Tr.userSymbolMap={},Tr.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ui);const wr=["segments","points","curveType","curveTension",...ki];class Pr extends Di{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=ss}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,s,n){"points"===t&&(n.points=yi(i,s,e))}getGraphicTheme(){return Qe(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,wr)}needUpdateTag(t){return super.needUpdateTag(t,wr)}toCustomPath(){const t=this.attribute,e=new ye,i=t.segments,s=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=>{s(t.points)})):t.points&&s(t.points),e}clone(){return new Pr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Pr.NOWORK_ANIMATE_ATTR}}function Mr(t){return new Pr(t)}Pr.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ui);const Or=["path","customPath",...ki];class Cr extends Di{constructor(t){super(t),this.type="path",this.numberType=ns}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 ye?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ye?this.cache:t.path)}getGraphicTheme(){return Qe(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=ze.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;i.isString(t.path,!0)?this.cache=(new ye).fromString(t.path):t.customPath&&(this.cache=new ye,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Or)}needUpdateTag(t){return super.needUpdateTag(t,Or)}toCustomPath(){return(new ye).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Cr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cr.NOWORK_ANIMATE_ATTR}}function kr(t){return new Cr(t)}Cr.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ui);const Lr=["segments","points","curveType","curveTension",...ki];class Er extends Di{constructor(t){super(t),this.type="area",this.numberType=es}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 Qe(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.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,s){const{segments:n=e.segments}=t,r=i;return n.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,s,n){"points"===t&&(n.points=yi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Lr)}needUpdateTag(t){return super.needUpdateTag(t,Lr)}toCustomPath(){const t=new ye,e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new Er(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Er.NOWORK_ANIMATE_ATTR}}Er.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ui);const Ir=["points","cornerRadius",...ki];class Rr extends Di{constructor(t){super(t),this.type="polygon",this.numberType=rs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Qe(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=yi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Ir)}needUpdateTag(t){return super.needUpdateTag(t,Ir)}toCustomPath(){const t=this.attribute.points,e=new ye;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 Rr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rr.NOWORK_ANIMATE_ATTR}}function Ur(t){return new Rr(t)}Rr.NOWORK_ANIMATE_ATTR=Ui;var Dr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Nr,jr=class extends Xs{constructor(){super(...arguments),this.numberType=ss}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Qe(t).line,{fill:c=h.fill,stroke:d=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:f=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:m=h.visible}=t.attribute,y=ms(u,p,c),b=ys(u,f),x=fs(c),v=gs(d,g);if(!t.valid||!m)return;if(!x&&!v)return;if(!(y||b||a||o))return;const{context:_}=n;for(let n=e;n<e+r;n++)this.drawIncreaseSegment(t,_,l[n-1],l[n],t.attribute.segments[n],[h,t.attribute],i,s)}else super.drawShape(t,e,i,s,n,r,a,o)}drawIncreaseSegment(t,e,i,s,n,r,a,o){s&&(e.beginPath(),function(t,e,i,s){const{offsetX:n=0,offsetY:r=0}=s||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+n,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};jr=Dr([N()],jr);let Fr=!1;const zr=new P((t=>{Fr||(Fr=!0,t(Xs).toSelf().inSingletonScope(),t(jr).toSelf().inSingletonScope(),t(cn).to(Xs).inSingletonScope(),t(hn).toService(cn))}));let Wr=!1;const Gr=new P((t=>{Wr||(Wr=!0,t(Zs).toSelf().inSingletonScope(),t(un).to(Zs).inSingletonScope(),t(hn).toService(un),t(xs).toService(js),it(t,xs))}));let $r=!1;const Yr=new P((t=>{$r||($r=!0,t(dn).to(ln).inSingletonScope(),t(hn).toService(dn),t(bs).toService(js),it(t,bs))}));const Vr=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Xr extends us{constructor(t,e){super(t),(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,s,n){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(r)return this._setAttributes(r,s);i.isPlainObject(this.attribute[t])&&i.isPlainObject(e)&&!i.isFunction(this.attribute[t])&&!i.isFunction(e)?i.merge(this.attribute[t],e):this.attribute[t]=e,Vr.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!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=>Vr.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){i.isNil(e)&&(e=Object.keys(t));for(let s=0;s<e.length;s++){const n=e[s];!i.isPlainObject(this.attribute[n])||i.isFunction(this.attribute[n])||i.isFunction(t[n])?this.attribute[n]=t[n]:i.merge(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 s=new si(t,e);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}}const Hr=Symbol.for("MathPickerContribution"),Kr=Symbol.for("MathLinePicker"),qr=Symbol.for("MathSymbolPicker"),Zr=Symbol.for("MathPolygonPicker"),Jr=Symbol.for("CanvasLinePicker"),Qr=Symbol.for("CanvasSymbolPicker"),ta=Symbol.for("CanvasPolygonPicker"),ea=Symbol.for("CanvasPickerContribution");class ia{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:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();let{x:r=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,a+=e.y,s.setTransformForCurrent()}else r=0,a=0,s.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,n)=>{if(o)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,l=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=l?r+a:We(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}var sa=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},na=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ra=function(t,e){return function(i,s){e(i,s,t)}};let aa=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ss}};aa=sa([N(),ra(0,U(cn)),na("design:paramtypes",[Object])],aa);let oa=!1;const la=new P(((t,e,i,s)=>{oa||(oa=!0,t(Kr).to(aa).inSingletonScope(),t(Hr).toService(Kr))}));var ha=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ca=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},da=function(t,e){return function(i,s){e(i,s,t)}};let ua=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=rs}};ua=ha([N(),da(0,U(dn)),ca("design:paramtypes",[Object])],ua);let pa=!1;const fa=new P(((t,e,i,s)=>{pa||(pa=!0,t(Zr).to(ua).inSingletonScope(),t(Hr).toService(Zr))}));var ga=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ma=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ya=function(t,e){return function(i,s){e(i,s,t)}};let ba=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=as}};ba=ga([N(),ya(0,U(un)),ma("design:paramtypes",[Object])],ba);let xa=!1;const va=new P(((t,e,i,s)=>{xa||(xa=!0,t(qr).to(ba).inSingletonScope(),t(Hr).toService(qr))}));class _a extends Is{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.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 d=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,i)=>{if(d)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:We(s,n+r,s.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ps.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),d}}var Aa=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ba=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ta=function(t,e){return function(i,s){e(i,s,t)}};let Sa=class extends _a{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ss}};Sa=Aa([N(),Ta(0,U(cn)),Ba("design:paramtypes",[Object])],Sa);let wa=!1;const Pa=new P(((t,e,i,s)=>{wa||(wa=!0,t(Jr).to(Sa).inSingletonScope(),t(ea).toService(Jr))}));class Ma extends Is{contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();const r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.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 d=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ps.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),d}}var Oa=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ca=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ka=function(t,e){return function(i,s){e(i,s,t)}};let La=class extends Ma{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=as}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,s),{x:o,y:l,z:h,lastModelMatrix:c}=a;let d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:We(s,n+r,s.dpr),u=t.isPointInStroke(d.x,d.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==c&&Ps.free(s.modelMatrix),s.modelMatrix=c,s.highPerformanceRestore(),u}};La=Oa([N(),ka(0,U(un)),Ca("design:paramtypes",[Object])],La);let Ea=!1;const Ia=new P(((t,e,i,s)=>{Ea||(Ea=!0,t(Qr).to(La).inSingletonScope(),t(ea).toService(Qr))}));var Ra=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ua=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Da=function(t,e){return function(i,s){e(i,s,t)}};let Na=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=rs}};Na=Ra([N(),Da(0,U(dn)),Ua("design:paramtypes",[Object])],Na);let ja=!1;const Fa=new P(((t,e,i,s)=>{ja||(ja=!0,t(ta).to(Na).inSingletonScope(),t(ea).toService(ta))})),za=function(){!function(){if(null==Nr)try{const t=document.createElement("canvas"),e=t.getContext("2d");Nr=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),Nr&&(Nr=!!document.createElement)}catch(t){Nr=!1}}();const t=ze.global&&ze.global.env;return t?"browser"===t:Nr}();function Wa(){Wa.__loaded||(Wa.__loaded=!0,Js.RegisterGraphicCreator("group",ps))}Wa.__loaded=!1;const Ga=Wa;function $a(){$a.__loaded||($a.__loaded=!0,Js.RegisterGraphicCreator("line",Mr),Ge.load(zr),Ge.load(za?Pa:la))}$a.__loaded=!1;const Ya=$a;function Va(){Va.__loaded||(Va.__loaded=!0,Js.RegisterGraphicCreator("polygon",Ur),Ge.load(Yr),Ge.load(za?Fa:fa))}Va.__loaded=!1;const Xa=Va;function Ha(){Ha.__loaded||(Ha.__loaded=!0,Js.RegisterGraphicCreator("symbol",Sr),Ge.load(Gr),Ge.load(za?Ia:va))}Ha.__loaded=!1;const Ka=Ha;Ga(),Ya(),Xa(),Ka();class qa extends Xr{getStartAngle(){return i.normalizeAngle(this._startAngle)}getEndAngle(){return i.normalizeAngle(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},qa.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:s,state:n,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),h=this._renderSymbol(t,l,"start"),c=this._renderSymbol(e,l,"end");if(this.startSymbol=h,this.endSymbol=c,a){const t=[...this.attribute.points];if(i.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const e=this._clipPoints(i.flattenArray(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 r,a;const o=Js.line(Object.assign(Object.assign({points:t},i.isArray(s)?null!==(r=s[e])&&void 0!==r?r:s[s.length-1]:s),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+e),i.isEmpty(null==n?void 0:n.line)||(o.states=i.isArray(n.line)?null!==(a=n.line[e])&&void 0!==a?a:n.line[n.line.length-1]:n.line),this.add(o),this.lines.push(o)}))}else{let t=Js.line;i.array(s)[0].cornerRadius&&(t=Js.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},i.array(s)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),i.isEmpty(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,s){if(!e.length)return;const{autoRotate:n=!0}=t;let r;if(t&&t.visible){const a=this.getStartAngle(),o=this.getEndAngle(),{state:l}=this.attribute,h=e[0],c=e[e.length-1],{refX:d=0,refY:u=0,refAngle:p=0,style:f,symbolType:g,size:m=12}=t;let y,b;"start"===s?(y={x:h.x+(i.isValidNumber(a)?d*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(i.isValidNumber(a)?d*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(y={x:c.x+(i.isValidNumber(o)?d*Math.cos(o)+u*Math.cos(o-Math.PI/2):0),y:c.y+(i.isValidNumber(o)?d*Math.sin(o)+u*Math.sin(o-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=Js.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:g,size:m,angle:n?b+p:0,strokeBoundsBuffer:0}),f)),r.name=`${this.name}-${s}-symbol`,r.id=this._getNodeId(`${s}-symbol`),i.isEmpty(null==l?void 0:l.symbol)||(r.states=l.symbol),"start"===s?i.isEmpty(null==l?void 0:l.startSymbol)||(r.states=l.startSymbol):i.isEmpty(null==l?void 0:l.endSymbol)||(r.states=l.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:s}=this.attribute;let n;return n=e?i.isValidNumber(s)?t[s]:i.flattenArray(t):t,this._mainSegmentPoints=n,n}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let s=t;if(e.visible){const i=e.clip?e.size||10:0;s=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...s.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={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)};s=[...s.slice(0,s.length-1),n]}return s}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],s=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[n.x-s.x,n.y-s.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}}qa.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}}};const Za="seriesBreak";function Ja(t,e,i,s,n=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=n?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),d=Math.PI/180*s,u=i*Math.cos(d),p=i*Math.sin(d);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=n?a+(t%2==0?u:-u):a+t*i*2,s=n?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${s}`)}return r.push(`L ${n?a:l} ${n?h:o}`),r.join(" ")}class Qa extends Xr{constructor(){super(...arguments),this.name=Za}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(i.isEmpty(t))return;const e=[],s=[];t.forEach((t=>{const{start:n,end:r}=t;((t,e)=>{const{start:s,end:n}=e,r=s.x===n.x,a=r?"x":"y",o=r?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(i.isNumberClose(t.start[a],s[a])){const e=Math.min(s[o],n[o]),i=Math.max(s[o],n[o]),r=Math.min(t.start[o],t.end[o]),a=Math.max(t.start[o],t.end[o]);if(!(i<r-h||e>a+h))return t.start[o]=Math.min(r,e),t.end[o]=Math.max(a,i),void(l=!1)}})),l&&t.push(e)})(n.x===r.x?e:s,t)})),[...e,...s].forEach(((t,e)=>{var s;const{start:n,end:r,size:a=4,gap:o=5,style:l={}}=t,h=d(t,["start","end","size","gap","style"]),c=ps({}),u=n.x===r.x;let p,f,g,m;u?(p={x:n.x-o/2,y:n.y},f={x:r.x-o/2,y:r.y},g={x:n.x+o/2,y:n.y},m={x:r.x+o/2,y:r.y}):(p={x:n.x,y:n.y-o/2},f={x:r.x,y:r.y-o/2},g={x:n.x,y:n.y+o/2},m={x:r.x,y:r.y+o/2});const y=Ja(p,f,a,u?75:15,u),b=Ja(n,r,a,u?75:15,u),x=Ja(g,m,a,u?75:15,u);c.add(kr(Object.assign(Object.assign({path:y,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(kr(Object.assign(Object.assign({path:x,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(kr({path:b,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=h,i.isValid(h.axisId)&&(c.id=`${null!==(s=h.axisId)&&void 0!==s?s:""}_${e}`),this.add(c)}))}}function to(t,e,i=1){return Math.abs(t-e)<i}function eo(t,e){return{type:"component",componentType:Za,interactive:!0,zIndex:500,style:{data:(s,n)=>{const r=[],a=n.vchart.getChart(),o="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,s)=>{var n,l;const h=t.id,c=i.isValid(h)?a.getComponentByUserId(h):e&&i.isValid(e[s])?a.getComponentByIndex("axes",e[s]):null===(n=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const d=null!=h?h:`${c.type}-${c.id}`,u=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=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),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}return{x1:e,y1:i,x2:s,y2:n}}(c.getRegions());i.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,n=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(n+l)/2+(o?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const a=t.AABBBounds;let c,p,f,g,m=!1;o?(m=a.x1<(n+l-s)/2&&a.x2>(n+l+s)/2,c=h,p=Math.max(a.y1+u.y1-2,u.y1),f=h,g=Math.min(a.y2+u.y1+2,u.y2)):(m=a.y1<(n+l-s)/2&&a.y2>(n+l+s)/2,c=Math.max(a.x1+u.x1-2,u.x1),p=h,f=Math.min(a.x2+u.x1+2,u.x2),g=h),m&&r.push({start:{x:c,y:p},end:{x:f,y:g},gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{so(t,"line").forEach((t=>{io(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(n+l)/2},end:{x:u.x2-u.x1,y:(n+l)/2}},t).forEach((t=>{let n,a;o?(n={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(n={x:Math.max(t[0]+u.x1-10,u.x1),y:h},a={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),r.push({start:n,end:a,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{so(t,"area").forEach((t=>{const a=io(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(n+l)/2},end:{x:u.x2-u.x1,y:(n+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let n=0;n<a.length-1;n++){const l={x:a[n][0],y:a[n][1]},h={x:a[n+1][0],y:a[n+1][1]};if(no(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,n;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},n={x:h.x+u.x1,y:Math.min(h.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},n={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),r.push({start:t,end:n,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}}}))}))}}))}))})),r}}}}function io(t,e){const s=[];for(let n=1;n<e.length;n++){const r=i.getIntersectPoint([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]);r&&!s.find((t=>to(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&s.push(r)}return s}function so(t,e){const{points:i,segments:s}=t.attribute,n=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var s,a;if(!1===t.defined){if(n.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!==(s=t.x1)&&void 0!==s?s: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])}n.push(r)}};return i&&i.length?a(i):s&&s.length&&s.forEach((t=>{a(t.points)})),n}function no(t,e){const{x:i,y:s}=t;let n=!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>s!=h>s&&i<(l-a)*(s-o)/(h-o)+a&&(n=!n)}return n}class ro{constructor(t,e,i,s){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(s)}getMarks(){return this.marks}registerChannelEncoder(t,e){return i.isString(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=i.array(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class ao{static registerPlotMarks(t,e){ao._plotMarks[t]=e}static createPlotMark(t,e){return ao._plotMarks[t]?new ao._plotMarks[t](e):null}static registerMark(t,e){ao._marks[t]=e}static createMark(t,e,i){return ao._marks[t]?new ao._marks[t](e,t,i):null}static hasMark(t){return!!ao._marks[t]}static getMark(t){return ao._marks[t]}static registerComponent(t,e){ao._components[t]=e}static createComponent(t,e,i,s){const n=ao._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!ao._components[t]}static registerGraphicComponent(t,e){ao._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=ao._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){ao._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return ao._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(ao._transforms).forEach((t=>{ao._transforms[t]&&!ao._transforms[t].isBuiltIn&&(ao._transforms[t]=null)}))}static registerGrammar(t,e,i){ao._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=ao._grammars[t])||void 0===s?void 0:s.grammarClass;return n?new n(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return ao._glyphs[t]}static createInteraction(t,e,i){const s=ao._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!ao._interactions[t]}}ao._plotMarks={},ao._marks={},ao._components={},ao._graphicComponents={},ao._transforms={},ao._grammars={},ao._glyphs={},ao._animations={},ao._interactions={},ao._graphics={},ao._stageEventPlugins={},ao.registerGlyph=(t,e,i,s,n)=>(ao._glyphs[t]=new ro(e,i,s,n),ao._glyphs[t]),ao.registerAnimationType=(t,e)=>{ao._animations[t]=e},ao.getAnimationType=t=>ao._animations[t],ao.registerInteraction=(t,e)=>{ao._interactions[t]=e},ao.registerGraphic=(t,e)=>{ao._graphics[t]=e},ao.getGraphicType=t=>ao._graphics[t],ao.createGraphic=(t,e)=>{const i=ao._graphics[t];return i?i(e):null},ao.registerDefaultLayout=t=>{ao.defaultLayout=t},ao.getDefaultLayout=()=>ao.defaultLayout,ao.registerStageEventPlugin=(t,e)=>{ao._stageEventPlugins[t]=e},ao.getStageEventPlugin=t=>ao._stageEventPlugins[t];const oo="barLink";class lo extends Xr{constructor(){super(...arguments),this.name=oo}render(){const{data:t,linkStyle:s,areaStyle:n,styleMap:r,label:a,linkType:o="total"}=this.attribute;i.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,l)=>{var h,c,d,u,p;const{linePoints:f,areaPoints:g,id:m=l,color:y,data:b}=t;if(g&&!1!==(null===(h=null==r?void 0:r[`area-${m}`])||void 0===h?void 0:h.visible)){const t=(x=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:y,zIndex:0},n),null==r?void 0:r[`area-${m}`]),new Er(x));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}var x;if(f&&!1!==(null===(c=null==r?void 0:r[`line-${m}`])||void 0===c?void 0:c.visible)&&0!==(null===(d=null==s?void 0:s.lineStyle)||void 0===d?void 0:d.lineWidth)&&0!==(null===(u=null==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=s||{},a=i.cloneDeep(t),o=i.cloneDeep(e);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new qa({points:f,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==a?void 0:a.visible)&&!1!==(null===(p=null==r?void 0:r[`label-${m}`])||void 0===p?void 0:p.visible)){const{style:t,formatMethod:i}=a,[s,n]=b;let l=s[e.STACK_FIELD_END],h=n[e.STACK_FIELD_END];"value"===o&&(l=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START],h=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START]);const c=h-l,d=(h-l)/l*100,u=mn(Object.assign(Object.assign({x:.5*(f[0].x+f[1].x),y:.5*(f[0].y+f[1].y),text:i?i(c,d,b):`${c} ${d}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==r?void 0:r[`label-${m}`]));u.name="bar-link-label",u.id=`label-${m}`,this.add(u)}})))}}function ho(t,e,i){const{isHorizontal:s,isXAxisInverse:n,isYAxisInverse:r,linkType:a,doFill:o,regionStartX:l,regionStartY:h}=i,c=t.getGraphicItem(),d=e.getGraphicItem(),u=c.AABBBounds,p=d.AABBBounds;let f,g;return s?(f=[{x:(u.x1+u.x2)/2+l,y:u.y1+h},{x:(p.x1+p.x2)/2+l,y:p.y2+h}],n?("total"===a&&(f=[{x:u.x1+l,y:u.y1+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:u.x1+l,x1:u.x2+l,y:u.y1+h},{x:p.x1+l,x1:p.x2+l,y:p.y2+h}])):("total"===a&&(f=[{x:u.x2+l,y:u.y1+h},{x:p.x2+l,y:p.y2+h}]),o&&(g=[{x:u.x2+l,x1:u.x1+l,y:u.y1+h},{x:p.x2+l,x1:p.x1+l,y:p.y2+h}]))):(f=[{x:u.x2+l,y:(u.y1+u.y2)/2+h},{x:p.x1+l,y:(p.y1+p.y2)/2+h}],r?("total"===a&&(f=[{x:u.x2+l,y:u.y2+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:u.x2+l,y:u.y2+h,y1:u.y1+h},{x:p.x1+l,y:p.y2+h,y1:p.y1+h}])):("total"===a&&(f=[{x:u.x2+l,y:u.y1+h},{x:p.x1+l,y:p.y1+h}]),o&&(g=[{x:u.x2+l,y:u.y1+h,y1:u.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 co(t={},i){const{linkType:s="total",doFill:n}=t,r=d(t,["linkType","doFill"]);return{type:"component",componentType:oo,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 s={};for(let n=0;n<t.length;n++){const r=t[n],a=null===(i=r.data)||void 0===i?void 0:i[0],o=e.map((t=>a[t])).join("-");s[o]||(s[o]=[]),s[o].push(r)}return s}(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],d="horizontal"===c.direction,u=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),f=Object.values(h);if(f.length)if(d){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=ho(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:n,linkType:s,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=ho(t,i[l],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:s},r),i)}}const uo="seriesLabel";function po(t,e=10,i=10,s=.1){const n=t.length;if(!t.every(isFinite))return t;if(!(n>1))return t;const r=function(t,e,i){t=+t,e=+e;let s=arguments.length;i=s<2?(e=t,t=0,1):s<3?1:+i;let n=-1;s=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return s=t[e],n=t[i],null==s||null==n?NaN:s<n?-1:s>n?1:s>=n?0:NaN;var s,n}));let i=0;for(let s=1;s<n;++s){let n=t[r[s]]-t[r[s-1]];n<e&&(n=(e-n)/2,i=Math.max(i,n),t[r[s-1]]-=n,t[r[s]]+=n)}if(i<s)break}return t}function fo(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function go(t,e=10,i=10){const s=t.length;let n,r=0;do{n=!1;for(let i=0;i<s;++i)for(let r=i+1;r<s;++r){const s=t[i].AABBBounds,a=t[r].AABBBounds;if(fo(s,a)){const i=e-(a.x1-s.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,n=!0)}}r++}while(n&&r<i)}function mo(t,e){const{label:s,line:n}=e;return{type:"component",componentType:uo,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,s)=>{var n;const r=s.vchart.getChart(),a=r.getAllSeries()[0],o="horizontal"===a.direction,l=o?a.getYAxisHelper():a.getXAxisHelper(),h=null===(n=l.getScale)||void 0===n?void 0:n.call(l,0),c=l.isInverse(),d=a.getDimensionField()[0],u=a.getSeriesField(),p=r.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),f=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?i.last(h.domain()):h.domain()[0],s=a.getRegion(),{x:n,y:l}=s.getLayoutStartPoint();let g=0;r.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===p[0]?"bar":p[0]).getProduct().elements.forEach((s=>{var r;const a=s.data.find((t=>t[d]===e));if(a){const e=s.getGraphicItem(),h=e.AABBBounds;let m,y,b,x;"bar"===p[0]||"waterfall"===p[0]?(m="end"===t?{x:o?(h.x1+h.x2)/2:c?h.x1:h.x2,y:o?c?h.y2:h.y1:(h.y1+h.y2)/2}:{x:o?(h.x1+h.x2)/2:c?h.x2:h.x1,y:o?c?h.y1:h.y2:(h.y1+h.y2)/2},y=e.attribute.fill):(m=i.dataToPosition(a),y=e.attribute.stroke||e.attribute.fill),"end"===t?(b=o?"center":c?"end":"start",x=o?c?"top":"bottom":"middle"):(b=o?"center":c?"start":"end",x=o?c?"bottom":"top":"middle");const v=null!==(r=a[u])&&void 0!==r?r:a[d];f.push({point:{x:m.x+n,y:m.y+l},label:v,color:y,textAlign:b,textBaseline:x,series:i,datum:a,id:`${t}-${g}`,position:t}),g++}}))}))}))}return f},line:n,label:Object.assign({space:12},s)}}}class yo extends Xr{constructor(){super(...arguments),this.name=uo}render(){var t,e,s,n;this.removeAllChild();const{data:r,layout:a,label:o,line:l={}}=this.attribute;if(i.isEmpty(r))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},c={},d=r.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(s=null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.fontSize)&&void 0!==s?s:12),i=(t,e,i)=>{var s,n,r,a,o,l,h,c;const{label:d,color:u,textAlign:p,textBaseline:f,id:g}=t,m=null!==(n=null===(s=i[g])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=mn(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(d,t.datum,{series:t.series}):d},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:u}),null===(c=i[g])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=g,this.add(y),y};["start","end"].forEach((e=>{const s=d.filter((t=>t.position===e)),n=po(s.map((t=>t.point.y)),t);s.forEach(((t,e)=>{var s;const r={x:t.point.x+(null!==(s=null==o?void 0:o.space)&&void 0!==s?s:8)*("start"===t.textAlign?1:-1),y:n[e]};i(t,r,h),c[t.id]=r}))}))}else{const t=[],e=[];d.forEach((i=>{var s,n,r,a,l;const{point:c,label:d,color:u,textAlign:p,textBaseline:f,id:g,position:m}=i,y={x:c.x,y:c.y},b=null!==(n=null===(s=h[g])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null==o?void 0:o.formatMethod,x=mn(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(d,i.datum,{series:i.series}):d},null==o?void 0:o.style),y),{textAlign:p,textBaseline:f,fill:null!==(a=null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:u}),null===(l=h[g])||void 0===l?void 0:l.style));x.id=g,x.name="series-label-text",this.add(x),"start"===m?t.push(x):"end"===m&&e.push(x)})),t.length&&go(t,4,10),e.length&&go(e,4,10);const i=null!==(n=null==o?void 0:o.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),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&d.forEach((t=>{var e,i,s,n,r,o;const{point:d,color:u,id:p}=t,f={x:c[p].x+(null!==(s=null===(i=null===(e=h[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==s?s:0),y:c[p].y+(null!==(o=null===(r=null===(n=h[p])||void 0===n?void 0:n.style)||void 0===r?void 0:r.dy)&&void 0!==o?o:0)};if(!1!==l.autoVisible){if("vertical"===a&&d.y!==f.y||"horizontal"===a&&d.x!==f.x){const t=Mr(Object.assign({points:[d,f],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}else{const t=Mr(Object.assign({points:[d,f],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}))}}t.BAR_LINK=oo,t.BarLinkComponent=lo,t.ConversionFunnelChart=v,t.ConversionFunnelSeries=_,t.DEFAULT_ARROW_MARK_STYLE=A,t.DEFAULT_ARROW_SYMBOL_MARK_STYLE=B,t.DEFAULT_ARROW_TEXT_MARK_STYLE=T,t.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE=S,t.RankingBar=a,t.SERIES_BREAK=Za,t.SeriesBreakComponent=Qa,t.SeriesLabelComponent=yo,t.appendBarLinkConfig=function(t,e){t.customMark=i.array(t.customMark).filter((t=>t.componentType!==oo)),t.customMark.push(co(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=i.array(t.customMark).filter((t=>t.componentType!==Za)),t.customMark.push(eo(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var s,n,r;if(t.customMark=i.array(t.customMark).filter((t=>t.componentType!==uo)),e||(e=null!==(r=null!==(s=i.get(t,uo))&&void 0!==s?s:i.get(null===(n=t.series)||void 0===n?void 0:n[0],uo))&&void 0!==r?r:{}),e.visible){const{position:i="end"}=e,s=d(e,["position"]);t.customMark.push(mo(i,s))}},t.getBarLinkConfig=co,t.getSeriesBreakConfig=eo,t.getSeriesLabelConfig=mo,t.registerBarLink=()=>{ao.registerGraphicComponent(oo,(t=>new lo(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([v]),i.useSeries([_]))},t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new Qa(t)))},t.registerSeriesLabel=()=>{ao.registerGraphicComponent("seriesLabel",(t=>new yo(t)))}}));
|
|
15
|
+
***************************************************************************** */function I(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}const E={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},D={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},F={fill:"#606773",fontSize:12},j={fill:"#eff1f9"};class U extends e.FunnelChartSpecTransformer{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=I(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=N(s,i),a=N(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=I(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},j),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 N(t,n){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:r,text:a,margin:o}=n,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,n=I(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({},E),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=W(t,i,e),n}})})}(s,o);c&&l.push(c);const d=function(t={},e){const{style:i={}}=t,n=I(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},D),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=W(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=W(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})})}(r,o);d&&l.push(d);const u=function(t={},e){const{style:n={},formatMethod:s,textMargin:r=4}=t,a=I(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},F),{text:(t,e)=>{var n,r,a,o,l,h,c;const{text:d}=t;let u=d;if(i.isFunction(s)){const{vchart:i}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(a=null===(r=null===(n=null==i?void 0:i.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],y=null!==(c=null===(h=null===(l=null===(o=null==i?void 0:i.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));u=s(d,{arrow:t,from:b,to:v})}return u},x:(t,i)=>{var n,s;let a=t.layout.points;return a=W(t,i,e),null!==(s=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-r:r))&&void 0!==s?s:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=W(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"}),n)})}(a,o);return u&&l.push(u),h.children=l,h}function W(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:d}=t.context,u=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 g=[];if(u&&u.length){const n=p.find((t=>t[d]===u[h][d])),s=p.find((t=>t[d]===u[c][d])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:d,toTotal:u}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?n[1]:n[0],_=m/(d+1),A=v/(u+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-s*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:S},{x:x.x-(s+(l+1)*a)*w,y:T},{x:y.x-s*w,y:T}];return M}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function z(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function V(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const G=(t,e)=>{var n,s,r;if(!t||!(null===(n=t.arrows)||void 0===n?void 0:n.length))return[];const{arrows:a}=t,o=function(t,e){return t.filter((t=>i.isValidNumber(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}`})}))}(a,e.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(s=H(l))&&void 0!==s?s:[],...null!==(r=H(h))&&void 0!==r?r:[]]};function H(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const n=e.get(t.from);if(i.isValid(n)){const e=n.fromArrows.find((e=>V(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const s=e.get(t.to);if(i.isValid(s)){const e=s.toArrows.find((e=>V(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.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((n=>{var s;const r=t.filter((t=>t.layout.isLayout)),a=i.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let o=null!==(s=null==a?void 0:a.layout.level)&&void 0!==s?s:0;for(;o>=0;){if(r.some((t=>t.layout.level===o&&z(t,n)))){o+=1;break}--o}n.layout.level=Math.max(0,o),n.layout.fromTotal=e.get(n.from).degree,n.layout.toTotal=e.get(n.to).degree;const l=n.layout.duplicateNode;l?(n.layout.fromIndex=l.layout.fromIndex,n.layout.toIndex=l.layout.toIndex):(n.layout.fromIndex=X(n,e.get(n.from).totalArrows),n.layout.toIndex=X(n,e.get(n.to).totalArrows)),n.layout.isLayout=!0})),t}function X(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 Y extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=U}}Y.type="conversionFunnel",Y.transformerConstructor=U;class q 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 L(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",G),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.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const $="dataKey";class K 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),{[$]: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=$,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 Z extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=K}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)}}Z.type="sequenceScatterLink",Z.view="singleDefault",Z.transformerConstructor=K;const J=.2;function Q(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const tt="dataKey";class et 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),{[tt]: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),d=Math.max(...o),u=l-(h-l)*J,p=c-(d-c)*J;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=u+.1*i,o=p+.1*a;let l=0;for(const t of n)l+=Q(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=tt,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 it extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=et}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)}}it.type="sequenceScatterKDE",it.view="singleDefault",it.transformerConstructor=et;const nt="dataKey";function st(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),{[nt]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class rt extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,s,r;super.transformSpec(t);const a=st(t);t.type="common",t.dataKey=nt,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 at extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=rt}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)}}at.type="sequenceScatterPixel",at.view="singleDefault",at.transformerConstructor=rt;class ot extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var lt,ht,ct,dt,ut;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(lt||(lt={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(ht||(ht={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(ct||(ct={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(dt||(dt={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(ut||(ut={}));class pt{static GenAutoIncrementId(){return pt.auto_increment_id++}}pt.auto_increment_id=0;class gt{constructor(t){this.id=pt.GenAutoIncrementId(),this.registry=t}}const ft="named",mt="inject",yt="inversify:tagged",bt="inversify:paramtypes";class vt{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===ft?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var xt=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=f(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=f(e);return c(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(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(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(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(!d(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(!d(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(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 _t(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};xt.hasOwnMetadata(t,e)&&(r=xt.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,xt.defineMetadata(t,r,e)}(yt,t,i.toString(),n)}function At(t){return(e,i,n)=>{_t(e,0,n,t)}}const St=(Tt=mt,t=>(e,i,n)=>At(new vt(Tt,t))(e,i,n));var Tt;function wt(){return function(t){return xt.defineMetadata(bt,null,t),t}}function Mt(t){return At(new vt(ft,t))}const Bt="Singleton",Ct="Transient",kt="ConstantValue",Pt="DynamicValue",Ot="Factory",Rt="Function",Lt="Instance",It="Invalid";class Et{constructor(t,e){this.id=pt.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=It,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Et(this.serviceIdentifier,this.scope);return t.activated=t.scope===Bt&&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 Dt{getConstructorMetadata(t){return{compilerGeneratedMetadata:xt.getMetadata(bt,t),userGeneratedMetadata:xt.getMetadata(yt,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Ft=(jt=ft,t=>{const e=e=>{if(null==e)return!1;if(e.key===jt&&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===jt&&i[e].value===t)return!0;return!1};return e.metaData=new vt(jt,t),e});var jt;class Ut{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Bt,this}inTransientScope(){return this._binding.scope=Ct,this}whenTargetNamed(t){return this._binding.constraint=Ft(t),this}}class Nt{constructor(t){this._binding=t}to(t){return this._binding.type=Lt,this._binding.implementationType=t,new Ut(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Pt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ut(this._binding)}toConstantValue(t){return this._binding.type=kt,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Bt,new Ut(this._binding)}toFactory(t){return this._binding.type=Ot,this._binding.factory=t,this._binding.scope=Bt,new Ut(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Wt=Symbol("ContributionProvider");class zt{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Vt(t,e){t(Wt).toDynamicValue((t=>{let{container:i}=t;return new zt(e,i)})).inSingletonScope().whenTargetNamed(e)}class Gt{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 Ht extends Gt{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const Xt=new class{};var Yt,qt,$t,Kt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(Yt||(Yt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(qt||(qt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}($t||($t={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Kt||(Kt={}));const Zt=i.tau-1e-8;class Jt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,s,r,a){if(Math.abs(r-s)>Zt)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,l,h,c,d=1/0,u=-1/0,p=1/0,g=-1/0;function f(t){h=n*Math.cos(t),c=n*Math.sin(t),h<d&&(d=h),h>u&&(u=h),c<p&&(p=c),c>g&&(g=c)}if(f(s),f(r),r!==s)if((s%=i.tau)<0&&(s+=i.tau),(r%=i.tau)<0&&(r+=i.tau),r<s&&(a=!a,o=s,s=r,r=o),a)for(r-=i.tau,o=s-s%i.halfPi,l=0;l<4&&o>r;++l,o-=i.halfPi)f(o);else for(o=s-s%i.halfPi+i.halfPi,l=0;l<4&&o<r;++l,o+=i.halfPi)f(o);this.bounds.add(t+d,e+p),this.bounds.add(t+u,e+g)}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(){}}class Qt{constructor(){this._curves=[],this.bounds=new i.AABBBounds}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 te=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ee={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},ie={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ne,se,re,ae,oe,le;var he,ce,de,ue,pe,ge;function fe(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,d=o*r,u=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,d*x+u*_,h*T+c*w,d*T+u*w,h*A+c*S,d*A+u*S]}function me(t,e,n,s){const r=function(t,e,n,s,r,a,o,l,h){const c=i.degreeToRadian(o),d=Math.sin(c),u=Math.cos(c),p=u*(l-t)*.5+d*(h-e)*.5,g=u*(h-e)*.5-d*(l-t)*.5;let f=p*p/((n=Math.abs(n))*n)+g*g/((s=Math.abs(s))*s);f>1&&(f=Math.sqrt(f),n*=f,s*=f);const m=u/n,y=d/n,b=-d/s,v=u/s,x=m*l+y*h,_=b*l+v*h,A=m*t+y*e,S=b*t+v*e;let T=1/((A-x)*(A-x)+(S-_)*(S-_))-.25;T<0&&(T=0);let w=Math.sqrt(T);a===r&&(w=-w);const M=.5*(x+A)-w*(S-_),B=.5*(_+S)+w*(A-x),C=Math.atan2(_-B,x-M);let k=Math.atan2(S-B,A-M)-C;k<0&&1===a?k+=i.tau:k>0&&0===a&&(k-=i.tau);const P=Math.ceil(Math.abs(k/(i.halfPi+.001))),O=[];for(let t=0;t<P;++t){const e=C+t*k/P,i=C+(t+1)*k/P;O[t]=[M,B,e,i,n,s,d,u]}return O}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,n);for(let e=0;e<r.length;++e){const i=fe(r[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"}(he||(he={})),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"}(ce||(ce={})),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"}(de||(de={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(ue||(ue={})),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"}(pe||(pe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(ge||(ge={}));const ye=[(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 be(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];ye[l[0]](l,e,i,n,s,r,a)}}class ve{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function xe(t,e){let n=0;const s=t.length;for(let r=0;r<s;r++){const a=t[r],o=e[r],l=t[(r+1)%s],h=e[(r+1)%s];n+=i.PointService.distanceNN(a,o,l,h)}return n/2}function _e(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 Ae(t,e,n,s,r){const a=_e(t.x,e.x,n.x,s.x,r),o=_e(t.y,e.y,n.y,s.y,r);return new i.Point(a,o)}function Se(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function Te(t,e,n,s){const r=Se(t.x,e.x,n.x,s),a=Se(t.y,e.y,n.y,s);return new i.Point(r,a)}function we(t,e){const{p0:n,p1:s,p2:r,p3:a}=t,o=Ae(n,s,r,a,e),l=i.PointService.pointAtPP(n,s,e),h=i.PointService.pointAtPP(s,r,e),c=i.PointService.pointAtPP(r,a,e),d=i.PointService.pointAtPP(l,h,e),u=i.PointService.pointAtPP(h,c,e);return[new Me(n,l,d,o),new Me(o,u,c,a)]}class Me extends ve{constructor(t,e,i,n){super(),this.type=pe.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 Ae(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,xe([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===ue.ROW?i.abs(this.p0.x-this.p3.x):t===ue.COLUMN?i.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=i.max(t-.01,0),n=i.min(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(n);return i.atan2(r.y-s.y,r.x-s.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]=we(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=i.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=i.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=i.min(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(i.max(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class Be extends ve{constructor(t,e){super(),this.type=pe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=i.atan2(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()?i.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===ue.ROW?i.abs(this.p0.x-this.p1.x):t===ue.COLUMN?i.abs(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 Ce{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,n,s,r,a,o,l){const h=new Me(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s),new i.Point(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}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,n,s,r){const a=new Be(new i.Point(this._lastX,this._lastY),new i.Point(t,e));return a.originP1=s,a.originP2=r,a.defined=n,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===ue.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],s=null!==(e=n.p3)&&void 0!==e?e:n.p1;return i.abs(t.p0.y-s.y)}if(t===ue.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(n=e.p3)&&void 0!==n?n:e.p1;return i.abs(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class ke extends Ce{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 Pe(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Oe(t,e,n){const s=null!=e?e:i.abs(n[n.length-1].x-n[0].x)>i.abs(n[n.length-1].y-n[0].y)?ue.ROW:ue.COLUMN;return"monotoneY"===t?new ke(t,s):new Ce(t,s)}class Re{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 Le(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Oe("linear",i,t);return function(t,e){Pe(t,e)}(new Re(s,n),t),s}function Ie(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 Ee{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&&Ie(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:Ie(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 De(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("basis",i,t);return function(t,e){Pe(t,e)}(new Ee(s,n),t),s}function Fe(t){return t<0?-1:1}function je(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(Fe(r)+Fe(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Ue(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ne(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 We{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:Ne(this,this._t0,Ue(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,Ne(this,Ue(this,e=je(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ne(this,this._t0,e=je(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 ze extends We{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("monotoneX",i,t);return function(t,e){Pe(t,e)}(new We(s,n),t),s}function Ge(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return Le(t,e);const s=Oe("monotoneY",i,t);return function(t,e){Pe(t,e)}(new ze(s,n),t),s}let He=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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 Xe extends He{lineEnd(){this.context.closePath()}}function Ye(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const a=new Ce("step",null!=s?s:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?ue.ROW:ue.COLUMN);return qe(new He(a,e,r),t),a}function qe(t,e){return Pe(t,e)}class $e extends Re{lineEnd(){this.context.closePath()}}function Ke(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=Oe("linear",i,t);return function(t,e){Pe(t,e)}(new $e(s,n),t),s}function Ze(t,e,n,s,r){let a=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>i.epsilon){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);a=(a*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>i.epsilon){const i=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);l=(l*i+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*i+t._y1*t._l23_2a-n*t._l12_2a)/s}t.context.bezierCurveTo(a,o,l,h,t._x2,t._y2,s,t.lastPoint1)}function Je(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Le(i,s);const o=Oe(t,r,i);return Pe(new e(o,n,a),i),o}}const Qe=Je("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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:Ze(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 ti=Je("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;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:Ze(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 ei extends ve{constructor(t,e,i){super(),this.type=pe.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 Te(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,xe([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===ue.ROW?i.abs(this.p0.x-this.p2.x):t===ue.COLUMN?i.abs(this.p0.y-this.p2.y):0}getAngleAt(t){const e=i.max(t-.01,0),n=i.min(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(n);return i.atan2(r.y-s.y,r.x-s.x)}draw(t,e,n,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+n),a>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*r+n,this.p2.x*s+e,this.p2.y*r+n);else if(a>0){const[o]=function(t,e){const{p0:n,p1:s,p2:r}=t,a=Te(n,s,r,e),o=i.PointService.pointAtPP(n,s,e),l=i.PointService.pointAtPP(s,r,e);return[new ei(n,o,a),new ei(a,l,r)]}(this,a);t.quadraticCurveTo(o.p1.x*s+e,o.p1.y*r+n,o.p2.x*s+e,o.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class ii{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 Be(new i.Point(this._lastX,this._lastY),new i.Point(t,e))}quadraticCurveTo(t,e,n,s){const r=new ei(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s));this.path.addCurve(r),this._lastX=n,this._lastY=s}bezierCurveTo(t,e,n,s,r,a){const o=new Me(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s),new i.Point(r,a));this.path.addCurve(o),this._lastX=r,this._lastY=a}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 ni(t,e,n){var s,r;switch(e){case"linear":default:return Le(t,n);case"basis":return De(t,n);case"monotoneX":return Ve(t,n);case"monotoneY":return Ge(t,n);case"step":return Ye(t,.5,n);case"stepClosed":return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const a=new Ce("step",null!=s?s:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?ue.ROW:ue.COLUMN);return qe(new Xe(a,e,r),t),a}(t,.5,n);case"stepBefore":return Ye(t,0,n);case"stepAfter":return Ye(t,1,n);case"catmullRom":return Qe(t,null!==(s=null==n?void 0:n.curveTension)&&void 0!==s?s:.5,n);case"catmullRomClosed":return ti(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Ke(t,n)}}class si extends Qt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Jt(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ie.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([ie.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([ie.Q,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([ie.C,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([ie.AT,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([ie.E,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([ie.R,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([ie.A,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([ie.Z]),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 ii(this);be(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[ie.M]=t=>`M${t[1]} ${t[2]}`,t[ie.L]=t=>`L${t[1]} ${t[2]}`,t[ie.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[ie.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ie.A]=t=>{const e=[],i=t[1],n=t[2],s=t[3];!function(t,e,i,n,s,r,a){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=2*Math.PI,h=(e%l+l)%l;let c,d=(i%l+l)%l;o?(d>=h&&(d-=l),c=d-h):(d<=h&&(d+=l),c=d-h);const u=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/u;for(let e=0;e<u;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),d=Math.cos(i),u=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=d*r+n,y=u*a+s,b=g*r+n,v=f*a+s,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*u,y+A*d,b+_*f,v-A*g,b,v)}}(e,t[4],t[5],i,n,s,s,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[ie.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ie.Z]=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(ne=e[t],se=ne.slice(1),re=ne[0],i=[re],n=se.match(te),null!==n){for(let t=0,e=n.length;t<e;t++)ae=n[t],oe=parseFloat(ae),Number.isNaN(oe)||i.push(oe);if(le=ee[re],i.length-1>le){let t,e=re;for(let n=1,r=i.length;n<r;n+=le){t=[e];for(let e=n,s=n+le;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=ni(e,i);"x"===n?this.direction=ue.ROW:"y"===n?this.direction=ue.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[ie.M]=this.moveToTransform,t[ie.L]=this.lineToTransform,t[ie.Q]=this.quadraticCurveToTransform,t[ie.C]=this.bezierCurveToTransform,t[ie.AT]=this.arcToTransform,t[ie.E]=this.ellipseTransform,t[ie.R]=this.rectTransform,t[ie.A]=this.arcTransform,t[ie.Z]=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){let e,i,n,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,d=0,u=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===l&&1===h||(e=ai(e,l,h)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+a,u+o);break;case"L":d=e[1],u=e[2],this.lineTo(d+a,u+o);break;case"h":d+=e[1],this.lineTo(d+a,u+o);break;case"H":d=e[1],this.lineTo(d+a,u+o);break;case"v":u+=e[1],this.lineTo(d+a,u+o);break;case"V":u=e[1],this.lineTo(d+a,u+o);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+a,u+o);break;case"M":d=e[1],u=e[2],this.moveTo(d+a,u+o);break;case"c":i=d+e[5],n=u+e[6],p=d+e[3],g=u+e[4],this.bezierCurveTo(d+e[1]+a,u+e[2]+o,p+a,g+o,i+a,n+o),d=i,u=n;break;case"C":d=e[5],u=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,d+a,u+o);break;case"s":i=d+e[3],n=u+e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=d+e[1],r=u+e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,d=i,u=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=e[1],r=e[2],this.bezierCurveTo(p+a,g+o,s+a,r+o,i+a,n+o),p=s,g=r,d=i,u=n;break;case"q":i=d+e[3],n=u+e[4],p=d+e[1],g=u+e[2],this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),d=i,u=n,p=e[1],g=e[2];break;case"t":i=d+e[1],n=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,g=u):"t"===c[0]?(p=2*d-s,g=2*u-r):"q"===c[0]&&(p=2*d-p,g=2*u-g),s=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n,p=d+e[1],g=u+e[2];break;case"T":i=e[1],n=e[2],p=2*d-p,g=2*u-g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),d=i,u=n;break;case"a":me(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+a,e[7]+u+o]),d+=e[6],u+=e[7];break;case"A":me(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),d=e[6],u=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 ie.L:this.lineToTransform(a,e,i,n,s);break;case ie.M:this.moveToTransform(a,e,i,n,s);break;case ie.C:this.bezierCurveToTransform(a,e,i,n,s);break;case ie.Q:this.quadraticCurveToTransform(a,e,i,n,s);break;case ie.A:this.arcToTransform(a,e,i,n,s);break;case ie.E:this.ellipseTransform(a,e,i,n,s);break;case ie.R:this.rectTransform(a,e,i,n,s);break;case ie.AT:this.arcToTransform(a,e,i,n,s);break;case ie.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),be(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===ue.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return i.abs(t.p0.y-e.p1.y)}if(this.direction===ue.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return i.abs(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 ri=["l",0,0,0,0,0,0,0];function ai(t,e,i){const n=ri[0]=t[0];if("a"===n||"A"===n)ri[1]=e*t[1],ri[2]=i*t[2],ri[3]=t[3],ri[4]=t[4],ri[5]=t[5],ri[6]=e*t[6],ri[7]=i*t[7];else if("h"===n||"H"===n)ri[1]=e*t[1];else if("v"===n||"V"===n)ri[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)ri[n]=(n%2==1?e:i)*t[n];return ri}const oi={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 i.Matrix},li={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},hi=Object.assign({outerBorder:Object.assign(Object.assign({},li),{distance:0}),innerBorder:Object.assign(Object.assign({},li),{distance:0})},li),ci={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:Yt.fontBounding,keepCenterInLine:!1},di=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}),hi),{alignSelf:"auto"}),{pickStrokeBuffer:0}),ui={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},pi=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,roughStyle:null},{_debug_bounds:!1}),di),oi),gi=Object.assign(Object.assign({},pi),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),fi=Object.assign(Object.assign(Object.assign({},pi),ui),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),mi=Object.assign(Object.assign({},pi),{radius:1,startAngle:0,endAngle:i.pi2}),yi=Object.assign(Object.assign({},pi),{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"}),bi=Object.assign(Object.assign({},pi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),vi=Object.assign(Object.assign(Object.assign({},pi),ui),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),xi=Object.assign(Object.assign({},pi),{path:new si,fillStrokeOrder:1,clipRange:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),_i=Object.assign(Object.assign({},pi),{points:[],cornerRadius:0,closePath:!0}),Ai=Object.assign(Object.assign({},pi),{width:100,height:100,spikes:5,thickness:.5}),Si=Object.assign(Object.assign({},pi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},pi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Ti=Object.assign(Object.assign({},pi),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),wi=Object.assign(Object.assign(Object.assign({},pi),ci),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Mi=Object.assign(Object.assign(Object.assign({},pi),ci),{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}),Bi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},pi),{fill:!0,cornerRadius:0,cornerType:"round"}),Ci=Object.assign(Object.assign({},Bi),{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}),ki=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return s("linear",t.linearGradient,r)||s("radial",t.radialGradient,o)||s("conic",t.conicGradient,a)}function s(e,n,s){return function(n,r){const a=y(n);if(a){y(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(p)}}();return y(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,n,s=l();return s&&(i=[],i.push(s),n=e,y(t.comma)&&(s=l(),s?i.push(s):e=n)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=d();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let n=e();const s=[];if(n)for(s.push(n);y(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=y(e);if(n)return{type:t,value:n[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const n=t.exec(e);return n&&b(n[0].length),n}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Pi{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Pi.IsGradientStr(t))try{const e=ki(t)[0];if(e){if("linear"===e.type)return Pi.ParseLinear(e);if("radial"===e.type)return Pi.ParseRadial(e);if("conic"===e.type)return Pi.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,s=i.pi/2,r=parseFloat(e.value)/180*i.pi-s;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+i.pi2,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:n=[]}=t,s=i.pi/2;let r="angular"===e.type?parseFloat(e.value)/180*i.pi:0;for(;r<0;)r+=i.pi2;for(;r>=i.pi2;)r-=i.pi2;let a=0,o=0,l=0,h=0;return r<s?(a=0,o=1,l=Math.sin(r),h=o-Math.cos(r)):r<i.pi?(a=0,o=0,l=Math.cos(r-s),h=Math.sin(r-s)):r<i.pi+s?(a=1,o=0,l=a-Math.sin(r-i.pi),h=Math.cos(r-i.pi)):(a=1,l=a-Math.cos(r-s-i.pi),h-=Math.sin(r-s-i.pi)),{gradient:"linear",x0:a,y0:o,x1:l,y1:h,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Oi(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)}function Ri(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var a,o,l,h;if(!e||!0===e)return"black";let c,d;if(i.isArray(e))for(let t=0;t<e.length&&(d=e[t],!d);t++);else d=e;if(d=Pi.Parse(d),"string"==typeof d)return d;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let i=e.x2-e.x1,u=e.y2-e.y1,p=e.x1-s,g=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:s=0}=n.attribute;i/=t,u/=e,p/=t,g/=e,(s||1!==t||1!==e)&&(p=null!==(a=n.x1WithoutTransform)&&void 0!==a?a:0,g=null!==(o=n.y1WithoutTransform)&&void 0!==o?o:0,i=null!==(l=n.widthWithoutTransform)&&void 0!==l?l:i,u=null!==(h=n.heightWithoutTransform)&&void 0!==h?h:u)}"linear"===d.gradient?c=function(t,e,i,n,s,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*s,n+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*s,n+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,d,p,g,i,u):"conical"===d.gradient?c=function(t,e,i,n,s,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*s,n+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(s+i,r+n,void 0):l}(t,d,p,g,i,u):"radial"===d.gradient&&(c=function(t,e,i,n,s,r){var a,o,l,h,c,d;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*s,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(s,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,d,p,g,i,u))}return c||"orange"}const Li={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Ii=!0,Ei=!1,Di=/\w|\(|\)|-/,Fi=/[.?!,;:/,。?!、;:]/,ji=/\S/,Ui=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Ni(t,e,i,n,s){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=Xt.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return s&&(a=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;Di.test(t[n-1])&&Di.test(t[n])||Fi.test(t[n]);)if(n--,n<=0)return i?Wi(t,e):e;return n}(t,a)),a}function Wi(t,e){let i=e;for(;Di.test(t[i+1])&&Di.test(t[i])||Fi.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function zi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"actual";var n;if(""===t)return{ascent:0,height:0,descent:0,width:0};const s=Xt.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?s.actualBoundingBoxAscent:s.fontBoundingBoxAscent,o="actual"===i?s.actualBoundingBoxDescent:s.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(s.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(s.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(n=e.space)&&void 0!==n?n:0;return r.width+=l,r}const Vi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Ct,this.options=e,this.id=pt.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Dt}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,ft,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Et(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new Nt(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[mt],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 kt:case Rt:e=t.cache;break;case Lt: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===Bt&&(t.cache=e,t.activated=!0)}},Gi=Symbol.for("CanvasFactory");function Hi(t){return Vi.getNamed(Gi,Xt.global.env)(t)}const Xi=1e-4,Yi=Math.sqrt(3),qi=1/3;function $i(t){return t>-hn&&t<hn}function Ki(t){return t>hn||t<-hn}const Zi=[0,0],Ji=[0,0],Qi=[0,0];function tn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function en(t,e,i,n){const s=1-n;return s*(s*t+2*n*e)+n*n*i}function nn(t,e,i,n,s){const r=1-s;return r*r*(r*t+3*s*e)+s*s*(s*n+3*r*i)}function sn(t){return(t%=i.pi2)<0&&(t+=i.pi2),t}function rn(t,e,i,n,s,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>n+h&&l>r+h||l<e-h&&l<n-h&&l<r-h||o>t+h&&o>i+h&&o>s+h||o<t-h&&o<i-h&&o<s-h)&&function(t,e,i,n,s,r,a,o,l){let h=0,c=.005,d=1/0;Zi[0]=a,Zi[1]=o;for(let a=0;a<1;a+=.05){Ji[0]=en(t,i,s,a),Ji[1]=en(e,n,r,a);const o=tn(Zi,Ji);o<d&&(h=a,d=o)}d=1/0;for(let a=0;a<32&&!(c<Xi);a++){const a=h-c,o=h+c;Ji[0]=en(t,i,s,a),Ji[1]=en(e,n,r,a);const l=tn(Ji,Zi);if(a>=0&&l<d)h=a,d=l;else{Qi[0]=en(t,i,s,o),Qi[1]=en(e,n,r,o);const a=tn(Qi,Zi);o<=1&&a<d?(h=o,d=a):c*=.5}}return l&&(l[0]=en(t,i,s,h),l[1]=en(e,n,r,h)),Math.sqrt(d)}(t,e,i,n,s,r,o,l,null)<=h/2}function an(t,e,i,n,s,r,a,o,l,h,c){if(0===l)return!1;const d=l;return!(c>e+d&&c>n+d&&c>r+d&&c>o+d||c<e-d&&c<n-d&&c<r-d&&c<o-d||h>t+d&&h>i+d&&h>s+d&&h>a+d||h<t-d&&h<i-d&&h<s-d&&h<a-d)&&function(t,e,i,n,s,r,a,o,l,h,c){let d,u,p,g,f=0,m=.005,y=1/0;Zi[0]=l,Zi[1]=h;for(let l=0;l<1;l+=.05)Ji[0]=nn(t,i,s,a,l),Ji[1]=nn(e,n,r,o,l),p=tn(Zi,Ji),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<Xi);l++)d=f-m,u=f+m,Ji[0]=nn(t,i,s,a,d),Ji[1]=nn(e,n,r,o,d),p=tn(Ji,Zi),d>=0&&p<y?(f=d,y=p):(Qi[0]=nn(t,i,s,a,u),Qi[1]=nn(e,n,r,o,u),g=tn(Qi,Zi),u<=1&&g<y?(f=u,y=g):m*=.5);return c&&(c[0]=nn(t,i,s,a,f),c[1]=nn(e,n,r,o,f)),Math.sqrt(y)}(t,e,i,n,s,r,a,o,h,c,null)<=d/2}function on(t,e,n,s,r,a,o,l,h){if(0===o)return!1;const c=o;l-=t,h-=e;const d=Math.sqrt(l*l+h*h);if(d-c>n||d+c<n)return!1;if(Math.abs(s-r)%i.pi2<1e-4)return!0;if(a){const t=s;s=sn(r),r=sn(t)}else s=sn(s),r=sn(r);s>r&&(r+=i.pi2);let u=Math.atan2(h,l);return u<0&&(u+=i.pi2),u>=s&&u<=r||u+i.pi2>=s&&u+i.pi2<=r}function ln(t,e,i,n,s,r,a){if(0===s)return!1;const o=s,l=s/2;let h=0,c=t;if(a>e+l&&a>n+l||a<e-l&&a<n-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const d=h*r-a+c;return d*d/(h*h+1)<=o/2*o/2}const hn=1e-4;function cn(t,e,i,n,s){const r=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let l=0;if($i(a)){if(Ki(r)){const t=-o/r;t>=0&&t<=1&&(s[l++]=t)}}else{const t=r*r-4*a*o;if($i(t))s[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),n=(-r-e)/(2*a);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}const dn=[-1,-1,-1],un=[-1,-1];function pn(){const t=un[0];un[0]=un[1],un[1]=t}function gn(t,e,i,n,s,r,a,o,l,h){if(h>e&&h>n&&h>r&&h>o||h<e&&h<n&&h<r&&h<o)return 0;const c=function(t,e,i,n,s,r){const a=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-s,c=o*o-3*a*l,d=o*l-9*a*h,u=l*l-3*o*h;let p=0;if($i(c)&&$i(d))if($i(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=d*d-4*c*u;if($i(t)){const t=d/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-d+e),n=c*o+1.5*a*(-d-e);i=i<0?-Math.pow(-i,qi):Math.pow(i,qi),n=n<0?-Math.pow(-n,qi):Math.pow(n,qi);const s=(-o-(i+n))/(3*a);s>=0&&s<=1&&(r[p++]=s)}else{const t=(2*c*o-3*a*d)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),s=(-o-2*i*n)/(3*a),l=(-o+i*(n+Yi*Math.sin(e)))/(3*a),h=(-o+i*(n-Yi*Math.sin(e)))/(3*a);s>=0&&s<=1&&(r[p++]=s),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,n,r,o,h,dn);if(0===c)return 0;let d=0,u=-1,p=0,g=0;for(let h=0;h<c;h++){const c=dn[h],f=0===c||1===c?.5:1;nn(t,i,s,a,c)<l||(u<0&&(u=cn(e,n,r,o,un),un[1]<un[0]&&u>1&&pn(),p=nn(e,n,r,o,un[0]),u>1&&(g=nn(e,n,r,o,un[1]))),2===u?c<un[0]?d+=p<e?f:-f:c<un[1]?d+=g<p?f:-f:d+=o<g?f:-f:c<un[0]?d+=p<e?f:-f:d+=o<p?f:-f)}return d}function fn(t,e,i,n,s,r,a,o){if(o>e&&o>n&&o>r||o<e&&o<n&&o<r)return 0;const l=function(t,e,i,n,s){const r=t-2*e+i,a=2*(e-t),o=t-n;let l=0;if($i(r)){if(Ki(a)){const t=-o/a;t>=0&&t<=1&&(s[l++]=t)}}else{const t=a*a-4*r*o;if($i(t)){const t=-a/(2*r);t>=0&&t<=1&&(s[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),n=(-a-e)/(2*r);i>=0&&i<=1&&(s[l++]=i),n>=0&&n<=1&&(s[l++]=n)}}return l}(e,n,r,o,dn);if(0===l)return 0;const h=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,r);if(h>=0&&h<=1){let o=0;const c=en(e,n,r,h);for(let n=0;n<l;n++){const l=0===dn[n]||1===dn[n]?.5:1;en(t,i,s,dn[n])<a||(dn[n]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===dn[0]||1===dn[0]?.5:1;return en(t,i,s,dn[0])<a?0:r<e?c:-c}function mn(t,e,n,s,r,a,o,l){if((l-=e)>n||l<-n)return 0;const h=Math.sqrt(n*n-l*l);dn[0]=-h,dn[1]=h;const c=Math.abs(s-r);if(c<1e-4)return 0;if(c>=i.pi2-1e-4){s=0,r=i.pi2;const e=a?1:-1;return o>=dn[0]+t&&o<=dn[1]+t?e:0}if(s>r){const t=s;s=r,r=t}s<0&&(s+=i.pi2,r+=i.pi2);let d=0;for(let e=0;e<2;e++){const n=dn[e];if(n+t>o){let t=Math.atan2(l,n),e=a?1:-1;t<0&&(t=i.pi2+t),(t>=s&&t<=r||t+i.pi2>=s&&t+i.pi2<=r)&&(t>i.pi/2&&t<1.5*i.pi&&(e=-e),d+=e)}}return d}function yn(t){return Math.round(t/i.pi*1e8)/1e8%2*i.pi}function bn(t,e){let n=yn(t[0]);n<0&&(n+=i.pi2);const s=n-t[0];let r=t[1];r+=s,!e&&r-n>=i.pi2?r=n+i.pi2:e&&n-r>=i.pi2?r=n-i.pi2:!e&&n>r?r=n+(i.pi2-yn(n-r)):e&&n<r&&(r=n-(i.pi2-yn(r-n))),t[0]=n,t[1]=r}const vn=[0,0];function xn(t,e,n,s,r){const a=t,o=t.length;let l,h,c=0,d=0,u=0,p=0,g=0;for(let t=0;t<o;t++){const o=a[t],f=0===t;o[0]===ie.M&&t>1&&(n||(c+=i.isPointInLine(d,u,p,g,s,r))),f&&(d=o[1],u=o[2],p=d,g=u);const m=o[0],y=o[1],b=o[2],v=o[3],x=o[4],_=o[5],A=o[6];let S=x,T=_;vn[0]=S,vn[1]=T,bn(vn,Boolean(o[6])),S=vn[0],T=vn[1];const w=S,M=T-S,B=!!(1-(o[6]?0:1)),C=(s-y)*v/v+y;switch(m){case ie.M:p=y,g=b,d=p,u=g;break;case ie.L:if(n){if(ln(d,u,y,b,e,s,r))return!0}else c+=i.isPointInLine(d,u,y,b,s,r)||0;d=y,u=b;break;case ie.C:if(n){if(an(d,u,y,b,v,x,_,A,e,s,r))return!0}else c+=gn(d,u,y,b,v,x,_,A,s,r)||0;d=_,u=A;break;case ie.Q:if(n){if(rn(d,u,y,b,v,x,e,s,r))return!0}else c+=fn(d,u,y,b,v,x,s,r)||0;d=v,u=x;break;case ie.A:if(l=Math.cos(w)*v+y,h=Math.sin(w)*v+b,f?(p=l,g=h):c+=i.isPointInLine(d,u,l,h,s,r),n){if(on(y,b,v,w,w+M,B,e,C,r))return!0}else c+=mn(y,b,v,w,w+M,B,C,r);d=Math.cos(w+M)*v+y,u=Math.sin(w+M)*v+b;break;case ie.R:if(p=d=y,g=u=b,l=p+v,h=g+x,n){if(ln(p,g,l,g,e,s,r)||ln(l,g,l,h,e,s,r)||ln(l,h,p,h,e,s,r)||ln(p,h,p,g,e,s,r))return!0}else c+=i.isPointInLine(l,g,l,h,s,r),c+=i.isPointInLine(p,h,p,g,s,r);break;case ie.Z:if(n){if(ln(d,u,p,g,e,s,r))return!0}else c+=i.isPointInLine(d,u,p,g,s,r);d=p,u=g}}return n||(f=u,m=g,Math.abs(f-m)<hn)||(c+=i.isPointInLine(d,u,p,g,s,r)||0),0!==c;var f,m}const _n=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=Hi(Object.assign({nativeCanvas:Xt.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=Hi(Object.assign({nativeCanvas:Xt.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(){this.pools=[]}},An={arc:gi,area:fi,circle:mi,line:vi,path:xi,symbol:Ti,text:wi,rect:Si,polygon:_i,star:Ai,richtext:Mi,richtextIcon:Ci,image:Bi,group:yi,glyph:bi},Sn=Object.keys(An);function Tn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const wn={arc:Object.assign({},An.arc),area:Object.assign({},An.area),circle:Object.assign({},An.circle),line:Object.assign({},An.line),path:Object.assign({},An.path),symbol:Object.assign({},An.symbol),text:Object.assign({},An.text),rect:Object.assign({},An.rect),polygon:Object.assign({},An.polygon),star:Object.assign({},An.star),richtext:Object.assign({},An.richtext),richtextIcon:Object.assign({},An.richtextIcon),image:Object.assign({},An.image),group:Object.assign({},An.group),glyph:Object.assign({},An.glyph)};class Mn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Sn.forEach((t=>{this._defaultTheme[t]=Object.create(wn[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){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||n)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,i.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Sn.forEach((n=>{const s=Object.create(wn[n]);t&&t[n]&&Tn(s,t[n]),i[n]&&Tn(s,i[n]),e[n]&&Tn(s,e[n]),this.combinedTheme[n]=s})),e.common&&Sn.forEach((t=>{Tn(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 Bn=new Mn;function Cn(t,e){return t.glyphHost?Cn(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)):Bn.getTheme()}return null}(t)||t.attachedThemeGraphic&&Cn(t.attachedThemeGraphic)||Bn.getTheme()}var kn=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 Pn extends i.EventEmitter{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=pt.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return kn(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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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){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&&i.Logger.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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[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,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isObject(n)&&n.once,a=i.isFunction(e)?void 0:e;return t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isFunction(e)?void 0:e;t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent;const a=i.isObject(n)&&n.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,n){return i.isObject(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class On{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=On.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&&i.isFunction(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&&i.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Rn extends On{constructor(t,e){super(),this.type=t,this.detail=e}}const Ln={dispatchEvent(t){var e;if(!(t instanceof On))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 Rn(t,e))}};class In{static GetImage(t,e){var i;const n=In.cache.get(t);n?"fail"===n.loadState?Xt.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):In.loadImage(t,e)}static GetSvg(t,e){var i;let n=In.cache.get(t);n?"fail"===n.loadState?Xt.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"},In.cache.set(t,n),n.dataPromise=Xt.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=In.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"},In.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Xt.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Xt.global.loadBlob(t):"json"===e&&(i.dataPromise=Xt.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!In.isLoading&&In.toLoadAueue.length){In.isLoading=!0;const t=In.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(In.cache.set(i,s),s.dataPromise=Xt.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((()=>{In.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),In.loading()})).catch((t=>{console.error(t),In.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),In.loading()}))}}),0)}static loadImage(t,e){const i=En(t,In.toLoadAueue);if(-1!==i)return In.toLoadAueue[i].marks.push(e),void In.loading();In.toLoadAueue.push({url:t,marks:[e]}),In.loading()}static improveImageLoading(t){const e=En(t,In.toLoadAueue);if(-1!==e){const t=In.toLoadAueue.splice(e,1);In.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function En(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Dn;In.cache=new Map,In.isLoading=!1,In.toLoadAueue=[],In.onLoadSuccessCb=[],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"}(Dn||(Dn={}));const Fn=[!1,!1,!1,!1],jn=[0,0,0,0],Un=t=>t?i.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(jn[0]=t[0],jn[2]=t[0],jn[1]=t[1],jn[3]=t[1],jn):t:t:0,Nn=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Wn=[1,2,3,0,1,2,3,0];function zn(t,e,n,s){for(;t>=i.pi2;)t-=i.pi2;for(;t<0;)t+=i.pi2;for(;t>e;)e+=i.pi2;Nn[0].x=n,Nn[1].y=n,Nn[2].x=-n,Nn[3].y=-n;const r=Math.ceil(t/i.halfPi)%4,a=Math.ceil(e/i.halfPi)%4;if(s.add(i.cos(t)*n,i.sin(t)*n),s.add(i.cos(e)*n,i.sin(e)*n),r!==a||e-t>i.pi){let t=!1;for(let e=0;e<Wn.length;e++)if(t||r!==Wn[e]){if(t&&a===Wn[e])break;if(t){const t=Nn[Wn[e]];s.add(t.x,t.y)}}else{t=!0;const e=Nn[r];s.add(e.x,e.y)}}}function Vn(t,e,n){const{x:s,y:r}=i.pointAt(t.x,t.y,e.x,e.y,n),{x:a,y:o}=i.pointAt(t.x1,t.y1,e.x1,e.y1,n),l=new i.Point(s,r,a,o);return l.defined=e.defined,l}function Gn(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let s=[];if(t.length>e.length){s=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<e.length;i++)s[i]=Vn(t[i],e[i],n)}else{s=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<t.length;i++)s[i]=Vn(t[i],e[i],n)}return s}const Hn=(t,e)=>{const n=((t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};class Xn{bounds(t,e){if(i.isNumber(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 i.isNumber(t)?t:Math.min(t[0],t[1])}}function Yn(t,e,n,s,r){return r?t.arc(n,s,e,0,i.tau,!1,r):t.arc(n,s,e,0,i.tau),!1}var qn=new class extends Xn{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 Yn(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Yn(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 $n=new class extends Xn{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 Kn(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 Zn=new class extends Xn{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 Kn(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return Kn(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Kn(t,this.parseSize(e)/2+s,i,n,r)}};function Jn(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var Qn=new class extends Xn{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Jn(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Jn(t,this.parseSize(e)/2+s,i,n)}};function ts(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 es extends Xn{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 ts(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ts(t,this.parseSize(e)/2,i,n,s)}}var is=new es;var ns=new class extends es{constructor(){super(...arguments),this.type="triangle"}};const ss=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),rs=Math.sin(i.tau/10)*ss,as=-Math.cos(i.tau/10)*ss;function os(t,e,n,s){const r=rs*e,a=as*e;t.moveTo(n,-e+s),t.lineTo(r+n,a+s);for(let o=1;o<5;++o){const l=i.tau*o/5,h=Math.cos(l),c=Math.sin(l);t.lineTo(c*e+n,-h*e+s),t.lineTo(h*r-c*a+n,c*r+h*a+s)}return t.closePath(),!0}var ls=new class extends Xn{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 os(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return os(t,this.parseSize(e)/2+s,i,n)}};const hs=i.sqrt(3);function cs(t,e,i,n){const s=e,r=s/hs,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 ds=new class extends Xn{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 cs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return cs(t,this.parseSize(e)/2+s,i,n)}};function us(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 ps=new class extends Xn{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return us(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return us(t,this.parseSize(e)/2+s,i,n)}};function gs(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var fs=new class extends Xn{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return gs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return gs(t,this.parseSize(e)/2+s,i,n)}};const ms=-.5,ys=i.sqrt(3)/2,bs=1/i.sqrt(12);function vs(t,e,i,n){const s=e/2,r=e*bs,a=s,o=e*bs+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(ms*s-ys*r+i,ys*s+ms*r+n),t.lineTo(ms*a-ys*o+i,ys*a+ms*o+n),t.lineTo(ms*l-ys*h+i,ys*l+ms*h+n),t.lineTo(ms*s+ys*r+i,ms*r-ys*s+n),t.lineTo(ms*a+ys*o+i,ms*o-ys*a+n),t.lineTo(ms*l+ys*h+i,ms*h-ys*l+n),t.closePath(),!1}var xs=new class extends Xn{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 vs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return vs(t,this.parseSize(e)/2+s,i,n)}};function _s(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 As=new class extends Xn{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 _s(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return _s(t,this.parseSize(e)/2,i,n,s)}};function Ss(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 Ts=new class extends Xn{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 Ss(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ss(t,this.parseSize(e)/2,i,n,s)}};function ws(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 Ms=new class extends Xn{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 ws(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ws(t,this.parseSize(e)/2,i,n,s)}};const Bs=i.sqrt(3);function Cs(t,e,i,n){const s=e*Bs;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var ks=new class extends Xn{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Cs(t,this.parseSize(e)/2/Bs,i,n)}drawOffset(t,e,i,n,s){return Cs(t,this.parseSize(e)/2/Bs+s,i,n)}};function Ps(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 Os=new class extends Xn{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 Ps(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ps(t,this.parseSize(e)/4+s,i,n)}};function Rs(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 Ls=new class extends Xn{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 Rs(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Rs(t,this.parseSize(e)/4+s,i,n)}};function Is(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 Es=new class extends Xn{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 Is(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Is(t,this.parseSize(e)/4+s,i,n)}};function Ds(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 Fs=new class extends Xn{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 Ds(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ds(t,this.parseSize(e)/4+s,i,n)}};function js(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Us=new class extends Xn{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return js(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return js(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 Ns(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Ws=new class extends Xn{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return Ns(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return Ns(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 zs(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 Vs=new class extends Xn{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 zs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return zs(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 Gs(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function Hs(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var Xs=new class extends Xn{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,n,s){return i.isNumber(e)?Hs(t,e,n,s):Gs(t,e,n,s)}drawWithClipRange(t,e,n,s,r,a,o){i.isNumber(e)&&(e=[e,e/2]);const l=2*(e[0]+e[1])*r,h=[{x:n+e[0]/2,y:s-e[1]/2},{x:n+e[0]/2,y:s+e[1]/2},{x:n-e[0]/2,y:s+e[1]/2},{x:n-e[0]/2,y:s-e[1]/2}];let c=0,d=h[3];t.moveTo(d.x,d.y);for(let e=0;e<h.length;e++){const i=h[e],n=Math.sqrt((i.x-d.x)*(i.x-d.x)+(i.y-d.y)*(i.y-d.y));if(c+n>l){const e=(i.x-d.x)*(l-c)/n,s=(i.y-d.y)*(l-c)/n;t.lineTo(d.x+e,d.y+s);break}t.lineTo(i.x,i.y),d=i,c+=n}return!1}drawOffset(t,e,n,s,r){return i.isNumber(e)?Hs(t,e+2*r,n,s):Gs(t,[e[0]+2*r,e[1]+2*r],n,s)}};const Ys=new i.AABBBounds;class qs{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,i.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),be(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(be(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 i.isNumber(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((i=>{let{path:n}=i;Ys.x1=n.bounds.x1*t,Ys.y1=n.bounds.y1*t,Ys.x2=n.bounds.x2*t,Ys.y2=n.bounds.y2*t,e.union(Ys)}))}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 $s={};[qn,$n,Zn,Qn,ks,ns,ls,ds,ps,fs,xs,As,Ts,is,Ms,Os,Ls,Es,Fs,Xs,Us,Ws,Vs].forEach((t=>{$s[t.type]=t}));const Ks={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 Zs{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 Js(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function Qs(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,a=s.search(/\s/);let o=s,l=!0;-1!==a&&(o=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==n.data.substr(t+1))}return{tagName:o,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:h}}const tr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class er{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,tr),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 Zs("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Js(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=Qs(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Js(t,"--\x3e",r+4,"Comment is not closed.");else{const a=Qs(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 Zs(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 Zs(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 ir(t,e){return nr(t)}function nr(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=sr(s);if(void 0!==r&&s[r]){const t=nr(s[r]);n=t,Object.keys(n).length,s[":@"]&&rr(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 sr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function rr(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 ar{constructor(t){this.options=Object.assign({},ar.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return ir(new er(this.options).parseXml(t),this.options)}}function or(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}ar.defaultOptions={};let lr=0;function hr(){return lr++}var cr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(cr||(cr={}));const dr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>dr.set(t,!0)));const ur=new Map;function pr(t){if(dr.has(t))return!0;if(ur.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>ur.set(t,!0)));const gr=hr(),fr=hr(),mr=hr();hr(),hr();const yr=hr(),br=hr(),vr=hr(),xr=hr(),_r=hr(),Ar=hr(),Sr=hr(),Tr=hr(),wr=hr();hr();const Mr=hr(),Br=hr(),Cr=Symbol.for("GraphicCreator"),kr={"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"},Pr=Object.keys(kr),Or={duration:200,easing:"cubicOut"};function Rr(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 Lr(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,c,d,u,p,g,f,m,y;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],d=e[5],u=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+c*s+g*r+e[12],t[13]=o*n+d*s+f*r+e[13],t[14]=l*n+u*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function Ir(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],d=e[8],u=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*n+x*o+_*d+A*f,t[1]=v*s+x*l+_*u+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*n+x*o+_*d+A*f,t[5]=v*s+x*l+_*u+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*n+x*o+_*d+A*f,t[9]=v*s+x*l+_*u+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*n+x*o+_*d+A*f,t[13]=v*s+x*l+_*u+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Er(t,e,i){const n=e[0],s=e[1],r=e[2];let a=i[3]*n+i[7]*s+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*s+i[8]*r+i[12])/a,t[1]=(i[1]*n+i[5]*s+i[9]*r+i[13])/a,t[2]=(i[2]*n+i[6]*s+i[10]*r+i[14])/a,t}class Dr{constructor(){this.pools=[]}static identity(t){return Rr(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 Dr.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(){this.pools=[]}}const Fr=new class{constructor(){this.pools=[]}allocate(t,e,n,s,r,a){if(!this.pools.length)return new i.Matrix(t,e,n,s,r,a);const o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=s,o.e=r,o.f=a,o}allocateByObj(t){if(!this.pools.length)return new i.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},jr=new Dr;var Ur=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},Nr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Wr=new i.Matrix(1,0,0,1,0,0),zr={x:0,y:0};let Vr=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new i.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new i.Matrix(1,0,0,1,0,0),this.path=new si,this._clearMatrix=new i.Matrix(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Fr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new i.Matrix(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Fr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Fr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),s&&this.setTransformForCurrent()}setTransform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*s,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,s,r){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,s,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,s,r){this.path.arc(t,e,i,n,s,r)}arcTo(t,e,i,n,s){this.path.arcTo(t,e,i,n,s)}bezierCurveTo(t,e,i,n,s,r){this.path.bezierCurveTo(t,e,i,n,s,r)}closePath(){this.path.closePath()}ellipse(t,e,i,n,s,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,s,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},zr),function(t,e,i){return xn(t,0,!1,e,i)}(this.path.commandList,zr.x,zr.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},zr);const i=Oi(this,this.lineWidth,this.dpr);return function(t,e,i,n){return xn(t,e,!0,i,n)}(this.path.commandList,i,zr.x,zr.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,s){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,s){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(Wr,t,e)}setClearMatrix(t,e,i,n,s,r){this._clearMatrix.setValue(t,e,i,n,s,r)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Fr.free(t))),this.stack.length=0}};var Gr;Vr=Ur([wt(),Nr("design:paramtypes",[Object,Number])],Vr),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Gr||(Gr={}));class Hr{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gr.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Gr.Color1){const e=Hr.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const s=i.Color.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Hr.store1[t]=e,Hr.store255[t]=[s.r,s.g,s.b,s.opacity],n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}const s=Hr.store255[t];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;const r=i.Color.parseColorString(t);return r&&(Hr.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Hr.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,i){if(e===Gr.Color1){if(Hr.store1[t])return;Hr.store1[t]=i,Hr.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Hr.store255[t])return;Hr.store255[t]=i,Hr.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Xr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&i.isNumber(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 Yr(t,e,n,s,r){return Array.isArray(t)&&!i.isNumber(t[0])||Array.isArray(e)&&!i.isNumber(e[0])?new Array(4).fill(0).map(((r,a)=>{var o,l;return qr(i.isArray(t)?null!==(o=t[a])&&void 0!==o?o:t[0]:t,i.isArray(e)?null!==(l=e[a])&&void 0!==l?l:e[0]:e,n,s)})):qr(t,e,n,s,r)}function qr(t,e,i,n,s){if(!t||!e)return t&&Xr(t)||e&&Xr(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Hr.Get(t,Gr.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Hr.Get(e,Gr.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:Xr(a)})))});return o?Yr(r,l,i,n,s):Yr(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:Jr(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:Jr(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:Jr(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),Xr(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)}function $r(t,e,i){return`rgba(${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})`}Hr.store255={},Hr.store1={};const Kr=[0,0,0,0],Zr=[0,0,0,0];function Jr(t,e,i){return Hr.Get(t,Gr.Color255,Kr),Hr.Get(e,Gr.Color255,Zr),`rgba(${Math.round(Kr[0]+(Zr[0]-Kr[0])*i)},${Math.round(Kr[1]+(Zr[1]-Kr[1])*i)},${Math.round(Kr[2]+(Zr[2]-Kr[2])*i)},${Kr[3]+(Zr[3]-Kr[3])*i})`}const Qr=new i.AABBBounds,ta=new i.Matrix;new i.AABBBounds;const ea=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ia=["x","y"],na=["scaleX","scaleY"],sa=["angle"],ra=new i.Point,aa={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 oa extends Pn{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(oa.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new i.AABBBounds,this._updateTag=he.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)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:Xt.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;ra.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),ra.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else ra.x=s,ra.y=r;return ra}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;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new i.OBBBounds),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){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=$s[t];if(e)return e;if(e=oa.userSymbolMap[t],e)return e;if(!0===((n=t=Ks[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new ar,{svg:n}=e.parse(t);if(!n)return null;const s=i.isArray(n.path)?n.path:[n.path];Qr.clear();const r=[];s.forEach((t=>{const e=(new si).fromString(t.d),i={};Pr.forEach((e=>{t[e]&&(i[kr[e]]=t[e])})),r.push({path:e,attribute:i}),Qr.union(e.bounds)}));const a=Qr.width(),o=Qr.height(),l=1/i.max(a,o);r.forEach((t=>t.path.transform(0,0,l,l)));const h=new qs(t,r,!0);return oa.userSymbolMap[t]=h,h}var n;const s=(new si).fromString(t),r=s.bounds.width(),a=s.bounds.height(),o=1/i.max(r,a);s.transform(0,0,o,o);const l=new qs(t,s);return oa.userSymbolMap[t]=l,l}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=Un(s);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 Jt(t);return be(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(){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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new i.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&he.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&he.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&he.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&he.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&he.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&he.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=he.CLEAR_SHAPE}containsPoint(t,e,n,s){if(!s)return!1;if(n===ce.GLOBAL){const n=new i.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;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,n,s){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);a?this._setAttributes(a,n,s):i.isNil(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ea;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ea;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:de.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=he.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:de.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?Xt.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:oi.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:oi.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:de.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,n){var s,r;if(1===t&&1===e)return this;const a={type:de.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,na,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(n){let{postMatrix:s}=this.attribute;s||(s=new i.Matrix,l.postMatrix=s),Xt.transformUtil.fromMatrix(s,s).scale(t,e,n)}else l.scaleX=(null!==(s=l.scaleX)&&void 0!==s?s:oi.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:oi.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:de.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 n;if(0===t)return this;const s={type:de.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,sa,s);r&&(delete r.angle,this._setAttributes(r,!1,s));const a=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new i.Matrix,a.postMatrix=n),Xt.transformUtil.fromMatrix(n,n).rotate(t,e)}else a.angle=(null!==(n=a.angle)&&void 0!==n?n:oi.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:de.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,sa,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}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().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)&&(!!i.isNil(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;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(s=this.context&&this.context.stateAnimateConfig)&&void 0!==s?s:this.stateAnimateConfig)&&void 0!==r?r:Or;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:de.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:de.STATE});this._emitCustomEvent("afterStateUpdate",{type:de.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const n=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=n?n:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}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 n=i.isArray(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(n);s.length!==this.currentStates.length&&this.useStates(s,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|=he.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=he.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=he.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&he.UPDATE_SHAPE_AND_BOUNDS)===he.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=he.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=he.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=he.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=he.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=he.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=he.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=he.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&he.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=oi.x,y:e=oi.y,scaleX:n=oi.scaleX,scaleY:s=oi.scaleY,angle:r=oi.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const c={};if(o&&r&&(h=this.getAnchor(o,c)),!a||1===n&&1===s)i.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,n,s,r,o&&h);else{const i=this._transMatrix;i.reset(),i.translate(h[0],h[1]),i.rotate(r),i.translate(-h[0],-h[1]),i.translate(t,e),h=this.getAnchor(a,c,!0),Xt.transformUtil.fromMatrix(i,i).scale(n,s,{x:h[0],y:h[1]})}const d=this.getOffsetXY(oi);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=ta.setValue(l.a,l.b,l.c,l.d,l.e,l.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.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:de.ANIMATE_END})}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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Xt.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 i.isString(t,!0)?this.pathProxy=(new si).fromString(t):this.pathProxy=new si,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(n,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(In.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(In.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):i.isObject(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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(),Xt.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Rn(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)}}toCustomPath(){var t,e,i;const n=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||Xt.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(n){const t=new Vr(null,1);return n.drawShape(this,t,0,0,{},{}),t.path}return null}}var la;oa.userSymbolMap={},oa.mixin(Ln),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(la||(la={}));class ha extends oa{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=yr,this._childUpdateTag=he.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 Mn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Mn)}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,n){if(n===ce.GLOBAL){const n=new i.Point(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&he.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=oi.x,y:e=oi.y,dx:i=oi.dx,dy:n=oi.dy,scaleX:s=oi.scaleX,scaleY:r=oi.scaleY,angle:a=oi.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 Cn(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 Xt.graphicService.updateTempAABBBounds(i),Xt.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&=he.CLEAR_BOUNDS,this._childUpdateTag&=he.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=he.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&he.UPDATE_BOUNDS||(this._childUpdateTag|=he.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(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];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,this.getGraphicService().onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{this.getGraphicService().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),this.getGraphicService().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(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[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&he.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=Xt.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new ha(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ha.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function ca(t){return new ha(t)}function da(t,e){return!(!t&&!e)}function ua(t,e){let n;return n=i.isArray(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function pa(t,e,i){return i&&t*e>0}function ga(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}function fa(t,e){return t*e>0}function ma(t,e,i,n){return t*e>0&&0!==i&&0!==n}function ya(t,e,i,n,s,r,a){const o=t-i,l=e-n,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,d=-h*o,u=t+c,p=e+d,g=i+c,f=n+d,m=(u+g)/2,y=(p+f)/2,b=g-u,v=f-p,x=b*b+v*v,_=s-r,A=u*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-d,x11:T*(s/_-1),y11:w*(s/_-1)}}function ba(t,e,n,s,r){const a=i.abs(n-e),o=t.getParsedCornerRadius(),l=i.isArray(o),{outerDeltaAngle:h,innerDeltaAngle:c,outerStartAngle:d,outerEndAngle:u,innerEndAngle:p,innerStartAngle:g}=t.getParsePadAngle(e,n),f=l?o[0]:o,m=l?o[1]:o,y=l?o[2]:o,b=l?o[3]:o,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=r*i.cos(d),T=r*i.sin(d),w=s*i.cos(p),M=s*i.sin(p);let B,C,k,P;if((x>i.epsilon||v>i.epsilon)&&(B=r*i.cos(u),C=r*i.sin(u),k=s*i.cos(g),P=s*i.sin(g),a<i.pi)){const t=function(t,e,n,s,r,a,o,l){const h=n-t,c=s-e,d=o-r,u=l-a;let p=u*h-d*c;return p*p<i.epsilon?[]:(p=(d*(e-a)-u*(t-r))/p,[t+p*h,e+p*c])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],n=T-t[1],a=B-t[0],o=C-t[1],l=1/i.sin(i.acos((e*a+n*o)/(i.sqrt(e*e+n*n)*i.sqrt(a*a+o*o)))/2),h=i.sqrt(t[0]*t[0]+t[1]*t[1]);A=i.min(x,(s-h)/(l-1)),_=i.min(v,(r-h)/(l+1))}}return{outerDeltaAngle:h,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:d,outerEndAngle:u,innerDeltaAngle:c,innerEndAngle:p,innerStartAngle:g,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function va(t,e,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=i.abs(h-l),d=h>l;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=i.epsilon)e.moveTo(n,s);else if(c>=i.pi2-i.epsilon)e.moveTo(n+r*i.cos(l),s+r*i.sin(l)),e.arc(n,s,r,l,h,!d),a>i.epsilon&&(e.moveTo(n+a*i.cos(h),s+a*i.sin(h)),e.arc(n,s,a,h,l,d));else{const{outerDeltaAngle:c,xors:p,yors:g,xirs:f,yirs:m,limitedOcr:y,outerCornerRadiusStart:b,outerCornerRadiusEnd:v,maxOuterCornerRadius:x,xore:_,yore:A,xire:S,yire:T,outerStartAngle:w,outerEndAngle:M,limitedIcr:B,innerDeltaAngle:C,innerEndAngle:k,innerStartAngle:P,innerCornerRadiusStart:O,innerCornerRadiusEnd:R,maxInnerCornerRadius:L}=ba(t,l,h,a,r);if(c<.001)o&&(o[3]||o[1])&&e.moveTo(n+p,s+g),u=!0;else if(y>i.epsilon){const t=i.min(b,y),a=i.min(v,y),l=ya(f,m,p,g,r,t,Number(d)),h=ya(_,A,S,T,r,a,Number(d));y<x&&t===a?!o||o[0]?(e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),e.arc(n+l.cx,s+l.cy,y,i.atan2(l.y01,l.x01),i.atan2(h.y01,h.x01),!d)):e.moveTo(n+l.cx+y*i.cos(i.atan2(h.y01,h.x01)),s+l.cy+y*i.sin(i.atan2(h.y01,h.x01))):!o||o[0]?(e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),t>0&&e.arc(n+l.cx,s+l.cy,t,i.atan2(l.y01,l.x01),i.atan2(l.y11,l.x11),!d),e.arc(n,s,r,i.atan2(l.cy+l.y11,l.cx+l.x11),i.atan2(h.cy+h.y11,h.cx+h.x11),!d),a>0&&e.arc(n+h.cx,s+h.cy,a,i.atan2(h.y11,h.x11),i.atan2(h.y01,h.x01),!d)):a>0?e.moveTo(n+h.cx+a*i.cos(i.atan2(h.y01,h.x01)),s+h.cy+a*i.sin(i.atan2(h.y01,h.x01))):e.moveTo(n+_,s+r*i.sin(M))}else!o||o[0]?(e.moveTo(n+p,s+g),e.arc(n,s,r,w,M,!d)):e.moveTo(n+r*i.cos(M),s+r*i.sin(M));if(!(a>i.epsilon)||C<.001)!o||o[1]?e.lineTo(n+S,s+T):e.moveTo(n+S,s+T),u=!0;else if(B>i.epsilon){const t=i.min(O,B),r=i.min(R,B),l=ya(S,T,_,A,a,-r,Number(d)),h=ya(p,g,f,m,a,-t,Number(d));if(!o||o[1]?e.lineTo(n+l.cx+l.x01,s+l.cy+l.y01):e.moveTo(n+l.cx+l.x01,s+l.cy+l.y01),B<L&&t===r){const t=i.atan2(h.y01,h.x01);!o||o[2]?e.arc(n+l.cx,s+l.cy,B,i.atan2(l.y01,l.x01),t,!d):e.moveTo(n+l.cx+i.cos(t),s+l.cy+i.sin(t))}else!o||o[2]?(r>0&&e.arc(n+l.cx,s+l.cy,r,i.atan2(l.y01,l.x01),i.atan2(l.y11,l.x11),!d),e.arc(n,s,a,i.atan2(l.cy+l.y11,l.cx+l.x11),i.atan2(h.cy+h.y11,h.cx+h.x11),d),t>0&&e.arc(n+h.cx,s+h.cy,t,i.atan2(h.y11,h.x11),i.atan2(h.y01,h.x01),!d)):t>0?e.moveTo(n+h.cx+t*i.cos(i.atan2(h.y01,h.x01)),s+h.cy+t*i.sin(i.atan2(h.y01,h.x01))):e.moveTo(n+f,s+m)}else!o||o[1]?e.lineTo(n+S,s+T):e.moveTo(n+S,s+T),!o||o[2]?e.arc(n,s,a,k,P,d):e.moveTo(n+a*i.cos(P),s+a*i.sin(P))}return o?o[3]&&e.lineTo(n+r*i.cos(l),s+r*i.sin(l)):e.closePath(),u}ha.NOWORK_ANIMATE_ATTR=aa;const xa=Symbol.for("ArcRenderContribution"),_a=Symbol.for("ImageRenderContribution"),Aa=Symbol.for("PolygonRenderContribution"),Sa=Symbol.for("RectRenderContribution"),Ta=Symbol.for("SymbolRenderContribution"),wa=Symbol.for("TextRenderContribution"),Ma=Symbol.for("InteractiveSubRenderContribution");function Ba(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ca(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var ka=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},Pa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oa=function(t,e){return function(i,n){e(i,n,t)}};function Ra(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:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(n=m[2])&&void 0!==n?n:0}if(Rr(t),Lr(t,t,[s+o,r+l,a+h]),Lr(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],d=e[10],u=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+d*n,t[7]=l*s+u*n,t[8]=h*s-r*n,t[9]=c*s-a*n,t[10]=d*s-o*n,t[11]=u*s-l*n}(t,t,g),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],d=e[10],u=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-d*n,t[3]=l*s-u*n,t[8]=r*n+h*s,t[9]=a*n+c*s,t[10]=o*n+d*s,t[11]=l*n+u*s}(t,t,p),Lr(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,d,u]),f){const i=jr.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Lr(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],d=e[6],u=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+d*n,t[3]=l*s+u*n,t[4]=h*s-r*n,t[5]=c*s-a*n,t[6]=d*s-o*n,t[7]=u*s-l*n}(i,i,f),Lr(i,i,[-n[0],-n[1],0]),Ir(t,t,i)}}let La=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Ht(["graphic"]),onSetStage:new Ht(["graphic","stage"]),onRemove:new Ht(["graphic"]),onRelease:new Ht(["graphic"]),onAddIncremental:new Ht(["graphic","group","stage"]),onClearIncremental:new Ht(["graphic","group","stage"]),beforeUpdateAABBBounds:new Ht(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Ht(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new Ht(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new i.AABBBounds,this.tempAABBBounds2=new i.AABBBounds}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 Jt(t);return be(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,n,s){const{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){const e=i.isNumber(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Ca(a,e,e);n.set(n.x1,s,n.x2,s+e)}if(null!=t.forceBoundsWidth){const e=i.isNumber(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=Ba(r,e);n.set(s,n.y1,s+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,n,s,r){if(!e.empty()){const{scaleX:i=n.scaleX,scaleY:r=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:h=n.pickStrokeBuffer,strokeBoundsBuffer:c=n.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){or(d,(l+h)/Math.abs(i+r),s,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:s=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;or(d,o/Math.abs(i+r)*2,!1,c+1),d.translate(s,a),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0;const o=r.transMatrix;r&&r.isContainer&&(a=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),a&&i.transformBoundsWithMatrix(e,e,o)}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),this.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}}};La=ka([wt(),Oa(0,St(Cr)),Pa("design:paramtypes",[Object])],La);const Ia=(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)}return i};class Ea{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){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=Yt.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const d=[],u=[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;d.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:c})}u[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),d.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}u[0]=n}u[1]=d.length*n,u[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,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 Da=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ea];class Fa extends oa{get font(){const t=this.getGraphicTheme();return this._font||(this._font=i.getContextFont(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(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Br,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return i.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Cn(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:n=t.angle}=e;if(!n){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Fa({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:r,y:a}=e,o={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},l=i.rotatePoint(o,n,{x:r,y:a});return this._OBBBounds.copy(s),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=n,this._OBBBounds}updateAABBBounds(t,e,n){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:r}=Xt.graphicService.updateTempAABBBounds(n),{scaleX:a=e.scaleX,scaleY:o=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(l){or(r,l/Math.abs(a+o),!0,h),n.union(r)}return Xt.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Xt.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,i.transformBoundsWithMatrix(n,n,this.transMatrix),n}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:d=i.stroke,wrap:u=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||u)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),d&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=Xt.graphicUtil.textMeasure,A=new Ea(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:m,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),d&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,s;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:d,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:y=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(h),S=this.getLineHeight(this.attribute,r,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(p/2),this._AABBBounds}const T=Xt.graphicUtil.textMeasure,w={fontSize:h,fontWeight:f,fontFamily:a,lineHeight:S},M=new Ea(a,w,T),B=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<B.length;t++){const e=B[t];let i=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,d,c,!1,b,t!==B.length-1),n=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,d,"break-all"!==g,"keep-all"===g);if(""!==e&&""===r.str||r.wordBreaked){if(c){const t=T.clipTextWithSuffix(e,w,d,c,!1,b);r.str=null!==(n=t.str)&&void 0!==n?n:"",r.width=null!==(s=t.width)&&void 0!==s?s:0}else r.str="",r.width=0;i=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.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||(i=!0,o=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(o);"keep-all"===g&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let n=0,s=B.length;n<s;n++){if(n===P-1){const t=T.clipTextWithSuffix(B[n],w,d,c,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[n],t=T.measureTextWidth(e,w),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,o,l,C);const R=M.layoutWithBBox(O,C,o,l,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,n;const s=this.getGraphicTheme(),r=Xt.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=s.maxLineWidth,ellipsis:h=s.ellipsis,fontFamily:c=s.fontFamily,fontSize:d=s.fontSize,fontWeight:u=s.fontWeight,stroke:p=s.stroke,lineWidth:g=s.lineWidth,verticalMode:f=s.verticalMode,suffixPosition:m=s.suffixPosition}=o,y=this.getLineHeight(o,s,0);let{textAlign:b=s.textAlign,textBaseline:v=s.textBaseline}=o;if(!f){const t=b;b=null!==(e=Fa.baselineMapAlign[v])&&void 0!==e?e:"left",v=null!==(n=Fa.alignMapBaseline[t])&&void 0!==n?n:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const t=Ba(b,a),e=this.cache.verticalList.length*y,n=Ca(v,e,d);return this._AABBBounds.set(n,t,n+e,t+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)pr(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:cr.VERTICAL}),n="",i=0),e.push({text:t[s],direction:cr.HORIZONTAL}));return n&&e.push({text:n,direction:cr.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const i=!0===h?s.ellipsis:h,n=r.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,i,!1,m);x[e]=n.verticalList,a=n.width}else{const i=r.clipTextVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,!1);x[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===cr.HORIZONTAL?d:r.measureTextWidth(t.text,{fontSize:d,fontWeight:u,fontFamily:c});a+=e,t.width=e}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const _=Ba(b,a),A=this.cache.verticalList.length*y,S=Ca(v,A,d);return this._AABBBounds.set(S,_,S+A,_+a),p&&this._AABBBounds.expand(g/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=Hn(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Da;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Da;return super.needUpdateTag(t,e)}_interpolate(t,e,i,n,s){"text"===t&&(s.text=n)}clone(){return new Fa(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Fa.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Fa.baselineMapAlign}getAlignMapBaseline(){return Fa.alignMapBaseline}}function ja(t){return new Fa(t)}Fa.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},aa),Fa.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Fa.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Ua=["symbolType","size",...ea];let Na=class t extends oa{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Mr}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,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 i.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Cn(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}=Xt.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;or(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 Xt.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,n){const{size:s=e.size}=t;if(i.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Ua)}needUpdateTag(t){return super.needUpdateTag(t,Ua)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=i.isArray(e)?e:[e,e];return t.path?(new si).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new si).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Wa(t){return new Na(t)}Na.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},aa);const za=["segments","points","curveType","curveTension",...ea];let Va=class t extends oa{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=vr}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=Gn(i,n,e))}getGraphicTheme(){return Cn(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Xt.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return Xt.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,za)}needUpdateTag(t){return super.needUpdateTag(t,za)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new si;const i=e.segments,n=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):e.points&&n(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ga(t){return new Va(t)}Va.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},aa);const Ha=["width","x1","y1","height","cornerRadius",...ea];class Xa extends oa{constructor(t){super(t),this.type="rect",this.numberType=Sr}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Cn(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:a,y:o}=t;e=null!=e?e:s-a,n=null!=n?n:r-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);return Ia(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,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Ha)}needUpdateTag(t){return super.needUpdateTag(t,Ha)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:n,y:s,width:r,height:a}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=i.isNil(t.width)?t.x1-t.x:t.width,n=i.isNil(t.height)?t.y1-t.y:t.height,s=0,r=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:s,y:r,width:e,height:n}})(e);return t=new si,t.moveTo(n,s),t.rect(n,s,r,a),t}clone(){return new Xa(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Xa.NOWORK_ANIMATE_ATTR}}function Ya(t){return new Xa(t)}Xa.NOWORK_ANIMATE_ATTR=aa;const qa=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class $a extends Xa{constructor(t){super(t),this.type="rect3d",this.numberType=Tr}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:n,y1:s,x:r,y:a,length:o=i.min(e.width,e.height)}=this.attribute;let{width:l,height:h}=this.attribute;l=null!=l?l:n-r,h=null!=h?h:s-a;for(let e=0;e<qa.length;e++){const i=qa[e];t.vertices.push([i[0]*l,i[1]*h,i[2]*o])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return $a.NOWORK_ANIMATE_ATTR}}function Ka(t){return new $a(t)}$a.NOWORK_ANIMATE_ATTR=aa;class Za{constructor(t,e,i,n,s,r,a,o,l,h,c,d,u,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=s,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Li[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=d,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),s=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,n):this.height||n||0;r=Math.min(r,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-s:"center"===this.globalAlign&&(o=-s/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+s>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,h=!0),this.lines[i].draw(t,n,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:s}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+l)return h;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(n=!0,h=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let s=this[this.directionKey.height];if(this.singleLine&&(s=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=s&&0!==s)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((s-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],a=s-this.lines[i].top-this.lines[i].height;if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+s||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(0===s)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+s);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+s){const n=!0===this.ellipsis?"...":this.ellipsis||"",s=this.lines[i].getWidthWithEllips(n);s>t&&(t=s),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function Ja(t,e,i,n){const s=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(n);return{left:t>s?s:s-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>n?o:o+.5}}class Qa{constructor(t,e,i,n){var s,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=n;const a=Hn(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=zi(t,i,this.ascentDescentMode);let d=0,u=0,p=0;this.height>l&&(d=(this.height-l)/2,u=Math.ceil(d),p=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=l-d):"bottom"===this.textBaseline?(this.ascent=l-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+u,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(s=i.dx)&&void 0!==s?s:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=zi(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,n,s,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+n;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ni(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=zi(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const d=Ja(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},d),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,n,s,r,a){var o;let l=e+i,h=this.text,c=this.left+n+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let d=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,d="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ni(h,("vertical"===d?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===d);else{const{width:e}=zi(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===d&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:u=1}=this.character;if(this.character.stroke&&u&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=Ja(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===d&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Ni(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=zi(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-n}return i}}const to=["width","height","image",...ea];class eo extends oa{constructor(t){super(t),this.type="image",this.numberType=br,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Cn(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:n=e.maxWidth,maxHeight:s=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>n/s?(r=n,a=n/t):(a=s,r=s*t)}}else r=n,a=s}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);return Ia(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,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Bi[t]}needUpdateTags(t){return super.needUpdateTags(t,to)}needUpdateTag(t){return super.needUpdateTag(t,to)}clone(){return new eo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return eo.NOWORK_ANIMATE_ATTR}}function io(t){return new eo(t)}eo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},aa);class no extends eo{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Un(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(i.isArray(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=Un(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Bi.width,height:e=Bi.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,s=(i-t)/2,r=(n-e)/2;return this._AABBBounds.expand([0,2*s,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class so{constructor(t,e,i,n,s,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=s,this.top=i-n,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof no?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Li[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Qa){const e=ji.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let s=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?s=t-this.actualWidth:"center"===this.textAlign?s=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?s=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof no?(t["_"+i.x]=s,s+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=s,s+=t[i.width]+r)}))}draw(t,e,i,n,s,r){if(s&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof no)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===s?"...":s||"";i.ellipsisStr=r;const{width:a}=zi(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,s)=>{if(e instanceof no)return;const r=e.drawBackground(t,n,this.ascent,i,0===s,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],n=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,n.right-i.left,n.bottom-i.top)})),this.paragraphs.forEach(((e,s)=>{if(e instanceof no)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Ei;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:s=1}=e;t.globalAlpha=n*s,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Ui(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||Ii;if(!n)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.fillStyle=i?Ri(t,n,{AABBBounds:i}):n,Ui(t,e)}(t,e.character,a),e.draw(t,n,this.ascent,i,0===s,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof no)break;const{width:s}=zi(t,n.character,n.ascentDescentMode),r=s||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof no?t.width:t.getWidthWithEllips(this.direction)})),i}}class ro{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Li[this.direction]}store(t){if(t instanceof no){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new so(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof no?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,s=Ni(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==s){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new Qa(i,t.newLine,t.character,t.ascentDescentMode),new Qa(n,!0,t.character,t.ascentDescentMode)]}(t,s);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let ao=!1;try{ao=Intl&&"function"==typeof Intl.Segmenter}catch(t){ao=!1}const oo=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...ea];class lo extends oa{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=wr,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Mi.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Mi.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Mi.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Mi.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Mi.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Mi.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Mi.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Mi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Cn(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&i.isString(t.text)&&lo.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&i.isString(t.text)&&lo.splitText(t.text).length>1)))}static splitText(t){if(ao){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:n}of e.segment(t))i.push(n);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const n=lo.splitText(t.text.toString());if(i.isString(t.text)&&n.length>1)for(let i=0;i<n.length;i++){const s=n[i];e.push(Object.assign(Object.assign({},t),{text:s}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var n,s,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:d=e.textAlign,textBaseline:u=(null!==(s=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)&&void 0!==s?s:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:n}=t.getActualSize();let s=o||e||0,r=l||n||0;r="number"==typeof c&&r>c?c:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(u){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(d){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),Xt.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Xt.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Xt.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,oo)}needUpdateTag(t){return super.needUpdateTag(t,oo)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:d,upgradeAttrs:u}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:s,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:d},t);return(null==u?void 0:u.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:n,maxHeight:s,width:r,height:a,ellipsis:o,wordBreak:l,verticalDirection:h,textAlign:c,textBaseline:d,layoutDirection:u,singleLine:p,disableAutoWrapLine:g,editable:f,ascentDescentMode:m,upgradeAttrs:y}=this.attribute,b=y&&y.multiBreakLine;let{textConfig:v=[]}=this.attribute;f&&v.length>0&&!lo.AllSingleCharacter(v)&&(v=lo.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new no(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(i.isNumber(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let n=0;n<i.length;n++)if(0===n)x.push(new Qa(i[n],!1,e,m));else if(i[n]||t===_.length-1)x.push(new Qa(i[n],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new Qa(i[n],!0,e,m))}}else e.text&&x.push(new Qa(e.text,!1,e,m))}const A="number"==typeof n&&Number.isFinite(n)&&n>0,S="number"==typeof s&&Number.isFinite(s)&&s>0,T="number"==typeof r&&Number.isFinite(r)&&r>0&&(!A||r<=n),w="number"==typeof a&&Number.isFinite(a)&&a>0&&(!S||a<=s),M=new Za(0,0,(T?r:A?n:0)||0,(w?a:S?s:0)||0,o,l,h,c,d,u||"horizontal",!T&&A,!w&&S,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new ro(M);if(B.newLine=b,g){let t=0,e=!1;for(let i=0;i<x.length;i++){const n=x[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&M.lines[M.lines.length-1].paragraphs.push(n)):B.deal(n,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,M.lines[M.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?n:s)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new lo(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,s,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(s=this.stage)||void 0===s||s.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let s;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-n})&&(s=e,s.globalX=(null!==(a=s.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],s.globalY=(null!==(o=s.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),s}getNoWorkAnimateAttr(){return lo.NOWORK_ANIMATE_ATTR}}function ho(t){return new lo(t)}lo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},aa);const co=["path","customPath",...ea];class uo extends oa{constructor(t){super(t),this.type="path",this.numberType=xr}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 si?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof si?this.cache:t.path)}getGraphicTheme(){return Cn(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=Xt.graphicService.updateTempAABBBounds(i);Ia(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 Xt.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;i.isString(t.path,!0)?this.cache=(new si).fromString(t.path):t.customPath&&(this.cache=new si,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,co)}needUpdateTag(t){return super.needUpdateTag(t,co)}toCustomPath(){return(new si).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new uo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return uo.NOWORK_ANIMATE_ATTR}}function po(t){return new uo(t)}uo.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},aa);const go=["segments","points","curveType","curveTension",...ea];class fo extends oa{constructor(t){super(t),this.type="area",this.numberType=mr}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 Cn(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Xt.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:n=e.lineJoin}=t;return Xt.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=Gn(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,go)}needUpdateTag(t){return super.needUpdateTag(t,go)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new si;const 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 fo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fo.NOWORK_ANIMATE_ATTR}}fo.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},aa);const mo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...ea];class yo extends oa{constructor(t){super(t),this.type="arc",this.numberType=gr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:a=t.innerRadius}=this.attribute;if(r+=s,a-=n,0===e||"0%"===e)return 0;const o=Math.abs(r-a),l=t=>Math.min(i.isNumber(t,!0)?t:o*parseFloat(t)/100,o/2);if(i.isArray(e)){const t=e.map((t=>l(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return l(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,r=n-e>=0?1:-1,a=n-e;if(e=i.clampAngleByRadian(e),n=e+a,s&&i.abs(a)<i.pi2-i.epsilon){let a=1,o=1;s.length&&(a=Number(s[0]),o=Number(s[1]));let{outerRadius:l=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute;const{outerPadding:c=t.outerPadding,innerPadding:d=t.innerPadding}=this.attribute;l+=c,h-=d;const u=Math.abs(l-h)/2,p=u/l;if(u>i.epsilon&&l>i.epsilon)return{startAngle:e-r*p*a,endAngle:n+r*p*o,sc:r*p*a,ec:r*p*o}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:s=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:a=n.padAngle}=this.attribute;let{outerRadius:o=n.outerRadius,innerRadius:l=n.innerRadius}=this.attribute;o+=r,l-=s;const{padRadius:h=i.sqrt(o*o+l*l)}=this.attribute,c=i.abs(e-t);let d=t,u=e,p=t,g=e;const f=a/2;let m=c,y=c;if(f>i.epsilon&&h>i.epsilon){const n=e>t?1:-1;let s=i.asin(Number(h)/l*i.sin(f)),r=i.asin(Number(h)/o*i.sin(f));return(m-=2*s)>i.epsilon?(s*=n,p+=s,g-=s):(m=0,p=g=(t+e)/2),(y-=2*r)>i.epsilon?(r*=n,d+=r,u-=r):(y=0,d=u=(t+e)/2),{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:y}}return{outerStartAngle:d,outerEndAngle:u,innerStartAngle:p,innerEndAngle:g,innerDeltaAngle:m,outerDeltaAngle:y}}getGraphicTheme(){return Cn(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Xt.graphicService.updateTempAABBBounds(i);Ia(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return Xt.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:s=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=r,s-=a,n<s&&(n=s),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:s=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:a=e.outerPadding,innerPadding:o=e.innerPadding}=t;if(s+=a,r-=o,s<r){const t=s;s=r,r=t}let{endAngle:l=e.endAngle,startAngle:h=e.startAngle}=t;if(h>l){const t=h;h=l,l=t}return s<=i.epsilon?n.set(0,0,0,0):Math.abs(l-h)>i.pi2-i.epsilon?n.set(-s,-s,s,s):(zn(h,l,s,n),zn(h,l,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,mo)}needUpdateTag(t){return super.needUpdateTag(t,mo)}toCustomPath(){var t,e,n,s;let r=super.toCustomPath();if(r)return r;const a=this.attribute,{startAngle:o,endAngle:l}=this.getParsedAngle();let h=(null!==(t=a.innerRadius)&&void 0!==t?t:0)-(null!==(e=a.innerPadding)&&void 0!==e?e:0),c=(null!==(n=a.outerRadius)&&void 0!==n?n:0)-(null!==(s=a.outerPadding)&&void 0!==s?s:0);const d=i.abs(l-o),u=l>o;if(c<h){const t=c;c=h,h=t}if(r=new si,c<=i.epsilon)r.moveTo(0,0);else if(d>=i.pi2-i.epsilon)r.moveTo(0+c*i.cos(o),0+c*i.sin(o)),r.arc(0,0,c,o,l,!u),h>i.epsilon&&(r.moveTo(0+h*i.cos(l),0+h*i.sin(l)),r.arc(0,0,h,l,o,u));else{const t=c*i.cos(o),e=c*i.sin(o),n=h*i.cos(l),s=h*i.sin(l);r.moveTo(0+t,0+e),r.arc(0,0,c,o,l,!u),r.lineTo(0+n,0+s),r.arc(0,0,h,l,o,u),r.closePath()}return r}clone(){return new yo(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return yo.NOWORK_ANIMATE_ATTR}}function bo(t){return new yo(t)}yo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},aa);class vo extends yo{constructor(t){super(t),this.type="arc3d",this.numberType=fr}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:s=e.outerRadius,height:r=0}=t,a=s+r;return i.setValue(-a,-a,a,a),Xt.graphicService.updateTempAABBBounds(i),Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return vo.NOWORK_ANIMATE_ATTR}}function xo(t){return new vo(t)}vo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},aa);const _o=["points","cornerRadius",...ea];class Ao extends oa{constructor(t){super(t),this.type="polygon",this.numberType=_r}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Cn(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Xt.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:n=e.lineJoin}=t;return Xt.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=Gn(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,_o)}needUpdateTag(t){return super.needUpdateTag(t,_o)}toCustomPath(){const t=this.attribute.points,e=new si;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 Ao(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ao.NOWORK_ANIMATE_ATTR}}function So(t){return new Ao(t)}Ao.NOWORK_ANIMATE_ATTR=aa;class To extends Ao{constructor(t){super(t),this.type="pyramid3d",this.numberType=Ar}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),Xt.graphicService.updateTempAABBBounds(i),Xt.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],s=e.x-n.x;return 0===s?0:(e.y-n.y)/s})),n=t.map((t=>({p:t,d:0})));let s=!1,r=0;for(let t=0;t<e.length-1;t++){for(let a=t+1;a<e.length;a++){if(e[t]===e[a]){s=!0;const e=i.PointService.distancePP(n[t].p,n[t+1].p);n[t].d=e,n[t+1].d=e,r=i.max(r,e);const o=i.PointService.distancePP(n[a].p,n[a+1].p);n[a].d=o,n[a+1].d=o,r=i.max(r,o)}if(s)break}if(s)break}for(let e=t.length-1;e>=0;e--){const i=t[e];n.unshift({p:i,d:0})}for(let e=0;e<t.length;e++){const i=(r-n[e+t.length].d)/2;n[e].d+=i,n[e+t.length].d+=i}const a={polygons:[],vertices:[],edges:[]};return n.forEach((t=>{a.vertices.push([t.p.x,t.p.y,t.d])})),a.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),a.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),a.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),a.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),a.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),a.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),a.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],a}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return To.NOWORK_ANIMATE_ATTR}}function wo(t){return new To(t)}To.NOWORK_ANIMATE_ATTR=aa;class Mo extends ha{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Bo(t){return new Mo(t)}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}};let ko;function Po(t){return ko||(ko=Co.CreateGraphic("text",{})),ko.initAttributes(t),ko.AABBBounds}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},Ro=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)}};class Io{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=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(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Cn(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=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:y,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=f*m,e.fillStyle=g,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(),d=i.height();let u=c,p=d;if("no-repeat"===s)if(r)if(a){const n=Math.max(c/e.width,d/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?(u=i*(d/n),p=d):"repeat-y"===s&&(p=n*(c/i),u=c);const r=t.dpr,a=_n.allocate({width:u,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,u,p),o.drawImage(e,0,0,u,p),e=a.nativeCanvas),_n.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,d),t.translate(-i.x1,-i.y1)}}}const Eo=new Io;let Do=class{constructor(t){this.subRenderContribitions=t,this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,c,d,u)}))}};Do=Oo([wt(),Lo(0,St(Wt)),Lo(0,Mt(Ma)),Ro("design:paramtypes",[Object])],Do);const Fo=new class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||d),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const jo=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};const Uo=new class{constructor(){this.time=ge.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=_n.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])),_n.free(o),h}createCirclePattern(t,e,n,s){return this.createCommonPattern(t,e,n,s,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,i.pi2),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,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:d=null}=e.attribute;let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,a,i);break;case"diamond":u=this.createDiamondPattern(o,l,a,i);break;case"rect":u=this.createRectPattern(o,l,a,i);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":u=this.createGridPattern(o,l,a,i)}if(d&&d.dynamicTexture){const{gridConfig:u={},useNewCanvas:p}=d,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=_n.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=u.columns?u.columns:Math.ceil(y/x),A=u.rows?u.rows:Math.ceil(b/x),S=u.gutterColumn?u.gutterColumn:2*v,T=u.gutterRow?u.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Wa({}));const w=u.columns?y/u.columns:x,M=u.rows?b/u.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=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=d.beforeDynamicTexture)||void 0===h||h.call(d,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,d.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(u)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=u,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:d=0}=s;let{amplitude:u=10}=s;u*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=u*Math.sin((e+m+d)/y+d);t.lineTo(e+r,p+i+a)}t.lineTo(g+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({},d||{}),{fill:a}),n+t.x1-n,s+t.y1-s),i.restore()}}};const No=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=w?o:Oi(e,o,e.dpr),c=o/B,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+u*h,innerRadius:M-u*h,startAngle:b-u*c,endAngle:v+u*c}),e.beginPath(),va(t,e,i,n,B+u*h,M-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,s,(_-i)/S,(A-n)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(u,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Wo=Uo,zo=Eo,Vo=i.pi/2;function Go(t,e,n,s,r,a){let o,l=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],h=arguments.length>7?arguments[7]:void 0;if(Array.isArray(l)&&(h=l,l=!0),s<0&&(e+=s,s=-s),r<0&&(n+=r,r=-r),i.isNumber(a,!0))o=[a=i.abs(a),a,a,a];else if(Array.isArray(a)){const t=a;let e,n;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=i.abs(t[0]),o=[e,e,e,e];break;case 2:case 3:e=i.abs(t[0]),n=i.abs(t[1]),o=[e,n,e,n];break;default:o=t,o[0]=i.abs(o[0]),o[1]=i.abs(o[1]),o[2]=i.abs(o[2]),o[3]=i.abs(o[3])}}else o=[0,0,0,0];if(s<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,s,r);const[c,d,u,p]=[[e,n],[e+s,n],[e+s,n+r],[e,n+r]],g=Math.min(s/2,r/2),f=[Math.min(g,o[0]),Math.min(g,o[1]),Math.min(g,o[2]),Math.min(g,o[3])],m=[c[0]+f[0],c[1]],y=[c[0],c[1]+f[0]],b=[d[0]-f[1],d[1]],v=[d[0],d[1]+f[1]],x=[u[0]-f[2],u[1]],_=[u[0],u[1]-f[2]],A=[p[0]+f[3],p[1]],S=[p[0],p[1]-f[3]];if(t.moveTo(m[0],m[1]),l){if(h&&h[0]?h[0](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!i.arrayEqual(b,v)){h&&h[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+f[1];t.arc(e,i,f[1],-Vo,0,!1)}if(h&&h[1]?h[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!i.arrayEqual(x,_)){const e=_[0]-f[2],i=_[1];h&&h[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,f[2],0,Vo,!1)}if(h&&h[2]?h[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!i.arrayEqual(A,S)){const e=A[0],n=A[1]-f[3];h&&h[2]&&t.moveTo(A[0],A[1]),t.arc(e,n,f[3],Vo,i.pi,!1)}if(h&&h[3]?h[3](S[0],S[1],y[0],y[1]):t.lineTo(y[0],y[1]),!i.arrayEqual(m,y)){const e=m[0],n=m[1]+f[0];h&&h[3]&&t.moveTo(y[0],y[1]),t.arc(e,n,f[0],i.pi,i.pi+Vo,!1)}}else h&&h[0]?h[0](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),h&&h[1]?h[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),h&&h[2]?h[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),h&&h[2]?h[2](A[0],A[1],m[0],m[1]):t.lineTo(m[0],m[1]);return!h&&t.closePath(),t}var Ho=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};class Xo{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{cornerRadius:y=h.cornerRadius,cornerType:b=h.cornerType,opacity:v=h.opacity,x:x=h.x,y:_=h.y,scaleX:A=h.scaleX,scaleY:S=h.scaleY,x1:T,y1:w,keepStrokeScale:M=h.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-n)||0,C=(null!=C?C:w-s)||0;const k=(r,a)=>{const o=!(!r||!r.stroke),l="outerBorder"===a?-1:1,{distance:c=h[a].distance}=r,d=M?c:Oi(e,c,e.dpr),p=n+l*d,g=s+l*d,f=2*d;if(0===y||i.isArray(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(p,g,B-l*f,C-l*f)):(e.beginPath(),Go(e,p,g,B-l*f,C-l*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[a]);else if(o){const i=h[a].opacity;h[a].opacity=v,e.setStrokeStyle(t,r,(x-n)/A,(_-s)/S,h[a]),h[a].opacity=i,e.stroke()}};f&&k(p,"outerBorder"),m&&k(g,"innerBorder")}}let Yo=class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Yo=Ho([wt()],Yo);let qo=class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){const{x1:p,y1:g,x:f=h.x,y:m=h.y,stroke:y=h.stroke,cornerRadius:b=h.cornerRadius,cornerType:v=h.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:p-f)||0,_=(null!=_?_:g-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,s,h),!(0===b||i.isArray(b)&&b.every((t=>0===t)))){let i,r=0;return Go(e,n,s,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,l,c,d)=>{y[o]&&(r===o-1&&y[o]===i||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),n,s,h),e.beginPath(),e.moveTo(a,l),i=y[o]),r=o,e.lineTo(c,d),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,s),y[0]?e.lineTo(n+x,s):e.moveTo(n+x,s),y[1]?e.lineTo(n+x,s+_):e.moveTo(n+x,s+_),y[2]?e.lineTo(n,s+_):e.moveTo(n,s+_),y[3]){const t=y[0]?s-e.lineWidth/2:s;e.lineTo(n,t)}else e.moveTo(n,s);e.stroke()}}};qo=Ho([wt()],qo);const $o=new Xo,Ko=Uo,Zo=Eo;const Jo=new class extends Xo{constructor(){super(...arguments),this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){return super.drawShape(t,e,i,n,s,r,a,o,l,h,c,d)}},Qo=Eo;const tl=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=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:Oi(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,y,i,n,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(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()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},el=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,c,d,u){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=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,y,i,n,p,m,((s,r)=>{var a,h,c,u;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!==(u=r.lineWidth)&&void 0!==u?u:t.attribute.lineWidth,r=e}r.stroke&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-n)/v,l),e.stroke()))})),r&&!x.isSvg&&(d?d(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-n)/v,l),e.stroke())))}},il=Uo,nl=Eo,sl={x:0,y:0,z:0,lastModelMatrix:null};class rl{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Fo),this.builtinContributions.push(jo),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===ge.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===ge.afterFillStroke)))}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,c,d,u){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,d,u)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,c,d,u){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,d,u)}))}drawPathProxy(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=Cn(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:d=l.opacity,fillOpacity:u=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=pa(d,u,h),v=fa(d,g),x=da(h),_=ua(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return be(("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-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,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:d=e.visible}=t.attribute,u=pa(o,l,s),p=fa(o,c),g=da(s,r),f=ua(a,h);return!(!t.valid||!d)&&!(!g&&!f)&&!!(u||p||i||n||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];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,d=i.modelMatrix,u=i.camera;sl.x=s,sl.y=r,sl.z=a,sl.lastModelMatrix=d;const p=u&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const n=jr.allocate(),s=jr.allocate();Ra(s,t,e),Ir(n,d||n,s),sl.x=0,sl.y=0,sl.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),jr.free(s)}if(g&&!d){const n=t.getOffsetXY(e);sl.x+=n.x,sl.y+=n.y,sl.z=a,i.setTransformForCurrent()}else if(p)sl.x=0,sl.y=0,sl.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);sl.x+=n.x,sl.y+=n.y,this.transformWithoutTranslate(i,sl.x,sl.y,sl.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),sl.x=0,sl.y=0,sl.z=0;return sl}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},d={x:s,y:r};n.camera=null;const u=1/(h.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+d.y*o.x+(c.y-d.y)*a.x)*u,g=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*a.y)*u,f=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*a.x)*u,m=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*a.y)*u,y=(h.x*(d.y*o.x-c.y*l.x)+h.y*(c.x*l.x-d.x*o.x)+(d.x*c.y-c.x*d.y)*a.x)*u,b=(h.x*(d.y*o.y-c.y*l.y)+h.y*(c.x*l.y-d.x*o.y)+(d.x*c.y-c.x*d.y)*a.y)*u;n.setTransform(p,g,f,m,y,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,r){const{context:a}=n;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.z=d,this.drawPathProxy(t,a,h,c,n,s)||(this.drawShape(t,a,h,c,n,s,null,null,r),this.z=0,a.modelMatrix!==u&&jr.free(a.modelMatrix),a.modelMatrix=u),a.highPerformanceRestore()}}var al=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},ol=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ll=function(t,e){return function(i,n){e(i,n,t)}};let hl=class extends rl{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=gr,this.builtinContributions=[No,zo,Wo],this.init(t)}drawArcTailCapPath(t,e,n,s,r,a,o,l){const h=l-o,c=t.getParsedAngle(),d=c.startAngle;let u=c.endAngle;u=l,i.abs(u-d);const p=u>d;let g=!1;if(r<a){const t=r;r=a,a=t}const{outerDeltaAngle:f,xors:m,yors:y,xirs:b,yirs:v,limitedOcr:x,outerCornerRadiusStart:_,outerCornerRadiusEnd:A,maxOuterCornerRadius:S,xore:T,yore:w,xire:M,yire:B,limitedIcr:C,innerDeltaAngle:k,innerStartAngle:P,innerCornerRadiusStart:O,innerCornerRadiusEnd:R,maxInnerCornerRadius:L}=ba(t,d,u,a,r);if(x>i.epsilon){const t=i.min(_,x),a=i.min(A,x),o=ya(b,v,m,y,r,t,Number(p)),l=ya(T,w,M,B,r,a,Number(p));if(x<S&&t===a)e.moveTo(n+o.cx+o.x01,s+o.cy+o.y01),e.arc(n+o.cx,s+o.cy,x,i.atan2(o.y01,o.x01),i.atan2(l.y01,l.x01),!p);else{const t=u-h-.03,o=i.atan2(l.y11,l.x11);e.arc(n,s,r,t,o,!p),a>0&&e.arc(n+l.cx,s+l.cy,a,i.atan2(l.y11,l.x11),i.atan2(l.y01,l.x01),!p)}}else e.moveTo(n+m,s+y);if(!(a>i.epsilon)||k<.001)e.lineTo(n+M,s+B),g=!0;else if(C>i.epsilon){const t=i.min(O,C),r=i.min(R,C),o=ya(M,B,T,w,a,-r,Number(p)),l=ya(m,y,b,v,a,-t,Number(p));if(e.lineTo(n+o.cx+o.x01,s+o.cy+o.y01),C<L&&t===r){const t=i.atan2(l.y01,l.x01);e.arc(n+o.cx,s+o.cy,C,i.atan2(o.y01,o.x01),t,!p)}else{r>0&&e.arc(n+o.cx,s+o.cy,r,i.atan2(o.y01,o.x01),i.atan2(o.y11,o.x11),!p);const t=i.atan2(o.cy+o.y11,o.cx+o.x11),l=u-h-.03;e.arc(n,s,a,t,l,p)}}else e.lineTo(n+a*i.cos(P),s+a*i.sin(P));return g}drawShape(t,e,n,s,r,a,o,l,h){h=null!=h?h:Cn(t,null==a?void 0:a.theme).arc;const{fill:c=h.fill,stroke:d=h.stroke,x:u=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(i.isBoolean(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:n,endAngle:s}=t.getParsedAngle();i.abs(s-n)<i.pi2-i.epsilon&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let n=!0;if(i.isBoolean(t,!0)){for(let i=0;i<4;i++)Fn[i]=t,n&&(n=!(null!==(e=Fn[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Fn[e]=!!t[e],n&&(n=!!Fn[e]);else Fn[0]=!1,Fn[1]=!1,Fn[2]=!1,Fn[3]=!1;return{isFullStroke:n,stroke:Fn}})(d);if((b||k)&&(e.beginPath(),va(t,e,n,s,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),g?(this._runStroke(t,e,n,s,h,v,k,y,l),this._runFill(t,e,n,s,h,b,m,u,p,o)):(this._runFill(t,e,n,s,h,b,m,u,p,o),this._runStroke(t,e,n,s,h,v,k,y,l))),!k&&v&&(e.beginPath(),va(t,e,n,s,T,w,P),C||this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,n,s,h),e.stroke())),(i.isBoolean(A)&&A||A[1])&&S){const{startAngle:a,endAngle:c}=t.getParsedAngle();if(i.abs(c-a)>=i.pi2-i.epsilon){e.beginPath();const a=Math.abs(T-w)/2/T,{endAngle:c=h.endAngle,fill:d=h.fill}=t.attribute,u=c;this.drawArcTailCapPath(t,e,n,s,T,w,u,u+a),C||this.beforeRenderStep(t,e,n,s,b,v,m,y,h,r,o,l);const p=()=>{if(b){const r=d;if("conical"===r.gradient){const a=function(t,e,n,s){const{stops:r,startAngle:a,endAngle:o}=s;for(;n<0;)n+=i.pi2;for(;n>i.pi2;)n-=i.pi2;if(n<a)return r[0].color;if(n>o)return r[0].color;let l,h,c=(n-a)/(o-a);for(let t=0;t<r.length;t++)if(r[t].offset>=c){l=r[t-1],h=r[t];break}return c=(c-l.offset)/(h.offset-l.offset),Yr(l.color,h.color,c,!1)}(0,0,c,r);o||pa&&(e.setCommonStyle(t,t.attribute,n,s,h),e.fillStyle=a,e.fill())}}},g=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,n,s,h),e.stroke()))};p(),g()}}this.afterRenderStep(t,e,n,s,b,v,m,y,h,r,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,n,s,r,a,o,l,h){r&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,n,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n,s)}};function cl(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]=we(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 dl(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:d}=e;let u;if(c&&!1!==c.defined&&!i?u=l:c&&!1!==d.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+s,o+r,a)}else u&&(h=!n,t.lineTo(u.x+s,u.y+r,a))}return h}hl=al([wt(),ll(0,St(Wt)),ll(0,Mt(xa)),ol("design:paramtypes",[Object])],hl);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 pl=class extends rl{constructor(){super(...arguments),this.numberType=vr}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,n,s,r,a,o,l,h,c,d,u,p,g,f){var m;if(!e)return;t.beginPath();(function(t,e,n,s,r){const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1}=r||{};if(c&&"none"===h)return;if(!e)return;let d=!0;const{curves:u}=e;if(n>=1){if(c){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=dl(t,n,e,i,a,o,l),e=n):e=n}))}else u.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+a,e.p0.y+o,l),cl(t,e,1,r),d=!1):d=!0}));return}if(n<=0)return;let p;"x"===s?p=ue.ROW:"y"===s?p=ue.COLUMN:"auto"===s&&(p=e.direction);const g=n*e.tryUpdateLength(p);let f=0,m=!0,y=null;for(let e=0,n=u.length;e<n;e++){const n=u[e],s=n.getLength(p),h=(g-f)/s;if(f+=s,h<0)break;if(c){if(n.originP1===n.originP2){y=n;continue}m=dl(t,n,y,m,a,o,l),y=n}else{if(!n.defined){d=!0;continue}d&&t.moveTo(n.p0.x+a,n.p0.y+o,l),cl(t,n,i.min(h,1),r),d=!1}}})(t,e,h,c,{offsetX:d,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),p.cache&&!i.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,l);const{x:y=0,x:b=0}=o;return!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(p,o,y-d,b-u,l),t.fill())),!1!==s&&(f?f(t,o,l):a&&(t.setStrokeStyle(p,o,y-d,b-u,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,c,d,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(u?u(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t,null==a?void 0:a.theme).line,{fill:c=h.fill,stroke:d=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,segments:g,points:f,closePath:m,curveTension:y=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,l))return;let{curveType:v=h.curveType}=t.attribute;m&&"linear"===v&&(v="linearClosed");const{clipRange:x=h.clipRange,clipRangeByDimension:_=h.clipRangeByDimension}=t.attribute;if(1===x&&!g&&!f.some((t=>!1===t.defined))&&"linear"===v)return this.drawLinearLineHighPerformance(t,e,!!c,!!d,u,p,n,s,h,r,a,o,l);function A(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=ni(A(t.points,b),v,{startPoint:e,curveTension:y});return n=s,s})).filter((t=>!!t)),"linearClosed"===v){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=ni(A(n,b),v,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let i=!1;t.cache.forEach(((a,g)=>{i||(i=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[g],[h,t.attribute],x,_,n,s,t,o,l))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=x*a;let f=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),v=(g-f)/b;f+=b,v>0&&(m=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[y],[h,t.attribute],i.min(v,1),_,n,s,t,o,l))}))}}else this.drawSegmentItem(e,t.cache,!!c,!!d,u,p,t.attribute,h,x,_,n,s,t,o,l)}};pl=ul([wt()],pl);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},fl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ml=function(t,e){return function(i,n){e(i,n,t)}};let yl=class extends rl{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Sr,this.builtinContributions=[$o,Zo,Ko],this.init(t)}drawShape(t,e,n,s,r,a,o,l,h){h=null!=h?h:Cn(t,null==a?void 0:a.theme).rect;const{fill:c=h.fill,background:d,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,cornerType:g=h.cornerType,opacity:f=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:b=h.strokeOpacity,visible:v=h.visible,x1:x,y1:_,x:A=h.x,y:S=h.y,fillStrokeOrder:T=h.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=ga(f,m,w,M,c),C=ma(f,b,w,M),k=da(c,d),P=ua(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||o||l||d))return;0===p||i.isArray(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(n,s,w,M)):(e.beginPath(),Go(e,n,s,w,M,p,"bevel"!==g));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,k,P,B,C,h,r,o,l,O),T?(this._runStroke(t,e,n,s,h,O,C,A,S,l),this._runFill(t,e,n,s,h,O,B,A,S,o)):(this._runFill(t,e,n,s,h,O,B,A,S,o),this._runStroke(t,e,n,s,h,O,C,A,S,l)),this.afterRenderStep(t,e,n,s,k,P,B,C,h,r,o,l)}_runFill(t,e,i,n,s,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,s):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-n,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).rect;this._draw(t,s,!1,i,n,s)}};yl=gl([wt(),ml(0,St(Wt)),ml(0,Mt(Sa)),fl("design:paramtypes",[Object])],yl);var bl=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},vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xl=function(t,e){return function(i,n){e(i,n,t)}};let _l=class extends rl{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Mr,this.builtinContributions=[tl,nl,il,el],this.init(t)}drawShape(t,e,n,s,r,a,o,l,h){var c;h=null!=h?h:Cn(t,null==a?void 0:a.theme).symbol;const{size:d=h.size,x:u=h.x,y:p=h.y,scaleX:g=h.scaleX,scaleY:f=h.scaleY,fillStrokeOrder:m=h.fillStrokeOrder,clipRange:y=h.clipRange}=t.attribute,b=this.valid(t,h,o,l);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,w=null!==(c=this.z)&&void 0!==c?c:0;e.beginPath();let M=n,B=s,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(n,s,w);e.camera=null,i.isArray(d)&&(d[0],d[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,d,M,B,C,((i,r)=>{var a,c,d,b;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!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(d=r.stroke)&&void 0!==d?d:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,r,u-n,p-s,h),e.fill()))},_=()=>{r.stroke&&(l?l(e,t.attribute,h):x&&y>=1&&(e.setStrokeStyle(t,r,(u-n)/g,(p-s)/f,h),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,_,A,v,x,h,r,o,l),m?(this._runStroke(t,e,n,s,h,A,x,u,p,S,y,g,f,l),this._runFill(t,e,n,s,h,_,v,u,p,S,o)):(this._runFill(t,e,n,s,h,_,v,u,p,S,o),this._runStroke(t,e,n,s,h,A,x,u,p,S,y,g,f,l)),this.afterRenderStep(t,e,n,s,_,A,v,x,h,r,o,l)}_runFill(t,e,i,n,s,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,s):a&&(e.setCommonStyle(t,t.attribute,o-i,l-n,s),e.fill()))}_runStroke(t,e,i,n,s,r,a,o,l,h,c,d,u,p){r&&!h.isSvg&&(p?p(e,t.attribute,s):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/d,(l-n)/u,s),e.stroke()))}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};_l=bl([wt(),xl(0,St(Wt)),xl(0,Mt(Ta)),vl("design:paramtypes",[Object])],_l);const Al=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new i.AABBBounds)}allocate(t,e,n,s){if(!this.pools.length)return(new i.AABBBounds).setValue(t,e,n,s);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=s,r}allocateByObj(t){if(!this.pools.length)return new i.AABBBounds(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Sl=new class extends Io{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,n,s,r,a,o,l,h,c,d,u){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=h.backgroundMode,backgroundFit:T=h.backgroundFit,backgroundKeepAspectRatio:w=h.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=i.isObject(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),n=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),s=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Al.allocate(i,n,i+s,n+r),B=B.background,!O){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,O||(k=Po(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const i=t.resources.get(B);if("success"!==i.state||!i.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,s,h),this.doDrawImage(e,i.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:i}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,s,h),e.fillStyle=B,i?(Go(e,k.x1,k.y1,k.width(),k.height(),i,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Al.free(k),C()}};var Tl=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},wl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ml=function(t,e){return function(i,n){e(i,n,t)}};let Bl=class extends rl{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Br,this.builtinContributions=[Sl],this.init(t)}drawShape(t,e,n,s,r,a,o,l){var h,c,d;const u=Cn(t,null==a?void 0:a.theme).text,{text:p,underline:g=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:m=u.keepDirIn3d,direction:y=u.direction,fontSize:b=u.fontSize,verticalMode:v=u.verticalMode,x:x=u.x,y:_=u.y}=t.attribute,A=null!==(h=Hn(t.attribute.lineHeight,b))&&void 0!==h?h:b,S=this.valid(t,u,o,l);if(!S)return;const{fVisible:T,sVisible:w,doFill:M,doStroke:B}=S,C=!m,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,s,M,B,T,w,u,r,o,l),C&&this.transformUseContext2d(t,u,k,e);const P=(i,r,a,h)=>{let c=n+r;const d=s+a;if(h){e.highPerformanceSave(),c+=b;const t=Fr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Fr.free(t)}B&&(l?l(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,x-n,_-s,u),e.strokeText(i,c,d,k))),M&&(o?o(e,t.attribute,u):T&&(e.setCommonStyle(t,t.attribute,x-n,_-s,u),e.fillText(i,c,d,k))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,k),"horizontal"===y){const{multilineLayout:i}=t;if(!i)return void e.highPerformanceRestore();const{xOffset:r,yOffset:a}=i.bbox;B&&(l?l(e,t.attribute,u):w&&(e.setStrokeStyle(t,t.attribute,x-n,_-s,u),i.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+n,(t.topOffset||0)+a+s,k)})))),M&&(o?o(e,t.attribute,u):T&&(e.setCommonStyle(t,t.attribute,x-n,_-s,u),i.lines.forEach((i=>{e.fillText(i.str,(i.leftOffset||0)+r+n,(i.topOffset||0)+a+s,k),this.drawUnderLine(g,f,t,(i.leftOffset||0)+r+n,(i.topOffset||0)+a+s,i.descent,(i.descent-i.ascent)/2,k,u,e,{width:i.width})}))))}else{let{textAlign:n=u.textAlign,textBaseline:s=u.textBaseline}=t.attribute;if(!v){const e=n;n=null!==(c=t.getBaselineMapAlign()[s])&&void 0!==c?c:"left",s=null!==(d=t.getAlignMapBaseline()[e])&&void 0!==d?d:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:a}=r;e.textAlign="left",e.textBaseline="top";const o=A*a.length;let l=0;a.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);l=i.max(e,l)}));let h=0,p=0;"bottom"===s?p=-o:"middle"===s&&(p=-o/2),"center"===n?h-=l/2:"right"===n&&(h-=l),a.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=l-i;let r=h;"center"===n?r+=s/2:"right"===n&&(r+=s),t.forEach((t=>{const{text:i,width:n,direction:s}=t;P(i,o-(e+1)*A+p,r,s),r+=n}))}))}C&&this.restoreTransformUseContext2d(t,u,k,e),this.afterRenderStep(t,e,n,s,M,B,T,w,u,r,o,l)}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).text,{keepDirIn3d:r=s.keepDirIn3d}=t.attribute,a=!r;this._draw(t,s,a,i,n)}drawUnderLine(t,e,n,s,r,a,o,l,h,c,d){if(e+t<=0)return;const{textAlign:u=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=n.attribute,b=!i.isNil(d),v=b?d.width:n.clipedWidth,x=b?0:Ba(u,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(n,_,s,r,h),m&&c.setLineDash(m),c.beginPath();const e=r+a+f;c.moveTo(s+x,e,l),c.lineTo(s+x+v,e,l),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(n,_,s,r,h),c.beginPath();const t=r+o;c.moveTo(s+x,t,l),c.lineTo(s+x+v,t,l),c.stroke()}}};function Cl(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 kl(t,e){return Math.sqrt(t*t+e*e)}function Pl(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}Bl=Tl([wt(),Ml(0,St(Wt)),Ml(0,Mt(wa)),wl("design:paramtypes",[Object])],Bl);const Ol=Uo,Rl=Eo;var Ll=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},Il=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 Dl=class extends rl{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=_r,this.builtinContributions=[Rl,Ol],this.init(t)}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t,null==a?void 0:a.theme).polygon,{points:c=h.points,cornerRadius:d=h.cornerRadius,x:u=h.x,y:p=h.y,closePath:g=h.closePath,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,m=this.valid(t,h,o,l);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),d<=0||i.isArray(d)&&d.every((t=>0===t))?Cl(e.camera?e:e.nativeContext,c,n,s):function(t,e,i,n,s){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Cl(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],d=h.x-o.x,u=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(u,d)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=kl(d,u),x=kl(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=Pl(h,b,v,d,u),S=Pl(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=kl(T,w),B=Pl(h,kl(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+n):t.lineTo(A.x+i,A.y+n),P&&t.arcTo(h.x+i,h.y+n,S.x+i,S.y+n,y),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,c,n,s,d,g),g&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,v,x,y,b,h,r,o,l);const _=()=>{v&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,u-n,p-s,h),e.fill()))},A=()=>{x&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,u-n,p-s,h),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,n,s,v,x,y,b,h,r,o,l)}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};Dl=Ll([wt(),El(0,St(Wt)),El(0,Mt(Aa)),Il("design:paramtypes",[Object])],Dl);var Fl=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},jl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ul=function(t,e){return function(i,n){e(i,n,t)}};const Nl=["","repeat-x","repeat-y","repeat"];let Wl=class extends rl{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=br,this.builtinContributions=[Jo,Qo],this.init(t)}drawShape(t,e,n,s,r,a,o,l){const h=Cn(t).image,{repeatX:c=h.repeatX,repeatY:d=h.repeatY,x:u=h.x,y:p=h.y,cornerRadius:g=h.cornerRadius,fillStrokeOrder:f=h.fillStrokeOrder,cornerType:m=h.cornerType,image:y}=t.attribute,b=this.valid(t,h,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===g||i.isArray(g)&&g.every((t=>0===t))?e.rect(n,s,T,w):(Go(e,n,s,T,w,g,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const B=()=>{if(_)if(o)o(e,t.attribute,h);else if(v){e.setCommonStyle(t,t.attribute,n,s,h);let i=0;if("repeat"===c&&(i|=1),"repeat"===d&&(i|=2),i){const t=e.createPattern(S.data,Nl[i]);e.fillStyle=t,e.translate(n,s,!0),e.fillRect(0,0,T,w),e.translate(-n,-s,!0)}else e.drawImage(S.data,n,s,T,w)}},C=()=>{A&&(l?l(e,t.attribute,h):x&&(e.setStrokeStyle(t,t.attribute,u-n,p-s,h),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,s,_,!1,v,!1,h,r,o),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,s,_,!1,v,!1,h,r,o),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,n,s,_,!1,v,!1,h,r,o)}draw(t,e,n){const{image:s}=t.attribute;if(!s||!t.resources)return;const r=t.resources.get(s);if("loading"===r.state&&i.isString(s))return void In.improveImageLoading(s);if("success"!==r.state)return;const{context:a}=e.drawParams;if(!a)return;const o=Cn(t).image;this._draw(t,o,!1,n)}};Wl=Fl([wt(),Ul(0,St(Wt)),Ul(0,Mt(_a)),jl("design:paramtypes",[Object])],Wl);const zl=Symbol.for("ArcRender"),Vl=Symbol.for("Arc3dRender"),Gl=Symbol.for("GraphicRender"),Hl=Symbol.for("LineRender"),Xl=Symbol.for("PolygonRender"),Yl=Symbol.for("RectRender"),ql=Symbol.for("Rect3DRender"),$l=Symbol.for("SymbolRender"),Kl=Symbol.for("TextRender"),Zl=Symbol.for("RichTextRender"),Jl=Symbol.for("Pyramid3dRender"),Ql=Symbol.for("ImageRender");var th=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 eh,ih=class extends pl{constructor(){super(...arguments),this.numberType=vr}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=Cn(t).line,{fill:c=h.fill,stroke:d=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=pa(u,p,c),b=fa(u,g),v=da(c),x=ua(d,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||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())}};ih=th([wt()],ih);class nh{static registerPlugin(t,e){nh._pluginClasses[t]=e}static getPlugin(t){return nh._pluginClasses[t]}}nh._pluginClasses={};class sh{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=t,this.color=e,this.colorRgb=Hr.Get(e,Gr.Color1),this.ambient=n;const s=i.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const n=this.formatedDir,s=i.min(i.max((t[0]*n[0]+t[1]*n[1]+t[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let r;r=i.isString(e)?Hr.Get(e,Gr.Color1):e;const a=this.colorRgb;return`rgb(${a[0]*r[0]*s}, ${a[1]*r[1]*s}, ${a[2]*r[2]*s})`}}const rh=()=>{nh.registerPlugin("DirectionalLight",sh)};class ah{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=jr.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=jr.allocate());const{pos:t,center:e,up:n}=this.params.viewParams;return function(t,e,n,s){let r,a,o,l,h,c,d,u,p,g;const f=e[0],m=e[1],y=e[2],b=s[0],v=s[1],x=s[2],_=n[0],A=n[1],S=n[2];Math.abs(f-_)<i.epsilon&&Math.abs(m-A)<i.epsilon&&Math.abs(y-S)<i.epsilon?Rr(t):(d=f-_,u=m-A,p=y-S,g=1/Math.hypot(d,u,p),d*=g,u*=g,p*=g,r=v*p-x*u,a=x*d-b*p,o=b*u-v*d,g=Math.hypot(r,a,o),g?(g=1/g,r*=g,a*=g,o*=g):(r=0,a=0,o=0),l=u*o-p*a,h=p*r-d*o,c=d*a-u*r,g=Math.hypot(l,h,c),g?(g=1/g,l*=g,h*=g,c*=g):(l=0,h=0,c=0),t[0]=r,t[1]=l,t[2]=d,t[3]=0,t[4]=a,t[5]=h,t[6]=u,t[7]=0,t[8]=o,t[9]=c,t[10]=p,t[11]=0,t[12]=-(r*f+a*m+o*y),t[13]=-(l*f+h*m+c*y),t[14]=-(d*f+u*m+p*y),t[15]=1)}(this._viewMatrixCached,t,e,n),this._vp||(this._vp=jr.allocate()),this._vp=Ir(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=jr.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=jr.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return function(t,e,i,n,s,r,a){const o=1/(e-i),l=1/(n-s),h=1/(r-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(s+n)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=jr.allocate()),this._vp=Ir(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Er(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:s}=this._params.viewParams;Er(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const r=this.getProjectionScale(i);return{x:t*r+s[0],y:e*r+s[1]}}}const oh=()=>{nh.registerPlugin("OrthoCamera",ah)};let lh=!1;const hh=new gt((t=>{lh||(lh=!0,t(hl).toSelf().inSingletonScope(),t(zl).to(hl).inSingletonScope(),t(Gl).toService(zl),t(xa).toService(Do),Vt(t,xa))}));let ch=!1;const dh=new gt((t=>{ch||(ch=!0,t(yl).toSelf().inSingletonScope(),t(Yl).to(yl).inSingletonScope(),t(Gl).toService(Yl),t(qo).toSelf(),t(Yo).toSelf(),t(Sa).toService(qo),t(Sa).toService(Yo),t(Sa).toService(Do),Vt(t,Sa))}));let uh=!1;const ph=new gt((t=>{uh||(uh=!0,t(pl).toSelf().inSingletonScope(),t(ih).toSelf().inSingletonScope(),t(Hl).to(pl).inSingletonScope(),t(Gl).toService(Hl))}));let gh=!1;const fh=new gt((t=>{gh||(gh=!0,t(_l).toSelf().inSingletonScope(),t($l).to(_l).inSingletonScope(),t(Gl).toService($l),t(Ta).toService(Do),Vt(t,Ta))}));let mh=!1;const yh=new gt((t=>{mh||(mh=!0,t(Kl).to(Bl).inSingletonScope(),t(Gl).toService(Kl),t(wa).toService(Do),Vt(t,wa))}));let bh=!1;const vh=new gt((t=>{bh||(bh=!0,t(Xl).to(Dl).inSingletonScope(),t(Gl).toService(Xl),t(Aa).toService(Do),Vt(t,Aa))}));var xh=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},_h=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ah=class extends rl{constructor(){super(),this.numberType=wr,this.builtinContributions=[Sl],this.init()}drawShape(t,e,i,n,s){const r=Cn(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=pa(o,l,!0),d=pa(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,d,c,d,r,s),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,d,c,d,r,s))}drawIcon(t,e,i,n,s){var r;const a=Cn(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:d=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(y-o)/2,s=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,n-s,y,b)):(e.beginPath(),Go(e,i-t,n-s,y,b,f,!0)),d&&(e.globalAlpha=u,e.fillStyle=d,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,n,o,l))}draw(t,e,i){const n=Cn(t).richtext;this._draw(t,n,!1,i)}};Ah=xh([wt(),_h("design:paramtypes",[])],Ah);let Sh=!1;const Th=new gt((t=>{Sh||(Sh=!0,t(Zl).to(Ah).inSingletonScope(),t(Gl).toService(Zl))}));let wh=!1;const Mh=new gt((t=>{wh||(wh=!0,t(Ql).to(Wl).inSingletonScope(),t(Gl).toService(Ql),t(_a).toService(Do),Vt(t,_a))}));class Bh extends rl{stroke(t,e,i,n,s){const r=n.vertices;n.edges.forEach((n=>{const a=r[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[n[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};s.beginPath(),s.moveTo(o.x,o.y,o.z),s.lineTo(h.x,h.y,h.z),s.stroke()}))}fill(t,e,i,n,s,r,a,o,l,h,c){const d=Hr.Get(r,Gr.Color255),u=n.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];n.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((n=>{const{polygon:s,normal:p}=n.polygon,g=u[s[0]],f=u[s[1]],m=u[s[2]],y=u[s[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,d):r,a.fill())}))}}var Ch=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 kh=class extends Bh{constructor(){super(...arguments),this.type="rect3d",this.numberType=Tr}drawShape(t,e,i,n,s,r,a,o){var l;const h=Cn(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:d=h.stroke,x1:u,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:u-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=ga(m,y,_,A,c),w=ma(m,v,_,A),M=da(c),B=ua(d,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=s.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,S,k,null,s,e,C,null,null,a)}!1!==d&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,S,k,e))}draw(t,e,i){const n=Cn(t).rect;this._draw(t,n,!1,i)}};kh=Ch([wt()],kh);let Ph=!1;const Oh=new gt((t=>{Ph||(Ph=!0,t(ql).to(kh).inSingletonScope(),t(Gl).toService(ql))}));var Rh=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 Lh=class extends rl{constructor(){super(...arguments),this.numberType=fr}drawShape(t,e,n,s,r,a,o,l){var h;const c=Cn(t,null==a?void 0:a.theme).arc,{fill:d=c.fill}=t.attribute,u=this.valid(t,c,o,l);if(!u)return;const{fVisible:p,sVisible:g,doFill:f,doStroke:m}=u,y=null!==(h=this.z)&&void 0!==h?h:0,{outerPadding:b=c.outerPadding,innerPadding:v=c.innerPadding,height:x=10}=t.attribute;let{outerRadius:_=c.outerRadius,innerRadius:A=c.innerRadius}=t.attribute;_+=b,A-=v;const S=Hr.Get(d,Gr.Color255),{light:T}=r.stage||{},w=r.hack_pieFace,M={top:y,bottom:y+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===w||"top"===w?(e.beginPath(),function(t,e,n,s,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=i.abs(h-l),d=h>l;let u=!1;if(a<o){const t=a;a=o,o=t}if(a<=i.epsilon)e.moveTo(n,s,r);else if(c>=i.pi2-i.epsilon)e.moveTo(n+a*i.cos(l),s+a*i.sin(l),r),e.arc(n,s,a,l,h,!d,r),o>i.epsilon&&(e.moveTo(n+o*i.cos(h),s+o*i.sin(h),r),e.arc(n,s,o,h,l,d,r));else{const{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:f,innerEndAngle:m,innerStartAngle:y}=t.getParsePadAngle(l,h),b=a*i.cos(g),v=a*i.sin(g),x=o*i.cos(m),_=o*i.sin(m);c<.001?u=!0:(e.moveTo(n+b,s+v,r),e.arc(n,s,a,g,f,!d,r)),!(o>i.epsilon)||p<.001?(e.lineTo(n+x,s+_,r),u=!0):(e.lineTo(n+x,s+_,r),e.arc(n,s,o,m,y,d,r))}e.closePath()}(t,e,n,s,M[w],_,A),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),f&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,n,s,c),e.fillStyle=T?T.computeColor(B[w],S):d,e.fill())),m&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,n,s,c),e.stroke()))):"outside"!==w&&"inside"!==w||("inside"===w&&(e.save(),e.beginPath(),e.arc(n,s,A,0,i.pi2,!0,M.top),e.clip()),e.beginPath(),function(t,e,n,s,r,a,o,l){const{startAngle:h,endAngle:c}=t.getParsedAngle(),d=i.abs(c-h),u=c>h;let p=!1;if(o<=i.epsilon)e.moveTo(n,s,r);else if(d>=i.pi2-i.epsilon)e.moveTo(n+o*i.cos(h),s+o*i.sin(h),r),e.arc(n,s,o,h,c,!u,r),e.lineTo(n+o*i.cos(c),s+o*i.sin(c),a),e.arc(n,s,o,c,h,u,a);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:g}=l(h,c),f=o*i.cos(d),m=o*i.sin(d),y=o*i.cos(g),b=o*i.sin(g);t<.001?p=!0:(e.moveTo(n+f,s+m,r),e.arc(n,s,o,d,g,!u,r),e.lineTo(n+y,s+b,a),e.arc(n,s,o,g,d,u,a))}e.closePath()}(t,e,n,s,M.top,M.bottom,"outside"===w?_:A,((e,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:s,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===w?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:s,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),f&&(o?o(e,t.attribute,c):p&&(e.setCommonStyle(t,t.attribute,n,s,c),e.fillStyle=T?T.computeColor(B[w],S):d,e.fill())),m&&(l?l(e,t.attribute,c):g&&(e.setStrokeStyle(t,t.attribute,n,s,c),e.stroke())),"inside"===w&&e.restore())}draw(t,e,i,n){const s=Cn(t,null==n?void 0:n.theme).arc;this._draw(t,s,!1,i,n)}};Lh=Rh([wt()],Lh);let Ih=!1;const Eh=new gt((t=>{Ih||(Ih=!0,t(Vl).to(Lh).inSingletonScope(),t(Gl).toService(Vl))}));var Dh=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 Fh=class extends Bh{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Ar}drawShape(t,e,i,n,s,r,a,o){var l;const h=Cn(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:d=h.stroke,face:u=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=s.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,h);let s=c;"string"!=typeof s&&(s="black"),this.fill(i,n,p,f,u,s,e,g,t,h,a)}!1!==d&&(e.setStrokeStyle(t,t.attribute,i,n,h),this.stroke(i,n,p,f,e))}draw(t,e,i){const n=Cn(t).polygon;this._draw(t,n,!1,i)}};Fh=Dh([wt()],Fh);let jh=!1;const Uh=new gt((t=>{jh||(jh=!0,t(Jl).to(Fh).inSingletonScope(),t(Gl).toService(Jl))}));class Nh{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=pt.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const s=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=s/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Wh=t=>t.zField||t.series&&t.series.some((t=>t.zField));class zh extends e.BasePlugin{constructor(){super(zh.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Wh(n),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Wh(e)&&(e.layout={type:"layout3d"})}}zh.pluginType="chart",zh.type="VChart3dPlugin";const Vh=()=>{e.registerChartPlugin(zh),rh(),oh(),nh.registerPlugin("ViewTransform3dPlugin",Nh)},Gh={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class Hh extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const Xh=Symbol.for("MathPickerContribution"),Yh=Symbol.for("MathArcPicker"),qh=Symbol.for("MathImagePicker"),$h=Symbol.for("MathLinePicker"),Kh=Symbol.for("MathRectPicker"),Zh=Symbol.for("MathSymbolPicker"),Jh=Symbol.for("MathTextPicker"),Qh=Symbol.for("MathPolygonPicker"),tc=Symbol.for("CanvasArcPicker"),ec=Symbol.for("CanvasArc3dPicker"),ic=Symbol.for("CanvasImagePicker"),nc=Symbol.for("CanvasLinePicker"),sc=Symbol.for("CanvasRectPicker"),rc=Symbol.for("CanvasRect3dPicker"),ac=Symbol.for("CanvasSymbolPicker"),oc=Symbol.for("CanvasTextPicker"),lc=Symbol.for("CanvasPolygonPicker"),hc=Symbol.for("CanvasPyramid3dPicker"),cc=Symbol.for("CanvasRichTextPicker"),dc=Symbol.for("CanvasPickerContribution");class uc{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:Oi(n,a+h,n.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),n.highPerformanceRestore(),o}}var pc=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},gc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(i,n){e(i,n,t)}};let mc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=gr}};mc=pc([wt(),fc(0,St(zl)),gc("design:paramtypes",[Object])],mc);let yc=!1;const bc=new gt(((t,e,i,n)=>{yc||(yc=!0,t(Yh).to(mc).inSingletonScope(),t(Xh).toService(Yh))}));var vc=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 xc=class{constructor(){this.type="image",this.numberType=br}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};xc=vc([wt()],xc);let _c=!1;const Ac=new gt(((t,e,i,n)=>{_c||(_c=!0,t(qh).to(xc).inSingletonScope(),t(xc).toService(qh))}));var Sc=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},Tc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wc=function(t,e){return function(i,n){e(i,n,t)}};let Mc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=vr}};Mc=Sc([wt(),wc(0,St(Hl)),Tc("design:paramtypes",[Object])],Mc);let Bc=!1;const Cc=new gt(((t,e,i,n)=>{Bc||(Bc=!0,t($h).to(Mc).inSingletonScope(),t(Xh).toService($h))}));var kc=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},Pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oc=function(t,e){return function(i,n){e(i,n,t)}};let Rc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=_r}};Rc=kc([wt(),Oc(0,St(Xl)),Pc("design:paramtypes",[Object])],Rc);let Lc=!1;const Ic=new gt(((t,e,i,n)=>{Lc||(Lc=!0,t(Qh).to(Rc).inSingletonScope(),t(Xh).toService(Qh))})),Ec=new i.AABBBounds;class Dc{constructor(){this.type="rect",this.numberType=Sr}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=n?n:{};if(!s)return!1;const r=t.getGraphicTheme(),{cornerRadius:a=r.cornerRadius}=t.attribute;let{x:o=r.x,y:l=r.y}=t.attribute;s.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,l+=e.y,s.setTransformForCurrent()}else o=0,l=0,h=!1,s.transformFromMatrix(t.transMatrix,!0);let c=!0;if(!h||t.shadowRoot||i.isNumber(a,!0)&&0!==a||i.isArray(a)&&a.some((t=>0!==t)))c=!1,this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,i,n)=>!!c||(c=t.isPointInPath(e.x,e.y),c)),((t,i,n)=>{if(c)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,o=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=o?r+a:Oi(s,r+a,s.dpr),c=t.isPointInStroke(e.x,e.y),c}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)c=!0;else if(n){const i=t.AABBBounds;Ec.setValue(i.x1,i.y1,i.x2,i.y2),Ec.expand(-s/2),c=!Ec.containsPoint(e)}}return s.highPerformanceRestore(),c}}var Fc=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},jc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uc=function(t,e){return function(i,n){e(i,n,t)}};let Nc=class extends Dc{constructor(t){super(),this.canvasRenderer=t}};Nc=Fc([wt(),Uc(0,St(Yl)),jc("design:paramtypes",[Object])],Nc);let Wc=!1;const zc=new gt(((t,e,i,n)=>{Wc||(Wc=!0,t(Kh).to(Nc).inSingletonScope(),t(Xh).toService(Kh))}));let Vc=!1;const Gc=new gt(((t,e,i,n)=>{Vc||(Vc=!0,t(qh).to(xc).inSingletonScope(),t(xc).toService(qh))}));var Hc=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},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yc=function(t,e){return function(i,n){e(i,n,t)}};let qc=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Mr}};qc=Hc([wt(),Yc(0,St($l)),Xc("design:paramtypes",[Object])],qc);let $c=!1;const Kc=new gt(((t,e,i,n)=>{$c||($c=!0,t(Zh).to(qc).inSingletonScope(),t(Xh).toService(Zh))}));var Zc=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 Jc=class{constructor(){this.type="text",this.numberType=Br}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Jc=Zc([wt()],Jc);let Qc=!1;const td=new gt(((t,e,i,n)=>{Qc||(Qc=!0,t(Jh).to(Jc).inSingletonScope(),t(Xh).toService(Jh))}));var ed=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},id=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nd=function(t,e){return function(i,n){e(i,n,t)}};let sd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=gr}};sd=ed([wt(),nd(0,St(zl)),id("design:paramtypes",[Object])],sd);let rd=!1;const ad=new gt(((t,e,i,n)=>{rd||(rd=!0,t(tc).to(sd).inSingletonScope(),t(dc).toService(tc))}));var od=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},ld=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hd=function(t,e){return function(i,n){e(i,n,t)}};let cd=class extends Dc{constructor(t){super(),this.canvasRenderer=t}};cd=od([wt(),hd(0,St(Yl)),ld("design:paramtypes",[Object])],cd);let dd=!1;const ud=new gt(((t,e,i,n)=>{dd||(dd=!0,t(sc).to(cd).inSingletonScope(),t(dc).toService(sc))}));class pd extends rl{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 d=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!d||(d=t.isPointInPath(c.x,c.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:Oi(n,s+r,n.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==h&&jr.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),d}}var gd=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},fd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},md=function(t,e){return function(i,n){e(i,n,t)}};let yd=class extends pd{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=vr}};yd=gd([wt(),md(0,St(Hl)),fd("design:paramtypes",[Object])],yd);let bd=!1;const vd=new gt(((t,e,i,n)=>{bd||(bd=!0,t(nc).to(yd).inSingletonScope(),t(dc).toService(nc))}));class xd extends rl{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 d=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,n.modelMatrix!==h&&jr.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),d}}var _d=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},Ad=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sd=function(t,e){return function(i,n){e(i,n,t)}};let Td=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Mr}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 d=e;if(n.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.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:Oi(n,s+r,n.dpr),u=t.isPointInStroke(d.x,d.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==c&&jr.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),u}};Td=_d([wt(),Sd(0,St($l)),Ad("design:paramtypes",[Object])],Td);let wd=!1;const Md=new gt(((t,e,i,n)=>{wd||(wd=!0,t(ac).to(Td).inSingletonScope(),t(dc).toService(ac))}));var Bd=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},Cd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kd=function(t,e){return function(i,n){e(i,n,t)}};let Pd=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Br}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.AABBBounds;if(!n.camera)return!!s.containsPoint(e);n.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,n,o),{x:h,y:c,z:d,lastModelMatrix:u}=l;this.canvasRenderer.z=d;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,n,h,c,{},null,((e,i,n)=>{if(g)return!0;const{fontSize:s=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),f=l.width(),m=Ca(a,u,s),y=Ba(o,f);return e.rect(y+h,m+c,f,u,d),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,n.modelMatrix!==u&&jr.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),g}};Pd=Bd([wt(),kd(0,St(Kl)),Cd("design:paramtypes",[Object])],Pd);let Od=!1;const Rd=new gt(((t,e,i,n)=>{Od||(Od=!0,t(oc).to(Pd).inSingletonScope(),t(dc).toService(oc))}));var Ld=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},Id=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ed=function(t,e){return function(i,n){e(i,n,t)}};let Dd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=_r}};Dd=Ld([wt(),Ed(0,St(Xl)),Id("design:paramtypes",[Object])],Dd);let Fd=!1;const jd=new gt(((t,e,i,n)=>{Fd||(Fd=!0,t(lc).to(Dd).inSingletonScope(),t(dc).toService(lc))}));var Ud=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},Nd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wd=function(t,e){return function(i,n){e(i,n,t)}};let zd=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=wr}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};zd=Ud([wt(),Wd(0,St(Zl)),Nd("design:paramtypes",[Object])],zd);let Vd=!1;const Gd=new gt(((t,e,i,n)=>{Vd||(Vd=!0,t(cc).to(zd).inSingletonScope(),t(dc).toService(cc))}));var Hd=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},Xd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yd=function(t,e){return function(i,n){e(i,n,t)}};let qd=class extends uc{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=br}};qd=Hd([wt(),Yd(0,St(Ql)),Xd("design:paramtypes",[Object])],qd);let $d=!1;const Kd=new gt(((t,e,i,n)=>{$d||($d=!0,t(ic).to(qd).inSingletonScope(),t(dc).toService(ic))}));var Zd=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},Jd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qd=function(t,e){return function(i,n){e(i,n,t)}};let tu=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Tr,this.themeType="rect"}};tu=Zd([wt(),Qd(0,St(ql)),Jd("design:paramtypes",[Object])],tu);let eu=!1;const iu=new gt(((t,e,i,n)=>{eu||(eu=!0,t(rc).to(tu).inSingletonScope(),t(dc).toService(rc))}));var nu=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},su=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ru=function(t,e){return function(i,n){e(i,n,t)}};let au=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=fr,this.themeType="arc"}};au=nu([wt(),ru(0,St(Vl)),su("design:paramtypes",[Object])],au);let ou=!1;const lu=new gt(((t,e,i,n)=>{ou||(ou=!0,t(ec).to(au).inSingletonScope(),t(dc).toService(ec))}));var hu=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},cu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},du=function(t,e){return function(i,n){e(i,n,t)}};let uu=class extends xd{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Ar,this.themeType="polygon"}};uu=hu([wt(),du(0,St(Jl)),cu("design:paramtypes",[Object])],uu);let pu=!1;const gu=new gt(((t,e,i,n)=>{pu||(pu=!0,t(hc).to(uu).inSingletonScope(),t(dc).toService(hc))})),fu=function(){!function(){if(null==eh)try{const t=document.createElement("canvas"),e=t.getContext("2d");eh=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),eh&&(eh=!!document.createElement)}catch(t){eh=!1}}();const t=Xt.global&&Xt.global.env;return t?"browser"===t:eh}();function mu(){mu.__loaded||(mu.__loaded=!0,Co.RegisterGraphicCreator("arc",bo),Vi.load(hh),Vi.load(fu?ad:bc))}mu.__loaded=!1;const yu=mu;function bu(){bu.__loaded||(bu.__loaded=!0,Co.RegisterGraphicCreator("arc3d",xo),rh(),oh(),Vi.load(Eh),Vi.load(lu))}bu.__loaded=!1;const vu=bu;function xu(){xu.__loaded||(xu.__loaded=!0,Co.RegisterGraphicCreator("group",ca))}xu.__loaded=!1;const _u=xu;function Au(){Au.__loaded||(Au.__loaded=!0,Co.RegisterGraphicCreator("image",io),Vi.load(Mh),Vi.load(fu?Kd:Ac))}Au.__loaded=!1;const Su=Au;function Tu(){Tu.__loaded||(Tu.__loaded=!0,Co.RegisterGraphicCreator("line",Ga),Vi.load(ph),Vi.load(fu?vd:Cc))}Tu.__loaded=!1;const wu=Tu;function Mu(){Mu.__loaded||(Mu.__loaded=!0,Co.RegisterGraphicCreator("polygon",So),Vi.load(vh),Vi.load(fu?jd:Ic))}Mu.__loaded=!1;const Bu=Mu;function Cu(){Cu.__loaded||(Cu.__loaded=!0,Co.RegisterGraphicCreator("pyramid3d",wo),rh(),oh(),Vi.load(Uh),Vi.load(gu))}Cu.__loaded=!1;const ku=Cu;function Pu(){Pu.__loaded||(Pu.__loaded=!0,Co.RegisterGraphicCreator("rect",Ya),Vi.load(dh),Vi.load(fu?ud:zc))}Pu.__loaded=!1;const Ou=Pu;function Ru(){Ru.__loaded||(Ru.__loaded=!0,Co.RegisterGraphicCreator("rect3d",Ka),Vi.load(Oh),Vi.load(iu))}Ru.__loaded=!1;const Lu=Ru;function Iu(){Iu.__loaded||(Iu.__loaded=!0,Co.RegisterGraphicCreator("richtext",ho),Vi.load(Th),Vi.load(fu?Gd:Gc))}Iu.__loaded=!1;const Eu=Iu;function Du(){Du.__loaded||(Du.__loaded=!0,Co.RegisterGraphicCreator("shadowRoot",Bo))}Du.__loaded=!1;const Fu=Du;function ju(){ju.__loaded||(ju.__loaded=!0,Co.RegisterGraphicCreator("symbol",Wa),Vi.load(fh),Vi.load(fu?Md:Kc))}ju.__loaded=!1;const Uu=ju;function Nu(){Nu.__loaded||(Nu.__loaded=!0,Co.RegisterGraphicCreator("text",ja),Vi.load(yh),Vi.load(fu?Rd:td))}Nu.__loaded=!1;const Wu=Nu;class zu extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=zu.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}zu.type="rect3d";const Vu=()=>{e.Factory.registerMark(zu.type,zu),Fu(),Lu(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",Ka)};class Gu extends e.BarSeries{constructor(){super(...arguments),this.type=ct.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=Hh}}Gu.type=ct.bar3d,Gu.mark=Gh,Gu.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},Gu.transformerConstructor=Hh;const Hu=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),Vu(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Gu.type,Gu)};class Xu extends e.Layout{layoutItems(t,i,n,s){this._layoutInit(t,i,n,s);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:d,relativeOverlapItems:u,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,d,u,g,r),this._processAutoIndent(c,d,u,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=d.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=d.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const n=m.getLayoutRect(),s=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:s.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();s?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}Xu.type="layout3d";const Yu=()=>{e.Factory.registerLayout(Xu.type,Xu)};class qu extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=ot,this.type="bar3d",this.seriesType=ct.bar3d}}qu.type="bar3d",qu.seriesType=ct.bar3d,qu.transformerConstructor=ot;const $u=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class Ku extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class Zu extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=Zu.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}Zu.type="pyramid3d";const Ju=e.getFunnelTheme(!0);class Qu extends e.FunnelSeries{constructor(){super(...arguments),this.type=ct.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=Ku}initMark(){var t,e,i,n,s,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Qu.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Qu.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(s=this._spec.outerLabel)&&void 0!==s?s:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(Qu.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(Qu.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,n;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}Qu.type=ct.funnel3d,Qu.mark=$u,Qu.builtInTheme={funnel3d:Ju},Qu.transformerConstructor=Ku;const tp=()=>{e.Factory.registerMark(Zu.type,Zu),Fu(),ku(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",wo),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(Qu.type,Qu)};class ep extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=ct.funnel3d}}ep.type="funnel3d",ep.seriesType=ct.funnel3d,ep.transformerConstructor=e.FunnelChartSpecTransformer;class ip extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=ct.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ip.type="histogram3d",ip.seriesType=ct.bar3d,ip.transformerConstructor=e.HistogramChartSpecTransformer;class np extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class sp extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=sp.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}sp.type="arc3d";const rp=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class ap extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class op extends e.BasePieSeries{constructor(){super(...arguments),this.type=ct.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=ap}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}op.type=ct.pie3d,op.mark=rp,op.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},op.transformerConstructor=ap;const lp=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),Fu(),vu(),e.Factory.registerGraphicComponent("arc3d",xo),e.Factory.registerMark("arc3d",sp),e.Factory.registerSeries(op.type,op)};class hp extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=np,this.type="pie3d",this.seriesType=ct.pie3d}}hp.type="pie3d",hp.seriesType=ct.pie3d,hp.transformerConstructor=np;class cp{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-cp.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*cp.bounceIn(2*t):.5*cp.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-s)*i.pi2/e)+1}}static getElasticInOut(t,e){return function(n){const s=e/i.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-s)*i.pi2/e)*.5+1}}static registerFunc(t,e){cp[t]=e}}function dp(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}cp.quadIn=cp.getPowIn(2),cp.quadOut=cp.getPowOut(2),cp.quadInOut=cp.getPowInOut(2),cp.cubicIn=cp.getPowIn(3),cp.cubicOut=cp.getPowOut(3),cp.cubicInOut=cp.getPowInOut(3),cp.quartIn=cp.getPowIn(4),cp.quartOut=cp.getPowOut(4),cp.quartInOut=cp.getPowInOut(4),cp.quintIn=cp.getPowIn(5),cp.quintOut=cp.getPowOut(5),cp.quintInOut=cp.getPowInOut(5),cp.backIn=cp.getBackIn(1.7),cp.backOut=cp.getBackOut(1.7),cp.backInOut=cp.getBackInOut(1.7),cp.elasticIn=cp.getElasticIn(1,.3),cp.elasticOut=cp.getElasticOut(1,.3),cp.elasticInOut=cp.getElasticInOut(1,.3*1.5),cp.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),cp.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},cp.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++)cp[`flicker${t}`]=e=>dp(e,t);for(let t=2;t<10;t++)cp[`aIn${t}`]=e=>t*e*e+(1-t)*e;function up(t,e,i){return t+(e-t)*i}const pp=new class{constructor(){this.opacity=(t,e,i,n,s,r)=>{r.attribute.opacity=up(e,i,n)},this.baseOpacity=(t,e,i,n,s,r)=>{r.attribute.baseOpacity=up(e,i,n)},this.fillOpacity=(t,e,i,n,s,r)=>{r.attribute.fillOpacity=up(e,i,n)},this.strokeOpacity=(t,e,i,n,s,r)=>{r.attribute.strokeOpacity=up(e,i,n)},this.zIndex=(t,e,i,n,s,r)=>{r.attribute.zIndex=up(e,i,n)},this.backgroundOpacity=(t,e,i,n,s,r)=>{r.attribute.backgroundOpacity=up(e,i,n)},this.shadowOffsetX=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetX=up(e,i,n)},this.shadowOffsetY=(t,e,i,n,s,r)=>{r.attribute.shadowOffsetY=up(e,i,n)},this.shadowBlur=(t,e,i,n,s,r)=>{r.attribute.shadowBlur=up(e,i,n)},this.fill=(t,e,i,n,s,r)=>{r.attribute.fill=Yr(e,i,n,!1)},this.fillPure=(t,e,i,n,s,r)=>{r.attribute.fill=s.fromParsedProps.fill?$r(s.fromParsedProps.fill,s.toParsedProps.fill,n):s.toParsedProps.fill},this.stroke=(t,e,i,n,s,r)=>{r.attribute.stroke=Yr(e,i,n,!1)},this.strokePure=(t,e,i,n,s,r)=>{r.attribute.stroke=s.fromParsedProps.stroke?$r(s.fromParsedProps.stroke,s.toParsedProps.stroke,n):s.toParsedProps.stroke},this.width=(t,e,i,n,s,r)=>{r.attribute.width=up(e,i,n),r.addUpdateBoundTag()},this.height=(t,e,i,n,s,r)=>{r.attribute.height=up(e,i,n),r.addUpdateBoundTag()},this.x=(t,e,i,n,s,r)=>{r.attribute.x=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,n,s,r)=>{r.attribute.y=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,n,s,r)=>{r.attribute.angle=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,n,s,r)=>{r.attribute.scaleX=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,n,s,r)=>{r.attribute.scaleY=up(e,i,n),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,n,s,r)=>{r.attribute.lineWidth=up(e,i,n),r.addUpdateBoundTag()},this.startAngle=(t,e,i,n,s,r)=>{r.attribute.startAngle=up(e,i,n),r.addUpdateBoundTag()},this.endAngle=(t,e,i,n,s,r)=>{r.attribute.endAngle=up(e,i,n),r.addUpdateBoundTag()},this.radius=(t,e,i,n,s,r)=>{r.attribute.radius=up(e,i,n),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,n,s,r)=>{r.attribute.outerRadius=up(e,i,n),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,n,s,r)=>{r.attribute.innerRadius=up(e,i,n),r.addUpdateBoundTag()},this.size=(t,e,i,n,s,r)=>{r.attribute.size=up(e,i,n),r.addUpdateBoundTag()},this.points=(t,e,i,n,s,r)=>{r.attribute.points=Gn(e,i,n),r.addUpdateBoundTag()}}};function gp(t,e,i,n,s,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*n,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const s=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*n;if(!Number.isFinite(o)){a=!1;break}s.push(o)}return a&&(r.attribute[t]=s),!0}return!1}function fp(){}class mp{constructor(t,e,i,n){this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=n?"function"==typeof n?n:cp[n]:cp.linear,"wait"===t&&(this.onUpdate=fp),this.id=pt.GenAutoIncrementId(),this.syncAttributeUpdate=fp}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const n=this.fromProps[e],s=this.props[e];if(i.isString(n)&&i.isString(s)){const i=Hr.Get(n,Gr.Color255),r=Hr.Get(s,Gr.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=i,this.toParsedProps[e]=r,t.push(pp["fill"===e?"fillPure":"strokePure"])}else pp[e]?t.push(pp[e]):t.push(gp)}else pp[e]?t.push(pp[e]):t.push(gp)})),this.interpolateUpdateFunctions=t}setStartTime(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,n,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],n,this,this.target)})),this.onUpdate(t,n,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class yp extends mp{constructor(t,e,i,n){super(t,e,i,n)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class bp extends i.EventEmitter{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this.id=pt.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const n=e.next;t(e.animate,i),i++,e=n}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===Kt.END?this.removeAnimate(t,!0):t.status!==Kt.RUNNING&&t.status!==Kt.INITIAL||t.advance(e)})),0===this._animateCount&&this.emit("animationEnd")}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const vp=new bp;vp.isGlobal=!0;class xp{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:vp,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.status=Kt.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new mp($t.to,t,e,i);return n.bind(this.target,this),this.updateStepAfterAppend(n),this}wait(t){const e=new yp($t.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear";const n=new mp($t.from,t,e,i);return this._firstStep?(this._lastStep.append(n),this._lastStep=n):(this._firstStep=n,this._lastStep=n),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===Kt.RUNNING&&(this.status=Kt.PAUSED)}resume(){this.status===Kt.PAUSED&&(this.status=Kt.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,n,s,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==Kt.END&&this.onEnd(),this.status=Kt.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=Kt.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,n;if(this.status===Kt.END)return void console.warn("aaa 动画已经结束,不能推进");const s=this.currentTime+t;if(s<this._startTime)return void(this.currentTime=s);if(s>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=Kt.END);this.status=Kt.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=s;let r=s-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(s-this._startTime)%this._duration;const t=Math.floor((s-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(n=this.lastRunStep)||void 0===n||n.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const _p=new class{constructor(){this.nextAnimationFrameCbs=[],this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=[];for(let i=0;i<e.length;i++)e[i]&&e[i](t)},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.length&&(this._rafHandle=Xt.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.push(t),this.tryRunAnimationFrameNextFrame(),this.nextAnimationFrameCbs.length-1}removeAnimationFrameCb(t){return t>=0&&t<this.nextAnimationFrameCbs.length&&(this.nextAnimationFrameCbs[t]=null,!0)}};class Ap{constructor(){this.released=!1}tick(t,e){_p.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Sp extends i.EventEmitter{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const n=t.getTime();this._lastTickTime=n,this.lastFrameTime<0&&(this.lastFrameTime=n-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const s=n-this.lastFrameTime,r=this.checkSkip(s);return r||(this._handlerTick(s),this.lastFrameTime=n,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===qt.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=qt.INITIAL,Xt.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler()})),Xt.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(){this.setupTickHandler()}setupTickHandler(){const t=new Ap;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>this.handleTick(t,{once:!0})))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==qt.INITIAL&&(this.status=qt.PAUSE,!0)}resume(){return this.status!==qt.INITIAL&&(this.status=qt.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===qt.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===qt.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=qt.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=qt.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}trySyncTickStatus(){this.status===qt.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===qt.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){return"performance"!==this.stage.params.optimize.tickRenderMode&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Tp{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Tp.instance||(Tp.instance=new Tp),Tp.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var n,s,r,a;let o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get(e);return o?o(i,t):(o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let n=this.transitions.get(t);n||(n=new Map,this.transitions.set(t,n)),n.set(e,i)}}Tp.getInstance();class wp{static registerBuiltInAnimate(t,e){wp.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,n){var s,r;const a=this.resolveValue(t.totalTime,void 0,void 0),o=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=o,l.totalTime=a;const h=this.resolveValue(t.oneByOne,n,!1);if(e){const t=l.timeSlices;i.isArray(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const i=this.resolveValue(t.delay,n,0),s=this.resolveValue(t.delayAfter,n,0),r=this.resolveValue(t.duration,n,300);return e+=i+r+s,Object.assign(Object.assign({},t),{delay:i,delayAfter:s,duration:r})}));let s=0;h&&(s="number"==typeof h?h:h?e:0),l.oneByOneDelay=s;let r=1;if(a){const t=e+s*(this._target.count-2);r=a?a/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*r,delayAfter:t.delayAfter*r,duration:t.duration*r,effects:e.map((t=>{var e,n;const s=null!==(e=t.custom)&&void 0!==e?e:wp.builtInAnimateMap[null!==(n=t.type)&&void 0!==n?n:"fromTo"],r=s&&i.isFunction(s)?/^class\s/.test(Function.prototype.toString.call(s))?1:2:0;return Object.assign(Object.assign({},t),{custom:s,customType:r})}))})})),l.oneByOneDelay=s*r,l.startTime=o*r}else{const e=this.resolveValue(t.delay,n,0),c=this.resolveValue(t.delayAfter,n,0),d=this.resolveValue(t.duration,n,300);let u=0;h&&(u="number"==typeof h?h:h?e+c+d:0),l.oneByOneDelay=u,l.custom=null!==(s=t.custom)&&void 0!==s?s:wp.builtInAnimateMap[null!==(r=t.type)&&void 0!==r?r:"fromTo"];const p=l.custom&&i.isFunction(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,a){const t=e+c+d+u*(this._target.count-2),i=a?a/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=d*i,l.oneByOneDelay=u*i,l.startTime=o}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,n;return t.partitioner(null===(n=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===n?void 0:n[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var n,s,r,a;return t.sort(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const n=e?(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,n,s);a&&this._trackAnimation(a)}:(i,n,s)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,n,s);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>n(t,e,i.length))):this._target.count<=1?n(this._target,0,1):this._target.forEachChildren(((t,e)=>n(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,n,s){var r,a,o,l,h,c,d,u;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=i.isFunction(y)?y(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):y,O=null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(n=null!==(c=O[R])&&void 0!==c?c:n),k.startAt(x);const L=n*_+P;L>0&&k.wait(L);let I=null,E=t.to,D=t.from;E||(I||(I=this.createPropsFromChannel(g,e)),E=I.props),D||(I||(I=this.createPropsFromChannel(g,e)),D=I.from),this._handleRunAnimate(k,M,B,D,E,v,m,f,C,w,p,e);let F=0;_&&(F=_*(s-n-1));const j=i.isFunction(b)?b(null===(u=null===(d=e.context)||void 0===d?void 0:d.data)||void 0===u?void 0:u[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,n,s,r,a,o,l,h,c,d,u){var p,g,f,m;if(e&&n){const d=this.resolveValue(l,u,{}),y=i.isFunction(c)?c.call(null,null!==(g=d&&(null===(p=d.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=u.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],u,d):c;d.options=y,d.controlOptions=h,1===n?this.createCustomAnimation(t,e,s,r,a,o,d):2===n&&this.createCustomInterpolatorAnimation(t,e,r,a,o,d)}else"to"===d?t.to(r,a,o):"from"===d&&t.from(r,a,o)}executeTimelineItem(t,e,i,n){var s,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:d,oneByOneDelay:u,priority:p,controlOptions:g}=t,f=null===(r=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*u),c&&c>0&&y.loop(c),d&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),u&&y.wait(u*(n-i-1)),y}applyTimeSliceToAnimate(t,e,n,s){var r,a,o,l;const{effects:h,duration:c=300,delay:d=0,delayAfter:u=0}=t,p=i.isFunction(d)?d(null===(a=null===(r=n.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],n,{}):d,g=i.isFunction(u)?u(null===(l=null===(o=n.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],n,{}):u;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var i;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let d=null,u=t.to,p=t.from;u||(d||(d=this.createPropsFromChannel(a,n)),u=d.props),p||(d||(d=this.createPropsFromChannel(a,n)),p=d.from);const g=null!==(i=t.custom)&&void 0!==i?i:wp.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,u,c,l,o,s,h,r,n)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,n,s,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,n,s,a,o)=>{e(s,i,n,a,o,t.target,r)},t.to(i,n,s)}createCustomAnimation(t,e,i,n,s,r,a){const o=new e(i,n,s,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let n=null;return t?(Array.isArray(t)?t.forEach((t=>{var n,s;const r=null===(s=null===(n=e.context)||void 0===n?void 0:n.diffAttrs)||void 0===s?void 0:s[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((s=>{var r,a,o,l;const h=t[s];void 0!==h.to&&("function"==typeof h.to?i[s]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[s]=h.to),void 0!==h.from&&(n||(n={}),"function"==typeof h.from?n[s]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):n[s]=h.from)})),{from:n,props:i}):{from:n,props:i}}resolveValue(t,e,i){var n,s;return void 0===t?i:"function"==typeof t&&e?t(null===(s=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===s?void 0:s[0],e,{}):t}executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,n))).filter(Boolean):[this._executeItem(t,e,i,n)].filter(Boolean)}_executeItem(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;const s="timeSlices"in t;let r=null;const a=this.parseParams(t,s);return r=s?this.executeTimelineItem(a,e,i,n):this.executeTypeConfigItem(a,e,i,n),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}wp.builtInAnimateMap={};const Mp="appear",Bp="disappear",Cp="update",kp="highlight",Pp="unhighlight";class Op{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Rp{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,n){const s=Tp.getInstance(),r=[],a=[];if(this.stateList&&this.stateList.length?t.forEach(((t,n)=>{const o={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=s.isTransitionAllowed(e.state,t,this.graphic);o.allowTransition=o.allowTransition&&i.allowTransition})),o.allowTransition&&(a.push({state:t,animationConfig:i.isArray(e[n])?e[n].map((t=>t.animation)):e[n].animation,executor:new wp(this.graphic)}),this.stateList.forEach((e=>{s.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&r.push(e)})))})):t.forEach(((t,n)=>{a.push({state:t,animationConfig:i.isArray(e[n])?e[n].map((t=>t.animation)):e[n].animation,executor:new wp(this.graphic)})})),r.forEach((t=>{t.executor.stop()})),a.length){a[0].executor.execute(a[0].animationConfig);for(let t=0;t<a.length;t++){const e=a[t+1],i=a[t];i.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==i)),t===a.length-1&&n&&n(!1)}))}}else n&&n(!0);this.stateList?this.stateList=this.stateList.filter((t=>!r.includes(t))):this.stateList=[],this.stateList.push(...a)}applyAppearState(t,e){this.applyState([Mp],[{name:Mp,animation:t}],e)}applyDisappearState(t,e){this.applyState([Bp],[{name:Bp,animation:t}],e)}applyUpdateState(t,e){this.applyState([Cp],[{name:Cp,animation:t}],e)}applyHighlightState(t,e){this.applyState([kp],[{name:kp,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Pp],[{name:Pp,animation:t}],e)}stopState(t,e){var i;const n=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));n&&n.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}}class Lp{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Rp(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Op(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e){return this._getAnimationStateManager(this).stopState(t,e),this}clearAnimationStates(){return this._getAnimationStateManager(this).clearState(),this}static extend(t){return(new Lp)._getAnimationStateManager(t),t}}class Ip{getAttributes(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,n;this.animates||(this.animates=new Map);const s=new xp(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:vp,null==t?void 0:t.slience);if(s.bind(this),t){const{onStart:e,onEnd:i,onRemove:n}=t;null!=e&&s.onStart(e),null!=i&&s.onEnd(i),null!=n&&s.onRemove(n)}return this.animates.set(s.id,s),s.onRemove((()=>{s.stop(),this.animates.delete(s.id)})),null===(n=this.stage)||void 0===n||n.ticker.start(),s}createTimeline(){return new bp}createTicker(t){return new Sp(t)}setFinalAttribute(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttribute(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new wp(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t){return!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}}function Ep(){i.mixin(oa,Lp),i.mixin(oa,Ip)}class Dp extends mp{constructor(t,e,i,n,s){super("customAnimate",e,i,n),this.type="customAnimate",this.customFrom=t,this.params=s}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const n=this.easing(e);this.onUpdate(t,n,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Fp extends Dp{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,n=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),a=Math.acos((s-t.y)/e);let o=Math.acos((n-t.x)/e/Math.sin(a));r-t.z<0&&(o=i.pi2-o),this.theta=o,this.phi=a}onBind(){super.onBind()}onEnd(){}onUpdate(t,e,n){if(null==this.phi||null==this.theta)return;const{center:s,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+s.x,d=r*Math.cos(h)+s.y,u=r*Math.sin(h)*Math.sin(l)+s.z;for(n.x=c,n.y=d,n.z=u,n.alpha=l+i.pi/2;n.alpha>i.pi2;)n.alpha-=i.pi2;n.alpha=i.pi2-n.alpha,n.zIndex=-1e4*n.z,a&&a(n)}}const jp=t=>({custom:Fp,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Up extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=ct.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const n=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-n.left||0-n.right||0,s=e.height-n.top||0-n.bottom||0,r=Math.max(i,s)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Up.type=ct.wordCloud3d,Up.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Np=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({enter:jp(t)}))),e.Factory.registerSeries(Up.type,Up)},Wp=()=>{Np()};class zp extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class Vp extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=zp,this.type="wordCloud3d",this.seriesType=ct.wordCloud3d}}Vp.type="wordCloud3d",Vp.seriesType=ct.wordCloud3d,Vp.transformerConstructor=zp;const Gp=()=>{Vh(),Np(),e.Factory.registerChart(Vp.type,Vp)},Hp=(t,i)=>{var n;const s=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),d={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()};i||(d.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:s.height});const u=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===u&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),d.z=f,d.alpha=g,d.anchor3d=p,d},Xp={label:{space:0}};class Yp extends e.CartesianBandAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Yp.builtInTheme=Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),Xp)}),i.mixin(Yp,e.BandAxisMixin);class qp extends e.CartesianLinearAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){if(!e.isZAxis(this._orient)){const e=super._getUpdateAttribute(t);return t||(e.grid.depth=this.layout3dBox?this.layout3dBox.length:0),e}return Hp(this,t)}}qp.builtInTheme=Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),Xp)}),i.mixin(qp,e.LinearAxisMixin);class $p extends e.CartesianLogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}$p.builtInTheme=Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),Xp)}),i.mixin($p,e.LinearAxisMixin);class Kp extends e.CartesianSymlogAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Kp.builtInTheme=Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianSymlogAxis.builtInTheme.axisX),Xp)}),i.mixin(Kp,e.LinearAxisMixin);class Zp extends e.CartesianTimeAxis{setLayout3dBox(t){this.layout3dBox=t}_getUpdateAttribute(t){return e.isZAxis(this._orient)?Hp(this,t):super._getUpdateAttribute(t)}}Zp.builtInTheme=Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianTimeAxis.builtInTheme.axisX),Xp)}),i.mixin(Zp,e.LinearAxisMixin);const Jp=Object.assign(Object.assign({},Gh),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Qp extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=ct.rangeColumn3d,this._barMarkType="rect3d",this._barName=ct.bar3d}}Qp.type=ct.rangeColumn3d,Qp.mark=Jp;const tg=()=>{Vu(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Qp.type,Qp)};class eg extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class ig extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class ng extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=ig,this.type="rangeColumn3d",this.seriesType=ct.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ng.type="rangeColumn3d",ng.seriesType=ct.rangeColumn3d,ng.transformerConstructor=ig;const sg="pictogram",rg="pictogram";var ag;!function(t){t.pictogram="pictogram"}(ag||(ag={}));const og=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class lg extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===rg}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const hg=new Map;let cg;function dg(t,i){hg.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),cg||(cg=new R,e.registerDataSetInstanceParser(cg,"svg",S));const n=new L(cg);n.parse(i,{type:"svg"}),hg.set(t,n)}function ug(t){hg.has(t)?hg.delete(t):e.warn(`map type of '${t}' does not exists.`)}function pg(t){return hg.get(t)}class gg extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,n,s;const r=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},a=t.svg,o=null===(s=null===(n=hg.get(a))||void 0===n?void 0:n.latestData)||void 0===s?void 0:s.elements;if(o&&o.length){o.map((t=>t.name)).filter((t=>i.isValid(t))).forEach((e=>{t[e]&&(r[e]=t[e])}))}return r}}class fg extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const mg="element-highlight-by-graphic-name";class yg extends e.ElementHighlight{constructor(){super(...arguments),this.type=mg,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(i.isNil(t))return;const{interaction:e,highlightState:n,blurState:s}=this.options,r=e.getStatedGraphics(this),a=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&a.push(e)}))})),e.updateStates(this,a,r,n,s),e.setStatedGraphics(this,a)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}yg.type=mg;const bg="element-select-by-graphic-name";class vg extends e.ElementSelect{constructor(){super(...arguments),this.type=bg}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}vg.type=bg;function xg(t){var e;return i.isValid(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const _g=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&xg(i)?1:0},Ag=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&xg(n)?n:void 0},Sg=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!xg(n))&&n},Tg=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Ag(t),lineWidth:_g(t),stroke:Sg(t)}),wg={group:t=>{const e=Tg(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Tg(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Tg(t)),{fill:Ag(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Tg(t)),{fill:Ag(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Tg(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Tg(t)),{path:t.d,fillStrokeOrder:!1,fill:Ag(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Tg(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Ag(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},Tg(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:Ag(t,"#000")})}},Mg=t=>{var n,s;if(!t||!t[0])return{};const{elements:r}=t[0].latestData;if(r&&r.length){r.forEach(((t,n)=>{var s;t[e.DEFAULT_DATA_INDEX]=n,t._uniqueId=`${t.id}-${n}`,t.data=void 0;const{graphicType:r,transform:a}=t,o={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?i.merge(o,t._inheritStyle,null===(s=t.parent)||void 0===s?void 0:s._textGroupStyle,t.attributes):"group"!==t.graphicType&&i.merge(o,t._inheritStyle,t.attributes),wg[r]?t._finalAttributes=wg[r](o,t.value):t._finalAttributes=o,a&&(t._finalAttributes.postMatrix=Object.assign({},a))}));const t=r.filter((t=>"text"===t.tagName));for(let i=0;i<t.length;i++){const a=t[i]._uniqueId,o=r.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const r=null!==(s=null===(n=t[i]._textGroupStyle)||void 0===n?void 0:n.x)&&void 0!==s?s:0;let a=r;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=r;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return r};class Bg extends e.GeoSeries{constructor(){super(...arguments),this.type=rg,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=pg(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const n="multiple"===t.mode,s=i.isValid(t.triggerOff)?t.triggerOff:n?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:s,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:n}}initMark(){var t;if(this._pictogramMark=this._createMark(Bg.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Bg.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Bg.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:s,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:n,name:null!=s?s:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Bg.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(Bg.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:n}=this._parsedSvgResult,s=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,wg.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),n&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[Ya(Object.assign(Object.assign({},n),{fill:!0}))]}));for(const t of s){const{_uniqueId:n,_finalAttributes:s}=t,r=this._idToMark.get(n),a=this._validElement(t);r&&(this.setMarkStyle(r,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),a?(this.initMarkStyleWithSpec(r,i.merge({},this._spec.pictogram,this._spec[r.name])),this.setMarkStyle(r,s,"normal",e.AttributeLevel.Series),r.setPostProcess("fill",((t,e)=>i.isValid(t)?t:this._spec.defaultFillColor))):(r.setMarkConfig({interactive:!1}),this.setMarkStyle(r,s,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new fg(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const n=t[this.nameField];if(!n)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===n));if(!s||0===s.length)return null;let r=new i.Bounds;e?s.forEach((t=>{r=r.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{r=r.union(t.getProduct().AABBBounds)}));const a={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();a.x-=t,a.y-=e}return a}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const s={};return n.getInverse().transformPoint({x:e,y:i},s),s}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=hg.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const s=new L(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Mg),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),s.parse([n],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,s)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,s=this.getPictogramRootGraphic();if(s){const r=s.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=s.AABBBounds,c=(a+o)/2,d=(l+h)/2,u=t/r.width(),p=e/r.height(),g=Math.min(u,p);s.scale(g,g,{x:c,y:d}),s.translate(i-c,n-d)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:n}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new i.Matrix}),s.scale(e,e,n))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new i.Matrix}),n.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Bg.type=rg,Bg.mark=og,Bg.transformerConstructor=gg;const Cg=()=>{e.Factory.registerSeries(Bg.type,Bg),e.Factory.registerImplement("registerSVG",dg),e.Factory.registerImplement("unregisterSVG",ug),e.Factory.registerInteractionTrigger(yg.type,yg),e.Factory.registerInteractionTrigger(vg.type,vg)};class kg extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=lg,this.type=sg,this.seriesType=rg}}kg.type=rg,kg.seriesType=sg,kg.transformerConstructor=lg;class Pg extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Og="imageCloud",Rg="imageCloud";var Lg;!function(t){t.image="image",t.imageMask="imageMask"}(Lg||(Lg={}));const Ig=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Eg={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Dg,triangle:Dg,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Dg(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Fg={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,n=0;return t=>{const s=t<0?-1:1;switch(Math.sqrt(1+4*s*t)-s&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}};const jg=(t,e,n)=>{const{threshold:s,invert:r=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,n)=>{const a=t.width;if(0===t.data[e*a*4+4*n+3])return!r;const o=t.data[e*a*4+4*n+0],l=t.data[e*a*4+4*n+1],h=t.data[e*a*4+4*n+2];if(255===o&&255===l&&255===h)return!r;if(i.isValidNumber(s)){const t=.3*o+.59*l+.11*h;return r?t<=s:t>=s}return!1};const a=n({width:1,height:1}).getContext("2d",{willReadFrequently:!0});a.fillStyle=t,a.fillRect(0,0,1,1);const o=a.getImageData(0,0,1,1).data;return(t,e,i)=>{const n=t.width;return[0,1,2,3].every((s=>r?t.data[4*(e*n+i)+s]!==o[s]:t.data[4*(e*n+i)+s]===o[s]))}},Ug=(t,e,n,s,r)=>{const{fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:l="normal",fontVariant:h="normal",text:c,hollow:d}=t;let u=12;r.font=`${l} ${h} ${o} ${u}px ${a}`,r.textAlign="center",r.textBaseline="middle",r.fillStyle=e;const p=r.measureText(c),g="normal"!==l?1.1:1,f=i.isValid(p.actualBoundingBoxRight)&&i.isValid(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,u);if(d&&(r.globalCompositeOperation="xor"),m>n){const t=Math.min(n/m,s/u);r.fillText(c,n/2,s/2),r.scale(t,t)}else u=Math.floor(u*n/m),u=Math.min(u,s),r.font=`${l} ${h} ${o} ${u}px ${a}`,r.fillText(c,Math.floor(n/2),Math.floor(s/2))},Ng=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0;const r=2*Math.PI/s;return new Array(s).fill(0).map(((s,a)=>i.polarToCartesian(t,e,n+a*r)))},Wg=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3?arguments[3]:void 0;const r=2*Math.PI/s,a=(t=>Eg[t]?Eg[t]():Eg.circle())("cardioid");return new Array(s).fill(0).map(((s,o)=>{const l=n+o*r,h=e*a(l);return i.polarToCartesian(t,h,l)}))},zg=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Vg=(t,e,i,n,s)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],n=e[1];let s=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(n/2.7*.4),s=Math.floor(Math.min(i/2.3,n/2.6));break;case"triangleForward":s=n/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(n/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(n/1.5),s=Math.floor(Math.min(n/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":s=Math.floor(Math.min(i/2,n/2));break;default:s=Math.floor(Math.max(i/2,n/2))}return{maxRadius:s,center:r}}(t.shape,[i,n]);s.fillStyle=e,r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,n)=>{0===n?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,Wg({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)zg(s,Ng({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)zg(s,Ng({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)zg(s,Ng({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ng({x:l,y:h},o,-Math.PI/2,5),e=Ng({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let n=0;n<5;n++)i.push(t[n]),i.push(e[n]);zg(s,i)}else s.fillRect(0,0,i,n)};function Gg(t){const{size:e,maskCanvas:i}=t,n=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),s=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===s[i*e[0]+l]&&!t.isEmptyPixel(n,i,l)){s[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==s[h*e[0]+c]||t.isEmptyPixel(n,h,c)||(s[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},d={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const n=s[t*e[0]+i];0!==n&&(T(t,i)&&(f.push([t,i]),l[n]=l[n]||[],l[n].push([i,t]),d[n]||(d[n]=[1/0,-1/0,1/0,-1/0]),t<d[n][0]&&(d[n][0]=t),t>d[n][1]&&(d[n][1]=t),i<d[n][2]&&(d[n][2]=i),i>d[n][3]&&(d[n][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[n]=(h[n]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),n=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,n],m.push(...e);const[s,r,a,o]=d[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(n-s)**2),Math.sqrt((i-o)**2+(n-r)**2),Math.sqrt((i-a)**2+(n-r)**2),Math.sqrt((i-o)**2+(n-s)**2)),p[t]=(o-a)/(r-s)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:d[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:s,labelNumber:r-1};if(t.blur){const i=t.blur,n=function(t,e,i,n){const s=n/3,r=Math.ceil(n/2),a=function(t,e){const i=new Array(2*t+1).fill(0),n=t;let s=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+n]=t,s+=t}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let n=0;n<i;n++)for(let i=0;i<e;i++){let s=0;for(let o=-r;o<=r;o++)s+=t[n*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[n*e+i]=s}for(let t=0;t<e;t++)for(let n=0;n<i;n++){let s=0;for(let l=-r;l<=r;l++)s+=o[Math.min(Math.max(n+l,0),i-1)*e+t]*a[l+r];l[n*e+t]=Math.max(0,Math.min(1,s))}return l}(s,e[0],e[1],i);(function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,s>1)for(let e=1-s;e<=s-1;e++)for(let o=1-s;o<=s-1;o++)if(Math.sqrt(e*e+o*o)<s){const s=t+e,l=a+o;s>=0&&s<n&&l>=0&&l<i&&(r[s*i+l]=1)}return r})(s,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(s[e]=n[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const n=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+n[r][0],o=i+n[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===s[a*e[0]+o])return!0}return!1}}function Hg(t,e,i){e.width=t.width,e.height=t.height;const n=e.getContext("2d",{willReadFrequently:!0});n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);const s=e.width,r=n.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let n=0;n<t;++n)if(!i(r,e,n))return!1;return!0},d=(t,e,n)=>{for(let s=e;s<n;++s)if(!i(r,s,t))return!1;return!0};for(;a<o&&c(s,a);)++a;for(;o-1>a&&c(s,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=n.getImageData(l,a,h-l,o-a);return e.width=u.width,e.height=u.height,n.clearRect(0,0,e.width,e.height),n.putImageData(u,0,0),e}function Xg(t,e){return t&&(i.isValidUrl(t)||i.isBase64(t)||t.startsWith("<svg"))?new Promise(((i,n)=>{var s;const r=e({image:t}),a=null===(s=r.resources)||void 0===s?void 0:s.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const s=null===(e=r.resources)||void 0===e?void 0:e.get(t);s&&"success"===s.state&&s.data?i(s.data):n(new Error("image load failed: "+t))}else n(new Error("image load failed: "+t))},r.failCallback=()=>{n(new Error("image load failed: "+t))})})):null}var Yg;function qg(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(Yg||(Yg={})),Object.values(Yg).forEach((t=>{}));const $g=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),Kg=t=>t<0?-t*t:t*t;function Zg(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function Jg(t,e,i){const n=t[0],s=t[1],r=e[0],a=e[1];let o,l;return s<n?(o=Zg(s,n),l=i(a,r)):(o=Zg(n,s),l=i(r,a)),t=>l(o(t))}function Qg(t,e,n){const s=Math.min(t.length,e.length)-1,r=new Array(s),a=new Array(s);let o=-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<s;)r[o]=Zg(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){const n=i.bisect(t,e,1,s)-1;return a[n](r[n](e))}}const tf=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Math.floor(Math.log10(t)),n=t/Math.pow(10,i);let s;return s=e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10,s*Math.pow(10,i)};class ef{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),n=t[0]-i*e[0];return[n,i+n]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,n){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):n?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var n;return i.isNil(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i.isNil(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(n=this._rangeFactorEnd)&&void 0!==n?n:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var n;return i.isNil(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!i.isNil(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(n=this._rangeFactorStart)&&void 0!==n?n:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:n=.1,radius:s}=this._fishEyeOptions,r=this.range(),a=r[0],o=r[r.length-1],l=Math.min(a,o),h=Math.max(a,o),c=i.clamp(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,l,h),d=i.isNil(s)?(h-l)*n:s;let u=Math.exp(e);u=u/(u-1)*d;const p=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=d)return t;if(e<=1e-6)return c;const i=u*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:nf}=i.ColorUtil;function sf(t,e){const n=typeof e;let s;if(i.isNil(e)||"boolean"===n)return()=>e;if("number"===n)return i.interpolateNumber(t,e);if("string"===n){if(s=i.ColorUtil.Color.parseColorString(e)){const e=nf(i.ColorUtil.Color.parseColorString(t),s);return t=>e(t).formatRgb()}return i.interpolateNumber(Number(t),Number(e))}return e instanceof i.ColorUtil.RGB?nf(t,e):e instanceof i.ColorUtil.Color?nf(t.color,e.color):e instanceof Date?i.interpolateDate(t,e):i.interpolateNumber(Number(t),Number(e))}class rf extends ef{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qg,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qg;super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=qg,this._piecewise=Jg,this._interpolate=sf}calculateVisibleDomain(t){var e;return i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),i.interpolateNumber)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var n;if(!t)return(null!==(n=this._niceDomain)&&void 0!==n?n:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,i.toNumber);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const n=Array.from(t);return this._range=n,this._interpolate=i.interpolateNumberRound,this.rescale(e)}rescale(t){var e;if(t)return this;const n=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=n.length,r=this._range.length;let a=Math.min(s,r);if(s&&s<r&&this._forceAlign){const t=r-s+1,e=n[s-1],i=s>=2?(e-n[s-2])/t:0;for(let r=1;r<=t;r++)n[s-2+r]=e-i*(t-r);a=r}return this._autoClamp&&(this._clamp=i.clamper(n[0],n[a-1])),this._piecewise=a>2?Qg:Jg,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:qg),this.rescale(i)):this._clamp!==qg}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(){return[]}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return i.isNil(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return i.isNil(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const af=Math.sqrt(50),of=Math.sqrt(10),lf=Math.sqrt(2),hf=[1,2,5,10],cf=(t,e,n)=>{let s=1,r=t;const a=Math.floor((e-1)/2),o=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?r=0:t<0&&t>=-Number.MIN_VALUE?r=-(e-1):!n&&o<1?s=gf(o).step:(n||o>1)&&(r=Math.floor(t)-a*s),s>0?(t>0?r=Math.max(r,0):t<0&&(r=Math.min(r,-(e-1)*s)),i.range(0,e).map((t=>r+t*s))):t>0?uf(0,-(e-1)/s,s):uf((e-1)/s,0,s)},df=i.memoize(((t,e,i,n)=>{let s,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((s=e<t)&&(r=t,t=e,e=r),o=ff(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),n=Math.round(e/o);for(i*o<t&&++i,n*o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==n?void 0:n.noDecimals)){o=1;const i=Math.ceil(t),n=Math.floor(e);if(!(i<=n))return[];for(a=new Array(r=n-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),n=Math.round(e*o);for(i/o<t&&++i,n/o>e&&--n,a=new Array(r=n-i+1);++l<r;)a[l]=(i+l)/o}return s&&a.reverse(),a})),uf=(t,e,i)=>{let n,s,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,s=new Array(n=o-a+1);++r<n;)s[r]=(a+r)/i}return s},pf=i.memoize(((t,e,i,n)=>{let s,r,a;if(i=+i,(t=+t)==(e=+e))return cf(t,i,null==n?void 0:n.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return cf(t,i,null==n?void 0:n.noDecimals);(s=e<t)&&(a=t,t=e,e=a);const o=ff(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let n=1;const{power:s,gap:a}=o,h=10===a?2*10**s:1*10**s;for(;n<=5&&(r=uf(t,e,l),r.length>i+1)&&i>2;)l+=h,n+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let n;const s=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(n=a;n>=1;n--)e.push(s-n*i);return e.concat(t)}if(s>=0){for(n=1;n<=a;n++)t.push(r+n*i);return t}let o=[];const l=[];for(n=1;n<=a;n++)n%2==0?o=[s-Math.floor(n/2)*i].concat(o):l.push(r+Math.ceil(n/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==n?void 0:n.noDecimals)&&l<0&&(l=1),r=uf(t,e,l);return s&&r.reverse(),r})),gf=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let n=hf[0];return i>=af?n=hf[3]:i>=of?n=hf[2]:i>=lf&&(n=hf[1]),e>=0?{step:n*10**e,gap:n,power:e}:{step:-(10**-e)/n,gap:n,power:e}};function ff(t,e,i){const n=(e-t)/Math.max(0,i);return gf(n)}function mf(t,e,i){let n;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(n=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(n))return[];const s=new Array(i);for(let e=0;e<i;e++)s[e]=t+e*n;return s}function yf(t,e,i){let n,s,r=-1;if(i=+i,(s=(e=+e)<(t=+t))&&(n=t,t=e,e=n),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return s&&o.reverse(),o}function bf(t){let e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,s=0,r=t.length-1,a=t[s],o=t[r],l=10;for(o<a&&(i=a,a=o,o=i,i=s,s=r,r=i);l-- >0;){if(i=ff(a,o,n).step,i===e)return t[s]=a,t[r]=o,t;if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else{if(!(i<0))break;a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i}e=i}}const vf=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i);i.memoize(((t,e,i,n,s,r,a)=>{let o=t,l=e;const h=l<o;h&&([o,l]=[l,o]);let c,d,u=s(o),p=s(l),g=[];if(!(n%1)&&p-u<i){if(u=Math.floor(u),p=Math.ceil(p),o>0){for(;u<=p;++u)for(c=1;c<n;++c)if(d=u<0?c/r(-u):c*r(u),!(d<o)){if(d>l)break;g.push(d)}}else for(;u<=p;++u)for(c=n-1;c>=1;--c)if(d=u>0?c/r(-u):c*r(u),!(d<o)){if(d>l)break;g.push(d)}2*g.length<i&&(g=pf(o,l,i))}else g=pf(u,p,Math.min(p-u,i)).map(r);return g=g.filter((t=>0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),i.memoize(((t,e,i,n,s,r)=>{const a=[],o={},l=s(t),h=s(e);let c=[];if(Number.isInteger(n))c=pf(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e<i;e++)c.push(l+e*t)}return c.forEach((i=>{const s=r(i),l=Number.isInteger(n)?vf(t,e,s):vf(t,e,tf(s)),h=vf(t,e,((t,e)=>{let i,n;return e[0]<e[1]?(i=e[0],n=e[1]):(i=e[1],n=e[0]),Math.min(Math.max(t,i),n)})(l,[t,e]));!o[h]&&!isNaN(h)&&c.length>1&&(o[h]=1,a.push(h))})),a})),i.memoize(((t,e,i,n,s)=>mf(n(t),n(e),i).map((t=>tf(s(t)))))),i.memoize(((t,e,i,n,s)=>yf(n(t),n(e),i).map((t=>tf(s(t))))));class xf extends rf{constructor(){super(...arguments),this.type=Yg.Linear}clone(){var t;const e=new xf;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.calculateVisibleDomain(this._range);return df(i[0],i[i.length-1],t,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var n;if(i.isFunction(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(i.isValid(this._rangeFactorStart)&&i.isValid(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(n=this._niceDomain)&&void 0!==n?n:this._domain,r=this._domain,a=s[0],o=s[s.length-1];let l=pf(r[0],r[r.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==a||l[l.length-1]!==o)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==a?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==o&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return mf(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return yf(e[0],e[e.length-1],t)}nice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var n,s;const r=this._domain;let a=[];if(e){const t=function(t,e){const n=i.isNumber(e.forceMin),s=i.isNumber(e.forceMax);let r=null;const a=[];let o=null;const l=n&&s?t=>t>=e.forceMin&&t<=e.forceMax:n?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return n?a[0]=e.forceMin:i.isNumber(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(a[0]=e.min),s?a[1]=e.forceMax:i.isNumber(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(a[1]=e.max),i.isNumber(a[0])&&i.isNumber(a[1])?(o=t.slice(),o[0]=a[0],o[o.length-1]=a[1]):r=i.isNumber(a[0])||i.isNumber(a[1])?i.isNumber(a[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:a,domainValidator:l}}(r,e);if(a=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=bf(r.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(n=a[1])&&void 0!==n?n:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=a[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";const e=this._domain[this._domain.length-1],i=bf(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";const e=this._domain[0],i=bf(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class _f extends xf{constructor(){super($g,Kg),this.type=Yg.Sqrt}clone(){return(new _f).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var Af;function Sf(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(Af||(Af={}));class Tf{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:n=0}=t;let s=this.imageCollageList;return s.forEach(((t,s)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=n,t.weight=i.simpleField(e)(this.data[s]),t.datum=this.data[s])})),s=s.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),s}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:n,height:s}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:n/s}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,n,s,r,a;const o=this.options,l=o.size,h={shapeUrl:null!==(t=o.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:l,ratio:o.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=o.maskConfig)||void 0===e?void 0:e.edgeBlur},c=this.options.createCanvas({width:l[0],height:l[1]}),d=c.getContext("2d",{willReadFrequently:!0});d.textAlign="center",d.textBaseline="middle",h.tempCanvas=c;const u=l[0]+31>>5<<5;if(h.boardSize=[u,l[1]],h.random?h.randomGenerator=Math.random:h.randomGenerator=i.fakeRandom(),this.segmentationInput=h,i.isString(h.shapeUrl)){h.isEmptyPixel=jg(void 0,{threshold:null!==(s=null===(n=o.maskConfig)||void 0===n?void 0:n.threshold)&&void 0!==s?s:200,invert:null===(r=o.maskConfig)||void 0===r?void 0:r.invert},this.options.createCanvas);const t=Xg(h.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const n=o.size,s=this.options.createCanvas({width:n[0],height:n[1],dpr:1});h.maskCanvas=s;const r=s.getContext("2d");(null===(e=o.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Hg(t,s,h.isEmptyPixel);const a=function(t,e){const i=t.width,n=t.height;let s=e[0]/i;n*s>e[1]&&(s=e[1]/n);const r=Math.floor(s*i),a=Math.floor(s*n);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:s}}(t,n);let l;r.clearRect(0,0,n[0],n[1]),r.drawImage(t,a.x,a.y,a.width,a.height),this.segmentationOutput=Gg(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(l=this.generateTransparentMaskCanvas(t,n)),this.segmentationOutput.transparentMaskCanvas=l,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(s,l)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(h.shapeUrl&&("text"===h.shapeUrl.type||"geometric"===h.shapeUrl.type)){h.isEmptyPixel=jg(h.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==h.shapeUrl.type&&"geometric"!==h.shapeUrl.type||h.shapeUrl.backgroundColor||(h.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=function(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5?arguments[5]:void 0,{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;s&&([a,o]=[o,a]);const l=n||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(n){const t=n.width,s=n.height;h.clearRect(0,0,t,s),n.style.width=`${e}px`,n.style.height=`${i}px`,n.width=e,n.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?Ug(t,o,l.width,l.height,h):"geometric"===t.type&&Vg(t,o,l.width,l.height,h),l}(h.shapeUrl,l[0],l[1],void 0,null===(a=o.maskConfig)||void 0===a?void 0:a.invert,this.options.createCanvas);h.maskCanvas=t,this.segmentationOutput=Gg(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>Xg(t,e))))}(this.data.map((t=>i.simpleField(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,i.Logger.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.45;const{imageSizeRange:s,padding:r=0}=e,a=i.isNumber(e.imageSize)?e.imageSize:i.field(e.imageSize),o=this.options.size;if(a||s)if(a&&!i.isFunction(a))t.forEach((t=>Sf(t,a)));else if(s){const e=(new _f).domain(i.extent(t,(t=>t.weight))).range(s);t.forEach((t=>Sf(t,~~e.scale(t.weight))))}else if(a&&i.isFunction(a)&&!s){const e=.5,[s,a]=i.extent(t,(t=>t.weight)),l=t.reduce(((t,i)=>{const n=i.aspectRatio,r=(i.weight-s)/(a-s);return t+(n>1?1/n:n)*(e+(1-e)*r)**2}),0),h=~~Math.sqrt(n*o[0]*o[1]/l),c=[~~(e*h)-2*r<0?1:~~(e*h)-2*r,~~h-2*r<0?1:~~h-2*r],d=(new _f).domain(i.extent(t,(t=>t.weight))).range(c);t.forEach((t=>Sf(t,~~d.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let i=~~Math.sqrt(n*o[0]*o[1]/e);i=i-2*r<0?1:i-2*r,t.forEach((t=>Sf(t,i)))}return t}generateTransparentMaskCanvas(t,e){var i;const n=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),s=n.getContext("2d");this.segmentationOutput.transparentMaskCanvas=n,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Hg(t,n,this.segmentationInput.isEmptyPixel);const r=s.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],n=4*t;r.data[n]=e,r.data[n+1]=e,r.data[n+2]=e,r.data[n+3]=i}return s.clearRect(0,0,e[0],e[1]),s.fillStyle="rgba(255,255,255,0)",s.fillRect(0,0,e[0],e[1]),s.putImageData(r,0,0),n}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class wf extends Tf{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,n,s){let r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),d=Fg[i](e);let u,p,g=-r;const{segmentation:f}=n,{labels:m}=f;for(;([u,p]=d(g+=r))&&!(Math.min(Math.abs(u),Math.abs(p))>=c);)if(u-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+u),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Mf(t,s)){const{x:e,y:i,width:n,height:s}=t;let r=!1;for(let t=0;t<n;t++){for(let n=0;n<s&&i+t<=o;n++)if(!(e+n>a||m[(i+t)*a+(e+n)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:n}=this,{layoutConfig:s={}}=this.options,r=this.options.size,{spiralType:a="archimedean",fillingTimes:o=4,minFillingImageSize:l=10}=s,h=[],c=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,r,a,n,h)&&h.push(e);const d=i.minInArray(h,((t,e)=>t.width-e.width)).width,u=i.minInArray(h,((t,e)=>t.height-e.height)).height,p=[];for(let i=0;i<o;i++){const s=.5*d-1*i,o=.5*u-1*i;for(const i of t){const t=Object.assign({},i,{visible:!0});Sf(t,Math.max(l,t.aspectRatio>1?s:o)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,r,a,n,[...p,...h],.5)&&(i._tempFrequency=(null!==(e=i._tempFrequency)&&void 0!==e?e:i.frequency)+1,t.frequency=i._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-r[0]/2,2)+Math.pow(t.y-r[1]/2,2)),t[c]=`${t[c]}_${t.frequency}`,p.push(t))}}return[...h,...p].filter((t=>t.visible))}}function Mf(t,e){for(let s=0;s<e.length;s++)if(i=t,n=e[s],!(i._leftWithoutPadding+i._widthWithPadding<n._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<n._topWithoutPadding||i._leftWithoutPadding>n._leftWithoutPadding+n._widthWithPadding||i._topWithoutPadding>n._topWithoutPadding+n._heightWithPadding))return!1;var i,n;return!0}function Bf(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*n-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=s;let d,u;c>1?(d=h,u=h/c):(u=h,d=h*c);const p=Math.ceil(l/(u+r)),g=Math.ceil(o/(d+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(d+r)+d/2,n=t*(u+r)+u/2;y[t*g+e]={centerX:i,centerY:n,x:i-d/2,y:n-u/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(n-m,2))}}return{context:Object.assign({},s,{cellWidth:d,cellHeight:u,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:d*u,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<d;t++)for(let s=0;s<u&&n+t<=l;s++)i+s>o||e((~~n+t)*o+(~~i+s))},clipPath:`M${-d/2} ${-u/2} L${d/2} ${-u/2} L${d/2} ${u/2} L${-d/2} ${u/2} Z`}),imageLength:h}}const Cf={rect:Bf,circle:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let d=0;d=a?a/2:Math.min(o,l)*n/2,d-r<=0&&(d=r+1);const u=2*d,p=Math.sqrt(3)/2*u+r,g=[];let f=0;for(let t=0;t*p-d<l;t++){const e=t*p,i=t%2==0?0:d;for(let n=-1;n*(u+r)+i-d<o;n++){const s=n*(u+r)+i+d;g[f++]={centerX:s,centerY:e,x:s-d,y:e-d,row:t,col:n,distance:Math.sqrt(Math.pow(s-h,2)+Math.pow(e-c,2))}}}let m=0;const y=d*d;for(let t=0;t<u;t++)for(let e=0;e<u;e++){const i=t-d,n=e-d;i*i+n*n<=y&&m++}return{context:Object.assign({},s,{cellWidth:u,cellHeight:u,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:n}=t;for(let t=0;t<u;t++)for(let s=0;s<u;s++){if(t+i<0||t+i>o||s+n>l||s+n<0)continue;const r=t-d,a=s-d;r*r+a*a<=y&&e((~~n+t)*o+(~~i+s))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:u}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:n=.1,layoutConfig:s={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let d;d=a?a/2:Math.min(o,l)*n/2,d-r<=0&&(d=r+1);const u=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;u.push({x:(d-r/2)*Math.cos(e),y:(d-r/2)*Math.sin(e)})}const g=2*d,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,n=t*b+(e%2?v:0);A.push({centerX:i,centerY:n,x:i-f,y:n-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(n-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,n=t-m/2,s=Math.abs(i),r=Math.abs(n);s<=f&&r<=m/2&&2*r+s*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},s,{cellHexSideLength:f,cellHexPoints:u,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:n}=t;let s=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[s++]&&e((~~n+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class kf extends Tf{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:n="rect"}=i,s=(null!==(t=Cf[n])&&void 0!==t?t:Cf.rect)(this.options),{context:r,imageLength:a}=s;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:n,cellInfo:s,cellCount:r,clipPath:a,eachPixel:o,cellPixelCount:l}=this.layoutContext;if(0===t.length||0===r||0===e||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:h}=this,{layoutConfig:c={}}=this.options,{placement:d="default"}=c;if("edge"===d||"default"===d){const{segmentation:t}=h,{labels:e}=t;s.forEach((t=>{let i=0;o(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,p=t=>{const{intersectPixels:e}=t;return"default"===d?e>=.45*l:"edge"!==d||e>.1*l&&e<l};for(let e=0;e<u;e++){const n=t[e],r=s[e];r&&(n.x=r.centerX-n.width/2,n.y=r.centerY-n.height/2,n.clipConfig={shape:a},n.frequency=1,n.visible=p(r),n.cell=i.pickWithout(r,["image"]),n.distance=r.distance,r.image=n)}const g=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<r)for(let e=u;e<r;e++){const n=t[e-u],r=s[e];if(r){const e=Object.assign({},n);e.x=r.centerX-e.width/2,e.y=r.centerY-e.height/2,e.frequency+=1,e[g]=`${e[g]}_${e.frequency}`,e.visible=p(r),e.distance=r.distance,e.cell=i.pickWithout(r,["image"]),r.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Pf extends Tf{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,n=Bf;return this.layoutContext=n(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:n,cellInfo:s,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===n||0===s.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:d=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;s.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const u=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.visible=g(n),i.cell=`${n.row}_${n.col}`,i.angle=Math.random()*(2*d)-d,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-n.distance,i.distance=n.distance,i.frequency=1,n.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<r)for(let e=u;e<r;e++){const i=t[e-u],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*d)-d,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(n),e.cell=`${n.row}_${n.col}`,e.distance=n.distance,e.zIndex=p-n.distance,n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Of=(t,e,n)=>{var s,r;const a=i.isFunction(t.size)?t.size():t.size;if(t.size=a,!a||i.isNil(a[0])||i.isNil(a[1])||a[0]<=0||a[1]<=0)return i.Logger.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(a[0]),Math.ceil(a[1])],t.image||i.Logger.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let o;switch(null!==(r=null===(s=t.layoutConfig)||void 0===s?void 0:s.layoutMode)&&void 0!==r?r:"spiral"){case"grid":o=kf;break;case"stack":o=Pf;break;default:o=wf}const l=new o(t);return l.layout(e),l.unfinished()?{progressive:l}:l.output()};class Rf extends Dp{constructor(t,e,i,n,s){var r;super(t,e,i,n,s),this._rotations=null!==(r=null==s?void 0:s.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,i.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const s=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(s))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Lf(t,i){switch(i){case"axialRotate":return[{custom:Rf,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class If extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:n}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&s)return null!==(i=s[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Ef extends e.BaseSeries{constructor(){super(...arguments),this.type=Rg}setValueField(t){i.isValid(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(Ig.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Ig.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new If(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:io,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const s=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,s),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Ef.type=Rg,Ef.mark=Ig;const Df=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Lf(t,e),enter:Lf(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Ef.type,Ef),e.Factory.registerGrammarTransform("imagecloud",{transform:Of})};class Ff extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Ff.transformerConstructor,this.type=Og,this.seriesType=Rg}}Ff.type=Og,Ff.seriesType=Rg,Ff.transformerConstructor=Pg;const jf=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Uf extends ha{constructor(t,e){super(t),this._skipRenderAttributes=jf,(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,n,s){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(r)return this._setAttributes(r,n);i.isPlainObject(this.attribute[t])&&i.isPlainObject(e)&&!i.isFunction(this.attribute[t])&&!i.isFunction(e)?i.merge(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!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){i.isNil(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const s=e[n];!i.isPlainObject(this.attribute[s])||i.isFunction(this.attribute[s])||i.isFunction(t[s])?this.attribute[s]=t[s]:i.merge(this.attribute[s],t[s])}}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 Rn(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}var Nf;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Nf||(Nf={}));const Wf={[Nf.selectedReverse]:{},[Nf.selected]:{},[Nf.hover]:{},[Nf.hoverReverse]:{}};function zf(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&zf(t,e)}))}function Vf(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function Gf(t,e,i){return Math.abs(t-e)<i}function Hf(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,s;return i.isObject(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}const Xf=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function Yf(){_u(),Ou(),Uu(),Eu(),Wu()}var qf=function(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};Yf();class $f extends Uf{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},$f.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:s="",textStyle:r={},shape:a={},panel:o={},space:l=4,minWidth:h,maxWidth:c,padding:d=4,visible:u,state:p,type:g,textAlwaysCenter:f,containerTextAlign:m}=this.attribute,y=i.normalizePadding(d),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let v,x=-y[3],_=-y[0],A=y[1]+y[3],S=y[0]+y[2],T=0,w=0;const{visible:M}=a,B=qf(a,["visible"]);if(i.isBoolean(M)){const t=(null==B?void 0:B.size)||10,e=i.isNumber(t)?t:Math.max(t[0],t[1]);v=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:M,x:e/2,y:e/2}),"symbol"),i.isEmpty(null==p?void 0:p.shape)||(v.states=p.shape),M&&(w=e+l)}let C,k,P;if(A+=w,T+=w,Hf({text:s})||"rich"===g){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return i.isValid(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:g,text:s},r))),r),{visible:i.isValid(s)&&!1!==u,x:T,y:0});i.isNil(t.lineHeight)&&(t.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",t,"richtext"),k=C.AABBBounds.width(),P=C.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:i.isObject(s)&&"type"in s&&"text"===s.type?s.text:s,visible:i.isValid(s)&&!1!==u,lineHeight:null==r?void 0:r.fontSize},r),{x:T,y:0});i.isNil(n.lineHeight)&&(n.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",n,"text");const a=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const n=Po({text:t,fontFamily:e.fontFamily||i.fontFamily||"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:n.width(),height:n.height()}}(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=a.width,P=a.height}A+=k;const O=null!==(n=a.size)&&void 0!==n?n:10,R=i.isNumber(O)?O:Math.max(O[0],O[1]);S+=Math.max(P,a.visible?R:0);const{textAlign:L,textBaseline:I}=r;(i.isValid(h)||i.isValid(c))&&(i.isValid(h)&&A<h&&(A=h),i.isValid(c)&&A>c&&(A=c,C.setAttribute("maxLineWidth",c-y[1]-y[2]))),x=0,_=0;let E=0;"left"===L||"start"===L?E=1:"right"===L||"end"===L?E=-1:"center"===L&&(E=0),E?E<0?(x-=A,v&&v.setAttribute("x",(v.attribute.x||0)-k),b.setAttribute("x",-y[1]-w)):E>0&&b.setAttribute("x",y[3]):(x-=A/2,v&&v.setAttribute("x",(v.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const D="right"===m||"end"===m,F="left"===m||"start"===m,j=(t,e)=>{"richtext"===C.type?C.setAttributes({x:t,textAlign:e,textConfig:i.array(C.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):C.setAttributes({x:t,textAlign:e})};if((m?"center"===m:f)&&E){const t=A-y[1]-y[3],e=k+w,i=1===E?(t-e)/2+w+k/2:y[0]+w-(A/2+e/2-w)+k/2;if(j(i,"center"),v){const t=i-k/2-w+R/2;v.setAttributes({x:t})}}if(F&&1!==E){const t=A-y[1]-y[3],e=0===E?-t/2+w/2:-A+y[3]+y[1]+w;if(j(e+w,"left"),v){const t=e+R/2;v.setAttributes({x:t})}}if(D&&-1!==E){const t=A-y[1]-y[3],e=0===E?t/2+w/2:t;if(j(e,"right"),v){const t=e-k-w+R/2;v.setAttributes({x:t})}}"middle"===I?(_-=S/2,v&&v.setAttribute("y",0)):"bottom"===I?(_-=S,v&&v.setAttribute("y",-P/2),b.setAttribute("y",-y[2])):"top"===I&&(b.setAttribute("y",y[0]),v&&v.setAttribute("y",P/2)),i.isEmpty(null==p?void 0:p.text)||(C.states=p.text);const{visible:U}=o,N=qf(o,["visible"]);if(u&&i.isBoolean(U)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},N),{visible:U&&!!s,width:A,height:S,x:x,y:_}),"rect");if(i.isEmpty(null==p?void 0:p.panel)||(t.states=p.panel),N.customShape){const e=N.customShape;t.pathProxy=t=>e(this,t,new si)}this._bgRect=t}this._textShape=C,this._symbol=v,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:i.merge({},$f.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,n,s,r,a,o,l,h,c,d,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(s=null===(n=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===n?void 0:n.slice())&&void 0!==s?s:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(d=this._bgRect)||void 0===d||d.clearStates(),null===(u=this._symbol)||void 0===u||u.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function Kf(){_u(),wu(),Bu(),Uu()}function Zf(){_u(),wu(),yu(),Uu()}$f.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},Kf();class Jf extends Uf{getStartAngle(){return i.normalizeAngle(this._startAngle)}getEndAngle(){return i.normalizeAngle(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},Jf.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:n,state:s,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),h=this._renderSymbol(t,l,"start"),c=this._renderSymbol(e,l,"end");if(this.startSymbol=h,this.endSymbol=c,a){const t=[...this.attribute.points];if(i.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const e=this._clipPoints(i.flattenArray(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 r,a;const o=Co.line(Object.assign(Object.assign({points:t},i.isArray(n)?null!==(r=n[e])&&void 0!==r?r:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+e),i.isEmpty(null==s?void 0:s.line)||(o.states=i.isArray(s.line)?null!==(a=s.line[e])&&void 0!==a?a:s.line[s.line.length-1]:s.line),this.add(o),this.lines.push(o)}))}else{let t=Co.line;i.array(n)[0].cornerRadius&&(t=Co.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},i.array(n)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),i.isEmpty(null==s?void 0:s.line)||(e.states=[].concat(s.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,n){if(!e.length)return;const{autoRotate:s=!0}=t;let r;if(t&&t.visible){const a=this.getStartAngle(),o=this.getEndAngle(),{state:l}=this.attribute,h=e[0],c=e[e.length-1],{refX:d=0,refY:u=0,refAngle:p=0,style:g,symbolType:f,size:m=12}=t;let y,b;"start"===n?(y={x:h.x+(i.isValidNumber(a)?d*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(i.isValidNumber(a)?d*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(y={x:c.x+(i.isValidNumber(o)?d*Math.cos(o)+u*Math.cos(o-Math.PI/2):0),y:c.y+(i.isValidNumber(o)?d*Math.sin(o)+u*Math.sin(o-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=Co.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:f,size:m,angle:s?b+p:0,strokeBoundsBuffer:0}),g)),r.name=`${this.name}-${n}-symbol`,r.id=this._getNodeId(`${n}-symbol`),i.isEmpty(null==l?void 0:l.symbol)||(r.states=l.symbol),"start"===n?i.isEmpty(null==l?void 0:l.startSymbol)||(r.states=l.startSymbol):i.isEmpty(null==l?void 0:l.endSymbol)||(r.states=l.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:n}=this.attribute;let s;return s=e?i.isValidNumber(n)?t[n]:i.flattenArray(t):t,this._mainSegmentPoints=s,s}_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}}Jf.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}}},Zf();class Qf extends Jf{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},Jf.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:n,state:s,visible:r=!0,radius:a,startAngle:o,endAngle:l,center:h}=this.attribute;if(!r)return;this._startAngle=o,this._endAngle=l,this.isReverseArc=o>l;const c={x:h.x+a*Math.cos(this._startAngle),y:h.y+a*Math.sin(this._startAngle)},d={x:h.x+a*Math.cos(this._endAngle),y:h.y+a*Math.sin(this._endAngle)};this._mainSegmentPoints=[c,d];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),p=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=p;const g=Co.arc(Object.assign({x:h.x,y:h.y,startAngle:o,endAngle:l,innerRadius:a,outerRadius:a},n));g.name=`${this.name}-line`,g.id=this._getNodeId("arc"),i.isEmpty(null==s?void 0:s.line)||(g.states=[].concat(s.line)[0]),this.add(g),this.line=g}}var tm,em,im,nm;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(tm||(tm={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(em||(em={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(im||(im={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(nm||(nm={}));class sm extends Uf{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,n)=>{const s=t.target;return s!==n&&s.name&&!i.isEmpty(s.states)?(s.addState(Nf.hover,!0),zf(e,(t=>{t!==s&&t.name&&!i.isEmpty(t.states)&&t.addState(Nf.hoverReverse,!0)})),s):n})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,n)=>n?(zf(e,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(Nf.hoverReverse),t.removeState(Nf.hover))})),null):n)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,n)=>{const s=t.target;return n===s&&s.hasState(Nf.selected)?(zf(e,(t=>{t.name&&!i.isEmpty(t.states)&&(t.removeState(Nf.selectedReverse),t.removeState(Nf.selected))})),null):s.name&&!i.isEmpty(s.states)?(s.addState(Nf.selected,!0),zf(e,(t=>{t!==s&&t.name&&!i.isEmpty(t.states)&&t.addState(Nf.selectedReverse,!0)})),s):n})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,n;if(!1!==this.attribute.animation){const s=i.isObject(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:i.merge({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:i.merge({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:i.merge({},this.defaultUpdateAnimation,s,null!==(n=this.attribute.animationUpdate)&&void 0!==n?n:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:n,select:s}=this.attribute;n&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),s&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let s;if(n){const n=Co.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));s=Co.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(s),this._containerClip=n,this.add(n)}else s=Co.group({x:0,y:0,pickable:!1}),this.add(s);s.name="marker-container",this._container=s}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const rm={type:"callIn",duration:500,easing:"linear",delay:0},am={type:"fadeOut",duration:500,easing:"linear",delay:0},om=.001;tm.end,im.arcOuterMiddle,em.right,im.arcOuterMiddle;const lm={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};_u(),Yf(),Ep(),Kf(),Zf(),Uu(),Su(),wu(),Ep();class hm extends sm{markerAnimate(t){hm._animate&&this._animationConfig&&hm._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},hm.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=rm,this.defaultExitAnimation=am,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,n,s){return Gf(Math.abs(n),Math.PI/2,om)||Gf(Math.abs(n),3*Math.PI/2,om)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,n,s):Vf(n)?lm.postiveXAxis[s]:lm.negativeXAxis[s]}setItemAttributes(t,e,n,s,r){var a,o;if(!t)return;const{autoRotate:l=!0,refX:h=0,refY:c=0,refAngle:d=0,style:u,position:p=nm.middle}=e,{state:g}=this.attribute,f=(null===(a=this._line)||void 0===a?void 0:a.getEndAngle())||0,m=h*Math.cos(f)+c*Math.cos(f-Math.PI/2),y=h*Math.sin(f)+c*Math.sin(f-Math.PI/2);if("text"===r){const r=s.x-n.x,a=s.y-n.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(l,r,a,f,null!==(o=e.position)&&void 0!==o?o:"end")),u.textStyle),state:{panel:i.merge({},Wf,null==g?void 0:g.textBackground),text:i.merge({},Wf,null==g?void 0:g.itemContent)}}))}else("richText"===r||"image"===r)&&(t.setAttributes({dx:this.getItemDx(t,p,u)+(u.dx||0),dy:this.getItemDy(t,p,u)+(u.dy||0)}),t.states=i.merge({},Wf,null==g?void 0:g.itemContent));const b=Vf(f)?f:f-Math.PI;t.setAttributes({x:s.x+(m||0),y:s.y+(y||0),angle:l&&b+d})}getItemDx(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==s?s:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var n,s;const r=null!==(s=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==s?s:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,n){const{state:s}=this.attribute,{type:r="text",style:a,renderCustomCallback:o}=t;let l;return"symbol"===r?(l=Co.symbol(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"text"===r?l=new $f(Object.assign(Object.assign({},n),{state:{panel:i.merge({},Wf,null==s?void 0:s.textBackground),text:i.merge({},Wf,null==s?void 0:s.itemContent)}})):"richText"===r?(l=Co.richtext(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"image"===r?(l=Co.image(Object.assign(Object.assign({},n),a)),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)):"custom"===r&&o&&(l=o(),l.states=i.merge({},Wf,null==s?void 0:s.itemContent)),l.name=`mark-point-${r}`,this.setItemAttributes(l,t,e,n,r),l}getItemLineAttr(t,e,i){let n=[],s={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,d=i.y-e.y;if(this._isStraightLine=Gf(c,0,om)||Gf(d,0,om),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:n,y:l}=i,c=(t+n)/2,d=c+h*(l>e?-1:1)*c,u=(e===l?0:-(t-n)/(e-l))*(d-c)+(e+l)/2;a=Xf(e-u,t-d),o=Xf(l-u,n-d),s={x:d,y:u};const p=Math.sqrt((d-t)*(d-t)+(u-e)*(u-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((d-t)*(d-t)+(u-e)*(u-e))}else n="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return n=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(n),{points:n,center:s,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:n,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this._isArcLine?Qf:Jf;this._container.removeChild(this._line),this._line=new l(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:n,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:i.merge({},Wf,null==o?void 0:o.line),startSymbol:i.merge({},Wf,null==o?void 0:o.lineStartSymbol),endSymbol:i.merge({},Wf,null==o?void 0:o.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,n){if(this._line){const{startSymbol:s,endSymbol:r,lineStyle:a,type:o="type-s"}=t,{state:l}=this.attribute,h=this.getItemLineAttr(t,e,n);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},h),{startSymbol:s,endSymbol:r,lineStyle:a,visible:t.visible,state:{line:i.merge({},Wf,null==l?void 0:l.line),startSymbol:i.merge({},Wf,null==l?void 0:l.lineStartSymbol),endSymbol:i.merge({},Wf,null==l?void 0:l.lineEndSymbol)}})):this.reDrawLine(t,h)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,n=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(n-Math.PI/2),startPointOffsetY:i/2*Math.sin(n-Math.PI/2),endPointOffsetX:-i/2*Math.cos(n-Math.PI/2),endPointOffsetY:-i/2*Math.sin(n-Math.PI/2)}}setDecorativeLineAttr(t,e,n){var s;if(this._decorativeLine){const{lineStyle:r}=t,{startPointOffsetX:a,startPointOffsetY:o,endPointOffsetX:l,endPointOffsetY:h}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+a,y:e.y+o},{x:e.x+l,y:e.y+h}]},r),{visible:n})),this._decorativeLine.states=i.merge({},Wf,null===(s=this.attribute.state)||void 0===s?void 0:s.line)}}setTargetItemAttributes(t,e){var n,s;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(n=t.visible)&&void 0!==n&&n,size:t.size},t.style)),this._targetItem.states=i.merge({},Wf,null===(s=this.attribute.state)||void 0===s?void 0:s.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:n,itemLine:s={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:n,height:s}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:n,x2:s,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,d=0;return a<i&&(c=i-a),o<n&&(d=n-o),l>s&&(c=s-l),h>r&&(d=r-h),{dx:c,dy:d}}(this._item,{x1:t,y1:i,x2:t+n,y2:i+s});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,n),this.setItemLineAttr(s,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(s,e,null===(i=s.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:n={},targetSymbol:s,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=n,{offset:l=0,style:h,visible:c=!1,size:d}=s,u=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:d)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?Xf(o,a/2):"type-po"===r.type?Xf(0,a):"type-op"===r.type?Xf(o,0):Xf(o,a),{newPosition:{x:t.x+(u/2+l)*Math.cos(p),y:t.y+(u/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(u/2+l)*Math.cos(p)+a,y:t.y+(u/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:n}=this.attribute,{type:s="type-s",arcRatio:r=.8}=n,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=Gf(a,0,om)||Gf(o,0,om),this._isArcLine="type-arc"===s&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?Qf:Jf)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const d=Co.line({points:[]});d.name="mark-point-decorativeLine",this._decorativeLine=d,t.add(d);const u=Co.symbol({});u.name="mark-point-targetItem",this._targetItem=u,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:n="text"}=e,{type:s="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=Gf(a,0,om)||Gf(o,0,om);const l="type-arc"===s&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,n),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!i.isValidNumber(t.x)||!i.isValidNumber(t.y))}}hm.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const cm="seriesBreak";function dm(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)),d=Math.PI/180*n,u=i*Math.cos(d),p=i*Math.sin(d);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=s?a+(t%2==0?u:-u):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(" ")}class um extends Uf{constructor(){super(...arguments),this.name=cm}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(i.isEmpty(t))return;const e=[],n=[];t.forEach((t=>{const{start:s,end:r}=t;((t,e)=>{const{start:n,end:s}=e,r=n.x===s.x,a=r?"x":"y",o=r?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(i.isNumberClose(t.start[a],n[a])){const e=Math.min(n[o],s[o]),i=Math.max(n[o],s[o]),r=Math.min(t.start[o],t.end[o]),a=Math.max(t.start[o],t.end[o]);if(!(i<r-h||e>a+h))return t.start[o]=Math.min(r,e),t.end[o]=Math.max(a,i),void(l=!1)}})),l&&t.push(e)})(s.x===r.x?e:n,t)})),[...e,...n].forEach(((t,e)=>{var n;const{start:s,end:r,size:a=4,gap:o=5,style:l={}}=t,h=I(t,["start","end","size","gap","style"]),c=ca({}),d=s.x===r.x;let u,p,g,f;d?(u={x:s.x-o/2,y:s.y},p={x:r.x-o/2,y:r.y},g={x:s.x+o/2,y:s.y},f={x:r.x+o/2,y:r.y}):(u={x:s.x,y:s.y-o/2},p={x:r.x,y:r.y-o/2},g={x:s.x,y:s.y+o/2},f={x:r.x,y:r.y+o/2});const m=dm(u,p,a,d?75:15,d),y=dm(s,r,a,d?75:15,d),b=dm(g,f,a,d?75:15,d);c.add(po(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(po(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(po({path:y,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=h,i.isValid(h.axisId)&&(c.id=`${null!==(n=h.axisId)&&void 0!==n?n:""}_${e}`),this.add(c)}))}}function pm(t,e,i=1){return Math.abs(t-e)<i}function gm(t,e){return{type:"component",componentType:cm,interactive:!0,zIndex:500,style:{data:(n,s)=>{const r=[],a=s.vchart.getChart(),o="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,n)=>{var s,l;const h=t.id,c=i.isValid(h)?a.getComponentByUserId(h):e&&i.isValid(e[n])?a.getComponentByIndex("axes",e[n]):null===(s=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===s?void 0:s[0];if(!c)return;const d=null!=h?h:`${c.type}-${c.id}`,u=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());i.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,s=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(s+l)/2+(o?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const a=t.AABBBounds;let c,p,g,f,m=!1;o?(m=a.x1<(s+l-n)/2&&a.x2>(s+l+n)/2,c=h,p=Math.max(a.y1+u.y1-2,u.y1),g=h,f=Math.min(a.y2+u.y1+2,u.y2)):(m=a.y1<(s+l-n)/2&&a.y2>(s+l+n)/2,c=Math.max(a.x1+u.x1-2,u.x1),p=h,g=Math.min(a.x2+u.x1+2,u.x2),f=h),m&&r.push({start:{x:c,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{mm(t,"line").forEach((t=>{fm(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t).forEach((t=>{let s,a;o?(s={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(s={x:Math.max(t[0]+u.x1-10,u.x1),y:h},a={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),r.push({start:s,end:a,gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{mm(t,"area").forEach((t=>{const a=fm(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let s=0;s<a.length-1;s++){const l={x:a[s][0],y:a[s][1]},h={x:a[s+1][0],y:a[s+1][1]};if(ym(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,s;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},s={x:h.x+u.x1,y:Math.min(h.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},s={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),r.push({start:t,end:s,gap:n,style:null==i?void 0:i.style,axisId:d,data:e})}}}))}))}}))}))})),r}}}}function fm(t,e){const n=[];for(let s=1;s<e.length;s++){const r=i.getIntersectPoint([t.start.x,t.start.y],[t.end.x,t.end.y],[e[s].x,e[s].y],[e[s-1].x,e[s-1].y]);r&&!n.find((t=>pm(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&n.push(r)}return n}function mm(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 ym(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 bm="barLink";class vm extends Uf{constructor(){super(...arguments),this.name=bm}render(){const{data:t,linkStyle:n,areaStyle:s,styleMap:r,label:a,linkType:o="total"}=this.attribute;i.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,l)=>{var h,c,d,u,p;const{linePoints:g,areaPoints:f,id:m=l,color:y,data:b}=t;if(f&&!1!==(null===(h=null==r?void 0:r[`area-${m}`])||void 0===h?void 0:h.visible)){const t=(v=Object.assign(Object.assign({points:f,fillOpacity:.3,fill:y,zIndex:0},s),null==r?void 0:r[`area-${m}`]),new fo(v));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}var v;if(g&&!1!==(null===(c=null==r?void 0:r[`line-${m}`])||void 0===c?void 0:c.visible)&&0!==(null===(d=null==n?void 0:n.lineStyle)||void 0===d?void 0:d.lineWidth)&&0!==(null===(u=null==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:s}=n||{},a=i.cloneDeep(t),o=i.cloneDeep(e);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new Jf({points:g,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==a?void 0:a.visible)&&!1!==(null===(p=null==r?void 0:r[`label-${m}`])||void 0===p?void 0:p.visible)){const{style:t,formatMethod:i}=a,[n,s]=b;let l=n[e.STACK_FIELD_END],h=s[e.STACK_FIELD_END];"value"===o&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START]);const c=h-l,d=(h-l)/l*100,u=ja(Object.assign(Object.assign({x:.5*(g[0].x+g[1].x),y:.5*(g[0].y+g[1].y),text:i?i(c,d,b):`${c} ${d}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==r?void 0:r[`label-${m}`]));u.name="bar-link-label",u.id=`label-${m}`,this.add(u)}})))}}function xm(t,i,n){const{isHorizontal:s,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=n,d=t.AABBBounds,u=i.AABBBounds;let p,g;return s?(p=[{x:(d.x1+d.x2)/2+h,y:d.y1+c},{x:(u.x1+u.x2)/2+h,y:u.y2+c}],r?("total"===o&&(p=[{x:d.x1+h,y:d.y1+c},{x:u.x1+h,y:u.y2+c}]),l&&(g=[{x:d.x1+h,x1:d.x2+h,y:d.y1+c},{x:u.x1+h,x1:u.x2+h,y:u.y2+c}])):("total"===o&&(p=[{x:d.x2+h,y:d.y1+c},{x:u.x2+h,y:u.y2+c}]),l&&(g=[{x:d.x2+h,x1:d.x1+h,y:d.y1+c},{x:u.x2+h,x1:u.x1+h,y:u.y2+c}]))):(p=[{x:d.x2+h,y:(d.y1+d.y2)/2+c},{x:u.x1+h,y:(u.y1+u.y2)/2+c}],a?("total"===o&&(p=[{x:d.x2+h,y:d.y2+c},{x:u.x1+h,y:u.y2+c}]),l&&(g=[{x:d.x2+h,y:d.y2+c,y1:d.y1+c},{x:u.x1+h,y:u.y2+c,y1:u.y1+c}])):("total"===o&&(p=[{x:d.x2+h,y:d.y1+c},{x:u.x1+h,y:u.y1+c}]),l&&(g=[{x:d.x2+h,y:d.y1+c,y1:d.y2+c},{x:u.x1+h,y:u.y1+c,y1:u.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function _m(t={},i){const{linkType:n="total",doFill:s}=t,r=I(t,["linkType","doFill"]);return{type:"component",componentType:bm,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;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const n={};for(let s=0;s<t.length;s++){const r=t[s],a=e.getDatumOfGraphic(r),o=i.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)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],d="horizontal"===c.direction,u=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(d){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=xm(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,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=xm(t,i[l],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const Am="seriesLabel";function Sm(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 Tm(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function wm(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(Tm(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 Mm(t,e){const{label:n,line:s}=e;return{type:"component",componentType:Am,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,n)=>{var s;const r=n.vchart.getChart(),a=r.getAllSeries()[0],o="horizontal"===a.direction,l=o?a.getYAxisHelper():a.getXAxisHelper(),h=null===(s=l.getScale)||void 0===s?void 0:s.call(l,0),c=l.isInverse(),d=a.getDimensionField()[0],u=a.getSeriesField(),p=r.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),g=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?i.last(h.domain()):h.domain()[0],n=a.getRegion(),{x:s,y:l}=n.getLayoutStartPoint();let f=0;r.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===p[0]?"bar":p[0]).getGraphics().forEach((n=>{var r;const a=n.context.data.find((t=>t[d]===e));if(a){const e=n.AABBBounds;let h,m,y,b;"bar"===p[0]||"waterfall"===p[0]?(h="end"===t?{x:o?(e.x1+e.x2)/2:c?e.x1:e.x2,y:o?c?e.y2:e.y1:(e.y1+e.y2)/2}:{x:o?(e.x1+e.x2)/2:c?e.x2:e.x1,y:o?c?e.y1:e.y2:(e.y1+e.y2)/2},m=n.attribute.fill):(h=i.dataToPosition(a),m=n.attribute.stroke||n.attribute.fill),"end"===t?(y=o?"center":c?"end":"start",b=o?c?"top":"bottom":"middle"):(y=o?"center":c?"start":"end",b=o?c?"bottom":"top":"middle");const v=null!==(r=a[u])&&void 0!==r?r:a[d];g.push({point:{x:h.x+s,y:h.y+l},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:a,id:`${t}-${f}`,position:t}),f++}}))}))}))}return g},line:s,label:Object.assign({space:12},n)}}}class Bm extends Uf{constructor(){super(...arguments),this.name=Am}render(){var t,e,n,s;this.removeAllChild();const{data:r,layout:a,label:o,line:l={}}=this.attribute;if(i.isEmpty(r))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},c={},d=r.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(n=null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.fontSize)&&void 0!==n?n:12),i=(t,e,i)=>{var n,s,r,a,o,l,h,c;const{label:d,color:u,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=ja(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(d,t.datum,{series:t.series}):d},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,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:u}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const n=d.filter((t=>t.position===e)),s=Sm(n.map((t=>t.point.y)),t);n.forEach(((t,e)=>{var n;const r={x:t.point.x+(null!==(n=null==o?void 0:o.space)&&void 0!==n?n:8)*("start"===t.textAlign?1:-1),y:s[e]};i(t,r,h),c[t.id]=r}))}))}else{const t=[],e=[];d.forEach((i=>{var n,s,r,a,l;const{point:c,label:d,color:u,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(s=null===(n=h[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==o?void 0:o.formatMethod,v=ja(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(d,i.datum,{series:i.series}):d},null==o?void 0:o.style),y),{textAlign:p,textBaseline:g,fill:null!==(a=null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:u}),null===(l=h[f])||void 0===l?void 0:l.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&wm(t,4,10),e.length&&wm(e,4,10);const i=null!==(s=null==o?void 0:o.space)&&void 0!==s?s:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&d.forEach((t=>{var e,i,n,s,r,o;const{point:d,color:u,id:p}=t,g={x:c[p].x+(null!==(n=null===(i=null===(e=h[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:c[p].y+(null!==(o=null===(r=null===(s=h[p])||void 0===s?void 0:s.style)||void 0===r?void 0:r.dy)&&void 0!==o?o:0)};if(!1!==l.autoVisible){if("vertical"===a&&d.y!==g.y||"horizontal"===a&&d.x!==g.x){const t=Ga(Object.assign({points:[d,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}else{const t=Ga(Object.assign({points:[d,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}))}}function Cm(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function km(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Pm(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:km(t.rect),anchorCandidates:Dm(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const s=i[t],r=s.bound;let a=n.some((t=>Cm(t,r)));if(s.anchorCandidates)if(a&&(null===(e=s.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<s.anchorCandidates.length;t++){const e=s.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>Cm(t,i)))){n.push(i),a=!1;break}}a&&n.push(s.bound)}else n.push(s.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Om(t,e,n){const s=t.map((t=>t.pointCoord)),{x1:r,x2:a,y1:o,y2:l}=i.getAABBFromPoints(s),h=n([(r+a)/2,(o+l)/2]);if(!h)return[];const c=t.map((t=>{const s=t.rect,r=Im(e,t.pointCoord)?n(function(t,e,n,s=200){const r=5621/s;let a=e;for(let e=1;e<=r;e++){const e=i.destination(a,s,n);if(!Im(t,e))return[e.x,e.y];a=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Rm(Lm(t.point,h)))):t.point;r&&(s.x=r.x,s.y=r.y);const a=Rm(Lm(t.point,h));let o;const l=[];return a>=-45&&a<45?(o="top",l.push("left","right")):a>=45&&a<135?o="right":a>=-135&&a<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),t.anchors=l,t.offset=20,t.rect=Em(t.rect,o,0),t}));return Pm(c)}function Rm(t){return t>180?t-360:t}function Lm(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Im(t,e){for(let n=0;n<t.length;n++){if(i.isPointInPolygon(e,t[n]))return!0}return!1}function Em(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Dm(t,e,i,n=0){const s=[];return t.forEach((t=>{const{x:r,y:a}=Em(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);s.push({x:r,y:a})})),s}const Fm={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class jm extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return Fm}}class Um extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=jm,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&i.isValid(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,s,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(s=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===s?void 0:s.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new L(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const n=new hm({position:void 0,animation:!1});return n&&(n.name=`${this.name}_marker_${e}`,n.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,n.setAttribute("zIndex",this.layoutZIndex)),n})));this._markerComponents.forEach(((t,n)=>{const{pairInfo:s,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[n],n);s&&e.push(s),r&&i.push(r)}));const n=this._layoutLabels(e);this._layoutMarkers(n,i),this._renderMarkers()}_evaluateMarker(t,n){var s,r,a,o,l,h,c,d,u,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Co.group({});if(k.name=`${this.name}_marker_itemContainer_${n}`,B.container=k,null===(r=this._spec.background)||void 0===r?void 0:r.visible){const t=Co.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(a=this._spec.icon)||void 0===a?void 0:a.visible){const t=Co.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(l=null===(o=this._spec.icon.style)||void 0===o?void 0:o.symbolType)&&void 0!==l?l:null===(h=this._spec.icon.style)||void 0===h?void 0:h.shape);const i=t.AABBBounds,n=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,s=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;B.icon=t,k.appendChild(t),A=n,_+=s,b++}if(null===(u=this._spec.nameLabel)||void 0===u?void 0:u.visible){const i=Co.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,s=null!==(p=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==p?p:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&i.isValid(t[this.valueField])){const i=Co.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,s=null!==(m=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==m?m:0,r=null!==(y=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,s),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:n};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Em(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var n,s,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:d}=i[a],u=t[a],p=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),g=this._spec.space||0,f=u.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,n;if(t){const s=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=s.x2-s.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(n=s.x2-s.x1)&&void 0!==n?n:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:u.width,height:u.height}),null==d||d.setAttributes({dx:-u.width/2,dy:-u.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:u.x+u.width/2-b.x,offsetY:u.y+u.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Om(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Pm(t)}_isRelativeModel(t){var e,i,n;const s=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===s}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}Um.type="mapLabel",Um.specKey="mapLabel",Um.transformerConstructor=jm;t.BAR_LINK=bm,t.Bar3dChart=qu,t.Bar3dChartSpecTransformer=ot,t.Bar3dSeries=Gu,t.Bar3dSeriesSpecTransformer=Hh,t.BarLinkComponent=vm,t.ConversionFunnelChart=Y,t.ConversionFunnelSeries=q,t.DefaultBandWidth=6,t.Funnel3dChart=ep,t.Funnel3dSeries=Qu,t.Funnel3dSeriesSpecTransformer=Ku,t.Histogram3dChart=ip,t.ImageCloudChart=Ff,t.MapLabelComponent=Um,t.PictogramChart=kg,t.PictogramChartSpecTransformer=lg,t.PictogramSeries=Bg,t.Pie3dChart=hp,t.Pie3dChartSpecTransformer=np,t.Pie3dSeries=op,t.Pie3dSeriesSpecTransformer=ap,t.RangeColumn3dChart=ng,t.RangeColumn3dChartSpecTransformer=ig,t.RangeColumn3dSeries=Qp,t.RangeColumn3dSeriesSpecTransformer=eg,t.RankingBar=a,t.RankingList=g,t.SERIES_BREAK=cm,t.SequenceScatterKDE=it,t.SequenceScatterLink=Z,t.SequenceScatterPixel=at,t.SeriesBreakComponent=um,t.SeriesLabelComponent=Bm,t.WordCloud3dChart=Vp,t.WordCloud3dChartSpecTransformer=zp,t.WordCloud3dSeries=Up,t.appendBarLinkConfig=function(t,e){t.customMark=i.array(t.customMark).filter((t=>t.componentType!==bm)),t.customMark.push(_m(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=i.array(t.customMark).filter((t=>t.componentType!==cm)),t.customMark.push(gm(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var n,s,r;if(t.customMark=i.array(t.customMark).filter((t=>t.componentType!==Am)),e||(e=null!==(r=null!==(n=i.get(t,Am))&&void 0!==n?n:i.get(null===(s=t.series)||void 0===s?void 0:s[0],Am))&&void 0!==r?r:{}),e.visible){const{position:i="end"}=e,n=I(e,["position"]);t.customMark.push(Mm(i,n))}},t.clearSVGSource=function(){hg.clear(),cg=null},t.getBarLinkConfig=_m,t.getSVGSource=pg,t.getSeriesBreakConfig=gm,t.getSeriesLabelConfig=Mm,t.register3DPlugin=Vh,t.registerAxis3dPlugin=()=>{Vh(),Yu(),e.Factory.registerComponent(e.CartesianBandAxis.type,Yp,!1),e.Factory.registerComponent(e.CartesianLinearAxis.type,qp,!1),e.Factory.registerComponent(e.CartesianTimeAxis.type,Zp,!1),e.Factory.registerComponent(e.CartesianSymlogAxis.type,Kp,!1),e.Factory.registerComponent(e.CartesianLogAxis.type,$p,!1)},t.registerBar3dChart=()=>{Vh(),Yu(),Hu(),e.Factory.registerChart(qu.type,qu)},t.registerBar3dSeries=Hu,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(bm,(t=>new vm(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([Y]),i.useSeries([q]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),Vh(),Yu(),tp(),e.Factory.registerChart(ep.type,ep)},t.registerFunnel3dSeries=tp,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Vh(),Yu(),Hu(),e.Factory.registerChart(ip.type,ip)},t.registerImageCloudChart=()=>{Df(),e.Factory.registerChart(Ff.type,Ff)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([Um])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Cg(),e.Factory.registerChart(kg.type,kg)},t.registerPictogramSeries=Cg,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),Vh(),Yu(),lp(),e.Factory.registerChart(hp.type,hp)},t.registerPie3dSeries=lp,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Vh(),Yu(),tg(),e.Factory.registerChart(ng.type,ng)},t.registerRangeColumn3dSeries=tg,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([g,e.BarChart])},t.registerSVGSource=dg,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([it,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Z,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([at,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new um(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Bm(t)))},t.registerWordCloud3dChart=Gp,t.registerWordCloud3dSeries=Np,t.registerWordCloudShape3dChart=()=>{Vh(),Wp(),Gp()},t.registerWordCloudShape3dSeries=Wp,t.svgSourceMap=hg,t.unregisterSVGSource=ug}));
|