From 644220b2043bf519efcb52e92b62966d19f0d7f3 Mon Sep 17 00:00:00 2001 From: pvictor Date: Wed, 6 Nov 2024 09:26:16 +0100 Subject: [PATCH] Updated @visactor/vchart to 1.12.10 --- DESCRIPTION | 2 +- NEWS.md | 4 + README.md | 6 + inst/htmlwidgets/vchart.js | 2 +- package-lock.json | 248 ++++++++++++++++++------------------- package.json | 2 +- 6 files changed, 137 insertions(+), 127 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a3a3db0..dfacf07 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: vchartr Title: Interactive Charts with the 'JavaScript' 'VChart' Library -Version: 0.1.3 +Version: 0.1.3.9000 Authors@R: c( person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")), person("Fanny", "Meyer", role = "aut")) diff --git a/NEWS.md b/NEWS.md index df2c146..19cfe2c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# vchartr 0.1.4 + +* Updated @visactor/vchart to 1.12.10 (https://github.com/VisActor/VChart/releases). + # vchartr 0.1.3 * CRAN requests taken into account diff --git a/README.md b/README.md index 92ed147..2e1be93 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ ## Installation +Install from [CRAN](https://CRAN.R-project.org/package=vchartr) with: + +```r +install.packages("vchartr") +``` + You can install the development version of vchartr from [GitHub](https://github.com/dreamRs/vchartr) with: ```r diff --git a/inst/htmlwidgets/vchart.js b/inst/htmlwidgets/vchart.js index 65cf8cc..6b7c143 100644 --- a/inst/htmlwidgets/vchart.js +++ b/inst/htmlwidgets/vchart.js @@ -1 +1 @@ -(()=>{var t={8932:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var s=i(1601),n=i.n(s),r=i(6314),a=i.n(r)()(n());a.push([t.id,":root{--ss-primary-color: #5897fb;--ss-bg-color: #ffffff;--ss-font-color: #4d4d4d;--ss-font-placeholder-color: #8d8d8d;--ss-disabled-color: #dcdee2;--ss-border-color: #dcdee2;--ss-highlight-color: #fffb8c;--ss-success-color: #00b755;--ss-error-color: #dc3545;--ss-focus-color: #5897fb;--ss-main-height: 30px;--ss-content-height: 300px;--ss-spacing-l: 7px;--ss-spacing-m: 5px;--ss-spacing-s: 3px;--ss-animation-timing: 0.2s;--ss-border-radius: 4px}@keyframes ss-valueIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes ss-valueOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.ss-hide{display:none !important}.ss-main{display:flex;flex-direction:row;position:relative;user-select:none;color:var(--ss-font-color);min-height:var(--ss-main-height);width:100%;padding:var(--ss-spacing-s);cursor:pointer;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;box-sizing:border-box;transition:background-color var(--ss-animation-timing);overflow:hidden}.ss-main:focus{box-shadow:0 0 5px var(--ss-focus-color)}.ss-main.ss-disabled{background-color:var(--ss-disabled-color);cursor:not-allowed}.ss-main.ss-disabled .ss-values .ss-disabled{color:var(--ss-font-color)}.ss-main.ss-disabled .ss-values .ss-value .ss-value-delete{cursor:not-allowed}.ss-main.ss-open-above{border-top-left-radius:0px;border-top-right-radius:0px}.ss-main.ss-open-below{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.ss-main .ss-values{display:inline-flex;flex-wrap:wrap;gap:var(--ss-spacing-m);flex:1 1 100%}.ss-main .ss-values .ss-placeholder{display:flex;padding:var(--ss-spacing-s) var(--ss-spacing-m) var(--ss-spacing-s) var(--ss-spacing-m);margin:auto 0px auto 0px;line-height:1em;align-items:center;width:100%;color:var(--ss-font-placeholder-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ss-main .ss-values .ss-max{display:flex;user-select:none;align-items:center;width:fit-content;font-size:12px;color:var(--ss-bg-color);line-height:1;padding:var(--ss-spacing-s) var(--ss-spacing-m);background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius)}.ss-main .ss-values .ss-single{display:flex;margin:auto 0px auto var(--ss-spacing-s)}.ss-main .ss-values .ss-value{display:flex;user-select:none;align-items:center;width:fit-content;background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius);animation-name:ss-valueIn;animation-duration:var(--ss-animation-timing);animation-timing-function:ease-out;animation-fill-mode:both}.ss-main .ss-values .ss-value.ss-value-out{animation-name:ss-valueOut;animation-duration:var(--ss-animation-timing);animation-timing-function:ease-out}.ss-main .ss-values .ss-value .ss-value-text{font-size:12px;color:var(--ss-bg-color);line-height:1;padding:var(--ss-spacing-s) var(--ss-spacing-m)}.ss-main .ss-values .ss-value .ss-value-delete{display:flex;align-items:center;height:var(--ss-spacing-l);width:var(--ss-spacing-l);padding:var(--ss-spacing-s) var(--ss-spacing-m);cursor:pointer;border-left:solid 1px var(--ss-bg-color);box-sizing:content-box}.ss-main .ss-values .ss-value .ss-value-delete svg{height:var(--ss-spacing-l);width:var(--ss-spacing-l)}.ss-main .ss-values .ss-value .ss-value-delete svg path{fill:none;stroke:var(--ss-bg-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-deselect{flex:0 1 auto;display:flex;align-items:center;justify-content:center;width:fit-content;height:auto;padding:0 var(--ss-spacing-m) 0 var(--ss-spacing-m)}.ss-main .ss-deselect svg{width:8px;height:8px}.ss-main .ss-deselect svg path{fill:none;stroke:var(--ss-font-color);stroke-width:20;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-arrow{flex:0 1 auto;display:flex;align-items:center;justify-content:flex-end;width:12px;height:12px;margin:auto var(--ss-spacing-m) auto var(--ss-spacing-m)}.ss-main .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;transition-timing-function:ease-out;transition:var(--ss-animation-timing)}.ss-content{position:absolute;display:flex;height:auto;flex-direction:column;width:auto;max-height:var(--ss-content-height);box-sizing:border-box;border:solid 1px var(--ss-border-color);background-color:var(--ss-bg-color);transition:transform var(--ss-animation-timing),opacity var(--ss-animation-timing);opacity:0;transform:scaleY(0);transform-origin:center top;overflow:hidden;z-index:10000}.ss-content.ss-relative{position:relative;height:100%}.ss-content.ss-open-above{flex-direction:column-reverse;opacity:1;transform:scaleY(1);transform-origin:center bottom;border-top-left-radius:var(--ss-border-radius);border-top-right-radius:var(--ss-border-radius)}.ss-content.ss-open-below{opacity:1;transform:scaleY(1);transform-origin:center top;border-bottom-left-radius:var(--ss-border-radius);border-bottom-right-radius:var(--ss-border-radius)}.ss-content .ss-search{flex:0 1 auto;display:flex;flex-direction:row;padding:var(--ss-spacing-l) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l)}.ss-content .ss-search input{display:inline-flex;font-size:inherit;line-height:inherit;flex:1 1 auto;width:100%;min-width:0px;padding:var(--ss-spacing-m) var(--ss-spacing-l);margin:0;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;text-align:left;box-sizing:border-box}.ss-content .ss-search input::placeholder{color:var(--ss-font-placeholder-color);vertical-align:middle}.ss-content .ss-search input:focus{box-shadow:0 0 5px var(--ss-focus-color)}.ss-content .ss-search .ss-addable{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;flex:0 0 auto;height:auto;margin:0 0 0 var(--ss-spacing-m);border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius)}.ss-content .ss-search .ss-addable svg{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;width:12px;height:12px;margin:auto var(--ss-spacing-m) auto var(--ss-spacing-m)}.ss-content .ss-search .ss-addable svg path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-content .ss-list{flex:1 1 auto;height:auto;overflow-x:hidden;overflow-y:auto}.ss-content .ss-list .ss-error{color:var(--ss-error-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-searching{color:var(--ss-font-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup.ss-close .ss-option{display:none !important}.ss-content .ss-list .ss-optgroup .ss-optgroup-label{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-label-text{flex:1 1 auto;font-weight:bold;color:var(--ss-font-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label:has(.ss-arrow){cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions{flex:0 1 auto;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ss-spacing-m)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall{flex:0 0 auto;display:flex;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall:hover{opacity:.5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall.ss-selected svg path{stroke:var(--ss-error-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall span{flex:0 1 auto;display:flex;align-items:center;justify-content:center;font-size:60%;text-align:center;padding:0 var(--ss-spacing-s) 0 0}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg{flex:0 1 auto;width:13px;height:13px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg path{fill:none;stroke:var(--ss-success-color);stroke-linecap:round;stroke-linejoin:round}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:first-child{stroke-width:5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:last-child{stroke-width:11}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable{flex:0 1 auto;display:flex;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow{flex:1 1 auto;width:10px;height:10px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;transition-timing-function:ease-out;transition:var(--ss-animation-timing)}.ss-content .ss-list .ss-optgroup .ss-option{padding:var(--ss-spacing-s) var(--ss-spacing-s) var(--ss-spacing-s) calc(var(--ss-spacing-l)*3)}.ss-content .ss-list .ss-option{display:block;padding:var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l);white-space:normal;color:var(--ss-font-color);cursor:pointer;user-select:none}.ss-content .ss-list .ss-option:hover{color:var(--ss-bg-color);background-color:var(--ss-primary-color)}.ss-content .ss-list .ss-option.ss-highlighted,.ss-content .ss-list .ss-option:not(.ss-disabled).ss-selected{color:var(--ss-bg-color);background-color:var(--ss-primary-color)}.ss-content .ss-list .ss-option.ss-disabled{cursor:not-allowed;background-color:var(--ss-disabled-color)}.ss-content .ss-list .ss-option.ss-disabled:hover{color:var(--ss-font-color)}.ss-content .ss-list .ss-option .ss-search-highlight{display:inline-block;background-color:var(--ss-highlight-color)}\n",""]);const o=a},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",s=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),s&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),s&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,s,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),n&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=n):d[4]="".concat(n)),e.push(d))}},e}},1601:t=>{"use strict";t.exports=function(t){return t[1]}},4353:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",s="second",n="minute",r="hour",a="day",o="week",l="month",h="quarter",d="year",c="date",u="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},_=function(t,e,i){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(i)+t},f={s:_,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),s=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+_(s,2,"0")+":"+_(n,2,"0")},m:function t(e,i){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,n=o}return!s&&n&&(v=n),n||!s&&v},M=function(t,e){if(x(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new A(i)},k=f;k.l=S,k.i=x,k.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function m(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var _=m.prototype;return _.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(p);if(s){var n=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(e)}(t),this.init()},_.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},_.$utils=function(){return k},_.isValid=function(){return!(this.$d.toString()===u)},_.isSame=function(t,e){var i=M(t);return this.startOf(e)<=i&&i<=this.endOf(e)},_.isAfter=function(t,e){return M(t)12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},3309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-iq",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},9865:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-kw",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},5592:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},meridiem:function(t){return t>12?"م":"ص"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},1289:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},539:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},4405:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},2338:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:i,monthsShort:i,weekStart:6,meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(r,null,!0),r}(i(4353))},1130:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},9990:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bg",weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekStart:1,ordinal:function(t){var e=t%100;if(e>10&&e<20)return t+"-ти";var i=t%10;return 1===i?t+"-ви":2===i?t+"-ри":7===i||8===i?t+"-ми":t+"-ти"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5944:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return e.default.locale(i,null,!0),i}(i(4353))},1092:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4608:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn-bd",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),weekStart:0,preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){var e=["ই","লা","রা","ঠা","শে"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY খ্রিস্টাব্দ",LL:"D MMMM YYYY খ্রিস্টাব্দ",LLL:"D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়",LLLL:"dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়"},meridiem:function(t){return t<4?"রাত":t<6?"ভোর":t<12?"সকাল":t<15?"দুপুর":t<18?"বিকাল":t<20?"সন্ধ্যা":"রাত"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},2509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){return t},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},9294:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔོན་ལ་",s:"ཏོག་ཙམ་",m:"སྐར་མ་གཅིག་",mm:"སྐར་མ་ %d",h:"ཆུ་ཚོད་གཅིག་",hh:"ཆུ་ཚོད་ %d",d:"ཉིན་གཅིག་",dd:"ཉིན་ %d",M:"ཟླ་བ་གཅིག་",MM:"ཟླ་བ་ %d",y:"ལོ་གཅིག་",yy:"ལོ་ %d"}};return e.default.locale(i,null,!0),i}(i(4353))},2745:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>9?i(t%10):t}function s(t,e,i){return t+" "+function(t,e){return 2===e?function(t){return{m:"v",b:"v",d:"z"}[t.charAt(0)]+t.substring(1)}(t):t}({mm:"munutenn",MM:"miz",dd:"devezh"}[i],t)}var n={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:s,h:"un eur",hh:"%d eur",d:"un devezh",dd:s,M:"ur miz",MM:s,y:"ur bloaz",yy:function(t){switch(i(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}},meridiem:function(t){return t<12?"a.m.":"g.m."}};return e.default.locale(n,null,!0),n}(i(4353))},5530:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5993:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(t){return t+(1===t||3===t?"r":2===t?"n":4===t?"t":"è")}};return e.default.locale(i,null,!0),i}(i(4353))},9751:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekund":"pár sekundami";case"m":return e?"minuta":n?"minutu":"minutou";case"mm":return e||n?r+(i(t)?"minuty":"minut"):r+"minutami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodin"):r+"hodinami";case"d":return e||n?"den":"dnem";case"dd":return e||n?r+(i(t)?"dny":"dní"):r+"dny";case"M":return e||n?"měsíc":"měsícem";case"MM":return e||n?r+(i(t)?"měsíce":"měsíců"):r+"měsíci";case"y":return e||n?"rok":"rokem";case"yy":return e||n?r+(i(t)?"roky":"let"):r+"lety"}}var n={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},4780:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5681:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return e.default.locale(i,null,!0),i}(i(4353))},2706:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2878:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},3672:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},494:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},2187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4072:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(t){return t},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},9881:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},1995:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2026:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},7329:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},7690:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},912:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5571:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2673:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-sg",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2619:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}}}()},3713:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return e.default.locale(i,null,!0),i}(i(4353))},1219:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},4719:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-mx",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},3532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},2498:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},7317:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},4288:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return e?(n[i][2]?n[i][2]:n[i][1]).replace("%d",t):(s?n[i][0]:n[i][1]).replace("%d",t)}var s={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:"%d päeva",M:i,MM:i,y:i,yy:i},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},4007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return e.default.locale(i,null,!0),i}(i(4353))},292:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fa",weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},9964:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},r={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},a=s&&!e?r:n,o=a[i];return t<10?o.replace("%d",a.numbers[t]):o.replace("%d",t)}var s={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"%s päästä",past:"%s sitten",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return e.default.locale(s,null,!0),s}(i(4353))},7674:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return e.default.locale(i,null,!0),i}(i(4353))},6290:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},3433:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},813:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return e.default.locale(i,null,!0),i}(i(4353))},9836:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return e.default.locale(i,null,!0),i}(i(4353))},4061:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return e.default.locale(i,null,!0),i}(i(4353))},8418:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return e.default.locale(i,null,!0),i}(i(4353))},3562:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},8660:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return e.default.locale(i,null,!0),i}(i(4353))},7409:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return e.default.locale(i,null,!0),i}(i(4353))},2010:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",hh2:"שעתיים",d:"יום",dd:"%d ימים",dd2:"יומיים",M:"חודש",MM:"%d חודשים",MM2:"חודשיים",y:"שנה",yy:"%d שנים",yy2:"שנתיים"};function s(t,e,s){return(i[s+(2===t?"2":"")]||i[s]).replace("%d",t)}var n={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinal:function(t){return t},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return e.default.locale(n,null,!0),n}(i(4353))},2830:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return e.default.locale(i,null,!0),i}(i(4353))},5811:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),s="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:r,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(t){return t+"."}};return e.default.locale(a,null,!0),a}(i(4353))},8809:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return e.default.locale(i,null,!0),i}(i(4353))},8298:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:function(t,e,i,s){return"néhány másodperc"+(s||e?"":"e")},m:function(t,e,i,s){return"egy perc"+(s||e?"":"e")},mm:function(t,e,i,s){return t+" perc"+(s||e?"":"e")},h:function(t,e,i,s){return"egy "+(s||e?"óra":"órája")},hh:function(t,e,i,s){return t+" "+(s||e?"óra":"órája")},d:function(t,e,i,s){return"egy "+(s||e?"nap":"napja")},dd:function(t,e,i,s){return t+" "+(s||e?"nap":"napja")},M:function(t,e,i,s){return"egy "+(s||e?"hónap":"hónapja")},MM:function(t,e,i,s){return t+" "+(s||e?"hónap":"hónapja")},y:function(t,e,i,s){return"egy "+(s||e?"év":"éve")},yy:function(t,e,i,s){return t+" "+(s||e?"év":"éve")}},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return e.default.locale(i,null,!0),i}(i(4353))},7420:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},5513:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:["nokkrar sekúndur","nokkrar sekúndur","nokkrum sekúndum"],m:["mínúta","mínútu","mínútu"],mm:["mínútur","mínútur","mínútum"],h:["klukkustund","klukkustund","klukkustund"],hh:["klukkustundir","klukkustundir","klukkustundum"],d:["dagur","dag","degi"],dd:["dagar","daga","dögum"],M:["mánuður","mánuð","mánuði"],MM:["mánuðir","mánuði","mánuðum"],y:["ár","ár","ári"],yy:["ár","ár","árum"]};function s(t,e,s,n){var r=function(t,e,s,n){var r=n?0:s?1:2,a=2===t.length&&e%10==1?t[0]:t,o=i[a][r];return 1===t.length?o:"%d "+o}(s,t,n,e);return r.replace("%d",t)}var n={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9286:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};return e.default.locale(i,null,!0),i}(i(4353))},3900:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},952:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t){return t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(t){return t<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return e.default.locale(i,null,!0),i}(i(4353))},7741:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return e.default.locale(i,null,!0),i}(i(4353))},6481:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1335:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},6101:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return e.default.locale(i,null,!0),i}(i(4353))},6364:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return e.default.locale(i,null,!0),i}(i(4353))},8003:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(t){return t+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(t){return t<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return e.default.locale(i,null,!0),i}(i(4353))},6605:function(t,e,i){!function(t,e){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(e),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],a={name:"ku",months:r,monthsShort:r,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(t){return t<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};i.default.locale(a,null,!0),t.default=a,t.englishToArabicNumbersMap=s,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(4353))},4457:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return e.default.locale(i,null,!0),i}(i(4353))},8615:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return e.default.locale(i,null,!0),i}(i(4353))},3860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return e.default.locale(i,null,!0),i}(i(4353))},4485:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),s="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),n=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:r,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"mėnesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return e.default.locale(a,null,!0),a}(i(4353))},6467:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return e.default.locale(i,null,!0),i}(i(4353))},623:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},2739:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return e.default.locale(i,null,!0),i}(i(4353))},5877:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5376:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return e.default.locale(i,null,!0),i}(i(4353))},2698:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return e.default.locale(i,null,!0),i}(i(4353))},6462:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return e.default.locale(i,null,!0),i}(i(4353))},6400:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return e.default.locale(i,null,!0),i}(i(4353))},9677:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},9464:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return e.default.locale(i,null,!0),i}(i(4353))},6803:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return e.default.locale(i,null,!0),i}(i(4353))},7205:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},880:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(t){return(""+t).replace(/\d/g,(function(t){return"०१२३४५६७८९"[t]}))},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return e.default.locale(i,null,!0),i}(i(4353))},465:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},9423:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(t){return"["+t+(1===t||8===t||t>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},3473:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},9252:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return e.default.locale(i,null,!0),i}(i(4353))},3225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function s(t,e,s){var n=t+" ";switch(s){case"m":return e?"minuta":"minutę";case"mm":return n+(i(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return n+(i(t)?"godziny":"godzin");case"MM":return n+(i(t)?"miesiące":"miesięcy");case"yy":return n+(i(t)?"lata":"lat")}}var n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),a=/D MMMM/,o=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};o.s=r,o.f=n;var l={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:o,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:s,y:"rok",yy:s},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(l,null,!0),l}(i(4353))},2218:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},2369:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},4509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rn",weekdays:"Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu".split("_"),weekdaysShort:"Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat".split("_"),weekdaysMin:"K7_K1_K2_K3_K4_K5_K6".split("_"),months:"Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama".split("_"),monthsShort:"Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4334:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},2796:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),n="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),r="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),a=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function o(t,e,i){var s,n;return"m"===i?e?"минута":"минуту":t+" "+(s=+t,n={mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var l=function(t,e){return a.test(e)?i[t.month()]:s[t.month()]};l.s=s,l.f=i;var h=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};h.s=r,h.f=n;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:l,monthsShort:h,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:o,mm:o,h:"час",hh:o,d:"день",dd:o,M:"месяц",MM:o,y:"год",yy:o},ordinal:function(t){return t},meridiem:function(t){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"}};return e.default.locale(d,null,!0),d}(i(4353))},5414:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},3222:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},5285:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return e.default.locale(i,null,!0),i}(i(4353))},5665:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),monthsShort:"දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),ordinal:function(t){return t},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"විනාඩිය",mm:"විනාඩි %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6847:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekúnd":"pár sekundami";case"m":return e?"minúta":n?"minútu":"minútou";case"mm":return e||n?r+(i(t)?"minúty":"minút"):r+"minútami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodín"):r+"hodinami";case"d":return e||n?"deň":"dňom";case"dd":return e||n?r+(i(t)?"dni":"dní"):r+"dňami";case"M":return e||n?"mesiac":"mesiacom";case"MM":return e||n?r+(i(t)?"mesiace":"mesiacov"):r+"mesiacmi";case"y":return e||n?"rok":"rokom";case"yy":return e||n?r+(i(t)?"roky":"rokov"):r+"rokmi"}}var n={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9998:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%100==2}function s(t){return t%100==3||t%100==4}function n(t,e,n,r){var a=t+" ";switch(n){case"s":return e||r?"nekaj sekund":"nekaj sekundami";case"m":return e?"ena minuta":"eno minuto";case"mm":return i(t)?a+(e||r?"minuti":"minutama"):s(t)?a+(e||r?"minute":"minutami"):a+(e||r?"minut":"minutami");case"h":return e?"ena ura":"eno uro";case"hh":return i(t)?a+(e||r?"uri":"urama"):s(t)?a+(e||r?"ure":"urami"):a+(e||r?"ur":"urami");case"d":return e||r?"en dan":"enim dnem";case"dd":return i(t)?a+(e||r?"dneva":"dnevoma"):a+(e||r?"dni":"dnevi");case"M":return e||r?"en mesec":"enim mesecem";case"MM":return i(t)?a+(e||r?"meseca":"mesecema"):s(t)?a+(e||r?"mesece":"meseci"):a+(e||r?"mesecev":"meseci");case"y":return e||r?"eno leto":"enim letom";case"yy":return i(t)?a+(e||r?"leti":"letoma"):s(t)?a+(e||r?"leta":"leti"):a+(e||r?"let":"leti")}}var r={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"čez %s",past:"pred %s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n}};return e.default.locale(r,null,!0),r}(i(4353))},5977:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return e.default.locale(i,null,!0),i}(i(4353))},7439:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["један минут","једног минута"],mm:["%d минут","%d минута","%d минута"],h:["један сат","једног сата"],hh:["%d сат","%d сата","%d сати"],d:["један дан","једног дана"],dd:["%d дан","%d дана","%d дана"],M:["један месец","једног месеца"],MM:["%d месец","%d месеца","%d месеци"],y:["једну годину","једне године"],yy:["%d годину","%d године","%d година"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"једна година":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d годину"===a?t+" година":a.replace("%d",t)}},s={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},5616:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["jedan minut","jednog minuta"],mm:["%d minut","%d minuta","%d minuta"],h:["jedan sat","jednog sata"],hh:["%d sat","%d sata","%d sati"],d:["jedan dan","jednog dana"],dd:["%d dan","%d dana","%d dana"],M:["jedan mesec","jednog meseca"],MM:["%d mesec","%d meseca","%d meseci"],y:["jednu godinu","jedne godine"],yy:["%d godinu","%d godine","%d godina"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"jedna godina":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d godinu"===a?t+" godina":a.replace("%d",t)}},s={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},2487:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return e.default.locale(i,null,!0),i}(i(4353))},9160:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv-fi",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY, [kl.] HH.mm",LLLL:"dddd, D. MMMM YYYY, [kl.] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [kl.] HH.mm",llll:"ddd, D. MMM YYYY, [kl.] HH.mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},1340:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2979:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},7250:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return e.default.locale(i,null,!0),i}(i(4353))},7406:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return e.default.locale(i,null,!0),i}(i(4353))},8928:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return e.default.locale(i,null,!0),i}(i(4353))},5012:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return e.default.locale(i,null,!0),i}(i(4353))},7081:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},2544:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},8142:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return e.default.locale(i,null,!0),i}(i(4353))},321:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4895:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},3187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return e.default.locale(i,null,!0),i}(i(4353))},8804:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return e.default.locale(i,null,!0),i}(i(4353))},5084:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return e.default.locale(i,null,!0),i}(i(4353))},9911:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return e.default.locale(i,null,!0),i}(i(4353))},4173:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),s="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function r(t,e,i){var s,n;return"m"===i?e?"хвилина":"хвилину":"h"===i?e?"година":"годину":t+" "+(s=+t,n={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var a=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};a.s=s,a.f=i;var o={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:a,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:r,mm:r,h:r,hh:r,d:"день",dd:r,M:"місяць",MM:r,y:"рік",yy:r},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return e.default.locale(o,null,!0),o}(i(4353))},1750:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},950:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return e.default.locale(i,null,!0),i}(i(4353))},4734:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"%s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return e.default.locale(i,null,!0),i}(i(4353))},860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return e.default.locale(i,null,!0),i}(i(4353))},5760:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return e.default.locale(i,null,!0),i}(i(4353))},7933:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6033:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},122:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},1349:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},6007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},8569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(i,s,n){var r,a=function(t,i,s){void 0===s&&(s={});var n=new Date(t),r=function(t,i){void 0===i&&(i={});var s=i.timeZoneName||"short",n=t+"|"+s,r=e[n];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),e[n]=r),r}(i,s);return r.formatToParts(n)},o=function(e,i){for(var s=a(e,i),r=[],o=0;o=0&&(r[c]=parseInt(d,10))}var u=r[3],p=24===u?0:u,g=r[0]+"-"+r[1]+"-"+r[2]+" "+p+":"+r[4]+":"+r[5]+":000",m=+e;return(n.utc(g).valueOf()-(m-=m%1e3))/6e4},l=s.prototype;l.tz=function(t,e){void 0===t&&(t=r);var i,s=this.utcOffset(),a=this.toDate(),o=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(o))/1e3/60),h=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(h)){if(i=n(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),e){var d=i.utcOffset();i=i.add(s-d,"minute")}}else i=this.utcOffset(0,e);return i.$x.$timezone=t,i},l.offsetName=function(t){var e=this.$x.$timezone||n.tz.guess(),i=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var h=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return h.call(this,t,e);var i=n(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(i,t,e).tz(this.$x.$timezone,!0)},n.tz=function(t,e,i){var s=i&&e,a=i||e||r,l=o(+n(),a);if("string"!=typeof t)return n(t).tz(a);var h=function(t,e,i){var s=t-60*e*1e3,n=o(s,i);if(e===n)return[s,e];var r=o(s-=60*(n-e)*1e3,i);return n===r?[s,n]:[t-60*Math.min(n,r)*1e3,Math.max(n,r)]}(n.utc(t,s).valueOf(),l,a),d=h[0],c=h[1],u=n(d).utcOffset(c);return u.$x.$timezone=a,u},n.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},n.tz.setDefault=function(t){r=t}}}()},3826:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,n,r){var a=n.prototype;r.utc=function(t){return new n({date:t,utc:!0,args:arguments})},a.utc=function(e){var i=r(this.toDate(),{locale:this.$L,utc:!0});return e?i.add(this.utcOffset(),t):i},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var h=a.utcOffset;a.utcOffset=function(s,n){var r=this.$utils().u;if(r(s))return this.$u?0:r(this.$offset)?h.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(e);if(!s)return null;var n=(""+s[0]).match(i)||["-",0,0],r=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===r?a:-a}(s),null===s))return this;var a=Math.abs(s)<=16?60*s:s,o=this;if(n)return o.$offset=a,o.$u=0===s,o;if(0!==s){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(a+l,t)).$offset=a,o.$x.$localOffset=l}else o=this.utc();return o};var d=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var c=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=a.diff;a.diff=function(t,e,i){if(t&&this.$u===t.$u)return u.call(this,t,e,i);var s=this.local(),n=r(t).local();return u.call(s,n,e,i)}}}()},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n{var s=i(833);function n(e,i){var s=e.geometry,n=s.type;if("LineString"===n)s.coordinates=t.exports.simplify(s.coordinates,i);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r{var s=i(1447),n=function(t,e){for(var i=0,r=0,a=1;a<=t.length-2;a++){var o=new s(t[0],t[t.length-1]).perpendicularDistance(t[a]);o>i&&(r=a,i=o)}if(i>e)var l=n(t.slice(0,r),e),h=n(t.slice(r,t.length),e),d=l.concat(h);else d=t.length>1?[t[0],t[t.length-1]]:[t[0]];return d};t.exports=n},1447:t=>{var e=function(t,e){this.p1=t,this.p2=e};e.prototype.rise=function(){return this.p2[1]-this.p1[1]},e.prototype.run=function(){return this.p2[0]-this.p1[0]},e.prototype.slope=function(){return this.rise()/this.run()},e.prototype.yIntercept=function(){return this.p1[1]-this.p1[0]*this.slope(this.p1,this.p2)},e.prototype.isVertical=function(){return!isFinite(this.slope())},e.prototype.isHorizontal=function(){return this.p1[1]==this.p2[1]},e.prototype._perpendicularDistanceHorizontal=function(t){return Math.abs(this.p1[1]-t[1])},e.prototype._perpendicularDistanceVertical=function(t){return Math.abs(this.p1[0]-t[0])},e.prototype._perpendicularDistanceHasSlope=function(t){var e=this.slope(),i=this.yIntercept();return Math.abs(e*t[0]-t[1]+i)/Math.sqrt(Math.pow(e,2)+1)},e.prototype.perpendicularDistance=function(t){return this.isVertical()?this._perpendicularDistanceVertical(t):this.isHorizontal()?this._perpendicularDistanceHorizontal(t):this._perpendicularDistanceHasSlope(t)},t.exports=e},6311:function(t){t.exports=function(){"use strict";class t{constructor(t){t||(t={}),this.main=t.main||"ss-main",this.placeholder=t.placeholder||"ss-placeholder",this.values=t.values||"ss-values",this.single=t.single||"ss-single",this.max=t.max||"ss-max",this.value=t.value||"ss-value",this.valueText=t.valueText||"ss-value-text",this.valueDelete=t.valueDelete||"ss-value-delete",this.valueOut=t.valueOut||"ss-value-out",this.deselect=t.deselect||"ss-deselect",this.deselectPath=t.deselectPath||"M10,10 L90,90 M10,90 L90,10",this.arrow=t.arrow||"ss-arrow",this.arrowClose=t.arrowClose||"M10,30 L50,70 L90,30",this.arrowOpen=t.arrowOpen||"M10,70 L50,30 L90,70",this.content=t.content||"ss-content",this.openAbove=t.openAbove||"ss-open-above",this.openBelow=t.openBelow||"ss-open-below",this.search=t.search||"ss-search",this.searchHighlighter=t.searchHighlighter||"ss-search-highlight",this.searching=t.searching||"ss-searching",this.addable=t.addable||"ss-addable",this.addablePath=t.addablePath||"M50,10 L50,90 M10,50 L90,50",this.list=t.list||"ss-list",this.optgroup=t.optgroup||"ss-optgroup",this.optgroupLabel=t.optgroupLabel||"ss-optgroup-label",this.optgroupLabelText=t.optgroupLabelText||"ss-optgroup-label-text",this.optgroupActions=t.optgroupActions||"ss-optgroup-actions",this.optgroupSelectAll=t.optgroupSelectAll||"ss-selectall",this.optgroupSelectAllBox=t.optgroupSelectAllBox||"M60,10 L10,10 L10,90 L90,90 L90,50",this.optgroupSelectAllCheck=t.optgroupSelectAllCheck||"M30,45 L50,70 L90,10",this.optgroupClosable=t.optgroupClosable||"ss-closable",this.option=t.option||"ss-option",this.optionDelete=t.optionDelete||"M10,10 L90,90 M10,90 L90,10",this.highlighted=t.highlighted||"ss-highlighted",this.open=t.open||"ss-open",this.close=t.close||"ss-close",this.selected=t.selected||"ss-selected",this.error=t.error||"ss-error",this.disabled=t.disabled||"ss-disabled",this.hide=t.hide||"ss-hide"}}function e(){return Math.random().toString(36).substring(2,10)}function i(t,e=50,i=!1){let s;return function(...n){const r=self,a=i&&!s;clearTimeout(s),s=setTimeout((()=>{s=null,i||t.apply(r,n)}),e),a&&t.apply(r,n)}}function s(t,e){return JSON.stringify(t)===JSON.stringify(e)}class n{constructor(t){if(this.id=t.id&&""!==t.id?t.id:e(),this.label=t.label||"",this.selectAll=void 0!==t.selectAll&&t.selectAll,this.selectAllText=t.selectAllText||"Select All",this.closable=t.closable||"off",this.options=[],t.options)for(const e of t.options)this.options.push(new r(e))}}class r{constructor(t){this.id=t.id&&""!==t.id?t.id:e(),this.value=void 0===t.value?t.text:t.value,this.text=t.text||"",this.html=t.html||"",this.selected=void 0!==t.selected&&t.selected,this.display=void 0===t.display||t.display,this.disabled=void 0!==t.disabled&&t.disabled,this.mandatory=void 0!==t.mandatory&&t.mandatory,this.placeholder=void 0!==t.placeholder&&t.placeholder,this.class=t.class||"",this.style=t.style||"",this.data=t.data||{}}}class a{constructor(t,e){this.selectType="single",this.data=[],this.selectedOrder=[],this.selectType=t,this.setData(e)}validateDataArray(t){if(!Array.isArray(t))return new Error("Data must be an array");for(let e of t)if(e instanceof n||"label"in e){if(!("label"in e))return new Error("Optgroup must have a label");if("options"in e&&e.options)for(let t of e.options){const e=this.validateOption(t);if(e)return e}}else{if(!(e instanceof r||"text"in e))return new Error("Data object must be a valid optgroup or option");{const t=this.validateOption(e);if(t)return t}}return null}validateOption(t){return"text"in t?null:new Error("Option must have a text")}partialToFullData(t){let e=[];return t.forEach((t=>{if(t instanceof n||"label"in t){let i=[];"options"in t&&t.options&&t.options.forEach((t=>{i.push(new r(t))})),i.length>0&&e.push(new n(t))}(t instanceof r||"text"in t)&&e.push(new r(t))})),e}setData(t){this.data=this.partialToFullData(t),"single"===this.selectType&&this.setSelectedBy("id",this.getSelected())}getData(){return this.filter(null,!0)}getDataOptions(){return this.filter(null,!1)}addOption(t,e=!1){if(e){let e=[new r(t)];this.setData(e.concat(this.getData()))}else this.setData(this.getData().concat(new r(t)))}setSelectedBy(t,e){let i=null,s=!1;const a=[];for(let o of this.data){if(o instanceof n)for(let n of o.options)i||(i=n),n.selected=!s&&e.includes(n[t]),n.selected&&(a.push(n),"single"===this.selectType&&(s=!0));o instanceof r&&(i||(i=o),o.selected=!s&&e.includes(o[t]),o.selected&&(a.push(o),"single"===this.selectType&&(s=!0)))}"single"===this.selectType&&i&&!s&&(i.selected=!0,a.push(i));const o=e.map((e=>{var i;return(null===(i=a.find((i=>i[t]===e)))||void 0===i?void 0:i.id)||""}));this.selectedOrder=o}getSelected(){return this.getSelectedOptions().map((t=>t.id))}getSelectedValues(){return this.getSelectedOptions().map((t=>t.value))}getSelectedOptions(){return this.filter((t=>t.selected),!1)}getOptgroupByID(t){for(let e of this.data)if(e instanceof n&&e.id===t)return e;return null}getOptionByID(t){let e=this.filter((e=>e.id===t),!1);return e.length?e[0]:null}getSelectType(){return this.selectType}getFirstOption(){let t=null;for(let e of this.data)if(e instanceof n?t=e.options[0]:e instanceof r&&(t=e),t)break;return t}search(t,e){return""===(t=t.trim())?this.getData():this.filter((i=>e(i,t)),!0)}filter(t,e){const i=[];return this.data.forEach((s=>{if(s instanceof n){let a=[];if(s.options.forEach((s=>{t&&!t(s)||(e?a.push(new r(s)):i.push(new r(s)))})),a.length>0){let t=new n(s);t.options=a,i.push(t)}}s instanceof r&&(t&&!t(s)||i.push(new r(s)))})),i}selectedOrderOptions(t){const e=[];return this.selectedOrder.forEach((i=>{const s=t.find((t=>t.id===i));s&&e.push(s)})),t.forEach((t=>{let i=!1;e.forEach((e=>{t.id!==e.id||(i=!0)})),i||e.push(t)})),e}}class o{constructor(t,e,i,s){this.store=i,this.settings=t,this.classes=e,this.callbacks=s,this.main=this.mainDiv(),this.content=this.contentDiv(),this.updateClassStyles(),this.updateAriaAttributes(),this.settings.contentLocation.appendChild(this.content.main)}enable(){this.main.main.classList.remove(this.classes.disabled),this.content.search.input.disabled=!1}disable(){this.main.main.classList.add(this.classes.disabled),this.content.search.input.disabled=!0}open(){this.main.arrow.path.setAttribute("d",this.classes.arrowOpen),this.main.main.classList.add("up"===this.settings.openPosition?this.classes.openAbove:this.classes.openBelow),this.main.main.setAttribute("aria-expanded","true"),this.moveContent();const t=this.store.getSelectedOptions();if(t.length){const e=t[t.length-1].id,i=this.content.list.querySelector('[data-id="'+e+'"]');i&&this.ensureElementInView(this.content.list,i)}}close(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.remove(this.classes.openBelow),this.main.main.setAttribute("aria-expanded","false"),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.main.arrow.path.setAttribute("d",this.classes.arrowClose)}updateClassStyles(){if(this.main.main.className="",this.main.main.removeAttribute("style"),this.content.main.className="",this.content.main.removeAttribute("style"),this.main.main.classList.add(this.classes.main),this.content.main.classList.add(this.classes.content),""!==this.settings.style&&(this.main.main.style.cssText=this.settings.style,this.content.main.style.cssText=this.settings.style),this.settings.class.length)for(const t of this.settings.class)""!==t.trim()&&(this.main.main.classList.add(t.trim()),this.content.main.classList.add(t.trim()));"relative"===this.settings.contentPosition&&this.content.main.classList.add("ss-"+this.settings.contentPosition)}updateAriaAttributes(){this.main.main.role="combobox",this.main.main.setAttribute("aria-haspopup","listbox"),this.main.main.setAttribute("aria-controls",this.content.main.id),this.main.main.setAttribute("aria-expanded","false"),this.content.main.setAttribute("role","listbox")}mainDiv(){var t;const e=document.createElement("div");e.dataset.id=this.settings.id,e.setAttribute("aria-label",this.settings.ariaLabel),e.tabIndex=0,e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return this.callbacks.open(),"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Enter":case" ":this.callbacks.open();const e=this.content.list.querySelector("."+this.classes.highlighted);return e&&e.click(),!1;case"Escape":return this.callbacks.close(),!1}return!0},e.onclick=t=>{this.settings.disabled||(this.settings.isOpen?this.callbacks.close():this.callbacks.open())};const i=document.createElement("div");i.classList.add(this.classes.values),e.appendChild(i);const s=document.createElement("div");s.classList.add(this.classes.deselect);const n=null===(t=this.store)||void 0===t?void 0:t.getSelectedOptions();!this.settings.allowDeselect||this.settings.isMultiple&&n&&n.length<=0?s.classList.add(this.classes.hide):s.classList.remove(this.classes.hide),s.onclick=t=>{if(t.stopPropagation(),this.settings.disabled)return;let e=!0;const i=this.store.getSelectedOptions();if(this.callbacks.beforeChange&&(e=!0===this.callbacks.beforeChange([],i)),e){if(this.settings.isMultiple)this.callbacks.setSelected([],!1),this.updateDeselectAll();else{const t=this.store.getFirstOption(),e=t?t.id:"";this.callbacks.setSelected(e,!1)}this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(this.store.getSelectedOptions())}};const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.deselectPath),r.appendChild(a),s.appendChild(r),e.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add(this.classes.arrow),o.setAttribute("viewBox","0 0 100 100");const l=document.createElementNS("http://www.w3.org/2000/svg","path");return l.setAttribute("d",this.classes.arrowClose),this.settings.alwaysOpen&&o.classList.add(this.classes.hide),o.appendChild(l),e.appendChild(o),{main:e,values:i,deselect:{main:s,svg:r,path:a},arrow:{main:o,path:l}}}mainFocus(t){"click"!==t&&this.main.main.focus({preventScroll:!0})}placeholder(){const t=this.store.filter((t=>t.placeholder),!1);let e=this.settings.placeholderText;t.length&&(""!==t[0].html?e=t[0].html:""!==t[0].text&&(e=t[0].text));const i=document.createElement("div");return i.classList.add(this.classes.placeholder),i.innerHTML=e,i}renderValues(){this.settings.isMultiple?(this.renderMultipleValues(),this.updateDeselectAll()):this.renderSingleValue()}renderSingleValue(){const t=this.store.filter((t=>t.selected&&!t.placeholder),!1),e=t.length>0?t[0]:null;if(e){const t=document.createElement("div");t.classList.add(this.classes.single),e.html?t.innerHTML=e.html:t.innerText=e.text,this.main.values.innerHTML=t.outerHTML}else this.main.values.innerHTML=this.placeholder().outerHTML;this.settings.allowDeselect&&t.length?this.main.deselect.main.classList.remove(this.classes.hide):this.main.deselect.main.classList.add(this.classes.hide)}renderMultipleValues(){let t=this.main.values.childNodes,e=this.store.filter((t=>t.selected&&t.display),!1);if(0===e.length)return void(this.main.values.innerHTML=this.placeholder().outerHTML);{const t=this.main.values.querySelector("."+this.classes.placeholder);t&&t.remove()}if(e.length>this.settings.maxValuesShown){const t=document.createElement("div");return t.classList.add(this.classes.max),t.textContent=this.settings.maxValuesMessage.replace("{number}",e.length.toString()),void(this.main.values.innerHTML=t.outerHTML)}{const t=this.main.values.querySelector("."+this.classes.max);t&&t.remove()}this.settings.keepOrder&&(e=this.store.selectedOrderOptions(e));let i=[];for(let s=0;st.id===r),!1).length||i.push(n))}for(const t of i)t.classList.add(this.classes.valueOut),setTimeout((()=>{this.main.values.hasChildNodes()&&this.main.values.contains(t)&&this.main.values.removeChild(t)}),100);t=this.main.values.childNodes;for(let i=0;i{if(e.preventDefault(),e.stopPropagation(),this.settings.disabled)return;let i=!0;const s=this.store.getSelectedOptions(),a=s.filter((e=>e.selected&&e.id!==t.id),!0);if(!(this.settings.minSelected&&a.length{this.callbacks.search(t.target.value)}),100),e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Escape":return this.callbacks.close(),!1;case" ":const e=this.content.list.querySelector("."+this.classes.highlighted);return!e||(e.click(),!1);case"Enter":if(this.callbacks.addable)return s.click(),!1;{const t=this.content.list.querySelector("."+this.classes.highlighted);if(t)return t.click(),!1}return!0}return!0},t.appendChild(e),this.callbacks.addable){s.classList.add(this.classes.addable);const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 100 100");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",this.classes.addablePath),e.appendChild(i),s.appendChild(e),s.onclick=t=>{if(t.preventDefault(),t.stopPropagation(),!this.callbacks.addable)return;const e=this.content.search.input.value.trim();if(""===e)return void this.content.search.input.focus();const i=t=>{let e=new r(t);if(this.callbacks.addOption(e),this.settings.isMultiple){let t=this.store.getSelected();t.push(e.id),this.callbacks.setSelected(t,!0)}else this.callbacks.setSelected([e.id],!0);this.callbacks.search(""),this.settings.closeOnSelect&&setTimeout((()=>{this.callbacks.close()}),100)},s=this.callbacks.addable(e);!1!==s&&null!=s&&(s instanceof Promise?s.then((t=>{"string"==typeof t?i({text:t,value:t}):s instanceof Error?this.renderError(s.message):i(t)})):"string"==typeof s?i({text:s,value:s}):s instanceof Error?this.renderError(s.message):i(s))},t.appendChild(s),n.addable={main:s,svg:e,path:i}}return n}searchFocus(){this.content.search.input.focus()}getOptions(t=!1,e=!1,i=!1){let s="."+this.classes.option;return t&&(s+=":not(."+this.classes.placeholder+")"),e&&(s+=":not(."+this.classes.disabled+")"),i&&(s+=":not(."+this.classes.hide+")"),Array.from(this.content.list.querySelectorAll(s))}highlight(t){const e=this.getOptions(!0,!0,!0);if(0===e.length)return;if(1===e.length&&!e[0].classList.contains(this.classes.highlighted))return void e[0].classList.add(this.classes.highlighted);let i=!1;for(const t of e)t.classList.contains(this.classes.highlighted)&&(i=!0);if(!i)for(const t of e)if(t.classList.contains(this.classes.selected)){t.classList.add(this.classes.highlighted);break}for(let i=0;i=0?i-1:e.length-1];r.classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,r);const a=r.parentElement;if(a&&a.classList.contains(this.classes.close)){const t=a.querySelector("."+this.classes.optgroupLabel);t&&t.click()}return}e["down"===t?0:e.length-1].classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,e["down"===t?0:e.length-1])}listDiv(){const t=document.createElement("div");return t.classList.add(this.classes.list),t}renderError(t){this.content.list.innerHTML="";const e=document.createElement("div");e.classList.add(this.classes.error),e.textContent=t,this.content.list.appendChild(e)}renderSearching(){this.content.list.innerHTML="";const t=document.createElement("div");t.classList.add(this.classes.searching),t.textContent=this.settings.searchingText,this.content.list.appendChild(t)}renderOptions(t){if(this.content.list.innerHTML="",0===t.length){const t=document.createElement("div");return t.classList.add(this.classes.search),this.callbacks.addable?t.innerHTML=this.settings.addableText.replace("{value}",this.content.search.input.value):t.innerHTML=this.settings.searchText,void this.content.list.appendChild(t)}this.settings.allowDeselect&&!this.settings.isMultiple&&(this.store.filter((t=>t.placeholder),!1).length||this.store.addOption(new r({text:"",value:"",selected:!1,placeholder:!0}),!0));for(const e of t){if(e instanceof n){const t=document.createElement("div");t.classList.add(this.classes.optgroup);const i=document.createElement("div");i.classList.add(this.classes.optgroupLabel),t.appendChild(i);const s=document.createElement("div");s.classList.add(this.classes.optgroupLabelText),s.textContent=e.label,i.appendChild(s);const n=document.createElement("div");if(n.classList.add(this.classes.optgroupActions),i.appendChild(n),this.settings.isMultiple&&e.selectAll){const t=document.createElement("div");t.classList.add(this.classes.optgroupSelectAll);let i=!0;for(const t of e.options)if(!t.selected){i=!1;break}i&&t.classList.add(this.classes.selected);const s=document.createElement("span");s.textContent=e.selectAllText,t.appendChild(s);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100"),t.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.optgroupSelectAllBox),r.appendChild(a);const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d",this.classes.optgroupSelectAllCheck),r.appendChild(o),t.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation();const s=this.store.getSelected();if(i){const t=s.filter((t=>{for(const i of e.options)if(t===i.id)return!1;return!0}));this.callbacks.setSelected(t,!0)}else{const t=s.concat(e.options.map((t=>t.id)));for(const t of e.options)this.store.getOptionByID(t.id)||this.callbacks.addOption(t);this.callbacks.setSelected(t,!0)}})),n.appendChild(t)}if("off"!==e.closable){const s=document.createElement("div");s.classList.add(this.classes.optgroupClosable);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100"),r.classList.add(this.classes.arrow),s.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","path");r.appendChild(a),e.options.some((t=>t.selected))||""!==this.content.search.input.value.trim()?(s.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"open"===e.closable?(t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"close"===e.closable&&(t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose)),i.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),t.classList.contains(this.classes.close)?(t.classList.remove(this.classes.close),t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):(t.classList.remove(this.classes.open),t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose))})),n.appendChild(s)}t.appendChild(i);for(const i of e.options)t.appendChild(this.option(i));this.content.list.appendChild(t)}e instanceof r&&this.content.list.appendChild(this.option(e))}}option(t){if(t.placeholder){const t=document.createElement("div");return t.classList.add(this.classes.option),t.classList.add(this.classes.hide),t}const e=document.createElement("div");return e.dataset.id=t.id,e.id=t.id,e.classList.add(this.classes.option),e.setAttribute("role","option"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.style&&(e.style.cssText=t.style),this.settings.searchHighlight&&""!==this.content.search.input.value.trim()?e.innerHTML=this.highlightText(""!==t.html?t.html:t.text,this.content.search.input.value,this.classes.searchHighlighter):""!==t.html?e.innerHTML=t.html:e.textContent=t.text,this.settings.showOptionTooltips&&e.textContent&&e.setAttribute("title",e.textContent),t.display||e.classList.add(this.classes.hide),t.disabled&&e.classList.add(this.classes.disabled),t.selected&&this.settings.hideSelected&&e.classList.add(this.classes.hide),t.selected?(e.classList.add(this.classes.selected),e.setAttribute("aria-selected","true"),this.main.main.setAttribute("aria-activedescendant",e.id)):(e.classList.remove(this.classes.selected),e.setAttribute("aria-selected","false")),e.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const i=this.store.getSelected(),s=e.currentTarget,n=String(s.dataset.id);if(t.disabled||t.selected&&!this.settings.allowDeselect)return;if(this.settings.isMultiple&&this.settings.maxSelected<=i.length&&!t.selected||this.settings.isMultiple&&this.settings.minSelected>=i.length&&t.selected)return;let r=!1;const a=this.store.getSelectedOptions();let o=[];this.settings.isMultiple&&(o=t.selected?a.filter((t=>t.id!==n)):a.concat(t)),this.settings.isMultiple||(o=t.selected?[]:[t]),this.callbacks.beforeChange||(r=!0),this.callbacks.beforeChange&&(r=!1!==this.callbacks.beforeChange(o,a)),r&&(this.store.getOptionByID(n)||this.callbacks.addOption(t),this.callbacks.setSelected(o.map((t=>t.id)),!1),this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(o))})),e}destroy(){this.main.main.remove(),this.content.main.remove()}highlightText(t,e,i){let s=t;const n=new RegExp("(?![^<]*>)("+e.trim()+")(?![^<]*>[^<>]*${o}`),s}moveContentAbove(){const t=this.main.main.offsetHeight,e=this.content.main.offsetHeight;this.main.main.classList.remove(this.classes.openBelow),this.main.main.classList.add(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.content.main.classList.add(this.classes.openAbove);const i=this.main.main.getBoundingClientRect();this.content.main.style.margin="-"+(t+e-1)+"px 0px 0px 0px",this.content.main.style.top=i.top+i.height+window.scrollY+"px",this.content.main.style.left=i.left+window.scrollX+"px",this.content.main.style.width=i.width+"px"}moveContentBelow(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.add(this.classes.openBelow),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.add(this.classes.openBelow);const t=this.main.main.getBoundingClientRect();this.content.main.style.margin="-1px 0px 0px 0px","relative"!==this.settings.contentPosition&&(this.content.main.style.top=t.top+t.height+window.scrollY+"px",this.content.main.style.left=t.left+window.scrollX+"px",this.content.main.style.width=t.width+"px")}ensureElementInView(t,e){const i=t.scrollTop+t.offsetTop,s=i+t.clientHeight,n=e.offsetTop,r=n+e.clientHeight;ns&&(t.scrollTop+=r-s)}putContent(){const t=this.main.main.offsetHeight,e=this.main.main.getBoundingClientRect(),i=this.content.main.offsetHeight;return window.innerHeight-(e.top+t)<=i&&e.top>i?"up":"down"}updateDeselectAll(){if(!this.store||!this.settings)return;const t=this.store.getSelectedOptions(),e=t&&t.length>0,i=this.settings.isMultiple,s=this.settings.allowDeselect,n=this.main.deselect.main,r=this.classes.hide;!s||i&&!e?n.classList.add(r):n.classList.remove(r)}}class l{constructor(t){this.listen=!1,this.observer=null,this.select=t,this.valueChange=this.valueChange.bind(this),this.select.addEventListener("change",this.valueChange,{passive:!0}),this.observer=new MutationObserver(this.observeCall.bind(this)),this.changeListen(!0)}enable(){this.select.disabled=!1}disable(){this.select.disabled=!0}hideUI(){this.select.tabIndex=-1,this.select.style.display="none",this.select.setAttribute("aria-hidden","true")}showUI(){this.select.removeAttribute("tabindex"),this.select.style.display="",this.select.removeAttribute("aria-hidden")}changeListen(t){this.listen=t,t&&this.observer&&this.observer.observe(this.select,{subtree:!0,childList:!0,attributes:!0}),t||this.observer&&this.observer.disconnect()}valueChange(t){return this.listen&&this.onValueChange&&this.onValueChange(this.getSelectedOptions()),!0}observeCall(t){if(!this.listen)return;let e=!1,i=!1,s=!1;for(const n of t){if(n.target===this.select&&("disabled"===n.attributeName&&(i=!0),"class"===n.attributeName&&(e=!0),"childList"===n.type)){for(const t of n.addedNodes)if("OPTION"===t.nodeName&&t.value===this.select.value){this.select.dispatchEvent(new Event("change"));break}s=!0}"OPTGROUP"!==n.target.nodeName&&"OPTION"!==n.target.nodeName||(s=!0)}e&&this.onClassChange&&this.onClassChange(this.select.className.split(" ")),i&&this.onDisabledChange&&(this.changeListen(!1),this.onDisabledChange(this.select.disabled),this.changeListen(!0)),s&&this.onOptionsChange&&(this.changeListen(!1),this.onOptionsChange(this.getData()),this.changeListen(!0))}getData(){let t=[];const e=this.select.childNodes;for(const i of e)"OPTGROUP"===i.nodeName&&t.push(this.getDataFromOptgroup(i)),"OPTION"===i.nodeName&&t.push(this.getDataFromOption(i));return t}getDataFromOptgroup(t){let e={id:t.id,label:t.label,selectAll:!!t.dataset&&"true"===t.dataset.selectall,selectAllText:t.dataset?t.dataset.selectalltext:"Select all",closable:t.dataset?t.dataset.closable:"off",options:[]};const i=t.childNodes;for(const t of i)"OPTION"===t.nodeName&&e.options.push(this.getDataFromOption(t));return e}getDataFromOption(t){return{id:t.id,value:t.value,text:t.text,html:t.dataset&&t.dataset.html?t.dataset.html:"",selected:t.selected,display:"none"!==t.style.display,disabled:t.disabled,mandatory:!!t.dataset&&"true"===t.dataset.mandatory,placeholder:"true"===t.dataset.placeholder,class:t.className,style:t.style.cssText,data:t.dataset}}getSelectedOptions(){let t=[];const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(this.getDataFromOption(e))}}if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(this.getDataFromOption(e))}}return t}getSelectedValues(){return this.getSelectedOptions().map((t=>t.value))}setSelected(t){this.changeListen(!1);const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.id)}}if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.id)}}this.changeListen(!0)}setSelectedByValue(t){this.changeListen(!1);const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}this.changeListen(!0)}updateSelect(t,e,i){this.changeListen(!1),t&&(this.select.dataset.id=t),e&&(this.select.style.cssText=e),i&&(this.select.className="",i.forEach((t=>{""!==t.trim()&&this.select.classList.add(t.trim())}))),this.changeListen(!0)}updateOptions(t){this.changeListen(!1),this.select.innerHTML="";for(const e of t)e instanceof n&&this.select.appendChild(this.createOptgroup(e)),e instanceof r&&this.select.appendChild(this.createOption(e));this.select.dispatchEvent(new Event("change",{bubbles:!0})),this.changeListen(!0)}createOptgroup(t){const e=document.createElement("optgroup");if(e.id=t.id,e.label=t.label,t.selectAll&&(e.dataset.selectAll="true"),"off"!==t.closable&&(e.dataset.closable=t.closable),t.options)for(const i of t.options)e.appendChild(this.createOption(i));return e}createOption(t){const e=document.createElement("option");return e.id=t.id,e.value=t.value,e.innerHTML=t.text,""!==t.html&&e.setAttribute("data-html",t.html),t.selected&&(e.selected=t.selected),t.disabled&&(e.disabled=!0),t.display||(e.style.display="none"),t.placeholder&&e.setAttribute("data-placeholder","true"),t.mandatory&&e.setAttribute("data-mandatory","true"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.data&&"object"==typeof t.data&&Object.keys(t.data).forEach((i=>{e.setAttribute("data-"+function(t){const e=t.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(t=>"-"+t.toLowerCase()));return t[0]===t[0].toUpperCase()?e.substring(1):e}(i),t.data[i])})),e}destroy(){this.changeListen(!1),this.select.removeEventListener("change",this.valueChange),this.observer&&(this.observer.disconnect(),this.observer=null),delete this.select.dataset.id,this.showUI()}}class h{constructor(t){this.id="",this.style="",this.class=[],this.isMultiple=!1,this.isOpen=!1,this.isFullOpen=!1,this.intervalMove=null,t||(t={}),this.id="ss-"+e(),this.style=t.style||"",this.class=t.class||[],this.disabled=void 0!==t.disabled&&t.disabled,this.alwaysOpen=void 0!==t.alwaysOpen&&t.alwaysOpen,this.showSearch=void 0===t.showSearch||t.showSearch,this.focusSearch=void 0===t.focusSearch||t.focusSearch,this.ariaLabel=t.ariaLabel||"Combobox",this.searchPlaceholder=t.searchPlaceholder||"Search",this.searchText=t.searchText||"No Results",this.searchingText=t.searchingText||"Searching...",this.searchHighlight=void 0!==t.searchHighlight&&t.searchHighlight,this.closeOnSelect=void 0===t.closeOnSelect||t.closeOnSelect,this.contentLocation=t.contentLocation||document.body,this.contentPosition=t.contentPosition||"absolute",this.openPosition=t.openPosition||"auto",this.placeholderText=void 0!==t.placeholderText?t.placeholderText:"Select Value",this.allowDeselect=void 0!==t.allowDeselect&&t.allowDeselect,this.hideSelected=void 0!==t.hideSelected&&t.hideSelected,this.keepOrder=void 0!==t.keepOrder&&t.keepOrder,this.showOptionTooltips=void 0!==t.showOptionTooltips&&t.showOptionTooltips,this.minSelected=t.minSelected||0,this.maxSelected=t.maxSelected||1e3,this.timeoutDelay=t.timeoutDelay||200,this.maxValuesShown=t.maxValuesShown||20,this.maxValuesMessage=t.maxValuesMessage||"{number} selected",this.addableText=t.addableText||'Press "Enter" to add {value}'}}return class{constructor(e){var s;if(this.events={search:void 0,searchFilter:(t,e)=>-1!==t.text.toLowerCase().indexOf(e.toLowerCase()),addable:void 0,beforeChange:void 0,afterChange:void 0,beforeOpen:void 0,afterOpen:void 0,beforeClose:void 0,afterClose:void 0},this.windowResize=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.windowScroll=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.documentClick=t=>{this.settings.isOpen&&t.target&&!function(t,e){function i(t,i){return i&&t&&t.classList&&t.classList.contains(i)||i&&t&&t.dataset&&t.dataset.id&&t.dataset.id===e?t:null}return i(t,e)||function t(e,s){return e&&e!==document?i(e,s)?e:t(e.parentNode,s):null}(t,e)}(t.target,this.settings.id)&&this.close(t.type)},this.windowVisibilityChange=()=>{document.hidden&&this.close()},this.selectEl="string"==typeof e.select?document.querySelector(e.select):e.select,!this.selectEl)return void(e.events&&e.events.error&&e.events.error(new Error("Could not find select element")));if("SELECT"!==this.selectEl.tagName)return void(e.events&&e.events.error&&e.events.error(new Error("Element isnt of type select")));this.selectEl.dataset.ssid&&this.destroy(),this.settings=new h(e.settings),this.cssClasses=new t(e.cssClasses);const n=["afterChange","beforeOpen","afterOpen","beforeClose","afterClose"];for(const t in e.events)e.events.hasOwnProperty(t)&&(-1!==n.indexOf(t)?this.events[t]=i(e.events[t],100):this.events[t]=e.events[t]);this.settings.disabled=(null===(s=e.settings)||void 0===s?void 0:s.disabled)?e.settings.disabled:this.selectEl.disabled,this.settings.isMultiple=this.selectEl.multiple,this.settings.style=this.selectEl.style.cssText,this.settings.class=this.selectEl.className.split(" "),this.select=new l(this.selectEl),this.select.updateSelect(this.settings.id,this.settings.style,this.settings.class),this.select.hideUI(),this.select.onValueChange=t=>{this.setSelected(t.map((t=>t.id)))},this.select.onClassChange=t=>{this.settings.class=t,this.render.updateClassStyles()},this.select.onDisabledChange=t=>{t?this.disable():this.enable()},this.select.onOptionsChange=t=>{this.setData(t)},this.store=new a(this.settings.isMultiple?"multiple":"single",e.data?e.data:this.select.getData()),e.data&&this.select.updateOptions(this.store.getData());const r={open:this.open.bind(this),close:this.close.bind(this),addable:this.events.addable?this.events.addable:void 0,setSelected:this.setSelected.bind(this),addOption:this.addOption.bind(this),search:this.search.bind(this),beforeChange:this.events.beforeChange,afterChange:this.events.afterChange};this.render=new o(this.settings,this.cssClasses,this.store,r),this.render.renderValues(),this.render.renderOptions(this.store.getData());const d=this.selectEl.getAttribute("aria-label"),c=this.selectEl.getAttribute("aria-labelledby");d?this.render.main.main.setAttribute("aria-label",d):c&&this.render.main.main.setAttribute("aria-labelledby",c),this.selectEl.parentNode&&this.selectEl.parentNode.insertBefore(this.render.main.main,this.selectEl.nextSibling),window.addEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.addEventListener("scroll",this.windowScroll,!1),document.addEventListener("visibilitychange",this.windowVisibilityChange),this.settings.disabled&&this.disable(),this.settings.alwaysOpen&&this.open(),this.selectEl.slim=this}enable(){this.settings.disabled=!1,this.select.enable(),this.render.enable()}disable(){this.settings.disabled=!0,this.select.disable(),this.render.disable()}getData(){return this.store.getData()}setData(t){const e=this.store.getSelected(),i=this.store.validateDataArray(t);if(i)return void(this.events.error&&this.events.error(i));this.store.setData(t);const n=this.store.getData();this.select.updateOptions(n),this.render.renderValues(),this.render.renderOptions(n),this.events.afterChange&&!s(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}getSelected(){let t=this.store.getSelectedOptions();return this.settings.keepOrder&&(t=this.store.selectedOrderOptions(t)),t.map((t=>t.value))}setSelected(t,e=!0){const i=this.store.getSelected(),n=this.store.getDataOptions();t=Array.isArray(t)?t:[t];const r=[];for(const e of t)if(n.find((t=>t.id==e)))r.push(e);else for(const t of n.filter((t=>t.value==e)))r.push(t.id);this.store.setSelectedBy("id",r);const a=this.store.getData();this.select.updateOptions(a),this.render.renderValues(),""!==this.render.content.search.input.value?this.search(this.render.content.search.input.value):this.render.renderOptions(a),e&&this.events.afterChange&&!s(i,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}addOption(t){const e=this.store.getSelected();this.store.getDataOptions().some((e=>{var i;return e.value===(null!==(i=t.value)&&void 0!==i?i:t.text)}))||this.store.addOption(t);const i=this.store.getData();this.select.updateOptions(i),this.render.renderValues(),this.render.renderOptions(i),this.events.afterChange&&!s(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}open(){this.settings.disabled||this.settings.isOpen||(this.events.beforeOpen&&this.events.beforeOpen(),this.render.open(),this.settings.showSearch&&this.settings.focusSearch&&this.render.searchFocus(),this.settings.isOpen=!0,setTimeout((()=>{this.events.afterOpen&&this.events.afterOpen(),this.settings.isOpen&&(this.settings.isFullOpen=!0),document.addEventListener("click",this.documentClick)}),this.settings.timeoutDelay),"absolute"===this.settings.contentPosition&&(this.settings.intervalMove&&clearInterval(this.settings.intervalMove),this.settings.intervalMove=setInterval(this.render.moveContent.bind(this.render),500)))}close(t=null){this.settings.isOpen&&!this.settings.alwaysOpen&&(this.events.beforeClose&&this.events.beforeClose(),this.render.close(),""!==this.render.content.search.input.value&&this.search(""),this.render.mainFocus(t),this.settings.isOpen=!1,this.settings.isFullOpen=!1,setTimeout((()=>{this.events.afterClose&&this.events.afterClose(),document.removeEventListener("click",this.documentClick)}),this.settings.timeoutDelay),this.settings.intervalMove&&clearInterval(this.settings.intervalMove))}search(t){if(this.render.content.search.input.value!==t&&(this.render.content.search.input.value=t),!this.events.search)return void this.render.renderOptions(""===t?this.store.getData():this.store.search(t,this.events.searchFilter));this.render.renderSearching();const e=this.events.search(t,this.store.getSelectedOptions());e instanceof Promise?e.then((t=>{this.render.renderOptions(this.store.partialToFullData(t))})).catch((t=>{this.render.renderError("string"==typeof t?t:t.message)})):Array.isArray(e)?this.render.renderOptions(this.store.partialToFullData(e)):this.render.renderError("Search event must return a promise or an array of data")}destroy(){document.removeEventListener("click",this.documentClick),window.removeEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.removeEventListener("scroll",this.windowScroll,!1),document.removeEventListener("visibilitychange",this.windowVisibilityChange),this.store.setData([]),this.render.destroy(),this.select.destroy()}}}()},5072:t=>{"use strict";var e=[];function i(t){for(var i=-1,s=0;s{"use strict";var e={};t.exports=function(t,i){var s=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(i)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,i)=>{"use strict";t.exports=function(t){var e=i.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(i){!function(t,e,i){var s="";i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var n=void 0!==i.layer;n&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,n&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}");var r=i.sourceMap;r&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(s,t,e.options)}(e,t,i)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={id:s,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var s={};(()=>{"use strict";i.r(s),i.d(s,{d3_format:()=>Rq,d3_format_locale:()=>Fq,dayjs:()=>bq});var t={};i.r(t),i.d(t,{Zr:()=>Nb}),window.HTMLWidgets;const e=t=>t;var n,r;!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(n||(n={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(r||(r={}));var a=i(228),o=i.n(a);const l=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,h=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||l(t,"Number")},d="undefined"!=typeof console;function c(t,e,i){const s=[e].concat([].slice.call(i));d&&console[t].apply(console,s)}var u,p;(p=u||(u={}))[p.None=0]="None",p[p.Error=1]="Error",p[p.Warn=2]="Warn",p[p.Info=3]="Info",p[p.Debug=4]="Debug";class g{static getInstance(t,e){return g._instance&&h(t)?g._instance.level(t):g._instance||(g._instance=new g(t,e)),g._instance}static setInstance(t){return g._instance=t}static setInstanceLevel(t){g._instance?g._instance.level(t):g._instance=new g(t)}static clearInstance(){g._instance=null}constructor(t=u.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=u.Info}canLogDebug(){return this._level>=u.Debug}canLogError(){return this._level>=u.Error}canLogWarn(){return this._level>=u.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=u.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):c(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=u.Warn&&c(this._method||"warn","WARN",t),this}info(...t){return this._level>=u.Info&&c(this._method||"log","INFO",t),this}debug(...t){return this._level>=u.Debug&&c(this._method||"log","DEBUG",t),this}}g._instance=null;let m=0;function _(t="dataset"){return m>1e8&&(m=0),t+"_"+m++}class f{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(o()),i=(null==t?void 0:t.name)?t.name:_("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:g.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 s=this._callMap.get(i);s||(s=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,s)})),this._callMap.set(i,s)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const s=this._callMap.get(i);s&&t.forEach((t=>{t.target.removeListener(e,s)})),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()}}const v=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||l(t,"Boolean"),y=t=>Array.isArray?Array.isArray(t):l(t,"Array"),b=(t,e,i)=>{const s=!v(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!y(t))throw new TypeError("Invalid data: must be DataView array!");return y(i.rawData)&&i.rawData.forEach((t=>{t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),s&&t.forEach((t=>{t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t},x=t=>l(t,"Date"),S=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||l(t,"String")},M=t=>null!=t;function k(t,e,i){let s;if(!M(t)||"object"!=typeof t||e&&e(t))return t;const n=y(t),r=t.length;s=n?new Array(r):"object"==typeof t?{}:v(t)||h(t)||S(t)?t:x(t)?new Date(+t):void 0;const a=n?void 0:Object.keys(Object(t));let o=-1;if(s)for(;++o<(a||t).length;){const n=a?a[o]:o,r=t[n];i&&i.includes(n.toString())?s[n]=r:s[n]=k(r,e,i)}return s}const A=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},w=function(t){if(!(t=>"object"==typeof t&&null!==t)(t)||!l(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function T(t,e,i=!1,s=!1){if(e){if(t===e)return;if(M(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!M(n[a])||"object"!=typeof n[a]||s&&y(t[a])?C(t,a,n[a]):L(t,e,a,i,s)}}}}function L(t,e,i,s=!1,n=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(y(a)){if(s)o=[];else if(y(r))o=r;else if(A(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++tnull==t,P=(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.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let s=0;s(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()})),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:_("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var 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,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t,e={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[O]=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[O]=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[O]"fields"===t.type));!D(this._fields)&&D(i)?(this.dataSet.registerTransform("fields",P),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class B{static GenAutoIncrementId(){return B.auto_increment_id++}}B.auto_increment_id=0;class I{constructor(t){this.id=B.GenAutoIncrementId(),this.registry=t}}const F="named",Y="inject",j="multi_inject",H="inversify:tagged",z="inversify:paramtypes",N=function(t){var e;return function(t){Object.prototype.hasOwnProperty;const e="function"==typeof Symbol,i=e&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=(e&&void 0!==Symbol.iterator&&Symbol.iterator,Object.create,Object.getPrototypeOf(Function)),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=(Set,new WeakMap);function a(t,e,i){let s=r.get(t);if(d(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(d(a)){if(!i)return;a=new n,s.set(e,a)}return a}function o(t,e,i){if(l(t,e,i))return!0;const s=m(e);return!c(s)&&o(t,s,i)}function l(t,e,i){const s=a(e,i,!1);return!d(s)&&!!s.has(t)}function h(t,e,i){if(l(t,e,i))return function(t,e,i){const s=a(e,i,!1);if(!d(s))return s.get(t)}(t,e,i);const s=m(e);return c(s)?void 0:h(t,s,i)}function d(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function p(t){const e=function(t,e){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===e?"string":5===e?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,i);if(void 0!==n){const e=n.call(t,s);if(u(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(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function m(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s)return e;if(e!==s)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);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(!u(i))throw new TypeError;return n=t,r=e,void a(i,s,!0).set(n,r);var n,r})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),l(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function V(){return function(t){return N.defineMetadata(z,null,t),t}}class W{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===F?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function G(t){return(e,i,s)=>{!function(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};N.hasOwnMetadata(t,e)&&(r=N.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,N.defineMetadata(t,r,e)}(H,t,i.toString(),s)}(e,0,s,t)}}function U(t){return e=>(i,s,n)=>G(new W(t,e))(i,s,n)}const $=U(Y);function X(t){return G(new W(F,t))}const K=Symbol("ContributionProvider");class q{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 Z(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).inSingletonScope().whenTargetNamed(e)}class J{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 Q extends J{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const tt=Symbol.for("EnvContribution"),et=Symbol.for("VGlobal");var it=function(t,e){return function(i,s){e(i,s,t)}};let st=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=B.GenAutoIncrementId(),this.hooks={onSetEnv:new Q(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const s=i.configure(this,t);s&&s.then&&e.push(s)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const s=this.bindContribution(e);if(s&&s.then)return s.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};st=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}([V(),it(0,$(K)),it(0,X(tt)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],st);const nt=1e-12,rt=Math.PI,at=rt/2,ot=2*rt,lt=2*Math.PI,ht=Math.abs,dt=Math.atan2,ct=Math.cos,ut=Math.max,pt=Math.min,gt=Math.sin,mt=Math.sqrt,_t=Math.pow;function ft(t){return t>=1?at:t<=-1?-at:Math.asin(t)}function vt(t,e,i,s,n){let r=i,a=s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof s&&(a=(1-n)*e+n*s),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function bt(t,e){let i=0;for(let s=0;s0?i:0}function Mt(t,e){return xt(t+e,10**Math.max(St(t),St(e)))}function kt(t,e){return xt(t-e,10**Math.max(St(t),St(e)))}function At(t){return t*(Math.PI/180)}function wt(t){return 180*t/Math.PI}function Tt(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Lt(t,e={x:0,y:0},i=0,s=2*Math.PI){const{x:n,y:r}=t,{x:a,y:o}=e;let l=n-a,h=r-o;const d=Math.sqrt(l*l+h*h);if(0===d)return{radius:0,angle:0};l/=d,h/=d;let c=Math.atan2(h,l);if(cs)for(;c>=s;)c-=2*Math.PI;return{radius:d,angle:c}}function Ct(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Et(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Dt(t){return(t=Et(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}class Pt{constructor(t=1,e=0,i=0,s=1,n=0,r=0){this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,r=this.f,a=new Pt,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,l=n*this.a+s*this.b,h=s*this.c-n*this.d,d=n*this.c+s*this.d,c=s*this.e-n*this.f+r,u=n*this.e+s*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=d,this.e=c,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,r){return this.multiply(t,e,i,s,n,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,l=this.c,h=this.d,d=a*t+l*e,c=o*t+h*e,u=a*i+l*s,p=o*i+h*s,g=a*n+l*r+this.e,m=o*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=p,this.e=g,this.f=m,this}interpolate(t,e){const i=new Pt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:r,e:a,f:o}=this,l=i*r-s*n,h=r/l,d=-s/l,c=-n/l,u=i/l,p=(n*o-r*a)/l,g=-(i*o-s*a)/l,{x:m,y:_}=t;e.x=m*h+_*c+p,e.y=m*d+_*u+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Pt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=wt(r.rotateDeg),r}}const Ot=ot-1e-8;class Rt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>Ot)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,d=1/0,c=-1/0,u=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),lc&&(c=l),hp&&(p=h)}if(g(s),g(n),n!==s)if((s%=ot)<0&&(s+=ot),(n%=ot)<0&&(n+=ot),nn;++o,a-=at)g(a);else for(a=s-s%at+at,o=0;o<4&&a=l||n<=o||r>=d||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,o),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(a,d)}}var Yt;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Yt||(Yt={}));const jt=(t,e,i)=>{let s=t.x1,n=t.x2,r=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),o>l&&([o,l]=[l,o]),h>d&&([h,d]=[d,h])),{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}};function Ht(t,e,i){if(!t||!e)return Yt.NONE;const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}=jt(t,e,i);return s>o&&nh&&as&&lr&&de.x2||t.x2e.y2||t.y2l||nd||a=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,n=e.x2,r=e.y1,a=e.y2;return s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),t.x>=s&&t.x<=n&&t.y>=r&&t.y<=a}function Vt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Wt({x:t,y:e},i,s={x:0,y:0}){return{x:(t-s.x)*Math.cos(i)-(e-s.y)*Math.sin(i)+s.x,y:(t-s.x)*Math.sin(i)+(e-s.y)*Math.cos(i)+s.y}}function Gt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ut(t,e){const i=e?At(t.angle):t.angle,s=Gt(t);return[Wt({x:t.x1,y:t.y1},i,s),Wt({x:t.x2,y:t.y1},i,s),Wt({x:t.x2,y:t.y2},i,s),Wt({x:t.x1,y:t.y2},i,s)]}function $t(t,e,i=!1,s){const n=Ut(t,i),r=Ut(e,i),a=(t,e)=>[e.x-t.x,e.y-t.y];s&&(s.save(),s.fillStyle="red",s.globalAlpha=.6,n.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore(),s.save(),s.fillStyle="green",s.globalAlpha=.6,r.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore());const o=Gt(t),l=Gt(e);s&&s.fillRect(o.x,o.y,2,2),s&&s.fillRect(l.x,l.y,2,2);const h=a(o,l),d=a(n[0],n[1]),c=a(n[1],n[2]),u=a(r[0],r[1]),p=a(r[1],r[2]),g=i?At(t.angle):t.angle;let m=i?At(90-t.angle):t.angle+at;const _=i?At(e.angle):e.angle;let f=i?At(90-e.angle):e.angle+at;m>lt&&(m-=lt),f>lt&&(f-=lt);const v=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Vt(n,i)+Vt(n,s))/2>Vt(n,h)};return v((t.x2-t.x1)/2,g,u,p)&&v((t.y2-t.y1)/2,m,u,p)&&v((e.x2-e.x1)/2,_,d,c)&&v((e.y2-e.y1)/2,f,d,c)}function Xt(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),e)}class Kt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Kt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,s=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=s,this}set(t=0,e=0,i=0,s=0){return ithis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return y(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(t=0,e=0,i=0,s=0){const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)}contains(t=0,e=0){return!(tthis.x2||ethis.y2)}containsPoint(t){return!(t.xthis.x2||t.ythis.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Xt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,d=i-e*l-i*o;return[o*s-l*n+h,l*s+o*n+d,o*s-l*a+h,l*s+o*a+d,o*r-l*n+h,l*r+o*n+d,o*r-l*a+h,l*r+o*a+d]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class qt extends Kt{}class Zt extends Kt{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return $t(this,t)}setValue(t=0,e=0,i=0,s=0,n=0){return super.setValue(t,e,i,s),this.angle=n,this}}class Jt{constructor(){this.curves=[],this.bounds=new qt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Qt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,te={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};let ee,ie,se,ne,re,ae;var oe,le,he,de,ce,ue,pe,ge,me;function _e(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,d=-o*a,c=o*r,u=l*a,p=Math.cos(s),g=Math.sin(s),m=Math.cos(n),_=Math.sin(n),f=.5*(n-s),v=Math.sin(.5*f),y=8/3*v*v/Math.sin(f),b=e+p-y*g,x=i+g+y*p,S=e+m,M=i+_,k=S+y*_,A=M-y*m;return[h*b+d*x,c*b+u*x,h*k+d*A,c*k+u*A,h*S+d*M,c*S+u*M]}function fe(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=At(a),d=Math.sin(h),c=Math.cos(h),u=c*(o-t)*.5+d*(l-e)*.5,p=c*(l-e)*.5-d*(o-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const m=c/i,_=d/i,f=-d/s,v=c/s,y=m*o+_*l,b=f*o+v*l,x=m*t+_*e,S=f*t+v*e;let M=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;M<0&&(M=0);let k=Math.sqrt(M);r===n&&(k=-k);const A=.5*(y+x)-k*(S-b),w=.5*(b+S)+k*(x-y),T=Math.atan2(b-w,y-A);let L=Math.atan2(S-w,x-A)-T;L<0&&1===r?L+=ot:L>0&&0===r&&(L-=ot);const C=Math.ceil(Math.abs(L/(at+.001))),E=[];for(let t=0;te.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 ye(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;ot+e.getLength()),0)),this.length}}class Ee extends Ce{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 De(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function Pe(t,e,i){const s=null!=e?e:ht(i[i.length-1].x-i[0].x)>ht(i[i.length-1].y-i[0].y)?pe.ROW:pe.COLUMN;return"monotoneY"===t?new Ee(t,s):new Ce(t,s)}class Oe{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 Re(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Pe("linear",i,t);return function(t,e){De(t,e,1)}(new Oe(n,s),t),n}function Be(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 Ie{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&&Be(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:Be(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 Fe(t){return t<0?-1:1}function Ye(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(Fe(r)+Fe(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function je(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function He(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 ze{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:He(this,this._t0,je(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,He(this,je(this,e=Ye(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:He(this,this._t0,e=Ye(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 Ne extends ze{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}class Ve{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0=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;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 We(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ce("step",null!=s?s:ht(t[t.length-1].x-t[0].x)>ht(t[t.length-1].y-t[0].y)?pe.ROW:pe.COLUMN);return function(t,e){De(t,e,1)}(new Ve(r,e,n),t),r}class Ge extends Oe{lineEnd(){this.context.closePath()}}function Ue(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>nt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>nt){const s=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);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function $e(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Re(i,n);const o=Pe(t,r,i);return De(new e(o,s,a),i,2),o}}const Xe=$e("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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()}}),Ke=$e("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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 qe(t,e,i){var s,n;switch(e){case"linear":default:return Re(t,i);case"basis":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Pe("basis",i,t);return function(t,e){De(t,e,2)}(new Ie(n,s),t),n}(t,i);case"monotoneX":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Pe("monotoneX",i,t);return function(t,e){De(t,e,2)}(new ze(n,s),t),n}(t,i);case"monotoneY":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Pe("monotoneY",i,t);return function(t,e){De(t,e,2)}(new Ne(n,s),t),n}(t,i);case"step":return We(t,.5,i);case"stepBefore":return We(t,0,i);case"stepAfter":return We(t,1,i);case"catmullRom":return Xe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Ke(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Pe("linear",i,t);return function(t,e){De(t,e,1)}(new Ge(n,s),t),n}(t,i)}}class Ze extends Jt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Rt(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([6,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([5,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([7,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([2,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([1,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([4,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([8,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([0,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([3]),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[6]=t=>`M${t[1]} ${t[2]}`,t[5]=t=>`L${t[1]} ${t[2]}`,t[7]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[2]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[0]=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`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[3]=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;tae){let t;for(let e=1,s=i.length;e{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,e=0,i=0,s=1,n=1){let r,a,o,l,h,d=null,c=0,u=0,p=0,g=0;for(let m=0,_=t.length;m<_;++m){switch(r=t[m],1===s&&1===n||(r=Qe(r,s,n)),r[0]){case"l":c+=r[1],u+=r[2],this.lineTo(c+e,u+i);break;case"L":c=r[1],u=r[2],this.lineTo(c+e,u+i);break;case"h":c+=r[1],this.lineTo(c+e,u+i);break;case"H":c=r[1],this.lineTo(c+e,u+i);break;case"v":u+=r[1],this.lineTo(c+e,u+i);break;case"V":u=r[1],this.lineTo(c+e,u+i);break;case"m":c+=r[1],u+=r[2],this.moveTo(c+e,u+i);break;case"M":c=r[1],u=r[2],this.moveTo(c+e,u+i);break;case"c":a=c+r[5],o=u+r[6],p=c+r[3],g=u+r[4],this.bezierCurveTo(c+r[1]+e,u+r[2]+i,p+e,g+i,a+e,o+i),c=a,u=o;break;case"C":c=r[5],u=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,c+e,u+i);break;case"s":a=c+r[3],o=u+r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,c+r[1]+e,u+r[2]+i,a+e,o+i),p=c+r[1],g=u+r[2],c=a,u=o;break;case"S":a=r[3],o=r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"q":a=c+r[3],o=u+r[4],p=c+r[1],g=u+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"t":a=c+r[1],o=u+r[2],null===d[0].match(/[QqTt]/)?(p=c,g=u):"t"===d[0]?(p=2*c-l,g=2*u-h):"q"===d[0]&&(p=2*c-p,g=2*u-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o,p=c+r[1],g=u+r[2];break;case"T":a=r[1],o=r[2],p=2*c-p,g=2*u-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"a":fe(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+c+e,r[7]+u+i]),c+=r[6],u+=r[7];break;case"A":fe(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),c=r[6],u=r[7];break;case"z":case"Z":this.closePath()}d=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;rt.slice()))}_updateBounds(){this.bounds.clear(),ye(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===pe.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.y-e.p1.y)}if(this.direction===pe.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(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=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}}const Je=["l",0,0,0,0,0,0,0];function Qe(t,e,i){const s=Je[0]=t[0];if("a"===s||"A"===s)Je[1]=e*t[1],Je[2]=i*t[2],Je[3]=t[3],Je[4]=t[4],Je[5]=t[5],Je[6]=e*t[6],Je[7]=i*t[7];else if("h"===s||"H"===s)Je[1]=e*t[1];else if("v"===s||"V"===s)Je[1]=i*t[1];else for(let s=1,n=t.length;s{g.getInstance().warn("空函数")}}),mi=Object.assign(Object.assign({},oi),{points:[],cornerRadius:0,closePath:!0}),_i=Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),fi=(Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Object.assign(Object.assign({},oi),{symbolType:"circle",size:10,keepDirIn3d:!0})),vi=Object.assign(Object.assign(Object.assign({},oi),ni),{strokeBoundsBuffer:0,keepDirIn3d:!0}),yi=Object.assign(Object.assign(Object.assign({},oi),ni),{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}),bi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},oi),{fill:!0,cornerRadius:0}),xi=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}),Si=new class{},Mi={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"}},ki=(String.fromCharCode(160),/\w|\(|\)|-/),Ai=/[.?!,;:/,。?!、;:]/,wi=/\S/,Ti=(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||"sans-serif"})};function Li(t,e,i,s,n){if(!e||e<=0)return 0;const r=Si.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width);for(;l>e||d<=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),d=Math.floor(r.measureText(h,i).width)}return n&&(a=Ci(t,a)),a}function Ci(t,e,i=!1){let s=e;for(;ki.test(t[s-1])&&ki.test(t[s])||Ai.test(t[s]);)if(s--,s<=0)return i?Ei(t,e):e;return s}function Ei(t,e){let i=e;for(;ki.test(t[i-1])&&ki.test(t[i])||Ai.test(t[i]);)if(i++,i>=t.length)return i;return i}function Di(t,e){const i=Si.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(s.width=Math.floor(i.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(i.width),s.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),s.ascent=Math.floor(i.actualBoundingBoxAscent),s.descent=s.height-s.ascent),s}let Pi=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,{fontSize:e=vi.fontSize}){let i=0,s=0;for(let e=0;e{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let a=0,o=0;for(;o1){const n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(s&&n.str!==t[o].text){let i="",s=0;for(let e=0;ei)return{str:"",width:0};const a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&a.str!==t){let i=Ci(t,a.str.length,n);i!==a.str.length&&(i>a.str.length&&(a.wordBreaked=i,i=a.str.length),a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a}_clipText(t,e,i,s,n,r,a){let o;if("start"===r)o=this._clipTextStart(t,e,i,s,n),a&&(o.result=a+o.str);else if("middle"===r){const s=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:s.width,result:s.left+a+s.right}}else o=this._clipTextEnd(t,e,i,s,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,s,n){const r=Math.floor((s+n)/2),a=t.substring(0,r+1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(0,r);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextEnd(t,e,i,s,r)}if(o=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(0,r+2);return l=this.measureTextWidth(s,e),l>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,r,n)}return{str:a,width:o}}_clipTextStart(t,e,i,s,n){const r=Math.ceil((s+n)/2),a=t.substring(r-1,t.length-1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const s=t.substring(r,t.length-1);return l=this.measureTextWidth(s,e),l<=i?{str:s,width:l}:this._clipTextStart(t,e,i,r,t.length-1)}if(o=i?{str:a,width:o}:this._clipTextStart(t,e,i,s,r)}return{str:a,width:o}}_clipTextMiddle(t,e,i,s,n,r,a,o){const l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:s,right:n,width:r+a};const d=t.substring(t.length-o,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,d,h,c,o+1)}clipTextWithSuffixVertical(t,e,i,s,n,r){if(""===s)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,n);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(s,e);if(o>i)return a;let l;if(i-=o,"start"===r){const r=this.revertVerticalList(t);l=this.clipTextVertical(r,e,i,n);const a=this.revertVerticalList(l.verticalList);a.unshift({text:s,direction:1,width:o}),l.verticalList=a}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),a=this.revertVerticalList(t),h=this.clipTextVertical(a,e,i/2,n);r.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),l={verticalList:r.verticalList,width:r.width+h.width}}else l=this.clipTextVertical(t,e,i,n),l.verticalList.push({text:s,direction:1,width:o});return l.width+=o,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,s,n,r,a=!1){if(""===s)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const l=this.measureTextWidth(s,e);if(l>i)return{str:"",width:0};if(a&&o+l<=i)return{str:t+s,width:o+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,r,s);if(n&&h.str!==t){const i=Ci(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else a&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=l,h}};Pi=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}([V()],Pi);const Oi=Symbol.for("TextMeasureContribution");let Ri=class extends Pi{};Ri=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}([V()],Ri);const Bi=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,s=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,s=e<<10|i,s+=65536),12288===s||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":8361===s||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||172===s||175===s||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":161===s||164===s||167<=s&&s<=168||170===s||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||198===s||208===s||215<=s&&s<=216||222<=s&&s<=225||230===s||232<=s&&s<=234||236<=s&&s<=237||240===s||242<=s&&s<=243||247<=s&&s<=250||252===s||254===s||257===s||273===s||275===s||283===s||294<=s&&s<=295||299===s||305<=s&&s<=307||312===s||319<=s&&s<=322||324===s||328<=s&&s<=331||333===s||338<=s&&s<=339||358<=s&&s<=359||363===s||462===s||464===s||466===s||468===s||470===s||472===s||474===s||476===s||593===s||609===s||708===s||711===s||713<=s&&s<=715||717===s||720===s||728<=s&&s<=731||733===s||735===s||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||1025===s||1040<=s&&s<=1103||1105===s||8208===s||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||8240===s||8242<=s&&s<=8243||8245===s||8251===s||8254===s||8308===s||8319===s||8321<=s&&s<=8324||8364===s||8451===s||8453===s||8457===s||8467===s||8470===s||8481<=s&&s<=8482||8486===s||8491===s||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||8585===s||8592<=s&&s<=8601||8632<=s&&s<=8633||8658===s||8660===s||8679===s||8704===s||8706<=s&&s<=8707||8711<=s&&s<=8712||8715===s||8719===s||8721===s||8725===s||8730===s||8733<=s&&s<=8736||8739===s||8741===s||8743<=s&&s<=8748||8750===s||8756<=s&&s<=8759||8764<=s&&s<=8765||8776===s||8780===s||8786===s||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||8853===s||8857===s||8869===s||8895===s||8978===s||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||9675===s||9678<=s&&s<=9681||9698<=s&&s<=9701||9711===s||9733<=s&&s<=9734||9737===s||9742<=s&&s<=9743||9748<=s&&s<=9749||9756===s||9758===s||9792===s||9794===s||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||9839===s||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||9955===s||9960<=s&&s<=9983||10045===s||10071===s||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||65533===s||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"};function Ii(t,e={},i){i||(i=1);const{fontStyle:s=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(s?s+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Fi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),M(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=M(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(D(this._canvas)&&(M(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),D(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&M(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),D(this._context)&&M(this._canvas)){const t=this._canvas.getContext("2d");M(t)&&(t.save(),t.font=Ii(this.textSpec),this._contextSaved=!0,this._context=t)}return!D(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:s={}}=this._option,{fontStyle:n=s.fontStyle,fontVariant:r=s.fontVariant,fontWeight:a=(null!==(t=s.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=s.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=s.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(S(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:d,textBaseline:u,ellipsis:p,limit:g,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(D(t))return{width:0,height:0};if(D(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:a,limit:o,lineHeight:l}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:l});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:s,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:s}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;it.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=n)&&void 0!==i?i:s)+1)+1}}return e(t.toString())}_measureNumberChar(){if(D(this._numberCharSize)){const t=this._standardMethod(Fi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Fi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return D(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Fi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(D(this._letterCharSize)){const t=this._standardMethod(Fi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Fi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return M(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){M(this._canvas)&&(this._canvas=null),M(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Fi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Fi.NUMBERS_CHAR_SET="0123456789",Fi.FULL_SIZE_CHAR="字";const Yi="Singleton",ji="Transient",Hi="ConstantValue",zi="Instance";class Ni{constructor(t,e){this.id=B.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type="Invalid",this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Ni(this.serviceIdentifier,this.scope);return t.activated=t.scope===Yi&&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 Vi{getConstructorMetadata(t){return{compilerGeneratedMetadata:N.getMetadata(z,t),userGeneratedMetadata:N.getMetadata(H,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Wi=(Gi=F,t=>{const e=e=>{if(null==e)return!1;if(e.key===Gi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;ee.container.get(t)))}}const Xi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=B.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Vi}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,F,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Ni(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new $i(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[t.key]=t.value}));const r={inject:s[Y],multiInject:s[j]},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};n.push(l)}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Hi:case"Function":e=t.cache;break;case zi: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===Yi&&(t.cache=e,t.activated=!0)}},Ki=Symbol.for("CanvasFactory"),qi=Symbol.for("Context2dFactory");function Zi(t){return Xi.getNamed(Ki,Si.global.env)(t)}Math.sqrt(3);const Ji=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=Zi(Object.assign({nativeCanvas:Si.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=Zi(Object.assign({nativeCanvas:Si.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Qi=Symbol.for("VWindow"),ts=Symbol.for("WindowHandlerContribution");let es=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new Q(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Xi.getNamed(ts,t.env).configure(this,t),this.actived=!0)},this._uid=B.GenAutoIncrementId(),this.global=Si.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const s=this._handler.getWH();this._width=s.width,this._height=s.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,s,n,r){this._handler.setViewBoxTransform(t,e,i,s,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),s={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},s),s.x-=i.x1,s.y-=i.y1,s}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};es=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],es);var is=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},ss=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ns=function(t,e){return function(i,s){e(i,s,t)}};let rs=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=Si.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=Ji.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(s=e.fontSize)&&void 0!==s?s:ni.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Fi(Object.assign({defaultFontParams:{fontFamily:ni.fontFamily,fontSize:ni.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Fi.ALPHABET_CHAR_SET+Fi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const s=Xi.get(Qi),n=t.AABBBounds,r=n.width(),a=n.height(),o=-n.x1,l=-n.y1;s.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:r,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(s,[t],{transMatrix:s.getViewBoxTransform(),viewBox:s.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=s.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var as;rs=is([V(),ns(0,$(K)),ns(0,X(Oi)),ss("design:paramtypes",[Object])],rs),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(as||(as={}));const os=new Pt;let ls=class{constructor(){this.matrix=new Pt}init(t){return this.mode=as.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=as.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const s=this.outSourceMatrix;if(os.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){const{x:s,y:n}=i;this.outTargetMatrix.translate(s,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(os.a,os.b,os.c,os.d,os.e,os.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(os.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:s}=e;this.outTargetMatrix.translate(i,s),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-s)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(os.a,os.b,os.c,os.d,os.e,os.f),this}scale(t,e,i){return this.mode===as.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===as.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return os.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(os.a,os.b,os.c,os.d,os.e,os.f),this}translate(t,e){return this.mode===as.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===as.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};ls=is([V(),ss("design:paramtypes",[])],ls);const hs={arc:li,area:hi,circle:di,line:pi,path:gi,symbol:fi,text:vi,rect:_i,polygon:mi,richtext:yi,richtextIcon:xi,image:bi,group:ci,glyph:ui},ds=Object.keys(hs);function cs(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const us={arc:Object.assign({},hs.arc),area:Object.assign({},hs.area),circle:Object.assign({},hs.circle),line:Object.assign({},hs.line),path:Object.assign({},hs.path),symbol:Object.assign({},hs.symbol),text:Object.assign({},hs.text),rect:Object.assign({},hs.rect),polygon:Object.assign({},hs.polygon),richtext:Object.assign({},hs.richtext),richtextIcon:Object.assign({},hs.richtextIcon),image:Object.assign({},hs.image),group:Object.assign({},hs.group),glyph:Object.assign({},hs.glyph)};class ps{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ds.forEach((t=>{this._defaultTheme[t]=Object.create(us[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,g.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ds.forEach((s=>{const n=Object.create(us[s]);t&&t[s]&&cs(n,t[s]),i[s]&&cs(n,i[s]),e[s]&&cs(n,e[s]),this.combinedTheme[s]=n})),e.common&&ds.forEach((t=>{cs(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 gs=new ps;function ms(t,e){return t.glyphHost?ms(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)):gs.getTheme()}return null}(t)||t.attachedThemeGraphic&&ms(t.attachedThemeGraphic)||gs.getTheme()}const _s=Object.prototype.hasOwnProperty,fs=(t,e)=>null!=t&&_s.call(t,e),vs=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),ys=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),bs=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},xs=t=>"function"==typeof t;class Ss extends(o()){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=B.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return i=this,s=void 0,r=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}}},new((n=void 0)||(n=Promise))((function(t,e){function a(t){try{l(r.next(t))}catch(t){e(t)}}function o(t){try{l(r.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,o)}l((r=r.apply(i,s||[])).next())}));var i,s,n,r}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&g.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t0&&(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,e=!1){let 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,e=!1){let 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,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i1&&(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-ws.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ws.bounceIn(2*t):.5*ws.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*lt/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/lt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*lt/e)*.5+1}}}ws.quadIn=ws.getPowIn(2),ws.quadOut=ws.getPowOut(2),ws.quadInOut=ws.getPowInOut(2),ws.cubicIn=ws.getPowIn(3),ws.cubicOut=ws.getPowOut(3),ws.cubicInOut=ws.getPowInOut(3),ws.quartIn=ws.getPowIn(4),ws.quartOut=ws.getPowOut(4),ws.quartInOut=ws.getPowInOut(4),ws.quintIn=ws.getPowIn(5),ws.quintOut=ws.getPowOut(5),ws.quintInOut=ws.getPowInOut(5),ws.backIn=ws.getBackIn(1.7),ws.backOut=ws.getBackOut(1.7),ws.backInOut=ws.getBackInOut(1.7),ws.elasticIn=ws.getElasticIn(1,.3),ws.elasticOut=ws.getElasticOut(1,.3),ws.elasticInOut=ws.getElasticInOut(1,.3*1.5);class Ts{constructor(){this.id=B.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===de.END?this.removeAnimate(e):e.status===de.RUNNING||e.status===de.INITIAL?(this.animateCount++,e.advance(t)):e.status===de.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const Ls=new Ts;class Cs{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 Es extends Cs{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Ds{constructor(t=B.GenAutoIncrementId(),e=Ls,i){this.id=t,this.timeline=e,this.status=de.INITIAL,this.tailAnimate=new Ps(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=ut(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Ds.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Ds.mode){t&&e&ce.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:he.ANIMATE_PLAY})}runCb(t){const e=new Es((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=Ds.interpolateMap.get(t)||Ds.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===de.RUNNING&&(this.status=de.PAUSED)}resume(){this.status===de.PAUSED&&(this.status=de.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 Ps(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._duringTimet()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===de.RUNNING&&(this.status=de.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=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=de.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}Ds.mode=ce.NORMAL,Ds.interpolateMap=new Map;class Ps{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 Os(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?ws[i]:i,n=this._addStep(e,null,s);return n.type=ue.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?ws[i]:i,r=this._addStep(e,null,n);return r.type=ue.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=ue.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=ue.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 Os(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=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 i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return g.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 Os{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 Rs=function(t,e,i){return ti?i:t};function Bs(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),r=i-s/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=s,o=n,l=0):60<=t&&t<120?(a=n,o=s,l=0):120<=t&&t<180?(a=0,o=s,l=n):180<=t&&t<240?(a=0,o=n,l=s):240<=t&&t<300?(a=n,o=0,l=s):300<=t&&t<360&&(a=s,o=0,l=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Is(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,l=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l}}const Fs=/^#([0-9a-f]{3,8})$/,Ys={transparent:4294967040},js={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Hs(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function zs(t){return h(t)?new Us(t>>16,t>>8&255,255&t,1):y(t)?new Us(t[0],t[1],t[2]):new Us(255,255,255)}function Ns(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Vs(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ws=(t,e)=>{const i=Fs.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Us((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?zs(t):8===e?new Us(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Gs{static Brighter(t,e=1){return 1===e?t:new Gs(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Gs(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof Gs?t:new Gs(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(M(Ys[t]))return function(t){return h(t)?new Us(t>>>24,t>>>16&255,t>>>8&255,255&t):y(t)?new Us(t[0],t[1],t[2],t[3]):new Us(255,255,255,1)}(Ys[t]);if(M(js[t]))return zs(js[t]);const e=`${t}`.trim().toLowerCase(),i=Ws(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Us(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Bs(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Us(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Gs.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Us(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=Is(this.color.r,this.color.g,this.color.b),r=Bs(D(t)?n.h:Rs(t,0,360),D(e)?n.s:e>=0&&e<=1?100*e:e,D(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Us(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!D(t)&&(this.color.r=t),!D(e)&&(this.color.g=e),!D(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Ws(e,!0);return null!=i?i:this}setColorName(t){const e=js[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Gs(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Ns(t.color.r),this.color.g=Ns(t.color.g),this.color.b=Ns(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Vs(t.color.r),this.color.g=Vs(t.color.g),this.color.b=Vs(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Us{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),M(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${Hs(this.r)+Hs(this.g)+Hs(this.b)+(1===this.opacity?"":Hs(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=Is(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var $s;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}($s||($s={}));class Xs{static Get(t,e=$s.Color1,i=[0,0,0,1]){if(e===$s.Color1){const e=Xs.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=Gs.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Xs.store1[t]=e,Xs.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=Xs.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=Gs.parseColorString(t);return n&&(Xs.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],Xs.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===$s.Color1){if(Xs.store1[t])return;Xs.store1[t]=i,Xs.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Xs.store255[t])return;Xs.store255[t]=i,Xs.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Ks(t,e=!1){return Array.isArray(t)&&h(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 qs(t,e,i,s,n){return Array.isArray(t)&&!h(t[0])||Array.isArray(e)&&!h(e[0])?new Array(4).fill(0).map(((n,r)=>Zs(y(t)?t[r]:t,y(e)?e[r]:e,i,s))):Zs(t,e,i,s,n)}function Zs(t,e,i,s,n){if(!t||!e)return t&&Ks(t)||e&&Ks(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Xs.Get(t,$s.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Xs.Get(e,$s.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:Ks(a)})))});return o?qs(r,l,i,s,n):qs(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:tn(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:tn(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:tn(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),Ks(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)}Xs.store255={},Xs.store1={};const Js=[0,0,0,0],Qs=[0,0,0,0];function tn(t,e,i){return Xs.Get(t,$s.Color255,Js),Xs.Get(e,$s.Color255,Qs),`rgba(${Math.round(Js[0]+(Qs[0]-Js[0])*i)},${Math.round(Js[1]+(Qs[1]-Js[1])*i)},${Math.round(Js[2]+(Qs[2]-Js[2])*i)},${Js[3]+(Qs[3]-Js[3])*i})`}class en{static GetImage(t,e){var i;const s=en.cache.get(t);s?"fail"===s.loadState?Si.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):en.loadImage(t,e)}static GetSvg(t,e){var i;let s=en.cache.get(t);s?"fail"===s.loadState?Si.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"},en.cache.set(t,s),s.dataPromise=Si.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=en.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},en.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Si.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Si.global.loadBlob(t):"json"===e&&(i.dataPromise=Si.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!en.isLoading&&en.toLoadAueue.length){en.isLoading=!0;const t=en.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(en.cache.set(i,n),n.dataPromise=Si.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((()=>{en.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),en.loading()})).catch((t=>{console.error(t),en.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),en.loading()}))}}),0)}static loadImage(t,e){const i=sn(t,en.toLoadAueue);if(-1!==i)return en.toLoadAueue[i].marks.push(e),void en.loading();en.toLoadAueue.push({url:t,marks:[e]}),en.loading()}static improveImageLoading(t){const e=sn(t,en.toLoadAueue);if(-1!==e){const t=en.toLoadAueue.splice(e,1);en.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function sn(t,e){for(let i=0;it?y(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(an[0]=t[0],an[2]=t[0],an[1]=t[1],an[3]=t[1],an):t:t:0,ln=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],hn=[1,2,3,0,1,2,3,0];function dn(t,e,i,s){for(;t>=lt;)t-=lt;for(;t<0;)t+=lt;for(;t>e;)e+=lt;ln[0].x=i,ln[1].y=i,ln[2].x=-i,ln[3].y=-i;const n=Math.ceil(t/at)%4,r=Math.ceil(e/at)%4;if(s.add(ct(t)*i,gt(t)*i),s.add(ct(e)*i,gt(e)*i),n!==r||e-t>rt){let t=!1;for(let e=0;ee.length){s=e.map((t=>{const e=new be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{const e=new be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}gn.TimeOut=1e3/60;const mn=new gn,_n=(t,e)=>S(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,fn=new Pt,vn=new qt,yn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],bn=["x","y"],xn=["scaleX","scaleY"],Sn=["angle"],Mn=new be,kn={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 An extends Ss{static mixin(t){const e=Object.keys(t);for(let i=0;i{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Si.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)&&(!!D(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 d;i.forEach((e=>{l[e]?(d||(d={}),d[e]=t[e]):h[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:200,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:"cubicOut"),d&&this.setAttributes(d,!1,{type:he.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:he.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();fs(s,t)&&(e=s[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|=oe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=oe.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=oe.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&oe.UPDATE_SHAPE_AND_BOUNDS)===oe.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=oe.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oe.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oe.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=oe.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=oe.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=oe.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=oe.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&oe.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 vn.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(vn),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=ti.x,y:e=ti.y,scaleX:i=ti.scaleX,scaleY:s=ti.scaleY,angle:n=ti.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,d=e.c,c=e.d,u=e.e,p=e.f,g=ct(a),m=gt(a);let _,f;o?(_=o[0],f=o[1]):(_=i,f=s);const v=_-i,y=f-s,b=l*g+d*m,x=h*g+c*m,S=d*g-l*m,M=c*g-h*m;t.a=n*b,t.b=n*x,t.c=r*S,t.d=r*M,t.e=u+l*_+d*f-b*v-S*y,t.f=p+h*_+c*f-x*v-M*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h),Si.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const d=this.getOffsetXY(ti);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,o){const t=fn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Si.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:he.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:he.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 d=a[r],c=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==d||null==c||d===c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,l,n)||this._interpolate(r,n,c,d,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=qs(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=qs(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=qs(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,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Si.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 S(t,!0)?this.pathProxy=(new Ze).fromString(t):this.pathProxy=new Ze,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",Si.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new ks(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)}}}An.mixin(As);function wn(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Tn=0;function Ln(){return Tn++}var Cn;function En(t){const e=[];let i=0,s="";for(let n=0;nDn.set(t,!0)));const Pn=new Map;function On(t){if(Dn.has(t))return!0;if(Pn.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Pn.set(t,!0)));const Rn=Ln(),Bn=Ln(),In=Ln(),Fn=Ln(),Yn=Ln(),jn=Ln(),Hn=Ln(),zn=Ln(),Nn=Ln(),Vn=Ln(),Wn=Ln(),Gn=Ln(),Un=Ln(),$n=Ln(),Xn=Ln(),Kn=Ln(),qn=Symbol.for("GraphicService"),Zn=Symbol.for("GraphicCreator"),Jn=(Object.keys({"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"}),{"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"}),Qn=Object.keys(Jn);var tr;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(tr||(tr={}));class er extends An{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=jn,this._childUpdateTag=oe.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 ps),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new ps)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===le.GLOBAL){const i=new be(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&oe.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Si.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Si.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=ti.x,y:e=ti.y,dx:i=ti.dx,dy:s=ti.dy,scaleX:n=ti.scaleX,scaleY:r=ti.scaleY,angle:a=ti.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 ms(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip,display:l}=t;return 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)})),Si.graphicService.updateTempAABBBounds(i),Si.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&=oe.CLEAR_BOUNDS,this._childUpdateTag&=oe.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=oe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&oe.UPDATE_BOUNDS||(this._childUpdateTag|=oe.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(),Si.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Si.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,Si.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{Si.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),Si.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&oe.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=Si.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new er(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return er.NOWORK_ANIMATE_ATTR}}function ir(t){return new er(t)}er.NOWORK_ANIMATE_ATTR=kn;class sr extends er{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,s){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=s.main,this.layerHandler=s.layerHandler,this.layerHandler.init(this,i,{main:s.main,canvasId:s.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=s.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new ps,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Si.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Si.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const nr=Symbol.for("TransformUtil"),rr=Symbol.for("GraphicUtil"),ar=Symbol.for("LayerService"),or=Symbol.for("StaticLayerHandlerContribution"),lr=Symbol.for("DynamicLayerHandlerContribution"),hr=Symbol.for("VirtualLayerHandlerContribution");var dr;let cr=dr=class{static GenerateLayerId(){return`${dr.idprefix}_${dr.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Si.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Xi.get(or):"dynamic"===t?Xi.get(lr):Xi.get(hr),e}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;const n=this.getLayerHandler(s),r=new sr(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:dr.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(r),this.layerMap.set(t,a),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};cr.idprefix="visactor_layer",cr.prefix_count=0,cr=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],cr);const ur=new I((t=>{t(et).to(st).inSingletonScope(),t(Qi).to(es),t(rr).to(rs).inSingletonScope(),t(nr).to(ls).inSingletonScope(),t(ar).to(cr).inSingletonScope()})),pr=Symbol.for("IncrementalDrawContribution"),gr=Symbol.for("ArcRender"),mr=Symbol.for("Arc3dRender"),_r=Symbol.for("AreaRender"),fr=Symbol.for("CircleRender"),vr=Symbol.for("GraphicRender"),yr=Symbol.for("GroupRender"),br=Symbol.for("LineRender"),xr=Symbol.for("PathRender"),Sr=Symbol.for("PolygonRender"),Mr=Symbol.for("RectRender"),kr=Symbol.for("Rect3DRender"),Ar=Symbol.for("SymbolRender"),wr=Symbol.for("TextRender"),Tr=Symbol.for("RichTextRender"),Lr=Symbol.for("Pyramid3dRender"),Cr=Symbol.for("GlyphRender"),Er=Symbol.for("ImageRender"),Dr=(Symbol.for("RenderSelector"),Symbol.for("DrawContribution"));const Pr=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let Or=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};var Rr,Br;Or=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}([V(),(Rr=0,Br=$(Dr),function(t,e){Br(t,e,Rr)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Or);const Ir=new I((t=>{t(Pr).to(Or)})),Fr=(Symbol.for("GraphicPicker"),Symbol.for("PickerService")),Yr=(Symbol.for("BoundsPicker"),Symbol.for("GlobalPickerService"));function jr(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 Hr(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,d,c,u,p,g,m,_,f;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],d=e[4],c=e[5],u=e[6],p=e[7],g=e[8],m=e[9],_=e[10],f=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=p,t[8]=g,t[9]=m,t[10]=_,t[11]=f,t[12]=a*s+d*n+g*r+e[12],t[13]=o*s+c*n+m*r+e[13],t[14]=l*s+u*n+_*r+e[14],t[15]=h*s+p*n+f*r+e[15]),t}function zr(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Nr(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],d=e[7],c=e[8],u=e[9],p=e[10],g=e[11],m=e[12],_=e[13],f=e[14],v=e[15];let y=i[0],b=i[1],x=i[2],S=i[3];return t[0]=y*s+b*o+x*c+S*m,t[1]=y*n+b*l+x*u+S*_,t[2]=y*r+b*h+x*p+S*f,t[3]=y*a+b*d+x*g+S*v,y=i[4],b=i[5],x=i[6],S=i[7],t[4]=y*s+b*o+x*c+S*m,t[5]=y*n+b*l+x*u+S*_,t[6]=y*r+b*h+x*p+S*f,t[7]=y*a+b*d+x*g+S*v,y=i[8],b=i[9],x=i[10],S=i[11],t[8]=y*s+b*o+x*c+S*m,t[9]=y*n+b*l+x*u+S*_,t[10]=y*r+b*h+x*p+S*f,t[11]=y*a+b*d+x*g+S*v,y=i[12],b=i[13],x=i[14],S=i[15],t[12]=y*s+b*o+x*c+S*m,t[13]=y*n+b*l+x*u+S*_,t[14]=y*r+b*h+x*p+S*f,t[15]=y*a+b*d+x*g+S*v,t}function Vr(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");class Wr{constructor(){this.pools=[]}static identity(t){return jr(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 Wr.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{let n,r=!1,a=!1;if(e.forEachChildren((t=>(r=t.numberType===Bn,!r))),e.forEachChildren((t=>(a=!!t.findFace,!a))),r){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,s,n,r;let a=(null!==(s=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==s?s:0)/2,o=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;a<0;)a+=lt;for(;o<0;)o+=lt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),s.hack_pieFace="outside",n=i(r,a),n&&n.graphic||(s.hack_pieFace="inside",n=i(r,a)),n&&n.graphic||(s.hack_pieFace="top",n=i(r,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const s=e.getChildren(),o=s.map((e=>({ave_z:e.findFace().vertices.map((i=>{var s;return t.view(i[0],i[1],null!==(s=i[2]+e.attribute.z)&&void 0!==s?s:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),n=i(r,a),e.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),e.update(),s.forEach((t=>{e.add(t)}))}else n=i(r,a);return n};var Xr=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};const Kr=Symbol.for("PickItemInterceptor");let qr=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,n):null}beforePickItem(t,e,i,s,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,n):null}_pickItem(t,e,i,s,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:a}=n||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const l=null===(r=ms(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,d=t.shadowRoot,c=Gr.allocateByObj(a),u=new be(c.a*i.x+c.c*i.y+c.e,c.b*i.x+c.d*i.y+c.f),p=e.pickGroup(d,u,c,s);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};qr=Xr([V()],qr);let Zr=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){const r=t.baseGraphic;if(r&&r.parent){const t=new be(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(t,t);const o=r.isContainer?e.pickGroup(r,t.clone(),a,s):e.pickItem(r,t.clone(),a,s);return n.highPerformanceRestore(),o}return null}};Zr=Xr([V()],Zr);let Jr=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){if(!t.in3dMode||s.in3dInterceptor)return null;const r=e.pickContext,a=t.stage;if(!r||!a)return null;if(s.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,t.isContainer){const a=$r(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,s)),s);return r.camera=null,s.in3dInterceptor=!1,r.restore(),a}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Jr=Xr([V()],Jr);const Qr=new I(((t,e,i)=>{i(Fr)||(t(Yr).toSelf(),t(Fr).toService(Yr)),t(Jr).toSelf().inSingletonScope(),t(Kr).toService(Jr),t(qr).toSelf().inSingletonScope(),t(Kr).toService(qr),t(Zr).toSelf().inSingletonScope(),t(Kr).toService(Zr),Z(t,Kr)}));function ta(t,e=0,i=0){if(!t)return{width:e,height:i};let s;try{s=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){s=()=>({})}const n=s(t);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){const s=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||t.clientWidth-1,r=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||t.clientHeight-1;return{width:s<=0?e:s,height:r<=0?i:r}}return{width:e,height:i}}const ea=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();function ia(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function sa(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function na(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:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:m=i.angle,anchor3d:_=e.attribute.anchor,anchor:f}=e.attribute,v=[0,0,0];if(_){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=_[1];v[2]=null!==(s=_[2])&&void 0!==s?s:0}if(jr(t),Hr(t,t,[n+o,r+l,a+h]),Hr(t,t,[v[0],v[1],v[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],d=e[9],c=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+d*s,t[6]=o*n+c*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=d*n-a*s,t[10]=c*n-o*s,t[11]=u*n-l*s}(t,t,g),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],d=e[9],c=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-d*s,t[2]=o*n-c*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+d*n,t[10]=o*s+c*n,t[11]=l*s+u*n}(t,t,p),Hr(t,t,[-v[0],-v[1],v[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,[d,c,u]),m){const i=Ur.allocate(),s=[0,0];if(f){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=_[1]}Hr(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],d=e[5],c=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+d*s,t[2]=o*n+c*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=d*n-a*s,t[6]=c*n-o*s,t[7]=u*n-l*s}(i,i,m),Hr(i,i,[-s[0],-s[1],0]),Nr(t,t,i)}}let ra=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Q(["graphic"]),onSetStage:new Q(["graphic","stage"]),onRemove:new Q(["graphic"]),onRelease:new Q(["graphic"]),onAddIncremental:new Q(["graphic","group","stage"]),onClearIncremental:new Q(["graphic","group","stage"]),beforeUpdateAABBBounds:new Q(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Q(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new qt,this.tempAABBBounds2=new qt}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)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new Rt(t);return ye(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=h(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=sa(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=h(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=ia(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l&&(wn(c,(l+h)/Math.abs(n+r),s,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)),o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;wn(c,o/Math.abs(n+r)*2,!1,d+1),c.translate(s,a),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Xt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot)return!0;if(!s.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(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}}};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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Zn)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ra);const aa=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}},oa=new I((t=>{t(qn).to(ra).inSingletonScope(),t(Zn).toConstantValue(aa)})),la=Symbol.for("AutoEnablePlugins"),ha=Symbol.for("PluginService");var da=function(t,e){return function(i,s){e(i,s,t)}};let ca=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Xi.isBound(la)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};ca=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}([V(),da(0,$(K)),da(0,X(la)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ca);const ua=new I((t=>{t(ha).to(ca),function(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).whenTargetNamed(e)}(t,la)})),pa=new I((t=>{Z(t,tt)})),ga=new I((t=>{t(Oi).to(Ri).inSingletonScope(),Z(t,Oi)}));let ma=class{constructor(){this.type="static",this.offscreen=!1,this.global=Si.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const s=e.getContext().getCanvas().nativeCanvas,n=Zi({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(s=e.background)&&void 0!==s?s:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var s;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(s=i.background)&&void 0!==s?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};ma=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ma);const _a=new I((t=>{t(ma).toSelf(),t(or).toService(ma)})),fa=U(j);function va(t,e,i){const s={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:s,zIdxArray:n}}function ya(t,e,i,s=!1,n=!1){let r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,s)=>{const{zIndex:n=e}=t.attribute;if(0===s)i=n;else if(i!==n)return r=!0,!0;return!1}),s)}if(r){const{childMap:r,zIdxArray:a}=va(t,e,s);let o=!1;for(let t=0;t{var i,n;return(s?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t{const{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return n=!0,!0;return!1}),s);let r=null,a=!1;if(n){const{childMap:n,zIdxArray:o}=va(t,i,s);let l=!1;for(let t=0;ta?(r=t,!0):(t._uid===e&&(a=!0),!1)),s);return r}const Sa=Symbol.for("DrawItemInterceptor"),Ma=new qt,ka=new qt;class Aa{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,s,n),!1}beforeDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){Ma.copy(s.dirtyBounds),ka.copy(s.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,Gr.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(Ma),s.backupDirtyBounds.copy(ka)),!0}}class wa{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(a.x1,a.y1,a.width(),a.height()),r.highPerformanceRestore(),!0}}let Ta=class{constructor(){this.order=1,this.interceptors=[new Aa,new Ca,new La,new wa]}afterDrawItem(t,e,i,s,n){for(let r=0;r=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Ta);class La{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,s,n):this.beforeSetInteractive(t,e,i,s,n))}beforeSetInteractive(t,e,i,s,n){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,s,n){const r=t.baseGraphic;let a=!!r.stage,o=r.parent;for(;a&&o&&o.stage!==o;)a=!!o.stage,o=o.parent;if(!a){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?s.renderGroup(r,i,r.parent.globalTransMatrix):s.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=aa.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Ca{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:a}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=a.camera;const o=r.currentMatrix;o.a/=r.dpr,o.b/=r.dpr,o.c/=r.dpr,o.d/=r.dpr,o.e/=r.dpr,o.f/=r.dpr;const l=Ur.allocate();zr(l,o);const h=r.modelMatrix;if(h){if(l){const t=Ur.allocate();r.modelMatrix=Nr(t,h,l)}}else r.modelMatrix=l;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?$r(r,t,((e,n)=>s.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):s.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&Ur.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}const Ea=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 s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s){if(f(s)){f(t.startCall)||i("Missing (");const s=function(){const s=n();return s&&(f(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:u(p)}}();return f(t.endCall)||i("Missing )"),s}}(s)}function r(){return _("directional",t.sideOrCorner,1)||_("angular",t.angleValue,1)}function a(){return _("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,f(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=_("shape",/^(circle)/i,0);return t&&(t.style=m()||h()),t}()||function(){const t=_("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return _("extent-keyword",t.extentKeywords,1)}function d(){if(_("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let s=e();const n=[];if(s)for(n.push(s);f(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=_("hex",t.hexColor,1)||_("rgba",t.rgbaColor,1)||_("rgb",t.rgbColor,1)||_("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return _("%",t.percentageValue,1)||_("position-keyword",t.positionKeywords,1)||m()}function m(){return _("px",t.pixelValue,1)||_("em",t.emValue,1)}function _(t,e,i){const s=f(e);if(s)return{type:t,value:s[i]}}function f(t){const i=/^[\n\r\t\s]+/.exec(e);i&&v(i[0].length);const s=t.exec(e);return s&&v(s[0].length),s}function v(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Da{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Da.IsGradientStr(t))try{const e=Ea(t)[0];if(e){if("linear"===e.type)return Da.ParseLinear(e);if("radial"===e.type)return Da.ParseRadial(e);if("conic"===e.type)return Da.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2,n=parseFloat(e.value)/180*rt-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+lt,stops:i.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:i=[]}=t,s=rt/2;let n="angular"===e.type?parseFloat(e.value)/180*rt:0;for(;n<0;)n+=lt;for(;n>lt;)n-=lt;let r=0,a=0,o=0,l=0;return n({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Pa(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)}function Oa(t,e,i,s=0,n=0){if(!e||!0===e)return"black";let r,a;if(y(e))for(let t=0;t{d.addColorStop(t.offset,t.color)})),d}(t,a,h,d,o,l):"conical"===a.gradient?r=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(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(n+i,r+s,void 0)}(t,a,h,d,o,l):"radial"===a.gradient&&(r=function(t,e,i,s,n,r){var a,o,l,h,d,c;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(d=e.y1)&&void 0!==d?d:.5)*r,Math.max(n,r)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,a,h,d,o,l))}return r||"orange"}Symbol.for("BoundsAllocate");const Ra=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new qt)}allocate(t,e,i,s){if(!this.pools.length)return(new qt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new qt(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(...t){this.pools=[]}};var Ba=function(t,e){return function(i,s){e(i,s,t)}};let Ia=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Kt,this.backupDirtyBounds=new Kt,this.global=Si.global,this.layerService=Si.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:s,viewBox:n,transMatrix:r}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(s.dirtyBounds&&!s.dirtyBounds.empty()){const t=Ft(a,s.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),s.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Gr.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=xa(e,i,oi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,s){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!zt(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=Ra.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=Gr.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;s?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):ya(t,oi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),Ra.free(n),Gr.free(r))}_increaseRender(t,e){const{layer:i,stage:s}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(s),zIndex:n.size,group:t},n.set(t._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||Xi.get(pr);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:t._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(s),zIndex:n.size},n.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let s=0;s=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}([V(),Ba(0,fa(vr)),Ba(1,$(K)),Ba(1,X(Sa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],Ia);const ja=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n0)&&(s=r)}return s},Ha=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;nt||void 0===t)):!!t,i&&e>0}function Xa(t,e,i){return i&&t*e>0}function Ka(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function qa(t,e){return t*e>0}function Za(t,e,i,s){return t*e>0&&0!==i&&0!==s}function Ja(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),d=h*l,c=-h*o,u=t+d,p=e+c,g=i+d,m=s+c,_=(u+g)/2,f=(p+m)/2,v=g-u,y=m-p,b=v*v+y*y,x=n-r,S=u*m-g*p,M=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-v*M)/b,A=(-S*v-y*M)/b;const w=(S*y+v*M)/b,T=(-S*v+y*M)/b,L=k-_,C=A-f,E=w-_,D=T-f;return L*L+C*C>E*E+D*D&&(k=w,A=T),{cx:k,cy:A,x01:-d,y01:-c,x11:k*(n/x-1),y11:A*(n/x-1)}}function Qa(t,e,i,s,n){const r=ht(i-e),a=t.getParsedCornerRadius(),o=y(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:c,innerEndAngle:u,innerStartAngle:p}=t.getParsePadAngle(e,i),g=o?a[0]:a,m=o?a[1]:a,_=o?a[2]:a,f=o?a[3]:a,v=Math.max(m,g),b=Math.max(_,f);let x=v,S=b;const M=n*ct(d),k=n*gt(d),A=s*ct(u),w=s*gt(u);let T,L,C,E;if((b>nt||v>nt)&&(T=n*ct(c),L=n*gt(c),C=s*ct(p),E=s*gt(p),r1?0:D<-1?rt:Math.acos(D))/2),l=mt(t[0]*t[0]+t[1]*t[1]);S=pt(b,(s-l)/(o-1)),x=pt(v,(n-l)/(o+1))}}var D;return{outerDeltaAngle:l,xors:M,yors:k,xirs:C,yirs:E,xore:T,yore:L,xire:A,yire:w,limitedOcr:x,limitedIcr:S,outerCornerRadiusStart:g,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:b,outerStartAngle:d,outerEndAngle:c,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:p,innerCornerRadiusStart:f,innerCornerRadiusEnd:_}}function to(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(n=lt-nt)e.moveTo(i+n*ct(o),s+n*gt(o)),e.arc(i,s,n,o,l,!d),r>nt&&(e.moveTo(i+r*ct(l),s+r*gt(l)),e.arc(i,s,r,l,o,d));else{const{outerDeltaAngle:h,xors:u,yors:p,xirs:g,yirs:m,limitedOcr:_,outerCornerRadiusStart:f,outerCornerRadiusEnd:v,maxOuterCornerRadius:y,xore:b,yore:x,xire:S,yire:M,outerStartAngle:k,outerEndAngle:A,limitedIcr:w,innerDeltaAngle:T,innerEndAngle:L,innerStartAngle:C,innerCornerRadiusStart:E,innerCornerRadiusEnd:D,maxInnerCornerRadius:P}=Qa(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+u,s+p),c=!0;else if(_>nt){const t=pt(f,_),r=pt(v,_),o=Ja(g,m,u,p,n,t,Number(d)),l=Ja(b,x,S,M,n,r,Number(d));_0&&e.arc(i+o.cx,s+o.cy,t,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,n,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),!d),r>0&&e.arc(i+l.cx,s+l.cy,r,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):r>0?e.moveTo(i+l.cx+r*ct(dt(l.y01,l.x01)),s+l.cy+r*gt(dt(l.y01,l.x01))):e.moveTo(i+b,s+n*gt(A))}else!a||a[0]?(e.moveTo(i+u,s+p),e.arc(i,s,n,k,A,!d)):e.moveTo(i+n*ct(A),s+n*gt(A));if(!(r>nt)||T<.001)!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),c=!0;else if(w>nt){const t=pt(E,w),n=pt(D,w),o=Ja(S,M,b,x,r,-n,Number(d)),l=Ja(u,p,g,m,r,-t,Number(d));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),w0&&e.arc(i+o.cx,s+o.cy,n,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,r,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),d),t>0&&e.arc(i+l.cx,s+l.cy,t,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):t>0?e.moveTo(i+l.cx+t*ct(dt(l.y01,l.x01)),s+l.cy+t*gt(dt(l.y01,l.x01))):e.moveTo(i+g,s+m)}else!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),!a||a[2]?e.arc(i,s,r,L,C,d):e.moveTo(i+r*ct(C),s+r*gt(C))}return a?a[3]&&e.lineTo(i+n*ct(o),s+n*gt(o)):e.closePath(),c}const eo=Symbol.for("ArcRenderContribution"),io=Symbol.for("AreaRenderContribution"),so=Symbol.for("CircleRenderContribution"),no=Symbol.for("GroupRenderContribution"),ro=Symbol.for("ImageRenderContribution"),ao=Symbol.for("PathRenderContribution"),oo=Symbol.for("PolygonRenderContribution"),lo=Symbol.for("RectRenderContribution"),ho=Symbol.for("SymbolRenderContribution"),co=Symbol.for("TextRenderContribution"),uo=(Symbol.for("CommonRenderContribution"),Symbol.for("InteractiveSubRenderContribution"));var po=function(t,e){return function(i,s){e(i,s,t)}};class go{constructor(){this.time=me.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;const{background:g,backgroundOpacity:m=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:_=l.opacity,backgroundMode:f=l.backgroundMode,backgroundFit:v=l.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ms(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=m*_,this.doDrawImage(e,n.data,r,f,v),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,e.fillStyle=g,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,d=Ji.allocate({width:o,height:l,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=d.nativeCanvas),Ji.free(d)}const h=t.dpr,d=t.createPattern(e,s);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}}const mo=new go;let _o=class{constructor(t){this.subRenderContribitions=t,this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}};_o=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}([V(),po(0,$(K)),po(0,X(uo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_o);const fo=new class extends go{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{background:u,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const s=t.AABBBounds;this.doDrawImage(e,i.data,s,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}};var vo=function(t,e){return function(i,s){e(i,s,t)}};let yo=class{constructor(t){this.groupRenderContribitions=t,this.numberType=jn}drawShape(t,e,i,s,n,r,a,o){const l=ms(t,null==r?void 0:r.theme).group,{fill:h=l.fill,background:d,stroke:c=l.stroke,opacity:u=l.opacity,width:p=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:_=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,cornerRadius:v=l.cornerRadius,path:b=l.path,lineWidth:x=l.lineWidth,visible:S=l.visible}=t.attribute,M=Ka(u,_,p,g,h),k=Za(u,f,p,g),A=Ua(h,d),w=$a(c,x);if(!t.valid||!S)return;if(!m){if(!A&&!w)return;if(!(M||k||a||o||d))return}if(b&&b.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,b.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===v||y(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(i,s,p,g)):(e.beginPath(),Ga(e,i,s,p,g,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(fo));const T={doFill:A,doStroke:w};this._groupRenderContribitions.forEach((r=>{r.time===me.beforeFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o,T)})),m&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T.doFill&&(a?a(e,t.attribute,l):M&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fill())),T.doStroke&&(o?o(e,t.attribute,l):k&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),this._groupRenderContribitions.forEach((r=>{r.time===me.afterFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:a=1}=t.attribute;r?n.save():n.highPerformanceSave();const o=n.baseGlobalAlpha;n.baseGlobalAlpha*=a;const l=ms(t,null==s?void 0:s.theme).group,h=n.modelMatrix;if(n.camera){const e=Ur.allocate(),i=Ur.allocate();na(i,t,l),Nr(e,h||e,i),n.modelMatrix=e,Ur.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),s.skipDraw?this.drawShape(t,n,0,0,i,s,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:d=l.scrollX,scrollY:c=l.scrollY}=t.attribute;let u;(d||c)&&n.translate(d,c),s&&s.drawingCb&&(u=s.drawingCb()),n.modelMatrix!==h&&Ur.free(n.modelMatrix),n.modelMatrix=h,n.baseGlobalAlpha=o,u&&u.then?u.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};yo=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}([V(),vo(0,$(K)),vo(0,X(no)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],yo);const bo={x:0,y:0,z:0,lastModelMatrix:null};class xo{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===me.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===me.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,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,d,c,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,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,d,c,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:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Xa(o,l,n),p=qa(o,d),g=Ua(n,r),m=$a(a,h);return!(!t.valid||!c)&&!(!g&&!m)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:m}}transform(t,e,i,s=!1){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:d}=t.attribute,c=i.modelMatrix,u=i.camera;bo.x=n,bo.y=r,bo.z=a,bo.lastModelMatrix=c;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){const s=Ur.allocate(),n=Ur.allocate();na(n,t,e),Nr(s,c||s,n),bo.x=0,bo.y=0,bo.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Ur.free(n)}if(g&&!c){const s=t.getOffsetXY(e);bo.x+=s.x,bo.y+=s.y,bo.z=a,i.setTransformForCurrent()}else if(p)bo.x=0,bo.y=0,bo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);bo.x+=s.x,bo.y+=s.y,this.transformWithoutTranslate(i,bo.x,bo.y,bo.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),bo.x=0,bo.y=0,bo.z=0;return bo}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},d={x:n,y:0},c={x:n,y:r};s.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+c.y*o.x+(d.y-c.y)*a.x)*u,g=(d.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-d.y)*a.y)*u,m=(h.x*(l.x-o.x)-d.x*l.x+c.x*o.x+(d.x-c.x)*a.x)*u,_=-(d.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-d.x)*a.y)*u,f=(h.x*(c.y*o.x-d.y*l.x)+h.y*(d.x*l.x-c.x*o.x)+(c.x*d.y-d.x*c.y)*a.x)*u,v=(h.x*(c.y*o.y-d.y*l.y)+h.y*(d.x*l.y-c.x*o.y)+(c.x*d.y-d.x*c.y)*a.y)*u;s.setTransform(p,g,m,_,f,v,!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:d,lastModelMatrix:c}=o;this.z=d,function(t,e,i,s,n,r){if(!t.pathProxy)return!1;const a=ms(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:o=a.fill,stroke:l=a.stroke,opacity:h=a.opacity,fillOpacity:d=a.fillOpacity,lineWidth:c=a.lineWidth,strokeOpacity:u=a.strokeOpacity,visible:p=a.visible,x:g=a.x,y:m=a.y}=t.attribute,_=Xa(h,d,o),f=qa(h,u),v=Ua(o),y=$a(l,c);return!p||!v&&!y||!(_||f)||(e.beginPath(),ye(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),y&&f&&(e.setStrokeStyle(t,t.attribute,i-g,s-m,a),e.stroke()),v&&_&&(e.setCommonStyle(t,t.attribute,i-g,s-m,a),e.fill()),!0)}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==c&&Ur.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}function So(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=Ae(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function Mo(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:i,originP2:d}=e;let c;if(i&&!1!==i.defined?c=l:i&&!1!==d.defined&&(c=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=c?c.x:e.p0.x,o=c?c.y:e.p0.y;t.moveTo(i+n,o+r,a)}else c&&(h=!s,t.lineTo(c.x+n,c.y+r,a))}return h}function ko(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let d=!0;const{curves:c}=e;if(i>=1){if(h){let e,i=!0;c.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Mo(t,s,e,i,r,a,o),e=s):e=s}))}else c.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+r,e.p0.y+a,o),So(t,e,1,n),d=!1):d=!0}));return}if(i<=0)return;let u;"x"===s?u=pe.ROW:"y"===s?u=pe.COLUMN:"auto"===s&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,m=!0,_=null;for(let e=0,i=c.length;et.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,a,o);const{x:S=0,x:M=0}=a;!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,a,S-d,M-c,o),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,a,S-d,M-c,o),t.stroke()));let{connectedType:k,connectedX:A,connectedY:w,connectedStyle:T}=a;if(y(o)?(k=null!==(_=null!=k?k:o[0].connectedType)&&void 0!==_?_:o[1].connectedType,A=null!==(f=null!=A?A:o[0].connectedX)&&void 0!==f?f:o[1].connectedX,w=null!==(v=null!=w?w:o[0].connectedY)&&void 0!==v?v:o[1].connectedY,T=null!==(b=null!=T?T:o[0].connectedStyle)&&void 0!==b?b:o[1].connectedStyle):(k=null!=k?k:o.connectedType,A=null!=A?A:o.connectedX,w=null!=w?w:o.connectedY,T=null!=T?T:o.connectedStyle),"connect"!==k&&"zero"!==k&&(k="none"),"none"!==k){t.beginPath(),ko(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:c,offsetZ:x,drawConnect:!0,mode:k,zeroX:A,zeroY:w});const m=[];y(o)?o.forEach((t=>m.push(t))):m.push(o),m.push(a),!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,T,S-d,M-c,m),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,T,S-d,M-c,m),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:m}=t.attribute,_=m[0];e.moveTo(_.x+a,_.y+o,g);for(let t=1;t!1===t.defined))&&"linear"===f)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,s,l,n,r,a,o);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=qe(t.points,f,{startPoint:e,curveTension:_});return s=n,n})).filter((t=>!!t)),"linearClosed"===f){let e;for(let i=0;it.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!d,c,u,n[g],[l,t.attribute],v,y,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,m=!1;t.cache.forEach(((r,_)=>{if(m)return;const f=r.getLength(),v=(p-g)/f;g+=f,v>0&&(m=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[_],[l,t.attribute],pt(v,1),y,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,l,v,y,i,s,t,a,o)}};Ao=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}([V()],Ao);let wo=class extends Ao{constructor(){super(...arguments),this.numberType=zn}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=ms(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:m=h.lineWidth,visible:_=h.visible}=t.attribute,f=Xa(u,p,d),v=qa(u,g),y=Ua(d),b=$a(c,m);if(!t.valid||!_)return;if(!y&&!b)return;if(!(f||v||a||o))return;const{context:x}=n;for(let n=e;n{!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())}};function To(t,e,i,s){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0,mode:o}=s||{};let l=e[0];t.moveTo(l.p0.x+n,l.p0.y+r,a),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+n,h.y+r,a),l=i[i.length-1],t.lineTo(l.p0.x+n,l.p0.y+r,a),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+n,h.y+r,a),t.closePath()}function Lo(t,e,i,s){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+r,a),So(t,e,1,s),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+r,a),So(t,l,1,s),o=!1):o=!0}t.closePath()}wo=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}([V()],wo);class Co{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Ji.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])),Ji.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,lt),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,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:m=l.textureSize,texturePadding:_=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,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 Eo=new Co,Do=new class extends Co{constructor(){super(...arguments),this.time=me.afterFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:f=t.attribute}=u||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:pn(l,"texture")),textureColor:y=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:pn(l,"textureColor")),textureSize:b=(null!==(m=t.attribute.textureSize)&&void 0!==m?m:pn(l,"textureSize")),texturePadding:x=(null!==(_=t.attribute.texturePadding)&&void 0!==_?_:pn(l,"texturePadding"))}=f;v&&this.drawTexture(v,t,e,i,s,l,y,b,x)}},Po=mo;var Oo=function(t,e){return function(i,s){e(i,s,t)}};let Ro=class extends xo{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=In,this.builtinContributions=[Do,Po],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_,f;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,x=v[0];e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(m=i.y1)&&void 0!==m?m:i.y)+o,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute});const{x:S=0,x:M=0}=t.attribute;if(!1!==i&&(c?c(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,S-a,M-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute}),s){const{stroke:i=l&&l.stroke}=t.attribute;if(y(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(_=i.x1)&&void 0!==_?_:i.x)+a,(null!==(f=i.y1)&&void 0!==f?f:i.y)+o,b)}}u?u(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,S-a,M-o,l),e.stroke())}}drawShape(t,e,i,s,n,r,a,o){var l,h,d,c,u,p;const g=ms(t,null==r?void 0:r.theme).area,{fill:m=g.fill,stroke:_=g.stroke,fillOpacity:f=g.fillOpacity,z:v=g.z,strokeOpacity:y=g.strokeOpacity,curveTension:b=g.curveTension}=t.attribute,x=this.valid(t,g,a,o);if(!x)return;const{doFill:S}=x,M=x.doStroke&&x.sVisible,{clipRange:k=g.clipRange,closePath:A,points:w,segments:T}=t.attribute;let{curveType:L=g.curveType}=t.attribute;if(A&&"linear"===L&&(L="linearClosed"),1===k&&!T&&!w.some((t=>!1===t.defined))&&"linear"===L)return this.drawLinearAreaHighPerformance(t,e,!!m,M,f,y,i,s,g,n,r,a,o);if(t.shouldUpdateShape()){if(T&&T.length){let e,i;const s=T.map(((t,s)=>{if(t.points.length<=1&&0===s)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===s?e={x:i.endX,y:i.endY}:s>1&&(e.x=i.endX,e.y=i.endY);const n=qe(t.points,L,{startPoint:e,curveTension:b});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=T.length-1;t>=0;t--){const e=T[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=T[t-1].points,s=e[e.length-1];s&&i.push({x:null!==(d=s.x1)&&void 0!==d?d:s.x,y:null!==(c=s.y1)&&void 0!==c?c:s.y})}i.length>1&&(n=qe(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!w||!w.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=w,i=[];for(let t=w.length-1;t>=0;t--)i.push({x:null!==(u=w[t].x1)&&void 0!==u?u:w[t].x,y:null!==(p=w[t].y1)&&void 0!==p?p:w[t].y});const s=qe(e,L,{curveTension:b}),n=qe(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b});t.cacheArea={top:s,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===k){let l=!1;t.cacheArea.forEach(((h,d)=>{l||(l=this.drawSegmentItem(e,h,S,f,M,y,r[d],[g,t.attribute],k,i,s,v,t,n,a,o))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=k*l;let d=0,c=!1;t.cacheArea.forEach(((l,u)=>{if(c)return;const p=l.top.getLength(),m=(h-d)/p;d+=p,m>0&&(c=this.drawSegmentItem(e,l,S,f,M,y,r[u],[g,t.attribute],pt(m,1),i,s,v,t,n,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,S,f,M,y,t.attribute,g,k,i,s,v,t,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).area;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m){let _=!1;return _=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!1,g,m),_=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!0,g,m),_}_drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f,v,b,x;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:S,connectedX:M,connectedY:k,connectedStyle:A}=a;const w=[];if(g&&(y(o)?(S=null!==(f=null!=S?S:o[0].connectedType)&&void 0!==f?f:o[1].connectedType,M=null!==(v=null!=M?M:o[0].connectedX)&&void 0!==v?v:o[1].connectedX,k=null!==(b=null!=k?k:o[0].connectedY)&&void 0!==b?b:o[1].connectedY,A=null!==(x=null!=A?A:o[0].connectedStyle)&&void 0!==x?x:o[1].connectedStyle):(S=null!=S?S:o.connectedType,M=null!=M?M:o.connectedX,k=null!=k?k:o.connectedY,A=null!=A?A:o.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),y(o)?o.forEach((t=>w.push(t))):w.push(o),w.push(a)),g&&"none"===S)return!1;t.beginPath();const{points:T,segments:L}=u.attribute;let C,E,D=pe.ROW;if(L){const t=L[L.length-1];E=L[0].points[0],C=t.points[t.points.length-1]}else E=T[0],C=T[T.length-1];const P=ht(C.x-E.x),O=ht(C.y-E.y);D=null==C.x1?pe.ROW:null==C.y1?pe.COLUMN:Number.isFinite(P+O)?P>O?pe.ROW:pe.COLUMN:pe.ROW,function(t,e,i,s){var n;const{drawConnect:r=!1,mode:a="none"}=s||{};if(r&&"none"===a)return;const{top:o,bottom:l}=e;if(o.curves.length!==l.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,a=!0;const h=o.curves.length;o.curves.forEach(((o,d)=>{const c=l.curves[h-d-1];let u=o,p=c;if(o.originP1===o.originP2)return n=o,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,p=r),o.defined)a||(e.push(u),i.push(p),To(t,e,i,s),e.length=0,i.length=0,a=!a);else{const{originP1:n,originP2:r}=o;let l,h;n&&!1!==n.defined?(l=u,h=p):n&&!1!==r.defined&&(l=o,h=c),a?(a=!a,e.push(l||o),i.push(h||c)):l&&(a=!a,e.push(l||o),i.push(h||c),To(t,e,i,s),e.length=0,i.length=0)}n=o})),To(t,e,i,s)}else{for(let r=0,a=o.curves.length;rp?pe.ROW:pe.COLUMN,Number.isFinite(u)||(h=pe.COLUMN),Number.isFinite(p)||(h=pe.ROW);const g=i*(h===pe.ROW?u:p);let m=0,_=!0;const f=[],v=[];let y,b,x=!0;for(let e=0,i=o.curves.length;e=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}([V(),Oo(0,$(K)),Oo(0,X(io)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ro);let Bo=class extends Ro{constructor(){super(...arguments),this.numberType=In}drawShape(t,e,i,s,n,r,a){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:o}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(r>l.length)return;const h=ms(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:p=h.visible}=t.attribute,g=Xa(u,c,d),m=Ua(d);if(!t.valid||!p)return;if(!m)return;if(!g&&!a)return;for(let n=r;n{var a,o,l,h;const d=e&&0===s?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const s=i[e];t.lineTo(null!==(a=s.x1)&&void 0!==a?a:s.x,null!==(o=s.y1)&&void 0!==o?o:s.y)}t.lineTo(null!==(l=d.x1)&&void 0!==l?l:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,a,o,r),e.fill())}};Bo=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}([V()],Bo);var Io,Fo=function(t,e){return function(i,s){e(i,s,t)}},Yo=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())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Io||(Io={}));let jo=class extends Ia{constructor(t,e,i,s){super(t,s),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Io.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Q([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Yo(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:s,viewBox:n}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(n.x1,n.y1,!0),s.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{s.restore(),s.restore(),s.draw(),s.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Yo(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Yo(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Yo(this,void 0,void 0,(function*(){if(2!==t.count)yield ba(t,oi.zIndex,((i,s)=>{if(this.status===Io.STOP)return!0;if(i.isContainer)return!1;if(s{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Yo(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Yo(this,void 0,void 0,(function*(){this.rendering&&(this.status=Io.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Io.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Yo(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Yo(this,void 0,void 0,(function*(){yield ba(t,oi.zIndex,(t=>Yo(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};jo=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}([V(),Fo(0,fa(vr)),Fo(1,$(wo)),Fo(2,$(Bo)),Fo(3,$(K)),Fo(3,X(Sa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],jo);const Ho=new I((t=>{t(go).toSelf().inSingletonScope(),t(Co).toSelf().inSingletonScope(),t(Dr).to(Ia),t(pr).to(jo),t(yr).to(yo).inSingletonScope(),t(vr).toService(yr),Z(t,no),t(_o).toSelf().inSingletonScope(),Z(t,uo),Z(t,vr),t(Ta).toSelf().inSingletonScope(),t(Sa).toService(Ta),Z(t,Sa)}));function zo(){var t;zo.__loaded||(zo.__loaded=!0,Xi.load(ur),Xi.load(oa),Xi.load(Ir),Xi.load(Qr),Xi.load(ua),(t=Xi).load(pa),t.load(ga),t.load(_a),function(t){t.load(Ho)}(Xi))}zo.__loaded=!1,zo();const No=Xi.get(et);Si.global=No;const Vo=Xi.get(rr);Si.graphicUtil=Vo;const Wo=Xi.get(nr);Si.transformUtil=Wo;const Go=Xi.get(qn);Si.graphicService=Go;const Uo=Xi.get(ar);function $o(t,e={data:t=>t}){if(!t)return t;if(t.constructor===Object){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(e[s]){i[s]=e[s](t[s]);continue}i[s]=$o(t[s],e)}return i}return y(t)?t.map((t=>$o(t,e))):t}function Xo(t,e){if(!t)return t;if(w(t)){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(S(t[s])&&e.getFunction(t[s])){i[s]=e.getFunction(t[s]);continue}i[s]=Xo(t[s],e)}return i}return y(t)?t.map((t=>Xo(t,e))):t}Si.layerService=Uo;let Ko=0;function qo(){return Ko>=9999999&&(Ko=0),Ko++}const Zo=t=>h(t)&&Number.isFinite(t);function Jo(t){return null!=t&&""!==t&&(!!h(t)||+t==+t)}function Qo(t){return!(!t||0===t.length)&&!D(t[0])&&!D(t[0].dataId)&&y(t[0].fields)}function tl(t){switch(t){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function el(t){return!!S(t)&&!!t.endsWith("%")&&Jo(t.substring(0,t.length-1))}function il(t,e,i,s=0){var n,r;return h(t)?t:el(t)?Number(t.substring(0,t.length-1))*e/100:xs(t)?t(i):bs(t)?e*(null!==(n=t.percent)&&void 0!==n?n:0)+(null!==(r=t.offset)&&void 0!==r?r:0):s}function sl(t,e,i){var s,n,r,a;const o={top:0,bottom:0,left:0,right:0};return Object.values(t).every((t=>h(t)))?(o.top=null!==(s=t.top)&&void 0!==s?s:0,o.right=null!==(n=t.right)&&void 0!==n?n:0,o.bottom=null!==(r=t.bottom)&&void 0!==r?r:0,o.left=null!==(a=t.left)&&void 0!==a?a:0,o):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((e=>{e.orients.forEach((s=>{o[s]=il(t[s],e.size,i)}))})),o)}function nl(t){let e={};return y(t)?(D(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),D(t[1])||(e.left=e.right=t[1]),D(t[2])||(e.bottom=t[2]),D(t[3])||(e.left=t[3]),e):h(t)||el(t)||xs(t)||bs(i=t)&&("percent"in i||"offset"in i)?(e.top=e.left=e.bottom=e.right=t,e):bs(t)?(e=Object.assign({},t),e):e;var i}function rl(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}const al=(t,e)=>{const i=Number(t),s=t.toString();return isNaN(i)&&"%"===s[s.length-1]?e*(Number(s.slice(0,s.length-1))/100):i};let ol;function ll(){!function(){if(null==ol)try{const t=document.createElement("canvas"),e=t.getContext("2d");ol=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),ol&&(ol=!!document.createElement)}catch(t){ol=!1}}();const t=Si.global&&Si.global.env;return t?"browser"===t:ol}const hl=ll(),dl=hl&&globalThis?globalThis.document:void 0;function cl(t){return("desktop-browser"===t||"mobile-browser"===t)&&hl}function ul(t){return pl(t)||"mobile-browser"===t}function pl(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}const gl=(t,e)=>(xs(_l.warnHandler)&&_l.warnHandler.call(null,t,e),e?g.getInstance().warn(`[VChart warn]: ${t}`,e):g.getInstance().warn(`[VChart warn]: ${t}`)),ml=(t,e,i)=>{if(!_l.silent){if(!xs(_l.errorHandler))throw new Error(t);_l.errorHandler.call(null,t,e)}},_l={silent:!1,warnHandler:!1,errorHandler:!1};var fl,vl;function yl(t){var e,i;const{type:s}=t;return s===fl.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(i=t.direction)&&void 0!==i?i:"vertical"}!function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn",t.mosaic="mosaic"}(fl||(fl={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.wordMask="wordMask",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquidGroup="liquidGroup",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(vl||(vl={}));const bl={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},xl={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function Sl(t,e){var i;if(!t)return[];const s=Tl(t,e);if(!s||y(s))return null!==(i=s)&&void 0!==i?i:[];if(bs(s)){const{dataScheme:i}=s;return i?wl(i)?i.map((i=>Object.assign(Object.assign({},i),{scheme:i.scheme.map((i=>Al(i)?kl(t,i,e):i)).filter(M)}))):i.map((i=>Al(i)?kl(t,i,e):i)).filter(M):[]}return[]}function Ml(t,e){var i,s;return wl(t)?null!==(s=null===(i=t.find((t=>M(t.isAvailable)?xs(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!M(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength)))||void 0===i?void 0:i.scheme)&&void 0!==s?s:t[t.length-1].scheme:t}function kl(t,e,i){var s;const n=Tl(t,i);if(!n)return;let r;const{palette:a}=n;if(bs(a)&&(r=null!==(s=function(t,e){const i=bl[e];if(i&&t[i])return t[i];if(t[e])return t[e];const s=xl[e];return s?t[s]:void 0}(a,e.key))&&void 0!==s?s:e.default),!r)return;if(D(e.a)&&D(e.l)||!S(r))return r;let o=new Gs(r);if(M(e.l)){const{r:t,g:i,b:s}=o.color,{h:n,s:r}=Is(t,i,s),a=Bs(n,r,e.l),l=new Gs(`rgb(${a.r}, ${a.g}, ${a.b})`);l.setOpacity(o.color.opacity),o=l}return M(e.a)&&o.setOpacity(e.a),o.toRGBA()}function Al(t){return t&&"palette"===t.type&&!!t.key}function wl(t){return!(!y(t)||0===t.length)&&t.every((t=>M(t.scheme)))}function Tl(t,e){var i,s;const{type:n}=null!=e?e:{};let r;if(!e||D(n))r=null==t?void 0:t.default;else{const a=yl(e);r=null!==(s=null!==(i=null==t?void 0:t[`${n}_${a}`])&&void 0!==i?i:null==t?void 0:t[n])&&void 0!==s?s:null==t?void 0:t.default}return r}function Ll(t,...e){let i=-1;const s=e.length;for(;++i{if(bs(e))e.type===n&&(y(t[n])?t[n].length>=e.index&&(t[n][e.index]=s?Ll({},t[n][e.index],i):i):t[n]=s?Ll({},t[n],i):i);else if(y(t[n])){const r=t[n].findIndex((t=>t.id===e));r>=0&&(t[n][r]=s?Ll({},t[n][r],i):i)}else t.id===e&&(t[n]=s?Ll({},t[n],i):i)}))}var El={},Dl={};function Pl(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Ol(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var s in t)s in e||i.push(e[s]=s)})),i}function Rl(t,e){var i=t+"",s=i.length;return s=r?l=!0:10===(s=t.charCodeAt(a++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(n+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+Rl(s,6):Rl(s,4))+"-"+Rl(i.getUTCMonth()+1,2)+"-"+Rl(i.getUTCDate(),2)+(o?"T"+Rl(n,2)+":"+Rl(r,2)+":"+Rl(a,2)+"."+Rl(o,3)+"Z":a?"T"+Rl(n,2)+":"+Rl(r,2)+":"+Rl(a,2)+"Z":r||n?"T"+Rl(n,2)+":"+Rl(r,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var i,s,n,r,a,o}return{parse:function(t,e){var i,n,r=s(t,(function(t,s){if(i)return i(t,s-1);n=t,i=e?function(t,e){var i=Pl(t);return function(s,n){return e(i(s),n,t)}}(t,e):Pl(t)}));return r.columns=n||[],r},parseRows:s,format:function(e,i){return null==i&&(i=Ol(e)),[i.map(a).join(t)].concat(n(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=Ol(t)),n(t,e).join("\n")},formatRows:function(t){return t.map(r).join("\n")},formatRow:r,formatValue:a}}var Il,Fl=Bl(","),Yl=Fl.parse,jl=(Fl.parseRows,Fl.format,Fl.formatBody,Fl.formatRows,Fl.formatRow,Fl.formatValue,Bl("\t")),Hl=jl.parse;jl.parseRows,jl.format,jl.formatBody,jl.formatRows,jl.formatRow,jl.formatValue,function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(Il||(Il={}));const zl=function(t,...e){return function(t,...e){t||(t={});let i=-1;const s=e.length;for(;++i{i.type=Il.DSV;const s=zl(Wl,e),{delimiter:n}=s;if(!S(n))throw new TypeError("Invalid delimiter: must be a string!");return Bl(n).parse(t)},Ul=(t,e={},i)=>(i.type=Il.DSV,Yl(t)),$l=(t,e={},i)=>(i.type=Il.DSV,Hl(t));class Xl{static registerChart(t,e){Xl._charts[t]=e}static registerSeries(t,e){Xl._series[t]=e}static registerComponent(t,e,i){Xl._components[t]={cmp:e,alwaysCheck:i}}static registerMark(t,e){Xl._marks[t]=e}static registerRegion(t,e){Xl._regions[t]=e}static registerTransform(t,e){Xl.transforms[t]=e}static registerLayout(t,e){Xl._layout[t]=e}static registerAnimation(t,e){Xl._animations[t]=e}static registerImplement(t,e){Xl._implements[t]=e}static registerChartPlugin(t,e){Xl._chartPlugin[t]=e}static registerComponentPlugin(t,e){Xl._componentPlugin[t]=e}static createChart(t,e,i){return Xl._charts[t]?new(0,Xl._charts[t])(e,i):null}static createChartSpecTransformer(t,e){if(!Xl._charts[t])return null;const i=Xl._charts[t];return new(0,i.transformerConstructor)(Object.assign({seriesType:i.seriesType},e))}static createRegion(t,e,i){return Xl._regions[t]?new(0,Xl._regions[t])(e,i):null}static createRegionSpecTransformer(t,e){return Xl._regions[t]?new(0,Xl._regions[t].transformerConstructor)(e):null}static createSeries(t,e,i){return Xl._series[t]?new(0,Xl._series[t])(e,i):null}static createSeriesSpecTransformer(t,e){return Xl._series[t]?new(0,Xl._series[t].transformerConstructor)(e):null}static createMark(t,e,i){if(!Xl._marks[t])return null;const s=new(0,Xl._marks[t])(e,i);return"group"===s.type&&s.setInteractive(!1),s}static getComponents(){return Object.values(Xl._components)}static getComponentInKey(t){return Xl._components[t].cmp}static getLayout(){return Object.values(Xl._layout)}static getLayoutInKey(t){return Xl._layout[t]}static getSeries(){return Object.values(Xl._series)}static getSeriesInType(t){return Xl._series[t]}static getRegionInType(t){return Xl._regions[t]}static getAnimationInKey(t){return Xl._animations[t]}static getImplementInKey(t){return Xl._implements[t]}static getSeriesMarkMap(t){return Xl._series[t]?Xl._series[t].mark:{}}static getChartPlugins(){return Object.values(Xl._chartPlugin)}static getComponentPlugins(){return Object.values(Xl._componentPlugin)}static getComponentPluginInType(t){return Xl._componentPlugin[t]}static registerFormatter(t){this._formatter=t}static getFormatter(){return this._formatter}}function Kl(t,...e){return Ll(ql(t),...e.map(ql))}function ql(t){var e;if(!t)return t;const i=function(t){return t&&(t=Object.keys(t).reduce(((e,i)=>{const s=t[i];return e[i]=function(t){return y(t)?{dataScheme:t}:t}(s),e}),{})),t}(t.colorScheme);return Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series)})}Xl._charts={},Xl._series={},Xl._components={},Xl._marks={},Xl._regions={},Xl._animations={},Xl._implements={},Xl._chartPlugin={},Xl._componentPlugin={},Xl.transforms={fields:P,filter:(t,e)=>{const{callback:i}=e;return i&&(t=t.filter(i)),t},fold:(t,e)=>{const{fields:i,key:s,value:n,retains:r}=e,a=[];for(let e=0;e{const l={};if(l[s]=o,l[n]=t[e][o],r)r.forEach((i=>{l[i]=t[e][i]}));else for(const s in t[e])-1===i.indexOf(s)&&(l[s]=t[e][s]);a.push(l)}));return a}},Xl.dataParser={csv:Ul,dsv:Gl,tsv:$l},Xl._layout={};const Zl=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],Jl={default:{dataScheme:Zl,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)",emptyCircleColor:"#e3e5e8",linearProgressTrackColor:"#E7EBED"}}},Ql=t=>{const e={label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}};return e[t?"transform3d":"transform"]={style:{fill:{type:"palette",key:"axisGridColor"}}},e},th=Ql(),eh=Ql(!0),ih="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",sh={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:ih,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:ih,fill:"#ddd"}}},nh="__VCHART",rh=500,ah=500,oh=`${nh}_ARC_TRANSFORM_VALUE`,lh=`${nh}_ARC_RATIO`,hh=`${nh}_ARC_START_ANGLE`,dh=`${nh}_ARC_END_ANGLE`,ch=`${nh}_ARC_K`,uh=`${nh}_ARC_MIDDLE_ANGLE`,ph=`${nh}_ARC_QUADRANT`,gh=`${nh}_ARC_RADIAN`,mh=-Math.PI/2,_h=3*Math.PI/2,fh=.6,vh={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:th,funnel3d:eh,linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:{type:"palette",key:"linearProgressTrackColor"},fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:sh,treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},yh={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},bh=Object.assign(Object.assign({},yh),{label:{space:0}}),xh=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),Sh={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:xh(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:xh(!0)},Mh=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),kh={title:{visible:!0,autoLimit:!1,autoFit:!1,style:Mh("l1FontSize","primaryFontColor")},content:{visible:!0,style:Mh("l2FontSize","tertiaryFontColor")}},Ah={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},wh=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},Ah),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},Th={horizontal:wh(!0),vertical:wh(!1)},Lh=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},Ah),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},Ch={horizontal:Lh(!0),vertical:Lh(!1)},Eh={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Dh=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),Ph={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:Dh(!1),endSymbol:Dh(!0),label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Oh={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}},Rh={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:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},Bh={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:Jl,token:Rh,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontWeight:null,fontSize:null}},fillingWord:{style:{fontWeight:null,fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:vh,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:Th,sizeLegend:Ch,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:yh,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:bh,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:Ph,markArea:Eh,markPoint:Oh,polarMarkLine:Ph,polarMarkArea:Eh,polarMarkPoint:Oh,geoMarkPoint:Oh,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:Sh,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:kh,title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},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:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},Ih=["animationThreshold","colorScheme","name","padding"];function Fh(t,e,i,s){if(!t)return t;e||(e=t.colorScheme),i||(i=t.token);const n={};return Object.keys(t).forEach((r=>{const a=t[r];Ih.includes(r)?n[r]=a:w(a)?Al(a)?n[r]=((t,e,i)=>{if(e&&Al(t)){const s=kl(e,t,i);if(s)return s}return t})(a,e,s):function(t){return t&&"token"===t.type&&!!t.key}(a)?n[r]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(i,a):n[r]=Fh(a,e,i,s):n[r]=a})),n}const Yh={[Bh.name]:Bh},jh=Bh.name,Hh=new Map(Object.keys(Yh).map((t=>[t,Yh[t]]))),zh=new Map(Object.keys(Yh).map((t=>[t,Fh(Yh[t])]))),Nh=new Map(Object.keys(Yh).map((t=>[t,t===jh]))),Vh=(t,e)=>{if(!t)return;const i=Gh(e);Hh.set(t,i),zh.set(t,Fh(i)),Nh.set(t,!0)},Wh=(t=jh,e=!1)=>(Nh.has(t)&&!Nh.get(t)&&Vh(t,Hh.get(t)),e?zh.get(t):Hh.get(t)),Gh=t=>{var e;const i=null!==(e=t.type)&&void 0!==e?e:jh;return Kl({},Wh(i),t)};class Uh{static registerInstance(t){Uh.instances.set(t.id,t)}static unregisterInstance(t){Uh.instances.delete(t.id)}static getInstance(t){return Uh.instances.get(t)}static instanceExist(t){return Uh.instances.has(t)}static forEach(t,e=[],i){const s=Fa(e);return Uh.instances.forEach(((e,i,n)=>{s.includes(i)||t(e,i,n)}),i)}}Uh.instances=new Map;class $h{static registerTheme(t,e){Vh(t,e)}static getTheme(t,e=!1){return Wh(t,e)}static removeTheme(t){return(t=>Hh.delete(t)&&zh.delete(t)&&Nh.delete(t))(t)}static themeExist(t){return(t=>!!S(t)&&Hh.has(t))(t)}static getDefaultTheme(){return $h.themes.get(jh)}static setCurrentTheme(t){$h.themeExist(t)&&($h._currentThemeName=t,Uh.forEach((e=>null==e?void 0:e.setCurrentTheme(t))))}static getCurrentTheme(t=!1){return $h.getTheme($h._currentThemeName,t)}static getCurrentThemeName(){return $h._currentThemeName}}function Xh(t,e){return S(t)?$h.themeExist(t)?$h.getTheme(t,e):{}:bs(t)?t:{}}var Kh,qh,Zh;$h.themes=Hh,$h._currentThemeName=jh,function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(Kh||(Kh={})),(Zh=qh||(qh={})).Identity="identity",Zh.Linear="linear",Zh.Log="log",Zh.Pow="pow",Zh.Sqrt="sqrt",Zh.Symlog="symlog",Zh.Time="time",Zh.Quantile="quantile",Zh.Quantize="quantize",Zh.Threshold="threshold",Zh.Ordinal="ordinal",Zh.Point="point",Zh.Band="band";const Jh={};function Qh(t){switch(t){case qh.Linear:case qh.Log:case qh.Pow:case qh.Sqrt:case qh.Symlog:case qh.Time:return!0;default:return!1}}function td(t){return!!Jh[t]}function ed(t){switch(t){case qh.Ordinal:case qh.Point:case qh.Band:return!0;default:return!1}}Object.values(qh).forEach((t=>{Jh[t]=!0}));const id=(t,e)=>{var i,s;return t===e||!D(t)&&!D(e)&&t.value===e.value&&(null===(i=t.axis)||void 0===i?void 0:i.id)===(null===(s=e.axis)||void 0===s?void 0:s.id)},sd=(t,e,i,s)=>{var n;const r=ed(e.getScale().type),a=[],o=e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes);for(const l of o)if(l.coordinate===i){const i=Fa(s(l)),o=null===(n=l.getViewData())||void 0===n?void 0:n.latestData;if(i&&o)if(r){const e=[],s=[];o.forEach(((n,r)=>{var a;(null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())&&(e.push(n),s.push(r))})),a.push({series:l,datum:e,key:nd(l,s)})}else if(M(i[1])){const e=[],s=[];o.forEach(((n,r)=>{var a;((null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())||M(n[i[0]])&&M(n[i[1]])&&t>=n[i[0]]&&t{if(M(e[i[0]])){const a=e[i[0]]-t;a>=n[0]&&a<=n[1]&&(r.push(e),h.push(s))}}));else{let e=1/0,s=0;o.forEach(((n,a)=>{if(M(n[i[0]])){const o=Math.abs(n[i[0]]-t),l=Math.sign(n[i[0]]-t);o`${t.id}_${e.join("_")}`,rd=(t,e,i)=>{const s=t.getAllComponents().filter((s=>"axes"===s.specKey&&e(s)&&((t,e,i)=>{const s=t.getRegionsInIds(Fa(e.layout.layoutBindRegionID));return null==s?void 0:s.some((t=>{const e=t.getLayoutRect(),s=t.getLayoutStartPoint();return((t,e,i)=>t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y)(i,{x:s.x,y:s.y},{x:e.width+s.x,y:e.height+s.y})}))})(t,s,i)));return s.length?s:null};function ad(t,e,i,s){let n,r,a=-1;t.forEach((t=>{n=e(t),r=i(t),!D(n)&&(n=+n)>=n&&!D(r)&&(r=+r)>=r&&s(n,r,++a)}))}function od(t,e,i,s,n){let r=0,a=0;return ad(t,e,i,((t,e)=>{const i=e-n(t),o=e-s;r+=i*i,a+=o*o})),1-r/a}const ld=1e-10,hd=1e-10;function dd(t,e,i=hd,s=ld){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function cd(t,e,i,s){return t>e&&!dd(t,e,i,s)}function ud(t,e,i,s){return te?1:t>=e?0:NaN}function gd(t){return Number(t)}const md=dd;function _d(t,e){const i=[];return t.forEach((t=>{const s=+t[e];Zo(s)&&i.push(s)})),0===i.length?null:Ha(i)}function fd(t,e){const i=[];return t.forEach((t=>{const s=+t[e];Zo(s)&&i.push(s)})),0===i.length?null:ja(i)}function vd(t,e){return t.reduce(((t,i)=>{const s=e?+i[e]:+i;return Zo(s)&&(t+=s),t}),0)}function yd(t,e){let i=0,s=0;return t.forEach((t=>{const n=e?+t[e]:+t;Zo(n)&&(i+=n,s++)})),i/s}function bd(t,e){const i=yd(t,e);return t.length<=1?0:t.reduce(((t,s)=>t+(e?+s[e]:+s-i)**2),0)/(t.length-1)}function xd(t,e){const i=Sd(t),s=Sd(e),n=Math.asin((t.x*e.y-e.x*t.y)/i/s),r=Math.acos((t.x*e.x+t.y*e.y)/i/s);return n<0?-r:r}function Sd(t,e={x:0,y:0}){return xe.distancePP(t,e)}function Md(t){return Zo(t.x)&&Zo(t.y)}const kd=(t,e)=>{if(!t)return null;const i=rd(t,(t=>"angle"===t.getOrient()),e),s=rd(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&ed(i.type)){const l=i.domain(),h=i.range(),d=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-d.x,y:o-t.getLayoutStartPoint().y-d.y};let u=xd({x:1,y:0},c);u=((t,e)=>{const i=2*Math.PI,s=Ha(e),n=ja(e);return tn&&(t-=Math.ceil((t-n)/i)*i),t})(u,h);const p=Sd(c),g=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==g?void 0:g.range();if((u-(null==h?void 0:h[0]))*(u-(null==h?void 0:h[1]))>0||(p-(null==m?void 0:m[0]))*(p-(null==m?void 0:m[1]))>0)return;const _=t.invert(u);if(D(_))return;let f=l.findIndex((t=>(null==t?void 0:t.toString())===_.toString()));f<0&&(f=void 0);const v=sd(_,t,"polar",r);n.push({index:f,value:_,position:i.scale(_),axis:t,data:v})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&ed(s.type)){const h=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let c=xd({x:1,y:0},d);c<-Math.PI/2&&(c=2*Math.PI+c);const u=Sd(d),p=null===(e=i[0])||void 0===e?void 0:e.getScale(),g=null==p?void 0:p.range();if((c-(null==g?void 0:g[0]))*(c-(null==g?void 0:g[1]))>0||(u-(null==l?void 0:l[0]))*(u-(null==l?void 0:l[1]))>0)return;const m=s.invert(u);if(D(m))return;let _=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));_<0&&(_=void 0);const f=sd(m,t,"polar",r);n.push({index:_,value:m,position:s.scale(m),axis:t,data:f})}})),n.length?n:null};function Ad(t){return"bottom"===t||"top"===t}function wd(t){return"left"===t||"right"===t}function Td(t){return"z"===t}function Ld(t,e){return tl(t.orient)||e&&e.includes(t.orient)?t.orient:"left"}function Cd(t){return"top"===t||"bottom"===t?"horizontal":"vertical"}function Ed(t,e){var i;const s=null!==(i=t.type)&&void 0!==i?i:function(t,e){return e?Ad(t)?"linear":"band":Ad(t)?"band":"linear"}(t.orient,e);return{axisType:s,componentName:`${r.cartesianAxis}-${s}`}}const Dd=t=>t.fieldX[0],Pd=t=>t.fieldY[0],Od=t=>{var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},Rd=t=>{var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},Bd=(t,e)=>t?e?Dd:Od:e?Pd:Rd,Id=(t,e,i)=>{var s,n;if(!t)return null;const{x:r,y:a}=e,o=null!==(s=rd(t,(t=>Ad(t.getOrient())),e))&&void 0!==s?s:[],l=null!==(n=rd(t,(t=>wd(t.getOrient())),e))&&void 0!==n?n:[];if(!o.length&&!l.length)return null;const h=new Set,d=new Set,c=new Set;[o,l].forEach((t=>t.forEach((t=>{ed(t.getScale().type)?h.add(t):d.add(t),i&&t.getSpec().hasDimensionTooltip&&c.add(t)}))));const u=[],p=t=>{const e="x"===t,i=e?r:a;(e?o:l).forEach((t=>{if(c.size>0){if(c.has(t)){const s=Fd(t,i,Bd(e,ed(t.getScale().type)));s&&u.push(s)}}else{const s=h.size>0;if((s?h:d).has(t)){const n=Fd(t,i,Bd(e,s));n&&u.push(n)}}}))};return"horizontal"===t.getSpec().direction?(p("y"),0===u.length&&p("x")):(p("x"),0===u.length&&p("y")),u.length?u:null},Fd=(t,e,i)=>{const s=t.positionToData(e,!0);return D(s)?null:Yd(t,s,i)},Yd=(t,e,i)=>{const s=t.getScale();if(D(e))return null;let n=s.domain().findIndex((t=>(null==t?void 0:t.toString())===e.toString()));n<0&&(n=void 0);const r=sd(e,t,"cartesian",null!=i?i:Ad(t.getOrient())?Dd:Pd);return{index:n,value:e,position:s.scale(e),axis:t,data:r}};class jd{constructor(t,e){this._eventDispatcher=t,this._mode=e}get chart(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}register(t,e){var i,s;(null!==(s=null===(i=this.chart)||void 0===i?void 0:i.getOption().onError)&&void 0!==s?s:ml)("Method not implemented.")}unregister(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:ml)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,s;const n=null!==(i=Id(this.chart,{x:t,y:e}))&&void 0!==i?i:[],r=null!==(s=kd(this.chart,{x:t,y:e}))&&void 0!==s?s:[],a=[].concat(n,r);return 0===a.length?null:a}dispatch(t,e){var i;const s=null===(i=this.chart)||void 0===i?void 0:i.getAllComponents().filter((t=>"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t)))),n=s.filter((t=>ed(t.getScale().type))),r=n.length?n:s.filter((t=>{const e=t.getOrient();return Ad(e)||"angle"===e})),a=[];return r.forEach((e=>{const i=Yd(e,t);i&&a.push(i)})),this._callback.call(null,{action:"enter",dimensionInfo:a}),a}}const Hd=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];var zd,Nd,Vd;!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(zd||(zd={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(Nd||(Nd={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(Vd||(Vd={}));const Wd={[Kh.dimensionHover]:class extends jd{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);null===s&&null!==this._cacheDimensionInfo?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=s):null===s||null!==this._cacheDimensionInfo&&s.length===this._cacheDimensionInfo.length&&!s.some(((t,e)=>!id(t,this._cacheDimensionInfo[e])))?null!==s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:s.slice()})):(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:s.slice()})),this._cacheDimensionInfo=s)},this.onMouseOut=t=>{t&&(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo?this._cacheDimensionInfo.slice():[]})),this._cacheDimensionInfo=null)}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:Nd.canvas}),callback:this.onMouseOut}),ul(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),ul(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}},[Kh.dimensionClick]:class extends jd{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"click",dimensionInfo:s.slice()}))}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}};class Gd{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){const s="function"==typeof e?{query:null,callback:e}:{query:e,callback:i};if(Wd[t]){const e=new Wd[t](this._eventDispatcher,this._mode);e.register(t,s),this._composedEventMap.set(i,{eventType:t,event:e})}else this._eventDispatcher.register(t,s);return this}off(t,e,i){var s,n;const r=null!=i?i:e;if(Wd[t])if(r)null===(s=this._composedEventMap.get(r))||void 0===s||s.event.unregister(),this._composedEventMap.delete(r);else for(const e of this._composedEventMap.entries())e[1].eventType===t&&(null===(n=this._composedEventMap.get(e[0]))||void 0===n||n.event.unregister(),this._composedEventMap.delete(e[0]));else if(r){const i={callback:r,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,i)}else this._eventDispatcher.unregister(t);return this}emit(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}prevent(t,e){return this._eventDispatcher.prevent(t,e),this}allow(t){return this._eventDispatcher.allow(t),this}release(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}class Ud{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(Vd.vchart,[]),this._levelNodes.set(Vd.chart,[]),this._levelNodes.set(Vd.model,[]),this._levelNodes.set(Vd.mark,[])}addHandler(t,e){var i;const s={level:e,handler:t};return null===(i=this._levelNodes.get(e))||void 0===i||i.push(s),this._map.set(t.callback,s),this}removeHandler(t){const e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);const i=this._levelNodes.get(e.level),s=null==i?void 0:i.findIndex((e=>e.handler.callback===t.callback));return void 0!==s&&s>=0&&(null==i||i.splice(s,1)),this}preventHandler(t){return t&&(t.prevented=!0),this}allowHandler(t){return t&&(t.prevented=!1),this}getHandlers(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((t=>t.handler)))||[]}getAllHandlers(){return Array.from(this._map.values()).map((t=>t.handler))||[]}getCount(){return this._map.size}release(){this._map.clear(),this._levelNodes.clear()}}const $d=(t,e,i)=>{const s=S(e)?e.split("."):e;for(let e=0;e=e||i<0||c&&t-h>=r}function f(){const t=Date.now();if(_(t))return v(t);o=m(f,function(t){const i=t-h,s=e-(t-l);return c?Math.min(s,r-i):s}(t))}function v(t){return o=void 0,u&&s?g(t):(s=n=void 0,a)}function y(...t){const i=Date.now(),r=_(i);if(s=t,n=this,l=i,r){if(void 0===o)return function(t){return h=t,o=m(f,e),d?g(t):a}(l);if(c)return o=m(f,e),g(l)}return void 0===o&&(o=m(f,e)),a}return e=+e||0,bs(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(Zo(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,s=l=n=o=void 0},y.flush=function(){return void 0===o?a:v(Date.now())},y.pending=function(){return void 0!==o},y},qd=function(t,e,i){let s=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return bs(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),Kd(t,e,{leading:s,trailing:n,maxWait:e})};var Zd,Jd,Qd,tc,ec,ic,sc,nc,rc,ac,oc,lc,hc,dc,cc,uc,pc,gc,mc;!function(t){t.enter="enter",t.update="update",t.exit="exit",t.group="group",t.connectNulls="connectNulls"}(Zd||(Zd={})),function(t){t.enter="enter",t.update="update",t.exit="exit",t.unChange="unChange"}(Jd||(Jd={})),(mc=Qd||(Qd={})).arc="arc",mc.arc3d="arc3d",mc.area="area",mc.image="image",mc.line="line",mc.path="path",mc.rect="rect",mc.rect3d="rect3d",mc.rule="rule",mc.shape="shape",mc.symbol="symbol",mc.text="text",mc.richtext="richtext",mc.polygon="polygon",mc.pyramid3d="pyramid3d",mc.circle="circle",mc.cell="cell",mc.interval="interval",mc.group="group",mc.glyph="glyph",mc.component="component",mc.largeRects="largeRects",mc.largeSymbols="largeSymbols",(gc=tc||(tc={})).axis="axis",gc.grid="grid",gc.legend="legend",gc.slider="slider",gc.label="label",gc.datazoom="datazoom",gc.player="player",gc.title="title",gc.scrollbar="scrollbar",function(t){t[t.player=1]="player",t[t.rollUp=2]="rollUp",t[t.drillDown=3]="drillDown",t[t.slider=4]="slider",t[t.datazoom=5]="datazoom",t[t.legend=6]="legend",t[t.scrollbar=7]="scrollbar",t[t.brush=8]="brush",t[t.normal=9]="normal"}(ec||(ec={})),(pc=ic||(ic={})).lineAxis="lineAxis",pc.circleAxis="circleAxis",(uc=sc||(sc={})).lineAxisGrid="lineAxisGrid",uc.circleAxisGrid="circleAxisGrid",function(t){t.discreteLegend="discreteLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend"}(nc||(nc={})),function(t){t.lineCrosshair="lineCrosshair",t.rectCrosshair="rectCrosshair",t.sectorCrosshair="sectorCrosshair",t.circleCrosshair="circleCrosshair",t.polygonCrosshair="polygonCrosshair",t.ringCrosshair="ringCrosshair"}(rc||(rc={})),function(t){t.symbolLabel="symbolLabel",t.rectLabel="rectLabel",t.lineLabel="lineLabel",t.dataLabel="dataLabel"}(ac||(ac={})),function(t){t.continuousPlayer="continuousPlayer",t.discretePlayer="discretePlayer"}(oc||(oc={})),function(t){t.before="before",t.layouting="layouting",t.reevaluate="reevaluate",t.after="after"}(lc||(lc={})),function(t){t.BEFORE_EVALUATE_DATA="beforeEvaluateData",t.AFTER_EVALUATE_DATA="afterEvaluateData",t.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",t.AFTER_EVALUATE_SCALE="afterEvaluateScale",t.BEFORE_PARSE_VIEW="beforeParseView",t.AFTER_PARSE_VIEW="afterParseView",t.BEFORE_TRANSFORM="beforeTransform",t.AFTER_TRANSFORM="afterTransform",t.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",t.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",t.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",t.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",t.BEFORE_STAGE_RESIZE="beforeStageResize",t.AFTER_STAGE_RESIZE="afterStageResize",t.BEFORE_VRENDER_DRAW="beforeVRenderDraw",t.AFTER_VRENDER_DRAW="afterVRenderDraw",t.BEFORE_MARK_JOIN="beforeMarkJoin",t.AFTER_MARK_JOIN="afterMarkJoin",t.BEFORE_MARK_UPDATE="beforeMarkUpdate",t.AFTER_MARK_UPDATE="afterMarkUpdate",t.BEFORE_MARK_STATE="beforeMarkState",t.AFTER_MARK_STATE="afterMarkState",t.BEFORE_MARK_ENCODE="beforeMarkEncode",t.AFTER_MARK_ENCODE="afterMarkEncode",t.BEFORE_DO_LAYOUT="beforeDoLayout",t.AFTER_DO_LAYOUT="afterDoLayout",t.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",t.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",t.BEFORE_DO_RENDER="beforeDoRender",t.AFTER_DO_RENDER="afterDoRender",t.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",t.AFTER_MARK_RENDER_END="afterMarkRenderEnd",t.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",t.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",t.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",t.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",t.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",t.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",t.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",t.BEFORE_ELEMENT_STATE="beforeElementState",t.AFTER_ELEMENT_STATE="afterElementState",t.BEFORE_ELEMENT_ENCODE="beforeElementEncode",t.AFTER_ELEMENT_ENCODE="afterElementEncode",t.ANIMATION_START="animationStart",t.ANIMATION_END="animationEnd",t.ELEMENT_ANIMATION_START="elementAnimationStart",t.ELEMENT_ANIMATION_END="elementAnimationEnd",t.ALL_ANIMATION_START="allAnimationStart",t.ALL_ANIMATION_END="allAnimationEnd"}(hc||(hc={})),function(t){t.signal="signal",t.data="data",t.scale="scale",t.coordinate="coordinate",t.mark="mark"}(dc||(dc={})),function(t){t.active="active",t.selected="selected",t.highlight="highlight",t.blur="blur"}(cc||(cc={}));class _c{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 S(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=Fa(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class fc{static registerPlotMarks(t,e){fc._plotMarks[t]=e}static createPlotMark(t,e){return fc._plotMarks[t]?new(0,fc._plotMarks[t])(e):null}static registerMark(t,e){fc._marks[t]=e}static createMark(t,e,i){return fc._marks[t]?new(0,fc._marks[t])(e,t,i):null}static hasMark(t){return!!fc._marks[t]}static getMark(t){return fc._marks[t]}static registerComponent(t,e){fc._components[t]=e}static createComponent(t,e,i,s){const n=fc._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!fc._components[t]}static registerGraphicComponent(t,e){fc._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=fc._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){fc._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return fc._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(fc._transforms).forEach((t=>{fc._transforms[t]&&!fc._transforms[t].isBuiltIn&&(fc._transforms[t]=null)}))}static registerGrammar(t,e,i){fc._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=fc._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 fc._glyphs[t]}static createInteraction(t,e,i){const s=fc._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!fc._interactions[t]}}fc._plotMarks={},fc._marks={},fc._components={},fc._graphicComponents={},fc._transforms={},fc._grammars={},fc._glyphs={},fc._animations={},fc._interactions={},fc._graphics={},fc._stageEventPlugins={},fc.registerGlyph=(t,e,i,s,n)=>(fc._glyphs[t]=new _c(e,i,s,n),fc._glyphs[t]),fc.registerAnimationType=(t,e)=>{fc._animations[t]=e},fc.getAnimationType=t=>fc._animations[t],fc.registerInteraction=(t,e)=>{fc._interactions[t]=e},fc.registerGraphic=(t,e)=>{fc._graphics[t]=e},fc.getGraphicType=t=>fc._graphics[t],fc.createGraphic=(t,e)=>{const i=fc._graphics[t];return i?i(e):null},fc.registerDefaultLayout=t=>{fc.defaultLayout=t},fc.getDefaultLayout=()=>fc.defaultLayout,fc.registerStageEventPlugin=(t,e)=>{fc._stageEventPlugins[t]=e},fc.getStageEventPlugin=t=>fc._stageEventPlugins[t];const vc={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend"};class yc{constructor(t,e){this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=t=>{var e;const i=this.globalInstance.getChart(),s=M(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,n=M(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,r=new Map;let a=null===(e=t.item)||void 0===e?void 0:e.mark;for(a&&M(a.id())&&r.set(a.id(),t.item);null==a?void 0:a.elements;){const t=a.id();M(t)&&!r.has(t)&&r.set(t,a.elements[0]),a=a.group}const o={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:r,chart:i,model:s,mark:null!=n?n:void 0,node:$d(t.event,"target")};this.dispatch(t.type,o)},this._onDelegateInteractionEvent=t=>{const e=this.globalInstance.getChart(),i=t.event;let s=null;i.elements&&(s=i.elements);const n={event:t.event,chart:e,items:s,datums:s&&s.map((t=>t.getDatum()))};this.dispatch(t.type,n)},this.globalInstance=t,this._compiler=e}register(t,e){var i,s,n,r,a;this._parseQuery(e);const o=this.getEventBubble((null===(i=e.filter)||void 0===i?void 0:i.source)||Nd.chart),l=this.getEventListeners((null===(s=e.filter)||void 0===s?void 0:s.source)||Nd.chart);if(o.get(t)||o.set(t,new Ud),o.get(t).addHandler(e,null===(n=e.filter)||void 0===n?void 0:n.level),this._isValidEvent(t)&&!l.has(t)){const i=this._onDelegate.bind(this);this._compiler.addEventListener(null===(r=e.filter)||void 0===r?void 0:r.source,t,i),l.set(t,i)}else if(this._isInteractionEvent(t)&&!l.has(t)){const i=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,i),l.set(t,i)}return this}unregister(t,e){var i,s,n,r;let a=!1;const o=this.getEventBubble((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||Nd.chart),l=this.getEventListeners((null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.source)||Nd.chart);if(e){const i=o.get(t);null==i||i.removeHandler(e),0===(null==i?void 0:i.getCount())&&(null==i||i.release(),o.delete(t),a=!0),(null===(n=null==e?void 0:e.wrappedCallback)||void 0===n?void 0:n.cancel)&&e.wrappedCallback.cancel()}else{const e=o.get(t);null==e||e.release(),o.delete(t),a=!0}if(a&&this._isValidEvent(t)){const i=l.get(t);this._compiler.removeEventListener((null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.source)||Nd.chart,t,i),l.delete(t)}return this}dispatch(t,e,i){const s=this.getEventBubble(e.source||Nd.chart).get(t);if(!s)return this;let n=!1;if(i){const r=s.getHandlers(i);n=this._invoke(r,t,e)}else{const i=[Vd.mark,Vd.model,Vd.chart,Vd.vchart];let r=0;for(;!n&&r{const s=this.getEventBubble(i).get(t);s&&s.getAllHandlers().forEach((t=>{e&&t.callback===e||s.preventHandler(t)}))})),this}allow(t){return["canvas","chart","window"].forEach((e=>{const i=this.getEventBubble(e).get(t);i&&i.getAllHandlers().forEach((t=>i.allowHandler(t)))})),this}clear(){[Nd.chart,Nd.window,Nd.canvas].forEach((t=>{const e=this.getEventListeners(t);for(const i of e.entries())this._compiler.removeEventListener(t,i[0],i[1]);e.clear()})),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach((t=>{for(const e of t.values())e.release();t.clear()}))}release(){this.clear(),this.globalInstance=null,this._compiler=null}_filter(t,e,i){var s,n,r;if(xs(t.filter)&&!t.filter(i))return!1;if(t.nodeName&&$d(i,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.name)!==t.markName)return!1;let a=null===(n=i.model)||void 0===n?void 0:n.type;return vc[a]&&(a=vc[a]),!(t.type&&a!==t.type||"mark"===t.level&&!t.type&&!(null==i?void 0:i.mark)||"model"===t.level&&!t.type&&!(null==i?void 0:i.model)||M(t.userId)&&(null===(r=i.model)||void 0===r?void 0:r.userId)!==t.userId)}_prepareParams(t,e){if(t.markName&&e.mark&&e.itemMap){const t=e.mark.getProductId(),i=e.itemMap.get(t),s=null==i?void 0:i.getDatum();return Object.assign(Object.assign({},e),{item:i,datum:s})}return Object.assign({},e)}_invoke(t,e,i){return t.map((t=>{var s,n,r;const a=t.filter;if(!t.prevented&&(!t.query||this._filter(a,e,i))){const e=(t.wrappedCallback||t.callback).call(null,this._prepareParams(a,i)),o=null!=e?e:null===(s=t.query)||void 0===s?void 0:s.consume;return o&&(null===(n=i.event)||void 0===n||n.stopPropagation(),null===(r=i.event)||void 0===r||r.preventDefault()),!!o}})).some((t=>!0===t))}_getQueryLevel(t){return t?t.level?t.level:M(t.id)?Vd.model:Vd.vchart:Vd.vchart}_parseQuery(t){var e;const i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=qd(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=Kd(t.callback,i.debounce));let s=this._getQueryLevel(i),n=null,r=Nd.chart,a=null,o=null,l=null;return(null==i?void 0:i.nodeName)&&(a=i.nodeName),(null==i?void 0:i.markName)&&(o=i.markName),!(null==i?void 0:i.type)||s!==Vd.model&&s!==Vd.mark||(n=i.type),(null==i?void 0:i.source)&&(r=i.source),M(null==i?void 0:i.id)&&(l=null==i?void 0:i.id,s=Vd.model),t.filter={level:s,markName:o,type:n,source:r,nodeName:a,userId:l,filter:null!==(e=null==i?void 0:i.filter)&&void 0!==e?e:null},t}getEventBubble(t){switch(t){case Nd.chart:return this._viewBubbles;case Nd.window:return this._windowBubbles;case Nd.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case Nd.chart:return this._viewListeners;case Nd.window:return this._windowListeners;case Nd.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return Hd.includes(t)||Object.values(hc).includes(t)}_isInteractionEvent(t){let e;return t&&(e=t.split(":")[0],e)&&fc.hasInteraction(e)}}function bc(t){return t}function xc(t,e){t&&Mc.hasOwnProperty(t.type)&&Mc[t.type](t,e)}var Sc={Feature:function(t,e){xc(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,s=-1,n=i.length;++s0?1:t<0?-1:0},$c=Math.sqrt,Xc=Math.tan;function Kc(t){return t>1?0:t<-1?Pc:Math.acos(t)}function qc(t){return t>1?Oc:t<-1?-Oc:Math.asin(t)}function Zc(){}var Jc,Qc,tu,eu,iu=Tc(),su=Tc(),nu={point:Zc,lineStart:Zc,lineEnd:Zc,polygonStart:function(){nu.lineStart=ru,nu.lineEnd=lu},polygonEnd:function(){nu.lineStart=nu.lineEnd=nu.point=Zc,iu.add(Yc(su)),su.reset()},result:function(){var t=iu/2;return iu.reset(),t}};function ru(){nu.point=au}function au(t,e){nu.point=ou,Jc=tu=t,Qc=eu=e}function ou(t,e){su.add(eu*t-tu*e),tu=t,eu=e}function lu(){ou(Jc,Qc)}const hu=nu;var du=1/0,cu=du,uu=-du,pu=uu,gu={point:function(t,e){tuu&&(uu=t),epu&&(pu=e)},lineStart:Zc,lineEnd:Zc,polygonStart:Zc,polygonEnd:Zc,result:function(){var t=[[du,cu],[uu,pu]];return uu=pu=-(cu=du=1/0),t}};const mu=gu;var _u,fu,vu,yu,bu=0,xu=0,Su=0,Mu=0,ku=0,Au=0,wu=0,Tu=0,Lu=0,Cu={point:Eu,lineStart:Du,lineEnd:Ru,polygonStart:function(){Cu.lineStart=Bu,Cu.lineEnd=Iu},polygonEnd:function(){Cu.point=Eu,Cu.lineStart=Du,Cu.lineEnd=Ru},result:function(){var t=Lu?[wu/Lu,Tu/Lu]:Au?[Mu/Au,ku/Au]:Su?[bu/Su,xu/Su]:[NaN,NaN];return bu=xu=Su=Mu=ku=Au=wu=Tu=Lu=0,t}};function Eu(t,e){bu+=t,xu+=e,++Su}function Du(){Cu.point=Pu}function Pu(t,e){Cu.point=Ou,Eu(vu=t,yu=e)}function Ou(t,e){var i=t-vu,s=e-yu,n=$c(i*i+s*s);Mu+=n*(vu+t)/2,ku+=n*(yu+e)/2,Au+=n,Eu(vu=t,yu=e)}function Ru(){Cu.point=Eu}function Bu(){Cu.point=Fu}function Iu(){Yu(_u,fu)}function Fu(t,e){Cu.point=Yu,Eu(_u=vu=t,fu=yu=e)}function Yu(t,e){var i=t-vu,s=e-yu,n=$c(i*i+s*s);Mu+=n*(vu+t)/2,ku+=n*(yu+e)/2,Au+=n,wu+=(n=yu*t-vu*e)*(vu+t),Tu+=n*(yu+e),Lu+=3*n,Eu(vu=t,yu=e)}const ju=Cu;function Hu(t){this._context=t}Hu.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Bc)}},result:Zc};var zu,Nu,Vu,Wu,Gu,Uu=Tc(),$u={point:Zc,lineStart:function(){$u.point=Xu},lineEnd:function(){zu&&Ku(Nu,Vu),$u.point=Zc},polygonStart:function(){zu=!0},polygonEnd:function(){zu=null},result:function(){var t=+Uu;return Uu.reset(),t}};function Xu(t,e){$u.point=Ku,Nu=Wu=t,Vu=Gu=e}function Ku(t,e){Wu-=t,Gu-=e,Uu.add($c(Wu*Wu+Gu*Gu)),Wu=t,Gu=e}const qu=$u;function Zu(){this._string=[]}function Ju(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qu(t,e){var i,s,n=4.5;function r(t){return t&&("function"==typeof n&&s.pointRadius(+n.apply(this,arguments)),wc(t,i(s))),s.result()}return r.area=function(t){return wc(t,i(hu)),hu.result()},r.measure=function(t){return wc(t,i(qu)),qu.result()},r.bounds=function(t){return wc(t,i(mu)),mu.result()},r.centroid=function(t){return wc(t,i(ju)),ju.result()},r.projection=function(e){return arguments.length?(i=null==e?(t=null,bc):(t=e).stream,r):t},r.context=function(t){return arguments.length?(s=null==t?(e=null,new Zu):new Hu(e=t),"function"!=typeof n&&s.pointRadius(n),r):e},r.pointRadius=function(t){return arguments.length?(n="function"==typeof t?t:(s.pointRadius(+t),+t),r):n},r.projection(t).context(e)}function tp(t){var e={type:"Feature"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}})),e.properties=ep(t.properties),e.geometry=ip(t.geometry),e}function ep(t){var e={};return t?(Object.keys(t).forEach((function(i){var s=t[i];"object"==typeof s?null===s?e[i]=null:Array.isArray(s)?e[i]=s.map((function(t){return t})):e[i]=ep(s):e[i]=s})),e):e}function ip(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return ip(t)})),e):(e.coordinates=sp(t.coordinates),e)}function sp(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return sp(t)}))}Zu.prototype={_radius:4.5,_circle:Ju(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Ju(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var np=6371008.8,rp={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*np,kilometers:6371.0088,kilometres:6371.0088,meters:np,metres:np,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:np/1852,radians:1,yards:6967335.223679999};function ap(t,e,i){void 0===i&&(i={});var s={type:"Feature"};return(0===i.id||i.id)&&(s.id=i.id),i.bbox&&(s.bbox=i.bbox),s.properties=e||{},s.geometry=t,s}function op(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function lp(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function hp(t){for(var e,i,s=lp(t),n=0,r=1;r0}function dp(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i is required");if("boolean"!=typeof s)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return tp(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}})),e.features=t.features.map((function(t){return tp(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ip(t);default:throw new Error("unknown GeoJSON type")}}(t));var r=[];switch(t.type){case"GeometryCollection":return cp(t,(function(t){up(t,s)})),t;case"FeatureCollection":return dp(t,(function(t){dp(up(t,s),(function(t){r.push(t)}))})),op(r)}return up(t,s)},_p=function(t){if(!t)throw new Error("geojson is required");var e=[];return function(t,e){cp(t,(function(t,i,s,n,r){var a,o=null===t?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==e(ap(t,s,{bbox:n,id:r}),i,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l{if(t.geometry.type.startsWith("Multi")){const e=_p(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},bp=(t,e={},i)=>{i.type=Il.GEO;const s=zl(vp,e),{centroid:n,name:r,bbox:a,rewind:o}=s;if(Array.isArray(t))return(t=>{const e=[];return t.forEach((t=>{"FeatureCollection"===t.type?t.features.forEach((t=>{e.push(yp(t))})):e.push(yp(t))})),e})(t);let l=t.features;return o&&(l=mp(t,{reverse:!bs(o)||o.reverse}).features),l.forEach((t=>{if(n){const e=fp.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){const e=fp.bounds(t);t.bbox=e}})),t.features=l,t};function xp(t){return t}function Sp(t,e){var i=e.id,s=e.bbox,n=null==e.properties?{}:e.properties,r=function(t,e){var i=function(t){if(null==t)return xp;var e,i,s=t.scale[0],n=t.scale[1],r=t.translate[0],a=t.translate[1];return function(t,o){o||(e=i=0);var l=2,h=t.length,d=new Array(h);for(d[0]=(e+=t[0])*s+r,d[1]=(i+=t[1])*n+a;l{i.type=Il.GEO;const s=zl(vp,Mp,e),{object:n}=s;if(!S(n))throw new TypeError("Invalid object: must be a string!");const r=(a=t,"string"==typeof(o=t.objects[n])&&(o=a.objects[o]),"GeometryCollection"===o.type?{type:"FeatureCollection",features:o.geometries.map((function(t){return Sp(a,t)}))}:Sp(a,o));var a,o;return bp(r,s,i)};var Ap=i(4028),wp=i.n(Ap);const Tp={tolerance:.01},Lp=(t,e)=>{const i=zl(Tp,e),{tolerance:s}=i;return wp()(t,s)};function Cp(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function Ep(t,e,i){t.getParser(e)||t.registerParser(e,i)}const Dp=new Map;let Pp;function Op(){Pp||(Pp=new f,Ep(Pp,"geojson",bp),Ep(Pp,"topojson",kp),Cp(Pp,"simplify",Lp))}function Rp(t,e,i={type:"geojson",centroid:!0}){Dp.has(t)&&gl(`map type of '${t}' already exists, will be overwritten.`),Op();const s=new R(Pp),n=E({},{centroid:!0,simplify:!1},i);"topojson"===i.type?s.parse(e,{type:"topojson",options:n}):s.parse(e,{type:"geojson",options:n});const{simplify:r}=i;!0===r?s.transform({type:"simplify"}):bs(r)&&s.transform({type:"simplify",options:r}),Dp.set(t,s)}function Bp(t){Dp.has(t)?Dp.delete(t):gl(`map type of '${t}' does not exists.`)}function Ip(t,e=!1){let i=e;return t.latestData instanceof R&&(i=!1),i?k(t.latestData):t.latestData&&t.latestData.slice()}const Fp=(t,e)=>0===t.length?[]:1===t.length?Ip(t[0],null==e?void 0:e.deep):t.map((t=>Ip(t,null==e?void 0:e.deep)));function Yp(t,e,i){Cp(e=e instanceof f?e:t.dataSet,"copyDataView",Fp);const s=new R(e,i);return s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView",level:zp.copyDataView}),s}function jp(t,e,i=[]){var s;if(t instanceof R)return t;const{id:n,values:r=[],fromDataIndex:a,fromDataId:o,transforms:l=[]}=t,h=t.parser?k(t.parser):{clone:!0},d=k(t.fields);let c;h.clone=!(!1===h.clone);const u=i.find((t=>t.name===n));if(u)c=u;else{const t={name:n};if(d&&(t.fields=d),c=new R(e,t),"string"==typeof o){const t=i.find((t=>t.name===o));if(!t)return gl(`no data matches fromDataId ${o}`),null;c.parse([t],{type:"dataview"}),c.transform({type:"copyDataView"})}else if("number"==typeof a){const t=i[a];if(!t)return gl(`no data matches fromDataIndex ${a}`),null;c.parse([t],{type:"dataview"}),c.transform({type:"copyDataView"})}else Array.isArray(r)?c.parse(r,h):!S(r)||h&&!["csv","dsv","tsv"].includes(h.type)?(c.parse([]),gl("values should be array")):c.parse(r,null!==(s=h)&&void 0!==s?s:{type:"csv"});l&&l.length&&l.forEach((t=>{e.getTransform(t.type)&&c.transform(t)}))}return c}function Hp(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}var zp,Np;function Vp(t,e){return Fa(t).reduce(((t,i)=>{const s=S(i)?e.getGrammarById(i):i;return s&&t.push(s),t}),[])}function Wp(t,e){if(D(t))return[];if(!xs(i=t)&&(null==i?void 0:i.signal)){const i=t.signal;if(S(i))return Fa(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}else if(function(t){return!xs(t)&&!!(null==t?void 0:t.callback)}(t))return Vp(t.dependency,e);var i;return[]}function Gp(t){return xs(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function Up(t,e,i,s){if(D(t))return t;if(xs(t))return s?t.call(null,i,s,e):t.call(null,i,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?s?t.callback.call(null,i,s,e):t.callback.call(null,i,e):t}function $p(t,e){return Xp(t)?t.output():e[t]}!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(zp||(zp={})),function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(Np||(Np={}));const Xp=t=>t&&!D(t.grammarType),Kp=t=>xs(t)?t:e=>e[t],qp=(t,e)=>Xp(t)?t.output():t&&bs(t)?xs(t.callback)?i=>t.callback(i,e):xs(t.value)?t.value(e):t:t,Zp=(t,e)=>t?bs(t)?Object.keys(t).reduce(((i,s)=>{const n=t[s];return i[s]=qp(n,e),i}),{}):t.map((t=>qp(t,e))):t;let Jp=-1;class Qp extends(o()){constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++Jp}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){const t=Fa(this.spec.dependency).map((t=>S(t)?this.view.getGrammarById(t):t));this.detach(t)}this.spec.dependency=t;const i=Fa(t).map((t=>S(t)?this.view.getGrammarById(t):t));return this.attach(i),this.commit(),this}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,s;return null===(s=null===(i=this.view)||void 0===i?void 0:i.emit)||void 0===s||s.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){if(!t||!t.length)return e;let s=e,n=0;const r=t.length;for(;n!D(t))).forEach((i=>{var s;D(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,(null!==(s=this.references.get(i))&&void 0!==s?s:0)+e))})),this}detach(t,e=1){return Fa(t).filter((t=>!D(t))).forEach((t=>{const i=this.references.get(t)-e;i>0?this.references.set(t,i-1):(this.references.delete(t),t.targets.includes(this)&&(t.targets=t.targets.filter((t=>t!==this))))})),this}detachAll(){this.references.forEach(((t,e)=>{this.detach(e,t)}))}link(t){this.grammarSource=t}run(){var t;const e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return D(this.spec[e])||this.detach(Wp(this.spec[e],this.view)),this.spec[e]=t,this.attach(Wp(t,this.view)),this.commit(),this}}const tg=(t,e,i)=>{var s,n;if("callback"===t&&xs(e))return{references:[],value:{callback:e,dependency:[]}};if(!D(e.data)){const t=i.getDataById(e.data);return{references:[t],value:t}}if(!D(e.customized)){const t=i.getCustomizedById(e.customized);return{references:[t],value:t}}if(!D(e.scale)){const t=i.getScaleById(e.scale);return{references:[t],value:t}}if((n=e)&&(n.signal||n.callback)){const t=Wp(e,i);return{references:t,value:e.callback?{value:e.callback,dependency:t}:null!==(s=null==t?void 0:t[0])&&void 0!==s?s:e}}return{value:e}},eg=(t,e)=>{if(null==t?void 0:t.length){const i=[];let s=[];return t.forEach((t=>{var n;const r=((t,e)=>{const i=fc.getTransform(t.type);if(!i)return;const s={};let n=[];return Object.keys(t).forEach((i=>{var r;if("type"===i)return;const a=t[i];if("dependency"===i)return void((null==a?void 0:a.length)&&(n=n.concat(Vp(a,e))));const o=((t,e,i)=>{if(D(e))return{value:e};if(y(e)){const s=e.map((e=>tg(t,e,i)));return{references:s.reduce(((t,e)=>(e.references&&t.concat(e.references),t)),[]),value:s.map((t=>t.value))}}return tg(t,e,i)})(i,a,e);o&&((null===(r=o.references)||void 0===r?void 0:r.length)&&(n=n.concat(o.references)),s[i]=o.value)})),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:s,references:n}})(t,e);r&&((null===(n=r.references)||void 0===n?void 0:n.length)&&(s=s.concat(r.references)),i.push(r))})),{transforms:i,refs:s}}return null},ig={csv:Ul,dsv:Gl,tsv:$l,json:(t,e={},i)=>{if(!S(t))return Fa(t);try{return Fa(JSON.parse(t))}catch(t){return[]}}};class sg extends Qp{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=t=>{const e=function(t,e){if(D(t))return t;if(xs(t))return t.call(null,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,this.parameters());return this._input=((t,e)=>{if(!e||!ig[e.type])return Fa(t);const i="dsv"===e.type?{delimiter:e.delimiter}:{};return ig[e.type](t,i,new R(new f))})(t.values,e),this._input},this.load=t=>{if(t.values)return this.ingest(t)},this.relay=t=>t[0],this._loadTasks=[],D(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){const e=[],i=[],s=t.format?Wp(t.format,this.view)[0]:null;if(s&&e.push(s),t.values){const s=Wp(t.values,this.view)[0];s&&e.push(s),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){const n=Wp(t.url,this.view)[0];n&&e.push(n),i.push({type:"load",transform:this.load,options:{url:null!=n?n:t.url,format:null!=s?s:t.format}})}else if(t.source){const s=[];Fa(t.source).forEach((t=>{const i=Xp(t)?t:this.view.getDataById(t);i&&(e.push(i),s.push(i))})),s.length&&(i.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:i,refs:e}}evaluate(t,e){this.view.emit(hc.BEFORE_EVALUATE_DATA);const i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);const s=this.evaluateTransform(i,this._input,e),n=this._evaluateFilter(s,e);return this.setValues(n),this._isLoaded=!0,this.view.emit(hc.AFTER_EVALUATE_DATA),this}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){const s=Object.assign({},this.spec,{values:t,format:e});return D(t)||(s.url=void 0,s.source=void 0),i?this.parseLoad(s):this}url(t,e,i=!0){const s=Object.assign({},this.spec,{url:t,format:e});return D(t)||(s.values=void 0,s.source=void 0),i?this.parseLoad(s):this}source(t,e,i=!0){const s=Object.assign({},this.spec,{source:t,format:e});return D(t)||(s.values=void 0,s.url=void 0),i?this.parseLoad(s):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;const e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=Fa(t).map(((t,e)=>{const i=t===Object(t)?t:{data:t};return i[this._dataIDKey]=e,i}))}field(t){return this._values.map((e=>e[t]))}transform(t){const e=eg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;const i=eg(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(Fa(t)),this._postFilters.sort(((t,e)=>{var i,s;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(s=e.rank)&&void 0!==s?s:0)})),this}removeDataFilter(t){const e=Fa(t);return this._postFilters=this._postFilters.filter((t=>!e.includes(t))),this}_evaluateFilter(t,e){return this._postFilters.reduce(((t,i)=>i.filter(t,e)),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}function ng(t,e,i,s){let n,r;const a=t[e];for(;e>i&&(r=Math.floor((e-1)/2),n=t[r],a&&n&&s(a,n)<0);)t[e]=n,e=r;return t[e]=a}function rg(t,e,i,s){const n=e,r=null!=i?i:t.length,a=t[e];let o,l=2*e+1;for(;l=0&&(l=o),t[e]=t[l],l=2*(e=l)+1;return t[e]=a,ng(t,e,n,s)}class ag{constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){const e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);return ng(this.nodes,e,0,this.compare),rg(this.nodes,e,null,this.compare)}return this.nodes.push(t),ng(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),ng(this.nodes,e,0,this.compare),rg(this.nodes,e,null,this.compare)}}pop(){const t=this.nodes.pop();let e;return this.nodes.length?(e=this.nodes[0],this.nodes[0]=t,rg(this.nodes,0,null,this.compare)):e=t,e}clear(){this.nodes=[]}}const og=t=>t,lg=t=>0;class hg{constructor(t){this.list=[],this.ids={},this.idFunc=t||og}add(t){const e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){const e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((e=>e!==t))),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}class dg{constructor(){this.grammars=[],this.logger=g.getInstance(),this._curRank=0,this._committed=new hg((t=>t.uid)),this._heap=new ag(((t,e)=>(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank))),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((e=>e!==t)))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){const e=[t];for(;e.length;){const i=e.pop();this._setRankOfGrammar(i);const s=i.targets;s&&s.forEach((i=>{e.push(i),i===t&&this.logger.error("Cycle detected in dataflow graph.")}))}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){const e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce(((t,e,i)=>D(e.value)?t:`${t}${i?" , ":""}${e.key}: ${e.value}`),"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach((t=>{t.targets.some((e=>(null==e?void 0:e.rank)<(null==t?void 0:t.rank)))&&this._reRank(t)})),this._committed.forEach((t=>this._enqueue(t))),this._committed=new hg((t=>t.uid))}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((t=>this._enqueue(t)))}evaluate(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)t=this._heap.pop(),t&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}const cg=(t,e,i,s,n)=>{const r=t=>{if(n||!t||s&&!s(t)||i.call(null,t),t.markType===Qd.group){const i=t[e];i&&i.forEach((t=>{r(t)}))}n&&(!t||s&&!s(t)||i.call(null,t))};r(t)},ug=t=>void 0===t;class pg extends Ms{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g){throw new Error("Method not implemented.")}}class gg extends pg{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const s=new gg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}class mg extends pg{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const s=new mg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}mg.DOM_DELTA_PIXEL=0,mg.DOM_DELTA_LINE=1,mg.DOM_DELTA_PAGE=2;const _g="object"==typeof performance&&performance.now?performance:Date;function fg(t){return"mouse"===t||"pen"===t}class vg{constructor(t,e){this.dispatch=new(o()),this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(fg(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,s;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=fg(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let s=null==o?void 0:o.parent;for(;s&&s!==this.rootTarget.parent&&s!==n.target;)s=s.parent;if(!s||s===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let s=o;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(s=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),a=fg(r.pointerType);this.dispatchEvent(r,"pointerover"),a&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(s=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=fg(t.pointerType),s=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",s||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=_g.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(fg(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(fg(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});const a=r.clicksByButton[t.button];a.target===e.target&&s-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=s,e.detail=a.clickCount,fg(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):fg(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof mg))return void g.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,s,n,r,a,o;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(s=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===s?void 0:s.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(o=null==h?void 0:h.stage.renderCount)&&void 0!==o?o:-1})),l)for(let e=0,i=l.length;e=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=_g.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let s=0,n=i.length;s{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:n,autoPreventDefault:r=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new vg(s,{clickInterval:a}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new gg,this.rootWheelEvent=new mg,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:s}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?s.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(s.style,n):i&&S(t)&&!fs(this.cursorStyles,t)&&(s.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const s=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class xg{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,Si.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),Si.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),Si.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));Si.graphicService.hooks.onAttributeUpdate.taps=e(Si.graphicService.hooks.onAttributeUpdate.taps),Si.graphicService.hooks.onSetStage.taps=e(Si.graphicService.hooks.onSetStage.taps),Si.graphicService.hooks.onRemove.taps=e(Si.graphicService.hooks.onRemove.taps)}}class Sg{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Si.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,s)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),Si.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){Si.graphicService.hooks.onAddIncremental.taps=Si.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onClearIncremental.taps=Si.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Si.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const s=e.layer.subLayers.get(e._uid);s&&s.drawContribution&&s.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:s.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const Mg=new qt;class kg{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),Si.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,s)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Mg.setValue(s.x1,s.y1,s.x2,s.y2),e.dirty(Mg,t.parent&&t.parent.globalTransMatrix)))})),Si.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,s,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(s.globalAABBBounds))})),Si.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){Si.graphicService.hooks.beforeUpdateAABBBounds.taps=Si.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.afterUpdateAABBBounds.taps=Si.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onRemove.taps=Si.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}var Ag;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Ag||(Ag={}));class wg{static Avaliable(){return!!Si.global.getRequestAnimationFrame()}avaliable(){return wg.Avaliable()}tick(t,e){Si.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Tg{static Avaliable(){return!0}avaliable(){return Tg.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}const Lg=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Ag.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Ag.INITIAL,Si.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),Si.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:wg},{mode:"timeout",cons:Tg}];for(let e=0;e{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Ag.INITIAL&&(this.status=Ag.PAUSE,!0)}resume(){return this.status!==Ag.INITIAL&&(this.status=Ag.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Ag.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ag.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Ag.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Ag.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};Lg.addTimeline(Ls),Lg.setFPS(60);class Cg{static registerPlugin(t,e){Cg._pluginClasses[t]=e}static getPlugin(t){return Cg._pluginClasses[t]}}Cg._pluginClasses={};const Eg="white";class Dg extends er{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:Eg}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new ps,this.hooks={beforeRender:new Q(["stage"]),afterRender:new Q(["stage"])},this.global=Si.global,!this.global.env&&ll()&&this.global.setEnv("browser"),this.window=Xi.get(Qi),this.renderService=Xi.get(Pr),this.pluginService=Xi.get(ha),this.layerService=Xi.get(ar),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:Eg,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Lg,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Ts,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&S(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(t=-1){this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new bg(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:s=0,beta:n=0,camera:r,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:s,beta:n,camera:r,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,s,n,r,a;this.option3d=t;const o=this.get3dOptions(t),{light:l,center:h,camera:d,alpha:c,beta:u,fieldRatio:p,fieldDepth:g}=o,{dir:m=[1,1,-1],color:_="white",ambient:f}=l,v=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),y=(null!==(s=h.y)&&void 0!==s?s:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),b=[v,y,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(a=h.dz)&&void 0!==a?a:0)];let x=0,S=0,M=0;d||(x=Math.sin(c)+v,S=Math.sin(u)+y,M=Math.cos(c)*Math.cos(u)*1);const k=Cg.getPlugin("DirectionalLight");k&&(this.light=new k(m,_,f));const A={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:g,viewParams:{pos:[x,S,M],center:b,up:[0,1,0]}};if(this.camera)this.camera.params=A;else{const t=Cg.getPlugin("OrthoCamera");t&&(this.camera=new t(A))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=Cg.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new xg))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Sg))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Kt;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new kg,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=Cg.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=Cg.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=Cg.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e,i=!0){"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,s,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+s),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new be(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(t=!0,e){if("released"===this.releaseStatus)return;const i=Xi.get(Qi),s=e?-e.x1:0,n=e?-e.y1:0,r=e?e.x2:this.viewWidth,a=e?e.y2:this.viewHeight,o=e?e.width():this.viewWidth,l=e?e.height():this.viewHeight;return i.create({viewBox:{x1:s,y1:n,x2:r,y2:a},width:o,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=Xi.get(Fr)),this.pickerService}}class Pg{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(hc.AFTER_VRENDER_DRAW),this._view.emit(hc.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,s){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=s,this.initStage(),this}stage(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}gestureController(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&function(t){return e=this,i=void 0,n=function*(){const e=[],i=t.getChildren();yield new Promise((t=>{Si.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)},new((s=void 0)||(s=Promise))((function(t,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(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(a,o)}l((n=n.apply(e,i||[])).next())}));var e,i,s,n}(this._stage).then((()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()})),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,s;return null===(s=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===s||s.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(hc.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(hc.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}render(t=!1){return this._view.emit(hc.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(hc.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree((t=>{t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,s,n;this._view.emit(hc.BEFORE_CREATE_VRENDER_STAGE);const r=this._viewOptions,a=null!==(t=r.stage)&&void 0!==t?t:(o={width:this._width,height:this._height,renderStyle:r.renderStyle,viewBox:r.viewBox,dpr:r.dpr,canvas:r.renderCanvas,canvasControled:r.canvasControled,container:r.container,title:r.rendererTitle,beforeRender:r.beforeRender,afterRender:r.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:r.pluginList,enableHtmlAttribute:r.enableHtmlAttribute,optimize:r.optimize,ticker:r.ticker,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,ReactDOM:r.ReactDOM},new Dg(o));var o;(null===(e=r.options3d)||void 0===e?void 0:e.enable)&&a.set3dOptions(r.options3d),a.enableIncrementalAutoRender(),this._viewBox=r.viewBox,this._view.emit(hc.AFTER_CREATE_VRENDER_STAGE),this._view.emit(hc.BEFORE_CREATE_VRENDER_LAYER);const l=null!==(i=r.layer)&&void 0!==i?i:a.defaultLayer;if(this._view.emit(hc.AFTER_CREATE_VRENDER_LAYER),(null===(s=this._eventConfig)||void 0===s?void 0:s.drag)&&fc.getStageEventPlugin("drag")&&(this._dragController=new(fc.getStageEventPlugin("drag"))(a)),(null===(n=this._eventConfig)||void 0===n?void 0:n.gesture)&&fc.getStageEventPlugin("gesture")){const t=bs(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new(fc.getStageEventPlugin("gesture"))(a,t)}return{stage:a,layer:l}}initStage(){if(!this._stage){const{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;const i=this._view.background();this.background(i)}}}function Og(t){return D(t.offsetX)?D(t.x)?t.changedTouches&&t.changedTouches.length?function(t){const e=t.changedTouches[0];return{canvasX:e.x,canvasY:e.y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function Rg(t,e,i=!0){const s=["canvasX","canvasY"];return i&&(s.push("clientX"),s.push("clientY")),s.forEach((i=>{Zo(e[i])&&Object.defineProperty(t,i,{value:e[i],writable:!0})})),[e.canvasX,e.canvasY]}const Bg="window",Ig="view",Fg="width",Yg="height",jg="viewWidth",Hg="viewHeight",zg="padding",Ng="viewBox",Vg="autoFit",Wg="__vgrammar_scene_item__",Gg=[Qd.line,Qd.area],Ug=[Qd.arc3d,Qd.rect3d,Qd.pyramid3d],$g="key",Xg=[{}],Kg=["key"],qg=!0,Zg=!0,Jg=!1,Qg=!0,tm="VGRAMMAR_IMMEDIATE_ANIMATION",em=0,im=1e3,sm=0,nm=0,rm=!1,am=!1,om="quintInOut",lm={stopWhenStateChange:!1,immediatelyApply:!0},hm="VGRAMMAR_ANIMATION_PARAMETERS",dm="_mo_hide_";function cm(t,e,i,s){var n,r;s===Bg&&function(t){["touches","changedTouches","targetTouches"].forEach((e=>{t[e]&&t[e].length&&Array.from(t[e]).forEach((t=>{Rg(t,Og(t),!1)}))}));const e=Og(t);Rg(t,e)}(e.changedTouches?e.changedTouches[0]:e);let a=null===(n=e.target)||void 0===n?void 0:n[Wg];if(!a&&s===Ig){let i=e.target;const s=null===(r=t.rootMark)||void 0===r?void 0:r.graphicItem;for(;(null==i?void 0:i.parent)&&i.parent!==s;)if(i=i.parent,i[Wg]){a=i[Wg];break}}return e.element=a,e}class um extends Qp{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?Up(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if(y(t)&&y(this.value)&&t.length===this.value.length){for(let e=0;e{var e,i,s,n;return h(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(s=null==t?void 0:t.left)&&void 0!==s?s:0,right:null!==(n=null==t?void 0:t.right)&&void 0!==n?n:0}};function _m(t,e){switch(e){case"line":return t.some((t=>["x","y","defined"].includes(t)));case"area":return t.some((t=>["x","y","x1","y1","defined"].includes(t)));case"largeRects":return t.some((t=>["x","y","width","y1"].includes(t)));case"largeSymbols":return t.some((t=>["x","y"].includes(t)))}return!1}const fm=["fillOpacity"],vm=(t,e,i)=>{var s;return"fillOpacity"===e?(t.fillOpacity=null!==(s=i.fillOpacity)&&void 0!==s?s:1,["fillOpacity"]):[]},ym={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;Zo(e.width)||!Zo(e.x1)&&Zo(i.width)?(t.x=Math.min(null!==(s=i.x)&&void 0!==s?s:0,null!==(n=i.x1)&&void 0!==n?n:1/0),t.width=i.width):Zo(e.x1)||!Zo(e.width)&&Zo(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(r=i.x)&&void 0!==r?r:0,null!==(a=i.x1)&&void 0!==a?a:1/0),t.width=i.width),Zo(e.height)||!Zo(e.y1)&&Zo(i.height)?(t.y=Math.min(null!==(o=i.y)&&void 0!==o?o:0,null!==(l=i.y1)&&void 0!==l?l:1/0),t.height=i.height):Zo(e.y1)||!Zo(e.height)&&Zo(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(h=i.y)&&void 0!==h?h:0,null!==(d=i.y1)&&void 0!==d?d:1/0),t.height=i.height),Zo(e.length)||!Zo(e.z1)&&Zo(i.length)?(t.z=Math.min(null!==(c=i.z)&&void 0!==c?c:0,null!==(u=i.z1)&&void 0!==u?u:1/0),t.length=i.length):Zo(e.z1)||!Zo(e.length)&&Zo(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(p=i.z)&&void 0!==p?p:0,null!==(g=i.z1)&&void 0!==g?g:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}],[Qd.text]:[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:(t,e,i)=>{var s,n;const r=null!==(s=i.limit)&&void 0!==s?s:1/0,a=null!==(n=i.autoLimit)&&void 0!==n?n:1/0,o=Math.min(r,a),l=w(i.text)&&!D(i.text.text),h=l?i.text.text:i.text;Array.isArray(h),t.maxLineWidth=o===1/0?i.maxLineWidth:o,!l&&!i.textType||"rich"!==i.text.type&&"rich"!==i.textType?t.text=h:t.textConfig=h},storedAttrs:"limitAttrs"}],[Qd.rule]:[{channels:["x","y","x1","y1"],transform:(t,e,i)=>{const s=function(t){const{x:e,y:i,x1:s,y1:n}=t;return Zo(e)&&Zo(i)&&Zo(s)&&Zo(n)?[{x:e,y:i},{x:s,y:n}]:[]}(i);t.points=s,t.x=0,t.y=0},storedAttrs:"pointAttrs"}],[Qd.symbol]:[{channels:["shape","symbolType"],transform:(t,e,i)=>{var s;t.symbolType=null!==(s=e.shape)&&void 0!==s?s:e.symbolType}},{channels:["image","fill","background"],transform:(t,e,i)=>{e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]},bm=(t,e,i,s)=>{const n={},r=e?Object.keys(e):[],a=S(t)?ym[t]:t;if(a&&a.length){const t=[];r.forEach((r=>{let o=!1;a.forEach(((a,l)=>{if(a.channels.includes(r)){if(!t[l])if(a.storedAttrs){const t=function(t,e,i,s,n,r){const a=n.getGraphicAttribute(t,!1,r);if(a)return e.forEach((t=>{t in s&&(a[t]=s[t])})),a;const o={};return e.forEach((t=>{o[t]=s[t]})),i[t]=o,o}(a.storedAttrs,a.channels,n,e,i,s);a.transform(n,e,t)}else a.transform(n,e,null);t[l]=!0,o=!0}})),o||(fm.includes(r)?vm(n,r,e):n[r]=e[r])}))}else r.forEach((t=>{fm.includes(t)?vm(n,t,e):n[t]=e[t]}));return n};function xm(t,e,i={}){var s;const n=fc.getGraphicType(e)?fc.createGraphic(e,i):fc.createGraphicComponent(e,i,{skipDefault:null===(s=null==t?void 0:t.spec)||void 0===s?void 0:s.skipTheme});return n||g.getInstance().error(`create ${e} graphic failed!`),n}const Sm=t=>{t&&(t[Wg]=null,t.release(),t.parent&&t.parent.removeChild(t))};function Mm(t,e,i){const s=new Map;if(!t||0===t.length)return{keys:[],data:s};if(!e)return s.set($g,i?t.slice().sort(i):t.slice()),{keys:Kg,data:s};const n=Kp(e);if(1===t.length){const e=n(t[0]);return s.set(e,[t[0]]),{keys:[e],data:s}}const r=new Set;return t.forEach((t=>{var e;const i=n(t),a=null!==(e=s.get(i))&&void 0!==e?e:[];a.push(t),s.set(i,a),r.add(i)})),i&&r.forEach((t=>{s.get(t).sort(i)})),{keys:Array.from(r),data:s}}class km{constructor(t,e,i){this.prevData=(null==t?void 0:t.length)?Mm(t,null!=e?e:null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback)if(this.currentData&&this.prevData){const t=new Map(this.prevData.data);this.currentData.keys.forEach((e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)})),this.prevData.keys.forEach((e=>{t.has(e)&&this.callback(e,null,t.get(e))}))}else this.currentData?this.currentData.keys.forEach((t=>{this.callback(t,this.currentData.data.get(t),null)})):this.prevData&&this.prevData.keys.forEach((t=>{this.callback(t,null,this.prevData.data.get(t))}))}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}function Am(t){return!!(null==t?void 0:t.scale)}function wm(t){return!!(null==t?void 0:t.field)}function Tm(t,e){if(!t)return[];let i=[];return t.scale&&(i=Xp(t.scale)?[t.scale]:Fa(e.getScaleById(t.scale))),i.concat(Wp(t,e))}const Lm=t=>e=>$d(e,t),Cm=t=>{g.getInstance().error(t)},Em=(t,e,i={})=>{if(xs(t))return t;const s=(t=>{const e=[],i=t.length;let s,n,r,a=null,o=0,l="";t+="";const h=()=>{e.push(l+t.substring(s,n)),l="",s=n+1};for(s=0,n=0;ns&&h(),s=n+1,o=s):"]"===r&&(o||Cm("Access path missing open bracket: "+t),o>0&&h(),o=0,s=n+1):n>s?h():s=n+1}return o&&Cm("Access path missing closing bracket: "+t),a&&Cm("Access path missing closing quote: "+t),n>s&&(n+=1,h()),e})(t),n=1===s.length?s[0]:t;return((t,e,i)=>(t.fields=e||[],t.fname=i,t))((i&&i.get||Lm)(s),[n],e||n)},Dm=(t,e,i={})=>{if(y(t)){const s=t.map((t=>Em(t,e,i)));return t=>s.map((e=>e(t)))}return Em(t,e,i)};function Pm(t,e,i,s,n){i&&(Gp(i)?e.forEach((e=>{const n=Up(i,s,e.datum,t);Object.assign(e.nextAttrs,n)})):Object.keys(i).forEach((r=>{var a,o;const l=i[r],d=n&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case Qd.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case Qd.group:case Qd.rect:case Qd.image:return["width","height","y1"].includes(e);case Qd.path:case Qd.shape:return["path","customPath"].includes(e);case Qd.line:return"defined"===e;case Qd.area:return["x1","y1","defined"].includes(e);case Qd.rule:return["x1","y1"].includes(e);case Qd.symbol:return"size"===e;case Qd.polygon:return"points"===e;case Qd.text:return"text"===e}return!1}(t.mark.markType,r)?[e[0]]:e;if(Am(l)){const t=$p(l.scale,s),e=null!==(a=null==l?void 0:l.offset)&&void 0!==a?a:0,i=!D(l.band)&&t.bandwidth?t.bandwidth()*l.band:null,n=S(null==l?void 0:l.field),c=n?Dm(l.field):null;let u=n?null:D(null==l?void 0:l.value)?0:null===(o=t.scale)||void 0===o?void 0:o.call(t,l.value);d.forEach((s=>{var a;n&&(u=null===(a=t.scale)||void 0===a?void 0:a.call(t,c(s.datum))),s.nextAttrs[r]=h(u)||h(i)?u+e+i:u}))}else if(wm(l)){const t=Dm(l.field);d.forEach((e=>{e.nextAttrs[r]=t(e.datum)}))}else d.forEach((e=>{e.nextAttrs[r]=Up(l,s,e.datum,t)}))})))}function Om(t,e,i,s){if(!t)return null;if(Gp(t))return Up(t,s,e,i);const n={};return Object.keys(t).forEach((r=>{var a,o,l;const d=t[r];if(Am(d)){const t=$p(d.scale,s),i=null!==(a=null==d?void 0:d.offset)&&void 0!==a?a:0,c=!D(d.band)&&t.bandwidth?t.bandwidth()*d.band:null,u=S(null==d?void 0:d.field),p=u?Dm(d.field):null,g=u?null===(o=t.scale)||void 0===o?void 0:o.call(t,p(e)):D(null==d?void 0:d.value)?0:null===(l=t.scale)||void 0===l?void 0:l.call(t,d.value);n[r]=h(g)||h(c)?g+i+c:g}else if(wm(d)){const t=Dm(d.field);n[r]=t(e)}else n[r]=Up(d,s,e,i)})),n}function Rm(t){return Object.prototype.toString.call(t)}function Bm(t){return Object.keys(t)}function Im(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Rm(t)!==Rm(e))return!1;if(xs(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(y(t)){if(t.length!==e.length)return!1;for(let s=t.length-1;s>=0;s--)if(!Im(t[s],e[s],i))return!1;return!0}if(!w(t))return!1;const s=Bm(t),n=Bm(e);if(s.length!==n.length)return!1;s.sort(),n.sort();for(let t=s.length-1;t>=0;t--)if(s[t]!=n[t])return!1;for(let n=s.length-1;n>=0;n--){const r=s[n];if(!Im(t[r],e[r],i))return!1}return!0}const Fm=Object.prototype,Ym=Object.prototype.hasOwnProperty,jm=function(t){if(D(t))return!0;if(A(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Fm)}(t))return!Object.keys(t).length;for(const e in t)if(Ym.call(t,e))return!1;return!0},Hm=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],zm=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(Hm);function Nm(t,e,i){var s;if(!t||t.length<=1)return null;const n="area"===(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.markType)?zm:Hm,r=[];let a=null;return t.forEach(((t,e)=>{a&&n.every((e=>((t,e,i)=>!(!D(t)||!D(e))||!D(t)&&!D(e)&&("lineDash"===i?((t,e)=>t.length===e.length&&t.join("-")===e.join("-"))(t,e):"stroke"===i||"fill"===i?((t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(S(t))return!1;if(t.gradient!==e.gradient)return!1;const i=Object.keys(t),s=Object.keys(e);return i.length===s.length&&i.every((i=>"stops"===i?((t,e)=>{var i,s;if(t===e)return!0;const n=null!==(i=t&&t.length)&&void 0!==i?i:0;return n===(null!==(s=e&&e.length)&&void 0!==s?s:0)&&0!==n&&t.every(((t,i)=>!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset))})(t[i],e[i]):t[i]===e[i]))})(t,e):t===e))(a[e],t[e],e)))||(r.length&&(r[r.length-1].endIndex=e),a=t,r.push({attrs:a,startIndex:e}))})),r.length>=2?r.map((t=>{const i=Vm(t.attrs);return i.points=e.slice(t.startIndex,D(t.endIndex)?e.length:t.endIndex),i})):null}function Vm(t){const e={};if(!t)return e;const i=["x","y","x1","y1","defined","size","width","height","context"];return Object.keys(t).forEach((s=>{i.includes(s)||(e[s]=t[s])})),e}class Wm{constructor(t){this.data=null,this.states=[],this.diffState=Jd.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t];if(!o)return{};if(xs(o))return o(this.getDatum(),this,t,e);if(!a&&(null===(r=this.graphicItem.states)||void 0===r?void 0:r[t]))return this.graphicItem.states[t];const l=this.items.map((t=>Object.assign({},t,{nextAttrs:{}})));Pm(this,l,o,this.mark.parameters());const h=this.transformElementItems(l,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[t]||(this.graphicItem.states[t]=h):this.graphicItem.states={[t]:h},h},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;const e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?bm(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[Wg]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=t=>this.mark?bm(e,t,this):t),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(Object.assign({},t)),this.setFinalGraphicAttributes(Object.assign({},t))))}updateGraphicItem(){var t;if(!this.graphicItem)return;this.diffState===Jd.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");e&&0!==e.length&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(t=>t.stop()))),this.graphicItem&&(Sm(this.graphicItem),this.graphicItem[Wg]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var s;this.mark.emit(hc.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;const n=Kp(i);return this.items=e.map((t=>({datum:t,key:n(t),view:this.mark.view,nextAttrs:{}}))),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(s=this.items)||void 0===s?void 0:s[0].key,this.mark.emit(hc.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;const s=this.mark.isCollectionMark(),n=this.states,r=Fa(Up(t,e,this.getDatum(),this)),a=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;a&&r.length&&r.sort(a);const o=r.length!==n.length||r.some(((t,e)=>t!==n[e]));this.states=r,!s&&o&&this.diffState===Jd.unChange&&(this.diffState=Jd.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);const e=this.transformElementItems(this.items,this.mark.markType);t&&Object.assign(e,t),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,dm in this.graphicItem.attribute&&"visible"in e&&delete this.graphicItem.attribute[dm],this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==Jd.enter&&this.diffState!==Jd.update||!this.states.length||this.useStates(this.states),this.mark.markType===Qd.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((t=>{t.nextAttrs={}})),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;const e=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=t=>e(this.data,t,new Ze))}encodeItems(t,e,i=!1,s){const n=this.mark.isCollectionMark(),r=e[Zd.update],a=e[Zd.enter],o=e[Zd.exit],l=this.mark.isLargeMode()||n&&!this.mark.getSpec().enableSegments;this.diffState===Jd.enter?(a&&Pm(this,t,a,s,l),r&&Pm(this,t,r,s,l)):this.diffState===Jd.update?((n&&a||i)&&Pm(this,t,a,s,l),r&&Pm(this,t,r,s,l)):this.diffState===Jd.exit&&o&&(i&&Pm(this,t,a,s,l),Pm(this,t,o,s,l))}coordinateTransformEncode(t){if(!this.mark.coord||"arc"===this.mark.markType||!0===this.mark.disableCoordinateTransform)return;const e=this.mark.coord.output();t.forEach((t=>{const i=t.nextAttrs,s=e.convert(i);Object.assign(i,s)}))}hasStateAnimation(){var t;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");return e&&e.length>0}clearStates(t){const e=v(t)?t:this.hasStateAnimation();this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}updateStates(t){if(!this.graphicItem)return!1;let e=this.states.slice();const i=this.mark.getSpec().encode;let s=!1,n=!1;return Object.keys(t).forEach((r=>{var a;if(!r)return;const o=t[r];if(bs(o)&&!Im(o,null===(a=this.runtimeStatesEncoder)||void 0===a?void 0:a[r]))e.includes(r)?s=!0:e.push(r),this._updateRuntimeStates(r,o),n=!0;else if(o)!e.includes(r)&&(null==i?void 0:i[r])&&(e.push(r),n=!0);else if(e.length){const t=e.filter((t=>t!==r));t.length!==e.length&&(n=!0,e=t),this.runtimeStatesEncoder&&this.runtimeStatesEncoder[r]&&(this.runtimeStatesEncoder[r]=null)}})),s&&this.graphicItem.clearStates(),!!n&&(this.useStates(e),!0)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&S(t)&&!Im(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){const i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}const s=this.mark.getSpec().encode,n=Fa(t).reduce(((t,e)=>(e&&!t.includes(e)&&(null==s?void 0:s[e])&&t.push(e),t)),this.states.slice());return n.length!==this.states.length&&(this.useStates(n),!0)}removeState(t){if(!this.graphicItem)return!1;const e=Fa(t);if(!e.length)return!1;const i=this.states.filter((t=>!e.includes(t)));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach((t=>{this.runtimeStatesEncoder[t]=null})),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(hc.BEFORE_ELEMENT_STATE,{states:t},this);const s=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;s&&t.sort(s),this.states=t;const n=v(e)?e:this.hasStateAnimation();return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(hc.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){const e={},i=this.getFinalGraphicAttributes();for(const s in t)fs(i,s)&&Im(i[s],t[s])||(e[s]=t[s]);return e}transformElementItems(t,e,i){var s,n,r,a,o;const l=t[0];if(!l.nextAttrs||0===Object.keys(l.nextAttrs).length)return{};let h=l.nextAttrs;if(function(t){return[Qd.line,Qd.area,Qd.largeRects,Qd.largeSymbols].includes(t)}(e)&&t&&t.length&&D(null===(s=l.nextAttrs)||void 0===s?void 0:s.points)&&(!0===i||_m(Object.keys(l.nextAttrs),this.mark.markType))){const i=this.mark.getSpec(),s=this.getGraphicAttribute("points",!1),l=this.getGraphicAttribute("segments",!1),d=i.enableSegments,c=null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[Zd.connectNulls],u=t.map((t=>t.nextAttrs)),p=this.mark.isProgressive();if(h=Vm(h),e===Qd.line||e===Qd.area){const i=function(t,e,i,s){return t&&t.length&&(t.length,1)?t.some((t=>_m(Object.keys(t.nextAttrs),"line")))?t.map(((t,e)=>{var n;const r=t.nextAttrs,{x:a,y:o,x1:l,y1:h,defined:d}=null!==(n=null==i?void 0:i[e])&&void 0!==n?n:{};return D(r.x)&&(r.x=a),D(r.y)&&(r.y=o),D(r.defined)&&!1===d&&(r.defined=!1),r.context=t.key,s&&(D(r.x1)&&(r.x1=l),D(r.y1)&&(r.y1=h)),r})):null!=i?i:[]:[]}(t,0,s,e===Qd.area);if(p)h.segments=(null!==(o=null===(a=null===(r=this.graphicItem)||void 0===r?void 0:r.attribute)||void 0===a?void 0:a.segments)&&void 0!==o?o:[]).concat([{points:i}]);else if(c){if(h.segments=function(t,e,i){if(!t||t.length<=1)return null;const s=!!i&&i.mark.getSpec().enableSegments;let n,r,a=[],o=null;if(t.forEach(((t,i)=>{o=e[i],o&&!1!==o.defined?(n||(r={items:[],points:[]},a.push(r)),r.points.push(o),r.items.push(t),!1===n&&(r.isConnect=!0,r={items:[],points:[]},a.push(r)),n=!0):n=!1})),a=a.filter((t=>t.points.length>0)),a.length>=2){const t=[];return a.forEach((e=>{if(e.isConnect)return void t.push({points:e.points,isConnect:!0});if(s){const s=Nm(e.items,e.points,i);if(s)return void s.forEach((e=>{t.push(e)}))}const n=Vm(e.items[0]);n.points=e.points,t.push(n)})),t}return s?Nm(t,e,i):null}(u,i,this),h.segments&&h.segments.some((t=>t.isConnect))){const t=Om(c,this.getDatum(),this,this.mark.parameters());t&&h.segments.forEach((e=>{e.isConnect&&Object.assign(e,t)}))}h.points=i}else if(d){const t=i&&0!==i.length?i:function(t){return t?t.reduce(((t,e)=>t.concat(e.points)),[]):null}(l),e=Nm(u,t,this);e?(h.segments=e,h.points=null):(h.segments=null,h.points=t),h=function(t,e){var i;if(!t||!t.segments||!t.segments.length)return t;const s="area"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.markType)?["fillOpacity","strokeOpacity"]:["strokeOpacity"],n={};return Object.keys(t).forEach((e=>{s.includes(e)||(n[e]=t[e])})),n}(h,this)}else h.points=i,h.segments=null}else e===Qd.largeRects?h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(4*t.length);return t.forEach(((t,e)=>{var n,r,a,o;const l=t.nextAttrs,h=null!==(n=l.x)&&void 0!==n?n:i[4*e],d=null!==(r=l.y)&&void 0!==r?r:i[4*e+1],c=null!==(a=l.width)&&void 0!==a?a:i[4*e+2],u=null!==(o=l.y1)&&void 0!==o?o:i[4*e+3];s[4*e]=h,s[4*e+1]=d,s[4*e+2]=c,s[4*e+3]=u-d})),s}(t,!0,s):e===Qd.largeSymbols&&(h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(2*t.length);return t.forEach(((t,e)=>{var n,r;const a=t.nextAttrs,o=null!==(n=a.x)&&void 0!==n?n:i[2*e],l=null!==(r=a.y)&&void 0!==r?r:i[2*e+1];s[2*e]=o,s[2*e+1]=l})),s}(t,!0,s))}return h}applyGraphicAttributes(t){var e,i,s;if(!jm(t))if(this.mark.needAnimate()){const n=this.diffAttributes(t),r=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},a=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(n).forEach((t=>{r[t]=this.getGraphicAttribute(t),a[t]=n[t]})),this.setNextGraphicAttributes(n),this.setPrevGraphicAttributes(r),this.setFinalGraphicAttributes(a);const o=((null===(s=this.mark.animate)||void 0===s?void 0:s.getElementAnimators(this))||[]).reduce(((t,e)=>Object.assign(t,e.getEndAttributes())),{}),l=Object.assign({},o,a);this.graphicItem.setAttributes(l)}else this.graphicItem.setAttributes(t)}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let e;const i=this.getPrevGraphicAttributes();if(!D(e=$d(i,t)))return e}const s=this.mark.getAttributeTransforms();let n=[t];if(s&&s.length){const e=s.find((e=>e.storedAttrs&&e.channels.includes(t)));e&&(n=[e.storedAttrs,t])}return $d(null===(i=this.graphicItem)||void 0===i?void 0:i.attribute,n)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;const s=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();i&&s&&(s[t]=e),n&&!fs(n,t)&&(n[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;const i=this.getFinalGraphicAttributes(),s=this.getPrevGraphicAttributes();Object.keys(t).forEach((n=>{i&&e&&(i[n]=t[n]),s&&!fs(s,n)&&(s[n]=this.graphicItem.attribute[n])})),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}getFinalAnimationAttribute(t){var e,i;return null!==(i=null===(e=this.getFinalGraphicAttributes())||void 0===e?void 0:e[t])&&void 0!==i?i:this.getGraphicAttribute(t)}getFinalAnimationAttributes(){var t;return null!==(t=this.getFinalGraphicAttributes())&&void 0!==t?t:this.graphicItem.attribute}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(Sm(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?D(t)?this.items.map((t=>t.nextAttrs)):this.items.map((e=>{var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]})):D(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}setItemAttributes(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?y(t)&&this.items.forEach(((e,i)=>{Object.assign(e.nextAttrs,t[i])})):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}getDatum(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}class Gm extends Qp{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.differ=new km([]),this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,s;if(super.parse(t),this.spec.group){const t=S(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(t)}const n=S(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(n),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach((t=>{this.encodeState(t,{},!0)})),Object.keys(null!==(s=t.encode)&&void 0!==s?s:{}).forEach((e=>{this.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:super.parameters()}parseAddition(t){return this}reuse(t){var e;if(t.grammarType!==this.grammarType)return this;const i=t;return this.markType=i.markType,this.coord=i.coord,this.elementMap=i.elementMap,this.elements=i.elements,this.elementMap.forEach((t=>t.mark=this)),this.differ=i.differ,null===(e=this.reuseAnimate)||void 0===e||e.call(this,i),this._context=i._context,this.graphicItem=i.graphicItem,this.graphicIndex=i.graphicIndex,this.graphicParent=i.graphicParent,this.needClear=i.needClear,this.isUpdated=i.isUpdated,this}needLayout(){return!D(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((t=>{t.diffState===Jd.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i,s;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===lc.before)return this;const n=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(n,e);const r=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:Xg,e),a=null==r?void 0:r.progressive;if(a?this.renderContext={large:!1}:(this.evaluateGroup(r),this.renderContext=this.parseRenderContext(r,e)),null===(s=this.renderContext)||void 0===s?void 0:s.progressive)this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive();else{let t=null;if(a){if(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=r.progressive,t=r.progressive.output(),r.progressive.canAnimate&&r.progressive.unfinished())return this.update(this.spec),this}else t=r;this.emit(hc.BEFORE_MARK_JOIN),this.evaluateJoin(t),this.emit(hc.AFTER_MARK_JOIN),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(hc.AFTER_MARK_ENCODE)}return this.update(this.spec),this}evaluateGroup(t){if(this.markType===Qd.group)return;const e=Mm(null!=t?t:Xg,this.spec.groupBy,this.spec.groupSort);this._groupEncodeResult=null,this._groupedData=e}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter((t=>"afterEncodeItems"===t.markPhase))}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter((t=>D(t.markPhase)||"afterEncode"===t.markPhase))}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter((t=>"beforeJoin"===t.markPhase)):[]}evaluate(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}output(){return this}join(t,e,i,s,n){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,D(t)||(S(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=s,this.spec.groupSort=n,this.commit(),this}coordinate(t){return S(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(Jd.update,t,e,i)}encodeState(t,e,i,s){if(t===Jd.enter&&(this._isReentered=!0),this.spec.encode[t]){const n=this.spec.encode[t];if(Gp(n))this.detach(Tm(n,this.view));else{const r=S(e);r&&s||!r&&i?(Object.keys(n).forEach((t=>{this.detach(Tm(n[t],this.view))})),this.spec.encode[t]={}):r?this.detach(Tm(n[e],this.view)):Object.keys(e).forEach((t=>{this.detach(Tm(n[t],this.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),S(e)?(this.spec.encode[t][e]=i,this.attach(Tm(i,this.view))):Gp(e)?(this.spec.encode[t]=e,this.attach(Tm(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((t=>{this.attach(Tm(t,this.view))})))),this.commit(),this}_getEncoders(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){const e=eg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);const i=eg(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){const e=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(e.forEach((t=>{D(this.spec[t])||(this.spec[t]=void 0)})),this):(e.forEach((e=>{D(t[e])||(this.spec[e]=t[e])})),this)}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return Gg.includes(this.markType)}needAnimate(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!D(this.spec.animation)}getAllElements(){const t=this.elements.slice();return this.elementMap.forEach((e=>{e.diffState!==Jd.exit||t.includes(e)||t.push(e)})),this.spec.sort&&t.sort(((t,e)=>this.spec.sort(t.getDatum(),e.getDatum()))),t}getScales(){const t={};return this.references.forEach(((e,i)=>{i.grammarType===dc.scale&&(t[i.id()]=i.output())})),t}getScalesByChannel(){const t=this.spec.encode;if(!t)return{};const e={},i=this.parameters();return Object.keys(t).forEach((s=>{const n=t[s];n&&!Gp(n)&&Object.keys(n).forEach((t=>{Am(n[t])&&(e[t]=$p(n[t].scale,i))}))})),e}getFieldsByChannel(){const t=this.spec.encode;if(!t)return{};const e={};return Object.keys(t).forEach((i=>{const s=t[i];Gp(s)||Object.keys(s).forEach((t=>{wm(s[t])&&(e[t]=s[t].field)}))})),e}init(t,e){var i,s,n,r,a;if(this._delegateEvent||(this._delegateEvent=(t,e)=>{const i=cm(this.view,t,0,Ig),s=t.element;(null==s?void 0:s.mark)===this&&this.emitGrammarEvent(e,i,s)},this.initEvent()),null===(i=this.initAnimate)||void 0===i||i.call(this,this.spec),!this.group){const t=$p(this.spec.group,e);this.group=t,t&&t.appendChild(this)}const o=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=null!==(r=null===(n=null===(s=this.group)||void 0===s?void 0:s.children)||void 0===n?void 0:n.indexOf(this))&&void 0!==r?r:0;if(this.markType!==Qd.group){if(!this.graphicItem){const t=xm(this,Qd.group,{pickable:!1,zIndex:null!==(a=this.spec.zIndex)&&void 0!==a?a:0});(this.spec.support3d||Ug.includes(this.markType))&&t.setMode("3d"),t.name=`${this.id()||this.markType}`,this.graphicItem=t}this.graphicParent=this.graphicItem,!o||this.graphicIndex===l&&this.graphicItem.parent===o||o.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=o;this.graphicIndex=l}update(t){var e;if(this.emit(hc.BEFORE_MARK_UPDATE),this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||null===(e=this.updateAnimate)||void 0===e||e.call(this,t),this.markType!==Qd.group){if(D(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),D(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!D(t.clipPath)){const e=y(t.clipPath)?t.clipPath:t.clipPath(this.elements);e&&e.length?this.graphicItem.setAttribute("path",e):this.graphicItem.setAttributes({path:e,clip:!1})}this.elementMap.forEach((t=>{t.updateGraphicItem()}))}else this.elementMap.forEach((t=>{t.updateGraphicItem()}));this.emit(hc.AFTER_MARK_UPDATE)}createElement(){return new Wm(this)}evaluateJoin(t){var e,i,s,n;this.needClear=!0;const r=Kp(null!==(s=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==s?s:()=>$g),a=Kp(null!==(n=this.spec.groupBy)&&void 0!==n?n:()=>$g),o=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter((t=>t.diffState===Jd.enter))),d=[];this.differ.setCallback(((t,e,i)=>{var s;const n=t;let o;if(D(e))o=this.elementMap.get(n),o&&(o.diffState=Jd.exit);else if(D(i)){if(o=this.elementMap.has(n)?this.elementMap.get(n):this.createElement(),o.diffState===Jd.exit){o.diffState=Jd.enter;const t=null===(s=this.animate)||void 0===s?void 0:s.getElementAnimators(o,Jd.exit);t&&t.forEach((t=>t.stop("start")))}o.diffState=Jd.enter;const i=l?t:a(e[0]);o.updateData(i,e,r),this.elementMap.set(n,o),d.push(o)}else if(o=this.elementMap.get(n),o){o.diffState=Jd.update;const i=l?t:a(e[0]);o.updateData(i,e,r),d.push(o)}h.delete(o)}));const c=null!=t?t:Xg;l?this.differ.setCurrentData(this._groupedData):this.differ.setCurrentData(Mm(c,(t=>`${a(t)}-${r(t)}`),void 0)),this.differ.doDiff(),h.forEach((t=>{this.elementMap.delete(l?t.groupKey:`${t.groupKey}-${t.key}`),t.remove(),t.release()})),this.elements=d,o&&this.elements.length>=2&&this.elements.sort(((t,e)=>o(t.getDatum(),e.getDatum())))}evaluateState(t,e,i){e&&t.forEach((t=>{t.state(e,i)}))}evaluateGroupEncode(t,e,i){if(!this._groupedData||!e)return;const s={};return this._groupedData.keys.forEach((n=>{const r=t.find((t=>t.groupKey===n));r&&(s[n]=Om(e,r.items&&r.items[0]&&r.items[0].datum,r,i))})),this._groupEncodeResult=s,s}getChannelsFromConfig(t){const e=this.spec;return D(e.interactive)?null:{pickable:e.interactive}}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(hc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[Zd.group],i);t.forEach((t=>{this.markType===Qd.glyph&&this._groupEncodeResult?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,this._groupEncodeResult[t.groupKey])})):(null==r?void 0:r[t.groupKey])&&!this.isCollectionMark()?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,r[t.groupKey])})):n&&t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n)})),t.encodeItems(t.items,e,this._isReentered,i),this.isCollectionMark()&&(null==r?void 0:r[t.groupKey])&&M(r[t.groupKey].defined)&&(t.items.forEach((e=>{e.nextAttrs.defined=r[t.groupKey].defined})),delete r[t.groupKey].defined)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic(this.isCollectionMark()?null==r?void 0:r[t.groupKey]:null)})),this.emit(hc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){var s;const n=null!=i?i:xm(this,this.markType,t);if(n){if(null===(s=this.renderContext)||void 0===s?void 0:s.progressive){let t;if(this._groupedData){const i=this._groupedData.keys.indexOf(e);i>=0&&(t=this.graphicParent.getChildAt(i))}else t=this.graphicParent.at(0);this.isCollectionMark()?(n.incremental=1,t.appendChild(n)):t.incrementalAppendChild(n)}else this.graphicParent.appendChild(n);return n}}parseRenderContext(t,e){const i=this.markType!==Qd.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep0&&t.length>=this.spec.largeThreshold;if(i){const i=this._groupedData;return i&&i.keys&&i.keys.some((t=>i.data.get(t).length>this.spec.progressiveThreshold))?{large:s,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:i.keys.reduce(((t,e)=>Math.max(Math.ceil(i.data.get(e).length/this.spec.progressiveStep),t)),1),groupedData:i.data}}:{large:s}}return{large:s}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}canAnimateAfterProgressive(){return this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.canAnimate()}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex{t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;const s=this.renderContext.progressive.currentIndex,n=Kp(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:()=>$g),r=[];if(this.isCollectionMark())return this._groupedData.keys.forEach(((t,e)=>{const i=this.renderContext.progressive.groupedData.get(t),a=this.renderContext.progressive.step,o=i.slice(s*a,(s+1)*a);if(0===s){const e=this.createElement();e.diffState=Jd.enter,e.updateData(t,o,n),r.push(e)}else{const i=this.elements[e];i.updateData(t,o,n),r.push(i)}})),r;const a={};return this._groupedData.keys.forEach((t=>{const e=this.renderContext.progressive.groupedData.get(t),i=this.renderContext.progressive.step,o=e.slice(s*i,(s+1)*i),l=[];o.forEach((e=>{const i=this.createElement();i.diffState=Jd.enter,i.updateData(t,[e],n),l.push(i),r.push(i)})),a[t]=l})),{groupElements:a,elements:r}}evaluateEncodeProgressive(t,e,i){const s=this.renderContext.progressive.currentIndex;if(0===s){if(this.evaluateEncode(t,e,i),0===s&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==Qd.glyph){const e=t[0],i=e.getGraphicItem(),s=null==i?void 0:i.parent;s&&this._groupEncodeResult[e.groupKey]&&s.setTheme({common:this._groupEncodeResult[e.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}evaluateProgressive(){var t,e,i;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){const t=this.renderContext.beforeTransformProgressive;t.progressiveRun();const e=t.output();if(t.canAnimate){if(t.unfinished())return;this.evaluateGroup(e)}return this.emit(hc.BEFORE_MARK_JOIN),this.evaluateJoin(e),this.emit(hc.AFTER_MARK_JOIN),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(hc.AFTER_MARK_ENCODE)}if(!(null===(e=this.renderContext)||void 0===e?void 0:e.progressive))return;const s=this.renderContext.parameters;this.emit(hc.BEFORE_MARK_JOIN);const n=this.evaluateJoinProgressive(),r=Array.isArray(n)?n:n.elements;if(this.emit(hc.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupedData.keys.forEach((t=>{const e=xm(this,Qd.group,{pickable:!1,zIndex:this.spec.zIndex});e.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(e)})),this.elements=r):this.elements=this.elements.concat(r),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(r,this.spec.state,s),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),Array.isArray(n))this.evaluateEncodeProgressive(r,this._getEncoders(),s);else{const t=n.groupElements;Object.keys(t).forEach((e=>{this.evaluateEncodeProgressive(t[e],this._getEncoders(),s)}))}this.emit(hc.AFTER_MARK_ENCODE);const a=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter((t=>!0===t.canProgressive));(null==a?void 0:a.length)&&this.evaluateTransform(a,this.elements,s),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach(((t,e)=>{t.diffState!==Jd.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())}))}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:ym[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;let i=this.group;for(;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}initEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}releaseEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,super.clear()}prepareRelease(){var t;this.differ.setCurrentData(null),null===(t=this.animate)||void 0===t||t.stop(),this.elementMap.forEach((t=>t.diffState=Jd.exit)),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach((t=>t.release())),this.differ=null,this.elements=[],this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&Sm(this.graphicItem),this.detachAll(),super.release()}}class Um extends Gm{constructor(t,e){super(t,Qd.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter((e=>e!==t)),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some((e=>e.markType===Qd.group&&e.includesChild(t,!0)))}updateLayoutChildren(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((t=>t.needLayout())),this):this}getAttributeTransforms(){return ym.rect}evaluateJoin(t){if(!this.elements.length){const t=this.createElement();t.updateData($g,Xg,(()=>"")),this.elements=[t],this.elementMap.set($g,t)}}getChannelsFromConfig(t){const e=this.spec,i={};if(D(e.clip)||(i.clip=e.clip),D(e.zIndex)||(i.zIndex=e.zIndex),!D(e.clipPath)){const s=xs(e.clipPath)?e.clipPath([t]):e.clipPath;s&&s.length?i.path=s:(i.path=null,i.clip=!1)}return D(e.interactive)||(i.pickable=e.interactive),i}evaluateGroupEncode(t,e,i){var s;const n=this.elements[0],r={};return Pm(n,[Object.assign({},null===(s=n.items)||void 0===s?void 0:s[0],{nextAttrs:r})],e,i),this._groupEncodeResult=r,r}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(hc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[Zd.group],i);t.forEach((t=>{t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n,r)})),t.encodeItems(t.items,e,this._isReentered,i)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic()})),this.emit(hc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){const s=null!=i?i:xm(this,this.markType,t);if(s)return this.emit(hc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),s.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(s,this.graphicIndex),this.emit(hc.AFTER_ADD_VRENDER_MARK,{graphicItem:s}),s}}class $m{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=S(t)?e=>e[t]:t,this._warning=e}record(t){var e,i;const s=t.grammarType,n=this._mapKey(t);return this._grammarMap[s]?(this._grammars[s].push(t),D(n)||(this._grammarMap[s][n]?null===(e=this._warning)||void 0===e||e.call(this,n,t):this._grammarMap[s][n]=t)):(this._grammars.customized.push(t),D(n)||(this._grammarMap.customized[n]?null===(i=this._warning)||void 0===i||i.call(this,n,t):this._grammarMap.customized[n]=t)),this._size+=1,this}unrecord(t){const e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((e=>e!==t)),D(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter((e=>e!==t)),D(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}getData(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}getScale(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}getCoordinate(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}getMark(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}getCustomized(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((e=>(null!=e?e:[]).forEach((e=>{t.call(null,e)}))))}find(t){let e=null;return this.traverse((i=>!0===t.call(null,i)&&(e=i,!0))),e}filter(t){const e=[];return this.traverse((i=>{!0===t.call(null,i)&&e.push(i)})),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class Xm extends $m{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),"mark"===t.grammarType){const e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach((t=>{const s=t.mark;s.markType===Qd.group&&s.includesChild(e,!1)?(t.children.push(i),i.parent=t):e.markType===Qd.group&&e.includesChild(s,!1)&&(i.children.push(t),t.parent=i)})),this._markNodes.push(i)}return this}unrecord(t){if(super.unrecord(t),"mark"===t.grammarType){const e=t,i=this._markNodes.find((t=>t.mark===e));this._markNodes.forEach((t=>{t.mark.markType===Qd.group&&t.children.includes(i)?(t.children=t.children.filter((t=>t!==i)),i.parent=null):e.markType===Qd.group&&i.children.includes(t)&&(i.children=i.children.filter((e=>e!==t)),t.parent=null)})),this._markNodes=this._markNodes.filter((t=>t!==i))}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class Km extends Gm{addGraphicItem(t,e){const i=t&&t.limitAttrs,s=xm(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?Qd.richtext:Qd.text,t);return super.addGraphicItem(t,e,s)}release(){super.release()}}Km.markType=Qd.text;const qm={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},Zm={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},Jm=Object.assign({},qm);Jm.axis=Object.assign({},Jm.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Jm.circleAxis=Object.assign({},Jm.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Jm.grid=Object.assign({},Jm.grid,{style:{stroke:"#404349"}}),Jm.circleGrid=Object.assign({},Jm.circleGrid,{style:{stroke:"#404349"}}),Jm.rectLabel=Object.assign({},Jm.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.lineLabel=Object.assign({},Jm.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.symbolLabel=Object.assign({},Jm.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.title=Object.assign({},Jm.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});const Qm={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:Zm,components:Jm},t_={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:Zm,components:qm};class e_{static registerTheme(t,e){t&&e_._themes.set(t,e)}static unregisterTheme(t){e_._themes.delete(t)}static getTheme(t){return e_._themes.get(t)}static getDefaultTheme(){return e_.getTheme("default")}}e_._themes=new Map,e_.registerTheme("default",t_),e_.registerTheme("dark",Qm);class i_ extends Gm{constructor(t,e,i,s){super(t,Qd.component,i),this._componentDatum={[$g]:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=s,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){const s=null!=i?i:fc.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return s&&(this.emit(hc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),this.graphicParent.appendChild(s),this.emit(hc.AFTER_ADD_VRENDER_MARK,{graphicItem:s})),s}join(t){return super.join(t,$g)}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum[$g]+=1}evaluateJoin(t){return this.spec.key=$g,t?(t[$g]=this._componentDatum[$g],this._componentDatum=t):this._componentDatum={[$g]:this._componentDatum[$g]},super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}const s_=Symbol.for("key");class n_{diffGrammar(t,e){return function(t,e,i){const s={enter:[],exit:[],update:[]},n=new km(t,i);return n.setCallback(((t,e,i)=>{D(e)?s.exit.push({prev:i[0]}):D(i)?s.enter.push({next:e[0]}):s.update.push({next:e[0],prev:i[0]})})),n.setCurrentData(Mm(e,i)),n.doDiff(),s}(t,e,(t=>{var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}diffMark(t,e,i){const s={enter:[],exit:[],update:[]};let n=[],r=[];t.forEach((t=>{t.markType!==Qd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?n.push(t):s.exit.push({prev:[t]})})),e.forEach((t=>{t.markType!==Qd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(t):s.enter.push({next:[t]})}));const a=this.diffUpdateByGroup(n,r,(t=>t.getMorphConfig().morphKey),(t=>t.getMorphConfig().morphKey));n=a.prev,r=a.next,s.update=s.update.concat(a.update);const o=this.diffUpdateByGroup(n,r,(t=>t.id()),(t=>t.id()));n=o.prev,r=o.next,s.update=s.update.concat(o.update);const l=Mm(n,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)})),h=Mm(r,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}));return Object.keys(h).forEach((t=>{const e=l.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t!e.includes(t))),r=r.filter((t=>!i.includes(t)))}})),n.forEach((t=>s.exit.push({prev:[t]}))),r.forEach((t=>s.enter.push({next:[t]}))),s}diffUpdateByGroup(t,e,i,s){const n=Mm(t,(t=>{var e;return null!==(e=i(t))&&void 0!==e?e:s_})),r=Mm(e,(t=>{var e;return null!==(e=s(t))&&void 0!==e?e:s_}));let a=t,o=e;const l=[];return r.keys.forEach((t=>{if(t!==s_){const e=n.data.get(t),i=r.data.get(t);e&&i&&(l.push({prev:e,next:i}),a=a.filter((t=>!e.includes(t))),o=o.filter((t=>!i.includes(t))))}})),{prev:a,next:o,update:l}}}class r_ extends(o()){static useRegisters(t){t.forEach((t=>{t()}))}constructor(t={},e={}){super(),this._observer=null,this._onResize=Kd(((...t)=>{const e=this._getContainerSize();e&&this.resize(e.width,e.height)}),100),this.delegateEvent=(t,e)=>{const i=cm(this,t,0,Ig);this.emit(e,i,t.element)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach((t=>{t.isDoingProgressive()&&t.evaluateProgressive()})),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:"browser"},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter((e=>e.name()===t))}getGrammarsByType(t){return this.grammars.filter((e=>e.grammarType===t))}getMarksByType(t){return this.grammars.getAllMarks().filter((e=>e.markType===t))}getMarksByName(t){return this.grammars.getAllMarks().filter((e=>e.name()===t))}getMarksBySelector(t){if(!t)return null;const e=Fa(t),i=[];return e.forEach((t=>{if(Xp(t))return void i.push(t);if("#"===t[0]){const e=this.getMarkById(t.slice(1));return void(e&&i.push(e))}const e="@"===t[0]?this.getMarksByName(t.slice(1)):Qd[t]?this.getMarksByType(t):null;e&&e.length&&e.forEach((t=>{i.push(t)}))})),i}updateSignal(t,e){S(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){const i=new um(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){const e=new sg(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){const e=fc.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){const e=fc.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){const s=S(e)?this.getMarkById(e):e;let n;switch(t){case Qd.group:n=new Um(this,s);break;case Qd.glyph:const e=fc.getMark(Qd.glyph);e&&(n=new e(this,null==i?void 0:i.glyphType,s));break;case Qd.component:n=fc.hasComponent(null==i?void 0:i.componentType)?fc.createComponent(null==i?void 0:i.componentType,this,s,null==i?void 0:i.mode):new i_(this,null==i?void 0:i.componentType,s,null==i?void 0:i.mode);break;case Qd.text:n=new Km(this,t,s);break;default:n=fc.hasMark(t)?fc.createMark(t,this,s):new Gm(this,t,s)}return this.grammars.record(n),this._dataflow.add(n),n}group(t){return this.mark(Qd.group,t)}glyph(t,e){return this.mark(Qd.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(Qd.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(Qd.component,t,{componentType:tc.axis,mode:e})}grid(t,e="2d"){return this.mark(Qd.component,t,{componentType:tc.grid,mode:e})}legend(t){return this.mark(Qd.component,t,{componentType:tc.legend})}slider(t){return this.mark(Qd.component,t,{componentType:tc.slider})}label(t){return this.mark(Qd.component,t,{componentType:tc.label})}datazoom(t){return this.mark(Qd.component,t,{componentType:tc.datazoom})}player(t){return this.mark(Qd.component,t,{componentType:tc.player})}title(t){return this.mark(Qd.component,t,{componentType:tc.title})}scrollbar(t){return this.mark(Qd.component,t,{componentType:tc.scrollbar})}customized(t,e){const i=fc.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find((e=>e.uid===t.uid))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){const e=S(t)?this.getGrammarById(t):t;return e&&this.grammars.find((t=>t.uid===e.uid))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}removeAllGrammars(){return this.grammars.traverse((t=>{"signal"===t.grammarType&&gm.includes(t.id())||"mark"===t.grammarType&&"root"===t.id()||this.removeGrammar(t)})),this}removeAllGraphicItems(){return this.traverseMarkTree((t=>{t.graphicItem&&(Sm(t.graphicItem),t.elementMap.forEach((t=>{t.resetGraphicItem()})),t.graphicItem=null)})),this}parseSpec(t){var e,i,s,n,r,a,o,l;if(this.emit(hc.BEFORE_PARSE_VIEW),this._spec=t,(t=>{var e;const i=(t,e)=>{var s,n;t.group=e;const r=null!==(s=t.id)&&void 0!==s?s:"VGRAMMAR_MARK_"+ ++pm;t.id=r,(null!==(n=t.marks)&&void 0!==n?n:[]).forEach((t=>i(t,r)))};(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((t=>i(t,"root")))})(t),t.theme?this.theme(t.theme):this.theme(e_.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){const t=this._getContainerSize();t&&(this.updateSignal(Fg,t.width),this.updateSignal(Yg,t.height))}(null===(s=t.signals)||void 0===s?void 0:s.length)&&t.signals.forEach((t=>{this.signal().parse(t)})),(null===(n=t.data)||void 0===n?void 0:n.length)&&t.data.forEach((t=>{this.data(null).parse(t)})),(null===(r=t.coordinates)||void 0===r?void 0:r.length)&&t.coordinates.forEach((t=>{var e;null===(e=this.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(a=t.scales)||void 0===a?void 0:a.length)&&t.scales.forEach((t=>{var e;null===(e=this.scale(t.type))||void 0===e||e.parse(t)}));const h=fc.getGrammars();return Object.keys(h).forEach((e=>{const{specKey:i}=h[e];t[i]&&t[i].length&&t[i].forEach((t=>{this.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((t=>{this.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((t=>{var e;null===(e=this.event)||void 0===e||e.call(this,t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((t=>{this.interaction(t.type,t)})),!1===t.animation?null===(o=this.animate)||void 0===o||o.disable():null===(l=this.animate)||void 0===l||l.enable(),this.emit(hc.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=lc.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){((t,e,i)=>{var s,n,r,a,o;return[{id:Fg,value:null!==(s=t[Fg])&&void 0!==s?s:0},{id:Yg,value:null!==(n=t[Yg])&&void 0!==n?n:0},{id:zg,value:mm(null!==(a=null!==(r=t[zg])&&void 0!==r?r:e[zg])&&void 0!==a?a:null==i?void 0:i.padding)},{id:jg,update:{callback:(t,e)=>{const i=mm(e[zg]);return e[Fg]-i.left-i.right},dependency:[Fg,zg]}},{id:Hg,update:{callback:(t,e)=>{const i=mm(e[zg]);return e[Yg]-i.top-i.bottom},dependency:[Yg,zg]}},{id:Ng,update:{callback:(t,e)=>{const i=mm(e[zg]);return(t||new Kt).setValue(i.left,i.top,i.left+e[jg],i.top+e[Hg])},dependency:[jg,Hg,zg]}},{id:Vg,value:null!==(o=t[Vg])&&void 0!==o?o:e[Vg]}]})(this._options,this._config,this.getCurrentTheme()).forEach((t=>{const e=this.signal().parse(t);t.value&&e.set(t.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;const i=t.type===Qd.glyph?{glyphType:t.glyphType}:t.type===Qd.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach((t=>{this.parseMarkSpec(t)}))}theme(t){var e,i,s,n,r,a;S(t)?this._theme=null!==(e=e_.getTheme(t))&&void 0!==e?e:e_.getDefaultTheme():this._theme=t;const{background:o,padding:l}=null!==(i=this._spec)&&void 0!==i?i:{};return this._theme?(this.background(null!==(s=null!=o?o:this._options.background)&&void 0!==s?s:this._theme.background),this.padding(null!==(n=null!=l?l:this._options.padding)&&void 0!==n?n:this._theme.padding),null===(a=null===(r=this.renderer.stage())||void 0===r?void 0:r.setTheme)||void 0===a||a.call(r,Object.assign({},this._theme.marks))):(this.background(null!=o?o:this._options.background),this.padding(null!=l?l:this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return this.theme(t),this.grammars.getAllMarks().forEach((t=>{t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){const e=this.getSignalById(Fg);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){const e=this.getSignalById(Yg);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){const e=this.getSignalById(jg);if(arguments.length){const e=this.padding();return this.width(t+e.left+e.right),t}return e.output()}viewHeight(t){const e=this.getSignalById(Hg);if(arguments.length){const e=this.padding();return this.height(t+e.top+e.bottom),t}return e.output()}padding(t){const e=this.getSignalById(zg);if(arguments.length){const i=mm(t);return this.updateSignal(e,i),i}return mm(e.output())}autoFit(t){const e=this.getSignalById(Vg);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){const t=this.getSignalById(Ng);return null==t?void 0:t.output()}updateLayoutTag(){return this._layoutState=lc.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){const t={},e=[];this.traverseMarkTree((i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===Qd.group&&i.updateLayoutChildren()}),(t=>t.needLayout())),this._layoutMarks=e}doLayout(){var t;const e=this._options.doLayout||fc.getDefaultLayout();e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(hc.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(hc.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(hc.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((t=>{cg(t,"layoutChildren",(t=>{t.handleLayoutEnd()}),(e=>e!==t))})),this.emit(hc.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(hc.BEFORE_MARK_RENDER_END),cg(this.rootMark,"children",(t=>{t.handleRenderEnd()})),this.emit(hc.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}doRender(t){this.emit(hc.BEFORE_DO_RENDER),this.renderer&&(!this._progressiveMarks&&this.animate?this.animate.animate():this.traverseMarkTree((t=>{t.cleanExitElements()}),null,!0),this.renderer.render(t),this.handleRenderEnd()),this.emit(hc.AFTER_DO_RENDER)}evaluate(t){var e,i;const s=(t=>{var e,i,s,n,r;const{reuse:a=qg,morph:o=Zg,morphAll:l=Jg,animation:h={},enableExitAnimation:d=Qg}=null!=t?t:{};return{reuse:a,morph:o,morphAll:l,animation:{easing:null!==(e=h.easing)&&void 0!==e?e:om,delay:null!==(i=h.delay)&&void 0!==i?i:sm,duration:null!==(s=h.duration)&&void 0!==s?s:im,oneByOne:null!==(n=h.oneByOne)&&void 0!==n?n:am,splitPath:null!==(r=h.splitPath)&&void 0!==r?r:null},enableExitAnimation:d}})(t),n=this._cachedGrammars.size()>0;n&&(this.reuseCachedGrammars(s),this.detachCachedGrammar());const r=this._resizeRenderer(),a=this._dataflow.hasCommitted();return n||a||this._layoutState||r?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=lc.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=lc.reevaluate,this._dataflow.evaluate()),this._layoutState=lc.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this.morph)||void 0===i||i.call(this,s),this.releaseCachedGrammars(s),this.doRender(!0),this.doPreProgressive(),this):this}reuseCachedGrammars(t){if(t.reuse){const t=t=>{t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),this._cachedGrammars.unrecord(t.prev)};this._differ.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((t=>!gm.includes(t.id())))).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(t)}this._differ.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((t=>"root"!==t.id())),t).update.forEach((e=>{var i;const s=1===e.prev.length&&1===e.next.length&&e.prev[0].markType===e.next[0].markType,n=e.prev.every((t=>t.getMorphConfig().morph))&&e.next.every((t=>t.getMorphConfig().morph));this.morph&&(t.morph&&n||t.morphAll)?null===(i=this.addMorphMarks)||void 0===i||i.call(this,{prev:e.prev,next:e.next}):s&&t.reuse&&(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0]))}))}detachCachedGrammar(){this._cachedGrammars.traverse((t=>{var e,i;if(t.detachAll(),"mark"===t.grammarType){const s=t;null===(i=null===(e=s.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,s)}}))}releaseCachedGrammars(t){this._cachedGrammars.traverse((t=>{"mark"!==t.grammarType&&t.release()}));const e=this._cachedGrammars.getAllMarkNodes();e.forEach((e=>{var i;null===(i=e.mark.animate)||void 0===i||i.stop(),t.enableExitAnimation&&this.animate&&this.animate.animateAddition(e.mark)}));const i=t=>{if(t.mark.view&&(!t.mark.animate||0===t.mark.animate.getAnimatorCount())&&(!t.children||0===t.children.length)){t.mark.release();const e=t.parent;e&&(t.parent.children=t.parent.children.filter((e=>e!==t)),t.parent=null,i(e))}};e.forEach((t=>{const e=t.mark;e.animate&&0!==e.animate.getAnimatorCount()?e.addEventListener("animationEnd",(()=>{e.animate&&0===e.animate.getAnimatorCount()&&i(t)})):i(t)})),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter((()=>{t.call(null,this)})),this}runBefore(t){return this._dataflow.runBefore((()=>{t.call(null,this)})),this}getImageBuffer(){var t,e;if("node"!==this._options.mode)return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));const i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return cg(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,s,n,r;if(this.autoFit()){const a=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(a){const t=window.ResizeObserver;this._observer=new t(this._onResize),null===(r=this._observer)||void 0===r||r.observe(a)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,s,n,r,a,o,l,h,d;const c=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(c){const{width:t,height:e}=ta(c);return{width:null!==(o=null!==(a=null===(r=this._spec)||void 0===r?void 0:r.width)&&void 0!==a?a:this._options.width)&&void 0!==o?o:t,height:null!==(d=null!==(h=null===(l=this._spec)||void 0===l?void 0:l.height)&&void 0!==h?h:this._options.height)&&void 0!==d?d:e}}return null}resize(t,e,i=!0){let s=!1;return t!==this.width()&&(s=!0,this.updateSignal(Fg,t)),e!==this.height()&&(s=!0,this.updateSignal(Yg,e)),s&&(i?this.evaluate({morph:!1}):this._dataflow.evaluate()),this}_resizeRenderer(){const t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}interaction(t,e){const i=fc.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){const i=this._boundInteractions.filter((i=>{var s;return D(e)?S(t)?i.type===t:t?i===t:void 0:(null===(s=i.options)||void 0===s?void 0:s.id)===e}));i.length&&i.forEach((t=>{t.unbind()}))}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach((t=>{t.unbind()})),this._boundInteractions=null),this}initializeEventConfig(t){const e=Object.assign({defaults:{}},t),i=(t,e)=>{e.forEach((e=>{y(t[e])&&(t[e]=t[e].reduce(((t,e)=>(t[e]=!0,t)),{}))}))};return i(e.defaults,["prevent","allow"]),i(e,[Ig,Bg]),e}initEvent(){const t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}releaseStageEvent(){const t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){const t=this._options.width,e=this._options.height;this.renderer=new Pg(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t,e;this.grammars=new $m((t=>t.id()),((t,e)=>this.logger.warn(`Grammar id '${t}' has been occupied`,e))),this._cachedGrammars=new Xm((t=>t.id())),this._options.logger&&g.setInstance(this._options.logger),this.logger=g.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new dg,this.animate=null===(e=this.initAnimate)||void 0===e?void 0:e.call(this,this),this._differ=new n_,this._options.hooks&&(Object.keys(this._options.hooks).forEach((t=>{this.on(t,this._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=this.initializeEventConfig(this._options.eventConfig),this._theme=this._options.disableTheme?null:e_.getDefaultTheme(),this.parseBuiltIn(),function(t){t.mode&&No.setEnv(t.mode,t.modeParams||{})}(this._options),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=lc.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){const t=[];return this.traverseMarkTree((e=>{t.push(e)}),(t=>t.markType!==Qd.group&&t.isProgressive())),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some((t=>t.isDoingProgressive()))){const t=No.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}else this._progressiveMarks&&this.animate&&this._progressiveMarks.every((t=>t.canAnimateAfterProgressive()))?this.animate.animate():this._progressiveMarks&&(this._progressiveMarks=null)}clearProgressive(){this._progressiveRafId&&No.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((t=>{t.clearProgressive()})),this._progressiveMarks=null)}release(){var t,e,i,s;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),fc.unregisterRuntimeTransforms(),g.setInstance(null),null===(t=this.animate)||void 0===t||t.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(i=null===(e=this.renderer)||void 0===e?void 0:e.release)||void 0===i||i.call(e),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(s=this._eventListeners)||void 0===s||s.forEach((t=>{t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}var a_;function o_(t){switch(t){case n["desktop-browser"]:case n["mobile-browser"]:return"browser";case n.node:case n.worker:return"node";case n.miniApp:case n["desktop-miniApp"]:return"feishu";case n.lynx:return"lynx";case n.wx:return"wx";case n.tt:return"tt";case n.harmony:return"harmony"}return"browser"}!function(t){t.data="data",t.signal="signal",t.mark="mark"}(a_||(a_={}));class l_{getVGrammarView(){return this._view}getModel(){return this._model}constructor(t,e){this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._model={[a_.signal]:{},[a_.data]:{},[a_.mark]:{}},this._compileChart=null,this.handleStageRender=()=>{var t,e;null===(e=null===(t=this._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(zd.afterRender,{chart:this._compileChart})},this._container=t,this._option=e}getRenderer(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}getCanvas(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}getStage(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}initView(){var t,e,i,s;if(this._released)return;if(this.isInited=!0,this._view)return;const n=new g(null!==(t=this._option.logLevel)&&void 0!==t?t:u.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&n.addErrorHandler(((...t)=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.onError)||void 0===i||i.call(e,...t)})),this._view=new r_(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(i=this._container.dom)&&void 0!==i?i:null,renderCanvas:null!==(s=this._container.canvas)&&void 0!==s?s:null,hooks:this._option.performanceHook},this._option),{mode:o_(this._option.mode),autoFit:!1,eventConfig:{gesture:ul(this._option.mode),disable:!1===this._option.interactive},doLayout:()=>{var t;null===(t=this._compileChart)||void 0===t||t.onLayout(this._view)},logger:n,logLevel:n.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((t=>{var e;null===(e=this._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}_setCanvasStyle(){if(this._view&&this._container.dom&&!S(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";const t=this.getCanvas();t&&(t.style.display="block")}}compileInteractions(){var t;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){const t={};this._interactions.forEach((e=>{var i;if(e.regionId){const s=`${e.regionId}-${e.type}-${null!==(i=e.id)&&void 0!==i?i:""}`,n=t[s];t[s]=n?Object.assign(Object.assign(Object.assign({},n),e),{selector:[...n.selector,...e.selector]}):e}else this._view.interaction(e.type,e)})),Object.keys(t).forEach((e=>{const i=this._view.interaction(t[e].type,t[e]);if(this._compileChart){const s=this._compileChart.getRegionsInIds([t[e].regionId])[0];s&&s.interaction.addVgrammarInteraction(i.getStartState(),i)}}))}}compile(t,e){if(this._released)return;const{chart:i}=t;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend(),this.compileInteractions())}clearNextRender(){return!!this._nextRafId&&(No.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,!0)}clear(t,e=!1){const{chart:i}=t;this.clearNextRender(),i.clear(),this.releaseGrammar(e)}renderNextTick(t){this._released||this._nextRafId||(this._nextRafId=No.getRequestAnimationFrame()((()=>{this._nextRafId=null,this.render(t)})))}render(t){var e,i;this._released||(this.initView(),this._view&&(null===(e=this._view)||void 0===e||e.run(t),this.clearNextRender()&&(null===(i=this._view)||void 0===i||i.run(t))))}updateViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}resize(t,e,i=!0){this._view&&(this._width=t,this._height=e,this._view.resize(t,e),i&&this.render({morph:!1}))}setBackground(t){var e;null===(e=this._view)||void 0===e||e.background(t)}setSize(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}setViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}addEventListener(t,e,i){var s,n;if(!1!==this._option.interactive)if(t===Nd.chart){const n=function(s,n){var r,a,o;const l=null!==(a=null===(r=null==n?void 0:n.mark)||void 0===r?void 0:r.getContext())&&void 0!==a?a:{},h=M(l.modelId)?l.modelId:null,d=M(l.markId)?l.markId:null,c=M(l.modelUserId)?l.modelUserId:null,u=M(l.markUserId)?l.markUserId:null,p={event:s,type:e,source:t,item:n,datum:(null===(o=null==n?void 0:n.getDatum)||void 0===o?void 0:o.call(n))||null,markId:d,modelId:h,markUserId:u,modelUserId:c};i.call(null,p)}.bind(this);this._viewListeners.set(i,{type:e,callback:n}),null===(s=this._view)||void 0===s||s.addEventListener(e,n)}else if(t===Nd.window){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._windowListeners.set(i,{type:e,callback:s});const n=this._getGlobalThis();null==n||n.addEventListener(e,s)}else if(t===Nd.canvas){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._canvasListeners.set(i,{type:e,callback:s});const r=null===(n=this.getStage())||void 0===n?void 0:n.window;null==r||r.addEventListener(e,s)}}removeEventListener(t,e,i){var s,n,r,a,o;if(!1!==this._option.interactive)if(t===Nd.chart){const t=null===(s=this._viewListeners.get(i))||void 0===s?void 0:s.callback;t&&(null===(n=this._view)||void 0===n||n.removeEventListener(e,t)),this._viewListeners.delete(i)}else if(t===Nd.window){const t=this._getGlobalThis(),s=null===(r=this._windowListeners.get(i))||void 0===r?void 0:r.callback;s&&(null==t||t.removeEventListener(e,s)),this._windowListeners.delete(i)}else if(t===Nd.canvas){const t=null===(a=this.getStage())||void 0===a?void 0:a.window,s=null===(o=this._canvasListeners.get(i))||void 0===o?void 0:o.callback;t&&s&&(null==t||t.removeEventListener(e,s)),this._canvasListeners.delete(i)}}releaseEvent(){const t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}release(){var t;this.clearNextRender(),this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}releaseGrammar(t=!1){var e,i;this._releaseModel(),t&&(null===(e=this._view)||void 0===e||e.removeAllGraphicItems()),null===(i=this._view)||void 0===i||i.removeAllGrammars()}_releaseModel(){Object.keys(this._model).forEach((t=>{Object.values(this._model[t]).forEach((t=>{Object.values(t).forEach((t=>{t.removeProduct(!0)}))})),this._model[t]={}}))}addGrammarItem(t){const e=t.getProduct();if(D(e))return;const i=e.id(),s=t.grammarType;D(this._model[s][i])&&(this._model[s][i]={}),this._model[s][i][t.id]=t}removeGrammarItem(t,e){var i;const s=t.getProduct();if(D(s))return;const n=s.id(),r=t.grammarType,a=this._model[r][n];M(a)&&(delete a[t.id],0===Object.keys(a).length&&delete this._model[r][n]),e||null===(i=this._view)||void 0===i||i.removeGrammar(s)}addInteraction(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}removeInteraction(t){this._interactions&&(this._interactions=this._interactions.filter((e=>e.seriesId!==t)))}updateDepend(t){return M(t)&&t.length>0?t.every((t=>t.updateDepend())):(Object.values(this._model).forEach((t=>{Object.values(t).forEach((t=>{const e=Object.values(t),i=e[0].getProduct(),s=e.reduce(((t,e)=>e.getDepend().length>0?t.concat(e.getDepend()):t),[]).filter((t=>!!t)).map((t=>t.getProduct()));i.depend(s)}))})),!0)}_getGlobalThis(){var t;return cl(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}function h_(t,e){var i,s,n,r,a;return s=this,n=void 0,a=function*(){if(!t)return"";try{if(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)return function(t){return new Promise((e=>{t.convertToBlob().then((t=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>{e(i.result)}}))}))}(t)}catch(t){(null!==(i=null==e?void 0:e.onError)&&void 0!==i?i:ml)(`getCanvasDataURL error : ${t.toString()}`)}return t.toDataURL()},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function o(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(t){t(s)}))).then(i,o)}l((a=a.apply(s,n||[])).next())}))}const d_={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},c_={poptip:E({},d_)};function u_(){u_.__loaded||(u_.__loaded=!0,aa.RegisterGraphicCreator("group",ir))}u_.__loaded=!1;const p_=u_;class g_{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,s,n,r,a,o,l){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===s||"start"===s||("center"===s?c[0]=d[0]/-2:"right"!==s&&"end"!==s||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,s,n,r)}GetLayoutByLines(t,e,i,s,n="",r,a,o="end"){t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,s=t.length;iMath.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,l,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{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(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=Kn,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return y(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ms(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new __({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:n,y:r}=e,a={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},o=Wt(a,i,{x:n,y:r});return this._OBBBounds.copy(s),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=Si.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;return o&&(wn(n,o/Math.abs(r+a),!0,l),i.union(n)),Si.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Si.graphicService.updateHTMLTextAABBBounds(t,e,i),Xt(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:m=r.fontWeight,ignoreBuf:_=r.ignoreBuf,suffixPosition:f=r.suffixPosition,heightLimit:v=0,lineClamp:b}=this.attribute,x=null!==(e=_n(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,S=_?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.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 M=Si.graphicUtil.textMeasure,k=new g_(a,{fontSize:h,fontWeight:m,fontFamily:a},M),A=y(t)?t.map((t=>t.toString())):[t.toString()],w=[],T=[0,0];let L=1/0;if(v>0&&(L=Math.max(Math.floor(v/x),1)),b&&(L=Math.min(L,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let s=0,n=A.length;s{const e=t.direction===Cn.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:p,fontFamily:g});a+=e,t.width=e})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const M=ia(b,a),k=sa(x,y,u);return this._AABBBounds.set(k,M,k+y,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,fontWeight:d=s.fontWeight,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:p=s.stroke,lineWidth:g=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:_=s.suffixPosition}=r,f=null!==(e=_n(r.lineHeight,r.fontSize||s.fontSize))&&void 0!==e?e:r.fontSize||s.fontSize;if("normal"===m)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const v=Si.graphicUtil.textMeasure,y=new g_(a,{fontSize:h,fontWeight:d,fontFamily:a},v).GetLayoutByLines(t,o,l,f,!0===c?s.ellipsis:c||void 0,!1,u,_),{bbox:b}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),r=Si.graphicUtil.textMeasure;let a;const o=this.attribute,{ignoreBuf:l=n.ignoreBuf}=o,h=l?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:p=n.fontSize,fontWeight:g=n.fontWeight,stroke:m=n.stroke,lineWidth:_=n.lineWidth,verticalMode:f=n.verticalMode,suffixPosition:v=n.suffixPosition}=o,y=null!==(e=_n(o.lineHeight,o.fontSize||n.fontSize))&&void 0!==e?e:(o.fontSize||n.fontSize)+h;let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!f){const t=b;b=null!==(i=__.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(s=__.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=ut(e,a)}));const t=ia(b,a),e=this.cache.verticalList.length*y,i=sa(x,e,p);return this._AABBBounds.set(i,t,i+e,t+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}const S=t.map((t=>En(t.toString())));S.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,s=r.clipTextWithSuffixVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,i,!1,v);S[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,!1);S[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Cn.HORIZONTAL?p:r.measureTextWidth(t.text,{fontSize:p,fontWeight:g,fontFamily:u});a+=e,t.width=e}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const M=ia(b,a),k=this.cache.verticalList.length*y,A=sa(x,k,p);return this._AABBBounds.set(A,M,A+k,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}needUpdateTags(t,e=m_){return super.needUpdateTags(t,e)}needUpdateTag(t,e=m_){return super.needUpdateTag(t,e)}clone(){return new __(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return __.NOWORK_ANIMATE_ATTR}}function f_(t){return new __(t)}let v_,y_;function b_(t){return v_||(v_=aa.CreateGraphic("text",{})),v_.initAttributes(t),v_.AABBBounds}__.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},kn),__.baselineMapAlign={top:"left",bottom:"right",middle:"center"},__.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const x_=new class extends go{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){var u,p,g,m,_,f,v,y,b,x;const{backgroundMode:S=l.backgroundMode,backgroundFit:M=l.backgroundFit}=t.attribute;let k,{background:A}=t.attribute;if(!A)return;const w=()=>{"richtext"===t.type&&(e.restore(),e.save(),k&&e.setTransformFromMatrix(k,!0,1))};let T;"richtext"===t.type&&(k=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const L=bs(A)&&A.background,C=t.transMatrix.onlyTranslate();if(L){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(p=A.dx)&&void 0!==p?p:0),s=(null!==(g=A.y)&&void 0!==g?g:e.y1)+(null!==(m=A.dy)&&void 0!==m?m:0),n=null!==(_=A.width)&&void 0!==_?_:e.width(),r=null!==(f=A.height)&&void 0!==f?f:e.height();if(T=Ra.allocate(i,s,i+n,s+r),A=A.background,!C){const t=T.width(),e=T.height();T.set((null!==(v=A.x)&&void 0!==v?v:0)+(null!==(y=A.dx)&&void 0!==y?y:0),(null!==(b=A.y)&&void 0!==b?b:0)+(null!==(x=A.dy)&&void 0!==x?x:0),t,e)}}else T=t.AABBBounds,C||(T=b_(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 n=t.resources.get(A);if("success"!==n.state||!n.data)return void w();e.highPerformanceSave(),C&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,T,S,M),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=A,n?(Ga(e,T.x1,T.y1,T.width(),T.height(),n),e.fill()):e.fillRect(T.x1,T.y1,T.width(),T.height()),e.highPerformanceRestore()}L&&Ra.free(T),w()}};var S_=function(t,e){return function(i,s){e(i,s,t)}};let M_=class extends xo{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Kn,this.builtinContributions=[x_],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=ms(t,null==r?void 0:r.theme).text,{text:u,underline:p=c.underline,lineThrough:g=c.lineThrough,keepDirIn3d:m=c.keepDirIn3d,direction:_=c.direction,fontSize:f=c.fontSize,verticalMode:v=c.verticalMode,x:y=c.x,y:b=c.y}=t.attribute;let{textAlign:x=c.textAlign,textBaseline:S=c.textBaseline}=t.attribute;if(!v&&"vertical"===_){const e=x;x=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const M=null!==(d=_n(t.attribute.lineHeight,f))&&void 0!==d?d:f,k=this.valid(t,c,a,o);if(!k)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:L}=k,C=!m,E=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,T,L,A,w,c,n,a,o),C&&this.transformUseContext2d(t,c,E,e);const D=(n,r,l,h)=>{let d=i+r;const u=s+l;if(h){e.highPerformanceSave(),d+=f;const t=Gr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),Gr.free(t)}L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),e.strokeText(n,d,u,E))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),e.fillText(n,d,u,E),this.drawUnderLine(p,g,t,d,u,E,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,E),"horizontal"===_){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,E)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((n=>{var a;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,E),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s-(a=f,"top"=="bottom"?Math.ceil(.79*a):Math.round(-.21*a))-.05*f,E,c,e,{width:n.width})}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:s}=i;e.textAlign="left",e.textBaseline="top";const n=M*s.length;let r=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=ut(e,r)}));let a=0,o=0;"bottom"===S?o=-n:"middle"===S&&(o=-n/2),"center"===x?a-=r/2:"right"===x&&(a-=r),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=r-i;let l=a;"center"===x?l+=s/2:"right"===x&&(l+=s),t.forEach((t=>{const{text:i,width:s,direction:r}=t;D(i,n-(e+1)*M+o,l,r),l+=s}))}))}else if("horizontal"===_){e.setTextStyle(t.attribute,c,E);const i=t.clipedText;let s=0;M!==f&&("top"===S?s=(M-f)/2:"middle"===S||"bottom"===S&&(s=-(M-f)/2)),D(i,0,s,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,E);const{verticalList:s}=i;let n=0;const r=s[0].reduce(((t,e)=>t+(e.width||0)),0);let a=0;"bottom"===S?a=-M:"middle"===S&&(a=-M/2),"center"===x?n-=r/2:"right"===x&&(n-=r),e.textAlign="left",e.textBaseline="top",s[0].forEach((t=>{const{text:e,width:i,direction:s}=t;D(e,a,n,s),n+=i}))}}C&&this.restoreTransformUseContext2d(t,c,E,e),this.afterRenderStep(t,e,i,s,T,L,A,w,c,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:d=a.textBaseline,fontSize:c=a.fontSize,fill:u=a.fill,opacity:p=a.opacity,underlineOffset:g=a.underlineOffset,underlineDash:m=a.underlineDash,fillOpacity:_=a.fillOpacity}=i.attribute,f=!D(l),v=f?l.width:i.clipedWidth,y=f?0:ia(h,v),b=sa(f?"alphabetic":d,c,c),x={lineWidth:0,stroke:u,opacity:p,strokeOpacity:_};let S=f?-3:0;if(t){x.lineWidth=t,o.setStrokeStyle(i,x,s,n,a),m&&o.setLineDash(m),o.beginPath();const e=n+b+c+g+S;o.moveTo(s+y,e,r),o.lineTo(s+y+v,e,r),o.stroke()}if(f&&(S=-1),e){x.lineWidth=e,o.setStrokeStyle(i,x,s,n,a),o.beginPath();const t=n+b+c/2+S;o.moveTo(s+y,t,r),o.lineTo(s+y+v,t,r),o.stroke()}}};M_=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}([V(),S_(0,$(K)),S_(0,X(co)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],M_);let k_=!1;const A_=new I((t=>{k_||(k_=!0,t(wr).to(M_).inSingletonScope(),t(vr).toService(wr),t(co).toService(_o),Z(t,co))})),w_=ll(),T_=Symbol.for("MathPickerContribution"),L_=Symbol.for("MathArcPicker"),C_=Symbol.for("MathAreaPicker"),E_=Symbol.for("MathCirclePicker"),D_=Symbol.for("MathImagePicker"),P_=Symbol.for("MathLinePicker"),O_=Symbol.for("MathPathPicker"),R_=Symbol.for("MathRectPicker"),B_=Symbol.for("MathSymbolPicker"),I_=Symbol.for("MathTextPicker"),F_=Symbol.for("MathPolygonPicker"),Y_=Symbol.for("MathGlyphPicker"),j_=Symbol.for("CanvasArcPicker"),H_=Symbol.for("CanvasArc3dPicker"),z_=Symbol.for("CanvasAreaPicker"),N_=Symbol.for("CanvasCirclePicker"),V_=Symbol.for("CanvasImagePicker"),W_=Symbol.for("CanvasLinePicker"),G_=Symbol.for("CanvasPathPicker"),U_=Symbol.for("CanvasRectPicker"),$_=Symbol.for("CanvasRect3dPicker"),X_=Symbol.for("CanvasSymbolPicker"),K_=Symbol.for("CanvasTextPicker"),q_=Symbol.for("CanvasPolygonPicker"),Z_=Symbol.for("CanvasPyramid3dPicker"),J_=Symbol.for("CanvasRichTextPicker"),Q_=Symbol.for("CanvasGlyphPicker"),tf=Symbol.for("CanvasGroupPicker"),ef=Symbol.for("CanvasPickerContribution");class sf extends xo{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 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=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ur.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let nf=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Kn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:d,z:c,lastModelMatrix:u}=l;this.canvasRenderer.z=c;let p=e;if(s.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,s,h,d,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),m=l.width(),_=sa(a,u,n),f=ia(o,m);return e.rect(f+h,_+d,m,u,c),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==u&&Ur.free(s.modelMatrix),s.modelMatrix=u,s.highPerformanceRestore(),g}};nf=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(wr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],nf);let rf=!1;const af=new I(((t,e,i,s)=>{rf||(rf=!0,t(K_).to(nf).inSingletonScope(),t(ef).toService(K_))}));let of=class{constructor(){this.type="text",this.numberType=Kn}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};of=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}([V()],of);let lf=!1;const hf=new I(((t,e,i,s)=>{lf||(lf=!0,t(I_).to(of).inSingletonScope(),t(T_).toService(I_))}));function df(){df.__loaded||(df.__loaded=!0,aa.RegisterGraphicCreator("text",f_),Xi.load(A_),Xi.load(w_?af:hf))}df.__loaded=!1;const cf=df;class uf{bounds(t,e){if(h(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}}function pf(t,e,i,s,n){return n?t.arc(i,s,e,0,ot,!1,n):t.arc(i,s,e,0,ot),!1}const gf=new class extends uf{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 pf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return pf(t,e/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=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`}},mf=new class extends uf{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,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,e/6,i,s,n,r)}};function _f(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}const ff=new class extends uf{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 _f(t,e/2,i,s,n)}drawFitDir(t,e,i,s,n){return _f(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return _f(t,e/2+n,i,s,r)}};function vf(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}const yf=new class extends uf{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return vf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return vf(t,e/2+n,i,s)}};function bf(t,e,i,s,n=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 xf extends uf{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 bf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return bf(t,e/2,i,s,n)}}const Sf=new xf,Mf=new class extends xf{constructor(){super(...arguments),this.type="triangle"}},kf=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Af=Math.sin(ot/10)*kf,wf=-Math.cos(ot/10)*kf;function Tf(t,e,i,s){const n=Af*e,r=wf*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=ot*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}const Lf=new class extends uf{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 Tf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Tf(t,e/2+n,i,s)}},Cf=mt(3);function Ef(t,e,i,s){const n=e,r=n/Cf,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}const Df=new class extends uf{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 Ef(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Ef(t,e/2+n,i,s)}};function Pf(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}const Of=new class extends uf{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Pf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Pf(t,e/2+n,i,s)}};function Rf(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}const Bf=new class extends uf{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Rf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Rf(t,e/2+n,i,s)}},If=-.5,Ff=mt(3)/2,Yf=1/mt(12);function jf(t,e,i,s){const n=e/2,r=e*Yf,a=n,o=e*Yf+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(If*n-Ff*r+i,Ff*n+If*r+s),t.lineTo(If*a-Ff*o+i,Ff*a+If*o+s),t.lineTo(If*l-Ff*h+i,Ff*l+If*h+s),t.lineTo(If*n+Ff*r+i,If*r-Ff*n+s),t.lineTo(If*a+Ff*o+i,If*o-Ff*a+s),t.lineTo(If*l+Ff*h+i,If*h-Ff*l+s),t.closePath(),!1}const Hf=new class extends uf{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 jf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return jf(t,e/2+n,i,s)}};function zf(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}const Nf=new class extends uf{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 zf(t,e/2,i,s,0)}drawOffset(t,e,i,s,n){return zf(t,e/2,i,s,n)}};function Vf(t,e,i,s,n=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}const Wf=new class extends uf{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 Vf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Vf(t,e/2,i,s,n)}};function Gf(t,e,i,s,n=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}const Uf=new class extends uf{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 Gf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Gf(t,e/2,i,s,n)}},$f=mt(3);function Xf(t,e,i,s){const n=e*$f;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}const Kf=new class extends uf{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Xf(t,e/2/$f,i,s)}drawOffset(t,e,i,s,n){return Xf(t,e/2/$f+n,i,s)}};function qf(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}const Zf=new class extends uf{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 qf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return qf(t,e/4+n,i,s)}};function Jf(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}const Qf=new class extends uf{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 Jf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Jf(t,e/4+n,i,s)}};function tv(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}const ev=new class extends uf{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 tv(t,e/4,i,s)}drawOffset(t,e,i,s,n){return tv(t,e/4+n,i,s)}};function iv(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}const sv=new class extends uf{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 iv(t,e/4,i,s)}drawOffset(t,e,i,s,n){return iv(t,e/4+n,i,s)}};function nv(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}const rv=new class extends uf{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return nv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return nv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function av(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}const ov=new class extends uf{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return av(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return av(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function lv(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}const hv=new class extends uf{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 lv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return lv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function dv(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function cv(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}const uv=new class extends uf{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return h(e)?cv(t,e,i,s):dv(t,e,i,s)}drawOffset(t,e,i,s,n){return h(e)?cv(t,e+2*n,i,s):dv(t,[e[0]+2*n,e[1]+2*n],i,s)}},pv={};[gf,mf,ff,yf,Kf,Mf,Lf,Df,Of,Bf,Hf,Nf,Wf,Sf,Uf,Zf,Qf,ev,sv,uv,rv,ov,hv].forEach((t=>{pv[t.type]=t}));const gv={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"},mv=new qt;class _v{constructor(t,e,i=!1){this.pathStr="",this.type=t,y(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),ye(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(ye(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return this.drawOffset(t,e,i,s,0,n,r)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{mv.x1=i.bounds.x1*t,mv.y1=i.bounds.y1*t,mv.x2=i.bounds.x2*t,mv.y2=i.bounds.y2*t,e.union(mv)}))}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)}}class fv{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 vv(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function yv(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r",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=yv(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=vv(t,"--\x3e",r+4,"Comment is not closed.");else{const a=yv(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,d=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 fv(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 fv(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=d}else s+=t[r];return e.child}}function Sv(t,e){return Mv(t)}function Mv(t,e){const i={};for(let n=0;n{const e=(new Ze).fromString(t.d),i={};Qn.forEach((e=>{t[e]&&(i[Jn[e]]=t[e])})),n.push({path:e,attribute:i}),Tv.union(e.bounds)}));const r=Tv.width(),a=Tv.height(),o=1/ut(r,a);return n.forEach((t=>t.path.transform(0,0,o,o))),this._parsedPath=new _v(e,n,!0),Cv.userSymbolMap[e]=this._parsedPath,this._parsedPath}var s;const n=(new Ze).fromString(e),r=n.bounds.width(),a=n.bounds.height(),o=1/ut(r,a);return n.transform(0,0,o,o),this._parsedPath=new _v(e,n),Cv.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return ms(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}=Si.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;wn(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 Si.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(y(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Lv)}needUpdateTag(t){return super.needUpdateTag(t,Lv)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=y(e)?e:[e,e];return t.path?(new Ze).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ze).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new Cv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cv.NOWORK_ANIMATE_ATTR}}function Ev(t){return new Cv(t)}Cv.userSymbolMap={},Cv.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},kn);const Dv=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,m=p&&!1!==p.visible,_=g&&!1!==g.visible;if(!m&&!_)return;const{size:f=l.size,opacity:v=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY}=t.attribute,M=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Pa(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,f,i,s,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(y-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};m&&M(p,"outerBorder"),_&&M(g,"innerBorder")}},Pv=Eo,Ov=mo;var Rv=function(t,e){return function(i,s){e(i,s,t)}};let Bv=class extends xo{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Xn,this.builtinContributions=[Dv,Ov,Pv],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=ms(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY}=t.attribute,m=this.valid(t,h,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:b}=m,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:S=h.keepDirIn3d}=t.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const k=(n,r)=>{var l,d,m;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(m=r.stroke)&&void 0!==m?m:t.attribute.stroke,r=e}r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-s,h),e.fill())),r.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/p,(u-s)/g,h),e.stroke()))};if(S&&e.camera&&e.project){const t=e.project(i,s,M),n=e.camera;e.camera=null,!1===x.draw(e,y(d)?[d[0]*p,d[1]*g]:d*p,t.x,t.y,void 0,k)&&e.closePath(),e.camera=n}else!1===x.draw(e,d,i,s,M,k)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,v,b,_,f,h,n,a,o),v&&!x.isSvg&&(a?a(e,t.attribute,h):_&&(e.setCommonStyle(t,t.attribute,c-i,u-s,h),e.fill())),b&&!x.isSvg&&(o?o(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,(c-i)/p,(u-s)/g,h),e.stroke())),this.afterRenderStep(t,e,i,s,v,b,_,f,h,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Bv=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}([V(),Rv(0,$(K)),Rv(0,X(ho)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Bv);let Iv=!1;const Fv=new I((t=>{Iv||(Iv=!0,t(Bv).toSelf().inSingletonScope(),t(Ar).to(Bv).inSingletonScope(),t(vr).toService(Ar),t(ho).toService(_o),Z(t,ho))}));let Yv=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Xn}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:d}=a;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=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Pa(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==d&&Ur.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),u}};Yv=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yv);let jv=!1;const Hv=new I(((t,e,i,s)=>{jv||(jv=!0,t(X_).to(Yv).inSingletonScope(),t(ef).toService(X_))}));class zv{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;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;return s.lineWidth=Pa(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}let Nv=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Xn}};Nv=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Nv);let Vv=!1;const Wv=new I(((t,e,i,s)=>{Vv||(Vv=!0,t(B_).to(Nv).inSingletonScope(),t(T_).toService(B_))}));function Gv(){Gv.__loaded||(Gv.__loaded=!0,aa.RegisterGraphicCreator("symbol",Ev),Xi.load(Fv),Xi.load(w_?Hv:Wv))}Gv.__loaded=!1;const Uv=Gv,$v=(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)}return i},Xv=["width","x1","y1","height","cornerRadius",...yn];class Kv extends An{constructor(t){super(t),this.type="rect",this.numberType=Gn}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ms(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Xv)}needUpdateTag(t){return super.needUpdateTag(t,Xv)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=D(t.width)?t.x1-t.x:t.width,i=D(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),r=new Ze;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Kv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kv.NOWORK_ANIMATE_ATTR}}function qv(t){return new Kv(t)}Kv.NOWORK_ANIMATE_ATTR=kn;var Zv=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};class Jv{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{cornerRadius:_=l.cornerRadius,opacity:f=l.opacity,x:v=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY,x1:M,y1:k}=t.attribute;let{width:A,height:w}=t.attribute;A=(null!=A?A:M-i)||0,w=(null!=w?w:k-s)||0;const T=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,d=Pa(e,h,e.dpr),u=i+o*d,p=s+o*d,g=2*d;if(0===_||y(_)&&_.every((t=>0===t))?(e.beginPath(),e.rect(u,p,A-o*g,w-o*g)):(e.beginPath(),Ga(e,u,p,A-o*g,w-o*g,_)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=f,e.setStrokeStyle(t,n,(v-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder")}}let Qv=class{constructor(){this.time=me.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Qv=Zv([V()],Qv);let ty=class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{x1:u,y1:p,x:g=l.x,y:m=l.y,stroke:_=l.stroke,cornerRadius:f=l.cornerRadius}=t.attribute;let{width:v,height:b}=t.attribute;if(v=(null!=v?v:u-g)||0,b=(null!=b?b:p-m)||0,Array.isArray(_)&&_.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===f||y(f)&&f.every((t=>0===t)))){let n,r=0;return Ga(e,i,s,v,b,f,new Array(4).fill(0).map(((a,o)=>(a,h,d,c)=>{_[o]&&(r===o-1&&_[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:_[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=_[o]),r=o,e.lineTo(d,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),_[0]?e.lineTo(i+v,s):e.moveTo(i+v,s),_[1]?e.lineTo(i+v,s+b):e.moveTo(i+v,s+b),_[2]?e.lineTo(i,s+b):e.moveTo(i,s+b),_[3]){const t=_[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};ty=Zv([V()],ty);const ey=new Jv,iy=Eo,sy=mo;var ny=function(t,e){return function(i,s){e(i,s,t)}};let ry=class extends xo{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Gn,this.builtinContributions=[ey,sy,iy],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:ms(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:_=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:v=h.visible,x1:b,y1:x,x:S=h.x,y:M=h.y}=t.attribute;let{width:k,height:A}=t.attribute;k=(null!=k?k:b-S)||0,A=(null!=A?A:x-M)||0;const w=Ka(g,m,k,A,d),T=Za(g,f,k,A),L=Ua(d,c),C=$a(u,_);if(!t.valid||!v)return;if(!L&&!C)return;if(!(w||T||a||o||c))return;0===p||y(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,s,k,A)):(e.beginPath(),Ga(e,i,s,k,A,p));const E={doFill:L,doStroke:C};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,L,C,w,T,h,n,a,o,E),E.doFill&&(a?a(e,t.attribute,h):w&&(e.setCommonStyle(t,t.attribute,S-i,M-s,h),e.fill())),E.doStroke&&(o?o(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,S-i,M-s,h),e.stroke())),this.afterRenderStep(t,e,i,s,L,C,w,T,h,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};ry=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}([V(),ny(0,$(K)),ny(0,X(lo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ry);let ay=!1;const oy=new I((t=>{ay||(ay=!0,t(ry).toSelf().inSingletonScope(),t(Mr).to(ry).inSingletonScope(),t(vr).toService(Mr),t(ty).toSelf(),t(Qv).toSelf(),t(lo).toService(ty),t(lo).toService(Qv),t(lo).toService(_o),Z(t,lo))})),ly=new qt;class hy{constructor(){this.type="rect",this.numberType=Gn}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;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let d=!0;if(!l||t.shadowRoot||h(r,!0)&&0!==r||y(r)&&r.some((t=>0!==t)))d=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!d||(d=t.isPointInPath(e.x,e.y),d)),((t,i,n)=>{if(d)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=Pa(s,r+a,s.dpr),d=t.isPointInStroke(e.x,e.y),d}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)d=!0;else if(s){const i=t.AABBBounds;ly.setValue(i.x1,i.y1,i.x2,i.y2),ly.expand(-r/2),d=!ly.containsPoint(e)}}return s.highPerformanceRestore(),d}}let dy=class extends hy{constructor(t){super(),this.canvasRenderer=t}};dy=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],dy);let cy=!1;const uy=new I(((t,e,i,s)=>{cy||(cy=!0,t(U_).to(dy).inSingletonScope(),t(ef).toService(U_))}));let py=class extends hy{constructor(t){super(),this.canvasRenderer=t}};py=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],py);let gy=!1;const my=new I(((t,e,i,s)=>{gy||(gy=!0,t(R_).to(py).inSingletonScope(),t(T_).toService(R_))}));function _y(){_y.__loaded||(_y.__loaded=!0,aa.RegisterGraphicCreator("rect",qv),Xi.load(oy),Xi.load(w_?uy:my))}_y.__loaded=!1;const fy=_y;function vy(t){t.crosshair=Fa(t.crosshair||{}).map((e=>Ll({["horizontal"===t.direction?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},e)))}function yy(t,e,i){var s;const{width:n,height:r}=t;if(M(n)&&M(r))return{width:n,height:r};let a=i.width,o=i.height;const l=e.container,h=e.canvas;if(l){const{width:t,height:e}=ta(l,i.width,i.height);a=t,o=e}else if(h&&cl(e.mode)){let t;t=S(h)?No.getElementById(h):h;const{width:e,height:s}=ta(t,i.width,i.height);a=e,o=s}else if(pl(e.mode)&&(null===(s=e.modeParams)||void 0===s?void 0:s.domref)){const t=e.modeParams.domref;a=t.width,o=t.height}return a=null!=n?n:a,o=null!=r?r:o,{width:a,height:o}}function by(t,...e){const i=i=>e.reduce(((t,e)=>t||(null==e?void 0:e[i])),t[i]);return Object.assign(t,{change:i("change"),reCompile:i("reCompile"),reMake:i("reMake"),reRender:i("reRender"),reSize:i("reSize"),reTransformSpec:i("reTransformSpec"),changeTheme:i("changeTheme"),changeBackground:i("changeBackground")}),t}function xy(t,e){return"line"===t||"area"===t||"common"===t&&e.series.every((t=>"area"===t.type||"line"===t.type))?{paddingInner:1,paddingOuter:0}:{paddingOuter:0}}var Sy,My,ky;(ky=Sy||(Sy={})).STATE_NORMAL="normal",ky.STATE_HOVER="hover",ky.STATE_HOVER_REVERSE="hover_reverse",ky.STATE_DIMENSION_HOVER="dimension_hover",ky.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",ky.STATE_SELECTED="selected",ky.STATE_SELECTED_REVERSE="selected_reverse",ky.STATE_SANKEY_EMPHASIS="selected",ky.STATE_SANKEY_EMPHASIS_REVERSE="blur",function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(My||(My={}));class Ay{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){D(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,E({},Ay.defaultMarkInfo,e)))}removeMark(t){const e=this._children.findIndex((e=>e.name===t));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}clear(){this._children=[],this._markNameMap={},this._infoMap.clear()}forEach(t){this._children.forEach(t)}includes(t,e){return this._children.includes(t,e)}get(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}getMarks(){return this._children.slice()}getMarksInType(t){const e=Fa(t);return this._children.filter((t=>e.includes(t.type)))}getMarkInId(t){return this._children.find((e=>e.id===t))}getMarkWithInfo(t){return this._children.find((e=>Object.keys(t).every((i=>t[i]===this._infoMap.get(e)[i]))))}}Ay.defaultMarkInfo={};class wy{get hover(){return this._hover}get select(){return this._select}constructor(t){this._marks=new Ay,this._markReverse=new Ay,this.onHover=t=>{switch(t.action){case"enter":this.interaction.getEventElement(Sy.STATE_DIMENSION_HOVER).forEach((t=>this.interaction.addEventElement(Sy.STATE_DIMENSION_HOVER_REVERSE,t))),this.interaction.clearEventElement(Sy.STATE_DIMENSION_HOVER,!1),this.getEventElement(t).forEach((t=>this.interaction.addEventElement(Sy.STATE_DIMENSION_HOVER,t))),this.interaction.reverseEventElement(Sy.STATE_DIMENSION_HOVER);break;case"leave":this.interaction.clearEventElement(Sy.STATE_DIMENSION_HOVER,!0),t=null}},this._option=t,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=t.interaction,this.initConfig(t.mode)}setStateKeys(t){}registerMark(t){jm(t.stateStyle[Sy.STATE_DIMENSION_HOVER])||this._marks.addMark(t),jm(t.stateStyle[Sy.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}init(){this.initEvent()}release(){this.releaseEvent()}initEvent(){this.event.on(Kh.dimensionHover,this.onHover)}releaseEvent(){this.event.release()}initConfig(t){}getEventElement(t,e=!1){const i=[];return t.dimensionInfo.forEach((t=>{t.data.forEach((t=>{(e?this._markReverse:this._marks).getMarks().filter((e=>e.model===t.series&&e.getVisible())).forEach((s=>{const n=s.getProduct();if(!n||!n.elements)return;const r=n.elements.filter((i=>{const s=i.getDatum();let n;return n=y(s)?s.every(((e,i)=>e===t.datum[i])):t.datum.some((t=>t===s)),e?!n:n}));i.push(...r)}))}))})),i}}const Ty={};Object.values(Sy).forEach((t=>{Ty[t]=!0}));const Ly={[Sy.STATE_HOVER]:Sy.STATE_HOVER_REVERSE,[Sy.STATE_SELECTED]:Sy.STATE_SELECTED_REVERSE,[Sy.STATE_DIMENSION_HOVER]:Sy.STATE_DIMENSION_HOVER_REVERSE};function Cy(t){return Ly[t]}class Ey{constructor(){this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}addVgrammarInteraction(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}static markStateEnable(t,e){return!jm(t.stateStyle[e])}setDisableActiveEffect(t){this._disableTriggerEvent=t}registerMark(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(i=this._stateMarks.get(t))||void 0===i||i.push(e)}getStateMark(t){return this._stateMarks.get(t)}filterEventMark(t,e){var i;return!(!t.mark||!(null===(i=this._stateMarks.get(e))||void 0===i?void 0:i.includes(t.mark)))}getEventElement(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}getEventElementData(t){return this.getEventElement(t).map((t=>t.getDatum()))}exchangeEventElement(t,e){var i;if(this._disableTriggerEvent)return;const s=Cy(t);null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t),s&&this.addEventElement(s,e)})),e.getStates().includes(t)||(e.addState(t),s&&e.removeState(s)),this._stateElements.set(t,[e])}removeEventElement(t,e){var i,s;if(this._disableTriggerEvent)return;e.removeState(t);const n=null!==(s=null===(i=this._stateElements.get(t))||void 0===i?void 0:i.filter((t=>t!==e)))&&void 0!==s?s:[];this._stateElements.set(t,n);const r=Cy(t);r&&(0===n.length?this.clearEventElement(r,!1):this.addEventElement(r,e))}addEventElement(t,e){var i;if(this._disableTriggerEvent)return;e.getStates().includes(t)||e.addState(t);const s=null!==(i=this._stateElements.get(t))&&void 0!==i?i:[];s.push(e),this._stateElements.set(t,s)}clearEventElement(t,e){var i;if(!this._disableTriggerEvent&&(null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t)})),this._stateElements.set(t,[]),e)){const e=Cy(t);e&&this.clearEventElement(e,!1)}}clearAllEventElement(){if(!this._disableTriggerEvent)for(const[t,e]of this._stateElements)e.forEach((t=>{t.clearStates()})),this._stateElements.set(t,[])}reverseEventElement(t){if(this._disableTriggerEvent)return;const e=Cy(t);if(!e)return;const i=this.getStateMark(e);if(!i)return;const s=this.getEventElement(t);s.length&&(this.getEventElement(e).length||(1===s.length?i.forEach((t=>{t.getProduct().elements.filter((t=>t!==s[0])).forEach((t=>{this.addEventElement(e,t)}))})):i.forEach((t=>{t.getProduct().elements.filter((t=>!s.includes(t))).forEach((t=>{this.addEventElement(e,t)}))}))))}startInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.start(e)}))}resetInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.reset(e)}))}resetAllInteraction(){for(const[t,e]of this._vgrammarInteractions)e&&e.forEach((t=>{t.reset(null)}))}}var Dy,Py,Oy;!function(t){t[t.SeriesGroup=0]="SeriesGroup",t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(Dy||(Dy={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(Py||(Py={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.User_SeriesStyle=9]="User_SeriesStyle",t[t.Built_In=99]="Built_In"}(Oy||(Oy={}));class Ry{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getVGrammarView(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}release(){this._option=null,this.getCompiler=null}}class By extends Ry{constructor(){super(...arguments),this.id=qo(),this._compiledProductId=null,this._depend=[]}getProduct(){if(M(this._product))return this._product;const t=this.getVGrammarView(),e=this.getProductId();return M(e)&&M(t)&&(this._product=this._lookupGrammar(e)),this._product}getProductId(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}getDepend(){return this._depend}setDepend(...t){this._depend=t}compile(t){this._compileProduct(t),this._afterCompile(t)}_afterCompile(t){var e;M(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}updateDepend(){if(M(this._product)){const t=this.getDepend().map((t=>t.getProduct())).filter(M);return this._product.depend(t),t.length===this.getDepend().length}return!1}release(){this.removeProduct(),super.release(),this._depend=[]}removeProduct(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}class Iy extends By{getValue(){return this._value}getUpdateFunc(){return this._updateFunc}constructor(t,e,i,s){super(t),this.grammarType=a_.signal,this.name=e,this._value=i,this._updateFunc=s}updateSignal(t,e){this._value=t,this._updateFunc=e,this.compile()}_compileProduct(){const t=this.getVGrammarView();if(t){if(!this.getProduct()){const e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}M(this._value)&&this._product.value(this._value),M(this._updateFunc)&&this._product.update(this._updateFunc)}}generateProductId(){return this.name}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}class Fy extends Ry{constructor(){super(...arguments),this._signalMap={}}getSignalMap(){return this._signalMap}getSignal(t){return this._signalMap[t]}updateSignal(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new Iy(this._option,t,e,i),this._signalMap[t].compile())}compile(){Object.values(this._signalMap).forEach((t=>{t.compile()}))}release(){super.release(),Object.values(this._signalMap).forEach((t=>{t.release()})),this._signalMap={}}}class Yy extends Fy{getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),t.stateKeyToSignalName?this.stateKeyToSignalName=t.stateKeyToSignalName:this.stateKeyToSignalName=()=>"state_signal",this.initStateMap()}initStateMap(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}compile(t){const e=null!=t?t:this._stateMap;Object.keys(e).forEach((t=>{const i=this.stateKeyToSignalName(t),s=e[t];this.updateSignal(i,s)}))}updateState(t,e){if(t&&(E(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}class jy extends Yy{constructor(){super(...arguments),this.id=qo(),this.stateKeyToSignalName=t=>`${nh}_animate_${this.id}_${t}`}getAnimationStateSignalName(){return this.stateKeyToSignalName("animationState")}updateAnimateState(t,e){t===Np.update?this.updateState({animationState:{callback:(t,e)=>e.diffState}},e):t===Np.appear?this.updateState({animationState:{callback:(t,e)=>"exit"===e.diffState?Np.none:Np.appear}},e):this.updateState({animationState:{callback:(e,i)=>t}},e)}_getDefaultStateMap(){return{animationState:{callback:(t,e)=>"exit"===e.diffState?Np.exit:"update"===e.diffState?Np.update:Np.appear}}}}class Hy{constructor(t){this._option=t,this.type=t.type}_initTheme(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}getTheme(t,e){}transformSpec(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);const s=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(s.spec,e,i),s}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>Ll({},i,s,t);return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}const zy=(t,e,i)=>{if(D(e))return t;const s=e[0];return D(s)?t:1===e.length?(t[s]=i,t):(D(t[s])&&("number"==typeof e[1]?t[s]=[]:t[s]={}),zy(t[s],e.slice(1),i))};class Ny extends Ry{getSpec(){return this._spec||{}}getSpecPath(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}getSpecInfoPath(){var t,e,i;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(i=this._option)||void 0===i?void 0:i.specPath}getData(){return this._data}get layout(){return this._layout}getOption(){return this._option}getMarks(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}getMarkNameMap(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}getMarkSet(){return this._marks}getChart(){return this._option.getChart()}get _theme(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}constructor(t,e){var i;super(e),this.transformerConstructor=Hy,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this.specKey="",this._marks=new Ay,this._lastLayoutRect=null,this.id=qo(),this.userId=t.id,this._spec=t,this.effect={},this.event=new Gd(e.eventDispatcher,e.mode),null===(i=e.map)||void 0===i||i.set(this.id,this)}_releaseEvent(){this.event.release()}created(){this.setAttrFromSpec()}init(t){}afterInit(){}getVisible(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}onLayoutStart(t,e,i){var s;null===(s=this._layout)||void 0===s||s.onLayoutStart(t,e,i)}onLayoutEnd(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((t=>t.updateLayoutState(!0,!0)))}onEvaluateEnd(t){}onDataUpdate(){}beforeRelease(){}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((t=>t.release())),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),super.release()}updateSpec(t){const e=this._compareSpec(t,this._spec);return this._spec=t,e}_compareSpec(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}reInit(t){t&&(this._spec=t),this.setAttrFromSpec()}updateLayoutAttribute(){}setAttrFromSpec(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,s){M(t)&&M(e)&&t.setStyle(this._convertMarkStyle(e),i,s)}initMarkStyleWithSpec(t,e,i){if(!M(t)||!M(e))return;const{style:s,state:n}=e,r=Object.assign({},e);s&&(r.style=this._convertMarkStyle(s)),n&&(r.state={},Object.keys(n).forEach((t=>{r.state[t]=this._convertMarkStyle(n[t])}))),t.initStyleWithSpec(r,i)}stateKeyToSignalName(t,e){let i=`${nh}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;null===(t=this._data)||void 0===t||t.compile()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t})}))}_createMark(t,e={}){const{type:i,name:s}=t,n=Xl.createMark(i,s,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return null==n||n.created(),n}_getDataIdKey(){}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}getSpecInfo(){var t,e,i;return((t,e)=>{if(!D(e))return $d(t,e,void 0)})(null!==(i=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==i?i:{},this.getSpecInfoPath())}getSpecIndex(){const t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;const e=Number(t[t.length-1]);return isNaN(e)?0:e}}class Vy{getSpec(){return this._spec||{}}getLayoutStartPoint(){return this._layoutStartPoint}get layoutRectLevelMap(){return this._layoutRectLevelMap}get minWidth(){return this._minWidth}set minWidth(t){this._minWidth=t}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth=t}get minHeight(){return this._minHeight}set minHeight(t){this._minHeight=t}get maxHeight(){return this._maxHeight}set maxHeight(t){this._maxHeight=t}getLastComputeOutBounds(){return this._lastComputeOutBounds}get layoutOrient(){return this._layoutOrient}set layoutOrient(t){this._layoutOrient=t}get model(){return this._model}get type(){return this._model.type}constructor(t,e){var i;this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=()=>this._layoutRect,this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=Py.Region,this._model=t,this._option=e,this.layoutLevel=e.layoutLevel,this.layoutType=e.layoutType,e.layoutOrient&&(this.layoutOrient=e.layoutOrient),this._spec=null===(i=null==t?void 0:t.getSpec)||void 0===i?void 0:i.call(t)}_setLayoutAttributeFromSpec(t,e){var i,s,n,r;if(this._spec&&!1!==this._spec.visible){const a=sl(nl(t.padding),e,e);this.layoutPaddingLeft=a.left,this.layoutPaddingRight=a.right,this.layoutPaddingTop=a.top,this.layoutPaddingBottom=a.bottom,this._minHeight=D(t.minHeight)?null!==(i=this._minHeight)&&void 0!==i?i:null:il(t.minHeight,e.height,e),this._maxHeight=D(t.maxHeight)?null!==(s=this._maxHeight)&&void 0!==s?s:null:il(t.maxHeight,e.height,e),this._minWidth=D(t.minWidth)?null!==(n=this._minWidth)&&void 0!==n?n:null:il(t.minWidth,e.width,e),this._maxWidth=D(t.maxWidth)?null!==(r=this._maxWidth)&&void 0!==r?r:null:il(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:il(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:il(t.height,e.height,e)},{height:9}),D(t.offsetX)||(this.layoutOffsetX=il(t.offsetX,e.width,e)),D(t.offsetY)||(this.layoutOffsetY=il(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,s,n,r;this._spec=t,this.layoutType=null!==(i=t.layoutType)&&void 0!==i?i:this.layoutType,this.layoutLevel=null!==(s=t.layoutLevel)&&void 0!==s?s:this.layoutLevel,this.layoutOrient=null!==(n=t.orient)&&void 0!==n?n:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(r=t.clip)&&void 0!==r?r:this.layoutClip}onLayoutStart(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(t){}_getAbsoluteSpecValue(t){const e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((i=>{D(this._spec[i])||(e[i]=il(this._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))})),e}absoluteLayoutInRect(t){const{top:e,bottom:i,left:s,right:n}=this._getAbsoluteSpecValue(t),r={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};D(s)||(r.width-=s),D(n)||(r.width-=n),D(e)||(r.height-=e),D(i)||(r.height-=i),this.setLayoutRect(r);const{width:a,height:o}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:a,height:o});const l={x:t.x,y:t.y};!0===this._spec.center?(l.x=t.x+.5*t.width-.5*a,l.y=t.y+.5*t.height-.5*o):(D(s)?D(n)||(l.x=t.x+t.width-this.layoutPaddingRight-n-a):l.x=t.x+s+this.layoutPaddingLeft,D(e)?D(i)||(l.y=t.y+t.height-this.layoutPaddingBottom-i-o):l.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(l)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),Zo(t.x)&&(this._layoutStartPoint.x=t.x),Zo(t.y)&&(this._layoutStartPoint.y=t.y),null===(i=(e=this._model).afterSetLayoutStartPoint)||void 0===i||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var s,n,r,a;Zo(t)&&(null!==(s=null==i?void 0:i.width)&&void 0!==s?s:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0),Zo(e)&&(null!==(r=null==i?void 0:i.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=null!==(a=null==i?void 0:i.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}getLayout(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}mergeLayoutRect({width:t,height:e}){const i={width:t,height:e};return this._layoutRectLevelMap.width>0&&(i.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(i.height=this._layoutRect.height),i}getOrientPosAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}getOrientSizeAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}changeBoundsBySetting(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}setRectInSpec(t){const e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(D(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),D(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(D(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),D(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}computeBoundsInRect(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;const e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));let i=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}}class Wy extends Ny{constructor(){super(...arguments),this.layoutType="normal",this.layoutLevel=0,this.layoutZIndex=0,this._forceLayoutTag=!1,this._layout=null,this._orient=null,this._layoutRect={width:0,height:0},this._layoutStartPos={x:0,y:0},this._isLayout=!0,this.getGraphicBounds=()=>this._layout?{x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0},this._transformLayoutRect=null,this._transformLayoutPosition=null}get layoutOrient(){return this._orient}set layoutOrient(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}initLayout(){"none"!==this.layoutType&&(this._layout=new Vy(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e,i){this._isLayout=!0,super.onLayoutStart(t,e,i)}onLayoutEnd(t){super.onLayoutEnd(t),this.updateLayoutAttribute();const e=this.getLayoutRect();!this._forceLayoutTag&&Im(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=E(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=E(this._layoutRect,t)}getLastComputeOutBounds(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(i=this._spec.layoutType)&&void 0!==i?i:this.layoutType,this._orient=null!==(s=this._spec.orient)&&void 0!==s?s:this._orient,this.layoutLevel=null!==(n=this._spec.layoutLevel)&&void 0!==n?n:this.layoutLevel}}class Gy extends Hy{_initTheme(t,e){return{spec:t,theme:this._theme}}}class Uy extends Wy{getMaxWidth(){return this._layout.maxWidth}setMaxWidth(t){this._layout.maxWidth=t}getMaxHeight(){return this._layout.maxHeight}setMaxHeight(t){this._layout.maxHeight=t}getGroupMark(){return this._groupMark}getInteractionMark(){return this._interactionMark}getStackInverse(){return!0===this._spec.stackInverse}getStackSort(){return!0===this._spec.stackSort}constructor(t,e){var i;super(t,e),this.transformerConstructor=Gy,this.modelType="region",this.specKey="region",this.type=Uy.type,this._series=[],this.layoutType="region",this.layoutZIndex=Dy.Region,this.interaction=new Ey,this.seriesDataFilterOver=()=>{this.event.emit(zd.regionSeriesDataFilterOver,{model:this,chart:this.getChart()}),this._series.forEach((t=>{t.getViewDataFilter()&&t.reTransformViewData()}))},this.getBoundsInRect=()=>({x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}),this.userId=t.id,this.coordinate=null!==(i=t.coordinate)&&void 0!==i?i:"cartesian",this._option.animation&&(this.animate=new jy({getCompiler:e.getCompiler})),this.interaction.setDisableActiveEffect(this._option.disableTriggerEvent)}_getClipDefaultValue(){var t,e,i,s;const n=this._option.getChart().getSpec(),r=null===(e=null===(t=n.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),a=null===(s=null===(i=n.scrollBar)||void 0===i?void 0:i.some)||void 0===s?void 0:s.call(i,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!r&&!a)||this._layout.layoutClip}created(){var t,e;this.initLayout(),super.created();const i=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",(null!==(e=this.userId)&&void 0!==e?e:this.type)+"_interaction",Dy.Interaction),jm(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),i&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((t=>{t&&(t.created(),this.setMarkStyle(t,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",Oy.Built_In),this._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setZIndex(Dy.SeriesGroup-1),this._foregroundMark&&this._foregroundMark.setZIndex(Dy.Mark+1)),this.createTrigger()}_createGroupMark(t,e,i){var s,n;const r=this._createMark({type:"group",name:t});r.setUserId(e),r.setZIndex(i);const a=null!==(s=this._spec.clip)&&void 0!==s?s:this._getClipDefaultValue();return this.setMarkStyle(r,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:a},"normal",Oy.Built_In),this.setMarkStyle(r,{cornerRadius:null===(n=this._spec.style)||void 0===n?void 0:n.cornerRadius},"normal",Oy.User_Mark),this._marks.addMark(r),r}init(t){super.init(t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",Oy.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",Oy.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",Oy.User_Mark)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(null==e?void 0:e.style,null==t?void 0:t.style)||(i.reMake=!0),i}reInit(t){super.reInit(t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}addSeries(t){t&&(this._series.includes(t)||this._series.push(t))}removeSeries(t){if(!t)return;const e=this._series.findIndex((e=>e===t));e>=0&&this._series.splice(e,1)}getSeries(t={}){return this._series.filter((e=>{var i,s;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||Fa(t.userId).includes(e.userId))&&(!M(t.specIndex)||Fa(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(s=null===(i=e.getRawData)||void 0===i?void 0:i.call(e))||void 0===s?void 0:s.name)===t.dataName)}))}getSeriesInName(t){return this.getSeries({name:t})[0]}getSeriesInUserId(t){return this.getSeries({userId:t})[0]}getSeriesInId(t){return this.getSeries({id:t})[0]}getSeriesInType(t){return this.getSeries({type:t})}getSeriesInCoordinateType(t){return this.getSeries({coordinateType:t})}getSeriesInDataName(t){return this.getSeries({dataName:t})}onRender(t){}initSeriesDataflow(){const t=this._series.map((t=>{var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((t=>!!t));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}createTrigger(){const t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new wy(t)}initTrigger(){this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{this._trigger.registerMark(t)}))})),this._trigger.init()}initInteraction(){this._option.disableTriggerEvent||this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{for(const e in My)jm(t.stateStyle[My[e]])||this.interaction.registerMark(My[e],t)}))}))}compileMarks(t){this.getMarks().forEach((e=>{var i;e.compile({group:t,context:{model:this}}),null===(i=e.getProduct())||void 0===i||i.layout(((t,e,i,s)=>{}))}))}compile(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}onLayoutEnd(t){this._series.forEach((e=>e.onLayoutEnd(t))),super.onLayoutEnd(t)}}function $y(t){const e=[],i=[],s=[];return t.forEach((t=>{D(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?i.push(t):"end"===t.getSpec().position&&s.push(t)})),{startItems:e,endItems:s,middleItems:i}}function Xy(t,e,i){e?t.forEach((t=>{const e=Ya(t),s=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+n})}))})):t.forEach((t=>{const e=Ya(t),s=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+n,y:t.getLayoutStartPoint().y})}))}))}function Ky(t,e,i,s){let n;t.forEach(((t,r)=>{t.length>1&&(n=i[r],t.forEach((t=>{if(!t.alignSelf||"start"===t.alignSelf)return;const i=t.getLayoutStartPoint(),r="middle"===t.alignSelf?.5:1,a=e?n-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):n-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+s*a*r,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+s*a*r})})))}))}function qy(t,e,i,s,n){if(t.length){let r=0;const a="right"===n,o=a?-1:1;let l=a?e.rightCurrent:e.leftCurrent,h=e.topCurrent;const d=[];let c=[];const u=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=a?-n.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:h+t.layoutOffsetY+t.layoutPaddingTop}),h+=p,h>i&&c.length?(u.push(r),l+=o*r,r=g,h=e.topCurrent+p,t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),d.push(c),c=[t]):(r=Math.max(r,g),c.push(t))})),u.push(r),d.push(c),Ky(d,!0,u,o),s&&Xy(d,!0,i),a?e.rightCurrent=l+o*r:e.leftCurrent=l+o*r}}function Zy(t,e,i,s){if(t.length){let i=0;const n="right"===s,r=n?-1:1;let a=n?e.rightCurrent:e.leftCurrent,o=e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),c=t.computeBoundsInRect(s);t.setLayoutRect(c);const u=c.height+t.layoutPaddingTop+t.layoutPaddingBottom,p=c.width+t.layoutPaddingLeft+t.layoutPaddingRight,g=n?-c.width-t.layoutPaddingRight:t.layoutPaddingLeft;o{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=r?t.layoutPaddingTop:-n.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:l+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),l+=g,l>i&&c.length?(u.push(o),l=e.leftCurrent+g,h+=a*o,o=p,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),d.push(c),c=[t]):(o=Math.max(o,p),c.push(t))})),u.push(o),d.push(c),Ky(d,!1,u,a),s&&Xy(d,!1,i),r?e.topCurrent=h+a*o:e.bottomCurrent=h+a*o}}function Qy(t,e,i,s){if(t.length){const i="top"===s,n=i?1:-1;let r=0,a=e.rightCurrent,o=i?e.topCurrent:e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),d=t.computeBoundsInRect(s);t.setLayoutRect(d);const c=d.height+t.layoutPaddingTop+t.layoutPaddingBottom,u=d.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=i?t.layoutPaddingTop:-d.height-t.layoutPaddingBottom;ae.layoutLevel-t.layoutLevel))}_layoutNormalItems(t){this.layoutNormalInlineItems(t.filter((t=>"normal-inline"===t.layoutType))),this.layoutNormalItems(t.filter((t=>"normal"===t.layoutType)))}_groupItems(t){const e=t.filter((t=>"region"===t.layoutType)),i=t.filter((t=>"region-relative"===t.layoutType)),s=t.filter((t=>"region-relative-overlap"===t.layoutType)),n=i.concat(s),r={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return s.forEach((t=>{r[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:i,relativeOverlapItems:s,allRelatives:n,overlapItems:r}}layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:r,relativeItems:a,relativeOverlapItems:o,allRelatives:l,overlapItems:h}=this._groupItems(e);this.layoutRegionItems(r,a,o,h),this._processAutoIndent(r,a,o,h,l,n),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType)))}_processAutoIndent(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},n,r){if(n.some((t=>t.autoIndent))){const{top:a,bottom:o,left:l,right:h}=this._checkAutoIndent(n,r);(a||o||l||h)&&(this.topCurrent=r.top+a,this.bottomCurrent=r.bottom-o,this.leftCurrent=r.left+l,this.rightCurrent=r.right-h,this.layoutRegionItems(t,e,i,s))}}layoutNormalItems(t){t.forEach((t=>{const e=this.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(e);t.setLayoutRect(i),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:this.bottomCurrent+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}layoutNormalInlineItems(t){const e=t.filter((t=>"left"===t.layoutOrient)),i=t.filter((t=>"right"===t.layoutOrient)),s=t.filter((t=>"top"===t.layoutOrient)),n=t.filter((t=>"bottom"===t.layoutOrient)),r=this._chartLayoutRect.width+this._chartLayoutRect.x,a=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&qy(s,e,i,!1,"left"),n.length&&qy(n,e,i,!0,"left"),r.length&&Zy(r,e,0,"left")}(e,this,a),s.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&Jy(s,e,i,!1,"top"),n.length&&Jy(n,e,i,!0,"top"),r.length&&Qy(r,e,0,"top")}(s,this,r),i.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&qy(s,e,i,!1,"right"),n.length&&qy(n,e,i,!0,"right"),r.length&&Zy(r,e,0,"right")}(i,this,a),n.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&Jy(s,e,i,!1,"bottom"),n.length&&Jy(n,e,i,!0,"bottom"),r.length&&Qy(r,e,0,"bottom")}(n,this,r)}_layoutRelativeOverlap(t,e){e.items.forEach((t=>{const i=this.getItemComputeLayoutRect(t),s=t.computeBoundsInRect(i);e.rect.width=Math.max(s.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(s.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((i=>{i.setLayoutRect(e.rect),"left"===t?i.setLayoutStartPosition({x:this.leftCurrent+i.layoutOffsetX}):"right"===t?i.setLayoutStartPosition({x:this.rightCurrent-e.rect.width+i.layoutOffsetX}):"top"===t?i.setLayoutStartPosition({x:this.topCurrent+i.layoutOffsetY}):i.setLayoutStartPosition({x:this.bottomCurrent-e.rect.height+i.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}_layoutRelativeItem(t,e){const i=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}_layoutRegionItem(t,e,i){const s=Math.max(Math.min(e,...t.map((t=>{var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))),0),n=Math.max(Math.min(i,...t.map((t=>{var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))),0);return t.forEach((t=>{const e=s-t.layoutPaddingLeft-t.layoutPaddingRight,i=n-t.layoutPaddingTop-t.layoutPaddingBottom;t.setLayoutRect({width:e,height:i}),t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:n,regionWidth:s}}layoutRegionItems(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}}){let n=this.rightCurrent-this.leftCurrent,r=this.bottomCurrent-this.topCurrent;e.filter((t=>"left"===t.layoutOrient||"right"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",s.left),this._layoutRelativeOverlap("right",s.right),n=this.rightCurrent-this.leftCurrent,e.filter((t=>"top"===t.layoutOrient||"bottom"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",s.top),this._layoutRelativeOverlap("bottom",s.bottom),r=this.bottomCurrent-this.topCurrent;const{regionWidth:a,regionHeight:o}=this._layoutRegionItem(t,n,r);e.concat(i).forEach((e=>{if(["left","right"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:i.getLayoutRect().height}),e.setLayoutStartPosition({y:i.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+a-n})}else if(["top","bottom"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:i.getLayoutRect().width}),e.setLayoutStartPosition({x:i.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+o-r})}}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}filterRegionsWithID(t,e){var i;const s=t.find((t=>t.getModelId()===e));return s||(null!==(i=this._onError)&&void 0!==i?i:ml)("can not find target region item, invalid id"),s}getItemComputeLayoutRect(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}_checkAutoIndent(t,e){const i={top:0,left:0,bottom:0,right:0};return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,n=t.getLastComputeOutBounds(),r=this._getOutInLayout(n,t,e);s?(i.top=Math.max(i.top,r.top),i.bottom=Math.max(i.bottom,r.bottom)):(i.left=Math.max(i.left,r.left),i.right=Math.max(i.right,r.right))})),i}_getOutInLayout(t,e,i){const{x:s,y:n}=e.getLayoutStartPoint(),{width:r,height:a}=e.getLayoutRect();return{left:i.left-(s-t.x1),right:s+r+t.x2-i.right,top:i.top-(n-t.y1),bottom:n+a+t.y2-i.bottom}}}function eb(t,e,i){M(e)||(e=t,t=0),M(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s{let e=null,i=null;return(...s)=>(e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i)};function sb(t,e,i=0,s){for(D(s)&&(s=t.length);i>>1;pd(t[n],e)>0?s=n:i=n+1}return i}const nb=(t,e)=>rb(0,t.length,(i=>e(t[i]))),rb=(t,e,i)=>{let s=t,n=e;for(;s=0?n=t:s=t+1}return s};function ab(t){return t}const ob=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),lb=t=>t<0?-t*t:t*t,hb=t=>-Math.log(-t),db=t=>-Math.exp(-t),cb=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,ub=t=>10===t?cb:t===Math.E?Math.exp:e=>Math.pow(t,e),pb=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),gb=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mb=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function _b(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 fb(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return nl(o(t))}function vb(t,e,i){let s;return s=1===t?t+2*i:t-e+2*i,t?s>0?s:1:0}function yb(t,e,i,s){return 1===i&&(i=0),vb(t,i,s)*(e/(1-i))}function bb(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}function xb(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]{const i=Math.floor(Math.log10(t)),s=t/Math.pow(10,i);let n;return n=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,n*Math.pow(10,i)},Mb=Math.sqrt(50),kb=Math.sqrt(10),Ab=Math.sqrt(2),wb=[1,2,5,10],Tb=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=Db(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),eb(0,e).map((t=>n+t*s))):t>0?Cb(0,-(e-1)/s,s):Cb((e-1)/s,0,s)},Lb=ib(((t,e,i,s)=>{let n,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((n=e0){let i=Math.round(t/o),s=Math.round(e/o);for(i*oe&&--s,a=new Array(r=s-i+1);++le&&--s,a=new Array(r=s-i+1);++l{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*ie&&--o,n=new Array(s=o-a+1);++re&&--o,n=new Array(s=o-a+1);++r{let n,r,a;if(i=+i,(t=+t)==(e=+e))return Tb(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return Tb(t,i,null==s?void 0:s.noDecimals);(n=e0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=Cb(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=Cb(t,e,l);return n&&r.reverse(),r})),Db=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=wb[0];return i>=Mb?s=wb[3]:i>=kb?s=wb[2]:i>=Ab&&(s=wb[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function Pb(t,e,i){const s=(e-t)/Math.max(0,i);return Db(s)}function Ob(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e0;){if(s=Pb(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}function Ib(t,e){const i=h(e.forceMin),s=h(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:h(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:h(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),h(r[0])&&h(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=h(r[0])||h(r[1])?h(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}const Fb=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),Yb=ib(((t,e,i,s,n,r,a)=>{let o=t,l=e;const h=l0){for(;u<=p;++u)for(d=1;dl)break;g.push(c)}}else for(;u<=p;++u)for(d=s-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(cl)break;g.push(c)}2*g.length0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),jb=ib(((t,e,i,s,n,r)=>{const a=[],o={},l=n(t),h=n(e);let d=[];if(Number.isInteger(s))d=Eb(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e{const n=r(i),l=Number.isInteger(s)?Fb(t,e,n):Fb(t,e,Sb(n)),h=Fb(t,e,((t,e)=>{let i,s;return e[0]1&&(o[h]=1,a.push(h))})),a})),Hb=ib(((t,e,i,s,n)=>Ob(s(t),s(e),i).map((t=>Sb(n(t))))));ib(((t,e,i,s,n)=>Rb(s(t),s(e),i).map((t=>Sb(n(t))))));class zb{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=bb(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){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):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):M(this._rangeFactorStart)&&M(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return D(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return D(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),l=Math.max(r,a),h=Rs(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=D(s)?(l-o)*i:s;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*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}}function Nb(t,e){const i=t.r,s=e.r,n=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+s*t),d=Math.round(n*(1-t)+r*t),c=Math.round(a*(1-t)+o*t);return new Us(e,d,c,l*(1-t)+h*t)}}function Vb(t,e){return i=>t*(1-i)+e*i}function Wb(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const Gb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ub=new RegExp(Gb.source,"g"),{Zr:$b}=t;function Xb(t,e){const i=typeof e;let s;if(D(e)||"boolean"===i)return()=>e;if("number"===i)return Vb(t,e);if("string"===i){if(s=Gs.parseColorString(e)){const e=$b(Gs.parseColorString(t),s);return t=>e(t).formatRgb()}return Vb(Number(t),Number(e))}return e instanceof Us?$b(t,e):e instanceof Gs?$b(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):Vb(Number(t),Number(e))}function Kb(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}class qb extends zb{constructor(t=ab,e=ab){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ab,this._piecewise=fb,this._interpolate=Xb}calculateVisibleDomain(t){var e;return M(this._rangeFactorStart)&&M(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),Vb)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,gd);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 i=Array.from(t);return this._range=i,this._interpolate=Wb,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=Kb(i[0],i[r-1])),this._piecewise=r>2?xb:fb,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:ab),this.rescale(i)):this._clamp!==ab}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=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 D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class Zb extends qb{constructor(){super(...arguments),this.type=qh.Linear}clone(){return(new Zb).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return Lb(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(xs(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let o=Eb(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==r||o[o.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==r?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.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]);o=o.filter((t=>t>=e&&t<=i))}}return o}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ob(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Rb(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=Ib(n,e);if(r=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=Bb(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Bb(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Bb(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}const Jb=Symbol("implicit");class Qb extends zb{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=qh.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Jb}clone(){const t=(new Qb).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==Jb)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}const n=this._ordinalRange[(s-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;ei&&a>1;)a-=1,r=Math.floor((e-t)/a);return tx(t,e,r,n)}class ix extends Qb{constructor(t){super(),this.type=qh.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),s=super.domain().length,n=i[1]this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=yb(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),s=Math.min((t[1]-t[0])/i,1);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)){if(i>0){const e=t[0]-i*this._rangeFactorStart,s=e+i;this._wholeRange=[e,s]}else{const e=t[1]+i*(1-this._rangeFactorEnd),s=e-i;this._wholeRange=[s,e]}const n=this._rangeFactorStart+s<=1,r=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&n?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&r?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?n?this._rangeFactorEnd=this._rangeFactorStart+s:r?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):r?this._rangeFactorStart=this._rangeFactorEnd-s:n?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),s=this._getInvertIndex(t[1]);return e.slice(Math.min(i,s),Math.max(i,s)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[gd(t[0]),gd(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[gd(t[0]),gd(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return-1===t?e:ex(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return ex(0,e.length-1,t,!0).filter((t=>te[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s;if(i=Kb(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),s=ee[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,s=this.bandwidth()/2,n=this._domain.length,r=this.range(),a=r[0]>r[r.length-1];for(e=0;e=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&h(this._userBandwidth)}clone(){var t,e,i;return new ix(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}class sx{constructor(){this.type=qh.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!D(t)&&Zo(+t)?this._range[sb(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new sx).domain(this._domain).range(this._range).unknown(this._unknown)}}class nx extends Qb{range(t){return t?(this._range=t,this._resetRange(),this):super.range()}domain(t){return t?(super.domain(t),this._resetRange(),this):super.domain()}_resetRange(){if(!wl(this._range))return void super.range(this._range);const t=Ml(this._range,this._domain);super.range(t)}}const rx={linear:Zb,band:ix,point:class extends ix{constructor(t){super(!1),this.type=qh.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},ordinal:Qb,threshold:sx,colorOrdinal:nx};function ax(t){const e=rx[t];return e?new e:null}function ox(t,e){if(!e)return t;const i=e.range(),s=Math.min(i[0],i[i.length-1]),n=Math.max(i[0],i[i.length-1]);return Math.min(Math.max(s,t),n)}function lx(t){return M(null==t?void 0:t.field)&&M(null==t?void 0:t.scale)}const hx=["linear","radial","conical"],dx={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},cx=["line","area","trail"];function ux(t){return cx.includes(t)}class px extends Yy{getStateInfoList(){return this._stateInfoList}constructor(t,e){super(t),this._stateInfoList=[],this._mark=e}_getDefaultStateMap(){return{markUpdateRank:1}}getStateInfo(t){return this._stateInfoList.find((e=>e.stateValue===t))}addStateInfo(t){if(this.getStateInfo(t.stateValue))return;t.level=t.level||0;let e=!0;for(let i=0;it.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}_clearStateBeforeSet(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}changeStateInfo(t){const e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else{e.fields=e.fields||{};for(const i in t.fields){const s=t.fields[i];e.fields[i]=e.fields[i]||{};const n=e.fields[i];M(s.domain)&&(n.domain=s.domain),M(s.type)&&(n.type=s.type)}}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}clearStateInfo(t){t.forEach((t=>{this.getStateInfo(t)&&this.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}checkOneState(t,e,i,s){var n;s=v(ux)?s:!t.mark||ux(t.mark.markType);let r=!1,a=!1;if(M(i.datums)&&i.datums.length>0)r=this.checkDatumState(i,e,s),a=!0;else if(i.items)r=null!==(n=this.checkItemsState(i,t))&&void 0!==n&&n,a=!0;else if(i.fields)r=this.checkFieldsState(i,e,t,s),a=!0;else if(!r&&i.filter){const s={mark:this._mark,renderNode:t,type:t.mark.markType};r=i.filter(e,s),a=!0}return a?r?"in":"out":"skip"}checkState(t,e){const i=t.getStates().filter((t=>!!Ty[t])).map((t=>[t,10])),s=!t.mark||ux(t.mark.markType);for(let n=0;nt[0]))}checkDatumState(t,e,i){let s=!1;const n=i?e[0]:e;if(y(t.datums)){const e=t.datumKeys||Object.keys(t.datums[0]).filter((t=>!t.startsWith(nh)));s=t.datums.some((t=>i&&y(null==t?void 0:t.items)?e.every((e=>{var i,s;return(null===(s=null===(i=null==t?void 0:t.items)||void 0===i?void 0:i[0])||void 0===s?void 0:s[e])===(null==n?void 0:n[e])})):e.every((e=>(null==t?void 0:t[e])===(null==n?void 0:n[e])))))}else s=bs(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((t=>!t.startsWith(nh)))).every((e=>{var s,r;return i?(null===(s=t.datums.items)||void 0===s?void 0:s[0][e])===n[e]:(null===(r=t.datums)||void 0===r?void 0:r[e])===n[e]})):e===t.datums;return s}checkItemsState(t,e){var i;return null===(i=t.items)||void 0===i?void 0:i.includes(e)}checkFieldsState(t,e,i,s){var n;let r=!0;for(const a in t.fields){const o=t.fields[a],l=o.type,h=o.domain,d=s?null===(n=e[0])||void 0===n?void 0:n[a]:e[a];if(Qh(l)&&h.length>1){if(this.checkLinearFieldState(h,a,e,i,s)){r=!1;break}r=!0}else{if(!h.some((t=>t===d))){r=!1;break}r=!0}}return r}checkLinearFieldState(t,e,i,s,n){var r;const a=n?null===(r=i[0])||void 0===r?void 0:r[e]:i[e];return at[t.length-1]}updateLayoutState(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}compileState(t,e){t.state({callback:(t,e)=>this.checkState(e,t)},e)}}class gx extends By{getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}constructor(t,e){super(t),this.grammarType=a_.data,this._data=null,this._data=e}release(){super.release(),this._data=null}updateData(t){const e=this.getProduct(),i=this.getLatestData();if(e&&i&&(e.values(i),!t))return this.getCompiler().renderNextTick()}_compileProduct(){const t=this.getLatestData();D(t)||(D(this.getProduct())?this._initProduct(t):this._product.values(t))}_initProduct(t){var e,i;const s=this.getVGrammarView();if(!s||!t)return;const n=this.getProductId();this._product=null===(i=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e.call(s,t))||void 0===i?void 0:i.id(n),this._compiledProductId=n}generateProductId(){var t;return`${null===(t=this.getDataView())||void 0===t?void 0:t.name}`}_lookupGrammar(t){var e,i;return null===(i=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===i?void 0:i.call(e,t)}}class mx extends gx{constructor(t){super(t),this._mark=t.mark}setCompiledProductId(t){this._compiledProductId=t}generateProductId(){const t=super.generateProductId();return M(t)?t:`${nh}_markData_${this._mark.id}`}_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct(e)}}var _x=function(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{this._unCompileChannel[t]||(this._option.noSeparateStyle||function(t,e,i){var s;const n=null===(s=e[t])||void 0===s?void 0:s.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,n)||!!xs(n)||!(!(null==n?void 0:n.scale)||n.field===i)}(t,i,this.getGroupKey())?n[t]={callback:this.compileCommonAttributeCallback(t,"normal"),dependency:[this.stateKeyToSignalName("markUpdateRank")]}:s[t]=this.compileCommonAttributeCallback(t,"normal"))})),{enterStyles:s,updateStyles:n}}compileEncode(){const t=this.stateStyle,e=Sy.STATE_NORMAL,i=(t[e],_x(t,["symbol"==typeof e?e:e+""])),{enterStyles:s,updateStyles:n}=this._separateStyle();this._product.encode(n,!0),this._product.encodeState("group",s,!0),Object.keys(i).forEach((t=>{const e={};Object.keys(i[t]).forEach((i=>{this._unCompileChannel[i]||(e[i]={callback:this.compileCommonAttributeCallback(i,t),dependency:[this.stateKeyToSignalName("markUpdateRank")]})})),this._product.encodeState(t,e,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}compileState(){this.state.compileState(this._product,this._stateSort)}compileAnimation(){var t,e,i,s;if(this._animationConfig){let n;if("component"===this.type)n=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{const t=null===(i=(e=this.model).getRegion)||void 0===i?void 0:i.call(e);n=null===(s=null==t?void 0:t.animate)||void 0===s?void 0:s.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:(t,e,i)=>{var s;return null===(s=i[n])||void 0===s?void 0:s.callback(t,e)},dependency:n}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(hc.ANIMATION_END,(({event:t})=>{t.mark===this.getProduct()&&t.animationState===Np.appear&&this.runAnimationByState(Np.normal)})):this._event.on(hc.AFTER_DO_RENDER,(()=>{this.runAnimationByState(Np.normal)})))}}compileContext(t){const e={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:Object.assign({markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},t),skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments,clip:!!this._clip||!1!==this._clip&&void 0,clipPath:this._clip||void 0};this._progressiveConfig&&(e.progressiveStep=this._progressiveConfig.progressiveStep,e.progressiveThreshold=this._progressiveConfig.progressiveThreshold,e.large=this._progressiveConfig.large,e.largeThreshold=this._progressiveConfig.largeThreshold),e.morph=this._morph,e.morphKey=this._morphKey,e.morphElementKey=this._morphElementKey,this._setCustomizedShape&&(e.setCustomizedShape=this._setCustomizedShape),this._product.configure(e)}compileSignal(){this.state.compile()}_computeAttribute(t,e){return(t,e)=>{}}compileCommonAttributeCallback(t,e){const i=this._computeAttribute(t,e),s={mark:null,parent:null,element:null};return(t,e)=>(s.mark=e.mark,s.parent=e.mark.group,s.element=e,i(t,s))}compileTransform(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}updateState(t,e){return this.state.updateState(t,e)}updateLayoutState(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((t=>t.state.updateLayoutState(!0))),this.state.updateLayoutState(t)}updateMarkState(t){if(!this._product)return;const e=this.state.getStateInfo(t);this._product.elements.forEach((i=>{"in"===this.state.checkOneState(i,i.getDatum(),e)?i.addState(t):i.removeState(t)}))}getMarks(){return[]}runAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.runAnimationByState(t)}stopAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.stopAnimationByState(t)}pauseAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.pauseAnimationByState(t)}resumeAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.resumeAnimationByState(t)}getProductElements(){const t=this.getProduct();if(t)return t.elements}release(){super.release(),this.state.release()}}var vx=function(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);ne(t(...i)):e(t)}convertAngleToRadian(t){return this._transformStyleValue(t,At)}isUserLevel(t){return[Oy.User_Mark,Oy.User_Series,Oy.User_Chart,Oy.User_SeriesStyle].includes(t)}setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this.isUserLevel(i);Object.keys(t).forEach((r=>{let a=t[r];D(a)||(a=this._filterAttribute(r,a,e,i,n,s),this.setAttribute(r,a,e,i,s))}))}getStyle(t,e="normal"){var i;return null===(i=this.stateStyle[e][t])||void 0===i?void 0:i.style}_filterAttribute(t,e,i,s,n,r=this.stateStyle){let a=this._styleConvert(e);if(n)switch(t){case"angle":a=this.convertAngleToRadian(a);break;case"innerPadding":case"outerPadding":a=this._transformStyleValue(a,(t=>-t));break;case"curveType":a=this._transformStyleValue(a,(t=>{return e=t,i=this._option.model.direction,"monotone"===e?"horizontal"===i?"monotoneY":"monotoneX":e;var e,i}))}return a}setReferer(t,e,i,s=this.stateStyle){var n;if(t)if(e&&i){const r=null!==(n=s[i])&&void 0!==n?n:{[e]:{}};s[i][e]=Object.assign(Object.assign({},r[e]),{referer:t})}else Object.entries(s).forEach((([e,i])=>{Object.entries(i).forEach((([i,n])=>{s[e][i].referer=t}))}))}setPostProcess(t,e,i="normal"){var s;(null===(s=this.stateStyle[i])||void 0===s?void 0:s[t])&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal",s){return this._computeAttribute(t,i)(e,s)}setAttribute(t,e,i="normal",s=0,n=this.stateStyle){var r;void 0===n[i]&&(n[i]={}),void 0===n[i][t]&&(n[i][t]={level:s,style:e,referer:void 0});const a=null===(r=n[i][t])||void 0===r?void 0:r.level;M(a)&&a<=s&&Ll(n[i][t],{style:e,level:s}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach((t=>{void 0===n[i][t]&&(n[i][t]=n.normal[t])}))}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(td(t.type)||t.scale){const e=function(t,e){if("scale"in t&&t.scale)return S(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;const i=ax(t.type);return i&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(i,t),i}(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}_computeAttribute(t,e){var i;let s=null===(i=this.stateStyle[e])||void 0===i?void 0:i[t];s||(s=this.stateStyle.normal[t]);const n=this._computeStateAttribute(s,t,e),r=xs(null==s?void 0:s.postProcess),a=t in this._computeExChannel;if(r&&a){const i=this._computeExChannel[t];return(r,a)=>{let o=n(r,a);return o=s.postProcess(o,r,this._attributeContext,a,this.getDataView()),i(t,r,e,a,o)}}if(r)return(t,e)=>s.postProcess(n(t,e),t,this._attributeContext,e,this.getDataView());if(a){const i=this._computeExChannel[t];return(s,r)=>i(t,s,e,r,n(s,r))}return n}_computeStateAttribute(t,e,i){var s;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?(e,i)=>t.style(e,this._attributeContext,i,this.getDataView()):hx.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):td(null===(s=t.style.scale)||void 0===s?void 0:s.type)?(e,i)=>{let s=e;return"series"===this.model.modelType&&this.model.getMarkData&&(s=this.model.getMarkData(e)),t.style.scale.scale(s[t.style.field])}:(e,i)=>t.style:(e,i)=>t.style:(t,e)=>{}}_initStyle(){const t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t,e,i){t.style&&this.setStyle(t.style,"normal",Oy.User_Mark,e);const s=t.state;s&&Object.keys(s).forEach((t=>{const i=s[t];if("style"in i){const s=i.style;let n={stateValue:t};"level"in i&&(n.level=i.level),"filter"in i&&(n=xs(i.filter)?Object.assign({filter:i.filter},n):Object.assign(Object.assign({},i.filter),n)),this.state.addStateInfo(n),this.setStyle(s,t,Oy.User_Mark,e)}else this.setStyle(i,t,Oy.User_Mark,e)}))}_computeGradientAttr(t){var e,i;const{gradient:s,scale:n,field:r}=t,a=vx(t,["gradient","scale","field"]);let o=n,l=r;if(!(n&&r||"series"!==this.model.modelType)){const{scale:t,field:e}=this.model.getColorAttribute();n||(o=t),l||(l=e)}const h=Ml(Sl(this.model.getColorScheme(),"series"===this.model.modelType?null===(i=(e=this.model).getSpec)||void 0===i?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),d=Object.assign(Object.assign({},dx[s]),a);return(t,e)=>{const i={},n=this.getDataView();return Object.keys(d).forEach((s=>{const r=d[s];"stops"===s?i.stops=r.map((i=>{const{opacity:s,color:r,offset:a}=i;let d=null!=r?r:null==o?void 0:o.scale(t[l]);return xs(r)&&(d=r(t,this._attributeContext,e,n)),M(s)&&(d=Gs.SetOpacity(d,s)),{offset:xs(a)?a(t,this._attributeContext,e,n):a,color:d||h[0]}})):xs(r)?i[s]=r(t,this._attributeContext,e,n):i[s]=r})),i.gradient=s,i}}_computeBorderAttr(t){const{scale:e,field:i}=t,s=vx(t,["scale","field"]);return(t,n)=>{var r,a,o;const l={};if(Object.keys(s).forEach((e=>{const i=s[e];xs(i)?l[e]=i(t,this._attributeContext,n,this.getDataView()):l[e]=i})),"stroke"in l)hx.includes(null===(o=s.stroke)||void 0===o?void 0:o.gradient)&&(l.stroke=this._computeGradientAttr(s.stroke)(t,n));else{const s=Ml(Sl(this.model.getColorScheme(),"series"===this.model.modelType?null===(a=(r=this.model).getSpec)||void 0===a?void 0:a.call(r):void 0),this.model.getDefaultColorDomain());let n=e,o=i;if(!(e&&i||"series"!==this.model.modelType)){const{scale:i,field:r}=this.model.getColorAttribute();e||(n=i),o||(o=r),l.stroke=(null==n?void 0:n.scale(t[o]))||s[0]}}return l}}}class bx extends er{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(t=!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 xx(t){return new bx(t)}function Sx(){Sx.__loaded||(Sx.__loaded=!0,aa.RegisterGraphicCreator("shadowRoot",xx))}Sx.__loaded=!1;const Mx=Sx,kx=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...yn];class Ax extends An{constructor(t){super(t),this.type="arc",this.numberType=Rn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(h(t,!0)?t:a*parseFloat(t)/100,a/2);if(y(e)){const t=e.map((t=>o(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 o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=((t=0)=>{if(t<0)for(;t<-ot;)t+=ot;else if(t>0)for(;t>ot;)t-=ot;return t})(e),i=e+r,s&&ht(r)nt&&o>nt)return{startAngle:e-n*u*r,endAngle:i+n*u*a,sc:n*u*r,ec:n*u*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=mt(a*a+o*o)}=this.attribute,h=ht(e-t);let d=t,c=e,u=t,p=e;const g=r/2;let m=h,_=h;if(g>nt&&l>nt){const i=e>t?1:-1;let s=ft(Number(l)/o*gt(g)),n=ft(Number(l)/a*gt(g));return(m-=2*s)>nt?(s*=i,u+=s,p-=s):(m=0,u=p=(t+e)/2),(_-=2*n)>nt?(n*=i,d+=n,c-=n):(_=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}getGraphicTheme(){return ms(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Si.graphicService.updateTempAABBBounds(i);$v(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return Si.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,so){const t=l;l=o,o=t}return s<=nt?i.set(0,0,0,0):Math.abs(o-l)>lt-nt?i.set(-s,-s,s,s):(dn(l,o,s,i),dn(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,kx)}needUpdateTag(t){return super.needUpdateTag(t,kx)}toCustomPath(){var t,e,i,s;const n=this.attribute,{startAngle:r,endAngle:a}=this.getParsedAngle();let o=(null!==(t=n.innerRadius)&&void 0!==t?t:0)-(null!==(e=n.innerPadding)&&void 0!==e?e:0),l=(null!==(i=n.outerRadius)&&void 0!==i?i:0)-(null!==(s=n.outerPadding)&&void 0!==s?s:0);const h=ht(a-r),d=a>r;if(l=lt-nt)c.moveTo(0+l*ct(r),0+l*gt(r)),c.arc(0,0,l,r,a,!d),o>nt&&(c.moveTo(0+o*ct(a),0+o*gt(a)),c.arc(0,0,o,a,r,d));else{const t=l*ct(r),e=l*gt(r),i=o*ct(a),s=o*gt(a);c.moveTo(0+t,0+e),c.arc(0,0,l,r,a,!d),c.lineTo(0+i,0+s),c.arc(0,0,o,a,r,d),c.closePath()}return c}clone(){return new Ax(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ax.NOWORK_ANIMATE_ATTR}}function wx(t){return new Ax(t)}Ax.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},kn);class Tx{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:s=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size{r++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length=n)););if(is;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:s=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>s&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();t.forEach((t=>{for(;s-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();for(;s-t.timestamp[0]>i;)t.timestamp.shift()}}class Lx{static GetCanvas(){try{return Lx.canvas||(Lx.canvas=Si.global.createCanvas({})),Lx.canvas}catch(t){return null}}static GetCtx(){if(!Lx.ctx){const t=Lx.GetCanvas();Lx.ctx=t.getContext("2d")}return Lx.ctx}}class Cx extends Tx{static getInstance(){return Cx._instance||(Cx._instance=new Cx),Cx._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Lx.GetCanvas(),s=Lx.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");const n=s.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),s.fillStyle=n,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,s,n=[],r=100){let a=`${t}${e}${i}${s}`;n.forEach((t=>a+=t.join())),a+=r;let o=this.dataMap.get(a);return o||(o={data:new Cx(n,r),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class Ex{static GetSize(t){for(let e=0;e=t)return Ex.ImageSize[e];return t}static Get(t,e,i,s,n,r,a){const o=Ex.GenKey(t,e,i,s,n),l=Ex.cache[o];if(!l||0===l.length)return null;for(let t=0;t=r&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,s,n,r,a,o){const l=Ex.GenKey(t,e,i,s,n);Ex.cache[l]?Ex.cache[l].push({width:a,height:o,pattern:r}):Ex.cache[l]=[{width:a,height:o,pattern:r}]}static GenKey(t,e,i,s,n){return`${e},${i},${s},${n},${t.join()}`}}Ex.cache={},Ex.ImageSize=[20,40,80,160,320,640,1280,2560];const Dx=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{innerPadding:_=l.innerPadding,outerPadding:f=l.outerPadding,startAngle:v=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x=l.x,y:S=l.y,scaleX:M=l.scaleX,scaleY:k=l.scaleY}=t.attribute;let{innerRadius:A=l.innerRadius,outerRadius:w=l.outerRadius}=t.attribute;w+=f,A-=_;const T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Pa(e,o,e.dpr),d=o/w,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:w+u*h,innerRadius:A-u*h,startAngle:v-u*d,endAngle:y+u*d}),e.beginPath(),to(t,e,i,s,w+u*h,A-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/M,(S-s)/k,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder"),t.setAttributes({outerRadius:w,innerRadius:A,startAngle:v,endAngle:y})}},Px=Eo,Ox=mo;var Rx=function(t,e){return function(i,s){e(i,s,t)}};let Bx=class extends xo{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Rn,this.builtinContributions=[Dx,Ox,Px],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=o,ht(c-d);const u=c>d;let p=!1;if(nnt){const t=pt(b,y),r=pt(x,y),a=Ja(f,v,m,_,n,t,Number(u)),o=Ja(M,k,A,w,n,r,Number(u));if(y0&&e.arc(i+o.cx,s+o.cy,r,dt(o.y11,o.x11),dt(o.y01,o.x01),!u)}}else e.moveTo(i+m,s+_);if(!(r>nt)||L<.001)e.lineTo(i+A,s+w),p=!0;else if(T>nt){const t=pt(E,T),n=pt(D,T),a=Ja(A,w,M,k,r,-n,Number(u)),o=Ja(m,_,f,v,r,-t,Number(u));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),T0&&e.arc(i+a.cx,s+a.cy,n,dt(a.y01,a.x01),dt(a.y11,a.x11),!u);const t=dt(a.cy+a.y11,a.cx+a.x11),o=c-l-.03;e.arc(i,s,r,t,o,u)}}else e.lineTo(i+r*ct(C),s+r*gt(C));return p}drawShape(t,e,i,s,n,r,a,o){const l=ms(t,null==r?void 0:r.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:c=l.x,y:u=l.y}=t.attribute,p=this.valid(t,l,a,o);if(!p)return;const{fVisible:g,sVisible:m,doFill:_,doStroke:f}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:S=l.forceShowCap}=t.attribute;let{outerRadius:M=l.outerRadius,innerRadius:k=l.innerRadius}=t.attribute;M+=y,k-=b;let A=0;const w=(v(x)&&x||x[0])&&"conical"===h.gradient;if(w){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ht(s-i){var e;let i=!0;if(v(t,!0)){for(let s=0;s<4;s++)rn[s]=t,i&&(i=!(null!==(e=rn[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)rn[e]=!!t[e],i&&(i=!!rn[e]);else rn[0]=!1,rn[1]=!1,rn[2]=!1,rn[3]=!1;return{isFullStroke:i,stroke:rn}})(d);if((_||L)&&(e.beginPath(),to(t,e,i,s,M,k),T=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_&&(a?a(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),f&&L&&(o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke()))),!L&&f&&(e.beginPath(),to(t,e,i,s,M,k,C),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),(v(x)&&x||x[1])&&S){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(ht(h-r)>=lt-nt){e.beginPath();const r=Math.abs(M-k)/2/M,{endAngle:h=l.endAngle,fill:d=l.fill}=t.attribute,c=h;if(this.drawArcTailCapPath(t,e,i,s,M,k,c,c+r),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_){const n=d;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=lt;for(;i>lt;)i-=lt;if(ia)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),qs(o.color,l.color,h,!1)}(0,0,h,n);a||Xa&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=r,e.fill())}}f&&(o||m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke()))}}this.afterRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),w&&(h.startAngle+=A,h.endAngle+=A)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Bx=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}([V(),Rx(0,$(K)),Rx(0,X(eo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Bx);let Ix=!1;const Fx=new I((t=>{Ix||(Ix=!0,t(Bx).toSelf().inSingletonScope(),t(gr).to(Bx).inSingletonScope(),t(vr).toService(gr),t(eo).toService(_o),Z(t,eo))}));let Yx=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Rn}};Yx=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(gr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yx);let jx=!1;const Hx=new I(((t,e,i,s)=>{jx||(jx=!0,t(j_).to(Yx).inSingletonScope(),t(ef).toService(j_))}));let zx=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Rn}};zx=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(gr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],zx);let Nx=!1;const Vx=new I(((t,e,i,s)=>{Nx||(Nx=!0,t(L_).to(zx).inSingletonScope(),t(T_).toService(L_))}));function Wx(){Wx.__loaded||(Wx.__loaded=!0,aa.RegisterGraphicCreator("arc",wx),Xi.load(Fx),Xi.load(w_?Hx:Vx))}Wx.__loaded=!1;const Gx=Wx;class Ux extends Ax{constructor(t){super(t),this.type="arc3d",this.numberType=Bn}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),Si.graphicService.updateTempAABBBounds(i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Ux.NOWORK_ANIMATE_ATTR}}function $x(t){return new Ux(t)}Ux.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},kn);class Xx{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Xs.Get(e,$s.Color1),this.ambient=i;const s=mt(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 i=this.formatedDir,s=pt(ut((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=S(e)?Xs.Get(e,$s.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const Kx=()=>{Cg.registerPlugin("DirectionalLight",Xx)};class qx{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=Ur.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Ur.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,d,c,u,p;const g=e[0],m=e[1],_=e[2],f=s[0],v=s[1],y=s[2],b=i[0],x=i[1],S=i[2];Math.abs(g-b){Cg.registerPlugin("OrthoCamera",qx)};let Jx=class extends xo{constructor(){super(...arguments),this.numberType=Bn}drawShape(t,e,i,s,n,r,a,o){var l;const h=ms(t,null==r?void 0:r.theme).arc,{fill:d=h.fill}=t.attribute,c=this.valid(t,h,a,o);if(!c)return;const{fVisible:u,sVisible:p,doFill:g,doStroke:m}=c,_=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:f=h.outerPadding,innerPadding:v=h.innerPadding,height:y=10}=t.attribute;let{outerRadius:b=h.outerRadius,innerRadius:x=h.innerRadius}=t.attribute;b+=f,x-=v;const S=Xs.Get(d,$s.Color255),{light:M}=n.stage||{},k=n.hack_pieFace,A={top:_,bottom:_+y},w={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===k||"top"===k?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(r=lt-nt)e.moveTo(i+r*ct(o),s+r*gt(o),n),e.arc(i,s,r,o,l,!d,n),a>nt&&(e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,o,d,n));else{const{outerDeltaAngle:h,innerDeltaAngle:u,outerStartAngle:p,outerEndAngle:g,innerEndAngle:m,innerStartAngle:_}=t.getParsePadAngle(o,l),f=r*ct(p),v=r*gt(p),y=a*ct(m),b=a*gt(m);h<.001?c=!0:(e.moveTo(i+f,s+v,n),e.arc(i,s,r,p,g,!d,n)),!(a>nt)||u<.001?(e.lineTo(i+y,s+b,n),c=!0):(e.lineTo(i+y,s+b,n),e.arc(i,s,a,m,_,d,n))}e.closePath()}(t,e,i,s,A[k],b,x),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==k&&"inside"!==k||("inside"===k&&(e.save(),e.beginPath(),e.arc(i,s,x,0,lt,!0,A.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),d=ht(h-l),c=h>l;let u=!1;if(a<=nt)e.moveTo(i,s,n);else if(d>=lt-nt)e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,h,!c,n),e.lineTo(i+a*ct(h),s+a*gt(h),r),e.arc(i,s,a,h,l,c,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:p}=o(l,h),g=a*ct(d),m=a*gt(d),_=a*ct(p),f=a*gt(p);t<.001?u=!0:(e.moveTo(i+g,s+m,n),e.arc(i,s,a,d,p,!c,n),e.lineTo(i+_,s+f,r),e.arc(i,s,a,p,d,c,r))}e.closePath()}(t,e,i,s,A.top,A.bottom,"outside"===k?b:x,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===k?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===k&&e.restore())}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Jx=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}([V()],Jx);let Qx=!1;const tS=new I((t=>{Qx||(Qx=!0,t(mr).to(Jx).inSingletonScope(),t(vr).toService(mr))}));let eS=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Bn,this.themeType="arc"}};eS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],eS);let iS=!1;const sS=new I(((t,e,i,s)=>{iS||(iS=!0,t(H_).to(eS).inSingletonScope(),t(ef).toService(H_))}));function nS(){nS.__loaded||(nS.__loaded=!0,aa.RegisterGraphicCreator("arc3d",$x),Kx(),Zx(),Xi.load(tS),Xi.load(sS))}nS.__loaded=!1;const rS=nS,aS=["points","cornerRadius",...yn];class oS extends An{constructor(t){super(t),this.type="polygon",this.numberType=Vn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return ms(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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=un(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,aS)}needUpdateTag(t){return super.needUpdateTag(t,aS)}toCustomPath(){const t=this.attribute.points,e=new Ze;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 oS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return oS.NOWORK_ANIMATE_ATTR}}function lS(t){return new oS(t)}oS.NOWORK_ANIMATE_ATTR=kn;class hS extends oS{constructor(t){super(t),this.type="pyramid3d",this.numberType=Wn}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),Si.graphicService.updateTempAABBBounds(i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.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]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return hS.NOWORK_ANIMATE_ATTR}}function dS(t){return new hS(t)}hS.NOWORK_ANIMATE_ATTR=kn;class cS extends xo{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,d){const c=Xs.Get(r,$s.Color255),u=s.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=u[n[0]],m=u[n[1]],_=u[n[2]],f=u[n[3]],v={x:t+g[0],y:e+g[1],z:i+g[2]},y={x:t+m[0],y:e+m[1],z:i+m[2]},b={x:t+_[0],y:e+_[1],z:i+_[2]},x={x:t+f[0],y:e+f[1],z:i+f[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.closePath(),d?d(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,c):r,a.fill())}))}}let uS=class extends cS{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Wn}drawShape(t,e,i,s,n,r,a,o){var l;const h=ms(t,null==r?void 0:r.theme).polygon,{fill:d=h.fill,stroke:c=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}=n.stage||{},m=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,s,h);let n=d;"string"!=typeof n&&(n="black"),this.fill(i,s,p,m,u,n,e,g,t,h,a)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,m,e))}draw(t,e,i){const s=ms(t).polygon;this._draw(t,s,!1,i)}};uS=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}([V()],uS);let pS=!1;const gS=new I((t=>{pS||(pS=!0,t(Lr).to(uS).inSingletonScope(),t(vr).toService(Lr))}));let mS=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Wn,this.themeType="polygon"}};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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Lr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mS);let _S=!1;const fS=new I(((t,e,i,s)=>{_S||(_S=!0,t(Z_).to(mS).inSingletonScope(),t(ef).toService(Z_))}));function vS(){vS.__loaded||(vS.__loaded=!0,aa.RegisterGraphicCreator("pyramid3d",dS),Kx(),Zx(),Xi.load(gS),Xi.load(fS))}vS.__loaded=!1;const yS=vS,bS=["segments","points","curveType","curveTension",...yn];class xS extends An{constructor(t){super(t),this.type="area",this.numberType=In}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 ms(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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=un(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,bS)}needUpdateTag(t){return super.needUpdateTag(t,bS)}toCustomPath(){const t=new Ze,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 xS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return xS.NOWORK_ANIMATE_ATTR}}function SS(t){return new xS(t)}xS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},kn);let MS=!1;const kS=new I((t=>{MS||(MS=!0,t(Ro).toSelf().inSingletonScope(),t(_r).to(Ro).inSingletonScope(),t(vr).toService(_r),t(io).toService(_o),Z(t,io),t(Bo).toSelf().inSingletonScope())}));let AS=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=In}};AS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(_r)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AS);let wS=!1;const TS=new I(((t,e,i,s)=>{wS||(wS=!0,t(z_).to(AS).inSingletonScope(),t(ef).toService(z_))}));let LS=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=In}};LS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(_r)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],LS);let CS=!1;const ES=new I(((t,e,i,s)=>{CS||(CS=!0,t(C_).to(LS).inSingletonScope(),t(T_).toService(C_))}));function DS(){DS.__loaded||(DS.__loaded=!0,aa.RegisterGraphicCreator("area",SS),Xi.load(kS),Xi.load(w_?TS:ES))}DS.__loaded=!1;const PS=DS,OS=["width","height","image",...yn];class RS extends An{constructor(t){super(t),this.type="image",this.numberType=Hn,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}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:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}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()}))}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,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return ms(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:s=e.width,height:n=e.height}=t;i.set(0,0,s,n)}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return bi[t]}needUpdateTags(t){return super.needUpdateTags(t,OS)}needUpdateTag(t){return super.needUpdateTag(t,OS)}clone(){return new RS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return RS.NOWORK_ANIMATE_ATTR}}function BS(t){return new RS(t)}RS.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},kn);const IS=new class extends Jv{constructor(){super(...arguments),this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){return super.drawShape(t,e,i,s,n,r,a,o,l,h,d,c)}},FS=new class extends go{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,d,c,u){const{background:p,backgroundMode:g=l.backgroundMode,backgroundFit:m=l.backgroundFit}=t.attribute;if(p)if(t.backgroundImg){const i=t.resources.get(p);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ms(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}const s=t.AABBBounds;this.doDrawImage(e,i.data,s,g,m),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(bs(p)){const{stroke:i,fill:s,lineWidth:n=1,cornerRadius:r=0,expandX:a=0,expandY:o=0}=p;if(!i&&!s)return;e.beginPath();const{x:l,y:d,width:c,height:u}=function(t){const e=on(t.attribute.boundsPadding),i=t.AABBBounds;let s=i.x1,n=i.y1,r=i.width(),a=i.height();return h(e)?(s+=e,n+=e,r-=2*e,a-=2*e):(s+=e[3],n+=e[0],r-=e[1]+e[3],a-=e[0]+e[2]),{x:s,y:n,width:r,height:a}}(t);r?Ga(e,l-a,d-o,c+2*a,u+2*o,r):e.rect(l-a,d-o,c+2*a,u+2*o),e.globalAlpha=1,s&&(e.fillStyle=s,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,s,n.width(),n.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}};var YS=function(t,e){return function(i,s){e(i,s,t)}};const jS=["","repeat-x","repeat-y","repeat"];let HS=class extends xo{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Hn,this.builtinContributions=[IS,FS],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=ms(t).image,{width:h=l.width,height:d=l.height,repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:p=l.x,y:g=l.y,cornerRadius:m=l.cornerRadius,image:_}=t.attribute,f=this.valid(t,l,a);if(!f)return;const{fVisible:v,sVisible:b,doFill:x,doStroke:S}=f;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,s,x,!1,v,!1,l,n,a),x)if(a)a(e,t.attribute,l);else if(v){if(!_||!t.resources)return;const n=t.resources.get(_);if("success"!==n.state)return;let r=!1;0===m||y(m)&&m.every((t=>0===t))||(e.beginPath(),Ga(e,i,s,h,d,m),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,s,l);let a=0;if("repeat"===c&&(a|=1),"repeat"===u&&(a|=2),a){const t=e.createPattern(n.data,jS[a]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,h,d),e.translate(-i,-s,!0)}else e.drawImage(n.data,i,s,h,d);r&&e.restore()}S&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,p-i,g-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,x,!1,v,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&S(s))return void en.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=ms(t).image;this._draw(t,a,!1,i)}};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}([V(),YS(0,$(K)),YS(0,X(ro)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],HS);let zS=!1;const NS=new I((t=>{zS||(zS=!0,t(Er).to(HS).inSingletonScope(),t(vr).toService(Er),t(ro).toService(_o),Z(t,ro))}));let VS=class{constructor(){this.type="image",this.numberType=Hn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};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}([V()],VS);let WS=!1;const GS=new I(((t,e,i,s)=>{WS||(WS=!0,t(V_).to(VS).inSingletonScope(),t(ef).toService(V_))}));let US=class{constructor(){this.type="image",this.numberType=Hn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};US=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}([V()],US);let $S=!1;const XS=new I(((t,e,i,s)=>{$S||($S=!0,t(D_).to(US).inSingletonScope(),t(US).toService(D_))}));function KS(){KS.__loaded||(KS.__loaded=!0,aa.RegisterGraphicCreator("image",BS),Xi.load(NS),Xi.load(w_?GS:XS))}KS.__loaded=!1;const qS=KS,ZS=["segments","points","curveType","curveTension",...yn];class JS extends An{constructor(t={}){super(t),this.type="line",this.numberType=zn}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=un(i,s,e))}getGraphicTheme(){return ms(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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&&"zero"!==r&&"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&&"zero"!==r&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,ZS)}needUpdateTag(t){return super.needUpdateTag(t,ZS)}toCustomPath(){const t=this.attribute,e=new Ze,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 JS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return JS.NOWORK_ANIMATE_ATTR}}function QS(t){return new JS(t)}JS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},kn);let tM=!1;const eM=new I((t=>{tM||(tM=!0,t(Ao).toSelf().inSingletonScope(),t(wo).toSelf().inSingletonScope(),t(br).to(Ao).inSingletonScope(),t(vr).toService(br))}));class iM extends xo{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 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=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Pa(s,n+r,s.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ur.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let sM=class extends iM{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=zn}};sM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(br)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],sM);let nM=!1;const rM=new I(((t,e,i,s)=>{nM||(nM=!0,t(W_).to(sM).inSingletonScope(),t(ef).toService(W_))}));let aM=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=zn}};aM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(br)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],aM);let oM=!1;const lM=new I(((t,e,i,s)=>{oM||(oM=!0,t(P_).to(aM).inSingletonScope(),t(T_).toService(P_))}));function hM(){hM.__loaded||(hM.__loaded=!0,aa.RegisterGraphicCreator("line",QS),Xi.load(eM),Xi.load(w_?rM:lM))}hM.__loaded=!1;const dM=hM,cM=["path","customPath",...yn];class uM extends An{constructor(t){super(t),this.type="path",this.numberType=Nn}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 Ze?e.path:(D(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ze?this.cache:t.path)}getGraphicTheme(){return ms(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);$v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return Si.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;S(t.path,!0)?this.cache=(new Ze).fromString(t.path):t.customPath&&(this.cache=new Ze,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,cM)}needUpdateTag(t){return super.needUpdateTag(t,cM)}toCustomPath(){return(new Ze).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new uM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return uM.NOWORK_ANIMATE_ATTR}}function pM(t){return new uM(t)}uM.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},kn);const gM=Eo,mM=mo;var _M=function(t,e){return function(i,s){e(i,s,t)}};let fM=class extends xo{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Nn,this.builtinContributions=[mM,gM],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=null!==(l=this.tempTheme)&&void 0!==l?l:ms(t,null==r?void 0:r.theme).path,{x:u=c.x,y:p=c.y}=t.attribute,g=null!==(h=this.z)&&void 0!==h?h:0,m=this.valid(t,c,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:y}=m;e.beginPath(),t.pathShape?ye(t.pathShape.commandList,e,i,s,1,1,g):ye((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,s,1,1,g),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,v,y,_,f,c,n,a,o),y&&(o?o(e,t.attribute,c):f&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,c),e.stroke())),v&&(a?a(e,t.attribute,c):_&&(e.setCommonStyle(t,t.attribute,u-i,p-s,c),e.fill())),this.afterRenderStep(t,e,i,s,v,y,_,f,c,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};fM=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}([V(),_M(0,$(K)),_M(0,X(ao)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fM);let vM=!1;const yM=new I((t=>{vM||(vM=!0,t(fM).toSelf().inSingletonScope(),t(xr).to(fM).inSingletonScope(),t(vr).toService(xr),t(ao).toService(_o),Z(t,ao))}));let bM=class extends iM{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Nn}};bM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bM);let xM=!1;const SM=new I(((t,e,i,s)=>{xM||(xM=!0,t(G_).to(bM).inSingletonScope(),t(ef).toService(G_))}));let MM=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Nn}};MM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],MM);let kM=!1;const AM=new I(((t,e,i,s)=>{kM||(kM=!0,t(O_).to(MM).inSingletonScope(),t(T_).toService(O_))}));function wM(){wM.__loaded||(wM.__loaded=!0,aa.RegisterGraphicCreator("path",pM),Xi.load(yM),Xi.load(w_?SM:AM))}wM.__loaded=!1;const TM=wM,LM=[[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 CM extends Kv{constructor(t){super(t),this.type="rect3d",this.numberType=Un}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=pt(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e=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}([V()],DM);let PM=!1;const OM=new I((t=>{PM||(PM=!0,t(kr).to(DM).inSingletonScope(),t(vr).toService(kr))}));let RM=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Un,this.themeType="rect"}};RM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(kr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],RM);let BM=!1;const IM=new I(((t,e,i,s)=>{BM||(BM=!0,t($_).to(RM).inSingletonScope(),t(ef).toService($_))}));function FM(){FM.__loaded||(FM.__loaded=!0,aa.RegisterGraphicCreator("rect3d",EM),Xi.load(OM),Xi.load(IM))}FM.__loaded=!1;const YM=FM;class jM{constructor(t,e,i,s,n,r,a,o,l,h,d,c,u,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Mi[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);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=-n:"center"===this.globalAlign&&(o=-n/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;ithis[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;ithis[this.directionKey.top]+l||rthis[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,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;it&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width;let n=this.height||s||0;n=Math.min(n,s);let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;ithis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+n>this[this.directionKey.top]+r||at&&(t=n),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;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+nthis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),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}}}class HM{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const s=_n(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof s?s>this.fontSize?s:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:a,width:o}=Di(t,i);let l=0,h=0,d=0;this.height>r&&(l=(this.height-r)/2,h=Math.ceil(l),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=r-l):"bottom"===this.textBaseline?(this.ascent=r-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=a+d),this.length=t.length,this.width=o||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,"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}=Di(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,s,n){let r=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Li(r,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=Di(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||false;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Ti(t,e)}(t,this.character),t.strokeText(r,a,e)),function(t,e){const i=e&&e.fill||true;if(!i)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.fillStyle=i,Ti(t,e)}(t,this.character),this.character.fill&&t.fillText(r,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&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=Li(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=Di(this.text.slice(t),this.character);return i+this.ellipsisWidth-s}return i}}class zM extends RS{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=on(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(y(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=on(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:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class NM{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof zM?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Mi[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof HM){const e=wi.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,s=this.height;let n=this.left,r=0;this.actualWidtht.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=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 zM)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=Di(r,i.character),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}this.paragraphs.map(((e,n)=>{if(e instanceof zM)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);e.draw(t,s+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof zM)break;const{width:n}=Di(t,s.character),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof zM?t.width:t.getWidthWithEllips(this.direction)})),i}}class VM{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=Mi[this.direction]}store(t){if(t instanceof zM){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 NM(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,e=!1){t instanceof zM?"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&&("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,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Li(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new HM(i,t.newLine,t.character),new HM(s,!0,t.character)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const WM=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...yn];class GM extends An{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=$n,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:yi.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:yi.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:yi.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:yi.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:yi.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:yi.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:yi.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:yi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return ms(this).richtext}updateAABBBounds(t,e,i){const{width:s=e.width,height:n=e.height,maxWidth:r=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(s>0&&n>0)i.set(0,0,s,n);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=s||e||0,h=n||o||0;h="number"==typeof a&&h>a?a:h||0,l="number"==typeof r&&l>r?r:l||0,i.set(0,0,l,h)}let h=0;switch(l){case"top":h=0;break;case"middle":h=-i.height()/2;break;case"bottom":h=-i.height()}let d=0;switch(o){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}return i.translate(d,h),Si.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Si.graphicService.updateHTMLTextAABBBounds(t,e,i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,WM)}needUpdateTag(t){return super.needUpdateTag(t,WM)}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{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,_.push(t)}}else{const e=this.combinedStyleToCharacter(f[t]);if(h(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i0,y="number"==typeof n&&Number.isFinite(n)&&n>0,b="number"==typeof r&&Number.isFinite(r)&&r>0&&(!v||r<=s),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=n),S=new jM(0,0,(b?r:v?s:0)||0,(x?a:y?n:0)||0,o,l,d,c,u,p||"horizontal",!b&&v,!x&&y,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),M=new VM(S);if(m){let t=0,e=!1;for(let i=0;i<_.length;i++){const s=_[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&S.lines[S.lines.length-1].paragraphs.push(s)):M.deal(s,!0),S.lines.length!==t&&(t=S.lines.length,M.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,S.lines[S.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,M.lineWidth=0),M.send()}}else for(let t=0;t<_.length;t++)M.deal(_[t]);if(M.send(),!("horizontal"===S.layoutDirection?b:x)){const t=S.getActualSizeWidthEllipsis();let e="horizontal"===S.layoutDirection?t.width:t.height;("horizontal"===S.layoutDirection?v:y)&&(e=Math.min(e,"horizontal"===S.layoutDirection?s:n)),S.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=S}clone(){return new GM(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,s,n,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===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;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-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return GM.NOWORK_ANIMATE_ATTR}}function UM(t){return new GM(t)}GM.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},kn);let $M=class extends xo{constructor(){super(),this.numberType=$n,this.builtinContributions=[x_],this.init()}drawShape(t,e,i,s,n){const r=ms(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 d=Xa(o,l,!0),c=Xa(o,a,!0);d&&(e.translate(i,s),this.beforeRenderStep(t,e,i,s,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,d,c,d,c,r,n))}drawIcon(t,e,i,s,n){var r;const a=ms(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:m=a.backgroundRadius,margin:_}=t.attribute,{backgroundWidth:f=o,backgroundHeight:v=l}=t.attribute;if(_&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(f-o)/2,n=(v-l)/2;0===m?(e.beginPath(),e.rect(i-t,s-n,f,v)):(e.beginPath(),Ga(e,i-t,s-n,f,v,m)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const y=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,s,o,l))}draw(t,e,i){const s=ms(t).richtext;this._draw(t,s,!1,i)}};$M=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],$M);let XM=!1;const KM=new I((t=>{XM||(XM=!0,t(Tr).to($M).inSingletonScope(),t(vr).toService(Tr))}));let qM=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=$n}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};qM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],qM);let ZM=!1;const JM=new I(((t,e,i,s)=>{ZM||(ZM=!0,t(J_).to(qM).inSingletonScope(),t(ef).toService(J_))}));let QM=!1;const tk=new I(((t,e,i,s)=>{QM||(QM=!0,t(D_).to(US).inSingletonScope(),t(US).toService(D_))}));function ek(){ek.__loaded||(ek.__loaded=!0,aa.RegisterGraphicCreator("richtext",UM),Xi.load(KM),Xi.load(w_?JM:tk))}ek.__loaded=!1;const ik=ek;function sk(t,e,i,s){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n0===t))?sk(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void sk(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],d=e[(r+1)%e.length],c=h.x-o.x,u=h.y-o.y,p=h.x-d.x,g=h.y-d.y,m=(Math.atan2(u,c)-Math.atan2(g,p))/2,_=Math.abs(Math.tan(m));let f=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,v=f/_;const y=nk(c,u),b=nk(p,g),x=Math.min(y,b);v>x&&(v=x,f=x*_);const S=rk(h,v,y,c,u),M=rk(h,v,b,p,g),k=2*h.x-S.x-M.x,A=2*h.y-S.y-M.y,w=nk(k,A),T=rk(h,nk(v,f),w,k,A);let L=Math.atan2(S.y-T.y,S.x-T.x);const C=Math.atan2(M.y-T.y,M.x-T.x);let E=C-L;E<0&&(L=C,E=-E),E>Math.PI&&(E-=Math.PI),0===r?t.moveTo(S.x+i,S.y+s):t.lineTo(S.x+i,S.y+s),E&&t.arcTo(h.x+i,h.y+s,M.x+i,M.y+s,f),t.lineTo(M.x+i,M.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,d,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};hk=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}([V(),lk(0,$(K)),lk(0,X(oo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],hk);let dk=!1;const ck=new I((t=>{dk||(dk=!0,t(Sr).to(hk).inSingletonScope(),t(vr).toService(Sr),t(oo).toService(_o),Z(t,oo))}));let uk=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Vn}};uk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Sr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],uk);let pk=!1;const gk=new I(((t,e,i,s)=>{pk||(pk=!0,t(q_).to(uk).inSingletonScope(),t(ef).toService(q_))}));let mk=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Vn}};mk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Sr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mk);let _k=!1;const fk=new I(((t,e,i,s)=>{_k||(_k=!0,t(F_).to(mk).inSingletonScope(),t(T_).toService(F_))}));function vk(){vk.__loaded||(vk.__loaded=!0,aa.RegisterGraphicCreator("polygon",lS),Xi.load(ck),Xi.load(w_?gk:fk))}vk.__loaded=!1;const yk=vk;class bk extends An{constructor(t){super(t),this.type="glyph",this.numberType=Yn,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,s){super.setAttribute(t,e,i,s),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return ms(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}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;this.stopStateAnimates();const s={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(s,r.attributes),(null===(i=r.subAttributes)||void 0===i?void 0:i.length)&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,s)=>{i.updateNormalAttrs(n[s]),i.applyStateAttrs(n[s],t,e)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new bk(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return bk.NOWORK_ANIMATE_ATTR}}function xk(t){return new bk(t)}bk.NOWORK_ANIMATE_ATTR=kn;let Sk=class{constructor(){this.numberType=Yn}drawShape(t,e,i,s,n,r,a,o){n.drawContribution&&t.getSubGraphic().forEach((t=>{const l=n.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,s,n,r,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;if(n.highPerformanceSave(),!i.drawContribution)return;const r=ms(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:r})})),n.highPerformanceRestore()}};Sk=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}([V()],Sk);let Mk=!1;const kk=new I((t=>{Mk||(Mk=!0,t(Cr).to(Sk).inSingletonScope(),t(vr).toService(Cr))}));class Ak{constructor(){this.type="glyph",this.numberType=Yn}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;const n=null==i?void 0:i.pickerService;if(n){let s=!1;return t.getSubGraphic().forEach((t=>{if(s)return;const r=n.pickItem(t,e,null,i);s=!(!r||!r.graphic)})),s}return!1}}let wk=class extends Ak{constructor(t){super(),this.canvasRenderer=t}};wk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Cr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],wk);let Tk=!1;const Lk=new I(((t,e,i,s)=>{Tk||(Tk=!0,t(Q_).to(wk).inSingletonScope(),t(ef).toService(Q_))}));let Ck=class extends Ak{constructor(t){super(),this.canvasRenderer=t}};Ck=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Cr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ck);let Ek=!1;const Dk=new I(((t,e,i,s)=>{Ek||(Ek=!0,t(Y_).to(Ck).inSingletonScope(),t(Ck).toService(Y_))}));function Pk(){Pk.__loaded||(Pk.__loaded=!0,aa.RegisterGraphicCreator("glyph",xk),Xi.load(kk),Xi.load(w_?Lk:Dk))}Pk.__loaded=!1;const Ok=Pk,Rk=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Bk extends er{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,i){w(this.attribute[t])&&w(e)&&!xs(this.attribute[t])&&!xs(e)?E(this.attribute[t],e):this.attribute[t]=e,Rk.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>Rk.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){D(e)&&(e=Object.keys(t));for(let i=0;i=.5:i<.5}return s?jk(t,e)>s:"largeText"===i?jk(t,e)>3:jk(t,e)>4.5}function jk(t,e){const i=Hk(t),s=Hk(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function Hk(t){const e=function(t){let e="",i="",s="";const n="#"===t[0]?1:0;for(let r=n;r{const i=e(t);t.isContainer&&!i&&Nk(t,e)}))}const Vk=t=>!D(t)&&!1!==t.visible;function Wk(t){return t>=0&&t3*Math.PI/2&&t<=2*Math.PI}function Gk(t,e,i){return Math.abs(t-e)Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":eMath.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:eMath.PI&&!i.includes("inside")?"bottom":"top"}}const $k=-.5*Math.PI,Xk=1.5*Math.PI,Kk="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";var qk;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(qk||(qk={}));const Zk={[qk.selectedReverse]:{},[qk.selected]:{},[qk.hover]:{},[qk.hoverReverse]:{}},Jk={container:"",width:30,height:30,style:{}},Qk=(t,e,i,s)=>new Fi(Object.assign({defaultFontParams:Object.assign({fontFamily:Kk,fontSize:14},s),getTextBounds:i?void 0:b_,specialCharSet:"-/: .,@%'\"~"+Fi.ALPHABET_CHAR_SET+Fi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function tA(t,e,i={}){if(!t)return{width:0,height:0};const s=b_({text:t,fontFamily:e.fontFamily||i.fontFamily||Kk,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:s.width(),height:s.height()}}function eA(t,e="type"){var i,s;return bs(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}function iA(t){var e,i;return M(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}function sA(t,e="type"){const i=eA(t,e);return"rich"===i?aa.richtext(iA(t)):("html"===i?t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.html=s,t.text=i,t.renderable=!1,t}(t):"react"===i&&(t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.react=s,t.text=i,t.renderable=!1,t}(t)),aa.text(t))}function nA(t,e,i,s,n){"right"===t?"center"===i?e.setAttribute("x",s-n/2):"right"===i||"end"===i?e.setAttribute("x",s):e.setAttribute("x",s-n):"center"===i?e.setAttribute("x",s+n/2):"right"===i||"end"===i?e.setAttribute("x",s+n):e.setAttribute("x",s)}const rA=new Uint32Array(33),aA=new Uint32Array(33);aA[0]=0,rA[0]=~aA[0];for(let t=1;t<=32;++t)aA[t]=aA[t-1]<<1|1,rA[t]=~aA[t];function oA(t,e,i={top:0,left:0,right:0,bottom:0}){const{top:s=0,left:n=0,right:r=0,bottom:a=0}=i,o=Math.max(1,Math.sqrt(t*e/1e6)),l=~~((t+n+r+o)/o),h=~~((e+s+a+o)/o),d=t=>~~(t/o);return d.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+32)/32));function s(t,e){i[t]|=e}function n(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const n=s*t+e;return i[n>>>5]&1<<(31&n)},set:(e,i)=>{const n=i*t+e;s(n>>>5,1<<(31&n))},clear:(e,i)=>{const s=i*t+e;n(s>>>5,~(1<<(31&s)))},getRange:({x1:s,y1:n,x2:r,y2:a})=>{if(r<0||a<0||s>t||n>e)return!0;let o,l,h,d,c=a;for(;c>=n;--c)if(o=c*t+s,l=c*t+r,h=o>>>5,d=l>>>5,h===d){if(i[h]&rA[31&o]&aA[1+(31&l)])return!0}else{if(i[h]&rA[31&o])return!0;if(i[d]&aA[1+(31&l)])return!0;for(let t=h+1;t{if(r<0||a<0||i>t||n>e)return;let o,l,h,d,c;for(;n<=a;++n)if(o=n*t+i,l=n*t+r,h=o>>>5,d=l>>>5,h===d)s(h,rA[31&o]&aA[1+(31&l)]);else for(s(h,rA[31&o]),s(d,aA[1+(31&l)]),c=h+1;c{let a,o,l,h,d;for(;i<=r;++i)if(a=i*t+e,o=i*t+s,l=a>>>5,h=o>>>5,l===h)n(l,aA[31&a]|rA[1+(31&o)]);else for(n(l,aA[31&a]),n(h,rA[1+(31&o)]),d=l+1;di<0||s<0||r>=e||n>=t,toImageData:s=>{const n=s.createImageData(t,e),r=n.data;for(let s=0;s>>5]&1<<(31&n);r[a+0]=255*o,r[a+1]=255*o,r[a+2]=255*o,r[a+3]=31}return n}}}(l,h),d.x=t=>~~((t+n)/o),d.y=t=>~~((t+s)/o),d.ratio=o,d.padding=i,d.width=t,d.height=e,d}function lA(t,e,i=!1){if(i){const{x1:i,x2:s,y1:n,y2:r}=e,a=Rs(i,0,t.width),o=Rs(s,0,t.width),l=Rs(n,0,t.height),h=Rs(r,0,t.height);return{x1:t.x(a),x2:t.x(o),y1:t.y(l),y2:t.y(h)}}return{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}function hA(t,e,i,s=!0,n=0){let r=i;return n>0&&(r={x1:i.x1-n,x2:i.x2+n,y1:i.y1-n,y2:i.y2+n}),r=lA(t,r),!(s&&e.outOfBounds(r)||e.getRange(r))}function dA(t,e,i,s=[],n=!0,r=0){const a=s.filter((t=>M(t)));for(let s=0;sa(n.AABBBounds,r,t,s.offset)));return dA(t,e,n,o,h,d)}return!1}var c;if("moveY"===i.type){const s=(i.offset?xs(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return dA(t,e,n,s,h,d)}if("moveX"===i.type){const s=(i.offset?xs(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return dA(t,e,n,s,h,d)}return!1}const uA=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],pA=["top","inside-top","inside"];function gA(t,e,i){const{x1:s,x2:n,y1:r,y2:a}=t.AABBBounds,o=Math.min(s,n),l=Math.max(s,n),h=Math.min(r,a),d=Math.max(r,a);let c=0,u=0;return o<0&&l-o<=e?c=-o:l>e&&o-(l-e)>=0&&(c=e-l),h<0&&d-h<=i?u=-h:d>i&&h-(d-i)>=0&&(u=i-d),{dx:c,dy:u}}class mA extends Cs{constructor(t,e,i,s,n){super(t,e,i,s,n)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,s,n,r,a,o;this.fromNumber=h(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=h(null===(s=this.to)||void 0===s?void 0:s.text)?null===(n=this.to)||void 0===n?void 0:n.text:Number.parseFloat(null===(r=this.to)||void 0===r?void 0:r.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(St(this.fromNumber),St(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}var _A;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(_A||(_A={}));class fA extends Cs{constructor(t,e,i,s,n){var r,a;super(t,e,i,s,n),this.newPointAnimateType=null!==(r=null==n?void 0:n.newPointAnimateType)&&void 0!==r?r:"grow",this.clipRangeByDimension=null!==(a=null==n?void 0:n.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t,e=!1){if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var s,n;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(n=null===(s=t.points)||void 0===s?void 0:s.length)&&void 0!==n?n:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let s,n,r=1/0,a=-1/0;for(let t=0;t=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,n=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],Zo(this.clipRange)?this.clipRange=Rs(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const l=i.get(t.context);return l?(o=l,[l,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:ea&&n?[n,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],s=new be(e.x,e.y,e.x1,e.y1);return s.defined=i.defined,s.context=i.context,s}))}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const s=cn(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const s=t+this.segmentsCache[i],n=this.points.slice(t,s);return t=s,Object.assign(Object.assign({},e),{points:n})}))}else i.points=this.points}}class vA extends Cs{constructor(t,e,i,s,n){super(null,null,i,s,n),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==n?void 0:n.group,this._clipGraphic=null==n?void 0:n.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:he.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:he.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;const s={};Object.keys(this.clipFromAttribute).forEach((t=>{s[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*e})),this._clipGraphic.setAttributes(s,!1,{type:he.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class yA extends vA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p,g,m,_;const f=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},v=null!==(o=f.width)&&void 0!==o?o:0,y=null!==(l=f.height)&&void 0!==l?l:0,b=null!==(h=null==n?void 0:n.animationType)&&void 0!==h?h:"in",x=null!==(d=null==n?void 0:n.startAngle)&&void 0!==d?d:0,S=null!==(c=null==n?void 0:n.orient)&&void 0!==c?c:"clockwise";let M=0,k=0;"anticlockwise"===S?(k="in"===b?x+2*Math.PI:x,k=x+2*Math.PI):(M=x,k="out"===b?x+2*Math.PI:x);const A=Si.graphicService.creator.arc({x:null!==(p=null===(u=null==n?void 0:n.center)||void 0===u?void 0:u.x)&&void 0!==p?p:v/2,y:null!==(m=null===(g=null==n?void 0:n.center)||void 0===g?void 0:g.y)&&void 0!==m?m:y/2,outerRadius:null!==(_=null==n?void 0:n.radius)&&void 0!==_?_:(v+y)/2,innerRadius:0,startAngle:M,endAngle:k,fill:!0});let w,T;"anticlockwise"===S?(w={startAngle:x+2*Math.PI},T={startAngle:x}):(w={endAngle:x},T={endAngle:x+2*Math.PI}),super("in"===b?w:T,"in"===b?T:w,i,s,{group:null==n?void 0:n.group,clipGraphic:A})}}class bA extends vA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p;const g=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},m=null!==(l=null!==(o=null==n?void 0:n.width)&&void 0!==o?o:g.width)&&void 0!==l?l:0,_=null!==(d=null!==(h=null==n?void 0:n.height)&&void 0!==h?h:g.height)&&void 0!==d?d:0,f=null!==(c=null==n?void 0:n.animationType)&&void 0!==c?c:"in",v=null!==(u=null==n?void 0:n.direction)&&void 0!==u?u:"x",y=null!==(p=null==n?void 0:n.orient)&&void 0!==p?p:"positive",b=Si.graphicService.creator.rect({x:0,y:0,width:"in"===f&&"x"===v?0:m,height:"in"===f&&"y"===v?0:_,fill:!0});let x={},S={};"y"===v?"negative"===y?(x={y:_,height:0},S={y:0,height:_}):(x={height:0},S={height:_}):"negative"===y?(x={x:m,width:0},S={x:0,width:m}):(x={width:0},S={width:m}),super("in"===f?x:S,"in"===f?S:x,i,s,{group:null==n?void 0:n.group,clipGraphic:b})}}class xA extends Cs{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),n=this.target.getComputedAttribute("z"),r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=lt-a),this.theta=a,this.phi=r}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:s,r:n,cb:r}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,l=this.phi,h=n*Math.sin(l)*Math.cos(o)+s.x,d=n*Math.cos(l)+s.y,c=n*Math.sin(l)*Math.sin(o)+s.z;for(i.x=h,i.y=d,i.z=c,i.alpha=o+rt/2;i.alpha>lt;)i.alpha-=lt;i.alpha=lt-i.alpha,i.zIndex=-1e4*i.z,r&&r(i)}}class SA extends Cs{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((s=>{const n=s.easing,r="string"==typeof n?ws[n]:n;e=r(e),s.onUpdate(t,e,i)})),this.updating=!1)}}const MA={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function kA(t,e){var i,s;return null!==(s=null===(i=MA[e])||void 0===i?void 0:i.call(MA,t))&&void 0!==s?s:{from:{},to:{}}}function AA(t,e,i,s){t.attribute.text!==e.attribute.text&&Zo(Number(t.attribute.text)*Number(e.attribute.text))&&t.animate().play(new mA({text:t.attribute.text},{text:e.attribute.text},i,s))}const wA={mode:"same-time",duration:300,easing:"linear"};function TA(t){return 3===t||4===t}function LA(t,e){const{x1:i,y1:s,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=e;return!(i<=a&&n<=a||i>=l&&n>=l||s<=o&&r<=o||s>=h&&r>=h)}const CA=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function EA(t,e,i,s,n,r){return Math.abs(e/t)0?n:-n),y:s+e*n/Math.abs(t)}:{x:i+t*r/Math.abs(e),y:s+(e>0?r:-r)}}p_(),cf(),ik(),dM();class DA extends Bk{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){const{data:i}=t,s=function(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{const e=t.target;e===this._lastHover||jm(e.states)||(e.addState(qk.hover,!0),Nk(this,(t=>{t===e||jm(t.states)||t.addState(qk.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(Nk(this,(t=>{jm(t.states)||(t.removeState(qk.hoverReverse),t.removeState(qk.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void Nk(this,(t=>{jm(t.states)||(t.removeState(qk.selectedReverse),t.removeState(qk.selected))}));jm(e.states)||(e.addState(qk.selected,!0),Nk(this,(t=>{t===e||jm(t.states)||t.addState(qk.selectedReverse,!0)})),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,s,n,r;if((null===(e=t.detail)||void 0===e?void 0:e.type)===he.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===he.ANIMATE_UPDATE&&(null===(s=t.detail.animationState)||void 0===s?void 0:s.isFirstFrameOfStep)){const e=null!==(r=null===(n=t.target)||void 0===n?void 0:n.currentStates)&&void 0!==r?r:[],i=this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)];this.updateStatesOfLabels(i,e)}}}labeling(t,e,i,s){}_getLabelLinePoints(t,e){return function(t,e){if(!t||!e)return;if(zt(t,e,!0))return;const i=Math.min(t.x1,t.x2),s=Math.min(t.y1,t.y2),n=Math.min(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.abs(t.x2-i)/2,o=Math.abs(t.y2-s)/2,l=Math.abs(e.x2-n)/2,h=Math.abs(e.y2-r)/2,d=i+a,c=s+o,u=n+l,p=r+h,g=u-d,m=p-c;return[EA(g,m,d,c,a,o),EA(-g,-m,u,p,l,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds)}_createLabelLine(t,e){const i=this._getLabelLinePoints(t,e);if(i){const s=aa.line({points:i}),{line:n={}}=t.attribute;if(n.customShape){const i=n.customShape;s.pathProxy=s=>i({text:t,baseMark:e},s,new Ze)}return e&&e.attribute.fill&&s.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!jm(this.attribute.line.style)&&s.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(s),s}}render(){if(this._prepare(),D(this._idToGraphic)||this._isCollectionBase&&D(this._idToPoint))return;const{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:s,customOverlapFunc:n}=this.attribute;let r=this.attribute.data;xs(i)&&(r=i(r));let a=this._initText(r);a=xs(s)?s(r,a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(a),xs(n)?a=n(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(a=this._overlapping(a)),xs(this.attribute.onAfterOverlapping)&&this.attribute.onAfterOverlapping(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null),a&&a.length&&a.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!1!==e&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const e=this.attribute.state;e&&!jm(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;const e=this.attribute.labelLineState;e&&!jm(e)&&(t.states=e)}_createLabelText(t){var e,i;return sA(Object.assign(Object.assign({},null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),t),"textType")}_prepare(){var t,e;const i=[];let s;if(s=xs(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),s.forEach((t=>{"willRelease"!==t.releaseStatus&&i.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(e=this._idToPoint)||void 0===e||e.clear(),this._baseMarks=i,this._isCollectionBase="line-data"===this.attribute.type,!i||0===i.length)return;const{data:n}=this.attribute;if(n&&0!==n.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e!!t&&!0!==t)):r.attribute.stroke:r.attribute.fill},e),n),o=this._createLabelText(a);i.push(o)}return i}_layout(t){const{position:e,offset:i}=this.attribute;for(let s=0;s"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&_.setRange(lA(m,t.AABBBounds,!0))}))),p.length>0&&p.forEach((t=>{S(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&_.setRange(lA(m,t.AABBBounds,!0))})):t.AABBBounds&&_.setRange(lA(m,t.AABBBounds,!0))}));for(let e=0;ee.name===t),!0)}getGraphicBounds(t,e={}){if(t){if(!1!==t.attribute.visible)return t.AABBBounds;const{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}const{x:i,y:s}=e;return{x1:i,x2:i,y1:s,y2:s}}_renderLabels(t){var e;const{syncState:i}=this.attribute,s=new Map,n=this._graphicToText||new Map,r=[],a=[],{visible:o}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t&&t.forEach(((t,e)=>{var l;const h=this.getRelatedGraphic(t.attribute),d=this._isCollectionBase?t.attribute.id:h,c=(null==n?void 0:n.get(d))?"update":"enter";let u;if(o&&(u=this._createLabelLine(t,h)),i&&this.updateStatesOfLabels([u?{text:t,labelLine:u}:{text:t}],null!==(l=h.currentStates)&&void 0!==l?l:[]),"enter"===c)r.push(t),s.set(d,u?{text:t,labelLine:u}:{text:t}),this._addLabel({text:t,labelLine:u},r,a,e);else if("update"===c){const e=n.get(d);n.delete(d),s.set(d,e),this._updateLabel(e,{text:t,labelLine:u})}})),this._removeLabel(n),this._graphicToText=s}_addLabel(t,e,i,s){const{text:n,labelLine:r}=t,a=this.getRelatedGraphic(n.attribute);if(this._syncStateWithRelatedGraphic(a),!1!==this._enableAnimation&&!1!==this._animationConfig.enter){if(a){const{from:t,to:o}=kA(n.attribute,"fadeIn");n&&this.add(n),r&&(i.push(r),this.add(r)),this._animationConfig.enter.duration>0&&a.once("animate-bind",(l=>{n.setAttributes(t),r&&r.setAttributes(t);const h=this._afterRelatedGraphicAttributeUpdate(n,e,r,i,s,a,o,this._animationConfig.enter);a.on("afterAttributeUpdate",h)}))}}else n&&this.add(n),r&&this.add(r)}_updateLabel(t,e){const{text:i,labelLine:s}=t,{text:n,labelLine:r}=e;if(!1!==this._enableAnimation&&!1!==this._animationConfig.update){const{duration:e,easing:a}=this._animationConfig.update;(function(t,e,i){if(!y(i)){const{duration:s,easing:n,increaseEffect:r=!0}=i;return t.animate().to(e.attribute,s,n),void(r&&"text"===t.type&&"text"===e.type&&AA(t,e,s,n))}i.forEach((i=>{const{duration:s,easing:n,increaseEffect:r=!0,channel:a}=i,{to:o}=((t,e,i,s)=>{const n=Object.assign({},t.attribute),r=Object.assign({},e.attribute);return Fa(null==s?void 0:s.excludeChannels).forEach((t=>{delete r[t]})),Object.keys(r).forEach((t=>{i&&!i.includes(t)&&delete r[t]})),{from:n,to:r}})(t,e,a,i.options);jm(o)||t.animate().to(o,s,n),r&&"text"===t.type&&"text"===e.type&&AA(t,e,s,n)}))})(i,n,this._animationConfig.update),s&&r&&t.labelLine.animate().to(r.attribute,e,a)}else t.text.setAttributes(n.attribute),s&&r&&t.labelLine.setAttributes(r.attribute)}_removeLabel(t){const e=t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)};if(!1!==this._enableAnimation&&!1!==this._animationConfig.exit){const{duration:i,easing:s}=this._animationConfig.exit;t.forEach((t=>{var n;null===(n=t.text)||void 0===n||n.animate().to(kA(t.text.attribute,"fadeOut").to,i,s).onEnd((()=>{e(t)}))}))}else t.forEach((t=>{e(t)}))}updateStatesOfLabels(t,e){t.forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,s,n,r,a,{mode:o,duration:l,easing:h,delay:d}){const c=u=>{var p,g,m;const{detail:_}=u;if(!_)return{};const f=null===(p=_.animationState)||void 0===p?void 0:p.step;if(_.type!==he.ANIMATE_UPDATE||!f||"wait"===f.type&&null==(null===(g=f.prev)||void 0===g?void 0:g.type))return{};if(_.type===he.ANIMATE_END)return t.setAttributes(a),void(i&&i.setAttributes(a));const v=()=>{r&&(r.onAnimateBind=void 0,r.removeEventListener("afterAttributeUpdate",c))};switch(o){case"after":_.animationState.end&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h));break;case"after-all":n===e.length-1&&_.animationState.end&&(e.forEach((t=>{t.animate({onStart:v}).wait(d).to(a,l,h)})),s.forEach((t=>{t.animate().wait(d).to(a,l,h)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!r.containsPoint(e.x,e.y,le.LOCAL,null===(m=this.stage)||void 0===m?void 0:m.getPickerService())||(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}else _.animationState.isFirstFrameOfStep&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}};return c}_smartInvert(t){var e,i,s,n,r;const a=bs(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:o,contrastRatiosThreshold:l,alternativeColors:h,mode:d,interactInvertType:c}=a,u=null!==(e=a.fillStrategy)&&void 0!==e?e:"invertBase",p=null!==(i=a.strokeStrategy)&&void 0!==i?i:"base",g=null!==(s=a.brightColor)&&void 0!==s?s:"#ffffff",m=null!==(n=a.darkColor)&&void 0!==n?n:"#000000",_=null!==(r=a.outsideEnable)&&void 0!==r&&r;if("null"!==u||"null"!==p)for(let e=0;e{PA[t]=e};class RA{constructor(t,e,i,s,n,r,a,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=n,this.middleAngle=r,this.innerRadius=a,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class BA extends DA{constructor(t,e){const{data:i}=t,s=function(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);nthis.getGraphicBounds(t))),a=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"});let o=1/0;if(!1!==a.ellipsis){const t=this._createLabelText(a),e=this.getGraphicBounds(t);o=e.x2-e.x1}const l=n.map((t=>t.attribute)),h=Array.from(this._idToGraphic.values());this._line2MinLength=xs(this.attribute.line.line2MinLength)?this.attribute.line.line2MinLength(t,h,this.attribute):this.attribute.line.line2MinLength,this._alignOffset=null!==(e=xs(this.attribute.layout.alignOffset)?this.attribute.layout.alignOffset(t,h,this.attribute):this.attribute.layout.alignOffset)&&void 0!==e?e:0;const d=this.layoutArcLabels(this.attribute.position,this.attribute,h,l,r,o);for(let t=0;t{var i;return(null===(i=t.refDatum)||void 0===i?void 0:i.id)===e.id}));if(r){const e={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,points:r.pointA&&r.pointB&&r.pointC?[r.pointA,r.pointB,r.pointC]:void 0,line:r.labelLine};"richtext"===n[t].type?e.width=null!==(i=r.labelLimit)&&void 0!==i?i:n[t].attribute.width:e.maxLineWidth=null!==(s=r.labelLimit)&&void 0!==s?s:n[t].attribute.maxLineWidth,n[t].setAttributes(e)}}return n}layoutArcLabels(t,e,i,s,n,r){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=r;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)})),s.forEach(((t,i)=>{var r,o;const l=this._idToGraphic.get(t.id).attribute,h={x:null!==(r=null==l?void 0:l.x)&&void 0!==r?r:0,y:null!==(o=null==l?void 0:l.y)&&void 0!==o?o:0};if(!D(s[i])&&!D(n[i])){const t=s[i]?s[i]:null,r=n[i]?n[i]:{x1:0,x2:0,y1:0,y2:0},o=(l.startAngle+l.endAngle)/2,c=l.endAngle-l.startAngle,u=Dt(l.endAngle-c/2),p=Tt(h,l.outerRadius,o),g=Tt(h,a+e.line.line1MinLength,o),m=new RA(t,p,g,u,c,o,l.innerRadius,l.outerRadius,h);m.pointA=Tt(h,this.computeDatumRadius(2*h.x,2*h.y,l.outerRadius),m.middleAngle),m.labelSize={width:r.x2-r.x1,height:r.y2-r.y1},1===(d=m.quadrant)||2===d?this._arcRight.set(m.refDatum,m):TA(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}var d}));const o=Array.from(this._arcLeft.values()),l=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":case"inside-center":h.push(...this._layoutInsideLabels(l,e,i)),h.push(...this._layoutInsideLabels(o,e,i));break;default:h.push(...this._layoutOutsideLabels(l,e,i)),h.push(...this._layoutOutsideLabels(o,e,i))}return h}_layoutInsideLabels(t,e,i){var s,n;const r=e,a=r.spaceWidth,o=null!==(s=r.position)&&void 0!==s?s:"inside",l=null!==(n=r.offsetRadius)&&void 0!==n?n:-a;return t.forEach((t=>{var i,s,n;const{labelSize:h,radian:d}=t,c=t.innerRadius,u=t.outerRadius;let p;if(d<(g=u,(m=h.height)>2*g?NaN:2*Math.asin(m/2/g)))p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=u-t-a}var g,m;!0!==r.rotate&&(p=u-a);const _=this._getFormatLabelText(t.refDatum,p);t.labelText=_;const f=Math.min(p,t.labelSize.width),v=this._computeAlign(t,e);let y,b=0;if("inside"===o&&(b="left"===v?f:"right"===v?0:f/2),y="inside-inner"===o?c-l+b:"inside-center"===o?c+(u-c)/2:u+l-b,t.labelPosition=Tt(t.circleCenter,y,t.middleAngle),t.labelLimit=f,cd(f,0)||(t.labelVisible=!1),!1!==r.rotate){t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:t.middleAngle;let a=null!==(n=r.offsetAngle)&&void 0!==n?n:0;["inside-inner","inside-outer"].includes(o)&&(a+=Math.PI/2),t.angle+=a}})),t}_layoutOutsideLabels(t,e,i){var s,n,r;const a=null!==(s=i[0].attribute.x)&&void 0!==s?s:0,o=2*(null!==(n=i[0].attribute.y)&&void 0!==n?n:0),l=e.layout,h=e.spaceWidth;if(t.forEach((t=>{const e=TA(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+this._line2MinLength+h),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===l.strategy){for(const s of t){const{labelPosition:t,labelSize:n}=s;s.labelLimit=n.width,s.pointB=TA(s.quadrant)?{x:t.x+n.width/2+this._line2MinLength+h,y:t.y}:{x:t.x-n.width/2-this._line2MinLength-h,y:t.y},this._computeX(s,e,i)}!1===e.coverEnable&&"none"===l.strategy&&this._coverLabels(t)}else{const s=o/((null===(r=e.textStyle)||void 0===r?void 0:r.fontSize)||16);this._adjustY(t,s,e,i);const{minY:n,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(o,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),l=Math.max(Math.abs(o/2-n),Math.abs(a-o/2)),h=this._computeLayoutRadius(l,e,i);for(const s of t)this._computePointB(s,h,e,i),this._computeX(s,e,i)}const d=2*a;return t.forEach((t=>{var i,s;t.labelVisible&&(ud(t.pointB.x,this._line2MinLength+h)||cd(t.pointB.x,d-this._line2MinLength-h))&&(t.labelVisible=!1),t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:0,e.offsetAngle&&(t.angle+=e.offsetAngle),t.labelLine=Object.assign(Object.assign({},e.line),{visible:t.labelVisible})})),t}_computeX(t,e,i){var s;const n=t.circleCenter,r=this.attribute.width;this.attribute.height;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,h=null===(s=e.layout)||void 0===s?void 0:s.align,d=e.spaceWidth,{labelPosition:c,quadrant:u,pointB:p}=t;Zo(p.x*p.y)||(t.pointC={x:NaN,y:NaN},c.x=NaN,t.labelLimit=0);const g=this.computeRadius(o,e.width,e.height),m=TA(u)?-1:1;let _=0,f=(m>0?r-p.x:p.x-0)+this._alignOffset-this._line2MinLength-d;"labelLine"===h&&(_=(g+l+this._line2MinLength)*m+n.x,f=(m>0?r-_:_-0)-d);const v=this._getFormatLabelText(t.refDatum,f);t.labelText=v;let y=Math.min(f,t.labelSize.width);switch(h){case"labelLine":break;case"edge":_=m>0?r-y-d:0+y+d;break;default:_=p.x+m*this._line2MinLength}y=Math.max(this._ellipsisWidth,y);const b=y0?r:0)-m*x+m*this._alignOffset,t.pointC.x+=m*this._alignOffset):c.x=_+m*(this._alignOffset+d+x)}_computeAlign(t,e){var i,s,n,r,a,o;const l=e,h=null!==(s=null===(i=l.textStyle)||void 0===i?void 0:i.textAlign)&&void 0!==s?s:null===(n=l.textStyle)||void 0===n?void 0:n.align,d=null!==(a=null===(r=l.layout)||void 0===r?void 0:r.textAlign)&&void 0!==a?a:null===(o=l.layout)||void 0===o?void 0:o.align;return"inside"!==l.position?D(h)||"auto"===h?"edge"===d?TA(t.quadrant)?"left":"right":TA(t.quadrant)?"right":"left":h:D(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,e,i,s){var n;s[0].attribute.x;const r=2*(null!==(n=s[0].attribute.y)&&void 0!==n?n:0),a=i.layout;if("vertical"===a.strategy){let e,i=0;const s=t.length;if(s<=0)return;for(let n=0;n=0&&t[e].getLabelBounds().y2>r;e--)t[e].labelVisible=!1}else if("none"!==a.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let o=1/0,l=-1/0;for(let h=0;hi?e.labelPosition.y=i-g.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,g,u)}else if(-1!==c&&-1===u){const i=p.labelPosition.y;ds?(e.labelPosition.y=s-g.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,p,e,n[h].originIndex)):d=0&&e0&&so)return r}r=e}return i}_findNextVisibleIndex(t,e,i,s){const n=(i-e)*s;for(let i=1;i<=n;i++){const n=e+i*s;if(t[n].labelVisible)return n}return-1}_computePointB(t,e,i,s){const n=i;let r=0;s.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,i.width,i.height),o=n.line.line1MinLength;if("none"===n.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const s=t.circleCenter,n=this.computeRadius(a,i.width,i.height),{labelPosition:r,quadrant:l}=t,h=e-Math.max(n+o,t.outerRadius),d=Math.sqrt(e**2-Math.abs(s.y-r.y)**2)-h;Zo(d)?t.pointB={x:s.x+d*(TA(l)?-1:1),y:r.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){const s=t.circleCenter,n={width:2*s.x,height:2*s.y};let r=0;i.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,e.width,e.height),o=e.line.line1MinLength,{width:l,height:h}=n,d=this.computeRadius(a,e.width,e.height),c=this._computeLayoutRadius(h/2,e,i),u=Math.abs(t.center.x-l/2),p=t.center.y-h/2;let g,m,_;if(dd(l/2,u))g=0,m=1,_=-p;else if(dd(h/2,p))g=1,m=0,_=-u;else{const t=-1/(p/u);g=t,m=-1,_=p-t*u}const f=function(t,e,i,s,n,r){if(0===t&&0===e||r<=0)return[];if(0===t){const t=-i/e,n=r**2-(t-0)**2;return n<0?[]:0===n?[{x:s,y:t}]:[{x:Math.sqrt(n)+s,y:t},{x:-Math.sqrt(n)+s,y:t}]}if(0===e){const e=-i/t,n=r**2-(e-s)**2;return n<0?[]:0===n?[{x:e,y:0}]:[{x:e,y:Math.sqrt(n)+0},{x:e,y:0-Math.sqrt(n)}]}const a=(e/t)**2+1,o=2*((i/t+s)*(e/t)-0),l=o**2-4*a*((i/t+s)**2+0-r**2);if(l<0)return[];const h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),c=-(e*h+i)/t;return 0===l?[{x:c,y:h}]:[{x:c,y:h},{x:-(e*d+i)/t,y:d}]}(g,m,_,o+d-c,0,c);if(f.length<2)return;let v,y;f[0].x>f[1].x&&f.reverse(),f[0].x<0?dd(f[0].y,f[1].y)?cd(t.middleAngle,-Math.PI)&&ud(t.middleAngle,0)||cd(t.middleAngle,Math.PI)&&ud(t.middleAngle,2*Math.PI)?(v=0,y=f[1].y+h/2):(v=f[1].y+h/2,y=h):f[0].y{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+r,h=l-n;return Math.max((h**2+t**2)/(2*h),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,n=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[])),s&&0!==s.length||(s=[e]);const r="start"===i?0:s.length-1;return s[r]?{x1:s[r].x,x2:s[r].x,y1:s[r].y,y2:s[r].y}:void 0}labeling(t,e,i="end",s=0){return function(t,e,i="end",s=0){if(!t||!e)return{x:1/0,y:1/0};const{x1:n,x2:r}=t,a=Math.abs(r-n),o=e.x1;let l=o;return"end"===i?l=o+a/2+s:"start"===i&&(l=o-a/2-s),{x:l,y:e.y1}}(t,e,i,s)}}IA.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};const FA=()=>{OA("line",IA),OA("area",IA)};class YA extends DA{constructor(t,e){const{data:i}=t,s=function(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{if(!t)return;const{x1:n,y1:r,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-r),d=(e.x1+e.x2)/2,c=(e.y1+e.y2)/2;let u=0,p=0,g=0,m=0;e&&(g=Math.abs(e.x1-e.x2)/2,m=Math.abs(e.y1-e.y2)/2);const _={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":u=-1;break;case"right":u=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":u=Math.sin(_[i]*(Math.PI/180)),p=Math.cos(_[i]*(Math.PI/180));break;case"center":u=0,p=0}return{x:d+u*(s+g)+Math.sign(u)*(l/2),y:c+p*(s+m)+Math.sign(p)*(h/2)}})(t,e,i,s)}}YA.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};const jA=()=>{OA("symbol",YA),OA("line-data",YA)},HA=(t,e)=>{const{x1:i,x2:s,y1:n,y2:r}=t,a=Math.abs(s-i),o=Math.abs(r-n);let l=(i+s)/2,h=(n+r)/2,d=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":d=-.5;break;case"right":case"inside-right":d=.5;break;case"top-right":d=.5,c=-.5;break;case"top-left":d=-.5,c=-.5;break;case"bottom-right":d=.5,c=.5;break;case"bottom-left":d=-.5,c=.5}return l+=d*a,h+=c*o,{x:l,y:h}};class zA extends DA{constructor(t,e){const{data:i}=t,s=function(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{Mx(),TM(),fc.registerGraphic(Qd.path,pM)},VA=()=>{Mx(),fy(),OA("rect",zA),fc.registerGraphic(Qd.rect,qv)},WA=()=>{Mx(),dM(),fc.registerGraphic(Qd.rule,QS)},GA=()=>{Mx(),Uv(),jA(),fc.registerGraphic(Qd.symbol,Ev)},UA=()=>{Mx(),cf(),ik(),fc.registerGraphic(Qd.text,f_)},$A=()=>{Mx(),Ok(),fc.registerGraphic(Qd.glyph,xk)};class XA extends yx{constructor(){super(...arguments),this.type=XA.type,this._marks=[]}getMarks(){return this._marks}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}isMarkExist(t){return void 0!==this._marks.find((e=>e.id===t.id||e.name===t.name))}addMark(t){return this.isMarkExist(t)?(gl("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){const e=this._marks.findIndex((e=>e.id===t.id||e.name===t.name));return-1===e?(gl("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}getMarkInType(t){return this._marks.filter((e=>e.type===t))}getMarkInId(t){return this._marks.find((e=>e.id===t))}getMarkInName(t){return this._marks.find((e=>e.name===t))}_compileProduct(t){super._compileProduct(t),this._product.configure({zIndex:this.getZIndex()}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((t=>{t.getProduct()&&t.removeProduct(),t.compile({group:this._product})}))}}XA.type="group";const KA=()=>{Mx(),p_(),fc.registerGraphic(Qd.group,ir),Xl.registerMark(XA.type,XA)},qA=(t,e)=>{const i=e.x-t.x,s=e.y-t.y;return Math.abs(i)>Math.abs(s)?i>0?"right":"left":s>0?"down":"up"},ZA=(t,e)=>{const i=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);return Math.sqrt(i*i+s*s)};class JA extends(o()){constructor(t,e={}){var i,s,n,r,a,o,l,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=_g.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,s=0,n=0;for(;n{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const s=t.clone(),{x:n,y:r,pointerId:a}=s;for(let t=0,e=i.length;t({x:t.x,y:t.y}))),h=_g.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=o,1===e.length){const t=e[0],i=n-t.x,a=r-t.y,h=this.direction||qA(t,o);this.direction=h;const d=this.getEventType(o);return s.direction=h,s.deltaX=i,s.deltaY=a,s.points=l,this.triggerStartEvent(d,s),void this.triggerEvent(d,s)}const{startDistance:d}=this,c=ZA(l[0],l[1]);s.scale=c/d,s.center=this.center,s.points=l,this.triggerStartEvent("pinch",s),this.triggerEvent("pinch",s)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:s}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=_g.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||s[0],n=this.lastMovePoint||s[0],r=ZA(i,n),a=r/t;a>this.config.swipe.velocity&&r>this.config.swipe.threshold&&(e.velocity=a,e.direction=qA(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(s=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==s?s:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:s}=this;if(e)return e;let n;return n=_g.now()-i>this.config.press.time&&ZA(s[0],t){for(let t=0,e=s.length;t{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let s=0,n=i.length;s{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(hc.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),this._animations=this._animations.filter((e=>e.config!==t.animationConfig||e.mark!==t.mark)),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(hc.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(hc.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(hc.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this}resume(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).enable)||void 0===i||i.call(e))})),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).disable)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).enableAnimationState)||void 0===s||s.call(i,t))})),this}disableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).disableAnimationState)||void 0===s||s.call(i,t))})),this}isAnimating(){return 0!==this._animations.length||this._additionalAnimateMarks.some((t=>{var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1}))}animate(){return this.isEnabled?(this._view.traverseMarkTree((t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1}),null,!0),this):this}animateAddition(t){var e;const i=null===(e=t.animate)||void 0===e?void 0:e.animate();return i&&i.isAnimating()&&this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(hc.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(hc.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}class ew{initAnimate(t){return this.animate=new tw(t),this.animate}}const iw=(t,e)=>{if(!t)return null;if(t.from){const i=t.from,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=_m(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.from=e.transformElementItems(s,e.mark.markType,n)}}if(t.to){const i=t.to,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=_m(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.to=e.transformElementItems(s,e.mark.markType,n)}}return t},sw=(t,e,i,s,n)=>xs(i)?i(t.getDatum(),t,n):i;class nw extends Cs{constructor(t,e,i,s,n){super(t,e,i,s,n),this._interpolator=null==n?void 0:n.interpolator,this._element=null==n?void 0:n.element}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class rw extends Cs{getEndProps(){return this.to}onBind(){var t;const e=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:kn,i=Object.keys(e).filter((t=>0!==e[t]));this.subAnimate.animate.preventAttrs(i);const s=Object.assign({},this.from),n=Object.assign({},this.to),r=[];Object.keys(n).forEach((t=>{i.includes(t)?(s[t]=n[t],this.from[t]=n[t]):D(s[t])?s[t]=this.target.getComputedAttribute(t):r.push(t)})),this.target.animates.forEach((t=>{t!==this.subAnimate.animate&&t.preventAttrs(r)})),this._fromAttribute=s,this._toAttribute=n}onStart(){if(this._fromAttribute){const t={};Object.keys(this._fromAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._fromAttribute[e])})),this.target.setAttributes(t,!1,{type:he.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}})}}onEnd(){if(this._toAttribute){const t={};Object.keys(this._toAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._toAttribute[e])})),this.target.setAttributes(t,!1,{type:he.ANIMATE_END})}}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;const s=this.step.getLastProps();Object.keys(s).forEach((t=>{this.subAnimate.animate.validAttr(t)&&(i[t]=s[t])})),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}Ds.mode|=ce.SET_ATTR_IMMEDIATELY;let aw=0;const ow=t=>{var e;if(D(t)||D(t.prototype))return!1;const i=null!==(e=t.prototype)&&void 0!==e?e:{};return i instanceof Cs||"onBind"in i&&"onStart"in i&&"onEnd"in i&&"onUpdate"in i};class lw{constructor(t,e,i){this.id=aw++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach((e=>e.stop(t))),this.animationEnd(e),this}pause(){return this.runnings.forEach((t=>t.pause())),this}resume(){return this.runnings.forEach((t=>t.resume())),this}startAt(t){return this.runnings.forEach((e=>{const i=this.unit.initialDelay;e.startAt(i+t)})),this}getTotalAnimationTime(){var t;const e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}getEndAttributes(){return this.runnings.reduce(((t,e)=>Object.assign(t,e.getEndProps())),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&(null===(e=this.callbackFunction)||void 0===e||e.call(null))}animateElement(t,e){const i=this.element.getGraphicItem();if(!i)return;const s=i.animate();this.runnings.push(s),s.startAt(this.unit.initialDelay),s.wait(this.unit.loopDelay),this.unit.timeSlices.forEach((i=>{this.animateTimeSlice(s,i,t,e)})),s.wait(this.unit.loopDelayAfter),s.loop(this.unit.loopCount-1),Zo(this.unit.totalTime)&&setTimeout((()=>{s&&s.stop("end")}),this.unit.totalTime),s.onEnd((()=>{this.runnings=this.runnings.filter((t=>t!==s)),0===this.runnings.length&&this.animationEnd()}))}animateTimeSlice(t,e,i,s){const n=e.delay,r=e.delayAfter,a=e.duration,o=e.effects;if(n>0&&t.wait(n),o.length<0)t.wait(a);else{const e=o.map(((t,e)=>{var n;const r=null!==(n=t.type?function(t,e,i,s){const n=xs(e.options)?e.options.call(null,t.getDatum(),t,s):e.options;if(!e.type||!fc.getAnimationType(e.type))return null;const r=fc.getAnimationType(e.type)(t,n,i);return iw(r,t)}(this.element,t,i,s):t.channel?function(t,e,i,s){const n=e.channel;let r=null;return y(n)?r=n.reduce(((e,i)=>(e.from[i]=t.getGraphicAttribute(i,!0),e.to[i]=t.getGraphicAttribute(i,!1),e)),{from:{},to:{}}):bs(n)&&(r=Object.keys(n).reduce(((e,i)=>{var r,a;const o=!D(null===(r=n[i])||void 0===r?void 0:r.from),l=!D(null===(a=n[i])||void 0===a?void 0:a.to);return(o||l)&&(e.from[i]=o?sw(t,0,n[i].from,0,s):void 0,e.to[i]=l?sw(t,0,n[i].to,0,s):t.getGraphicAttribute(i,!1)),e}),{from:{},to:{}})),iw(r,t)}(this.element,t,0,s):void 0)&&void 0!==n?n:{},o=r.custom||(null==t?void 0:t.custom),l=(null==r?void 0:r.customParameters)||(null==t?void 0:t.customParameters);r.from&&Object.keys(r.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==this.element.mark.markType&&this.element.getGraphicItem().setAttributes(r.from);const h=ow(o);return D(o)||ow(o)?h?new o(r.from,r.to,a,t.easing,l):r.to?new rw(r.from,r.to,a,t.easing):void 0:new nw(r.from,r.to,a,t.easing,{interpolator:o,element:this.element,parameters:l})})).filter((t=>!D(t)));1===e.length?t.play(e[0]):e.length>1&&t.play(new SA(a,e))}r>0&&t.wait(r)}}function hw(t){let e=[];return Object.keys(t).forEach((i=>{e=e.concat(dw(i,t[i]))})),e}function dw(t,e,i=0){const s=[];let n=i;return Fa(e).forEach((e=>{var i;const r=function(t){var e,i,s,n,r,a,o,l,h,d,c,u;if(D(t.timeSlices)){const h=t;return{startTime:null!==(e=h.startTime)&&void 0!==e?e:em,totalTime:h.totalTime,oneByOne:null!==(i=h.oneByOne)&&void 0!==i?i:am,loop:null!==(s=h.loop)&&void 0!==s?s:rm,controlOptions:E({},lm,null!==(n=h.controlOptions)&&void 0!==n?n:{}),timeSlices:[{duration:null!==(r=h.duration)&&void 0!==r?r:im,delay:null!==(a=h.delay)&&void 0!==a?a:sm,delayAfter:null!==(o=h.delayAfter)&&void 0!==o?o:nm,effects:[{type:h.type,channel:h.channel,custom:h.custom,easing:null!==(l=h.easing)&&void 0!==l?l:om,customParameters:h.customParameters,options:h.options}]}]}}const p=Fa(t.timeSlices).filter((t=>t.effects&&Fa(t.effects).filter((t=>t.channel||t.type)).length));if(p.length)return{startTime:null!==(h=t.startTime)&&void 0!==h?h:em,totalTime:t.totalTime,oneByOne:null!==(d=t.oneByOne)&&void 0!==d?d:am,loop:null!==(c=t.loop)&&void 0!==c?c:rm,controlOptions:E({},lm,null!==(u=t.controlOptions)&&void 0!==u?u:{}),timeSlices:p.map((t=>{var e,i;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:sm,delayAfter:null!==(i=t.delayAfter)&&void 0!==i?i:nm,effects:Fa(t.effects).filter((t=>t.channel||t.type)).map((t=>{var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:om,customParameters:t.customParameters,options:t.options}}))}})),partitioner:t.partitioner,sort:t.sort}}(e);r&&(s.push({state:t,id:null!==(i=r.id)&&void 0!==i?i:`${t}-${n}`,timeline:r,originConfig:e}),n+=1)})),s}function cw(t,e,i){return xs(t)?t.call(null,e.getDatum(),e,i):t}class uw{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter((t=>!D(t))),this.totalTime=this.animators.reduce(((t,e)=>Math.max(t,e.getTotalAnimationTime())),0)}parallel(t){const e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach((t=>{t.parallelArrangers=e})),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){const t=this.parallelArrangers.reduce(((t,e)=>Math.max(t,e.totalTime)),this.totalTime),e=this.parallelArrangers.reduce(((t,e)=>{var i,s;return Math.max(t,null!==(s=null===(i=e.afterArranger)||void 0===i?void 0:i.endTime)&&void 0!==s?s:0)}),0);this.parallelArrangers.forEach((i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach((t=>{t.startAt(e)}))}))}}class pw{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=hw(null!=e?e:{})}getAnimationConfigs(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter((e=>e.state===t)):[]}updateConfig(t){this.configs=hw(null!=t?t:{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;const t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach((t=>{var e;t.isReserved&&t.diffState!==Jd.exit&&(t.isReserved=!1);const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.prevState;this.configs.some((e=>i!==t.diffState&&e.state===i&&e.timeline.controlOptions.stopWhenStateChange))&&this.clearElementAnimation(t,!1)})),this.configs.forEach((i=>{this.animateByTimeline(i,t,e)})),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;const e=this.configs.filter((e=>e.state===t)),i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new uw(n)}stopAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.stop())),this}pauseAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.pause())),this}resumeAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.resume())),this}run(t){if(!this.isEnabled)return;const e=dw(tm,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);const i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new uw(n)}stop(){return this.animators.forEach((t=>{t.forEach((t=>t.stop()))})),this}pause(){return this.animators.forEach((t=>t.forEach((t=>t.pause())))),this}resume(){return this.animators.forEach((t=>t.forEach((t=>t.resume())))),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach((e=>{t=t||e.some((t=>t.isAnimating))})),t}isElementAnimating(t){var e;const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return D(i)||Object.values(i).every((t=>0===t))}getAnimatorCount(){let t=0;return this.animators.forEach((e=>t+=e.length)),t}getAllAnimators(){const t=[];return this.animators.forEach((e=>{t.push(...e)})),t}getElementAnimators(t,e){var i;const s=Fa(t);let n=[];return e?n=null!==(i=this.animators.get(e))&&void 0!==i?i:[]:this.animators.forEach((t=>{n=n.concat(t)})),n.filter((t=>s.includes(t.element)))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){const e=Fa(t);return this.disabledStates=this.disabledStates.filter((t=>!e.includes(t))),this}disableAnimationState(t){const e=Fa(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,s=!1){var n;const r=[],a=e.filter((e=>{const n=!(e.isReserved&&e.diffState===Jd.exit),r=this.getAnimationState(e),a=!this.disabledStates.includes(r),o=s||r===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,i);return n&&a&&o&&l}));if(a.length){D(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&a.sort(((e,s)=>t.timeline.sort(e.getDatum(),s.getDatum(),e,s,i)));const e={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(n=this.mark.group)&&void 0!==n?n:null,mark:this.mark,view:this.mark.view,elementCount:a.length,elementIndex:0};a.forEach(((s,n)=>{e.elementIndex=n;const o=Object.assign({[hm]:e},i),l=this.getAnimationUnit(t.timeline,s,n,a.length,o);r.push(this.animateElement(t,l,s,e,o))}))}return r}animateElement(t,e,i,s,n){var r,a;const o=new lw(i,e,t);if(o.animate(s,n),!o.isAnimating)return;i.diffState===Jd.exit&&(i.isReserved=!0);const l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;const h=null!==(r=this.elementRecorder.get(i))&&void 0!==r?r:{prevState:t.state,count:{}};h.prevState=t.state,h.count[t.state]=(null!==(a=h.count[t.state])&&void 0!==a?a:0)+1,this.elementRecorder.set(i,h);const d=this.animators.get(t.state);d?d.push(o):this.animators.set(t.state,[o]),o.callback((()=>{this.handleAnimatorEnd(o)}));const c={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(hc.ANIMATION_START,c),this.mark.emit(hc.ELEMENT_ANIMATION_START,c,i),o}getAnimationState(t){const e=Up(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}getAnimationUnit(t,e,i,s,n){const r=[],a=cw(t.startTime,e,n),o=cw(t.totalTime,e,n),l=cw(t.oneByOne,e,n),d=cw(t.loop,e,n);let c=0;t.timeSlices.forEach((t=>{var i;const a=cw(t.delay,e,n),l=cw(t.delayAfter,e,n),h=null!==(i=cw(t.duration,e,n))&&void 0!==i?i:o/s,d=Fa(t.effects).map((t=>Object.assign({},t,{customParameters:cw(t.customParameters,e,n)})));r.push({effects:d,duration:h,delay:a,delayAfter:l}),c+=a+h+l}));const u=h(l)?l:!0===l?c:0;return{initialDelay:a,loopCount:h(d)?d:!0===d?1/0:1,loopDelay:u*i,loopDelayAfter:u*(s-i-1),loopAnimateDuration:c,loopDuration:c+u*(s-1),totalTime:o,timeSlices:r}}clearElementAnimation(t,e=!0){this.animators.forEach((i=>{i.forEach((i=>{i.element===t&&(i.animationOptions.state===Jd.exit?i.stop("start",!1):i.stop("end",!1),this.handleAnimatorEnd(i,e))}))})),this.elementRecorder.delete(t)}clearAllElements(){const t=this.mark.getAllElements();t&&t.forEach(((e,i)=>{this.clearElement(e,i===t.length-1)}))}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===Jd.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){const i=t.element,s=t.animationOptions,n=s.state,r=n===tm,a=this.elementRecorder.get(i).count;a[n]-=1,this.animators.set(n,this.animators.get(n).filter((e=>e!==t))),0===this.animators.get(n).length&&this.animators.delete(n),this.timelineCount[s.id]-=1;const o=0===this.timelineCount[s.id],l=r?this.immediateConfigs.find((t=>t.id===s.id)).originConfig:this.configs.find((t=>t.id===s.id)).originConfig;o&&(delete this.timelineCount[s.id],r&&(this.immediateConfigs=this.immediateConfigs.filter((t=>t.id!==s.id)))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():n===Jd.exit&&0===a[Jd.exit]&&this.clearElement(i));const h={mark:this.mark,animationState:n,animationConfig:l};o&&this.mark.emit(hc.ANIMATION_END,h),this.mark.emit(hc.ELEMENT_ANIMATION_END,h,i)}}class gw{constructor(){this.animate=new pw(this,{})}initAnimate(t){this.animate||(this.animate=new pw(this,t.animation),this.needAnimate()&&this.animate.updateState(t.animationState))}reuseAnimate(t){this.animate=t.animate,this.animate.mark=this}updateAnimate(t){t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)}}const mw={measureText:(t,e,i,s)=>((t,e,i)=>Qk(t,e,i,{fontFamily:Rh.fontFamily,fontSize:Rh.fontSize}))(e,i,s).measure(t)};class _w{static instance(){return _w.instance_||(_w.instance_=new _w),_w.instance_}constructor(){this.functions={}}registerFunction(t,e){t&&e&&(this.functions[t]=e)}unregisterFunction(t){t&&delete this.functions[t]}getFunction(t){return this.functions[t]||null}getFunctionNameList(){return Object.keys(this.functions)}}const fw={WIDTH:500,HEIGHT:500,DPR:1};class vw{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:s=fw.WIDTH,height:n=fw.HEIGHT,dpr:r=fw.DPR,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=s*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}vw.env="browser";const yw=[0,0,0];let bw=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},ei),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},si),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},ni),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Pt(1,0,0,1,0,0),this._clearMatrix=new Pt(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&g.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Pt(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Gr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Gr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Gr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=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(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,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,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,s,n,r,a){if(a=a||0,this.camera){const o=[];((t,e,i,s,n,r,a,o)=>{if(o)for(;i>e;)i-=lt;else for(;ie?1:-1);let h=e,d=h;for(;d!==i;){d=l>0?Math.min(d+l,i):Math.max(d+l,i);const e=Math.abs(d-h),o=4*Math.tan(e/4)/3,c=da);t++){const e=v.getColor(t);c.beginPath(),c.rotate(f),c.moveTo(0,0),c.lineTo(m,-2*y),c.lineTo(m,0),c.fillStyle=e,c.closePath(),c.fill()}const b=c.getImageData(0,0,u,p);return d.width=b.width,d.height=b.height,c.putImageData(b,0,0),g=t.createPattern(d,"no-repeat"),g&&Ex.Set(e,i,s,r,a,g,u,p),g}(a,this.stops,t,e,h,i,s,o,l),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,s){this.nativeContext.fillRect(t,e,i,s)}clearRect(t,e,i,s){this.nativeContext.clearRect(t,e,i,s)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Vr(yw,[t,e,i],this.modelMatrix),t=yw[0],e=yw[1],i=yw[2]);const s=this.camera.vp(t,e,i);t=s.x,e=s.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Vr(yw,[t,e,i],this.modelMatrix),t=yw[0],e=yw[1],i=yw[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Vr(yw,[e,i,s],this.modelMatrix),e=yw[0],i=yw[1],s=yw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,s){return this.nativeContext.getImageData(t,e,i,s)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=Si.global.measureTextMethod){var i,s;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Si.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:ni.fontFamily,r=null!==(s=this.fontSize)&&void 0!==s?s:ni.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,s){this.nativeContext.strokeRect(t,e,i,s)}strokeText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Vr(yw,[e,i,s],this.modelMatrix),e=yw[0],i=yw[1],s=yw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,s,r)}return this._setCommonStyle(t,e,i,s,n)}_setCommonStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=e;r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(r.fillStyle=Oa(this,l,t,i,s))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const s=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setShadowBlendStyle(t,e,s)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const s=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||o||l?(s.shadowBlur=r*this.dpr,s.shadowColor=a,s.shadowOffsetX=o*this.dpr,s.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0),h?(s.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(s.filter="blur(0px)",this._clearFilterStyle=!1),d?(s.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(s.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,s,r)}return this._setStrokeStyle(t,e,i,s,n)}_setStrokeStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=e;if(r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=n.lineWidth,stroke:o=n.stroke,lineJoin:l=n.lineJoin,lineDash:h=n.lineDash,lineCap:d=n.lineCap,miterLimit:c=n.miterLimit}=e;r.lineWidth=Pa(this,a,this.dpr),r.strokeStyle=Oa(this,o,t,i,s),r.lineJoin=l,h&&r.setLineDash(h),r.lineCap=d,r.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){const s=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?s.font=t.font:s.font=Ii(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=r,this.fontSize=a,s.textAlign="left",s.textBaseline="alphabetic"}setTextStyle(t,e,i){var s,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Ii(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,r.textAlign=null!==(s=t.textAlign)&&void 0!==s?s:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Gr.free(t))),this.stack.length=0}};bw.env="browser",bw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],bw);let xw=class extends vw{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=Si.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new bw(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:s=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:a}=this;a.width=e*s,a.height=i*s,!a.style||this.setCanvasStyle(a,n,r,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,s,n){this.controled&&(t.style.width=`${s}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Sw(t,e){return new I((i=>{i(Ki).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(qi).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}xw.env="browser",xw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],xw);const Mw=Sw(xw,bw);var kw=function(t,e){return function(i,s){e(i,s,t)}};let Aw=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=Si.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let s={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new qt).setValue(0,0,n,r).containsPoint(e))return s;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new Pt(1,0,0,1,0,0);let o;for(let n=t.length-1;n>=0&&(s=t[n].isContainer?this.pickGroup(t[n],e,a,i):this.pickItem(t[n],e,a,i),!s.graphic);n--)o||(o=s.group);if(s.graphic||(s.group=o),this.pickContext&&(this.pickContext.inuse=!1),s.graphic){let t=s.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(s.params={shadowTarget:s.graphic},s.graphic=t.shadowHost)}return s}containsPoint(t,e,i){var s;return!!(null===(s=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===s?void 0:s.graphic)}pickGroup(t,e,i,s){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=s.pickContext,a=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=Ur.allocate();if(zr(i,e),a){if(i){const t=Ur.allocate();r.modelMatrix=Nr(t,a,i),Ur.free(i)}}else zr(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n{if(r.isContainer){const i=new be(e.x,e.y),a=ms(t).group,{scrollX:o=a.scrollX,scrollY:h=a.scrollY}=t.attribute;i.x-=o,i.y-=h,n=this.pickGroup(r,i,l,s)}else{const a=new be(e.x,e.y);l.transformPoint(a,a);const o=ms(t).group,{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;a.x-=h,a.y-=d;const c=this.pickItem(r,a,i,s);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==a&&Ur.free(r.modelMatrix),r.modelMatrix=a,n.graphic||n.group||!u||t.stage.camera||(n.group=t),Gr.free(l),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};Aw=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}([V(),kw(0,$(K)),kw(0,X(Kr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Aw);var ww=function(t,e){return function(i,s){e(i,s,t)}};let Tw=class extends Aw{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=Ji.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,s){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n=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}([V(),ww(0,$(K)),ww(0,X(ef)),ww(1,$(Dr)),ww(2,$(K)),ww(2,X(Kr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object])],Tw);let Lw=class{constructor(){this.type="group",this.numberType=jn}contains(t,e,i){return!1}};Lw=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}([V()],Lw);const Cw=new I(((t,e,i,s)=>{Cw.__vloaded||(Cw.__vloaded=!0,t(tf).to(Lw).inSingletonScope(),t(ef).toService(tf),Z(t,ef))}));Cw.__vloaded=!1;const Ew=Cw,Dw=new I(((t,e,i,s)=>{i(Tw)||t(Tw).toSelf().inSingletonScope(),i(Fr)?s(Fr).toService(Tw):t(Fr).toService(Tw)}));let Pw=class{constructor(){this._uid=B.GenAutoIncrementId(),this.viewBox=new qt,this.modelMatrix=new Pt(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,s,n,r){this.modelMatrix.setValue(t,e,i,s,n,r)}getViewBoxTransform(){return this.modelMatrix}};Pw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Pw);var Ow;let Rw=Ow=class extends Pw{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Ow.idprefix}_${Ow.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=Si.global,this.viewBox=new qt,this.modelMatrix=new Pt(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>s)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const s={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Ow.GenerateCanvasId(),canvasControled:!0};this.canvas=new xw(s)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let s=t.width,n=t.height;if(null==s||null==n||!t.canvasControled){const t=i.getBoundingClientRect();s=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/s),this.canvas=new xw({width:s,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),s=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(s,0,0,s,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Rw.env="browser",Rw.idprefix="visactor_window",Rw.prefix_count=0,Rw=Ow=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Rw);const Bw=new I((t=>{t(Rw).toSelf(),t(ts).toDynamicValue((t=>t.container.get(Rw))).whenTargetNamed(Rw.env)}));let Iw=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new qt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};Iw=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}([V()],Iw);class Fw{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function Yw(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let jw=class extends Iw{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,s;let n=0,r=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,a=n,o=r}else n=t.clientX||0,r=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=n,i=r,a=e.getBoundingClientRect(),o=null===(s=e.getNativeHandler)||void 0===s?void 0:s.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(Zo(l)?l:1),y:(i-a.top)/(Zo(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Fw(t)}return new qt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:s,style:n}=e;return n&&(S(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=s&&(t.style.height=`${s}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,s=document.createElement(e);if(this.updateDom(s,t),i){const t=S(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(s)}return s}loadImage(t){return Yw(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Yw(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const s=document.createElement("canvas");t.id&&(s.id=null!==(e=t.id)&&void 0!==e?e:B.GenAutoIncrementId().toString());const n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(s.style.width=`${t.width}px`,s.style.height=`${t.height}px`,s.width=t.width*n,s.height=t.height*n),s}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let i=t.offsetTop,s=t.offsetParent;for(;null!==s;)i+=s.offsetTop,s=s.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,s=t.offsetParent;for(;null!==s;)i+=s.offsetLeft,s=s.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,s=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent;return{top:i,left:s}}};jw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],jw);const Hw=new I((t=>{Hw.isBrowserBound||(Hw.isBrowserBound=!0,t(jw).toSelf().inSingletonScope(),t(tt).toService(jw))}));function zw(t,e=!0){zw.__loaded||(zw.__loaded=!0,t.load(Hw),t.load(Mw),t.load(Bw),e&&function(t){t.load(Ew),t.load(Dw)}(t))}Hw.isBrowserBound=!1,zw.__loaded=!1;let Nw=class extends bw{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};Nw.env="node",Nw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],Nw);let Vw=class extends vw{constructor(t){super(t)}init(){this._context=new Nw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...t){this._nativeCanvas.release&&xs(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Vw.env="node",Vw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Vw);const Ww=Sw(Vw,Nw);let Gw=class extends Pw{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:B.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Vw(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,s=t.height;null!=i&&null!=s&&t.canvasControled||(i=e.width,s=e.height),this.canvas=new Vw({width:i,height:s,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Gw.env="node",Gw=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(et)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Gw);const Uw=new I((t=>{t(Gw).toSelf(),t(ts).toDynamicValue((t=>t.container.get(Gw))).whenTargetNamed(Gw.env)}));let $w=class extends Iw{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return mn.call(t)}}getCancelAnimationFrame(){return t=>{mn.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};$w=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}([V()],$w);const Xw=new I((t=>{Xw.isNodeBound||(Xw.isNodeBound=!0,t($w).toSelf().inSingletonScope(),t(tt).toService($w))}));function Kw(t,e=!0){Kw.__loaded||(Kw.__loaded=!0,t.load(Xw),t.load(Ww),t.load(Uw))}Xw.isNodeBound=!1,Kw.__loaded=!1;const qw={name:"dark",colorScheme:{default:{dataScheme:Zl,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F",emptyCircleColor:"#bbbdc3",linearProgressTrackColor:"#404349"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};class Zw{constructor(){this.id=qo(),this._plugins=[]}add(t){if(!t||0===t.length)return null;const e=[];return t.forEach((t=>{this._plugins.find((e=>e.id===t.id))?gl("不要重复添加相同的plugin"):(this._plugins.push(t),e.push(t),t.onAdd&&t.onAdd(this))})),e}load(t){const e=this.add(t);e&&e.length&&this.activate(t)}activate(t){t.length&&t.forEach((t=>{t.init&&t.init()}))}get(t){return this._plugins.find((e=>e.id===t))}getAll(){return this._plugins.slice()}release(t){const e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((t=>t!==e)))}releaseAll(){this._plugins.forEach((t=>{t.release(this)})),this._plugins=[]}clear(t){const e=this.get(t);e&&e.clear(this)}clearAll(){this._plugins.forEach((t=>{var e;null===(e=t.clear)||void 0===e||e.call(t,this)}))}}class Jw extends Zw{constructor(t){super(),this.globalInstance=t}onInit(t){this._plugins.forEach((e=>{e.onInit&&e.onInit(this,t)}))}onBeforeResize(t,e){this._plugins.forEach((i=>{i.onBeforeResize&&i.onBeforeResize(this,t,e)}))}onAfterChartSpecTransform(t,e){this._plugins.forEach((i=>{i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(this,t,e)}))}onAfterModelSpecTransform(t,e,i){this._plugins.forEach((s=>{s.onAfterModelSpecTransform&&s.onAfterModelSpecTransform(this,t,e,i)}))}onBeforeInitChart(t,e){this._plugins.forEach((i=>{i.onBeforeInitChart&&i.onBeforeInitChart(this,t,e)}))}releaseAll(){super.releaseAll(),this.globalInstance=null}}class Qw{constructor(t,e){this.references=new Map,this.view=t,this.depend(null==e?void 0:e.dependency)}getStartState(){return null}depend(t){this.references.clear(),Fa(t).map((t=>S(t)?this.view.getGrammarById(t):t)).filter((t=>!D(t))).forEach((t=>{var e;this.references.set(t,(null!==(e=this.references.get(t))&&void 0!==e?e:0)+1)}))}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}bind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.addEventListener(e,t.handler)})):"none"!==t.type&&this.view.addEventListener(t.type,t.handler))}))}unbind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.removeEventListener(e,t.handler)})):"none"!==t.type&&this.view.removeEventListener(t.type,t.handler))}))}start(t){}reset(t){}dispatchEvent(t,e){this.view.emit(`${this.type}:${t}`,e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}class tT extends Qw{constructor(t,e){super(t,e),this.type=tT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},tT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){t&&this._marks&&this._marks.includes(t.mark)&&t.addState(this.options.state)}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&t.removeState(this.options.state)}}tT.type="element-active",tT.defaultOptions={state:cc.active,trigger:"pointerover",triggerOff:"pointerout"};const eT=t=>t.filterField?e=>{var i;return null===(i=e.getDatum())||void 0===i?void 0:i[t.filterField]}:e=>e[t.filterType],iT=(t,e)=>{if(!e||!t)return null;const i={};return t.forEach((t=>{const s=t&&t.getSpec(),n=s&&s.encode;n&&e.forEach((e=>{e&&n[e]&&(i[e]||(i[e]=[]),i[e].push(t))}))})),i};class sT extends Qw{constructor(t,e){super(t,e),this.type=sT.type,this._resetType=[],this.clearPrevElements=()=>{const{state:t,reverseState:e}=this.options;this._statedElements&&this._statedElements.length&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:this._statedElements,options:this.options}),this._statedElements=[])},this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},sT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=iT(this._marks,[this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getEvents(){const t=this.options.triggerOff,e=this.options.trigger,i=[{type:e,handler:this.handleStart}],{eventNames:s,resetType:n}=(t=>{const e=Fa(t),i=[],s=[];return e.forEach((t=>{"empty"===t?i.push("view"):S(t)&&"none"!==t?t.includes("view:")?(s.push(t.replace("view:","")),i.push("view")):(s.push(t),i.push("self")):h(t)&&i.push("timeout")})),{eventNames:s,resetType:i}})(t);return s.forEach((t=>{t&&(y(e)?!e.includes(t):t!==e)&&i.push({type:t,handler:this.handleReset})})),this._resetType=n,i}start(t){const{state:e,reverseState:i,isMultiple:s}=this.options;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(e)){if(this._resetType.includes("self")){const s=this._statedElements&&this._statedElements.filter((e=>e!==t));s&&s.length?this._statedElements=this.updateStates(s,this._statedElements,e,i):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(e),this._statedElements=this.updateStates(s&&this._statedElements?[...this._statedElements,t]:[t],this._statedElements,e,i),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((()=>{this.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}sT.type="element-select",sT.defaultOptions={state:cc.selected,trigger:"click"};class nT extends Qw{constructor(t,e){super(t,e),this.type=nT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},nT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=iT(this._marks,[this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getEvents(){const t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}];let i=t;return S(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}clearPrevElements(){const{highlightState:t,blurState:e}=this.options;this._lastElement&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const{highlightState:e,blurState:i}=this.options;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,e,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}nT.type="element-highlight",nT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};class rT extends Qw{constructor(t,e){super(t,e),this.type=rT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{t.element&&this._marks&&this._marks.includes(t.element.mark)&&this.clearPrevElements()},this.options=Object.assign({},rT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}}rT.type="element-highlight-by-key",rT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};class aT extends Qw{constructor(t,e){super(t,e),this.type=aT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},aT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.groupKey;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.groupKey===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&this.clearPrevElements()}}aT.type="element-highlight-by-group",aT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};const oT=16,lT=8,hT=12;var dT,cT,uT;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(dT||(dT={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(cT||(cT={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(uT||(uT={}));class pT extends Qw{constructor(t,e){super(t,e),this.type=pT.type,this.handleStart=t=>{var e,i;this.start(null===(i=null===(e=t.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},pT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:cT.legendItemHover,handler:this.handleStart},{type:cT.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){const e=t;if(D(e))return;const i=eT(this.options);this._marks.forEach((t=>{t.elements.forEach((t=>{i(t)===e?t.addState(this.options.state):t.removeState(this.options.state)}))}))}reset(){this._marks.forEach((t=>{t.elements.forEach((t=>{t.removeState(this.options.state)}))}))}}pT.type="element-active-by-legend",pT.defaultOptions={state:cc.active,filterType:"groupKey"};class gT extends Qw{constructor(t,e){super(t,e),this.type=gT.type,this.handleStart=(t,e)=>{var i,s;this.start(null===(s=null===(i=t.detail)||void 0===i?void 0:i.data)||void 0===s?void 0:s.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},gT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:cT.legendItemHover,handler:this.handleStart},{type:cT.legendItemUnHover,handler:this.handleReset}]}start(t){if(D(t))return;const e=eT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}gT.type="element-highlight-by-legend",gT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,filterType:"groupKey"};class mT extends Qw{constructor(t,e){super(t,e),this.type=mT.type,this.handleStart=(t,e)=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const i=this._parseTargetKey(t,e);this.start(i)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.reset()},this.options=Object.assign({},mT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Fa(this.options.graphicName);return(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.name)&&i.includes(t.target.name)}_parseTargetKey(t,e){return this.options.parseData?this.options.parseData(t):"text"===t.target.type?t.target.attribute.text:null}start(t){if(D(t))return;const e=eT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}mT.type="element-highlight-by-name",mT.defaultOptions={trigger:"pointerover",triggerOff:"pointerout",highlightState:cc.highlight,blurState:cc.blur,filterType:"groupKey"};class _T{updateStates(t,e,i,s){return t&&t.length?(i&&s?e&&e.length?(this.toggleReverseStateOfElements(t,e,s),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,s):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}toggleReverseStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)}))}toggleStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)}))}addBothStateOfElements(t,e,i){this._marks.forEach((s=>{var n;const r=i&&this._stateMarks[i]&&this._stateMarks[i].includes(s),a=e&&this._stateMarks[e]&&this._stateMarks[e].includes(s);(r||a)&&(null===(n=s.elements)||void 0===n||n.forEach((s=>{t&&t.includes(s)?a&&s.addState(e):r&&s.addState(i)})))}))}addStateOfElements(t,e){this._marks.forEach((i=>{var s;const n=e&&this._stateMarks[e]&&this._stateMarks[e].includes(i);n&&(null===(s=i.elements)||void 0===s||s.forEach((i=>{t&&t.includes(i)&&n&&i.addState(e)})))}))}clearAllStates(t,e){this._statedElements&&this._statedElements.length&&this._marks.forEach((i=>{i&&i.elements&&(e&&this._stateMarks[e]&&this._stateMarks[e].includes(i)&&i.elements.forEach((t=>{t.removeState(e)})),t&&this._stateMarks[t]&&this._stateMarks[t].includes(i)&&i.elements.forEach((e=>{this._statedElements.includes(e)&&e.removeState(t)})))}))}}var fT=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 vT{static useRegisters(t){t.forEach((t=>{"function"==typeof t?t():console.error("Invalid function:",t)}))}static useChart(t){t.forEach((t=>Xl.registerChart(t.type,t)))}static useSeries(t){t.forEach((t=>Xl.registerSeries(t.type,t)))}static useComponent(t){t.forEach((t=>Xl.registerComponent(t.type,t)))}static useMark(t){t.forEach((t=>{var e;return Xl.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}static useLayout(t){t.forEach((t=>Xl.registerLayout(t.type,t)))}static registerDataSetTransform(t,e){Xl.registerTransform(t,e)}static registerFunction(t,e){t&&e&&_w.instance().registerFunction(t,e)}static unregisterFunction(t){t&&_w.instance().unregisterFunction(t)}static getFunction(t){return t?_w.instance().getFunction(t):null}static getFunctionList(){return _w.instance().getFunctionNameList()}static registerMap(t,e,i){const s=Xl.getImplementInKey("registerMap");s&&s(t,e,i)}static unregisterMap(t){const e=Xl.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return e=t,Dp.get(e);var e}static hideTooltip(t=[]){Uh.forEach((t=>{var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}static getLogger(){return g.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}getDataSet(){return this._dataSet}constructor(t,e){var i,s,r,a,o,l,h,d;this.id=qo(),this._userEvents=[],this._autoSize=!0,this._option={mode:n["desktop-browser"],onError:t=>{throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._doResize=()=>{const{width:t,height:e}=this.getCurrentSize();this._currentSize.width===t&&this._currentSize.height===e||(this._currentSize={width:t,height:e},this.resizeSync(t,e))},this._renderSync=(t={})=>{var e;return this._beforeRender(t)?(null===(e=this._compiler)||void 0===e||e.render(t.morphConfig),this._afterRender(),this):this},this._updateSpec=(t,e=!1,i)=>{var s,n;const r=this._spec,a={changeBackground:!1,reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(!this._setNewSpec(t,e))return;Im(r.theme,this._spec.theme)?Im(this._spec.background,r.background)||(a.reMake=!0,a.changeBackground=!0):a.changeTheme=!0;const o=this._shouldChartResize(r);if(a.reSize=o,null===(n=null===(s=this._compiler)||void 0===s?void 0:s.getVGrammarView())||void 0===n||n.updateLayoutTag(),this._spec.type!==r.type)return a.reMake=!0,a.reTransformSpec=!0,a.change=!0,a.changeTheme=!0,a;this._initChartSpec(this._spec,"updateSpec");const l=by(this._chart.updateSpec(this._spec),a);return i?Object.assign(Object.assign({},l),i):l},this._option=E(this._option,{animation:!1!==t.animation},e),this._onError=null===(i=this._option)||void 0===i?void 0:i.onError;const c=this._option,{dom:u,renderCanvas:p,mode:g,stage:m,poptip:_}=c,f=function(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{this._event.emit(zd.animationFinished,{chart:this._chart,vchart:this})})),this._compiler.getVGrammarView().addEventListener(hc.AFTER_VRENDER_NEXT_RENDER,(()=>{this._event.emit(zd.renderFinished,{chart:this._chart,vchart:this})})))}_bindResizeEvent(){var t,e;if(this._autoSize){if(this._onResize=qd(this._doResize,null!==(t=this._option.resizeDelay)&&void 0!==t?t:100),this._container){const t=window.ResizeObserver;t&&(this._observer=new t(this._onResize),null===(e=this._observer)||void 0===e||e.observe(this._container))}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}getCurrentSize(){var t,e,i,s;return yy(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:rh,height:null!==(s=null===(i=this._currentSize)||void 0===i?void 0:i.height)&&void 0!==s?s:ah})}_initDataSet(t){this._dataSet=t instanceof f?t:new f,Ep(this._dataSet,"dataview",b),Ep(this._dataSet,"array",e),Cp(this._dataSet,"copyDataView",Fp);for(const t in Xl.transforms)Cp(this._dataSet,t,Xl.transforms[t]);for(const t in Xl.dataParser)Ep(this._dataSet,t,Xl.dataParser[t])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return xs(t)&&(t=t()),t.reAnimate&&(this.stopAnimation(),this._updateAnimateState(!0)),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}_updateCustomConfigAndRecompile(t,e={}){return!!t&&(this._reCompile(t),this._beforeRender(e))}_reCompile(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(i=this._chart)||void 0===i||i.release(),this._chart=null,t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(s=this._currentTheme)||void 0===s?void 0:s.fontFamily)):t.changeBackground&&(null===(n=this._compiler)||void 0===n||n.setBackground(this._getBackground())),null===(r=this._compiler)||void 0===r||r.releaseGrammar(!1===(null===(a=this._option)||void 0===a?void 0:a.animation)||!1===(null===(o=this._spec)||void 0===o?void 0:o.animation)),this._userEvents.forEach((t=>{var e;return null===(e=this._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(l=this._currentTheme)||void 0===l?void 0:l.fontFamily)):t.changeBackground&&(null===(h=this._compiler)||void 0===h||h.setBackground(this._getBackground())),t.reCompile&&(null===(d=this._compiler)||void 0===d||d.clear({chart:this._chart,vChart:this},!1===(null===(c=this._option)||void 0===c?void 0:c.animation)||!1===(null===(u=this._spec)||void 0===u?void 0:u.animation)),null===(p=this._compiler)||void 0===p||p.compile({chart:this._chart,vChart:this},{})),t.reSize){const{width:t,height:e}=this.getCurrentSize();this._chart.onResize(t,e,!1),this._compiler.resize(t,e,!1)}}_beforeRender(t={}){var e,i,s,n,r,a,o,l;if(this._isReleased)return!1;if(this._chart)return!0;const{transformSpec:h,actionSource:d}=t;return h&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,d),null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeInitializeChart)||void 0===i||i.call(e,this),this._initChart(this._spec),null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterInitializeChart)||void 0===n||n.call(s,this),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(l=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===l||l.call(o),0))}_afterRender(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(zd.rendered,{chart:this._chart,vchart:this}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return fT(this,void 0,void 0,(function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})}))}_renderAsync(t={}){return fT(this,void 0,void 0,(function*(){return this._renderSync(t)}))}_updateAnimateState(t){var e,i;if(this._option.animation){const s=t?Np.appear:Np.update;null===(e=this._chart)||void 0===e||e.getAllRegions().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)})),null===(i=this._chart)||void 0===i||i.getAllComponents().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)}))}}release(){var t,e,i,s;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(i=this._eventDispatcher)||void 0===i||i.release(),null===(s=this._compiler)||void 0===s||s.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,Uh.unregisterInstance(this)}updateData(t,e,i,s){return fT(this,void 0,void 0,(function*(){return this.updateDataSync(t,e,i,s)}))}_updateDataById(t,e,i){const s=this._spec.data.find((e=>e.name===t||e.id===t));s?s.id===t?s.values=e:s.name===t&&s.parse(e,i):y(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}updateDataInBatches(t){return fT(this,void 0,void 0,(function*(){return this._chart?(this._chart.updateFullData(t.map((({id:t,data:e,options:i})=>({id:t,values:e,parser:i})))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=Fa(this._spec.data),t.forEach((({id:t,data:e,options:i})=>{this._updateDataById(t,e,i)})),this)}))}updateDataSync(t,e,i,s){return D(this._dataSet)?this:this._chart?((null==s?void 0:s.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateData(t,e,!0,i),this._compiler.render(),this):(this._spec.data=Fa(this._spec.data),this._updateDataById(t,e,i),this)}updateFullDataSync(t,e=!0,i){if(this._chart)return(null==i?void 0:i.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateFullData(t),e&&this._compiler.render(),this;const s=Fa(this._spec.data);return Fa(t).forEach((t=>{const{id:e,values:i,parser:n,fields:r}=t,a=s.find((t=>t.name===e));if(a)a instanceof R?(a.setFields(k(r)),a.parse(i,k(n))):(a.values=i,M(n)&&(a.parser=n),M(r)&&(a.fields=r));else{const e=jp(t,this._dataSet,s);y(this._spec.data)&&this._spec.data.push(e)}})),this}updateFullData(t,e=!0){return fT(this,void 0,void 0,(function*(){return this.updateFullDataSync(t,e)}))}updateSpec(t,e=!1,i,s){return fT(this,void 0,void 0,(function*(){const n=this._updateSpec(t,e,s);return n?(yield this.updateCustomConfigAndRerender(n,!1,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}))}updateSpecSync(t,e=!1,i,s){const n=this._updateSpec(t,e,s);return n?(this.updateCustomConfigAndRerender(n,!0,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}updateSpecAndRecompile(t,e=!1,i={}){const s=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(s,Object.assign({actionSource:"updateSpecAndRecompile"},i))}updateModelSpec(t,e,i=!1,s){return fT(this,void 0,void 0,(function*(){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),xs(t)||Cl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!1,i,s)}return this}))}updateModelSpecSync(t,e,i=!1,s){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),xs(t)||Cl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!0,i,s)}return this}_updateModelSpec(t,e,i=!1,s=!1,n){s&&(e=Ll({},t.getSpec(),e));const r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,i,{morphConfig:n,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){return fT(this,void 0,void 0,(function*(){return this.resizeSync(t,e)}))}resizeSync(t,e){var i,s;return this._beforeResize(t,e)?(null===(s=(i=this._compiler).resize)||void 0===s||s.call(i,t,e),this._afterResize()):this}_beforeResize(t,e){var i,s,n,r;if(!this._chart||!this._compiler)return!1;const a=this._chart.getCanvasRect();return!(a&&a.width===t&&a.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.beforeResizeWithUpdate)||void 0===s||s.call(i),this._chart.onResize(t,e,!1),null===(r=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterResizeWithUpdate)||void 0===r||r.call(n),0))}_afterResize(){return this._isReleased||this._event.emit(zd.afterResize,{chart:this._chart}),this}updateViewBox(t,e=!0,i=!0){return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}on(t,e,i){var s;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:i}),null===(s=this._event)||void 0===s||s.on(t,e,i))}off(t,e){var i;if(this._userEvents&&0!==this._userEvents.length)if(e){const s=this._userEvents.findIndex((i=>i.eType===t&&i.handler===e));s>=0&&(this._userEvents.splice(s,1),null===(i=this._event)||void 0===i||i.off(t,e))}else this._userEvents.forEach((e=>{var i;e.eType===t&&(null===(i=this._event)||void 0===i||i.off(t,e.handler))})),this._userEvents=this._userEvents.filter((e=>e.eType!==t))}updateState(t,e){this._chart&&this._chart.updateState(t,e)}setSelected(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}setHovered(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}clearState(t){this._chart&&this._chart.clearState(t)}clearAllStates(){this._chart&&this._chart.clearAllStates()}clearSelected(){this._chart&&this._chart.clearSelected()}clearHovered(){this._chart&&this._chart.clearHovered()}_updateCurrentTheme(t){var e,i,s;const n=this._option.theme,r=null===(e=this._spec)||void 0===e?void 0:e.theme,a=null===(i=this._spec)||void 0===i?void 0:i.type;t&&(this._currentThemeName=t);const o=(t,e)=>{var i;return(null===(i=e.chart)||void 0===i?void 0:i[t])&&(e=Kl({},e,e.chart[t])),e};let l;if(jm(n)&&jm(r))l=Xh(this._currentThemeName,!0),this._currentTheme=o(a,l);else if(S(n)&&(!r||S(r))||S(r)&&(!n||S(n))){const t=Kl({},Xh(this._currentThemeName,!0),Xh(n,!0),Xh(r,!0));this._currentTheme=o(a,t)}else{const t=Kl({},Xh(this._currentThemeName),Xh(n),Xh(r));this._currentTheme=Fh(o(a,t))}var h;h=$d(this._currentTheme,"component.poptip"),E(c_.poptip,d_,h),null===(s=this._compiler)||void 0===s||s.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let s=!1;D(this._spec.width)?!D(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(s=!0),D(this._spec.height)?!D(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(s=!0);const n=this._autoSize;return this._autoSize=!!cl(this._option.mode)&&(null===(i=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===i||i),this._autoSize!==n&&(s=!0),s}_getBackground(){return("string"==typeof this._spec.background||bs(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this._currentTheme.background||this._option.background}getCurrentTheme(){return Xh(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){var e;return fT(this,void 0,void 0,(function*(){if(!$h.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),yield this.updateCustomConfigAndRerender(i,!1,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}))}setCurrentThemeSync(t){var e;if(!$h.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),this.updateCustomConfigAndRerender(i,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}_setFontFamilyTheme(t){var e;t&&(null===(e=this.getStage())||void 0===e||e.setTheme({text:{fontFamily:t}}))}_getTooltipComponent(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(r.tooltip)[0]}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;const s=this._getTooltipComponent();s&&(null===(i=null===(e=s.tooltipHandler)||void 0===e?void 0:e.release)||void 0===i||i.call(e),s.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}getTooltipHandler(){const t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;const s=this._getTooltipComponent();return null!==(i=M(t)&&"none"!==(null==s?void 0:s.showTooltip(t,e)))&&void 0!==i&&i}hideTooltip(){var t;const e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}getLegendDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.discreteLegend);s&&s[t]&&s[t].setSelectedData(e)}getDataURL(){var t;return fT(this,void 0,void 0,(function*(){const e=this.getStage();if(this._chart&&e){e.render();const t=this._chart.getCanvas();return yield h_(t,{onError:this._onError})}return null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null}))}exportImg(t){var e,i;return fT(this,void 0,void 0,(function*(){if(!cl(this._option.mode))return void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img")));const s=yield this.getDataURL();s?function(t="vchart",e){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("target","_blank"),i.setAttribute("download",`${t}.png`),i.dispatchEvent(new MouseEvent("click"))}(t,s):null===(i=this._option)||void 0===i||i.onError(new ReferenceError("render is not defined"))}))}exportCanvas(){var t;const e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if("node"!==this._option.mode)return void(null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment.")));const i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}reLayout(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}getContainer(){var t;if(M(this._container))return this._container;let e;return e=S(this._canvas)?No.getElementById(this._canvas):this._canvas,M(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement}getComponents(){return this._chart.getAllComponents()}getScale(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==i?void 0:i.getScale(t)}setDimensionIndex(t,e={}){var i;return null===(i=this._chart)||void 0===i?void 0:i.setDimensionIndex(t,e)}stopAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.stop()}pauseAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.pause()}resumeAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.resume()}convertDatumToPosition(t,e={},i=!1,s){var n;if(!this._chart)return null;if(jm(t))return null;const{seriesId:r,seriesIndex:a=0}=e;let o;if(M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o){const e=Object.keys(t),n=o.getViewData().latestData.find((i=>e.every((e=>i[e]==t[e])))),r=o.getRegion().getLayoutStartPoint();let a;return a=n?o.dataToPosition(n,s):o.dataToPosition(t,s),a?rl(a,r,i):null}return null}convertValueToPosition(t,e,i=!1){var s,n;if(!this._chart||D(t)||jm(e))return null;if(!y(t)){const{axisId:n,axisIndex:r}=e;let a;if(M(n)?a=this._chart.getComponentsByKey("axes").find((t=>t.userId===n)):M(r)&&(a=null===(s=this._chart.getComponentsByKey("axes"))||void 0===s?void 0:s[r]),!a)return gl("Please check whether the `axisId` or `axisIndex` is set!"),null;const o=null==a?void 0:a.valueToPosition(t);if(i){const t=a.getLayoutStartPoint(),e=a.getOrient();return o+("bottom"===e||"top"===e?t.x:t.y)}return o}const{seriesId:r,seriesIndex:a}=e;let o;return M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o?rl(o.valueToPosition(t[0],t[1]),o.getRegion().getLayoutStartPoint(),i):(gl("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return _w.instance().getFunction(t)}registerFunction(t,e){t&&e&&_w.instance().registerFunction(t,e)}unregisterFunction(t){t&&_w.instance().unregisterFunction(t)}getFunctionList(){return _w.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}updateIndicatorDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.updateDatum(e)}updateIndicatorDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.indicator);s&&s[t]&&s[t].updateDatum(e)}geoZoomByIndex(t=0,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionIndex:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}geoZoomById(t,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionId:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}_initChartPlugin(){const t=Xl.getChartPlugins();t.length>0&&(this._chartPlugin=new Jw(this),this._chartPlugin.load(t.map((t=>new t))),this._chartPluginApply("onInit",this._spec))}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}_getMode(){return this._option.mode||n["desktop-browser"]}_getChartOption(t){return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:()=>this._compiler,performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:()=>{var t;return null!==(t=this._currentTheme)&&void 0!==t?t:{}},getSpecInfo:()=>{var t;return null!==(t=this._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}vT.InstanceManager=Uh,vT.ThemeManager=$h,vT.globalConfig={uniqueTooltip:!0},vT.Utils=mw,vT.vglobal=No,Xl.registerRegion("region",Uy),Xl.registerLayout("base",tb),KA(),r_.useRegisters([()=>{fc.registerStageEventPlugin("gesture",JA)}]),QA(nT,_T),fc.registerInteraction(nT.type,nT),QA(sT,_T),fc.registerInteraction(sT.type,sT),Vh(qw.name,qw),g.getInstance(u.Error);const yT=`${nh}_DEFAULT_DATA_INDEX`,bT=`${nh}_DEFAULT_DATA_KEY`,xT=`${nh}_DEFAULT_DATA_SERIES_FIELD`,ST=`${nh}_DEFAULT_SERIES_STYLE_NAME`,MT=`${nh}_STACK_KEY`,kT=`${nh}_STACK_START`,AT=`${nh}_STACK_END`,wT=`${nh}_STACK_START_PERCENT`,TT=`${nh}_STACK_END_PERCENT`,LT=`${nh}_STACK_START_OffsetSilhouette`,CT=`${nh}_STACK_END_OffsetSilhouette`,ET=`${nh}_STACK_TOTAL`,DT=`${nh}_STACK_TOTAL_PERCENT`,PT=`${nh}_STACK_TOTAL_TOP`,OT=`${nh}_STACK_TOTAL_BOTTOM`,RT=`${nh}_SEGMENT_START`,BT=`${nh}_SEGMENT_END`;function IT(t,e){for(let i=0;it.key===e))}function YT(t,e){var i;if(!t)return null!=e?e:null;const s=t.getFields();return s&&s[e]?null!==(i=s[e].alias)&&void 0!==i?i:e:null!=e?e:null}function jT(t,e,i){const s=t.getStackSort(),n={};let r=null;return s&&(r={},t.getSeries().forEach((t=>{const e=t.getSeriesField();if(e){const i=t.getRawDataStatisticsByField(e);i.values&&(r[e]||(r[e]={lastIndex:0,sort:{}}),i.values.forEach(((t,i)=>{t in r[e].sort||(r[e].sort[t]=r[e].lastIndex,r[e].lastIndex++)})))}}))),t.getSeries().forEach((t=>{var s;const a=t.getStackData(),o=t.getStackValue(),l=t.getStackValueField(),h=!i||i(t);a&&l&&h&&(n[o]=null!==(s=n[o])&&void 0!==s?s:{groupField:a.groupField,nodes:{}},WT(t,a,n[o],l,e,r))})),s?HT(n,r):n}function HT(t,e){var i;for(const s in t)(null===(i=t[s].sortDatums)||void 0===i?void 0:i.length)?(t[s].sortDatums.sort(((t,e)=>t.index-e.index)),t[s].values=t[s].sortDatums.map((t=>t.datum))):HT(t[s].nodes,e);return t}function zT(t,e){if("values"in t&&t.values.length){const i=vd(t.values,e),s=fd(t.values,TT);t.values.forEach((t=>{t[ET]=i,t[DT]=s}))}else for(const i in t.nodes)zT(t.nodes[i],e)}function NT(t){if(!t.values.length)return;const e=t.values[t.values.length-1][AT]/2;for(let i=0;i0){let s=0,o=0,l=1,h=0,d=null,c=null;const u=t.values.length;for(let i=0;i=0?(l[n.start]=s,s+=l[n.end],l[n.end]=s):(l[n.start]=o,o+=l[n.end],l[n.end]=o),l[n.key]=t.key,a&&(delete l[n.max],(!c||l[n.end]>c[n.end])&&(c=l)),r&&(delete l[n.min],(!d||l[n.start]=0?s:o;l=h>=0?1:-1,r[n.startPercent]=0===a?0:Math.min(1,r[n.start]/a)*l,r[n.endPercent]=0===a?0:Math.min(1,r[n.end]/a)*l}}for(const r in t.nodes)VT(t.nodes[r],e,i,s,n)}function WT(t,e,i,s,n,r,a){var o;if("values"in e)if(n&&e.values.forEach((t=>t[AT]=function(t){if(Zo(t))return t;const e=+t;return Zo(e)?e:0}(t[s]))),i.series.push({s:t,values:e.values}),r){const s=t.getSeriesField();e.values.forEach((e=>{i.sortDatums.push({series:t,datum:e,index:s?r[s].sort[e[s]]:0})}))}else i.values.push(...e.values);else for(const l in e.nodes){const h=a?`${a}_${l}`:l;i.nodes[l]||(i.nodes[l]={values:[],series:[],nodes:{},sortDatums:[],key:h},M(null===(o=e.nodes[l])||void 0===o?void 0:o.groupField)&&(i.nodes[l].groupField=e.nodes[l].groupField)),WT(t,e.nodes[l],i.nodes[l],s,n,r,h)}}const GT=(t,e)=>{const i=e.beforeCall();return t&&t.forEach(((t,s)=>e.call(t,s,i))),i.keyMap&&(i.keyMap.clear(),i.keyMap=null),t};class UT{static getInstance(){return UT.instance||(UT.instance=new UT),UT.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,i)=>{const s=this.shortWeekdayRe.exec(e.slice(i));return s?(t.w=this.shortWeekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseWeekday=(t,e,i)=>{const s=this.weekdayRe.exec(e.slice(i));return s?(t.w=this.weekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseShortMonth=(t,e,i)=>{const s=this.shortMonthRe.exec(e.slice(i));return s?(t.m=this.shortMonthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseMonth=(t,e,i)=>{const s=this.monthRe.exec(e.slice(i));return s?(t.m=this.monthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseDayOfMonth=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.d=+s[0],i+s[0].length):-1},this.parseHour24=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.H=+s[0],i+s[0].length):-1},this.parseMilliseconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+3));return s?(t.L=+s[0],i+s[0].length):-1},this.parseMonthNumber=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.m=s-1,i+s[0].length):-1},this.parseMinutes=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.M=+s[0],i+s[0].length):-1},this.parsePeriod=(t,e,i)=>{const s=this.periodRe.exec(e.slice(i));return s?(t.p=this.periodLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseSeconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.S=+s[0],i+s[0].length):-1},this.parseFullYear=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+4));return s?(t.y=+s[0],i+s[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,i){return{y:t,m:e,d:i,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,i){const s=t<0?"-":"",n=(s?-t:t)+"",r=n.length;return s+(r=a)return-1;if(o=e.charCodeAt(n++),37===o){if(o=e.charAt(n++),l=this.parses[o in this.pads?e.charAt(n++):o],!l||(s=l(t,i,s))<0)return-1}else if(o!==i.charCodeAt(s++))return-1}return s}newParse(t,e){const i=this;return function(s){const n=i.newDate(1900,void 0,1);return i.parseSpecifier(n,t,s+="",0)!==s.length?null:"Q"in n?new Date(n.Q):"s"in n?new Date(1e3*n.s+("L"in n?n.L:0)):(e&&!("Z"in n)&&(n.Z=0),"p"in n&&(n.H=n.H%12+12*n.p),void 0===n.m&&(n.m="q"in n?n.q:0),"Z"in n?(n.H+=n.Z/100|0,n.M+=n.Z%100,i.utcDate(n)):i.localDate(n))}}newFormat(t,e){const i=this;return function(s){const n=[];let r=-1,a=0;const o=t.length;let l,h,d;for(s instanceof Date||(s=new Date(+s));++r{if(D(t[e]))return;const n=y(t[e]),r=n?t[e]:[t[e]],a=[];return r.forEach(((t,r)=>{!t||s&&!s(t)||a.push({spec:t,specPath:n?[e,r]:[e],specInfoPath:["component",e,r],type:i})})),a},qT=(t,e,i,s)=>{let n;if(n=xs(t)?t(e,i):t,s){const{formatFunc:i,args:r}=XT(void 0,s,t,e);i&&r&&(n=i(...r))}return n},ZT=(t,e,i)=>D(t)?t:xs(t)?t(e,i):t,JT=(t,e)=>!(e&&(!1===e.visible||e[t]&&!1===e[t].visible||e.activeType&&!(y(e.activeType)?e.activeType.includes(t):e.activeType===t)));function QT(t,e,i,s,n,r){const a=e=>{if(e){const a={},o=D(e.key)&&D(e.value)&&!jm(e)?Object.assign(Object.assign(Object.assign({},s),i),e):Object.assign(Object.assign({},s),e);Object.keys(o).forEach((t=>{"key"===t?a.key=eL(qT(o.key,n,r,o.keyFormatter),o.keyTimeFormat,o.keyTimeFormatMode):"value"===t?a.value=eL(qT(o.value,n,r,o.valueFormatter),o.valueTimeFormat,o.valueTimeFormatMode):a[t]=qT(o[t],n,r)})),!1!==a.visible&&(M(a.key)||M(a.value))&&t.push(a)}};y(e)?e.forEach((t=>{a(t)})):a(e)}function tL(t,e,i,s,n,r,a){xs(e)?QT(t,e(n,a),i,s,r,a):e&&QT(t,e,i,s,r,a)}const eL=(t,e,i)=>{if(!e&&!i)return"object"!=typeof t?null==t?void 0:t.toString():t;const s=UT.getInstance();return e=e||"%Y%m%d",("local"===(i=i||"local")?s.timeFormat:s.timeUTCFormat)(e,t)};class iL{constructor(t){this.activeTriggerSet={mark:new Set,group:new Set},this.ignoreTriggerSet={mark:new Set},this._getSeriesCacheInfo=()=>{var t,e,i;const{series:s}=this,n=s.getSeriesField();return{seriesFields:M(n)?Fa(n):null!==(t=s.getSeriesKeys())&&void 0!==t?t:[],dimensionFields:null!==(e=s.getDimensionField())&&void 0!==e?e:[],measureFields:null!==(i=s.getMeasureField())&&void 0!==i?i:[],type:s.type}},this._getDimensionData=t=>{const{dimensionFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getMeasureData=t=>{const{measureFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getSeriesFieldData=t=>{const{dimensionFields:e,seriesFields:i}=this._seriesCacheInfo;if(M(i[0])&&(null==t?void 0:t[i[0]]))return null==t?void 0:t[i[0]];const s=e[e.length-1];return e.length>1&&(0===i.length||this.series.getSeriesKeys().length),null==t?void 0:t[s]},this._getSeriesStyle=(t,e,i)=>{var s;for(const i of Fa(e)){const e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(M(e))return e}return i},this.markTooltipKeyCallback=(t,e)=>this._getSeriesFieldData(t),this.markTooltipValueCallback=(t,e)=>this._getMeasureData(t),this.shapeTypeCallback=(t,e)=>{var i;return null!==(i=this._getSeriesStyle(t,"shape",null))&&void 0!==i?i:this._getSeriesStyle(t,"symbolType",this.series.getDefaultShapeType())},this.shapeColorCallback=(t,e)=>this._getSeriesStyle(t,["fill","stroke"]),this.shapeStrokeCallback=(t,e)=>this._getSeriesStyle(t,["stroke","fill"]),this.dimensionTooltipTitleCallback=(t,e)=>this._getDimensionData(t),this.groupTooltipTitleCallback=(t,e)=>this._getSeriesFieldData(t),this.groupTooltipKeyCallback=(t,e)=>{const{seriesFields:i}=this._seriesCacheInfo;let s=this._seriesCacheInfo.dimensionFields;return i[0]&&(s=s.filter((t=>t!==i[0]))),s.map((e=>null==t?void 0:t[e])).join("-")},this.getHasShape=t=>!!t,this.series=t,this.updateTooltipSpec()}updateTooltipSpec(){var t;const e=null===(t=this.series.getSpec())||void 0===t?void 0:t.tooltip;this.spec=e,this._seriesCacheInfo=this._getSeriesCacheInfo()}getShapeAttrs(t,e,i){var s,n,r,a,o,l,h,d,c,u,p,g;const m=e?"content":"title",_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.shape),null==i?void 0:i[t]),null===(n=null==i?void 0:i[t])||void 0===n?void 0:n[m]),null===(r=this.spec)||void 0===r?void 0:r[t]),null===(o=null===(a=this.spec)||void 0===a?void 0:a[t])||void 0===o?void 0:o[m]);return{shapeType:null!==(l=_.shapeType)&&void 0!==l?l:this.shapeTypeCallback,shapeFill:null!==(d=null!==(h=_.shapeFill)&&void 0!==h?h:_.shapeColor)&&void 0!==d?d:this.shapeColorCallback,shapeStroke:null!==(c=_.shapeStroke)&&void 0!==c?c:this.shapeStrokeCallback,shapeHollow:null!==(u=_.shapeHollow)&&void 0!==u&&u,shapeLineWidth:_.shapeLineWidth,shapeSize:null!==(p=_.shapeSize)&&void 0!==p?p:_.size,hasShape:null!==(g=_.hasShape)&&void 0!==g?g:this.getHasShape(e)}}enableByType(t){return!0}getDefaultContentList(t){return[this.getDefaultContentPattern(t)]}getContentList(t,e,i,s,n,r){var a;return function(t,e,i,s,n,r){if(n&&n.length){const a=[];return n.forEach((n=>{y(t)?t.forEach((t=>{tL(a,t,e,i,s,n,r)})):xs(t)?tL(a,t,e,i,s,n,r):t&&QT(a,t,e,i,n,r)})),a}return null}(null!==(a=null==e?void 0:e.content)&&void 0!==a?a:this.getDefaultContentList(t),this.getDefaultContentPattern(t),i,s,n,r)}getTitleResult(t,e,i,s,n){let r=xs(e)?e(s,n):e;if(r?D(r.value)&&(r=Object.assign(Object.assign({},this.getDefaultTitlePattern(t)),r)):r=this.getDefaultTitlePattern(t),r&&!1!==r.visible){const t=function(t){var e;const i=(null===(e=t[0])||void 0===e?void 0:e.series)?[{data:t,value:""}]:t;for(const{data:t}of i)for(const{datum:e}of t)for(const t of null!=e?e:[])if(t)return t}(s),e={visible:qT(r.visible,t,n),value:eL(qT(r.value,t,n,r.valueFormatter),r.valueTimeFormat,r.valueTimeFormatMode),valueStyle:qT(r.valueStyle,t,n),hasShape:r.hasShape};return Object.keys(i).forEach((s=>{e[s]=qT(i[s],t,n)})),e}return{hasShape:!1,visible:!1}}getTooltipData(t,e,i,s,n){var r,a;if(!(this.enableByType(t)&&JT(t,this.spec)&&("dimension"!==t||s&&s.length)))return null;const o=null!==(a=null===(r=this.spec)||void 0===r?void 0:r[t])&&void 0!==a?a:null==e?void 0:e[t],l=this.getShapeAttrs(t,!0,e),h=this.getShapeAttrs(t,!1,e);let d;return"dimension"===t?(d=[],this.getContentList(t,o,l,i,s,n).forEach((t=>{d.push(t)}))):d=this.getContentList(t,o,l,i,s,n),{visible:!0,activeType:t,data:i,title:this.getTitleResult(t,null==o?void 0:o.title,h,i,n),content:d}}getDefaultTitlePattern(t){return{key:void 0,value:"group"===t?this.groupTooltipTitleCallback:this.dimensionTooltipTitleCallback}}getDefaultContentPattern(t){return{seriesId:this.series.id,key:"group"===t?this.groupTooltipKeyCallback:this.markTooltipKeyCallback,value:this.markTooltipValueCallback}}}const sL={min:t=>t.length?Ha(t.map((t=>1*t))):0,max:t=>t.length?ja(t.map((t=>1*t))):0,"array-min":t=>t.length?Ha(t.map((t=>1*t))):0,"array-max":t=>t.length?ja(t.map((t=>1*t))):0,values:t=>{const e={},i=[];for(const s of t)e[s]||(i.push(s),e[s]=1);return i}},nL=(t,e)=>{var i,s;let n=e.fields;if(xs(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return{};n=IT([],n);const r="parser"===e.target?"parserData":"latestData",a=t[0][r]?t[0][r]:t||[],o=null===(s=(i=t[0]).getFields)||void 0===s?void 0:s.call(i);return rL(a,n,o)},rL=(t,e,i)=>{const s={};let n=[],r=[];return e.forEach((e=>{const a=e.key;s[a]={};const o=null==i?void 0:i[a],l=e.operations,h=l.some((t=>"min"===t||"max"===t||"allValid"===t));let d=!0;n.length=0,t&&t.forEach((t=>{t&&n.push(t[a])}));const c=n.length;if(h){r.length=0,n.forEach(((t,e)=>{Jo(t)&&r.push(t)}));const t=n;n=r,r=t,d=n.length===c}else n=l.some((t=>"array-min"===t||"array-max"===t))?n.reduce(((t,e)=>(e&&e.forEach((e=>{Jo(e)&&t.push(e)})),t)),[]):n.filter((t=>void 0!==t));e.filter&&(n=n.filter(e.filter)),l.forEach((t=>{if(e.customize)s[a][t]=e.customize;else{if(o&&o.lockStatisticsByDomain&&!D(o.domain)){if("values"===t)return void(s[a][t]=o.domain.slice())}else if("allValid"===t)return;s[a][t]=sL[t](n),"array-max"===t&&(s[a].max=s[a][t]),"array-min"===t&&(s[a].min=s[a][t])}})),h&&(s[a].allValid=d)})),s},aL=(t,e)=>{const{config:i}=e;if(!i)return t;const{invalidType:s,checkField:n}=i();return"zero"!==s||n&&n.length&&t.forEach((t=>{n.forEach((e=>{Jo(t[e])||(t[e]=0)}))})),t};class oL extends gx{_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct([])}generateProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.name}}const lL=`${nh}_HIERARCHY_DEPTH`,hL=`${nh}_HIERARCHY_ROOT`,dL=`${nh}_HIERARCHY_ROOT_INDEX`;function cL(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function uL(t,e,i){t&&(i.needDefaultSeriesField&&(t[xT]=i.defaultSeriesField),t[yT]=e,t[bT]=i.getKey(t,e,i))}function pL(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function gL(t,e,i,s=0,n,r){void 0===r&&(r=e),uL(t,e,i),t[lL]=s,t[hL]=n||t[i.categoryField],t[dL]=r,t.children&&t.children.length&&t.children.forEach(((e,s)=>gL(e,s,i,t[lL]+1,t[hL],r)))}const mL={label:{name:"label",type:"text"}},_L=`${nh}_rect_x`,fL=`${nh}_rect_x1`,vL=`${nh}_rect_y`,yL=`${nh}_rect_y1`,bL={data:!0},xL={invalidType:!0,animation:!0,animationAppear:!0,animationEnter:!0,animationUpdate:!0,animationExit:!0,animationNormal:!0},SL={type:"fadeIn"};function ML(t,e){switch(e){case"grow":return(t=>({type:"horizontal"===t.direction?"growPointsXIn":"growPointsYIn",options:{orient:"horizontal"===t.direction?"positive":"negative"}}))(t);case"fadeIn":return SL;default:return(t=>({type:"clipIn",options:{clipDimension:"horizontal"===t.direction?"y":"x"}}))(t)}}const kL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!1),r=null!==(s=t.getGraphicAttribute("clipRange",!1))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:0,clipRangeByDimension:e.clipDimension},to:{clipRange:r,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:r}}},AL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!0),r=null!==(s=t.getGraphicAttribute("clipRange",!0))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:r,clipRangeByDimension:e.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:r},to:{clipRange:0}}},wL=(t,e,i)=>{var s,n,r,a;const o=null!==(s=t.getFinalAnimationAttributes())&&void 0!==s?s:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(n=o.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(a=o.strokeOpacity)&&void 0!==a?a:1}}},TL=(t,e,i)=>{var s,n,r;return{from:{opacity:null!==(s=t.getGraphicAttribute("opacity",!0))&&void 0!==s?s:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==n?n:1,strokeOpacity:null!==(r=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==r?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},LL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{from:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0},to:{x:e,x1:i,width:s}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{from:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0},to:{y:e,y1:i,height:s}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width"),n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height"),o={};return M(s)?(o.x=e+s/2,o.width=0,o.x1=void 0):(o.x=(e+i)/2,o.x1=(e+i)/2,o.width=void 0),M(a)?(o.y=n+a/2,o.height=0,o.y1=void 0):(o.y=(n+r)/2,o.y1=(n+r)/2,o.height=void 0),{from:o,to:{x:e,y:n,x1:i,y1:r,width:s,height:a}}}}},CL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{to:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{to:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("width"),a=t.getFinalAnimationAttribute("height"),o={};return M(r)?(o.x=e+r/2,o.width=0,o.x1=void 0):(o.x=(e+s)/2,o.x1=(e+s)/2,o.width=void 0),M(a)?(o.y=i+a/2,o.height=0,o.y1=void 0):(o.y=(i+n)/2,o.y1=(i+n)/2,o.height=void 0),{to:o}}}},EL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x"),r=t.getFinalAnimationAttribute("x1"),a=t.getFinalAnimationAttribute("width");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=o):o=i.width:o=h(null==e?void 0:e.overall)?null==e?void 0:e.overall:0,{from:{x:o,x1:D(r)?void 0:o,width:D(a)?void 0:0},to:{x:n,x1:r,width:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}(t,e)},DL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x1"),r=t.getFinalAnimationAttribute("width");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=a):a=i.width:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{x:a,x1:D(n)?void 0:a,width:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0}}}(t,e)},PL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=o):o=i.height:o=h(null==e?void 0:e.overall)?e.overall:0,{from:{y:o,y1:D(r)?void 0:o,height:D(a)?void 0:0},to:{y:n,y1:r,height:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}(t,e)},OL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("height");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=a):a=i.height:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{y:a,y1:D(n)?void 0:a,height:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0}}}(t,e)},RL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes();if(e&&"anticlockwise"===e.orient){const t=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t,endAngle:t},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}}const s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:s,endAngle:s},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:null==i?void 0:i.endAngle},to:{startAngle:null==i?void 0:i.startAngle}}:{from:{endAngle:null==i?void 0:i.startAngle},to:{endAngle:null==i?void 0:i.endAngle}}})(t,e)},BL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{if(e&&"anticlockwise"===e.orient){const i=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}}const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("startAngle",!0)},to:{startAngle:null==i?void 0:i.endAngle}}:{from:{endAngle:t.getGraphicAttribute("endAngle",!0)},to:{endAngle:null==i?void 0:i.startAngle}}})(t,e)},IL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes(),s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:s,outerRadius:s},to:{innerRadius:null==i?void 0:i.innerRadius,outerRadius:null==i?void 0:i.outerRadius}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:null==i?void 0:i.outerRadius},to:{innerRadius:null==i?void 0:i.innerRadius}}:{from:{outerRadius:null==i?void 0:i.innerRadius},to:{outerRadius:null==i?void 0:i.outerRadius}}})(t,e)},FL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0),outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:i,outerRadius:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:null==i?void 0:i.outerRadius}}:{from:{outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:null==i?void 0:i.innerRadius}}})(t,e)},YL=(t,e,i)=>{const s=t.getGraphicAttribute("points",!1),n={x:0,y:0};return s.forEach((t=>{n.x+=t.x,n.y+=t.y})),n.x/=s.length,n.y/=s.length,e&&e.center&&(Zo(e.center.x)&&(n.x=e.center.x),Zo(e.center.y)&&(n.y=e.center.y)),"area"===t.mark.markType&&(n.x1=n.x,n.y1=n.y),s.map((t=>Object.assign({},t,n)))},jL=(t,e,i)=>({from:{points:YL(t,e)},to:{points:t.getGraphicAttribute("points",!1)}}),HL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:YL(t,e)}}),zL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.width;return i.group&&(e=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=e),Object.assign(Object.assign({},t),{x:e,y:t.y,x1:e,y1:t.y1,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:0,y:t.y,x1:0,y1:t.y1,defined:!1!==t.defined})})),NL=(t,e,i)=>({from:{points:zL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),VL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:zL(t,e,i)}}),WL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.height;return i.group&&(e=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=e),Object.assign(Object.assign({},t),{x:t.x,y:e,x1:t.x1,y1:e,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:t.x,y:0,x1:t.x1,y1:0,defined:!1!==t.defined})})),GL=(t,e,i)=>({from:{points:WL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),UL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:WL(t,e,i)}}),$L=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l,excludeChannels:h=[]}=null!=e?e:{};let d=0,c=0;"negative"===a&&(i.group?(d=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),c=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupWidth=d,i.groupHeight=c):(d=i.width,c=i.height)),d+=r,c+=r;const u=xs(l)?l.call(null,t.getDatum(),t,i):l,p=u&&Zo(u.x)?u.x:d,g=u&&Zo(u.y)?u.y:c,m=h.includes("x")?t.getGraphicAttribute("x"):t.getFinalAnimationAttribute("x"),_=h.includes("y")?t.getGraphicAttribute("y"):t.getFinalAnimationAttribute("y");switch(o){case"x":return{from:{x:p},to:{x:m}};case"y":return{from:{y:g},to:{y:_}};default:return{from:{x:p,y:g},to:{x:m,y:_}}}},XL=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l}=null!=e?e:{},h=i.group?i.group.getBounds():null,d=null!==(s=null==h?void 0:h.width())&&void 0!==s?s:i.width,c=null!==(n=null==h?void 0:h.height())&&void 0!==n?n:i.height,u=("negative"===a?d:0)+r,p=("negative"===a?c:0)+r,g=xs(l)?l.call(null,t.getDatum(),t,i):l,m=g&&Zo(g.x)?g.x:u,_=g&&Zo(g.y)?g.y:p;switch(o){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:m}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:_}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:m,y:_}}}},KL=(t,e,i)=>{var s,n,r,a;const o=t.getFinalAnimationAttributes();switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(s=null==o?void 0:o.scaleX)&&void 0!==s?s:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(n=null==o?void 0:o.scaleY)&&void 0!==n?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(r=null==o?void 0:o.scaleX)&&void 0!==r?r:1,scaleY:null!==(a=null==o?void 0:o.scaleY)&&void 0!==a?a:1}}}},qL=(t,e,i)=>{var s,n,r,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!0))&&void 0!==s?s:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!0))&&void 0!==n?n:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!0))&&void 0!==r?r:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!0))&&void 0!==a?a:1},to:{scaleX:0,scaleY:0}}}},ZL={symbol:["_mo_hide_","visible"]},JL=(t,e,i)=>{const s=Object.assign({},t.getPrevGraphicAttributes()),n=Object.assign({},t.getNextGraphicAttributes());let r;e&&Fa(e.excludeChannels).forEach((t=>{delete s[t],delete n[t]})),t.mark&&t.mark.markType&&(r=ZL[t.mark.markType])&&r.forEach((t=>{delete s[t],delete n[t]})),Object.keys(n).forEach((t=>{Im(s[t],n[t])&&(delete s[t],delete n[t])}));const a=t.getFinalGraphicAttributes();return Object.keys(s).forEach((t=>{D(n[t])&&(D(a[t])||Im(s[t],a[t])?delete s[t]:n[t]=a[t])})),{from:s,to:n}},QL=(t,e,i)=>{var s;const n=null!==(s=t.getFinalAnimationAttribute("angle"))&&void 0!==s?s:0;let r=0;return r=dd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:Zo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:r},to:{angle:n}}},tC=(t,e,i)=>{var s;const n=null!==(s=t.getGraphicAttribute("angle",!0))&&void 0!==s?s:0;let r=0;return r=dd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:Zo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:r}}},eC=()=>{fc.registerAnimationType("clipIn",kL)},iC=()=>{fc.registerAnimationType("clipOut",AL)},sC=()=>{fc.registerAnimationType("fadeIn",wL)},nC=()=>{fc.registerAnimationType("fadeOut",TL)},rC=()=>{fc.registerAnimationType("growCenterIn",LL)},aC=()=>{fc.registerAnimationType("growCenterOut",CL)},oC=()=>{fc.registerAnimationType("growHeightIn",PL)},lC=()=>{fc.registerAnimationType("growHeightOut",OL)},hC=()=>{fc.registerAnimationType("growWidthIn",EL)},dC=()=>{fc.registerAnimationType("growWidthOut",DL)},cC=()=>{fc.registerAnimationType("growPointsIn",jL)},uC=()=>{fc.registerAnimationType("growPointsOut",HL)},pC=()=>{fc.registerAnimationType("growPointsXIn",NL)},gC=()=>{fc.registerAnimationType("growPointsXOut",VL)},mC=()=>{fc.registerAnimationType("growPointsYIn",GL)},_C=()=>{fc.registerAnimationType("growPointsYOut",UL)},fC=()=>{fc.registerAnimationType("growAngleIn",RL)},vC=()=>{fc.registerAnimationType("growAngleOut",BL)},yC=()=>{fc.registerAnimationType("growRadiusIn",IL)},bC=()=>{fc.registerAnimationType("growRadiusOut",FL)},xC=()=>{fc.registerAnimationType("moveIn",$L)},SC=()=>{fc.registerAnimationType("moveOut",XL)},MC=()=>{fc.registerAnimationType("scaleIn",KL)},kC=()=>{fc.registerAnimationType("scaleOut",qL)},AC=()=>{fc.registerAnimationType("rotateIn",QL)},wC=()=>{fc.registerAnimationType("rotateOut",tC)},TC=()=>{fc.registerAnimationType("update",JL)},LC={appear:{duration:1e3,easing:"cubicOut"},update:{type:"update",duration:300,easing:"linear"},enter:{duration:300,easing:"linear"},exit:{duration:300,easing:"linear"},disappear:{duration:500,easing:"cubicIn"},state:{duration:300,easing:"linear"}},CC={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:{type:"scaleOut"}},EC={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}},DC=()=>{Xl.registerAnimation("scaleInOut",(()=>CC))},PC=()=>{Xl.registerAnimation("fadeInOut",(()=>EC))},OC=(t,e)=>({appear:ML(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined","segments"]}},{channel:["points","segments"],custom:fA,duration:LC.update.duration,easing:LC.update.easing,customParameters:{clipRangeByDimension:"horizontal"===t.direction?"y":"x"}}],disappear:{type:"clipOut"}}),RC=()=>{Xl.registerAnimation("line",OC)},BC=()=>{r_.useRegisters([oC,lC,hC,dC,rC,aC])},IC=()=>{r_.useRegisters([yC,bC,fC,vC])},FC=()=>{r_.useRegisters([cC,uC,pC,gC,mC,_C,eC,iC])},YC=()=>{r_.useRegisters([cC,uC])},jC=[...Object.keys(LC),"normal"];function HC(t={},e,i){const s={};for(let n=0;n{t.controlOptions={stopWhenStateChange:!0}})),a?(l=y(a)?a.map(((t,e)=>{var s;let n=t;return GC(n)&&delete n.type,n.oneByOne&&(n=NC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:VC,null==i?void 0:i.dataCount)),n})):o.map(((t,e)=>{var s;let n=Ll({},o[e],a);return GC(n)&&delete n.type,n.oneByOne&&(n=NC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:VC,null==i?void 0:i.dataCount)),n})),s[r]=l):s[r]=o}return s}function zC(t,e,i){var s,n,r,a,o,l;const h={};return M(e.animationAppear)&&(h.appear=null!==(s=e.animationAppear[t])&&void 0!==s?s:e.animationAppear),M(e.animationDisappear)&&(h.disappear=null!==(n=e.animationDisappear[t])&&void 0!==n?n:e.animationDisappear),M(e.animationEnter)&&(h.enter=null!==(r=e.animationEnter[t])&&void 0!==r?r:e.animationEnter),M(e.animationExit)&&(h.exit=null!==(a=e.animationExit[t])&&void 0!==a?a:e.animationExit),M(e.animationUpdate)&&(h.update=null!==(o=e.animationUpdate[t])&&void 0!==o?o:e.animationUpdate),M(e.animationState)&&(h.state=null!==(l=e.animationState[t])&&void 0!==l?l:e.animationState),e.animationNormal&&e.animationNormal[t]&&(h.normal=e.animationNormal[t]),function(t,e){return t?(UC(t=k(t),(t=>{var i;return xs(t)&&(null===(i=t.prototype)||void 0===i?void 0:i.constructor)!==t?(...i)=>t(...i,e):t})),t):t}(h,i)}function NC(t,e,i){const{oneByOne:s,duration:n,delay:r,delayAfter:a}=t;return t.delay=(t,i,a)=>{const o=e(t,a),l=xs(n)?n(t,i,a):Zo(n)?n:0,h=xs(r)?r(t,i,a):Zo(r)?r:0;let d=xs(s)?s(t,i,a):s;return!1===d?h:(d=!0===d?0:d,h+o*(l+d))},t.delayAfter=(t,r,o)=>{const l=e(t,o),h=xs(n)?n(t,r,o):Zo(n)?n:0,d=xs(a)?a(t,r,o):Zo(a)?a:0;let c=xs(s)?s(t,r,o):s;return!1===c?d:(c=!0===c?0:c,d+((i?i():r.mark.elements.length)-l)*(h+c))},delete t.oneByOne,t}function VC(t,e){var i,s;return null!==(i=null==t?void 0:t[yT])&&void 0!==i?i:null===(s=null==e?void 0:e.VGRAMMAR_ANIMATION_PARAMETERS)||void 0===s?void 0:s.elementIndex}function WC(t,e){var i,s,n,r,a;if(!1===t.animation)return!1;if(!1===(null===(i=t.morph)||void 0===i?void 0:i.enable))return!1;const o=!1!==(null!==(n=null===(s=t.animationAppear)||void 0===s?void 0:s[e])&&void 0!==n?n:t.animationAppear),l=!1!==(null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r[e])&&void 0!==a?a:t.animationUpdate);return!(!o||!l)}function GC(t){return!function(t){return M(t.timeSlices)}(t)&&M(t.channel)}function UC(t,e){if(y(t))t.forEach(((i,s)=>{t[s]=e(t[s],s),UC(t[s],e)}));else if(bs(t))for(const i in t)t[i]=e(t[i],i),UC(t[i],e)}function $C(t){var e,i,s,n;const r=t.getSpec();if(!1===r.animation)return!1;if(!M(t.getRegion().animate))return!1;let a=null!==(e=r.animationThreshold)&&void 0!==e?e:Number.MAX_SAFE_INTEGER;return null===(i=t.getMarks())||void 0===i||i.forEach((t=>{const e=t.getProgressiveConfig();e&&(e.large&&e.largeThreshold&&(a=Math.min(a,e.largeThreshold)),e.progressiveThreshold&&(a=Math.min(a,e.progressiveThreshold)))})),!((null===(n=null===(s=t.getRawData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)>=a)}class XC extends Hy{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=Fa(e)}addLabelSpec(t,e,i=!1){this.markLabelSpec[t]||(this.markLabelSpec[t]=[]),i?this.markLabelSpec[t].unshift(e):this.markLabelSpec[t].push(e)}getTheme(t,e){var i,s,n;const r=yl(t),a=null===(i=this._option)||void 0===i?void 0:i.getTheme(),{markByName:o,mark:l}=a,h=this._option.type,d=Xl.getSeriesMarkMap(h)?function(t,e,i,s){const n=Xl.getSeriesMarkMap(e);if(!n)return t;const r={};return Object.values(n).forEach((({type:e,name:n})=>{r[n]=Ll({},null==i?void 0:i[Fa(e)[0]],null==s?void 0:s[n],null==t?void 0:t[n])})),Object.assign(Object.assign({},t),r)}($d(a,`series.${h}`),h,l,o):{},c=$d(a,`series.${h}_${r}`);return Ll({},d,c,(null!==(n=null!==(s=this.stack)&&void 0!==s?s:null==c?void 0:c.stack)&&void 0!==n?n:null==d?void 0:d.stack)?$d(a,`series.${h}_stack`):void 0)}transformSpec(t,e,i){this._transformStack(t);const s=super.transformSpec(t,e,i);return this._transformLabelSpec(s.spec),Object.assign(Object.assign({},s),{markLabelSpec:this.markLabelSpec,stack:this.stack})}_transformLabelSpec(t){}_transformStack(t){v(t.stack)&&(this.stack=t.stack),v(t.percent)&&(this.stack=t.percent||this.stack),D(this.stack)&&this._supportStack&&t.seriesField&&(this.stack=!0)}_addMarkLabelSpec(t,e,i="label",s="initLabelMarkStyle",n=!0,r){t&&Fa(t[i]).forEach((i=>{var a,o,l;if(i&&i.visible){const{animation:h=!0,animationUpdate:d=!0,animationEnter:c=!0,animationExit:u=!0}=i,{animationUpdate:p=!0,animationEnter:g=!0,animationExit:m=!0}=t,_=!!(null!==(l=null!==(o=null===(a=this._option)||void 0===a?void 0:a.animation)&&void 0!==o?o:t.animation)&&void 0!==l?l:i.animation)&&!!n;this.addLabelSpec(e,Object.assign(Object.assign({},i),{animation:!!_&&h,animationUpdate:!!(_&&p&&d)&&p,animationEnter:!!(_&&g&&c)&&g,animationExit:!!(_&&g&&u)&&m,getStyleHandler:t=>{var e;return null===(e=t[s])||void 0===e?void 0:e.bind(t)}}),r)}}))}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{outerRadius:s,innerRadius:n,direction:r}=t;return M(s)&&(i.outerRadius=s),M(n)&&(i.innerRadius=n),M(r)&&(i.direction=r),Object.keys(i).length>0?i:void 0}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>{const e=Ll({},i,s,t),n=i.label;return n&&bs(n)&&y(e.label)&&(e.label=e.label.map((t=>Ll({},n,t)))),e};return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}}class KC extends Ny{getRegion(){return this._region}getLayoutStartPoint(){return this._region.getLayoutStartPoint()}getRootMark(){return this._rootMark}getSeriesMark(){return this._seriesMark}getRawData(){return this._rawData}getViewDataFilter(){return this._viewDataFilter}getViewData(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}getViewDataProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getGroups(){return this._groups}getStack(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.stack}getStackValue(){var t;return null!==(t=this._spec.stackValue)&&void 0!==t?t:`${nh}_series_${this.type}`}getPercent(){return this._spec.percent}getStackOffsetSilhouette(){return this._spec.stackOffsetSilhouette}get tooltipHelper(){return this._tooltipHelper||this.initTooltip(),this._tooltipHelper}getInvalidType(){return this._invalidType}setInvalidType(t){var e;this._invalidType=t,null===(e=this.getViewData())||void 0===e||e.reRunAllTransform()}getMarkAttributeContext(){return this._markAttributeContext}constructor(t,e){var i;super(t,e),this.specKey="series",this.type="series",this.layoutType="absolute",this.modelType="series",this.name=void 0,this.transformerConstructor=XC,this.coordinate="none",this._region=null,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:null,height:null},this.getLayoutRect=()=>{var t,e;return{width:null!==(t=this._layoutRect.width)&&void 0!==t?t:this._region.getLayoutRect().width,height:null!==(e=this._layoutRect.height)&&void 0!==e?e:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this.layoutZIndex=Dy.SeriesGroup,this._invalidType="break",this._region=e.region,this._dataSet=e.dataSet,(null===(i=this._spec)||void 0===i?void 0:i.name)&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(zd.afterInitData,{model:this}),this.initRootMark(),this.initMark();const t=$C(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this._option.disableTriggerEvent||this.initInteraction(),this.afterInitMark(),this.initEvent(),this.event.emit(zd.afterInitEvent,{model:this})}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},seriesColor:t=>{var e;return D(t)&&(t=this.getSeriesKeys()[0]),null===(e=this._option.globalScale.getScale("color"))||void 0===e?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),M(this._spec.invalidType)&&(this._invalidType=this._spec.invalidType)}getInvalidCheckFields(){return[this.getStackValueField()]}initInvalidDataTransform(){var t,e;"zero"===this._invalidType&&(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"invalidTravel",aL),null===(e=this._rawData)||void 0===e||e.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getInvalidCheckFields()})}},!1))}initData(){var t,e,i;const s=null!==(t=this._spec.data)&&void 0!==t?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(s&&(this._rawData=jp(s,this._dataSet,this._option.sourceDataList)),null===(i=null===(e=this._rawData)||void 0===e?void 0:e.target)||void 0===i||i.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this.getStack()&&(this._viewDataFilter=Yp(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));const t=Yp(this.getStack()?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new oL(this._option,t),this.getStack()&&this._viewDataFilter.target.removeListener("change",t.reRunAllTransform)}this.initInvalidDataTransform()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,s,n;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]||e&&(D(this._rawStatisticsCache[t].min)||D(this._rawStatisticsCache[t].max))||!e&&D(this._rawStatisticsCache[t].values))if(this._viewDataStatistics&&(!this._viewDataFilter||this._viewDataFilter.transformsArr.length<=1)&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){const i=null===(s=this._rawData.getFields())||void 0===s?void 0:s[t];if(i&&i.lockStatisticsByDomain&&i.domain)this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=Ha(i.domain),this._rawStatisticsCache[t].max=ja(i.domain)):this._rawStatisticsCache[t].values=i.domain;else{const i=rL(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t];this._rawStatisticsCache[t]=E(null!==(n=this._rawStatisticsCache[t])&&void 0!==n?n:{},i)}}return this._rawStatisticsCache[t]}_statisticViewData(){Cp(this._dataSet,"dimensionStatistics",nL);const t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new R(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&IT(t,[{key:this._seriesField,operations:["values"]}]),t},target:"latest"}},!1),this._data.getDataView().target.removeListener("change",this._viewDataStatistics.reRunAllTransform),this.getStack()&&this.createdStackData()}createStatisticalData(t,e,i){Cp(this._dataSet,"dimensionStatistics",nL);const s=new R(this._dataSet,{name:t});return s.parse([e],{type:"dataview"}),s.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var t;const s=IT(this.getStatisticFields(),null!==(t=null==i?void 0:i(e.name))&&void 0!==t?t:[]);return this._seriesField&&IT(s,[{key:this._seriesField,operations:["values"]}]),s},target:"latest"}},!1),s}createdStackData(){const t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new R(this._dataSet,{name:t}),this._viewStackData.parse([this._viewDataFilter],{type:"dataview"}),this._viewStackData.transform({type:"stackSplit",options:{fields:this.getStackGroupFields()}},!1)}_noAnimationDataKey(t,e){return e}generateDefaultDataKey(t){var e;return D(t)?(t,e,i)=>{if(!1===this._spec.animation){const i=this._noAnimationDataKey(t,e);if(void 0!==i)return i}const{keyMap:s}=i,n=this._getSeriesDataKey(t);return void 0===s.get(n)?(s.set(n,0),n):(s.set(n,s.get(n)+1),`${n}_${s.get(n)}`)}:S(t)?e=>e[t]:y(t)&&t.every((t=>S(t)))?e=>t.map((t=>e[t])).join("-"):xs(t)?(e,i)=>t(e,i):(null===(e=this._option)||void 0===e||e.onError(`invalid dataKey: ${t}`),(t,e)=>{})}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"addVChartProperty",GT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:cL.bind(this),call:uL}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;null===(e=this._rawDataStatistics)||void 0===e||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(zd.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(zd.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(zd.viewDataUpdate,{model:this}),null===(e=this._data)||void 0===e||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(zd.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||D(e)?null:t[e]}getDatumPositionValues(t,e){return!t||D(e)?[]:S(e)?[t[e]]:e.map((e=>t[e]))}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:null===(e=(t=this._region).getGroupMark)||void 0===e?void 0:e.call(t),dataView:!1}),this._rootMark.setZIndex(this.layoutZIndex)}_getExtensionMarkNamePrefix(){return`${this.type}_${this.id}_extensionMark`}_initExtensionMark(t){var e;if(!this._spec.extensionMark)return;const i=this.getMarksWithoutRoot();t.depend=i,null===(e=this._spec.extensionMark)||void 0===e||e.forEach(((e,i)=>{this._createExtensionMark(e,null,this._getExtensionMarkNamePrefix(),i,t)}))}_createExtensionMark(t,e,i,s,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,customShape:null==t?void 0:t.customShape,componentType:t.componentType,depend:n.depend,key:t.dataKey});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation){const e=HC({},zC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if("group"===t.type)i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}));else if(!(e||D(t.dataId)&&D(t.dataIndex))){const e=this._option.getSeriesData(t.dataId,t.dataIndex);e===this._rawData?a.setDataView(this.getViewData(),this.getViewDataProductId()):(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}_updateExtensionMarkSpec(){var t;null===(t=this._spec.extensionMark)||void 0===t||t.forEach(((t,e)=>{const i=this._marks.getMarkWithInfo({name:`${this._getExtensionMarkNamePrefix()}_${e}`});i&&(this.initMarkStyleWithSpec(i,t),i.updateStaticEncode(),i.updateLayoutState())}))}getStackData(){var t;return null===(t=this._viewStackData)||void 0===t?void 0:t.latestData}_parseSelectorOfInteraction(t,e){if(!e||!e.length)return[];const i=[];return t.markIds?e.filter((e=>{t.markIds.includes(e.getProductId())&&i.push(`#${e.getProductId()}`)})):t.markNames?e.forEach((e=>{t.markNames.includes(e.name)&&i.push(`#${e.getProductId()}`)})):e.forEach((t=>{i.push(`#${t.getProductId()}`)})),i}_parseDefaultInteractionConfig(t){if(!(null==t?void 0:t.length))return[];const e=(i=this._option.mode)===n["desktop-browser"]||i===n["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"pointertap"}}:ul(i)||pl(i)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"tap"}}:null;var i;let s=Object.assign({},null==e?void 0:e.hover),r=Object.assign({},null==e?void 0:e.select);const a=this._spec.hover;v(a)?s.enable=a:bs(a)&&(s.enable=!0,s=Ll(s,a));const o=this._spec.select;v(o)?r.enable=o:bs(o)&&(r.enable=!0,r=Ll(r,o));const l=[];if(s.enable){const e=this._parseSelectorOfInteraction(s,t);e.length&&l.push({seriesId:this.id,regionId:this._region.id,selector:e,type:"element-highlight",trigger:s.trigger,triggerOff:s.triggerOff,blurState:Sy.STATE_HOVER_REVERSE,highlightState:Sy.STATE_HOVER})}if(r.enable){const e=this._parseSelectorOfInteraction(r,t),i="multiple"===r.mode,s=M(r.triggerOff)?r.triggerOff:i?["empty"]:["empty",r.trigger];e.length&&l.push({type:"element-select",seriesId:this.id,regionId:this._region.id,selector:e,trigger:r.trigger,triggerOff:s,reverseState:Sy.STATE_SELECTED_REVERSE,state:Sy.STATE_SELECTED,isMultiple:i})}return l}_parseInteractionConfig(t){const e=this.getCompiler();if(!e)return;const{interactions:i}=this._spec,s=this._parseDefaultInteractionConfig(t);s&&s.length&&s.forEach((t=>{e.addInteraction(t)})),i&&i.length&&i.forEach((t=>{const i=this._parseSelectorOfInteraction(t,this.getMarks());i.length&&e.addInteraction(Object.assign(Object.assign({},t),{selector:i,seriesId:this.id,regionId:this._region.id}))}))}initInteraction(){const t=this.getMarksWithoutRoot();this._parseInteractionConfig(t)}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;const e=this._spec.seriesStyle;if(!e||!e.length)return;const i=null!==(t=this._seriesField)&&void 0!==t?t:xT;this.getMarksWithoutRoot().forEach((t=>{const s={},n={},r={};e.forEach((e=>{var i;const a=null===(i=e[t.name])||void 0===i?void 0:i.style;a&&(s[e.name]=!0,r[e.name]=r[e.name]||{},Object.keys(a).forEach((t=>{n[t]=!0,r[e.name][t]=a[t]})))})),t.state.addStateInfo({stateValue:ST,level:-1,filter:t=>Array.isArray(t)?0!==t.length&&!0===s[t[0][i]]:!0===s[t[i]]});const a={};Object.keys(n).forEach((e=>{a[e]=s=>{var n,a;let o;if(Array.isArray(s)){if(0===s.length)return;o=null===(n=r[s[0][i]])||void 0===n?void 0:n[e]}return o=null===(a=r[s[i]])||void 0===a?void 0:a[e],M(o)?o:t.getAttribute(e,s)}})),this.setMarkStyle(t,a,ST,Oy.User_SeriesStyle)}))}afterInitMark(){this.event.emit(zd.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField),this.getMarks().forEach((t=>{var e,i;(null===(i=null===(e=t.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&t.setAttribute("stroke",this.getColorAttribute(),"normal",Oy.Base_Series)}))}getMarksWithoutRoot(){return this.getMarks().filter((t=>!t.name.includes("seriesGroup")))}getMarksInType(t){return this._marks.getMarksInType(t)}getMarkInName(t){return this._marks.get(t)}getMarkInId(t){return this.getMarks().find((e=>e.id===t))}initEvent(){var t,e,i;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.target.addListener("change",this.viewDataUpdate.bind(this)),null===(i=this._viewDataStatistics)||void 0===i||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent(),this.getCompiler().removeInteraction(this.id)}initTooltip(){this._tooltipHelper=new iL(this)}_compareExtensionMarksSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.type!==t[i].type||e.id!==t[i].id))?i.reMake=!0:e.some(((e,i)=>e.visible!==t[i].visible))&&(i.reCompile=!0)}_compareLabelSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.labelLayout!==t[i].labelLayout||e.visible!==t[i].visible))?i.reMake=!0:!i.reCompile&&e.some(((e,i)=>!Im(e,t[i])))&&(i.reCompile=!0)}_compareSpec(t,e,i){const s=super._compareSpec(t,e),n=Object.keys(e||{}).sort();if(!Im(n,Object.keys(t||{}).sort()))return s.reMake=!0,s;const r=Object.assign(Object.assign(Object.assign(Object.assign({},bL),xL),i),{extensionMark:!0,label:!0,totalLabel:!0});return this._compareExtensionMarksSpec(Fa(t.extensionMark),Fa(e.extensionMark),s),!s.reMake&&this._compareLabelSpec(Fa(t.label),Fa(e.label),s),!s.reMake&&this._compareLabelSpec(Fa(t.totalLabel),Fa(e.totalLabel),s),s.reMake?s:(!s.reCompile&&this._marks.getMarks().some((i=>{var s,n;return r[i.name]=!0,(null===(s=e[i.name])||void 0===s?void 0:s.visible)!==(null===(n=t[i.name])||void 0===n?void 0:n.visible)}))&&(s.reCompile=!0),!s.reCompile&&n.some((i=>xL[i]&&!Im(t[i],e[i])))&&(s.reCompile=!0),n.some((i=>!r[i]&&!Im(t[i],e[i])))?(s.reMake=!0,s):s)}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof R||Hp(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);const e=this.getMarksWithoutRoot();e.forEach((t=>{this._spec[t.name]&&this.initMarkStyleWithSpec(t,this._spec[t.name])})),this.initMarkStyle(),e.forEach((t=>{t.updateStaticEncode(),t.updateLayoutState(!0)})),this._updateExtensionMarkSpec(),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec(),$C(this)&&this.initAnimation()}onEvaluateEnd(t){this._data.updateData()}onRender(t){}release(){var t,e,i;super.release(),this._viewDataMap.clear();const s=null===(e=null===(t=this._rawData)||void 0===t?void 0:t.transformsArr)||void 0===e?void 0:e.findIndex((t=>"addVChartProperty"===t.type));s>=0&&this._rawData.transformsArr.splice(s,1),null===(i=this._data)||void 0===i||i.release(),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){Zo(t.x)&&(this._layoutStartPoint.x=t.x),Zo(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){Zo(t)&&(this._layoutRect.width=t),Zo(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}getSeriesStyle(t){return e=>{var i,s;return null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0}}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesInfoInField(t){var e,i;return this._getSeriesInfo(t,null!==(i=null===(e=this.getRawDataStatisticsByField(t))||void 0===e?void 0:e.values)&&void 0!==i?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo(null!==(t=this._seriesField)&&void 0!==t?t:xT,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;const i=this.getDefaultColorDomain(),s=this._getDataScheme();return null===(e=(t=(new nx).domain(i)).range)||void 0===e?void 0:e.call(t,s)}_getDataScheme(){return Sl(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?null===(e=null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesField])||void 0===e?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(e=this._seriesField)&&void 0!==e?e:xT}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={}){var i,s,n,r;const{key:a,groupKey:o,skipBeforeLayouted:l,themeSpec:h={},markSpec:d,dataView:c,dataProductId:u,parent:p,isSeriesMark:g,depend:m,progressive:_,support3d:f=this._spec.support3d||!!this._spec.zField,morph:y=!1,clip:b,customShape:x,stateSort:S,noSeparateStyle:k=!1}=e,A=super._createMark(t,{key:null!=a?a:this._getDataIdKey(),support3d:f,seriesId:this.id,attributeContext:this._markAttributeContext,componentType:e.componentType,noSeparateStyle:k});if(M(A)){this._marks.addMark(A,{name:t.name}),g&&(this._seriesMark=A),D(p)?null===(i=this._rootMark)||void 0===i||i.addMark(A):!1!==p&&p.addMark(A),D(c)?(A.setDataView(this.getViewData(),this.getViewDataProductId()),A.setSkipBeforeLayouted(!0)):!1!==c&&A.setDataView(c,u),v(l)&&A.setSkipBeforeLayouted(l),M(m)&&A.setDepend(...Fa(m));const a=this.getSpec()||{};A.setMorph(y),A.setMorphKey((null===(s=a.morph)||void 0===s?void 0:s.morphKey)||`${this.getSpecIndex()}_${this.getMarks().length}`),A.setMorphElementKey(null!==(r=null===(n=a.morph)||void 0===n?void 0:n.morphElementKey)&&void 0!==r?r:e.defaultMorphElementKey),D(_)||A.setProgressiveConfig(_),D(o)||A.setGroupKey(o),x&&A.setCustomizedShapeCallback(x),S&&A.setStateSortCallback(S),b&&A.setClip(b),this.initMarkStyleWithSpec(A,Ll({},h,d||a[A.name]))}return A}_getDataIdKey(){var t;return null!==(t=super._getDataIdKey())&&void 0!==t?t:bT}_getSeriesDataKey(t){let e="";if(!t)return e;const i=this.getDimensionField();e=i.map((e=>t[e])).join("_");const s=this.getSeriesField();return s&&!i.includes(s)&&(e+=`_${t[s]}`),e}addViewDataFilter(t){var e,i;null===(i=null!==(e=this._viewDataFilter)&&void 0!==e?e:this.getViewData())||void 0===i||i.transform(t,!1)}reFilterViewData(){var t,e;null===(e=null!==(t=this._viewDataFilter)&&void 0!==t?t:this.getViewData())||void 0===e||e.reRunAllTransform()}reTransformViewData(){var t,e;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}fillData(){var t;null===(t=this.getRawData())||void 0===t||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==AT&&t!==TT&&t!==kT&&t!==wT||(t=this.getStackValueField()),null!==(e=YT(this.getRawData(),t))&&void 0!==e?e:t}_getInvalidConnectType(){return"zero"===this._invalidType?"zero":"link"===this._invalidType?"connect":"none"}_getInvalidDefined(t){const e=this.getInvalidCheckFields();return!e.length||e.every((e=>Jo(t[e])))}_getRelatedComponentSpecInfo(t){var e;const i=this.getSpecIndex(),s=null===(e=this._option.getSpecInfo().component[t])||void 0===e?void 0:e.filter((t=>t.seriesIndexes.includes(i)));return null!=s?s:[]}_forEachStackGroup(t,e){var i,s;(e=null!=e?e:null===(i=this._viewStackData)||void 0===i?void 0:i.latestData)&&((null===(s=e.values)||void 0===s?void 0:s.length)?t(e):e.nodes&&Object.values(e.nodes).forEach((e=>{this._forEachStackGroup(t,e)})))}isDatumInViewData(t){if(!t)return!1;const e=this.getViewData().latestData;return!!e&&(!!e.includes(t)||e.some((e=>Object.keys(t).every((i=>t[i]===e[i])))))}getSeriesFieldValue(t,e){var i;return t[null!==(i=null!=e?e:this.getSeriesField())&&void 0!==i?i:xT]}}function qC(t,e,i){const s=t.getScale(0),n="isInverse"in t&&t.isInverse();Qh(s.type)?i.sort(((t,i)=>(t[e]-i[e])*(n?-1:1))):i.sort(((t,i)=>(s.index(t[e])-s.index(i[e]))*(n?-1:1)))}function ZC(t){return{dataIndex:e=>{var i,s;const n="horizontal"===t.direction?t.fieldY[0]:t.fieldX[0],r=null==e?void 0:e[n],a="horizontal"===t.direction?t.scaleY:t.scaleX;return(null!==(s=null===(i=null==a?void 0:a.domain)||void 0===i?void 0:i.call(a))&&void 0!==s?s:[]).indexOf(r)||0},dataCount:()=>{var e,i,s;const n="horizontal"===t.direction?t.scaleY:t.scaleX;return null!==(s=(null!==(i=null===(e=null==n?void 0:n.domain)||void 0===e?void 0:e.call(n))&&void 0!==i?i:[]).length)&&void 0!==s?s:0}}}KC.mark=mL,KC.transformerConstructor=XC;class JC extends KC{constructor(){super(...arguments),this.coordinate="cartesian",this._bandPosition=.5,this._scaleConfig={bandPosition:this._bandPosition},this._direction="vertical",this._sortDataByAxis=!1,this._getPositionXEncoder=()=>{var t;return null===(t=this._positionXEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionXEncoder=t=>{this._positionXEncoder=t.bind(this)},this._getPositionYEncoder=()=>{var t;return null===(t=this._positionYEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionYEncoder=t=>{this._positionYEncoder=t.bind(this)}}_buildScaleConfig(){this._scaleConfig={bandPosition:this._bandPosition}}get fieldX(){return this._fieldX}setFieldX(t){this._fieldX=Fa(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=Fa(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&Fa(t)}get fieldX2(){return this._fieldX2}setFieldX2(t){this._fieldX2=t}get fieldY2(){return this._fieldY2}setFieldY2(t){this._fieldY2=t}get direction(){return this._direction}get scaleX(){return this._scaleX}setScaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}setScaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}setScaleZ(t){this._scaleZ=t}getXAxisHelper(){return this._xAxisHelper}setXAxisHelper(t){this._xAxisHelper=t,this.onXAxisHelperUpdate()}getYAxisHelper(){return this._yAxisHelper}setYAxisHelper(t){this._yAxisHelper=t,this.onYAxisHelperUpdate()}getZAxisHelper(){return this._zAxisHelper}setZAxisHelper(t){this._zAxisHelper=t,this.onYAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}getStatisticFields(){const t=[];return[{axisHelper:this.getXAxisHelper(),fields:this._fieldX2?[...this._fieldX,this._fieldX2]:this._fieldX},{axisHelper:this.getYAxisHelper(),fields:this._fieldY2?[...this._fieldY,this._fieldY2]:this._fieldY},{axisHelper:this.getZAxisHelper(),fields:this._fieldZ}].forEach((e=>{e.axisHelper&&e.axisHelper.getScale&&e.fields&&e.fields.forEach((i=>{const s={key:i,operations:[]},n=e.axisHelper.getScale(0);Qh(n.type)?(s.operations=["max","min"],"log"===n.type&&(s.filter=t=>t>0)):s.operations=["values"],t.push(s)}))})),this.getStack()&&t.push({key:this.getStackValueField(),operations:["allValid"]}),t}getGroupFields(){return"vertical"===this.direction?this._fieldX:this._fieldY}getStackGroupFields(){return this.getGroupFields()}getStackValue(){var t,e;const i=null===(t="horizontal"===this.direction?this.getXAxisHelper():this.getYAxisHelper())||void 0===t?void 0:t.getAxisId();return null!==(e=this._spec.stackValue)&&void 0!==e?e:`${nh}_series_${this.type}_${i}`}getStackValueField(){return"horizontal"===this.direction?Fa(this._spec.xField)[0]:Fa(this._spec.yField)[0]}setValueFieldToStack(){"horizontal"===this.direction?(this.setFieldX(AT),this.setFieldX2(kT)):(this.setFieldY(AT),this.setFieldY2(kT))}setValueFieldToPercent(){"horizontal"===this.direction?(this.setFieldX(TT),this.setFieldX2(wT)):(this.setFieldY(TT),this.setFieldY2(wT))}setValueFieldToStackOffsetSilhouette(){"horizontal"===this.direction?(this.setFieldX(CT),this.setFieldX2(LT)):(this.setFieldY(CT),this.setFieldY2(LT))}onXAxisHelperUpdate(){this.onMarkPositionUpdate()}onYAxisHelperUpdate(){this.onMarkPositionUpdate()}onZAxisHelperUpdate(){this.onMarkPositionUpdate()}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setFieldX(this._spec.xField),this.setFieldY(this._spec.yField),this.setFieldZ(this._spec.zField),this._specXField=Fa(this._spec.xField),this._specYField=Fa(this._spec.yField),M(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2(null===(t=this._spec)||void 0===t?void 0:t.x2Field),this.setFieldY2(null===(e=this._spec)||void 0===e?void 0:e.y2Field),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent(),this.getStackOffsetSilhouette()&&this.setValueFieldToStackOffsetSilhouette(),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}dataToPosition(t,e){return t?e&&!this.isDatumInViewData(t)?null:{x:this.dataToPositionX(t),y:this.dataToPositionY(t)}:null}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToX=this.valueToPositionX.bind(this),this._markAttributeContext.valueToY=this.valueToPositionY.bind(this),this._markAttributeContext.xBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getXAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getYAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t,e){return{x:this.valueToPositionX(t),y:this.valueToPositionY(e)}}_axisPosition(t,e,i){return this._scaleConfig.datum=i,t.isContinuous?t.valueToPosition(e,this._scaleConfig):t.dataToPosition(Fa(e),this._scaleConfig)}valueToPositionX(t,e){return this._axisPosition(this._xAxisHelper,t,e)}valueToPositionY(t,e){return this._axisPosition(this._yAxisHelper,t,e)}_dataToPosition(t,e,i,s,n,r){const a=n();if(a)return a(t);if(!e)return r((t=>Number.NaN)),Number.NaN;const o=(e.getFields?e.getFields():i).slice(0,s);return o&&0!==o.length?(e.isContinuous?r((t=>(this._scaleConfig.datum=t,e.valueToPosition(this.getDatumPositionValue(t,o[0]),this._scaleConfig)))):r((t=>(this._scaleConfig.datum=t,e.dataToPosition(Fa(this.getDatumPositionValues(t,o)),this._scaleConfig)))),n()(t)):(r((t=>null)),null)}dataToPositionX(t){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,void 0,this._getPositionXEncoder,this._setPositionXEncoder)}dataToPositionY(t){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,void 0,this._getPositionYEncoder,this._setPositionYEncoder)}dataToPositionZ(t){if(!this._zAxisHelper)return Number.NaN;const{dataToPosition:e}=this._zAxisHelper;return e(this.getDatumPositionValues(t,this._fieldZ),{bandPosition:this._bandPosition})}dataToPositionX1(t){return this._xAxisHelper?this._fieldX2&&this._fieldX2 in t?this.valueToPositionX(this.getDatumPositionValues(t,this._fieldX2)):this.valueToPositionX(0):Number.NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):Number.NaN}positionToData(t){return t?{x:this.positionToDataX(t.x),y:this.positionToDataY(t.y)}:null}positionToDataX(t){return this._scaleX?this._scaleX.invert(t):null}positionToDataY(t){return this._scaleY?this._scaleY.invert(t):null}getRegionRectLeft(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[1]}afterInitMark(){super.afterInitMark(),this.setFieldX(this._fieldX),this.setFieldY(this._fieldY),this._buildScaleConfig()}getDimensionField(){return"horizontal"===this._direction?this._specYField:this._specXField}getDimensionContinuousField(){return"horizontal"===this._direction?[this.fieldY[0],this.fieldY2]:[this.fieldX[0],this.fieldX2]}getMeasureField(){return"horizontal"===this._direction?this._specXField:this._specYField}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(zd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e,i;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&(qC("horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,"horizontal"===this._direction?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),null===(i=this._data)||void 0===i||i.updateData(!0))}getInvalidCheckFields(){const t=[];return this._xAxisHelper&&this._xAxisHelper.isContinuous&&this._xAxisHelper.getAxisType()!==r.geoCoordinate&&(this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._specXField).forEach((e=>{t.push(e)})),this._yAxisHelper&&this._yAxisHelper.isContinuous&&this._yAxisHelper.getAxisType()!==r.geoCoordinate&&(this._yAxisHelper.getFields?this._yAxisHelper.getFields():this._specYField).forEach((e=>{t.push(e)})),t}reInit(t){this._positionXEncoder&&(this._positionXEncoder=null),this._positionYEncoder&&(this._positionYEncoder=null),super.reInit(t)}}const QC="monotone",tE="linear",eE={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}};class iE{addSamplingCompile(){if(this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}addOverlapCompile(){var t;if(this._spec.markOverlap){const e=[];e.push({type:"markoverlap",direction:"horizontal"===this._direction&&"cartesian"===this.coordinate?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),null===(t=this._symbolMark)||void 0===t||t.getProduct().transform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t,e){var i,s;return this._lineMark=this._createMark(eE.line,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:null==e||e,progressive:t,customShape:null===(i=this._spec.line)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.line)||void 0===s?void 0:s.stateSort}),this._lineMark}initLineMarkStyle(t,e){var i,s;const n=this._lineMark;if(n){if(this.setMarkStyle(n,{stroke:this.getColorAttribute()},"normal",Oy.Series),"zero"!==this._invalidType&&this.setMarkStyle(n,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Oy.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(n,"defined")})),"polar"===this.coordinate)this.setMarkStyle(n,{lineJoin:"bevel",curveType:tE,closePath:!0},"normal",Oy.Series);else{const r=null!=e?e:null===(s=null===(i=this.getSpec().line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.curveType,a=r===QC?"horizontal"===t?"monotoneY":"monotoneX":r;this.setMarkStyle(n,{curveType:a},"normal",Oy.Built_In)}this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Oy.Series)}return n}_getEventElement(t,e=!1){let i=[];return t.dimensionInfo.some((t=>(t.data.some((t=>t.series===this&&(i=t.datum,!0))),!i.length))),i}_dimensionTrigger(t){const e=this._getEventElement(t);switch(t.action){case"enter":this._symbolActiveMark.getDataView().parse(e),this._symbolActiveMark.getData().updateData(!1);break;case"leave":this._symbolActiveMark.getDataView().parse([]),this._symbolActiveMark.getData().updateData(!1)}}initSymbolMark(t,e){const i=this._spec.point||{};if(!1!==i.visible&&(this._symbolMark=this._createMark(eE.point,{morph:WC(this._spec,eE.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:t,isSeriesMark:!!e,customShape:i.customShape,stateSort:i.stateSort})),!0===this._spec.activePoint){const t=new R(this._option.dataSet,{name:`${nh}_series_${this.id}_active_point`});t.parse([]),this._symbolActiveMark=this._createMark({name:`active_point_${this.id}`,type:"symbol"},{morph:!1,groupKey:this._seriesField,isSeriesMark:!1,dataView:t,parent:this._region.getInteractionMark(),customShape:i.customShape,stateSort:i.stateSort}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){const t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){this._symbolActiveMark.setVisible(!0),this.event.on(Kh.dimensionHover,this._dimensionTrigger.bind(this));for(const e in this._symbolMark.stateStyle){this._symbolActiveMark.stateStyle[e]={};for(const i in this._symbolMark.stateStyle[e])this._symbolActiveMark.stateStyle[e][i]={style:null,level:Oy.Series,referer:t}}this._symbolActiveMark.state.changeStateInfo({stateValue:Sy.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",Oy.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Oy.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Oy.Series))}_initSymbolActiveMarkAlone(){var t,e;const i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(null===(e=null===(t=this._spec[eE.point.name])||void 0===t?void 0:t.state)||void 0===e?void 0:e.dimension_hover)&&(i.setVisible(!0),this.event.on(Kh.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,Ll({},this._spec[eE.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:Sy.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&("symbol"!==(null===(e=t.getTarget())||void 0===e?void 0:e.type)&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Oy.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getSeriesField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,s,n,r;if(!t)return;const a=this._isFieldAllValid();if("zero"===this._invalidType||a){if(!0===(null===(s=null===(i=t.stateStyle.normal)||void 0===i?void 0:i[e])||void 0===s?void 0:s.style))return;this.setMarkStyle(t,{[e]:!0},"normal",Oy.Series)}else{if(!0!==(null===(r=null===(n=t.stateStyle.normal)||void 0===n?void 0:n[e])||void 0===r?void 0:r.style))return;this.setMarkStyle(t,{[e]:this._getInvalidDefined.bind(this)},"normal",Oy.Series)}t.getProduct()&&t.compileEncode()}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.getStackValueField();return!!(t&&t.latestData&&e)&&t.latestData[e]&&t.latestData[e].allValid}}const sE=Object.assign(Object.assign({},mL),eE);class nE extends yx{setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this._getIgnoreAttributes(),r=["strokeWidth","lineWidth","lineDash","strokeDash","lineJoin","stroke","strokeOpacity","opacity","fill","fillOpacity","texture","texturePadding","textureSize","textureColor"],a=this.isUserLevel(i);let o=!1;Object.keys(t).forEach((l=>{const h=t[l];if(D(h)||n.includes(l))return;a&&r.includes(l)&&(td(null==h?void 0:h.type)||(null==h?void 0:h.scale)||xs(h))&&(o=!0);const d=this._filterAttribute(l,h,e,i,a,s);this.setAttribute(l,d,e,i,s)})),o&&this.setEnableSegments(o)}}class rE extends nE{constructor(){super(...arguments),this.type=rE.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return(null===(t=this.model)||void 0===t?void 0:t.type)===fl.radar&&"polar"===(null===(e=this.model)||void 0===e?void 0:e.coordinate)?[]:["fill","fillOpacity"]}}rE.type="line";const aE=()=>{Xl.registerMark(rE.type,rE),Mx(),dM(),FA(),jA(),fc.registerGraphic(Qd.line,QS),FC()};class oE extends yx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}}class lE extends oE{constructor(){super(...arguments),this.type=lE.type}}lE.type="symbol";const hE=()=>{Xl.registerMark(lE.type,lE),GA()},dE=(t,e,i)=>e.filter((e=>t.callback(e,i))),cE=(t,e,i)=>{const s=t.callback,n=t.as;if(!t.all)return e.forEach((t=>{const e=s(t,i);if(!D(n)){if(D(t))return;t[n]=e}return e})),e;const r=s(e,i);return D(n)||D(e)?r:(e[n]=r,e)};function uE(t){return t.reduce(((t,e)=>t+e),0)}const pE={min:Ha,max:ja,average:function(t){return 0===t.length?0:uE(t)/t.length},sum:uE};function gE(t,e,i,s){const n=Math.floor(e.length/t),r=[],a=e.length;let o,l,h,d=0,c=0;r[c++]=d;for(let t=1;to&&(o=l,h=t))}r[c++]=h,d=h}return r[c-1]!==a-1&&(r[c++]=a-1),r.map((t=>i?e[t].i:t))}function mE(t,e,i,s,n){let r=Math.floor(e.length/t);const a=[],o=e.length;let l=0,h=[];a.push(l),e[l][n]=e[l][n];for(let t=1;to-t&&(r=o-t,h.length=r),h=[];for(let i=0;ii?e[t].i:t))}function _E(t,e,i,s){return mE(t,e,i,"min",s)}function fE(t,e,i,s){return mE(t,e,i,"max",s)}function vE(t,e,i,s){return mE(t,e,i,"average",s)}function yE(t,e,i,s){return mE(t,e,i,"sum",s)}const bE=(t,e)=>{let i=t.size;const s=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),i*=s,i<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);const{mode:n,yfield:r,groupBy:a}=t,o=null!=r?r:"y";let l=gE;if("min"===n?l=_E:"max"===n?l=fE:"average"===n?l=vE:"sum"===n&&(l=yE),e.length){const t={};if(a){for(let i=0,s=e.length;i{const r=t[n];if(r.length<=i){const t=r.map((t=>t.i));s=s.concat(t)}else{const t=l(i,r,!0,o);s=s.concat(t),r.forEach((t=>e[t.i][o]=t[o]))}})),s.sort(((t,e)=>t-e)),s.map((t=>e[t]))}return l(i,e,!1,o).map((t=>e[t]))}return[]},xE=(t,e)=>{if(!e||0===e.length)return;let{radius:i}=t;D(i)&&"symbol"===e[0].mark.markType&&(i=!0);const{direction:s,delta:n,deltaMul:r=1,groupBy:a}=t,o=e=>{!function(t){t.forEach((t=>{t.getGraphicAttribute(dm)&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute(dm,!1))}))}(e);const a=t.sort?e.slice().sort(((t,e)=>t.getGraphicAttribute("x")-e.getGraphicAttribute("x"))):e;0===s?function(t,e,i,s){if(s){const s=-1/0;let n=-1/0,r=0,a=0;const o=D(e);let l=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,h=t.getGraphicAttribute("x"),d=t.getGraphicAttribute("y");o&&(l=(e+r)*i),a=(s-h)**2+(n-d)**2,a<(l+r+e)**2?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(dm,!0),t.setGraphicAttribute("visible",!1)):n=d,r=e}))}}(a,n,r,i):1===s?function(t,e,i,s){if(s){let s=-1/0,n=0;const r=D(e);let a=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("x");r&&(a=(e+n)*i),Math.abs(o-s){if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("y");r&&(a=(e+n)*i),Math.abs(o-s){const i=e.getDatum()[a];return t[i]?t[i].push(e):t[i]=[e],t}),{});Object.keys(t).forEach((e=>{o(t[e])}))}else o(e);return e},SE=()=>{fc.registerTransform("sampling",{transform:bE,markPhase:"afterEncode"},!0)},ME=()=>{fc.registerTransform("markoverlap",{transform:xE,markPhase:"afterEncode"},!0)};class kE extends XC{_transformLabelSpec(t){var e,i,s;!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}function AE(t,e,i){let s=!1;if(e&&xs(e))for(const n of t)for(const t of n.getSeries(i))if(s=!!e.call(null,t),s)return s;return s}function wE(t,e){const i=[];for(const s of t)for(const t of s.getSeries(e))i.push(t);return i}const TE=(t,e)=>{for(let i=0;i=t[0]}function CE(t,e){const i=Ya(e)-e[0],s=Ya(e)*e[0]<0;let n=e[0]<=0?0-e[0]:0,r=Ya(e)>0?Ya(e)-0:0;0===i?e[0]<0?(n=1,r=0):e[0]>0&&(n=0,r=1):(n/=i,r/=i);const a=t.getDomainSpec();return{total:i,negative:n,positive:r,includeZero:s,domain:e,extendable_min:!Zo(a.min),extendable_max:!Zo(a.max)}}function EE(t,e){const{positive:i,negative:s,extendable_min:n,extendable_max:r,domain:a}=t,{positive:o,negative:l,extendable_min:h,extendable_max:d,domain:c}=e;if(o>0){if(!h)return!1;let t=s/i;r&&(t=s/Math.max(i,o),a[1]=-a[0]/t),c[0]=-c[1]*t}else if(l>0){if(!d)return!1;let t=i/s;n&&(t=i/Math.max(s,s),a[0]=-a[1]/t),c[1]=-c[0]*t}return!0}function DE(t,e){const{extendable_min:i,extendable_max:s,domain:n}=t,{positive:r,negative:a,domain:o}=e;return!(0===r&&0===a||r>0&&!s||a>0&&!i||(n[0]=o[0],n[1]=o[1],0))}function PE(t,e){const{positive:i,negative:s,extendable_max:n,domain:r}=t,{positive:a,negative:o,extendable_min:l,domain:h}=e;if(n&&l){const t=Math.max(s,o)/Math.max(i,a);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(l){const t=s/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=o/a;r[1]=-r[0]/t}}return!0}function OE(t,e){const{extendable_min:i,domain:s}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(s[0]=-s[1],r[1]=-r[0],0))}const RE=t=>t.map(((t,e)=>({index:e,value:t}))),BE=(t,e,i=0)=>{const s=new qt(t).expand(i/2),n=new qt(e).expand(i/2);return s.intersects(n)},IE=(t,e,i,s)=>it?Math.min(t-e/2,i-e):i{var s;const{labelStyle:n,axisOrientType:r,labelFlush:a,labelFormatter:o,startAngle:l=0}=i;let h=null!==(s=n.angle)&&void 0!==s?s:0;"vertical"===n.direction&&(h+=At(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,p=0;d||(c?(u=0,p=1):l&&(u=Math.cos(l),p=-Math.sin(l)));const g=Qk(n),m=t.range(),_=e.map(((i,s)=>{var r,l;const _=o?o(i):`${i}`,{width:f,height:v}=g.quickMeasure(_),y=Math.max(f,12),b=Math.max(v,12),x=t.scale(i),S=u*x,M=p*x;let k,A,w=S,T=M;a&&d&&0===s?w=IE(S,y,m[0],m[m.length-1]):a&&d&&s===e.length-1?w=IE(S,y,m[m.length-1],m[0]):k=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===k?w-=y:"center"===k&&(w-=y/2),a&&c&&0===s?T=IE(M,b,m[0],m[m.length-1]):a&&c&&s===e.length-1?T=IE(M,b,m[m.length-1],m[0]):A=null!==(l=n.textBaseline)&&void 0!==l?l:"middle","bottom"===A?T-=b:"middle"===A&&(T-=b/2);const L=(new qt).set(w,T,w+y,T+b);return h&&L.rotate(h,S,M),L}));return _},YE=(t,e)=>{var i,s,n,r,a;if(!t)return t;const o=null===(i=null==e?void 0:e.targetAxis)||void 0===i?void 0:i.call(e);if(!o)return t;const l=null===(s=null==e?void 0:e.currentAxis)||void 0===s?void 0:s.call(e);if(!l)return t;const h=null===(n=l.getTickData())||void 0===n?void 0:n.getDataView();if(!h)return t;if(!h.transformsArr.find((t=>t.type.includes("ticks"))))return t;const d=l.getScale();if(!d)return t;const c=null===(a=null===(r=o.getTickData())||void 0===r?void 0:r.getDataView())||void 0===a?void 0:a.latestData;if(!(null==c?void 0:c.length))return t;const u=o.getScale();if(!u)return t;const p=u.domain(),g=Ya(p)-p[0];if(0===g)return t;const m=d.domain(),_=Ya(m)-m[0];if(0===g)return t;const f=c.map((t=>{const e=(t.value-p[0])/g;return _*e+m[0]}));return RE(f)};class jE{constructor(t){this.id=qo(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}release(){this.service=null}}class HE extends jE{constructor(){super(HE.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!Qh(t.getScale().type))return!1;const e=t.getSpec().sync;return!!(null==e?void 0:e.axisId)&&e}_getTargetAxis(t,e){const i=t.getOption().getChart().getComponentByUserId(e.axisId);return(null==i?void 0:i.type.startsWith("cartesianAxis"))?i:null}onInit(t,e){const i=this._checkEnableSync(e);if(!i)return;if(!i.zeroAlign)return;const s=this._getTargetAxis(e,i);s&&e.event.on(zd.scaleDomainUpdate,{filter:({model:t})=>t.id===e.id||t.id===s.id},(()=>{((t,e)=>{var i,s,n,r,a,o;const l=t.getScale(),h=e.getScale();if(!l||!h)return;const d=null!==(n=null===(s=(i=t).getDomainAfterSpec)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[0,1],c=null!==(o=null===(a=(r=e).getDomainAfterSpec)||void 0===a?void 0:a.call(r))&&void 0!==o?o:[0,1];if(!(d&&c&&LE(d)&&LE(c)))return;const u=CE(t,d),p=CE(e,c),{positive:g,negative:m,extendable_min:_,extendable_max:f,includeZero:v}=u,{positive:y,negative:b,extendable_min:x,extendable_max:S,includeZero:M}=p;if(0===g&&0===m){if(!DE(u,p))return}else if(0===y&&0===b){if(!DE(p,u))return}else if(v||M)if(v&&!M){if(!EE(u,p))return}else if(M&&!v){if(!EE(p,u))return}else{if(m===b)return;if(m>b){if(!PE(u,p))return}else if(!PE(p,u))return}else{if(0===m&&0===y){if(!OE(u,p))return}else if(0===b&&0===g&&!OE(p,u))return;if(0===m&&0===b)if(0===d[0]&&c[0]>0){if(!x)return;c[0]=0}else{if(!(0===c[0]&&d[0]>0))return;if(!_)return;d[0]=0}if(0===g&&0===y)if(0===d[1]&&c[1]>0){if(!S)return;c[1]=0}else{if(!(0===c[1]&&d[1]>0))return;if(!f)return;d[1]=0}}l.domain(d),h.domain(c)})(s,e)}))}onDidCompile(t,e){const i=this._checkEnableSync(e);if(!i)return;const s=this._getTargetAxis(e,i);if(s&&i.tickAlign){Cp(e.getOption().dataSet,"tickAlign",YE);const t={targetAxis:()=>s,currentAxis:()=>e};e.addTransformToTickData({type:"tickAlign",options:t,level:Number.MAX_SAFE_INTEGER},!1)}}}function zE(t={}){const e=Object.assign({},t);if(xs(t.style)?e.style=(e,i,s,n)=>WE(t.style(e,i,s,n)):jm(t.style)||(e.style=WE(t.style)),!jm(t.state)){const i={};Object.keys(t.state).forEach((e=>{xs(t.state[e])?i[e]=(i,s,n,r)=>WE(t.state[e](i,s,n,r)):jm(t.state[e])||(i[e]=WE(t.state[e]))})),e.state=i}return e}function NE(t){if(jm(t))return null;const e={};return Object.keys(t).forEach((i=>{xs(t[i])?e[i]=(e,s,n,r)=>WE(t[i](e,s,n,r)):jm(t[i])||(e[i]=WE(t[i]))})),e}function VE(t,e){if(jm(t))return null;const i={};return Object.keys(t).forEach((s=>{xs(t[s])?i[s]=t[s](e):i[s]=t[s]})),WE(i)}function WE(t){return(null==t?void 0:t.angle)&&(t.angle=At(t.angle)),t}HE.pluginType="component",HE.type="AxisSyncPlugin";const GE={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function UE(t){let e=0;return $d(t,"tick.visible")&&(e+=$d(t,"tick.tickSize")),$d(t,"label.visible")&&(e+=$d(t,"label.space")),e}function $E(t,e){var i,s,n,r,a,o;return{min:null!==(n=null!==(i=t.min)&&void 0!==i?i:null===(s=t.range)||void 0===s?void 0:s.min)&&void 0!==n?n:null==e?void 0:e.min,max:null!==(o=null!==(r=t.max)&&void 0!==r?r:null===(a=t.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null==e?void 0:e.max}}function XE(t){const e=null==t?void 0:t.orient;return"top"===e||"bottom"===e||"left"===e||"right"===e||"z"===e}const KE=(t,e,i)=>{var s;const n=null!==(s="band"===e?$T("axisBand",i):["linear","log","symlog"].includes(e)?$T("axisLinear",i):{})&&void 0!==s?s:{},r=Ad(t)?$T("axisX",i):wd(t)?$T("axisY",i):$T("axisZ",i);return Ll({},$T("axis",i),n,r)},qE=(t,e,i)=>{var s;const n=null!==(s="band"===e?$T("axisBand",i):"linear"===e?$T("axisLinear",i):{})&&void 0!==s?s:{},r=$T("angle"===t?"axisAngle":"axisRadius",i);return Ll({},$T("axis",i),n,r)},ZE=t=>"band"===t||"ordinal"===t||"point"===t;function JE(t,e){return{id:t,label:t,value:e,rawValue:t}}function QE(t,e,i){return i||!t||t.getAxisId()===e.getAxisId()}class tD extends Zw{constructor(t){super(),this.component=t}releaseAll(){super.releaseAll(),this.component=null}}function eD(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:d=0,dy:c=0}=t.attribute;let u=0,p=0;an&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+d),p&&t.setAttribute("dy",p+c)}function iD(t,e,i,s){for(let n=0,r=t.length;n=e)return r}}return null}const sD=(t,e)=>{var i;const s=Ll({},e,e[Cd(null!==(i=t.orient)&&void 0!==i?i:e.orient)]);return delete s.horizontal,delete s.vertical,s};class nD extends Hy{getTheme(t,e){return function(t,e,i,s){switch(t){case r.cartesianBandAxis:return KE(Ld(i,["z"]),"band",e);case r.cartesianLinearAxis:return KE(Ld(i,["z"]),"linear",e);case r.cartesianLogAxis:return KE(Ld(i,["z"]),"log",e);case r.cartesianSymlogAxis:return KE(Ld(i,["z"]),"symlog",e);case r.cartesianAxis:case r.cartesianTimeAxis:return KE(Ld(i),void 0,e);case r.polarBandAxis:return qE(i.orient,"band",e);case r.polarLinearAxis:return qE(i.orient,"linear",e);case r.polarAxis:return qE(i.orient,void 0,e);case r.cartesianCrosshair:return((t,e)=>{var i,s;const n=Fa(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,xField:l,yField:h}=null!==(s=$T(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>Ad(t.orient)));let c;c=M(d)?Ll({},ZE(d.type)?a:o,l):l;const u=n.find((t=>wd(t.orient)));let p;return p=M(u)?Ll({},ed(u.type)?a:o,h):h,{xField:c,yField:p}})(e,s);case r.polarCrosshair:return((t,e)=>{var i,s;const n=Fa(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,categoryField:l,valueField:h}=null!==(s=$T(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>"angle"===t.orient));let c;c=M(d)?Ll({},ZE(d.type)?a:o,l):l;const u=n.find((t=>"radius"===t.orient));let p;return p=M(u)?Ll({},ed(u.type)?a:o,h):h,{categoryField:c,valueField:p}})(e,s);case r.colorLegend:case r.sizeLegend:case r.discreteLegend:case r.dataZoom:case r.scrollBar:return sD(i,$T(t,e));default:return $T(t,e)}}(this.type,this._option.getTheme(),t,e)}_mergeThemeToSpec(t,e){const{spec:i,theme:s}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:s}}_adjustPadding(t){const{padding:e,noOuterPadding:i=!0,orient:s}=t;i&&e&&s&&(t.padding=Object.assign(Object.assign({},nl(e)),{[s]:0}))}}class rD extends Wy{static createComponent(t,e){const{spec:i}=t,s=function(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{var r,a;e instanceof ks||this.event.emit(i,{model:this,node:t,event:e,item:s,datum:n,source:Nd.chart,chart:null===(a=null===(r=this._option)||void 0===r?void 0:r.globalInstance)||void 0===a?void 0:a.getChart()},"model")},this._option.animation&&(this.animate=new jy({getCompiler:e.getCompiler}))}initLayout(){var t;super.initLayout(),this._regions=null!==(t=this._regions)&&void 0!==t?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map((t=>null==t?void 0:t.id)))}changeRegions(t){throw new Error("Method not implemented.")}_getNeedClearVRenderComponents(){throw new Error("Method not implemented.")}onRender(t){throw new Error("Method not implemented.")}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEach((e=>t(e)))}getContainer(){var t;return this._container||(this._container=null===(t=this._option)||void 0===t?void 0:t.globalInstance.getStage().find((t=>"root"===t.name),!0)),this._container}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some((i=>!Im(null==e?void 0:e[i],t[i])))),(null==e?void 0:e.visible)!==t.visible&&(i.reCompile=!0),i}release(){var t;super.release(),this.clear(),null===(t=this.pluginService)||void 0===t||t.releaseAll(),this.pluginService=null}clear(){var t;const e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach((t=>{var e;t&&(null===(e=this.getContainer())||void 0===e||e.removeChild(t),t=null)})),this._container=null,null===(t=this.pluginService)||void 0===t||t.clearAll()}compile(){this.compileMarks(),this.reAppendComponents()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t,context:{model:this}})}))}reAppendComponents(){const t=this._getNeedClearVRenderComponents();t&&t.length&&t.forEach((t=>{var e;t&&!t.stage&&(null===(e=this.getContainer())||void 0===e||e.appendChild(t))}))}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}}function aD(t,e){if(!t||!w(t))return t;const i={};return Object.keys(t).forEach((s=>{const n=t[s];let r=!1;e.forEach((t=>{(S(t)&&t===s||t instanceof RegExp&&s.match(t))&&(r=!0)})),r||(i[s]=n)})),i}rD.transformerConstructor=nD;class oD extends yx{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(Qd.component,null!=t?t:e.rootMark,{componentType:this._componentType,mode:this._mode}).id(i),this._compiledProductId=i}}oD.type="component";const lD=()=>{Xl.registerMark(oD.type,oD)};class hD extends Cs{constructor(){super(...arguments),this.mode=ce.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._newElementAttrMap={},Nk(t,(t=>{var i,s,n,r,a,o;if("group"!==t.type&&t.id){const l=e[t.id];if(l){if(!Im(t.attribute,l.attribute)){const e=k(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},e),{opacity:null!==(i=e.opacity)&&void 0!==i?i:1,fillOpacity:null!==(s=e.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(n=e.strokeOpacity)&&void 0!==n?n:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(r=t.attribute.opacity)&&void 0!==r?r:1,fillOpacity:null!==(a=t.attribute.fillOpacity)&&void 0!==a?a:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;this._newElementAttrMap&&Object.keys(this._newElementAttrMap).forEach((i=>{var s;const{node:n,attrs:r,state:a}=this._newElementAttrMap[i];if("enter"===a){const{enter:i={}}=null!==(s=this.params)&&void 0!==s?s:{};t=Zo(i.duration)?i.duration:t,e=i.easing?i.easing:e}"path"===n.type?n.animate({interpolate:(t,e,i,s,n)=>"path"===t&&(n.path=function(t,e){let i,s,n,r=Gb.lastIndex=Ub.lastIndex=0,a=-1;const o=[],l=[];for(t+="",e+="";(i=Gb.exec(t))&&(s=Ub.exec(e));)(n=s.index)>r&&(n=e.slice(r,n),o[a]?o[a]+=n:o[++a]=n),(i=i[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:Vb(i,s)})),r=Ub.lastIndex;return rt;class pD extends rD{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(t=0){return this._tickData[t]}get visible(){return this._visible}getInverse(){return this._inverse}getCoordinateType(){return this._coordinateType}constructor(t,e){var i;super(t,e),this.specKey="axes",this._scales=[],this._tickData=[],this._visible=!0,this._tick=void 0,this._visible=null===(i=t.visible)||void 0===i||i,this._coordinateType="none"}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){var t,e,i,s;return[null===(e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct())||void 0===e?void 0:e.getGroupGraphicItem(),null===(s=null===(i=this._gridMark)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.getGroupGraphicItem()].filter(M)}created(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this._shouldComputeTickData()&&this._initData(),this._visible){const f=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:"angle"===this.getOrient()?"circleAxis":"axis",mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});if(this._axisMark=f,f.setZIndex(this.layoutZIndex),M(this._spec.id)&&f.setUserId(this._spec.id),this._marks.addMark(f),null===(t=this._spec.grid)||void 0===t?void 0:t.visible){const t=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:"angle"===this.getOrient()?sc.circleAxisGrid:sc.lineAxisGrid,mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});t.setZIndex(null!==(r=null!==(s=null===(i=null===(e=this._spec.grid)||void 0===e?void 0:e.style)||void 0===i?void 0:i.zIndex)&&void 0!==s?s:null===(n=this._spec.grid)||void 0===n?void 0:n.zIndex)&&void 0!==r?r:Dy.Axis_Grid),t.setInteractive(!1),this._marks.addMark(t),this._gridMark=t}if(v(this._spec.interactive)&&this._marks.forEach((t=>t.setInteractive(this._spec.interactive))),!1!==this._option.animation&&!1!==$d(this._option.getChart().getSpec(),"animation")&&!0===this._spec.animation){const t=HC(null===(a=Xl.getAnimationInKey("axis"))||void 0===a?void 0:a(),{appear:null!==(l=null!==(o=this._spec.animationAppear)&&void 0!==o?o:$d(this._option.getChart().getSpec(),"animationAppear.axis"))&&void 0!==l?l:$d(this._option.getChart().getSpec(),"animationAppear"),disappear:null!==(d=null!==(h=this._spec.animationDisappear)&&void 0!==h?h:$d(this._option.getChart().getSpec(),"animationDisappear.axis"))&&void 0!==d?d:$d(this._option.getChart().getSpec(),"animationDisappear"),enter:null!==(u=null!==(c=this._spec.animationEnter)&&void 0!==c?c:$d(this._option.getChart().getSpec(),"animationEnter.axis"))&&void 0!==u?u:$d(this._option.getChart().getSpec(),"animationEnter"),exit:null!==(g=null!==(p=this._spec.animationExit)&&void 0!==p?p:$d(this._option.getChart().getSpec(),"animationExit.axis"))&&void 0!==g?g:$d(this._option.getChart().getSpec(),"animationExit"),update:null!==(_=null!==(m=this._spec.animationUpdate)&&void 0!==m?m:$d(this._option.getChart().getSpec(),"animationUpdate.axis"))&&void 0!==_?_:$d(this._option.getChart().getSpec(),"animationUpdate")});t.enter&&(t.update[0].customParameters={enter:t.enter[0]}),this._marks.forEach((e=>e.setAnimationConfig(t)))}}}_shouldComputeTickData(){return this.getVisible()||this._spec.forceInitTick}_initData(){const t=this._initTickDataSet(this._tickTransformOption());t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=[new gx(this._option,t)]}collectData(t,e){const i=[];return AE(this._regions,(s=>{var n;let a=this.collectSeriesField(t,s);if(a=y(a)?Qh(this._scale.type)?a:[a[0]]:[a],t||(this._dataFieldText=s.getFieldAlias(a[0])),a){const t=s.getViewData();if(e)a.forEach((t=>{i.push(s.getRawDataStatisticsByField(t,!1))}));else if(t&&t.latestData&&t.latestData.length){const e=null===(n=s.getViewDataStatistics)||void 0===n?void 0:n.call(s),o=this.type===r.cartesianLinearAxis&&this._spec.breaks&&this._spec.breaks.length;a.forEach((s=>{var n;(null===(n=null==e?void 0:e.latestData)||void 0===n?void 0:n[s])&&(o?i.push(Object.assign(Object.assign({},e.latestData[s]),{values:t.latestData.map((t=>t[s]))})):i.push(e.latestData[s]))}))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}isSeriesDataEnable(){let t=!0;return AE(this._regions,(e=>{var i;y(null===(i=e.getViewDataStatistics())||void 0===i?void 0:i.latestData)&&(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){const{seriesId:t,seriesIndex:e,regionId:i,regionIndex:s}=this._spec;M(t)&&(this._seriesUserId=Fa(t)),M(i)&&(this._regionUserId=Fa(i)),M(e)&&(this._seriesIndex=Fa(e)),M(s)&&(this._regionIndex=Fa(s)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionIndex),this.layout.layoutBindRegionID=this._regions.map((t=>t.id))}getBindSeriesFilter(){return{userId:this._seriesUserId,specIndex:this._seriesIndex}}initEvent(){this.event.on(zd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const t=wE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}).map((t=>t.getViewDataStatistics())).filter((t=>!!t));t.length>1?this._option.dataSet.multipleDataViewAddListener(t,"change",(()=>{this.updateScaleDomain()})):1===t.length&&t[0].target.addListener("change",(()=>{this.updateScaleDomain()})),AE(this._regions,(t=>{t.event.on(zd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._clearRawDomain()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_clearRawDomain(){}onLayoutEnd(t){this.updateScaleRange(),this.event.emit(zd.scaleUpdate,{model:this,value:"range"}),super.onLayoutEnd(t)}computeData(t){!this._tickData||!this._tickData.length||"force"!==t&&Im(this._scale.range(),[0,1])||this._tickData.forEach((t=>{t.getDataView().reRunAllTransform(),t.updateData()}))}initScales(){this._scales=[this._scale];const t=[];if(AE(this._regions,(e=>{const i=e.getGroups();i&&t.push(i)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),0!==t.length){const e=ja(t.map((t=>t.fields.length)));for(let t=1;t{var s,n;return(null===(s=null==e?void 0:e[i])||void 0===s?void 0:s.visible)!==(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.visible)})),i))}_getAxisAttributes(){const t=this._spec,e={orient:this.getOrient(),select:!0!==this._option.disableTriggerEvent&&t.select,hover:!0!==this._option.disableTriggerEvent&&t.hover};if(t.domainLine&&t.domainLine.visible?e.line=((i=zE(i=t.domainLine)).startSymbol=zE(i.startSymbol),i.endSymbol=zE(i.endSymbol),i):e.line={visible:!1},t.label&&t.label.visible){const i=aD(t.label,["style","formatMethod","state"]);e.label=i,t.label.style&&(e.label.style=xs(t.label.style)?(e,i,s,n)=>{var r;const a=t.label.style(e.rawValue,i,e,s,n);return WE(Ll({},null===(r=this._theme.label)||void 0===r?void 0:r.style,a))}:WE(t.label.style)),(t.label.formatMethod||t.label.formatter)&&(e.label.formatMethod=this._getLabelFormatMethod()),t.label.state&&(e.label.state=function(t){if(jm(t))return null;const e={};return Object.keys(t).forEach((i=>{xs(t[i])?e[i]=(e,s,n,r)=>WE(t[i](e.rawValue,s,e,n,r)):jm(t[i])||(e[i]=WE(t[i]))})),e}(t.label.state))}else e.label={visible:!1};var i;if(t.tick&&t.tick.visible?(e.tick={visible:t.tick.visible,length:t.tick.tickSize,inside:t.tick.inside,alignWithLabel:t.tick.alignWithLabel,dataFilter:t.tick.dataFilter},t.tick.style&&(e.tick.style=xs(t.tick.style)?(e,i,s,n)=>{var r;const a=t.tick.style(e,i,s,n);return WE(Ll({},null===(r=this._theme.tick)||void 0===r?void 0:r.style,a))}:WE(t.tick.style)),t.tick.state&&(e.tick.state=NE(t.tick.state))):e.tick={visible:!1},t.subTick&&t.subTick.visible?(e.subTick={visible:t.subTick.visible,length:t.subTick.tickSize,inside:t.subTick.inside,count:t.subTick.tickCount},t.subTick.style&&(e.subTick.style=xs(t.subTick.style)?(e,i,s,n)=>{var r;const a=t.subTick.style(e,i,s,n);return WE(Ll({},null===(r=this._theme.subTick)||void 0===r?void 0:r.style,a))}:WE(t.subTick.style)),t.subTick.state&&(e.subTick.state=NE(t.subTick.state))):e.subTick={visible:!1},t.title&&t.title.visible){const i=t.title,{autoRotate:s,angle:n,style:r={},background:a,state:o,shape:l}=i,h=function(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(e,i)=>{var s,n;const r=t.grid.style(null===(s=e.datum)||void 0===s?void 0:s.rawValue,i,e.datum);return WE(Ll({},null===(n=this._theme.grid)||void 0===n?void 0:n.style,r))}:WE(t.grid.style),subGrid:!1===t.subGrid.visible?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:t.subGrid.alternateColor,style:WE(t.subGrid.style)}}}_getLabelFormatMethod(){const{formatMethod:t,formatter:e}=this._spec.label,{formatFunc:i}=XT(t,e);return i?(t,s,n)=>i(s.rawValue,s,e):null}_initTickDataSet(t,e=0){Ep(this._option.dataSet,"scale",uD);const i=this.registerTicksTransform();return new R(this._option.dataSet,{name:`${this.type}_${this.id}_ticks_${e}`}).parse(this._scales[e],{type:"scale"}).transform({type:i,options:t},!1)}_tickTransformOption(){const t=this._tick||{},e=this._spec.label||{},{tickCount:i,forceTickCount:s,tickStep:n,tickMode:r}=t,{style:a,formatMethod:o,minGap:l}=e;return{sampling:!1!==this._spec.sampling,tickCount:i,forceTickCount:s,tickStep:n,tickMode:r,axisOrientType:this._orient,coordinateType:this._coordinateType,labelStyle:a,labelFormatter:o,labelGap:l}}addTransformToTickData(t,e){this._tickData.forEach((i=>{var s;null===(s=null==i?void 0:i.getDataView())||void 0===s||s.transform(t,e)}))}dataToPosition(t){return this._scale.scale(t)}}pD.specKey="axes";const gD=()=>{lD(),Xl.registerAnimation("axis",(()=>({appear:{custom:dD},update:{custom:hD},exit:{custom:cD}})))};var mD=function(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{this.computeData(null==t?void 0:t.value),AE(this._regions,(t=>{const e=this.getOrient();Ad(e)?QE(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):wd(e)?QE(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper()):Td(e)&&QE(t.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setZAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{let{x:e,y:i}=t;return Zo(e)&&(e+=Number("left"===this._orient)*this.getLayoutRect().width),Zo(i)&&(i+=Number("top"===this._orient)*this.getLayoutRect().height),{x:e,y:i}},this._transformLayoutRect=t=>{if(!this._visible)return t;const e=this._latestBounds.clone().translate(-this.getLayoutStartPoint().x,-this.getLayoutStartPoint().y);switch(this._layout.layoutOrient){case"left":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x1<0?-e.x1:0);break;case"right":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x2>0?e.x2:0);break;case"top":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y1<0?-e.y1:0);break;case"bottom":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y2>0?e.y2:0)}return t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),this._layout.setRectInSpec(this._layoutCacheProcessing(t))},this._updateAxisLayout=()=>{const t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,s=mD(e,["grid"]),n=this._axisMark.getProduct(),r=Ll({x:t.x,y:t.y},this._axisStyle,s);n.encode(r),this._gridMark&&this._gridMark.getProduct().encode(Ll({x:t.x,y:t.y},this._getGridAttributes(),i))},this._fixAxisOnZero=()=>{const{onZero:t,visible:e}=this._spec.domainLine;if(this.visible&&t&&!1!==e){const{onZeroAxisId:t,onZeroAxisIndex:e}=this._spec.domainLine,i=this._option.getComponentsByKey("axes"),s=Ad(this.getOrient()),n=t=>{var e;return(s?!Ad(t.getOrient()):Ad(t.getOrient()))&&Qh(t.getScale().type)&&(t.getTickData()?null===(e=t.getTickData().getLatestData())||void 0===e?void 0:e.find((t=>0===t.value)):t.getScale().domain()[0]<=0&&Ya(t.getScale().domain())>=0)},r=i.filter((t=>n(t)));if(r.length){let a;if(M(t))a=r.find((e=>e.id===t));else if(M(e)){const t=i[e];n(t)&&(a=t)}else a=r[0];if(a){const t=this._axisMark.getProduct(),e=a.valueToPosition(0);s?t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dy:"bottom"===this._orient?-((a.getInverse()?a.getScale().range()[1]:a.getScale().range()[0])-e):e})}):t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dx:"left"===this._orient?e:-((a.getInverse()?a.getScale().range()[0]:a.getScale().range()[1])-e)})})}}}},this._orient=Ld(t,["z"]),Td(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet,this._coordinateType="cartesian"}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;const i="horizontal"===t.direction;if(!y(e)){if(!XE(e))return null;const{axisType:t,componentName:s}=Ed(e,i);return e.type=t,[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:s}]}let s=!0;if(e.filter((t=>"z"===t.orient))[0]){const t=e.filter((t=>"bottom"===t.orient))[0],i=e.filter((t=>wd(t.orient)))[0];s=3===e.length&&t&&i}let n=e.map(((t,e)=>({spec:t,index:e})));s||(n=n.filter((({spec:t})=>"z"!==t.orient)));const r=[];return n.forEach((({spec:t,index:e})=>{if(!XE(t))return;const{axisType:s,componentName:n}=Ed(t,i);t.type=s,r.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:n})})),r}static createComponent(t,e){const{spec:i}=t,s=mD(t,["spec"]),n=Xl.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}initLayout(){super.initLayout(),this._layout.autoIndent=!1!==this._spec.autoIndent,this._layout.layoutOrient=this._orient}setLayout3dBox(t){this.layout3dBox=t}getNewScaleRange(){const{width:t,height:e}=this.getLayoutRect(),{left:i,right:s,top:n,bottom:r}=this._innerOffset;let a=[];return Ad(this.getOrient())?Zo(t)&&(a=this._inverse?[t-s,i]:[i,t-s]):Td(this.getOrient())?Zo(t)&&(a=this._inverse?[t-s,i]:[i,t-s],this._scale.range(a)):Zo(e)&&(a=this._inverse?[n,e-r]:[e-r,n]),a}updateScaleRange(){let t=!1;const e=this.getNewScaleRange(),i=this._scale.range();return e.length===i.length&&e.every(((t,e)=>t===i[e]))?t=!1:(t=!0,this._scale.range(e)),t}init(t){var e;super.init(t),null===(e=this.pluginService)||void 0===e||e.load(_D.map((t=>new t))),this.callPlugin((t=>{this.pluginService&&t.onInit&&t.onInit(this.pluginService,this)}))}setAttrFromSpec(){var t;if(super.setAttrFromSpec(),this.visible){Ad(this.getOrient())?ug(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):ug(this._spec.maxWidth)&&(this._spec.maxWidth="30%");const t=this._getAxisAttributes();t.label.formatMethod=this._getLabelFormatMethod(),t.verticalFactor="top"===this.getOrient()||"right"===this.getOrient()?-1:1,this._axisStyle=t}this._tick=this._spec.tick;const e=null===(t=this._option.getChart())||void 0===t?void 0:t.getSpec();this._inverse=function(t,e){let i=t.inverse;return e&&!Ad(t.orient)&&(i=!M(t.inverse)||!t.inverse),i}(this._spec,"horizontal"===(null==e?void 0:e.direction))}onLayoutStart(t,e,i){if(super.onLayoutStart(t,e,i),!Td(this.getOrient())&&this._spec.innerOffset){const t=this._spec;wd(this.getOrient())?["top","bottom"].forEach((i=>{this._innerOffset[i]=il(t.innerOffset[i],e.height,e)})):["left","right"].forEach((i=>{this._innerOffset[i]=il(t.innerOffset[i],e.width,e)}))}}getSeriesStatisticsField(t){let e;return e=Ad(this.getOrient())?t.fieldX:Td(this.getOrient())?t.fieldZ:t.fieldY,Qh(this._scale.type)?e:[e[0]]}_tickTransformOption(){var t,e,i,s;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimals:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,labelLastVisible:null===(e=this._spec.label)||void 0===e?void 0:e.lastVisible,labelFirstVisible:null===(i=this._spec.label)||void 0===i?void 0:i.firstVisible,labelFlush:null===(s=this._spec.label)||void 0===s?void 0:s.flush})}axisHelper(){return{isContinuous:Qh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),getScale:(t=0)=>this._scales[t],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!0===this._inverse,getSpec:()=>this._spec}}afterCompile(){var t;const e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct();e&&e.addEventListener(hc.AFTER_ELEMENT_ENCODE,(()=>{if(!1===this._isLayout&&(Ad(this.getOrient())?this.callPlugin((t=>{this.pluginService&&t.onDidLayoutHorizontal&&t.onDidLayoutHorizontal(this.pluginService,this)})):this.callPlugin((t=>{this.pluginService&&t.onDidLayoutVertical&&t.onDidLayoutVertical(this.pluginService,this)})),this._unitText)){const{x:t,y:e}=this.getLayoutStartPoint(),i=Ad(this._orient)?{x:ja(this._scale.range())+t,y:e}:{x:t,y:Ha(this._scale.range())+e};this._unitText.setAttributes(i)}})),this.callPlugin((t=>{this.pluginService&&t.onDidCompile&&t.onDidCompile(this.pluginService,this)}))}onRender(t){}changeRegions(t){}update(t){}resize(t){}collectScale(){const t=[];return AE(this._regions,(e=>{t.push("left"===this.getOrient()||"right"===this.getOrient()?e.scaleY:e.scaleX)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:Ad(this.getOrient())?e.getSpec().x2Field?[...e.fieldX,e.fieldX2]:e.fieldX:Td(this.getOrient())?e.fieldZ:e.getSpec().y2Field?[...e.fieldY,e.fieldY2]:e.fieldY,n}updateSeriesScale(){const t=this.getOrient();AE(this._regions,(e=>{Ad(t)?QE(e.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):wd(t)?QE(e.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):Td(t)&&QE(e.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleZ(this._scale),e.setZAxisHelper(this.axisHelper()))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getBoundsInRect(t){var e;let i={x1:0,y1:0,x2:0,y2:0};if(!this._visible)return i;this._verticalLimitSize=Ad(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&y(null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData())||this.computeData("range");const s={skipLayout:!1},n=Ad(this.getOrient());this.pluginService&&(n?this.callPlugin((t=>{t.onWillLayoutHorizontal&&t.onWillLayoutHorizontal(this.pluginService,s,this)})):this.callPlugin((t=>{t.onWillLayoutVertical&&t.onWillLayoutVertical(this.pluginService,s,this)})));const r=this._axisMark.getProduct();let a=!1;if(!s.skipLayout){const t=this._getUpdateAttribute(!0),e=r.getGroupGraphicItem(),s=Ll(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,t,{line:{visible:!1}});let o=e.getBoundsWithoutRender(s);o.empty()&&(o=(new Kt).set(s.x,s.y,s.x,s.y)),a=!0,this._latestBounds=o,i=this._appendAxisUnit(o,n)}return a||(this._latestBounds=r.getBounds()),i}positionToData(t,e){const i=Ad(this.getOrient());e&&(t-=i?this.getLayoutStartPoint().x:this.getLayoutStartPoint().y),this._innerOffset&&(t=i?Rs(t,this._innerOffset.left,this.getLayoutRect().width-this._innerOffset.right):Rs(t,this._innerOffset.top,this.getLayoutRect().height-this._innerOffset.bottom));const s=this._scale.range();return(t-s[0])*(t-Ya(s))>0?null:this._scale.invert(t)}_getTitleLimit(t){var e,i,s,n,r;if(this._spec.title.visible&&D(null===(e=this._spec.title.style)||void 0===e?void 0:e.maxLineWidth)){const e=null!==(r=null!==(s=null===(i=this._axisStyle.title)||void 0===i?void 0:i.angle)&&void 0!==s?s:null===(n=this._spec.title.style)||void 0===n?void 0:n.angle)&&void 0!==r?r:0;if(t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(e));return i<1e-6?1/0:t/i}const a=this.getLayoutRect().height,o=Math.abs(Math.sin(e));return o<1e-6?1/0:a/o}return null}_getUpdateAttribute(t){var e;let i=0,s=0;if(!t){const t=this.getRegions();let{x:e,y:n}=t[0].getLayoutStartPoint(),r=e+t[0].getLayoutRect().width,a=n+t[0].getLayoutRect().height;for(let i=1;i{const i=this._getNormalizedValue([e.value],t);return JE(e.value,i)})).filter((t=>{const{value:e,rawValue:i}=t,s=this._scale.domain();return"log"===this.getSpec().type?e>=0&&e<=1:Qh(this._scale.type)?i>=s[0]&&i<=Ya(s):s.includes(i)}))]:[]}initEvent(){super.initEvent(),this.visible&&(this.event.on(zd.layoutEnd,this._updateAxisLayout),this.event.on(zd.layoutEnd,this._fixAxisOnZero),this.event.on(zd.layoutRectUpdate,(()=>{this._clearLayoutCache()})))}_getNormalizedValue(t,e){return 0===e?0:this.dataToPosition(t)/e}_layoutCacheProcessing(t){return["width","height"].forEach((e=>{t[e]{this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]})):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach((t=>{this.layout.getLastComputeOutBounds()[t]t.x2?h.x2-t.x2:0,t.y2+=h.y2>t.y2?h.y2-t.y2:0):(t.x1+=h.x1{const i=t.getOrient();return("left"===i||"right"===i)&&t.getRegions().some((t=>e.includes(t)))}));let s=0,n=0;const r=this.getLayoutStartPoint().x,a=r+this.getLayoutRect().width;return i.forEach((t=>{const e=t.getLayoutStartPoint().x;if("left"===t.getOrient()&&e===r){const e=t.getLayoutRect().width;s=Math.max(s,e)}else if(e===a){const e=t.getLayoutRect().width;n=Math.max(n,e)}})),{left:s,right:n}}}}fD.type=r.cartesianAxis,fD.specKey="axes";class vD{constructor(){this._rawDomainIndex=[]}_initData(){var t;if(this._spec.showAllGroupLayers&&this._scales.length>1)for(let e=0;e{i>0&&(e.range([0,t.bandwidth()]),t=e)}))}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const s=Math.min(t.length,this._scales.length);for(let i=0;ithis._rawDomainIndex[t][e]-this._rawDomainIndex[t][i])))}this.transformScaleDomain(),this.event.emit(zd.scaleDomainUpdate,{model:this}),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}getLabelItems(t){const e=[];let i=[];return this._scales.forEach(((s,n)=>{var r;const a=this._tickDataMap[n],o=null===(r=null==a?void 0:a.getLatestData())||void 0===r?void 0:r.length,l=o?a.getLatestData().map((t=>t.value)):s.domain();if(l&&l.length)if(i&&i.length){const s=[],n=[];i.forEach((e=>{l.forEach((i=>{const r=Fa(e).concat(i);if(n.push(r),o){const e=JE(i,this._getNormalizedValue(r,t));s.push(e)}}))})),o&&e.push(s.filter((t=>t.value>=0&&t.value<=1))),i=n}else l.forEach((t=>{i.push(t)})),o&&e.push(a.getLatestData().map((e=>JE(e.value,this._getNormalizedValue([e.value],t)))).filter((t=>t.value>=0&&t.value<=1)))})),e.reverse()}_updateRawDomain(){this._rawDomainIndex=[];const t=this._spec.domain;for(let e=0;ethis._rawDomainIndex[e][t]=i))}}_clearRawDomain(){this._rawDomainIndex=[]}}function yD(t){if(Zo(t))return[t,t,t,t];if(y(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(bs(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}function bD(){p_(),dM(),yk(),Uv()}function xD(){p_(),dM(),Gx(),Uv()}bD();class SD extends Bk{getStartAngle(){return Et(this._startAngle)}getEndAngle(){return Et(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},SD.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(Zo(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(Va(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 n,r;const a=aa.line(Object.assign(Object.assign({points:t},y(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),jm(null==s?void 0:s.line)||(a.states=y(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=aa.line;Fa(i)[0].cornerRadius&&(t=aa.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Fa(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),jm(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,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:p,symbolType:g,size:m=12}=t;let _,f;"start"===i?(_={x:l.x+(Zo(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:l.y+(Zo(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},f=this._computeStartRotate(this._startAngle)):(_={x:h.x+(Zo(a)?d*Math.cos(a)+c*Math.cos(a-Math.PI/2):0),y:h.y+(Zo(a)?d*Math.sin(a)+c*Math.sin(a-Math.PI/2):0)},f=this._computeEndRotate(this._endAngle)),n=aa.symbol(Object.assign(Object.assign(Object.assign({},_),{symbolType:g,size:m,angle:s?f+u:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),jm(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?jm(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):jm(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?Zo(i)?t[i]:Va(t):t,this._mainSegmentPoints=s,s}_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}}function MD(t,e){return[t[0]*e,t[1]*e]}function kD(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}var AD,wD;SD.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}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background",t.axisBreak="axis-break",t.axisBreakSymbol="axis-break-symbol"}(AD||(AD={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(wD||(wD={}));const TD={[wD.selectedReverse]:{},[wD.selected]:{},[wD.hover]:{},[wD.hoverReverse]:{}},LD={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},CD={size:8,stroke:"#000",lineWidth:1,zIndex:1};function ED(){p_(),fy(),Uv(),ik(),cf()}var DD=function(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);nd&&(k=d,E.setAttribute("maxLineWidth",d-f[1]-f[2]))),x=0,S=0;let O=0;"left"===C||"start"===C?O=1:"right"===C||"end"===C?O=-1:"center"===C&&(O=0),O?O<0?(x-=k,b&&b.setAttribute("x",(b.attribute.x||0)-c),y.setAttribute("x",-f[1]-T)):O>0&&y.setAttribute("x",f[3]):(x-=k/2,b&&b.setAttribute("x",(b.attribute.x||0)-c/2),y.setAttribute("x",-T/2));const R="right"===_||"end"===_,B="left"===_||"start"===_;if((_?"center"===_:m)&&O){const t=k-f[1]-f[3],e=c+T,i=1===O?(t-e)/2+T+c/2:f[0]+T-(k/2+e/2-T)+c/2;if(E.setAttributes({x:i,textAlign:"center"}),b){const t=i-c/2-T+L/2;b.setAttributes({x:t})}}if(B&&1!==O){const t=k-f[1]-f[3],e=0===O?-t/2+T/2:-k+f[3]+f[1]+T,i=e+T;if(E.setAttributes({x:i,textAlign:"left"}),b){const t=e+L/2;b.setAttributes({x:t})}}if(R&&-1!==O){const t=k-f[1]-f[3],e=0===O?t/2+T/2:t;if(E.setAttributes({x:e,textAlign:"right"}),b){const t=e-c-T+L/2;b.setAttributes({x:t})}}"middle"===P?(S-=A/2,b&&b.setAttribute("y",0)):"bottom"===P?(S-=A,b&&b.setAttribute("y",-g/2),y.setAttribute("y",-f[2])):"top"===P&&(y.setAttribute("y",f[0]),b&&b.setAttribute("y",g/2))}const{visible:P}=a,O=DD(a,["visible"]);if(u&&v(P)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},O),{visible:P&&!!s,width:k,height:A,x,y:S}),"rect");if(jm(null==p?void 0:p.panel)||(t.states=p.panel),O.customShape){const e=O.customShape;t.pathProxy=t=>e(this,t,new Ze)}this._bgRect=t}this._textShape=E,this._symbol=b,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:E({},PD.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,s,n,r,a,o,l,h,d,c,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],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!==(d=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==d?d:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.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 OD(t){const e={};return Nk(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}function RD(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function BD(t,e,i,s=!1,n=!1){const r=[e.x-i.x,e.y-i.y];return MD(r,(s?-1:1)*(n?-1:1)*t/kD(r))}function ID(t,e,i,s,n){const r=[],a=n-s;for(let n=0;n{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function YD(t,e,i){let s=t.OBBBounds,n=e.OBBBounds;return s&&n&&!s.empty()&&!n.empty()?s.intersects(n):(s=t.AABBBounds,n=e.AABBBounds,i>Math.max(n.x1-s.x2,s.x1-n.x2,n.y1-s.y2,s.y1-n.y2))}function jD(t,e){for(let i,s=1,n=t.length,r=t[0];s{const s=t.target;return s!==i&&s.name&&!jm(s.states)?(s.addState(qk.hover,!0),Nk(e,(t=>{t!==s&&t.name&&!jm(t.states)&&t.addState(qk.hoverReverse,!0)})),s):i},zD=(t,e,i)=>i?(Nk(e,(t=>{t.name&&!jm(t.states)&&(t.removeState(qk.hoverReverse),t.removeState(qk.hover))})),null):i,ND=(t,e,i)=>{const s=t.target;return i===s&&s.hasState(qk.selected)?(Nk(e,(t=>{t.name&&!jm(t.states)&&(t.removeState(qk.selectedReverse),t.removeState(qk.selected))})),null):s.name&&!jm(s.states)?(s.addState(qk.selected,!0),Nk(e,(t=>{t!==s&&t.name&&!jm(t.states)&&t.addState(qk.selectedReverse,!0)})),s):i};class VD extends Bk{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=HD(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=zD(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=ND(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=k(this.attribute);E(this.attribute,t);const i=aa.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&OD(this._innerView),this.removeAllChild(!0),this._innerView=aa.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:s,line:n,items:r}=this.attribute,a=aa.group({x:0,y:0,zIndex:1,pickable:!1});if(a.name=AD.axisContainer,a.id=this._getNodeId("container"),a.setMode(this.mode),this.axisContainer=a,t.add(a),n&&n.visible&&this.renderLine(a),r&&r.length&&(this.data=this._transformItems(r[0]),s&&s.visible&&this.renderTicks(a),i&&i.visible)){const t=aa.group({x:0,y:0,pickable:!1});t.name=AD.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,a.add(t),r.forEach(((e,i)=>{const s=this.renderLabels(t,e,i),n=s.getChildren();this.beforeLabelsOverlap(n,e,s,i,r.length),this.handleLabelsOverlap(n,e,s,i,r.length),this.afterLabelsOverlap(n,e,s,i,r.length);let a=0,o=0,l="center",h="middle",d=0;n.forEach(((t,e)=>{var i;const s=t.attribute,n=null!==(i=s.angle)&&void 0!==i?i:0,r=t.AABBBounds;let c=r.width(),u=r.height();n&&(c=Math.abs(c*Math.cos(n)),u=Math.abs(u*Math.sin(n))),a=Math.max(a,c),o=Math.max(o,u),l=s.textAlign,h=s.textBaseline,0===e&&(d=s.x)})),this.axisLabelLayerSize[i]={width:a,height:o,labelPos:d,textAlign:l,textBaseline:h}}))}e&&e.visible&&this.renderTitle(a)}renderTicks(t){const e=this.getTickLineItems(),i=aa.group({x:0,y:0,pickable:!1});i.name=AD.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,s)=>{var n;const r=aa.line(Object.assign({},this._getTickLineAttribute("tick",t,s,e)));if(r.name=AD.tick,r.id=this._getNodeId(t.id),jm(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=Zk;else{const t=this.data[s],e=E({},Zk,this.attribute.tick.state);Object.keys(e).forEach((i=>{xs(e[i])&&(e[i]=e[i](t.rawValue,s,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:s}=this.attribute;if(s&&s.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=aa.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=AD.subTick,r.id=this._getNodeId(`${n}`),jm(s.state))r.states=Zk;else{const i=E({},Zk,s.state);Object.keys(i).forEach((s=>{xs(i[s])&&(i[s]=i[s](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:s}=this.attribute.label;s&&xs(s)&&(e=s(e,i));const n=this._transformItems(e),r=aa.group({x:0,y:0,pickable:!1});return r.name=`${AD.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var s;const a=sA(this._getLabelAttribute(t,e,n,i));if(a.name=AD.label,a.id=this._getNodeId(`layer${i}-label-${t.id}`),jm(null===(s=this.attribute.label)||void 0===s?void 0:s.state))a.states=Zk;else{const s=E({},Zk,this.attribute.label.state);Object.keys(s).forEach((r=>{xs(s[r])&&(s[r]=s[r](t,e,n,i))})),a.states=s}r.add(a)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new PD(Object.assign({},e));i.name=AD.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return RD(t,this.getVerticalVector(e,i,t))}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:s,inside:n=!1,length:r,dataFilter:a}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(a&&xs(a)?a(e):e).forEach((t=>{let e=t.point,a=t.value;if(!s){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),a=i}const l=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const s=this.getVerticalVector(r,n,e);let o=0,h=0;ht(s[0])>ht(s[1])?o=rt/2*(l.x>e.x?1:-1):h=rt/2*(l.y>e.y?-1:1),i.push({start:e,end:l,value:a,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else i.push({start:e,end:l,value:a,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:n=2}=t,r=this.tickLineItems,a=r.length;if(a>=2)for(let t=0;t0&&(0===p[1]?c+=(this.axisLabelLayerSize[s-1].height+$d(this.attribute,"label.space",4))*s:c+=(this.axisLabelLayerSize[s-1].width+$d(this.attribute,"label.space",4))*s);const g=this.getVerticalCoord(t.point,c,o),m=this.getVerticalVector(c||1,o,g),_=l?l(`${t.label}`,t,e,i,s):t.label;let{style:f}=this.attribute.label;return f=xs(f)?E({},LD.label.style,f(t,e,i,s)):f,f=E(this.getLabelAlign(m,o,f.angle),f),xs(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:s})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,m,_,f)),{text:null!=d?d:_,_originText:t.label,lineHeight:null==f?void 0:f.fontSize,type:h}),f)}getLabelPosition(t,e,i,s){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}const WD={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&YD(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function GD(t){let e;return e=t.OBBBounds.empty()?t.AABBBounds:t.OBBBounds,e.width()>1&&e.height()>1}function UD(t,e,i,s,n=!1){if(i&&!t.attribute.opacity){const i=e.length;if(i>1){t.setAttribute("opacity",1);for(let t=0;tt.setAttribute("opacity",1))),t}(i);const{method:n="parity",separation:r=0}=e,a=xs(n)?n:WD[n]||WD.parity;if(s.length>=3&&jD(s,r)){do{s=a(s,r)}while(s.length>=3&&jD(s,r));const t=(t,e)=>t<3||e,n=t(s.length,e.firstVisible);let o=t(s.length,e.lastVisible);const l=i[0],h=Ya(i);YD(l,h,r)&&(h.setAttribute("opacity",0),o=!1),UD(l,s,n,(t=>YD(t,l,r))),UD(h,s,o,(t=>YD(t,h,r)||!(!n||t===l)&&YD(t,l,r)),!0)}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}const XD=Math.sin(Math.PI/10);function KD(t){const e=!D(t)&&0!==t,i=e?Math.cos(t):1;return e&&Math.abs(i)<=XD}function qD(t){const e=!D(t)&&0!==t,i=e?Math.sin(t):0;return!e||Math.abs(i)<=XD}function ZD(t){for(let r=1;r{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},tP(t,e.attribute.angle)),{angle:QD(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},eP(t,e.attribute.angle)),{angle:QD(e.attribute.angle)}))}))}(t,e),function(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=Wt({x:t.attribute.x,y:t.attribute.y},e.angle,{x:e.centerX,y:e.centerY}),s=i.x-e.centerX,n=i.y-e.centerY;e.x1+=s,e.x2+=s,e.y1+=n,e.y2+=n,e.centerX+=s,e.centerY+=n,t.rotatedBounds=e}))}(e)}function QD(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function tP(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=QD(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}function eP(t,e=0){let i=["right","right","center","left","left","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","left","center","right","right","right","center","left","left"],s=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const n=(e=QD(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}class iP{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:s=1}=this.attribute,n=function(t){let e=kD(t);return e>0&&(e=1/e),[t[0]*e,t[1]*e]}(this.getRelativeVector());return MD([n[1],-1*n[0]],t*(e?1:-1)*s)}}const sP=["radius","startAngle","endAngle",...yn];class nP extends An{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Fn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return ms(this).circle}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:s=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-s>lt-nt?i.set(-r,-r,r,r):dn(s,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,sP)}needUpdateTag(t){return super.needUpdateTag(t,sP)}toCustomPath(){var t,e,i;const s=this.attribute,n=null!==(t=s.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=s.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=s.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new Ze;return o.arc(0,0,n,r,a),o}clone(){return new nP(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return nP.NOWORK_ANIMATE_ATTR}}function rP(t){return new nP(t)}nP.NOWORK_ANIMATE_ATTR=kn;const aP=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{radius:_=l.radius,startAngle:f=l.startAngle,endAngle:v=l.endAngle,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:M=l.scaleY}=t.attribute,k=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Pa(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,s,_+d*h,f,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=y,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/M,l[r]),l[r].opacity=a,e.stroke()}};g&&k(u,"outerBorder"),m&&k(p,"innerBorder")}},oP=Eo,lP=mo;var hP=function(t,e){return function(i,s){e(i,s,t)}};let dP=class extends xo{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Fn,this.builtinContributions=[aP,lP,oP],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=ms(t,null==r?void 0:r.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:c=l.endAngle,x:u=l.x,y:p=l.y}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;const{fVisible:m,sVisible:_,doFill:f,doStroke:v}=g;e.beginPath(),e.arc(i,s,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,p-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=ms(t,null==s?void 0:s.theme).circle;this._draw(t,n,!1,i,s)}};dP=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}([V(),hP(0,$(K)),hP(0,X(so)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],dP);let cP=!1;const uP=new I((t=>{cP||(cP=!0,t(dP).toSelf().inSingletonScope(),t(fr).to(dP).inSingletonScope(),t(vr).toService(fr),t(so).toService(_o),Z(t,so))}));let pP=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Fn}};pP=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(fr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],pP);let gP=!1;const mP=new I(((t,e,i,s)=>{gP||(gP=!0,t(N_).to(pP).inSingletonScope(),t(ef).toService(N_))}));let _P=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Fn}};_P=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(fr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_P);let fP=!1;const vP=new I(((t,e,i,s)=>{fP||(fP=!0,t(E_).to(_P).inSingletonScope(),t(T_).toService(E_))}));function yP(){yP.__loaded||(yP.__loaded=!0,aa.RegisterGraphicCreator("circle",rP),Xi.load(uP),Xi.load(w_?mP:vP))}yP.__loaded=!1;const bP=yP;function xP(){p_(),dM(),ik(),cf()}var SP=function(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{const{startPoint:s,endPoint:n,breakSymbol:r,rawRange:a}=e;if(!1!==(null==r?void 0:r.visible)){const e=aa.group({zIndex:999});e.name=AD.axisBreak,e.id=this._getNodeId(`${AD.axisBreak}-${i}`),e.data=a;const o=function(t={}){var e,i;const{style:s={},angle:n=.5*Math.PI}=t,r=E({},CD,s),a=null!==(e=r.size)&&void 0!==e?e:CD.size;return Object.assign(Object.assign({},r),{symbolType:null!==(i=r.symbolType)&&void 0!==i?i:`M ${-a/2} ${a*Math.sin(n)} L ${a/2} ${-a*Math.sin(n)}`,symbolSize:a})}(r),l=aa.symbol(Object.assign({x:s.x,y:s.y},o));l.name=AD.axisBreakSymbol;const h=aa.symbol(Object.assign({x:n.x,y:n.y},o));h.name=AD.axisBreakSymbol,e.add(l),e.add(h),t.add(e)}}));const{panel:i}=this.attribute;if(i&&i.visible){const t=this.axisContainer,s=t.AABBBounds,n=aa.rect(Object.assign({x:s.x1,y:s.y1,width:s.width(),height:s.height()},i.style));n.name=AD.background,n.id=this._getNodeId("background"),n.states=E({},TD,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){const{start:e,end:i,line:s}=this.attribute,n=s,{startSymbol:r,endSymbol:a,style:o,state:l}=n,h=SP(n,["startSymbol","endSymbol","style","state"]),d=Object.assign({startSymbol:r,endSymbol:a,lineStyle:o},h);if(this._breaks&&this._breaks.length){const t=[];let s=e;this._breaks.forEach((e=>{const{startPoint:i,endPoint:n}=e;t.push([s,i]),s=n})),t.push([s,i]),d.points=t,d.multiSegment=!0}else d.points=[e,i];jm(l)||(d.state={line:E({},TD,l),symbol:E({},TD,l)});const c=new SD(d);c.name=AD.line,c.id=this._getNodeId("line"),t.add(c)}getTextAlign(t){let e="center";return dd(t[0],0)?dd(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTitleAttribute(){var t,e,i;const s=this.attribute.title,{position:n="middle",space:r=4,textStyle:a={},autoRotate:o=!0,shape:l,background:h,state:d={},maxWidth:c}=s,u=SP(s,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let p=.5;"start"===n?p=0:"end"===n&&(p=1);const{verticalFactor:g=1}=this.attribute,m=-1*g,_=this.getTickCoord(p),f=this.getRelativeVector();let v=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+$d(this.attribute,"label.space",4);v+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===f[1]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?v+=i+(e-1)*t:v=0}else if(0===f[0])if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){const i=this.axisLabelLayerSize[0].labelPos,s=this.axisLabelsContainer.AABBBounds;v+=(1===m?s.x2>i?Math.min(s.x2-i,s.width()):0:s.x1{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)}))}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));const b=y+v+r,x=this.getVerticalCoord(_,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0});let M,k,{angle:A}=u;if(M="start"===n?"start":"end"===n?"end":"center",D(A)&&o){A=function(t,e,i){const s=function(t,e){const[i,s]=t,[n,r]=e,a=Math.sqrt((i*i+s*s)*(n*n+r*r)),o=a&&(i*n+s*r)/a;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),n=yt(t,e)>=0;return i?n?2*Math.PI-s:s:n?s:2*Math.PI-s}(f,[1,0],!0);const{verticalFactor:t=1}=this.attribute;k=1==-1*t?"bottom":"top"}else M=this.getTextAlign(S),k=this.getTextBaseline(S,!1);let w=c;if(D(w)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,s=Math.min(t||1/0,e||1/0);if(Zo(s))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));w=t<1e-6?1/0:this.attribute.end.x/t}else w=s-b;else if(A&&0!==A){const t=Math.abs(Math.sin(A));w=t<1e-6?1/0:this.attribute.end.y/t}else w=s-b}const T=Object.assign(Object.assign(Object.assign({},x),u),{maxWidth:w,textStyle:Object.assign({textAlign:M,textBaseline:k},a),state:{text:E({},TD,d.text),shape:E({},TD,d.shape),panel:E({},TD,d.background)}});return T.angle=A,l&&l.visible&&(T.shape=Object.assign({visible:!0},l.style),l.space&&(T.space=l.space)),h&&h.visible&&(T.panel=Object.assign({visible:!0},h.style)),T}getTextBaseline(t,e){let i="middle";const{verticalFactor:s=1}=this.attribute,n=(e?1:-1)*s;return dd(t[1],0)?i=!dd(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const s=this.attribute.orient;if(["top","bottom","right","left"].includes(s)||0===t[0]&&0===t[1]){if("top"===s||"bottom"===s)return tP(e?"bottom"===s?"top":"bottom":s,i);if("left"===s||"right"===s)return eP(e?"left"===s?"right":"left":s,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,s,n){var r,a,o,l;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:s}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=Ya(t),c=n?h.attribute.x>d.attribute.x:h.attribute.yo&&(e.attribute.angle?e.setAttributes({dx:(null!==(a=e.attribute.dx)&&void 0!==a?a:0)+o-u}):e.setAttributes({x:o,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,a=i.y,u=s.y;ru&&(t.attribute.angle?t.setAttributes({dy:(null!==(l=t.attribute.dy)&&void 0!==l?l:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,s,n){if(jm(t))return;const{verticalLimitSize:r,label:a,orient:o}=this.attribute,l=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:p,autoHide:g,autoHideMethod:m,autoHideSeparation:_,lastVisible:f,firstVisible:v,autoWrap:y,overflowLimitLength:b}=a;if(xs(h))h(t,e,s,this);else{if(d?function(t,e){if(jm(t))return;const{orient:i,labelRotateAngle:s=[0,45,90]}=e;if(0===s.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(s&&s.length>0&&(r=s.length);n{t.attribute.angle=At(e)})),JD(i,t),!ZD(t))break}}(t,{labelRotateAngle:c,orient:o}):y&&function(t,e){const{limitLength:i,axisLength:s,ellipsis:n="...",orient:r}=e;if(jm(t)||!Zo(i))return;const a=s/t.length;t.forEach((t=>{var e;const s=t.attribute.angle,o=qD(s),l=KD(s),h="top"===r||"bottom"===r;if(h){if(l&&Math.floor(t.AABBBounds.height())<=i)return;if(o&&Math.floor(t.AABBBounds.width())<=a)return}else{if(l&&Math.floor(t.AABBBounds.height())<=a)return;if(o&&Math.floor(t.AABBBounds.width())<=i)return}let d=null,c=null;h?l?(d=i,c=a):(d=a,c=i):l?(d=a,c=i):(d=i,c=a),t.setAttributes({maxLineWidth:d,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n,whiteSpace:"normal",heightLimit:c})}))}(t,{orient:o,limitLength:l,axisLength:"left"===o||"right"===o?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),ellipsis:p}),!y&&u&&Zo(l)&&l>0){const e="left"===o||"right"===o,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){const{limitLength:i,verticalLimitLength:s,ellipsis:n="...",orient:r,axisLength:a}=e;if(jm(t)||!Zo(i))return;Math.sin(Math.PI/10);const o=function(t){return Zo(t)?{left:t,right:t}:bs(t)?{left:t.left||0,right:t.right||0}:{left:0,right:0}}(e.overflowLimitLength);t.forEach((t=>{var e;const l=t.attribute.angle,h=!D(l),d=h?Math.cos(l):1,c=h?Math.sin(l):0,u=qD(l),p=KD(l),g="top"===r||"bottom"===r;if(g){if(p&&Math.floor(t.AABBBounds.height())<=i)return;if(u&&Math.floor(t.AABBBounds.width())<=s)return}const m=t.attribute.direction;if(!g){if("vertical"===m&&Math.floor(t.AABBBounds.height())<=s)return;if("vertical"!==m){if(u&&Math.floor(t.AABBBounds.width())<=i)return;if(p&&Math.floor(t.AABBBounds.height())<=s)return}}let _=null;if(u||p)_=g?u?s:i:"vertical"===m||p?s:i;else if(g){const{x1:e,x2:s}=t.AABBBounds,n=c/d,r=Math.abs(i/c);if(n>0&&e<=a&&i/n+e>a){const t=(a-e)/Math.abs(d)+o.right;_=Math.min(t,r)}else if(n<0&&s>=0&&i/n+s<0){const t=s/Math.abs(d)+o.left;_=Math.min(t,r)}else _=r}else _=Math.abs(i/d);Zo(t.attribute.maxLineWidth)&&(_=Zo(_)?Math.min(t.attribute.maxLineWidth,_):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:_,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}(t,{limitLength:l,verticalLimitLength:e?i/t.length:g||d?1/0:i/t.length,ellipsis:p,orient:o,axisLength:i,overflowLimitLength:b})}g&&$D(t,{orient:o,method:m,separation:_,lastVisible:f,firstVisible:v})}}afterLabelsOverlap(t,e,i,s,n){const{verticalLimitSize:r,orient:a}=this.attribute,o="bottom"===a||"top"===a,l=i.AABBBounds;let h=o?l.height():l.width();const{verticalMinSize:d}=this.attribute;if(Zo(d)&&(!Zo(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,s;h=Math.max(h,t),"left"===a?(e=l.x2-h,s=l.y1):"right"===a?(e=l.x1,s=l.y1):"top"===a?(e=l.x1,s=l.y2-h):"bottom"===a&&(e=l.x1,s=l.y1);const r=aa.rect({x:e,y:s,width:o?l.width():h,height:o?h:l.height(),pickable:!1});r.name=AD.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(M(this.attribute.label.containerAlign)){let e;"left"===a?e=l.x2-h:"right"===a?e=l.x1:"top"===a?e=l.y2-h:"bottom"===a&&(e=l.y1),function(t,e,i,s,n){"left"===s||"right"===s?"left"===n?t.forEach((t=>{var i;t.setAttributes({dx:(null!==(i=t.attribute.dx)&&void 0!==i?i:0)+e-t.AABBBounds.x1})})):"right"===n?t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i-t.AABBBounds.x2})})):"center"===n&&t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})})):"bottom"!==s&&"top"!==s||("top"===n?t.forEach((t=>{var i;t.setAttributes({dy:(null!==(i=t.attribute.dy)&&void 0!==i?i:0)+e-t.AABBBounds.y1})})):"bottom"===n?t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i-t.AABBBounds.y2})})):"middle"===n&&t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})})))}(t,e,h,a,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,s,n,r,a;const{label:o,title:l,line:h,tick:d}=this.attribute,c=null!==(i=o.space)&&void 0!==i?i:4;let u=t,p=0,g=0;const m=h&&h.visible?null!==(s=h.style.lineWidth)&&void 0!==s?s:1:0,_=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(l&&l.visible&&"string"==typeof l.text){p=tA(l.text,l.textStyle,null===(a=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===a?void 0:a.text).height;const t=yD(l.padding);g=l.space+t[0]+t[2]}return u&&(u=(u-c-g-p-m-_)/e),u}release(){super.release(),this._breaks=null}}MP.defaultAttributes=LD,QA(MP,iP);class kP{isInValidValue(t){const{startAngle:e=$k,endAngle:i=Xk}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=$k,endAngle:i=Xk,center:s,radius:n,inside:r=!1,innerRadius:a=0}=this.attribute;return Tt(s,r&&a>0?a:n,e+(i-e)*t)}getVerticalVector(t,e=!1,i){return BD(t,i,this.attribute.center,e,this.attribute.inside)}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}function AP(t,e){const i=t.length;return{prevLabel:e>=1?t[e-1]:t[i-1],nextLabel:e=3){const{prevLabel:i,nextLabel:n}=AP(t,e);s.push(i,n)}else 2===t.length&&s.push(t[0===e?1:0]);const n=t[e];let r=Math.min(Math.abs(n.attribute.y-i.y1),Math.abs(n.attribute.y-i.y2));s.forEach((t=>{r=Math.min(r,Math.abs(t.attribute.y-n.attribute.y))})),r>0&&n.setAttributes({whiteSpace:"normal",heightLimit:r})}xP(),bP();class LP extends VD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},LP.defaultAttributes,t))}renderLine(t){const{startAngle:e=$k,endAngle:i=Xk,radius:s,center:n,innerRadius:r=0,line:a={},inside:o=!1,sides:l}=this.attribute;let h,d=s,c=r;if(o&&r>0&&(d=r,c=0),Zo(l)&&l>=3){const t=ID(n,l,d,e,i);h=aa.path(Object.assign(Object.assign({},a.style),{path:FD(t,!0)}))}else{const t=Object.assign(Object.assign(Object.assign({},n),{startAngle:e,endAngle:i,radius:d,innerRadius:c}),a.style);h=aa.circle(t)}h.name=AD.line,h.id=this._getNodeId("line"),jm(a.state)||(h.states=E({},TD,a.state)),t.add(h)}getTitleAttribute(){var t,e,i;const{center:s,radius:n,innerRadius:r=0}=this.attribute,a=this.attribute.title,{space:o=4,textStyle:l={},shape:h,background:d,state:c={}}=a,u=function(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=2){const i=this.data[1].value-this.data[0].value,h=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t{const{x:o,y:l}=e.attribute,h=e.AABBBounds;if(dd(o,a.x)){if(l>n.y2||l=3){const{prevLabel:n,nextLabel:a}=AP(t,s);let l=n.attribute.x,h=a.attribute.x;l>h&&(l=a.attribute.x,h=n.attribute.x);const d=l===h?r:o>=l&&o<=h?h-l:Math.min(Math.abs(l-o),Math.abs(h-o));e.AABBBounds.width()>d&&wP(e,d,i)}else e.AABBBounds.width()>r&&wP(e,r,i)}else o>a.x&&h.x2>n.x2?(wP(e,n.x2-o,i),r&&TP(t,s,n)):o0?"top":"middle"}getLabelAlign(t,e,i){return dd(t[0],0)?{textAlign:"center",textBaseline:t[1]>0?"top":"bottom"}:t[0]<0?{textAlign:"right",textBaseline:this.getTextBaseline(t)}:t[0]>0?{textAlign:"left",textBaseline:this.getTextBaseline(t)}:{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,s){return t}}LP.defaultAttributes=LD,QA(LP,kP);class CP extends i_{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(t),this.spec.scale=void 0}const e=S(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}const EP=(t,e,i,s,n,r)=>{var a;const o=t.getCoordinateAxisPosition();n&&"auto"===n.position&&(n.position=i?"content":o);const l=t.getCoordinateAxisPoints(s);if(l){const s={start:l[0],end:l[1],verticalFactor:("top"===o||"left"===o?-1:1)*(i?-1:1)*((null===(a=t.getSpec().range)||void 0===a?void 0:a.reversed)?-1:1)};if(r&&"polar"===e.type){const t=e.angle();s.center=e.origin(),s.startAngle=t[0],s.endAngle=t[1]}return s}const h=e.radius(),d=e.angle();return{center:e.origin(),radius:h[1],innerRadius:h[0],inside:i,startAngle:d[0],endAngle:d[1]}};class DP extends CP{constructor(t,e,i){super(t,tc.axis,e),this.spec.componentType=tc.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=fc.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce(((i,s)=>{const n=e[s];return n&&(i[s]={callback:(e,i,s)=>{var r,a;const o=this.spec.skipTheme?null:this.view.getCurrentTheme();let l=Om(n,e,i,s);const h=Up(this.spec.inside,s,e,i),d=Up(this.spec.baseValue,s,e,i),c=null===(r=null==t?void 0:t.getCoordinate)||void 0===r?void 0:r.call(t);c&&(l=Object.assign(EP(t,c,h,d,this.spec.layout),l));const u=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t),p=Up(this.spec.tickCount,s,e,i);switch(this._getAxisComponentType()){case ic.lineAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.axis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p);case ic.circleAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleAxis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p)}return l}}),i}),{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if(D(e)){const i=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=(null===(t=null==i?void 0:i.getCoordinate)||void 0===t?void 0:t.call(i))?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType="circle"===e?ic.circleAxis:ic.lineAxis,this._axisComponentType}}DP.componentType=tc.axis;const PP=()=>{fc.registerGraphicComponent(ic.lineAxis,((t,e)=>new MP(t,e))),fc.registerComponent(tc.axis,DP)},OP=()=>{fc.registerGraphicComponent(ic.circleAxis,(t=>new LP(t))),fc.registerComponent(tc.axis,DP)};function RP(t,e,i,s){let n="";if(!t||0===e.length)return n;const r=e[0],a=xe.distancePP(t,r),o=i?0:1;return s?n+=`M${t.x},${t.y-a}A${a},${a},0,0,${o},${t.x},${t.y+a}A${a},${a},0,0,${o},${t.x},${t.y-a}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${a},${a},0,0,${o},${t.x},${t.y}`})),n}function BP(t,e,i){const{type:s,closed:n}=i,r=e.slice(0).reverse();let a="",o="";if("line"===s&&i.smoothLink&&i.center){const e=t[0],s=r[0],l=i.center;a=FD(t,!!n),o=FD(r,!!n);const h=xe.distancePP(s,l),d=xe.distancePP(e,l);a+=`A${h},${h},0,0,1,${s.x},${s.y}L${s.x},${s.y}`,o+=`A${d},${d},0,0,0,${e.x},${e.y}`}else if("circle"===s){const{center:e}=i;a=RP(e,t,!1,!!n),o=RP(e,r,!0,!!n)}else"line"!==s&&"polygon"!==s||(a=FD(t,!!n),o=FD(r,!!n));return n?a+=o:(o="L"+o.substring(1),a+=o,a+="Z"),a}class IP extends Bk{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&OD(this._innerView),this.removeAllChild(!0),this._innerView=aa.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){return RD(t,this.getVerticalVector(e,i,t))}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){const i=E({},this.attribute,this.getGridAttribute(t)),{type:s,items:n,style:r,closed:a,alternateColor:o,depth:l=0}=i,h=t?`${AD.grid}-sub`:`${AD.grid}`;if(n.forEach(((t,i)=>{const{id:n,points:o}=t;let d="";if("line"===s||"polygon"===s)d=FD(o,!!a);else if("circle"===s){const{center:t}=this.attribute;d=RP(t,o,!1,!!a)}const c=aa.path(Object.assign({path:d,z:l},xs(r)?E({},this.skipDefault?null:IP.defaultAttributes.style,r(t,i)):r));c.name=`${h}-line`,c.id=this._getNodeId(`${h}-path-${n}`),e.add(c)})),l&&"line"===s&&n.forEach(((t,i)=>{const{id:s,points:n}=t,o=[];o.push(n[0]);const d=n[1].x-n[0].x,c=n[1].y-n[0].y,u=Math.sqrt(d*d+c*c),p=l/u;o.push({x:n[0].x+d*p,y:n[0].y+c*p});const g=FD(o,!!a),m=ht(o[0].x-o[1].x),_=ht(o[0].y-o[1].y),f=aa.path(Object.assign({path:g,z:0,alpha:m>_?(n[1].x-n[0].x>0?-1:1)*rt/2:0,beta:m<_?-rt/2:0,anchor3d:m>_?[o[0].x,0]:[0,o[0].y]},xs(r)?E({},this.skipDefault?null:IP.defaultAttributes.style,r(t,i)):r));f.name=`${h}-line`,f.id=this._getNodeId(`${h}-path-${s}`),e.add(f)})),n.length>1&&o){const t=y(o)?o:[o,"transparent"],s=e=>t[e%t.length],r=this.attribute.items,a=r[0],l=r[r.length-1],d=!dd(a.value,0)&&!dd(l.value,0),c=!dd(a.value,1)&&!dd(l.value,1),u=[],p=a.value>l.value;(p&&c||!p&&d)&&u.push(this.getGridPointsByValue(p?1:0)),n.forEach((t=>{u.push(t.points)})),(p&&d||!p&&c)&&u.push(this.getGridPointsByValue(p?0:1));for(let t=0;t=2&&(t=this.data[1].value-this.data[0].value),t}_getPointsOfSubGrid(t,e){const i=this.data.length,s=[];return i>=2&&this.data.forEach((i=>{let n=i.value;if(!e){const e=i.value-t/2;if(this.isInValidValue(e))return;n=e}s.push({value:n})})),s}release(){super.release(),this._prevInnerView=null,this._innerView=null}}IP.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},p_(),TM();class FP extends IP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},IP.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){const{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:s=6,startAngle:n=$k,endAngle:r=Xk}=this.attribute;i=ID(t,s,xe.distancePP(t,e),n,r)}return i}getGridPointsByValue(t){const e=this.getTickCoord(t);return this._getGridPoint(this.attribute.type,e)}getGridAttribute(t){const{type:e,alignWithLabel:i=!0}=this.attribute,s=this._parseTickSegment();let n,r=[];if(t){n=E({},this.attribute,this.attribute.subGrid);const t=[],{count:e=4}=n;if(this.data.length>=2){const n=this._getPointsOfSubGrid(s,i);for(let i=0;i{let{point:r}=n;if(!i){const t=n.value-s/2;if(this.isInValidValue(t))return;r=this.getTickCoord(t)}t.push({id:n.label,datum:n,points:this._getGridPoint(e,r)})})),r=t}return Object.assign(Object.assign({},n),{items:r})}}QA(FP,iP);p_(),TM();class YP extends IP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},IP.defaultAttributes,t),e)}getGridPointsByValue(t){const e=this.getTickCoord(t),{radius:i,innerRadius:s=0}=this.attribute;return[e,this.getVerticalCoord(e,i-s,!0)]}getGridAttribute(t){let e,i=[];const s=this.attribute,{radius:n,innerRadius:r=0,startAngle:a=$k,endAngle:o=Xk,center:l,subGrid:h}=s,d=function(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=2){const e=this._getPointsOfSubGrid(p,c);for(let i=0;i{let{point:i}=e;if(!c){const t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),i=t}return Object.assign(Object.assign({},e),{items:i,center:l,type:"line"})}}QA(YP,kP);class jP extends CP{constructor(t,e,i){super(t,tc.grid,e),this.spec.componentType=tc.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){const t=S(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(t)}this.spec.target=t;const e=S(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=fc.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=this.spec.skipTheme?null:this.view.getCurrentTheme();let h,d=Om(s,t,e,i);const c=Up(this.spec.baseValue,i,t,e);if(this._targetAxis){const t=null===(n=this._targetAxis.getSpec())||void 0===n?void 0:n.scale;h=S(t)?this.view.getScaleById(t):t;const e=this._targetAxis.elements[0];if(e)switch(this._getGridComponentType()){case sc.lineAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),start:e.getGraphicAttribute("start"),end:e.getGraphicAttribute("end"),verticalFactor:null!==(r=e.getGraphicAttribute("verticalFactor"))&&void 0!==r?r:1},d);break;case sc.circleAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),center:e.getGraphicAttribute("center"),radius:e.getGraphicAttribute("radius"),innerRadius:e.getGraphicAttribute("innerRadius"),inside:e.getGraphicAttribute("inside"),startAngle:e.getGraphicAttribute("startAngle"),endAngle:e.getGraphicAttribute("endAngle")},d)}}else{h=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;const s=Up(this.spec.inside,i,t,e),n=null===(a=null==h?void 0:h.getCoordinate)||void 0===a?void 0:a.call(h);n&&(d=Object.assign(EP(h,n,s,c,this.spec.layout,!0),d))}this._getGridComponentType()===sc.lineAxisGrid&&(d="line"!==this.spec.gridShape&&this.spec.gridShape?Object.assign({center:d.start,closed:!0},d,{type:this.spec.gridShape}):Object.assign({},d,{type:"line"}));const u=null===(o=null==h?void 0:h.getScale)||void 0===o?void 0:o.call(h),p=Up(this.spec.tickCount,i,t,e);switch(this._getGridComponentType()){case sc.lineAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.grid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p);case sc.circleAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleGrid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p)}return d}}),e}),{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)"circle"===this.spec.gridType?this._gridComponentType=sc.circleAxisGrid:this._gridComponentType=sc.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case ic.circleAxis:this._gridComponentType=sc.circleAxisGrid;break;case ic.lineAxis:default:this._gridComponentType=sc.lineAxisGrid}else if(this.spec.scale){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=(null===(t=null==e?void 0:e.getCoordinate)||void 0===t?void 0:t.call(e))?e.getCoordinateAxisPoints()?sc.lineAxisGrid:sc.circleAxisGrid:sc.lineAxisGrid}else this._gridComponentType=sc.lineAxisGrid;return this._gridComponentType}}jP.componentType=tc.grid;const HP=()=>{fc.registerGraphicComponent(sc.lineAxisGrid,((t,e)=>new FP(t,e))),fc.registerComponent(tc.grid,jP)},zP=()=>{fc.registerGraphicComponent(sc.circleAxisGrid,((t,e)=>new YP(t,e))),fc.registerComponent(tc.grid,jP)},NP=(t,e,i,s)=>FE(t,e,i).map((t=>s?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),VP=(t,e,i=0)=>Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2,WP=(t,e)=>t[1]{var i;const s=t.domain();if(!s.length)return[];const{tickCount:n,forceTickCount:r,tickStep:a,labelGap:o=4,axisOrientType:l,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(l),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?RE([s[s.length-1]]):RE([s[0]]);let p;if(M(a))p=t.stepTicks(a);else if(M(r))p=t.forceTicks(r);else if(M(n)){const e=xs(n)?n({axisLength:u,labelStyle:h}):n;p=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=Ha(c),a=ja(c);if(s.length<=u/n){const i=(a-r)/s.length,n=NP(t,s,e,d),l=Math.min(...n.map((t=>t[2]))),h=UP(s,n,o,e.labelLastVisible,Math.floor(l/i),!1);p=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(p=p.slice(0,p.length-h.delCount)),p.push(s[s.length-1]))}else{const i=[s[0],s[Math.floor(s.length/2)],s[s.length-1]],n=NP(t,i,e,d);let l=null;n.forEach((t=>{l?l[2]0?Math.ceil(s.length*(o+l[2])/(a-r-o)):s.length-1;p=t.stepTicks(h),!e.labelLastVisible||p.length&&p[p.length-1]===s[s.length-1]||(p.length&&Math.abs(t.scale(p[p.length-1])-t.scale(s[s.length-1])){let a=0,o=0,l=-1,h=Number.MAX_VALUE;const d=s=>{let n=!0,r=0;do{r+sd(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!s){o=u;break}{const s=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==s&&!VP(e[n],e[s],i))break;r++}while(n>0);if(n===s){o=u,a=r;break}{const i=Math.floor(t.length/u)-r+1;if(i=0?WP(e[n-u],e[n]):t,c=Math.abs(t-d);if(cthis._scales[t];return{isContinuous:!1,dataToPosition:this.dataToPosition.bind(this),getScale:t,getBandwidth:(e=0)=>t(e).bandwidth(),getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse,getSpec:()=>this._spec}}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,GP),t}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){if(this._scale){const{bandSize:t,maxBandSize:e,minBandSize:i}=this._getOuterBandSizeFromSpec();if(t&&this._scale.bandwidth(t),e&&this._scale.maxBandwidth(e),i&&this._scale.minBandwidth(i),this._scale.isBandwidthFixed()&&this._spec.autoRegionSize&&(t||e)){const i=yb(this._scale.domain().length,null!=t?t:e,this._scale.paddingInner(),this._scale.paddingOuter());["bottom","top"].includes(this._orient)?this._regions.forEach((t=>t.setMaxWidth(i))):["left","right"].includes(this._orient)&&this._regions.forEach((t=>t.setMaxHeight(i)))}}}_getOuterBandSizeFromSpec(){var t;let{bandSize:e,maxBandSize:i,minBandSize:s,bandSizeLevel:n=0}=this._spec;const{gap:r,extend:a=0}=null!==(t=this._spec.bandSizeExtend)&&void 0!==t?t:{};n=Math.min(n,this._scales.length-1);for(let t=n;t>0;t--){const o=this._scales[t],l=o.domain(),h=o.paddingInner(),d=o.paddingOuter(),c=e=>{const i=t===n?a:0;return D(r)||t{PP(),HP(),gD(),Xl.registerComponent($P.type,$P)};function KP(t){const e=[];for(let i=0;it>i&&ti.reduce(((t,s,n)=>(t.push([s,i.length===n+1?e:i[n+1]]),t)),[[t,i[0]]]))(i,s,n)}const ZP=(t,e)=>t-e;function JP(t,e){const i=((t,e)=>{const i=[0];let s=0,n=0;for(;s{const n=t[i-1]?t[i-1][1]:0,r=(100*n+100*+(e/s).toFixed(2))/100;return t.push([n,r>1||r>.95?1:r]),t}),[]).filter((t=>!(0===t[0]&&0===t[1]||1===t[0]&&1===t[1])))}const QP=Math.sqrt(50),tO=Math.sqrt(10),eO=Math.sqrt(2);class iO{constructor(){this._extend={},this.niceLabelFormatter=null}setExtraAttrFromSpec(){M(this._spec.nice)&&(this._nice=this._spec.nice),M(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=$E(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;if(!this._nice)return!1;let e=5;const i=this._spec.tick||{};if(Zo(i.forceTickCount))e=i.forceTickCount;else if(xs(i.tickCount)){const t=this._scale.range();let s=Math.abs(Ya(t)-t[0]);1===s&&this._option&&(s=Ad(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({axisLength:s,labelStyle:this._spec.label&&this._spec.label.style})}else e=Zo(i.tickCount)?i.tickCount:5;"accurateFirst"===this._spec.niceType&&(e=Math.max(5,e));const{min:s,max:n}=null!==(t=this._domain)&&void 0!==t?t:{};return D(s)&&D(n)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice(e):(M(s)||M(this._softMinValue))&&D(n)&&D(this._softMaxValue)?this._scale.niceMax(e):!(!D(s)||!D(this._softMinValue)||!M(n)&&!M(this._softMaxValue))&&this._scale.niceMin(e)}setLogScaleNice(){var t;if(!this._nice)return!1;const{min:e,max:i}=null!==(t=this._domain)&&void 0!==t?t:{};return D(e)&&D(i)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice():(M(e)||M(this._softMinValue))&&D(i)&&D(this._softMaxValue)?this._scale.niceMax():!(!D(e)||!D(this._softMinValue)||!M(i)&&!M(this._softMaxValue))&&this._scale.niceMin()}setScaleNice(){return"log"===this._spec.type?this.setLogScaleNice():this.setLinearScaleNice()}dataToPosition(t,e){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){let e=[];if(t.length){const i=this._spec.breaks&&this._spec.breaks.length;let s,n,r=[];if(t.forEach((t=>{const{min:e,max:a}=t;s=void 0===s?e:Math.min(s,e),n=void 0===n?a:Math.max(n,a),i&&(r=r.concat(t.values))})),i){const t=[],i=[];for(let e=0;et[0]-e[0])),t.length){const{domain:s,scope:n}=function(t,e){return t.sort(ZP),e.sort(ZP),{domain:qP(t,e),scope:JP(t,e)}}(r,KP(t));e=KP(s),this._break={domain:s,scope:n,breakDomains:t,breaks:i}}else e=[s,n]}else e=[s,n]}else e[0]=0,e[1]=0;return this.setSoftDomainMinMax(e),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this._expand)return;let e=t[0],i=Ya(t);e===i&&(0===i?i=1:i>0?e=0:i<0&&(i=0)),M(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),M(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){const{min:e,max:i}=$E(this._spec);if(M(e)||M(i)||"linear"!==this._spec.type)return t;if(Math.abs(Ha(t)-ja(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[t.length-1]=1;else{let i=e/5;const s=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,s);i=(n>=QP?10:n>=tO?5:n>=eO?2:1)*Math.pow(10,s),t[0]=0,t[t.length-1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[t.length-1]*=-1)}return t}includeZero(t){this._zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(Ya(t),0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e;const i=t.length-1,s=t[0]-t[i]>0,n=s?i:0,r=s?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e=Ya(t)&&(t[t.length-1]=e),this._softMaxValue=e}}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){if(!this.isSeriesDataEnable())return;const t=this.collectData(),e=this.computeLinearDomain(t);this.updateScaleDomainByModel(e)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this._updateNiceLabelFormatter(t),this._domainAfterSpec=this._scale.domain(),this.event.emit(zd.scaleDomainUpdate,{model:this}),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}getDomainAfterSpec(){return this._domainAfterSpec}_updateNiceLabelFormatter(t){const e=Math.abs(Ya(t)-t[0]),i=Math.max(-Math.floor(Math.log10(e)),0)+2,s=Math.pow(10,i);this.niceLabelFormatter=t=>Zo(+t)?Math.round(+t*s)/s:t}}function sO(t,e,i,s){let n;const{breakData:r}=t;if(r&&r()){const{breakDomains:t}=r(),a=e.domain();n=[];for(let e=0;e{t.some((t=>e>=t[0]&&e<=t[1]))||n.push(e)}));e.domain(a)}else n=s(i);return n}function nO(t,e,i,s,n=!1){if(i&&!e.includes(t)){let i=e.length;if(i>1){n?e.push(t):e.unshift(t);for(let t=0;t{var i,s;if(!Qh(t.type))return RE(t.domain());const n=t.range(),r=Math.abs(n[n.length-1]-n[0]);if(r<2)return RE([t.domain()[0]]);const{tickCount:a,forceTickCount:o,tickStep:l,noDecimals:h=!1,labelStyle:d,breakData:c}=e;let u;if(M(l))u=t.stepTicks(l);else if(M(o))u=sO(e,t,o,((e,i)=>i&&i.length?t.domain(i,!0).forceTicks(e):t.forceTicks(e)));else if("d3"===e.tickMode){const s=null!==(i=xs(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==i?i:5;u=sO(e,t,s,((e,i)=>i&&i.length?t.domain(i,!0).d3Ticks(e,{noDecimals:h}):t.d3Ticks(e,{noDecimals:h})))}else{const i=null!==(s=xs(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==s?s:5,n=xs(e.tickMode)?e.tickMode:void 0;u=sO(e,t,i,((e,i)=>i&&i.length?t.domain(i,!0).ticks(e,{noDecimals:h,customTicks:n}):t.ticks(e,{noDecimals:h,customTicks:n})))}const p=t.domain();if(e.labelFirstVisible&&p[0]!==u[0]&&!u.includes(p[0])&&u.unshift(p[0]),e.labelLastVisible&&p[p.length-1]!==u[u.length-1]&&!u.includes(p[p.length-1])&&u.push(p[p.length-1]),e.sampling&&u.length>1&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:s}=e;let n=FE(t,u,e).map(((t,e)=>({AABBBounds:t,value:u[e]})));const r=[...n],a=r[0],o=Ya(r),l=c&&c()?aO.greedy:aO.parity;for(;n.length>=3&&jD(n,i);)n=l(n,i);const h=(t,e)=>t<3||e,d=h(n.length,e.labelFirstVisible);let p=h(n.length,e.labelLastVisible);YD(a,o,i)&&n.includes(o)&&n.length>1&&(n.splice(n.indexOf(o),1),p=!1),nO(a,n,d,(t=>YD(t,a,i))),nO(o,n,p,(t=>YD(t,o,i)||!(!d||t===a)&&YD(t,a,i)),!0);const g=n.map((t=>t.value));g.length<3&&s&&(g.length>1&&g.pop(),Ya(g)!==Ya(u)&&g.push(Ya(u))),u=g}return RE(u)},aO={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,s)=>!(s&&YD(i,t,e)||(i=t,0))))}};class oO extends fD{constructor(){super(...arguments),this.type=r.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new Zb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){var t,e;super.initScales();const i=[0,1];M(null===(t=this._domain)||void 0===t?void 0:t.min)&&(i[0]=this._domain.min),M(null===(e=this._domain)||void 0===e?void 0:e.max)&&(i[1]=this._domain.max),this._scale.domain(i)}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{breakData:(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)?()=>this._break:null})}_getUpdateAttribute(t){var e,i;const s=super._getUpdateAttribute(t);if(!Td(this._orient)&&(null===(i=null===(e=this._break)||void 0===e?void 0:e.breaks)||void 0===i?void 0:i.length)){const{width:t,height:e}=this.getLayoutRect(),i=Ad(this._orient),n=i?t:e;s.breaks=this._break.breaks.map((t=>{const{range:e,breakSymbol:s,gap:r=6}=t,a=this.valueToPosition((e[0]+e[1])/2)/n;let o;o=el(r)?Number(r.substring(0,r.length-1))/100:r/n;const l=Zo(null==s?void 0:s.angle)?s.angle:i?60:15;return{range:[a-o/2,a+o/2],breakSymbol:Object.assign(Object.assign({visible:!0},s),{angle:l*Math.PI/180}),rawRange:e}}))}return s}getNewScaleRange(){var t,e;let i=super.getNewScaleRange();return(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)&&(null===(e=this._break)||void 0===e?void 0:e.scope)&&(i=KP(this._break.scope).map((t=>i[0]+(Ya(i)-i[0])*t))),i}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,rO),t}}oO.type=r.cartesianLinearAxis,oO.specKey="axes",QA(oO,iO);const lO=()=>{PP(),HP(),gD(),Xl.registerComponent(oO.type,oO)};class hO extends JC{constructor(){super(...arguments),this.type=fl.line,this.transformerConstructor=kE,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},i=null!==(t=this._spec.seriesMark)&&void 0!==t?t:"line";this.initLineMark(e,"line"===i),this.initSymbolMark(e,"point"===i)}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initMarkStyle(){this.initLineMarkStyle(this._direction),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._lineMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("line"))||void 0===i?void 0:i(n,r),zC("line",this._spec,this._markAttributeContext))),this._symbolMark){const t=ZC(this);this._symbolMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),zC("point",this._spec,this._markAttributeContext),t))}}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){var e;const i="point"!==(null===(e=this._spec)||void 0===e?void 0:e.seriesMark);return e=>{var s,n;return i&&"fill"===e&&(e="stroke"),null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}hO.type=fl.line,hO.mark=sE,hO.transformerConstructor=kE,QA(hO,iE);const dO=(t,e)=>{var i;const s=t.spec,{regionId:n,regionIndex:r}=s;if(M(n)){const t=Fa(n);return null===(i=e.region)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Fa(r).map((t=>{var i;return null===(i=e.region)||void 0===i?void 0:i[t]})).filter(M)};class cO{constructor(t){this._option=t,this.type=t.type,this.seriesType=t.seriesType}initChartSpec(t){return this.transformSpec(t),this.transformModelSpec(t)}transformSpec(t){t.region&&0!==t.region.length||(t.region=[{}]),void 0===t.tooltip&&(t.tooltip={}),M(t.stackInverse)&&t.region.forEach((e=>{!M(e.stackInverse)&&(e.stackInverse=t.stackInverse)})),M(t.stackSort)&&t.region.forEach((e=>{!M(e.stackSort)&&(e.stackSort=t.stackSort)}))}transformModelSpec(t){return this.createSpecInfo(t,((e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})).transformSpec(n,t,s);zy(t,r,l.spec),zy(s,null!=a?a:r,Object.assign(Object.assign({},i),l))}))}createSpecInfo(t,e){var i,s;e||(e=(e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})),h=l.transformSpec(n,t,s);zy(s,null!=a?a:r,Object.assign(Object.assign(Object.assign({},i),h),{theme:l.getTheme(n,t)}))});const n={};return this.forEachRegionInSpec(t,e,n),this.forEachSeriesInSpec(t,e,n),null===(i=n.series)||void 0===i||i.forEach(((t,e)=>{var i,s;const r=(null!==(s=null!==(i=dO(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[])[0];r&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(e),t.regionIndexes=r.regionIndexes.slice())})),this.forEachComponentInSpec(t,e,n),Object.values(null!==(s=n.component)&&void 0!==s?s:{}).forEach((t=>t.forEach(((t,e)=>{var i,s,r;if(t){if(!t.regionIndexes){const e=null!==(s=null!==(i=dO(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[];t.regionIndexes=e.map((t=>t.regionIndexes[0]))}if(!t.seriesIndexes){const e=((t,e)=>{var i;const s=t.spec,{seriesId:n,seriesIndex:r}=s;if(M(n)){const t=Fa(n);return null===(i=e.series)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Fa(r).map((t=>{var i;return null===(i=e.series)||void 0===i?void 0:i[t]})).filter(M)})(t,n);if(e)t.seriesIndexes=e.map((({seriesIndexes:t})=>t[0]));else{const e=new Set;(null!==(r=t.regionIndexes)&&void 0!==r?r:[]).forEach((t=>{var i,s;const r=null===(i=n.region)||void 0===i?void 0:i[t];null===(s=null==r?void 0:r.seriesIndexes)||void 0===s||s.forEach((t=>e.add(t)))})),t.seriesIndexes=Array.from(e)}}}})))),n}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t){var e,i,s,n;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!==(e=t.animation)&&void 0!==e?e:this._option.animation,animationThreshold:null!==(i=t.animationThreshold)&&void 0!==i?i:null===(n=(s=this._option).getTheme)||void 0===n?void 0:n.call(s).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,animationState:t.animationState,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph,interactions:t.interactions}}forEachRegionInSpec(t,e,i){var s;return(null!==(s=t.region)&&void 0!==s?s:[]).map(((t,s)=>e(Xl.getRegionInType("region"),{spec:t,specPath:["region",s],type:"region",regionIndexes:[s]},i)))}forEachSeriesInSpec(t,e,i){var s;return(null!==(s=t.series)&&void 0!==s?s:[]).map(((t,s)=>e(Xl.getSeriesInType(t.type),{spec:t,specPath:["series",s],type:t.type,seriesIndexes:[s]},i)))}forEachComponentInSpec(t,e,i){var s,n,a;const o=[],l=Xl.getComponents();let h,d,c,u;const p=[];for(let e=0;e0&&(g=!0,s.forEach((t=>{const s=Xl.getComponentInKey(t.type);o.push(e(s,t,i))})))}if(d&&!g){const s=d.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(g=!0,s.forEach((t=>{const s=Xl.getComponentInKey(t.type);o.push(e(s,t,i))})))}return c&&!g&&(null===(n=c.getSpecInfo(t,i))||void 0===n||n.forEach((t=>{o.push(e(c,t,i))}))),p.forEach((s=>{var n;null===(n=s.getSpecInfo?s.getSpecInfo(t,i):KT(t,s.specKey,s.type))||void 0===n||n.forEach((t=>{o.push(e(s,t,i))}))})),u&&(null===(a=KT(t,u.specKey,u.type))||void 0===a||a.forEach((t=>{o.push(e(u,t,i))}))),o}transformSeriesSpec(t){const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}_findBandAxisBySeries(t,e,i){const s="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find((i=>{if(!s.includes(i.orient))return!1;if(M(i.seriesId)){if(Fa(i.seriesId).includes(null==t?void 0:t.id))return!0}else if(M(i.seriesIndex)){if(Fa(i.seriesIndex).includes(e))return!0}else if("band"===i.type)return!0;return!0}))}_applyAxisBandSize(t,e,i){const{barMaxWidth:s,barMinWidth:n,barWidth:r,barGapInGroup:a}=i;let o=!1;h(n)?(t.minBandSize=n,o=!0):h(r)?(t.minBandSize=r,o=!0):h(s)&&(t.minBandSize=s,o=!0),o&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:y(a)?a[a.length-1]:a})}}class uO extends cO{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{xField:t.xField,yField:t.yField,zField:t.zField,seriesField:t.seriesField,seriesStyle:t.seriesStyle,direction:t.direction,stack:t.stack,percent:t.percent,stackOffsetSilhouette:t.stackOffsetSilhouette,totalLabel:t.totalLabel,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e],this._transformAxisSpec(t)}_setDefaultXAxisSpec(t){return{orient:"bottom"}}_setDefaultYAxisSpec(t){return{orient:"left"}}_setDefaultZAxisSpec(t){return{orient:"z"}}_transformAxisSpec(t){if(this.needAxes()){t.axes||(t.axes=[]);const e={x:!1,y:!1,z:!1};t.axes.forEach((i=>{const{orient:s}=i;let n=null;"top"!==s&&"bottom"!==s||(e.x=!0,n=this._setDefaultXAxisSpec(t)),"left"!==s&&"right"!==s||(e.y=!0,n=this._setDefaultYAxisSpec(t)),"z"===s&&(e.z=!0,n=this._setDefaultZAxisSpec(t)),n&&Object.keys(n).forEach((t=>{D(i[t])&&(i[t]=n[t])})),$d(i,"trimPadding")&&Ll(i,xy(this.type,t))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t)),t.zField&&!e.z&&t.axes.push(this._setDefaultZAxisSpec(t))}}}class pO extends uO{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"line",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,lineLabel:t.lineLabel})}transformSpec(t){super.transformSpec(t),vy(t)}}class gO{get dataList(){return this._dataArr}constructor(t){this._dataArr=[],this._dataSet=t}parseData(t){this._dataArr=[];const e=Fa(t);for(let t=0;t{e.markRunning()})),this._dataValueForEach(s,((t,e)=>{Hp(e,t,i)})),0))}_dataValueForEach(t,e){t.forEach(((t,i)=>{if(t instanceof R)return;const s=this.getSeriesData(t.id,i);s&&e(t,s,i)}))}getSeriesData(t,e){if(!this._dataArr.length)return null;if("string"==typeof t){const e=this._dataArr.filter((e=>e.name===t));if(e[0])return e[0];gl(`no data matches dataId ${t}!`)}if("number"==typeof e){if(this._dataArr[e])return this._dataArr[e];gl(`no data matches dataIndex ${e}!`)}return this._dataArr[0]}}class mO{constructor(t,e){this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=t=>{const e=[];return this._scaleSpecMap.forEach(((i,s)=>{Qo(i.domain)&&i.domain.forEach((s=>{s.dataId===t&&s.fields.forEach((t=>{IT(e,[{key:t,operations:Qh(i.type)?["max","min"]:["values"]}])}))}))})),this._markAttributeScaleMap.forEach(((i,s)=>{const n=this.getScale(s);i.forEach((i=>{this._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&IT(e,[{key:i.field,operations:Qh(n.type)?["max","min"]:["values"]}])}))})),e},this._spec=t,this._chart=e,this._setAttrFromSpec()}_createFromSpec(t){if(!t.id)return null;let e=this._scaleMap.get(t.id);return e||(e="ordinal"===t.type&&"color"===t.id?ax("colorOrdinal"):ax(t.type)),e?(y(t.range)&&e.range(t.range),y(t.domain)&&(Qo(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}_setAttrFromSpec(){var t;if(!(null===(t=this._spec)||void 0===t?void 0:t.length))return;const e=new Map,i=new Map;this._spec.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._modelScaleSpecMap.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Im(t,this._spec))return e;e.change=!0;for(let i=0;it.id===s.id));if(!r.id)return e.reMake=!0,e;if(r.type!==s.type)return e.reMake=!0,e;if(!Im(r.specified,s.specified))return e.reMake=!0,e;s.range&&!Im(s.range,n.range())&&(n.range(s.range),e.reRender=!0),Qo(s.domain)?e.reRender=!0:Im(s.domain,n.domain())||(n.domain(s.domain),e.reRender=!0),this._scaleSpecMap.set(s.id,s)}return this._spec=t,e}registerModelScale(t){const e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}removeModelScale(t){this._modelScaleSpecMap.forEach((e=>{t(e)&&(this._modelScaleSpecMap.delete(e.id),this._scaleSpecMap.delete(e.id),this._scaleMap.delete(e.id))}))}getScale(t){return this._scaleMap.get(t)}getScaleSpec(t){return this._scaleSpecMap.get(t)}_getSeriesByRawDataId(t){const e=this._chart.getAllSeries();for(let i=0;i{const s=this._scaleMap.get(i);if(!s)return;if(!Qo(e.domain))return e.domain&&0!==e.domain.length||s.domain(t),void this._updateMarkScale(i,s,s.domain().slice());let n;n=Qh(e.type)?[null,null]:new Set,e.domain.forEach((t=>{const i=this._getSeriesByRawDataId(t.dataId);if(!i)return;const s=Qh(e.type);t.fields.forEach((t=>{const e=i.getRawDataStatisticsByField(t,s);e&&(s?(D(n[0])?n[0]=e.min:n[0]=Math.min(e.min,n[0]),D(n[1])?n[1]=e.max:n[1]=Math.max(e.max,n[1])):e.values.forEach((t=>{n.add(t)})))}))}));const r=n;Qh(e.type)||(n=Array.from(n)),s.domain(n),this._updateMarkScale(i,s,r)}))}_updateMarkScale(t,e,i){const s=this._markAttributeScaleMap.get(t);s&&0!==s.length&&s.forEach((t=>{if(!t.field||!t.markScale||t.markScale===e)return;if(D(t.changeDomain)||"none"===t.changeDomain||D(t.seriesId))return void(Qh(e.type)?t.markScale.domain(i):e.domain(Array.from(i)));const s=this._getSeriesBySeriesId(t.seriesId),n=Qh(e.type),r=s.getRawDataStatisticsByField(t.field,n);if(!jm(r))return"expand"===t.changeDomain?(n?(i[0]=Math.min(i[0],r.min),i[1]=Math.max(i[1],r.max)):(r.values.forEach((t=>{i.add(t)})),i=Array.from(i)),void t.markScale.domain(i)):void("replace"!==t.changeDomain||(n?t.markScale.domain([r.min,r.max]):t.markScale.domain(r.values)));Qh(e.type)?t.markScale.domain(i):e.domain(Array.from(i))}))}registerMarkAttributeScale(t,e){const i=this._scaleMap.get(t.scale);let s=this._markAttributeScaleMap.get(t.scale);s||(s=[],this._markAttributeScaleMap.set(t.scale,s));let n=i;return(D(t.field)||!D(t.changeDomain)&&"none"!==t.changeDomain&&!D(e))&&(n=i.clone()),s.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:n})),n}}var _O=function(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{var t;return null!==(t=this._series)&&void 0!==t?t:[]},this.getRegionsInIndex=t=>t&&0!==t.length?this._regions.filter(((e,i)=>t.includes(i))):[this._regions[0]],this.getAllRegions=()=>this._regions,this.getRegionsInIds=t=>t?this._regions.filter((e=>t.includes(e.id))):[],this.getRegionsInQuerier=t=>t?this._regions.filter(((e,i)=>Fa(t).some((t=>M(t.regionId)&&t.regionId===e.userId||t.regionIndex===i)))):this._regions,this.getRegionsInUserId=t=>{if(t)return this._regions.find((e=>e.userId===t))},this.getRegionsInUserIdOrIndex=(t,e)=>this.getAllRegions().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponents=()=>this._components,this.getSeriesInIndex=t=>t&&0!==t.length?this._series.filter(((e,i)=>t.includes(i))):[this._series[0]],this.getSeriesInIds=t=>t?this._series.filter((e=>t.includes(e.id))):[],this.getSeriesInUserId=t=>{if(t)return this._series.find((e=>e.userId===t))},this.getSeriesInUserIdOrIndex=(t,e)=>this.getAllSeries().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponentByIndex=(t,e)=>{const i=this._components.filter((e=>(e.specKey||e.type)===t));if(i&&0!==i.length)return i[e]},this.getComponentsByKey=t=>this._components.filter((e=>(e.specKey||e.type)===t)),this.getComponentByUserId=t=>{const e=this._components.find((e=>e.userId===t));if(e)return e},this.getComponentsByType=t=>this._components.filter((e=>e.type===t)),this._paddingSpec=nl(null!==(i=t.padding)&&void 0!==i?i:e.getTheme().padding),this._event=new Gd(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new gO(this._dataSet),this._modelOption=Object.assign(Object.assign({},e),{mode:this._option.mode,map:this._idMap,getChartLayoutRect:()=>this._layoutRect,getChartViewRect:()=>this._viewRect,getChart:()=>this,globalScale:this._globalScale,onError:null===(s=this._option)||void 0===s?void 0:s.onError,disableTriggerEvent:!0===(null===(n=this._option)||void 0===n?void 0:n.disableTriggerEvent),getSeriesData:this._chartData.getSeriesData.bind(this._chartData)}),this._spec=t}created(){this._transformer=new this.transformerConstructor(Object.assign(Object.assign({},this._option),{type:this.type,seriesType:this.seriesType})),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}init(){var t,e;null===(t=this._beforeInit)||void 0===t||t.call(this),this._regions.forEach((t=>t.init({}))),this._series.forEach((t=>t.init({}))),this._components.forEach((t=>t.init({dataSet:this._dataSet}))),this._initEvent(),null===(e=this._initStack)||void 0===e||e.call(this),this.reDataFlow()}reDataFlow(){this._series.forEach((t=>{var e;return null===(e=t.getRawData())||void 0===e?void 0:e.markRunning()})),this._series.forEach((t=>t.fillData())),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){const s={width:t,height:e};this._canvasRect=s,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}_createBackground(){const t=this._spec.background;if(!t||"object"!=typeof t||M(t.gradient))return;const e=aD(t,["x","y","width","height","x1","y1","image"]);e.background=t.image,this._backgroundMark=Xl.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},e),{x:()=>this._viewBox.x1,y:()=>this._viewBox.y1,width:()=>this._viewBox.x2-this._viewBox.x1,height:()=>this._viewBox.y2-this._viewBox.y1}))}_createRegion(t,e){if(!t)return;const{spec:i}=e,s=_O(e,["spec"]),n=new t(i,Object.assign(Object.assign({},this._modelOption),s));n&&(n.created(),this._regions.push(n))}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=_O(e,["spec"]);let n;if(M(i.regionId)?n=this.getRegionsInUserId(i.regionId):M(i.regionIndex)&&(n=this.getRegionsInIndex([i.regionIndex])[0]),!n&&!(n=this._regions[0]))return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{type:i.type,region:n,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));r&&(r.created(),this._series.push(r),n.addSeries(r))}getSeriesById(t){return this._series.find((e=>e.id===t))}_createComponent(t,e){const i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey,getComponentsByType:this.getComponentsByType}));i&&(i.created(),this._components.push(i))}getAllComponents(){return this._components}getAllModels(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}getModelInFilter(t){if(S(t))return this.getAllModels().find((e=>e.userId===t));if(xs(t))return this.getAllModels().find((e=>t(e)));let e=0;return this.getAllModels().find((i=>{var s;if((null!==(s=i.specKey)&&void 0!==s?s:i.type)===t.type){if(e===t.index)return!0;e++}return!1}))}_createLayout(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}setLayout(t){this._option.layout=t,this._initLayoutFunc()}_initLayoutFunc(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){let s=!1;(this._spec.zField||this._spec.series&&this._spec.series.some((t=>t.zField)))&&(s=!0);const n=Xl.getLayoutInKey(null!==(e=null===(t=this._spec.layout)||void 0===t?void 0:t.type)&&void 0!==e?e:s?"layout3d":"base");if(n){const t=new n(this._spec.layout,{onError:null===(i=this._option)||void 0===i?void 0:i.onError});this._layoutFunc=t.layoutItems.bind(t)}}}layout(t){var e,i,s,n;if(null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeLayoutWithSceneGraph)||void 0===i||i.call(e),this.getLayoutTag()){this._event.emit(zd.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart(t);const e=this.getLayoutElements();this._layoutFunc(this,e,this._layoutRect,this._viewBox),this._event.emit(zd.afterLayout,{elements:e,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(zd.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterLayoutWithSceneGraph)||void 0===n||n.call(s)}onLayoutStart(t){this.getAllModels().forEach((e=>e.onLayoutStart(this._layoutRect,this._viewRect,t)))}onLayoutEnd(t){this.getAllModels().forEach((e=>{"series"!==e.modelType&&e.onLayoutEnd(t)}))}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach((e=>e.onEvaluateEnd(t)))}getLayoutElements(){return this.getAllModels().map((t=>t.layout)).filter((t=>!!t))}getModelById(t){const e=this._idMap.get(t);if(e&&e instanceof Ny)return e}getModelByUserId(t){const e=this.getSeriesInUserId(t);if(e)return e;const i=this.getRegionsInUserId(t);return i||(this.getComponentByUserId(t)||void 0)}getAllMarks(){return Array.from(this._idMap.values()).filter((t=>t&&t instanceof yx))}getMarkById(t){const e=this._idMap.get(t);if(e&&e instanceof yx)return e}updateData(t,e,i=!0,s){const n=this._dataSet.getDataView(t);n&&(n.markRunning(),n.parseNewData(e,s)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}updateFullData(t,e=!0){Fa(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&e.markRunning()})),Fa(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&Hp(e,t,!0)})),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}onRender(t){}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=yy(this._spec,this._option,{width:rh,height:ah})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t;const e=this._spec.scales?[...this._spec.scales]:[];let i=e.find((t=>"color"===t.id));const s=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){const t=this._spec.color;if(y(t))i.range=t;else{const e=t;Object.prototype.hasOwnProperty.call(e,"type")&&(i.type=e.type),Object.prototype.hasOwnProperty.call(e,"domain")&&(i.domain=e.domain),Object.prototype.hasOwnProperty.call(e,"range")&&(i.range=e.range),Object.prototype.hasOwnProperty.call(e,"specified")&&(i.specified=e.specified)}}return(null===(t=i.range)||void 0===t?void 0:t.length)||(i.range=Sl(s),i.rangeTheme=!0),e}_createGlobalScale(){this._globalScale=new mO(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){const t=new Set;this._series.forEach((e=>{const i=e.getSeriesKeys();i&&i.forEach((e=>t.add(e)))}));const e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){by(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){const t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=Sl(e),this._globalScale.getScale("color").range(t.range))}_getSpecKeys(t){const e={width:!0,height:!0};return Object.keys(t).filter((t=>!e[t])).sort()}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;const i=this._getSpecKeys(this._spec);if(!Im(i,this._getSpecKeys(t)))return e.reMake=!0,e;for(let s=0;s{by(t,e.updateSpec(this._spec.region[e.getSpecIndex()]))})):t.reMake=!0)}updateComponentSpec(t){const e={},i={[r.title]:!0,[r.brush]:!0,[r.mapLabel]:!0};this._components.forEach((s=>{var n,a;if(s.type===r.label||s.type===r.totalLabel)return;i[s.type]&&(i[s.type]=!1);const o=s.specKey||s.type,l=null!==(n=this._spec[o])&&void 0!==n?n:{};y(l)?(e[o]=e[o]||{specCount:l.length,componentCount:0},e[o].componentCount++,by(t,s.updateSpec(null!==(a=l[s.getSpecIndex()])&&void 0!==a?a:{},l))):by(t,s.updateSpec(l))}));for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];s.componentCount!==s.specCount&&(t.reMake=!0)}const s=t=>t&&!1!==t.visible;Object.keys(i).forEach((e=>{if(i[e]){const i=this._spec[e];(y(i)?i.some(s):s(i))&&(t.reMake=!0)}}))}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach((e=>{const i=this._spec.series[e.getSpecIndex()];by(t,e.updateSpec(i))})):t.reMake=!0}getCanvas(){var t,e;return null!==(e=null===(t=this.getCompiler())||void 0===t?void 0:t.getCanvas())&&void 0!==e?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;const{x1:i=0,y1:s=0,x2:n,y2:r}=t;e={width:n-i,height:r-s}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=sl(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(zd.layoutRectUpdate,{chart:this})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}reInit(){[...this._regions,...this._series,...this._components].forEach((t=>{const e=t.getSpecInfo();e&&e.spec&&t.reInit(e.spec)}))}clear(){this.getAllModels().forEach((t=>{var e;return null===(e=t.clear)||void 0===e?void 0:e.call(t)}))}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllSeries().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllComponents().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)}))}compileLayout(){const{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){var t;this._backgroundMark&&(this._backgroundMark.compile({context:{model:this}}),null===(t=this._backgroundMark.getProduct())||void 0===t||t.layout((()=>{})))}compileRegions(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeRegionCompile)||void 0===e||e.call(t),this.getAllRegions().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterRegionCompile)||void 0===s||s.call(i)}compileSeries(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeSeriesCompile)||void 0===e||e.call(t),this.getAllSeries().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterSeriesCompile)||void 0===s||s.call(i)}compileComponents(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeComponentCompile)||void 0===e||e.call(t),this.getAllComponents().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterComponentCompile)||void 0===s||s.call(i)}release(){[...this._components,...this._regions,...this._series].forEach((t=>{t.beforeRelease()})),super.release(),this.clear(),[...this._components,...this._regions,...this._series].forEach((t=>{t.release()})),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}onLayout(t){const e=t.rootMark;this.layout({group:e,srView:t})}updateState(t,e){const i=this.getAllSeries();for(const s in t){if(jm(t[s]))continue;const n=t[s];let r={stateValue:s};r=xs(n.filter)?Object.assign({filter:n.filter},r):Object.assign(Object.assign({},n.filter),r),n.level&&(r.level=n.level),i.forEach((t=>{t.getMarks().forEach((i=>{i.stateStyle[s]&&(e&&!e(t,i,s)||(i.state.changeStateInfo(r),i.updateMarkState(s)))}))}))}}setSelected(t,e,i){this._setStateInDatum(Sy.STATE_SELECTED,!0,t,e,i)}setHovered(t,e,i){this._setStateInDatum(Sy.STATE_HOVER,!0,t,e,i)}clearState(t){this.getAllRegions().forEach((e=>{e.interaction.clearEventElement(t,!0),e.interaction.resetInteraction(t,null)}))}clearAllStates(){this.getAllRegions().forEach((t=>{t.interaction.clearAllEventElement(),t.interaction.resetAllInteraction()}))}clearSelected(){this.clearState(Sy.STATE_SELECTED)}clearHovered(){this.clearState(Sy.STATE_HOVER)}_initEvent(){[zd.dataZoomChange,zd.scrollBarChange].forEach((t=>{this._event.on(t,(({value:t})=>{this._disableMarkAnimation(["exit","update"]);const e=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(hc.AFTER_MARK_RENDER_END,e)};this._event.on(hc.AFTER_MARK_RENDER_END,e)}))}))}_enableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)}))}_disableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)}))}_setStateInDatum(t,e,i,s,n){const r=(i=i?Fa(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(n).forEach((n=>{i?(n.getSeries().forEach((e=>{e.getMarks().forEach((a=>{if(a.getProduct()&&(!s||xs(s)&&s(e,a))){const e=a.getProduct().isCollectionMark(),s=a.getProduct().elements;let o=[];if(e)o=s.filter((t=>{const e=t.getDatum();i.every(((t,i)=>r.every((s=>t[s]==e[i][s]))))}));else if(i.length>1){const t=i.slice();o=s.filter((e=>{if(0===t.length)return!1;const i=e.getDatum(),s=t.findIndex((t=>r.every((e=>t[e]==i[e]))));return s>=0&&(t.splice(s,1),!0)}))}else{const t=s.find((t=>r.every((e=>i[0][e]==t.getDatum()[e]))));t&&(o=[t])}o.forEach((e=>{n.interaction.startInteraction(t,e)}))}}))})),e&&n.interaction.reverseEventElement(t)):n.interaction.clearEventElement(t,!0)}))}setDimensionIndex(t,e){var i,s,n,a;let o=null;Array.from(this._event.getComposedEventMap().values()).forEach((i=>{const{eventType:s,event:n}=i;if(s===Kh.dimensionHover||s===Kh.dimensionClick){const i=n.dispatch(t,e);(null==i?void 0:i.length)&&(o=i)}}));const l=D(t)||!o||o.every((t=>ed(t.axis.getScale().type)&&D(t.index)));if(!1!==e.tooltip){const t=this.getComponentsByType(r.tooltip)[0];if(null==t?void 0:t.getVisible())if(l)null===(s=(i=t).hideTooltip)||void 0===s||s.call(i);else{const i={};o.forEach((t=>{const{axis:e,value:s,data:n}=t,r="left"===e.getOrient()||"right"===e.getOrient();n.forEach((t=>{var e,n,a;const o=r?t.series.fieldY[0]:t.series.fieldX[0];i[o]=null!==(a=null===(n=null===(e=t.datum)||void 0===e?void 0:e[0])||void 0===n?void 0:n[o])&&void 0!==a?a:s}))})),t.showTooltip(i,e.showTooltipOption)}}if(!1!==e.crosshair){const t=this.getComponentsByType(r.cartesianCrosshair)[0];t&&t.clearAxisValue&&t.setAxisValue&&(l?(null===(n=t.clearAxisValue)||void 0===n||n.call(t),null===(a=t.hide)||void 0===a||a.call(t)):o.forEach((e=>{const{axis:i,value:s}=e;t.clearAxisValue(),t.setAxisValue(s,i),t.layoutByValue()})))}}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}}const vO=(t,e)=>{const i={nodes:{}},{fields:s}=e;if(!(null==s?void 0:s.length))return i;const n=s.length-1;let r,a,o=i;return t.forEach((t=>{t.latestData&&t.latestData.forEach((t=>{o=i;for(let e=0;e{var e;const i=t.getSeries();if(!i.some((t=>t.getStack())))return;const s=i.some((t=>{var e,i;return null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.totalLabel)||void 0===i?void 0:i.visible})),n=s||i.some((t=>t.getPercent())),r=i.some((t=>t.getStackOffsetSilhouette())),a=jT(t,!0);for(const e in a)for(const i in a[e].nodes)VT(a[e].nodes[i],t.getStackInverse(),n,s);if(r)for(const t in a)for(const e in a[t].nodes)NT(a[t].nodes[e]);s&&t.getSeries().forEach((t=>{const e=t.getStackData(),i=t.getStackValue(),s=t.getStackValueField();e&&s&&zT(a[i],s)})),(null===(e=this._options)||void 0===e?void 0:e.afterStackRegion)&&this._options.afterStackRegion(t,a)},this._chart=t,this._options=e}init(){this._chart.getAllRegions().forEach((t=>{t.event.on(zd.regionSeriesDataFilterOver,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},this.stackRegion)}))}stackAll(){this._chart.getAllRegions().forEach((t=>{this.stackRegion({model:t})}))}}class bO{_beforeInit(){this._dataSet&&Cp(this._dataSet,"stackSplit",vO)}_initStack(){this._stack=new yO(this),this._stack.init()}}class xO extends fO{constructor(){super(...arguments),this.transformerConstructor=pO,this.type="line",this.seriesType=fl.line}}xO.type="line",xO.seriesType=fl.line,xO.transformerConstructor=pO,QA(xO,bO);class SO extends nE{constructor(){super(...arguments),this.type=SO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getIgnoreAttributes(){return[]}}SO.type="area";const MO=()=>{Xl.registerMark(SO.type,SO),Mx(),PS(),fc.registerGraphic(Qd.area,SS),FA(),jA(),FC()};class kO extends iL{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var s,n,r,a;for(const i of Fa(e)){let e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(!1!==e||"fill"!==i&&"stroke"!==i||(e="fill"===i?null===(r=null===(n=this.series.getSeriesStyle(t))||void 0===n?void 0:n("stroke"))||void 0===r?void 0:r[0]:null===(a=this.series.getSeriesStyle(t))||void 0===a?void 0:a("fill")),M(e))return e}return i}}}const AO=Object.assign(Object.assign(Object.assign({},mL),eE),{area:{name:"area",type:"area"}});class wO extends kE{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){var e,i,s;super._transformLabelSpec(t),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0),!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)||this._addMarkLabelSpec(t,"area")}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o;super._transformSpecAfterMergingTheme(t,e,i);const{area:l={},line:h={},seriesMark:d}=t,c=!1!==l.visible&&!1!==(null===(s=l.style)||void 0===s?void 0:s.visible),u=!1!==h.visible&&!1!==(null===(n=h.style)||void 0===n?void 0:n.visible);l.support3d=!(!l.support3d&&!h.support3d),l.zIndex=M(l.zIndex)||M(h.zIndex)?Math.max(null!==(r=l.zIndex)&&void 0!==r?r:0,null!==(a=h.zIndex)&&void 0!==a?a:0):void 0,l.style&&delete l.style.stroke,l.state&&Object.keys(l.state).forEach((t=>{"style"in l.state[t]?delete l.state[t].style.stroke:delete l.state[t].stroke}));let p=l,g=h;("line"===d||u&&!c)&&(p=h,g=l),l.style=Ll({},g.style,p.style),l.state=Ll({},g.state,p.state),c||(l.style.fill=!1),u||(l.style.stroke=!1),!1===l.interactive&&(l.style.fillPickable=!1),!1===h.interactive&&(h.style.strokePickable=!1),l.interactive=!(!l.interactive&&null!==(o=h.interactive)&&void 0!==o&&!o),l.visible=!(!c&&!u),t.area=l,t.line=h}}class TO extends JC{constructor(){super(...arguments),this.type=fl.area,this.transformerConstructor=wO,this._sortDataByAxis=!1}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},s=this._spec.area||{},n=!1!==s.visible&&!1!==(null===(t=s.style)||void 0===t?void 0:t.visible),r=null!==(e=this._spec.seriesMark)&&void 0!==e?e:"area";this._areaMark=this._createMark(TO.mark.area,{groupKey:this._seriesField,defaultMorphElementKey:this.getDimensionField()[0],progressive:i,isSeriesMark:n&&"point"!==r,customShape:s.customShape,stateSort:s.stateSort}),this.initSymbolMark(i,"point"===r)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){var t,e,i,s,n;const r=null!==(i=null===(e=null===(t=this.getSpec().area)||void 0===t?void 0:t.style)||void 0===e?void 0:e.curveType)&&void 0!==i?i:null===(n=null===(s=this.getSpec().line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.curveType,a=r===QC?"horizontal"===this._direction?"monotoneY":"monotoneX":r,o=this._areaMark;o&&("horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:t=>{var e,i;return ox(this.dataToPositionX1(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",Oy.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:t=>{var e,i;return ox(this.dataToPositionY1(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Oy.Series),this.setMarkStyle(o,{fill:this.getColorAttribute(),stroke:this.getColorAttribute()},"normal",Oy.Series),"zero"!==this._invalidType&&this.setMarkStyle(o,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Oy.Series),this.setMarkStyle(o,{curveType:a},"normal",Oy.Built_In),Object.keys(o.stateStyle).forEach((t=>{o.stateStyle[t].stroke&&o.setPostProcess("stroke",(t=>[t,!1,!1,!1]),t)})))}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("line"))||void 0===e?void 0:e(n,r),zC("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("area"))||void 0===i?void 0:i(n,r),zC("area",this._spec,this._markAttributeContext))),this._symbolMark){const t=ZC(this);this._symbolMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),zC("point",this._spec,this._markAttributeContext),t))}}initTooltip(){this._tooltipHelper=new kO(this);const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._areaMark&&t.add(this._areaMark),this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,s,n,r,a;const o=null!==(i=this._spec.seriesMark)&&void 0!==i?i:"area";let l=null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0;return"fill"!==e||l&&"line"!==o||(e="stroke",l=null!==(a=null===(r=this._seriesMark)||void 0===r?void 0:r.getAttribute(e,t))&&void 0!==a?a:void 0),"stroke"===e&&y(l)?l[0]:l}}}TO.type=fl.area,TO.mark=AO,TO.transformerConstructor=wO,QA(TO,iE);class LO extends uO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,area:t.area,seriesMark:t.seriesMark,activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,areaLabel:t.areaLabel})}transformSpec(t){super.transformSpec(t),vy(t)}}class CO extends fO{constructor(){super(...arguments),this.transformerConstructor=LO,this.type="area",this.seriesType=fl.area}}function EO(t,e=!0){return(i,s,n)=>{const r="vertical"===t.direction?t.yField:t.xField,a=null==i?void 0:i[r];return"vertical"===t.direction?{overall:e?t.growFrom():e,orient:a>0?"negative":"positive"}:{overall:!!e&&t.growFrom(),orient:a>0?"positive":"negative"}}}CO.type="area",CO.seriesType=fl.area,CO.transformerConstructor=LO,QA(CO,bO);const DO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:EO(t,e)}),PO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:EO(t,e)}),OO={type:"fadeIn"},RO={type:"growCenterIn"};function BO(t,e){if(!1===e)return{};switch(e){case"fadeIn":return OO;case"scaleIn":return RO;default:return DO(t)}}class IO extends yx{constructor(){super(...arguments),this.type=IO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}IO.type="rect";const FO=()=>{Xl.registerMark(IO.type,IO),VA(),BC()},YO=Object.assign(Object.assign({},mL),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),jO=Object.assign(Object.assign({},mL),{bar3d:{name:"bar3d",type:"rect3d"}});function HO(t,e,i){var s,n;if(t.values.length>0){let r;if(t.sortDatums.length){let a=t.sortDatums;e&&(a=t.sortDatums.slice().reverse());for(let t=0;t{var a,o;const l=null===(o=(a=t[i.axisHelper]).getScale)||void 0===o?void 0:o.call(a,0);for(let a=0;athis._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[_L]):this._spec.barMinHeight?this._calculateRectPosition(t,!1):ox(this._dataToPosX(t),e),this._getBarXEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[fL]):ox(this._dataToPosX1(t),e),this._getBarYStart=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[vL]):this._spec.barMinHeight?this._calculateRectPosition(t,!0):ox(this._dataToPosY(t),e),this._getBarYEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[yL]):ox(this._dataToPosY1(t),e),this._getBarBackgroundXStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundXEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundYStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundYEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundPositionXEncoder=()=>{var t;return null===(t=this._barBackgroundPositionXEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionXEncoder=t=>{this._barBackgroundPositionXEncoder=t.bind(this)},this._getBarBackgroundPositionYEncoder=()=>{var t;return null===(t=this._barBackgroundPositionYEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionYEncoder=t=>{this._barBackgroundPositionYEncoder=t.bind(this)}}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._initBarBackgroundMark(i),this._barMark=this._createMark(Object.assign(Object.assign({},VO.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{morph:WC(this._spec,this._barMarkName),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,progressive:i,customShape:null===(t=this._spec.bar)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.bar)||void 0===e?void 0:e.stateSort})}_initBarBackgroundMark(t){this._spec.barBackground&&this._spec.barBackground.visible&&(this._barBackgroundMark=this._createMark(VO.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId(),progressive:t,customShape:this._spec.barBackground.customShape,stateSort:this._spec.barBackground.stateSort}))}initMarkStyle(){this._barMark&&this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",Oy.Series)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initTooltip(){super.initTooltip();const{mark:t,group:e}=this._tooltipHelper.activeTriggerSet;this._barMark&&(t.add(this._barMark),e.add(this._barMark))}_statisticViewData(){var t,e;super._statisticViewData();const i=null!==(t=this._spec.barBackground)&&void 0!==t?t:{};if(!i.visible)return;const s=this._getRelatedComponentSpecInfo("axes").some((t=>t.type===r.cartesianBandAxis));let n;if(Cp(this._option.dataSet,"addVChartProperty",GT),s){const t=([t],{scaleDepth:e})=>{var i,s;let n=[{}];const r=this.getDimensionField(),a=D(e)?r.length:Math.min(r.length,e);for(let e=0;e{const i=[],[s,n]=this.getDimensionContinuousField(),r={};return e.latestData.forEach((t=>{const e=`${t[s]}-${t[n]}`;r[e]||(r[e]={[s]:t[s],[n]:t[n]},i.push(r[e]))})),i};Cp(this._option.dataSet,"dimensionItems",t);const e=this.getViewData();n=new R(this._option.dataSet).parse([e],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:cL.bind(this),call:uL}},!1),null==e||e.target.addListener("change",n.reRunAllTransform)}this._barBackgroundViewData=new oL(this._option,n)}init(t){var e,i;super.init(t),"vertical"===this.direction?"band"===(null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():"band"===(null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){const t=this.getRegion();return this.getStack()&&t.getSeries().filter((t=>t.type===this.type&&t.getSpec().barMinHeight)).length}_calculateStackRectPosition(t){const e=this.getRegion();if(e._bar_series_position_calculated)return;let i,s,n,r,a;e._bar_series_position_calculated=!0,t?(i=yL,s=vL,n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(i=fL,s=_L,n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=jT(e,!1,(t=>t.type===this.type));for(const l in o)for(const h in o[l].nodes)HO(o[l].nodes[h],e.getStackInverse(),{isVertical:t,start:i,end:s,startMethod:n,endMethod:r,axisHelper:a})}_calculateRectPosition(t,e){var i,s;let n,r,a;e?(n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=null===(s=(i=this[a]).getScale)||void 0===s?void 0:s.call(i,0),l=this[a].isInverse(),h=this._spec.barMinHeight,d=ox(this[n](t),o),c=ox(this[r](t),o);let u=Math.abs(d-c);uthis._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n),y:t=>this._getPosition(this.direction,t),height:()=>this._getBarWidth(this._yAxisHelper),width:()=>{},y1:()=>{}},"normal",Oy.Series):this.setMarkStyle(this._barMark,{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r),x:t=>this._getPosition(this.direction,t),width:()=>this._getBarWidth(this._xAxisHelper),x1:()=>{},height:()=>{}},"normal",Oy.Series),this._initStackBarMarkStyle(),this._initBandBarBackgroundMarkStyle()}_initStackBarMarkStyle(){var t,e,i,s;if(!this._spec.stackCornerRadius)return;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);this._barMark.setClip((()=>{const t=[];return this._forEachStackGroup((e=>{let i=1/0,s=-1/0,a=!1,o=1/0,l=-1/0;e.values.forEach((t=>{const e=t[kT],n=t[AT],r=t[wT],h=t[TT];i=Math.min(i,e,n),s=Math.max(s,e,n),M(r)&&M(h)&&(a=!0,o=Math.min(o,r,h),l=Math.max(l,r,h))}));const h=Object.assign(Object.assign(Object.assign({},e.values[0]),{[kT]:i,[AT]:s}),a?{[wT]:o,[TT]:l}:void 0),d="horizontal"===this.direction?{x:this._getBarXStart(h,n),x1:this._getBarXEnd(h,n),y:this._getPosition(this.direction,h),height:this._getBarWidth(this._yAxisHelper)}:{y:this._getBarYStart(h,r),y1:this._getBarYEnd(h,r),x:this._getPosition(this.direction,h),width:this._getBarWidth(this._xAxisHelper)};t.push(qv(Object.assign(Object.assign({},d),{cornerRadius:xs(this._spec.stackCornerRadius)?this._spec.stackCornerRadius(d,h,this._markAttributeContext):this._spec.stackCornerRadius,fill:!0})))})),t}))}initLinearRectMarkStyle(){var t,e,i,s;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);if("horizontal"===this.direction){const t=M(this._fieldY2)?{y:t=>ox(this._dataToPosY(t),r),y1:t=>ox(this._dataToPosY1(t),r)}:{y:t=>ox(this._dataToPosY(t)-this._getBarWidth(this._yAxisHelper)/2,r),height:t=>this._getBarWidth(this._yAxisHelper)};this.setMarkStyle(this._barMark,Object.assign({x:t=>this._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n)},t),"normal",Oy.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign({x:()=>this._getBarBackgroundXStart(n),x1:()=>this._getBarBackgroundXEnd(n)},t),"normal",Oy.Series)}else{const t=M(this._fieldX2)?{x:t=>ox(this._dataToPosX(t),n),x1:t=>ox(this._dataToPosX1(t),n)}:{x:t=>ox(this._dataToPosX(t)-this._getBarWidth(this._xAxisHelper)/2,n),width:t=>this._getBarWidth(this._xAxisHelper)};this.setMarkStyle(this._barMark,Object.assign(Object.assign({},t),{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r)}),"normal",Oy.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign(Object.assign({},t),{y:()=>this._getBarBackgroundYStart(r),y1:()=>this._getBarBackgroundYEnd(r)}),"normal",Oy.Series)}}_initBandBarBackgroundMarkStyle(){var t,e,i,s,n;if(!this._barBackgroundMark)return;const r=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),a=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0),o=null!==(n=this._spec.barBackground)&&void 0!==n?n:{},l=D(o.fieldLevel)?void 0:o.fieldLevel+1;"horizontal"===this.direction?this.setMarkStyle(this._barBackgroundMark,{x:()=>this._getBarBackgroundXStart(r),x1:()=>this._getBarBackgroundXEnd(r),y:t=>this._getPosition(this.direction,t,l,"barBackground"),height:()=>this._getBarWidth(this._yAxisHelper,l),width:()=>{},y1:()=>{}},"normal",Oy.Series):this.setMarkStyle(this._barBackgroundMark,{x:t=>this._getPosition(this.direction,t,l,"barBackground"),y:()=>this._getBarBackgroundYStart(a),y1:()=>this._getBarBackgroundYEnd(a),width:()=>this._getBarWidth(this._xAxisHelper,l),x1:()=>{},height:()=>{}},"normal",Oy.Series)}initAnimation(){var t,e;const i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},s=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset,n=ZC(this);this._barMark.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("bar"))||void 0===e?void 0:e(i,s),zC(this._barMarkName,this._spec,this._markAttributeContext),n))}_getBarWidth(t,e){var i,s;const n=this._groups?this._groups.fields.length:1,r=D(e)?n:Math.min(n,e),a=null!==(s=null===(i=t.getBandwidth)||void 0===i?void 0:i.call(t,r-1))&&void 0!==s?s:6,o=M(this._spec.barWidth)&&r===n,l=M(this._spec.barMinWidth),h=M(this._spec.barMaxWidth);let d=a;return o&&(d=al(this._spec.barWidth,a)),l&&(d=Math.max(d,al(this._spec.barMinWidth,a))),h&&(d=Math.min(d,al(this._spec.barMaxWidth,a))),d}_getPosition(t,e,i,s){var n,r,a,o,l;let h,d,c;"horizontal"===t?(h=this.getYAxisHelper(),d="height",c="barBackground"===s?this.dataToBarBackgroundPositionY.bind(this):this.dataToPositionY.bind(this)):(h=this.getXAxisHelper(),d="width",c="barBackground"===s?this.dataToBarBackgroundPositionX.bind(this):this.dataToPositionX.bind(this));const u=h.getScale(0),p=this._groups?this._groups.fields.length:1,g=D(i)?p:Math.min(p,i),m=null!==(r=null===(n=h.getBandwidth)||void 0===n?void 0:n.call(h,g-1))&&void 0!==r?r:6,_=g===p?this._barMark.getAttribute(d,e):m;if(g>1&&M(this._spec.barGapInGroup)){const t=this._groups.fields,i=Fa(this._spec.barGapInGroup);let s=0,n=0;for(let r=t.length-1;r>=1;r--){const d=t[r],c=null!==(o=null===(a=h.getScale(r))||void 0===a?void 0:a.domain())&&void 0!==o?o:[],u=c.length,p=al(null!==(l=i[r-1])&&void 0!==l?l:Ya(i),m),g=c.indexOf(e[d]);r===t.length-1?(s+=u*_+(u-1)*p,n+=g*(_+p)):(n+=g*(s+p),s+=s+(u-1)*p)}return u.scale(e[t[0]])+h.getBandwidth(0)/2-s/2+n}const f=Qh(u.type||"band");return c(e,g)+.5*(m-_)+(f?-m/2:0)}dataToBarBackgroundPositionX(t,e){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,e,this._getBarBackgroundPositionXEncoder,this._setBarBackgroundPositionXEncoder)}dataToBarBackgroundPositionY(t,e){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,e,this._getBarBackgroundPositionYEncoder,this._setBarBackgroundPositionYEncoder)}onLayoutEnd(t){super.onLayoutEnd(t),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}compile(){if(super.compile(),this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),null===(t=this._barBackgroundViewData)||void 0===t||t.compile()}fillData(){var t,e;super.fillData(),null===(e=null===(t=this._barBackgroundViewData)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._barBackgroundViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._barBackgroundViewData)||void 0===s||s.updateData()}release(){var t;super.release(),null===(t=this._barBackgroundViewData)||void 0===t||t.release(),this._barBackgroundViewData=null}}VO.type=fl.bar,VO.mark=YO,VO.transformerConstructor=NO;const WO=()=>{SE(),FO(),Xl.registerAnimation("bar",((t,e)=>({appear:BO(t,e),enter:DO(t,!1),exit:PO(t,!1),disappear:PO(t)}))),XP(),lO(),Xl.registerSeries(VO.type,VO)};class GO extends uO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barMinHeight:t.barMinHeight,sampling:t.sampling,samplingFactor:t.samplingFactor,barBackground:t.barBackground,stackCornerRadius:t.stackCornerRadius})}transformSpec(t){super.transformSpec(t),vy(t)}_transformAxisSpec(t){var e,i;if(super._transformAxisSpec(t),!t.axes)return;const s=t.series.some((t=>"horizontal"===t.direction)),n=null!==(e=t.axes.find((t=>"band"===t.type)))&&void 0!==e?e:t.axes.find((t=>(s?["left","right"]:["top","bottom"]).includes(t.orient)));if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize&&t.autoBandSize){const e=bs(t.autoBandSize)&&null!==(i=t.autoBandSize.extend)&&void 0!==i?i:0,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o}=t.series.find((t=>"bar"===t.type));this._applyAxisBandSize(n,e,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}class UO extends fO{constructor(){super(...arguments),this.transformerConstructor=GO,this.type="bar",this.seriesType=fl.bar}}UO.type="bar",UO.seriesType=fl.bar,UO.transformerConstructor=GO,QA(UO,bO);class $O extends yx{constructor(){super(...arguments),this.type=$O.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}}$O.type="rect3d";const XO=()=>{Xl.registerMark($O.type,$O),Mx(),YM(),fc.registerGraphic(Qd.rect3d,EM),BC()};class KO extends VO{constructor(){super(...arguments),this.type=fl.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d"}}KO.type=fl.bar3d,KO.mark=jO;const qO=()=>{Xl.registerAnimation("bar3d",((t,e)=>({appear:BO(t,e),enter:DO(t,!1),exit:PO(t,!1),disappear:PO(t)}))),XO(),XP(),lO(),Xl.registerSeries(KO.type,KO)};class ZO extends GO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup})}}class JO{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=B.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 s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/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,s.set3dOptions(this.option3d),s.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 QO=()=>{Kx(),Zx(),Cg.registerPlugin("ViewTransform3dPlugin",JO)};class tR extends UO{constructor(){super(...arguments),this.transformerConstructor=ZO,this.type="bar3d",this.seriesType=fl.bar3d}}tR.type="bar3d",tR.seriesType=fl.bar3d,tR.transformerConstructor=ZO;const eR=[10,20],iR=qh.Linear,sR="circle",nR=qh.Ordinal,rR=["circle","square","triangle","diamond","star"],aR=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"},oR=Object.assign(Object.assign({},mL),{point:{name:"point",type:"symbol"}});class lR extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class hR extends JC{constructor(){super(...arguments),this.type=fl.scatter,this.transformerConstructor=lR,this._invalidType="zero"}setAttrFromSpec(){super.setAttrFromSpec(),this._size=this._spec.size,this._sizeField=this._spec.sizeField,this._shape=this._spec.shape,this._shapeField=this._spec.shapeField}_getSeriesAttribute(t,e,{defaultScaleType:i,defaultRange:s},n){var r,a,o,l;if(xs(e))return e;if(y(e)){if(D(t))return null===(r=this._option)||void 0===r||r.onError(`${n}Field is required.`),e;if("ordinal"!==i&&e.length>2)return null===(a=this._option)||void 0===a||a.onError(`${n} length is invalid, specify up to 2 ${n}s.`),e;const s=`${nh}_series_scatter_${this.id}_scale_${n}`;return this._option.globalScale.registerModelScale({id:s,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:s,field:t}}if(bs(e)){if(D(t))return null===(o=this._option)||void 0===o||o.onError(`${n}Field is required.`),e;const r=`${nh}_series_scatter_${this.id}_scale_${n}`,a=Object.assign({id:r,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:s},e);return this._option.globalScale.registerModelScale(a),{scale:a.id,field:t}}return null===(l=this._option)||void 0===l||l.onError(`${n} attribute is invalid.`),e}getSizeAttribute(t,e){return D(e)?10:h(e)?e:!S(e)||("string"!=typeof(i=e)||isNaN(Number(i))||isNaN(parseFloat(i)))?this._getSeriesAttribute(t,e,{defaultScaleType:iR,defaultRange:eR},"size"):parseFloat(e);var i}getShapeAttribute(t,e){return D(e)?sR:S(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:nR,defaultRange:rR},"shape")}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._symbolMark=this._createMark(hR.mark.point,{morph:WC(this._spec,hR.mark.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:i,isSeriesMark:!0,customShape:null===(t=this._spec.point)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.point)||void 0===e?void 0:e.stateSort})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;const s=ZC(this),n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._symbolMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("scatter"))||void 0===i?void 0:i({},n),zC("point",this._spec,this._markAttributeContext),s))}initSymbolMarkStyle(){const t=this._symbolMark;t&&("zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,fill:this.getColorAttribute(),size:h(this._size)||xs(this._size)?this._size:10,symbolType:S(this._shape)||xs(this._shape)?this._shape:sR},Sy.STATE_NORMAL,Oy.Series),(M(this._sizeField)||M(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},Sy.STATE_NORMAL,Oy.User_Mark),(M(this._shapeField)||M(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},Sy.STATE_NORMAL,Oy.User_Mark))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);const e=[this.getDimensionField()[0],this.getStackValueField()].every((t=>{var e,i,s;return t&&(null===(s=null===(i=null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[t])||void 0===s?void 0:s.allValid)}));"zero"===this._invalidType||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",Oy.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined.bind(this)},"normal",Oy.Series),this._symbolMark.getProduct()&&this._symbolMark.compileEncode()}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null},Sy.STATE_NORMAL,Oy.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},Sy.STATE_NORMAL,Oy.Series))}handleZoom(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}handlePan(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}hR.type=fl.scatter,hR.mark=oR,hR.transformerConstructor=lR;class dR extends uO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,size:t.size,sizeField:t.sizeField,shape:t.shape,shapeField:t.shapeField})}}class cR extends fO{constructor(){super(...arguments),this.transformerConstructor=dR,this.type="scatter",this.seriesType=fl.scatter}}function uR(){var t,e=[];return{point:function(e,i,s){t.push([e,i,s])},lineStart:function(){e.push(t=[])},lineEnd:Zc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function pR(t,e){return Yc(t[0]-e[0])=0;--r)n.point((d=h[r])[0],d[1]);else s(u.x,u.p.x,-1,n);u=u.p}h=(u=u.o).z,p=!p}while(!u.v);n.lineEnd()}}}function _R(t){if(e=t.length){for(var e,i,s=0,n=t[0];++se?1:t>=e?0:NaN}1===(kR=LR).length&&(AR=kR,kR=function(t,e){return LR(AR(t),e)});var CR=Array.prototype;function ER(t){for(var e,i,s,n=t.length,r=-1,a=0;++r=0;)for(e=(s=t[n]).length;--e>=0;)i[--a]=s[e];return i}function DR(t,e,i,s){return function(n){var r,a,o,l=e(n),h=uR(),d=e(h),c=!1,u={point:p,lineStart:m,lineEnd:_,polygonStart:function(){u.point=f,u.lineStart=v,u.lineEnd=y,a=[],r=[]},polygonEnd:function(){u.point=p,u.lineStart=m,u.lineEnd=_,a=ER(a);var t=function(t,e){var i=TR(e),s=e[1],n=Gc(s),r=[Gc(i),-zc(i),0],a=0,o=0;wR.reset(),1===n?s=Oc+Dc:-1===n&&(s=-Oc-Dc);for(var l=0,h=t.length;l=0?1:-1,A=k*M,w=A>Pc,T=m*x;if(wR.add(Hc(T*k*Gc(A),_*S+T*zc(A))),a+=w?M+k*Bc:M,w^p>=i^y>=i){var L=bR(vR(u),vR(v));MR(L);var C=bR(r,L);MR(C);var E=(w^M>=0?-1:1)*qc(C[2]);(s>E||s===E&&(L[0]||L[1]))&&(o+=w^M>=0?1:-1)}}return(a<-Dc||a0){for(c||(n.polygonStart(),c=!0),n.lineStart(),t=0;t1&&2&l&&u.push(u.pop().concat(u.shift())),a.push(u.filter(PR))}return u}}function PR(t){return t.length>1}function OR(t,e){return((t=t.x)[0]<0?t[1]-Oc-Dc:Oc-t[1])-((e=e.x)[0]<0?e[1]-Oc-Dc:Oc-e[1])}CR.slice,CR.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);const RR=DR((function(){return!0}),(function(t){var e,i=NaN,s=NaN,n=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(r,a){var o=r>0?Pc:-Pc,l=Yc(r-i);Yc(l-Pc)0?Oc:-Oc),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),t.point(r,s),e=0):n!==o&&l>=Pc&&(Yc(i-n)Dc?jc((Gc(e)*(r=zc(s))*Gc(i)-Gc(s)*(n=zc(e))*Gc(t))/(n*r*a)):(e+s)/2}(i,s,r,a),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),e=0),t.point(i=r,s=a),n=o},lineEnd:function(){t.lineEnd(),i=s=NaN},clean:function(){return 2-e}}}),(function(t,e,i,s){var n;if(null==t)n=i*Oc,s.point(-Pc,n),s.point(0,n),s.point(Pc,n),s.point(Pc,0),s.point(Pc,-n),s.point(0,-n),s.point(-Pc,-n),s.point(-Pc,0),s.point(-Pc,n);else if(Yc(t[0]-e[0])>Dc){var r=t[0]0)do{h.point(0===d||3===d?t:i,d>1?s:e)}while((d=(d+o+4)%4)!==c);else h.point(r[0],r[1])}function a(s,n){return Yc(s[0]-t)0?0:3:Yc(s[0]-i)0?2:1:Yc(s[1]-e)0?1:0:n>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var i=a(t,1),s=a(e,1);return i!==s?i-s:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(a){var l,h,d,c,u,p,g,m,_,f,v,y=a,b=uR(),x={point:S,lineStart:function(){x.point=M,h&&h.push(d=[]),f=!0,_=!1,g=m=NaN},lineEnd:function(){l&&(M(c,u),p&&_&&b.rejoin(),l.push(b.result())),x.point=S,_&&y.lineEnd()},polygonStart:function(){y=b,l=[],h=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,n=h.length;is&&(u-r)*(s-a)>(p-a)*(t-r)&&++e:p<=s&&(u-r)*(s-a)<(p-a)*(t-r)&&--e;return e}(),i=v&&e,n=(l=ER(l)).length;(i||n)&&(a.polygonStart(),i&&(a.lineStart(),r(null,null,1,a),a.lineEnd()),n&&mR(l,o,e,r,a),a.polygonEnd()),y=a,l=h=d=null}};function S(t,e){n(t,e)&&y.point(t,e)}function M(r,a){var o=n(r,a);if(h&&d.push([r,a]),f)c=r,u=a,p=o,f=!1,o&&(y.lineStart(),y.point(r,a));else if(o&&_)y.point(r,a);else{var l=[g=Math.max(FR,Math.min(IR,g)),m=Math.max(FR,Math.min(IR,m))],b=[r=Math.max(FR,Math.min(IR,r)),a=Math.max(FR,Math.min(IR,a))];!function(t,e,i,s,n,r){var a,o=t[0],l=t[1],h=0,d=1,c=e[0]-o,u=e[1]-l;if(a=i-o,c||!(a>0)){if(a/=c,c<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-o,c||!(a<0)){if(a/=c,c<0){if(a>d)return;a>h&&(h=a)}else if(c>0){if(a0)){if(a/=u,u<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-l,u||!(a<0)){if(a/=u,u<0){if(a>d)return;a>h&&(h=a)}else if(u>0){if(a0&&(t[0]=o+h*c,t[1]=l+h*u),d<1&&(e[0]=o+d*c,e[1]=l+d*u),!0}}}}}(l,b,t,e,i,s)?o&&(y.lineStart(),y.point(r,a),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),o||y.lineEnd(),v=!1)}g=r,m=a,_=o}return x}}function jR(t,e){function i(i,s){return i=t(i,s),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,s){return(i=e.invert(i,s))&&t.invert(i[0],i[1])}),i}function HR(t,e){return[Yc(t)>Pc?t+Math.round(-t/Bc)*Bc:t,e]}function zR(t,e,i){return(t%=Bc)?e||i?jR(VR(t),WR(e,i)):VR(t):e||i?WR(e,i):HR}function NR(t){return function(e,i){return[(e+=t)>Pc?e-Bc:e<-Pc?e+Bc:e,i]}}function VR(t){var e=NR(t);return e.invert=NR(-t),e}function WR(t,e){var i=zc(t),s=Gc(t),n=zc(e),r=Gc(e);function a(t,e){var a=zc(e),o=zc(t)*a,l=Gc(t)*a,h=Gc(e),d=h*i+o*s;return[Hc(l*n-d*r,o*i-h*s),qc(d*n+l*r)]}return a.invert=function(t,e){var a=zc(e),o=zc(t)*a,l=Gc(t)*a,h=Gc(e),d=h*n-l*r;return[Hc(l*n+h*r,o*i+d*s),qc(d*i-o*s)]},a}function GR(t){return function(e){var i=new UR;for(var s in t)i[s]=t[s];return i.stream=e,i}}function UR(){}function $R(t,e,i){var s=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=s&&t.clipExtent(null),wc(i,t.stream(mu)),e(mu.result()),null!=s&&t.clipExtent(s),t}function XR(t,e,i){return $R(t,(function(i){var s=e[1][0]-e[0][0],n=e[1][1]-e[0][1],r=Math.min(s/(i[1][0]-i[0][0]),n/(i[1][1]-i[0][1])),a=+e[0][0]+(s-r*(i[1][0]+i[0][0]))/2,o=+e[0][1]+(n-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([a,o])}),i)}function KR(t,e,i){return XR(t,[[0,0],e],i)}function qR(t,e,i){return $R(t,(function(i){var s=+e,n=s/(i[1][0]-i[0][0]),r=(s-n*(i[1][0]+i[0][0]))/2,a=-n*i[0][1];t.scale(150*n).translate([r,a])}),i)}function ZR(t,e,i){return $R(t,(function(i){var s=+e,n=s/(i[1][1]-i[0][1]),r=-n*i[0][0],a=(s-n*(i[1][1]+i[0][1]))/2;t.scale(150*n).translate([r,a])}),i)}HR.invert=HR,UR.prototype={constructor:UR,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var JR=16,QR=zc(30*Fc);function tB(t,e){return+e?function(t,e){function i(s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f=h-s,v=d-n,y=f*f+v*v;if(y>4*e&&m--){var b=a+u,x=o+p,S=l+g,M=$c(b*b+x*x+S*S),k=qc(S/=M),A=Yc(Yc(S)-1)e||Yc((f*C+v*E)/y-.5)>.3||a*u+o*p+l*g0,n=Yc(e)>Dc;function r(t,i){return zc(t)*zc(i)>e}function a(t,i,s){var n=[1,0,0],r=bR(vR(t),vR(i)),a=yR(r,r),o=r[0],l=a-o*o;if(!l)return!s&&t;var h=e*a/l,d=-e*o/l,c=bR(n,r),u=SR(n,h);xR(u,SR(r,d));var p=c,g=yR(u,p),m=yR(p,p),_=g*g-m*(yR(u,u)-1);if(!(_<0)){var f=$c(_),v=SR(p,(-g-f)/m);if(xR(v,u),v=fR(v),!s)return v;var y,b=t[0],x=i[0],S=t[1],M=i[1];x0^v[1]<(Yc(v[0]-b)Pc^(b<=v[0]&&v[0]<=x)){var w=SR(p,(-g+f)/m);return xR(w,u),[v,fR(w)]}}}function o(e,i){var n=s?t:Pc-t,r=0;return e<-n?r|=1:e>n&&(r|=2),i<-n?r|=4:i>n&&(r|=8),r}return DR(r,(function(t){var e,i,l,h,d;return{lineStart:function(){h=l=!1,d=1},point:function(c,u){var p,g=[c,u],m=r(c,u),_=s?m?0:o(c,u):m?o(c+(c<0?Pc:-Pc),u):0;if(!e&&(h=l=m)&&t.lineStart(),m!==l&&(!(p=a(e,g))||pR(e,p)||pR(g,p))&&(g[2]=1),m!==l)d=0,m?(t.lineStart(),p=a(g,e),t.point(p[0],p[1])):(p=a(e,g),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(n&&e&&s^m){var f;_&i||!(f=a(g,e,!0))||(d=0,s?(t.lineStart(),t.point(f[0][0],f[0][1]),t.point(f[1][0],f[1][1]),t.lineEnd()):(t.point(f[1][0],f[1][1]),t.lineEnd(),t.lineStart(),t.point(f[0][0],f[0][1],3)))}!m||e&&pR(e,g)||t.point(g[0],g[1]),e=g,l=m,i=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return d|(h&&l)<<1}}}),(function(e,s,n,r){!function(t,e,i,s,n,r){if(i){var a=zc(e),o=Gc(e),l=s*i;null==n?(n=e+s*Bc,r=e-l/2):(n=BR(a,n),r=BR(a,r),(s>0?nr)&&(n+=s*Bc));for(var h,d=n;s>0?d>r:d2?t[2]%360*Fc:0,C()):[_*Ic,f*Ic,v*Ic]},T.angle=function(t){return arguments.length?(y=t%360*Fc,C()):y*Ic},T.reflectX=function(t){return arguments.length?(b=t?-1:1,C()):b<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},T.precision=function(t){return arguments.length?(a=tB(o,w=t*t),E()):$c(w)},T.fitExtent=function(t,e){return XR(T,t,e)},T.fitSize=function(t,e){return KR(T,t,e)},T.fitWidth=function(t,e){return qR(T,t,e)},T.fitHeight=function(t,e){return ZR(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&L,C()}}function aB(t){var e=0,i=Pc/3,s=rB(t),n=s(e,i);return n.parallels=function(t){return arguments.length?s(e=t[0]*Fc,i=t[1]*Fc):[e*Ic,i*Ic]},n}function oB(t,e){var i=Gc(t),s=(i+Gc(e))/2;if(Yc(s)2?t[2]*Fc:0),e.invert=function(e){return(e=t.invert(e[0]*Fc,e[1]*Fc))[0]*=Ic,e[1]*=Ic,e},e}(n.rotate()).invert([0,0]));return l(null==h?[[o[0]-r,o[1]-r],[o[0]+r,o[1]+r]]:t===gB?[[Math.max(o[0]-r,h),e],[Math.min(o[0]+r,i),s]]:[[h,Math.max(o[1]-r,e)],[i,Math.min(o[1]+r,s)]])}return n.scale=function(t){return arguments.length?(a(t),d()):a()},n.translate=function(t){return arguments.length?(o(t),d()):o()},n.center=function(t){return arguments.length?(r(t),d()):r()},n.clipExtent=function(t){return arguments.length?(null==t?h=e=i=s=null:(h=+t[0][0],e=+t[0][1],i=+t[1][0],s=+t[1][1]),d()):null==h?null:[[h,e],[i,s]]},d()}function _B(t){return Xc((Oc+t)/2)}function fB(t,e){var i=zc(t),s=t===e?Gc(t):Vc(i/zc(e))/Vc(_B(e)/_B(t)),n=i*Wc(_B(t),s)/s;if(!s)return gB;function r(t,e){n>0?e<-Oc+Dc&&(e=-Oc+Dc):e>Oc-Dc&&(e=Oc-Dc);var i=n/Wc(_B(e),s);return[i*Gc(s*t),n-i*zc(s*t)]}return r.invert=function(t,e){var i=n-e,r=Uc(s)*$c(t*t+i*i),a=Hc(t,Yc(i))*Uc(i);return i*s<0&&(a-=Pc*Uc(t)*Uc(i)),[a/s,2*jc(Wc(n/r,1/s))-Oc]},r}function vB(t,e){return[t,e]}function yB(t,e){var i=zc(t),s=t===e?Gc(t):(i-zc(e))/(e-t),n=i/s+t;if(Yc(s)Dc&&--n>0);return[t/(.8707+(r=s*s)*(r*(r*r*r*(.003971-.001529*r)-.013791)-.131979)),s]},LB.invert=cB(qc),CB.invert=cB((function(t){return 2*jc(t)})),EB.invert=function(t,e){return[-e,2*jc(Nc(t))-Oc]},Qu();const DB={},PB=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function OB(t,e){t&&S(t)||Cm("Projection type must be a name string.");const i=t.toLowerCase();return arguments.length>1&&(DB[i]=function(t,e){return function i(){const s=e();return s.type=t,s.path=Qu().projection(s),s.copy=s.copy||function(){const t=i();return PB.forEach((e=>{s[e]&&t[e](s[e]())})),t.path.pointRadius(s.path.pointRadius()),t},s}}(i,e)),DB[i]||null}const RB={albers:hB,albersusa:function(){var t,e,i,s,n,r,a=hB(),o=lB().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=lB().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){r=[t,e]}};function d(t){var e=t[0],a=t[1];return r=null,i.point(e,a),r||(s.point(e,a),r)||(n.point(e,a),r)}function c(){return t=e=null,d}return d.invert=function(t){var e=a.scale(),i=a.translate(),s=(t[0]-i[0])/e,n=(t[1]-i[1])/e;return(n>=.12&&n<.234&&s>=-.425&&s<-.214?o:n>=.166&&n<.234&&s>=-.214&&s<-.115?l:a).invert(t)},d.stream=function(i){return t&&e===i?t:(s=[a.stream(e=i),o.stream(i),l.stream(i)],n=s.length,t={point:function(t,e){for(var i=-1;++i2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}};Object.keys(RB).forEach((t=>{OB(t,RB[t])}));const BB="Feature",IB="FeatureCollection";const FB=PB.concat(["pointRadius","fit","extent","size"]);function YB(t,e){let i=[];return t?(Object.keys(t).forEach((s=>{FB.includes(s)&&(i=i.concat(Wp(t[s],e)))})),i):i}class jB extends Qp{constructor(t){super(t),this.grammarType="projection"}parse(t){return super.parse(t),this.pointRadius(t.pointRadius),this.size(t.size),this.extent(t.extent),this.fit(t.fit),this.configure(t),this.commit(),this}pointRadius(t){return D(this.spec.pointRadius)||this.detach(Wp(this.spec.pointRadius,this.view)),this.spec.pointRadius=t,this.attach(Wp(t,this.view)),this.commit(),this}size(t){return D(this.spec.size)||this.detach(Wp(this.spec.size,this.view)),this.spec.size=t,this.attach(Wp(t,this.view)),this.commit(),this}extent(t){return D(this.spec.extent)||this.detach(Wp(this.spec.extent,this.view)),this.spec.extent=t,this.attach(Wp(t,this.view)),this.commit(),this}fit(t){return D(this.spec.fit)||this.detach(Wp(this.spec.fit,this.view)),this.spec.fit=t,this.attach(Wp(t,this.view)),this.commit(),this}configure(t){return this.detach(YB(this.spec,this.view)),D(t)?this.spec={type:this.spec.type,fit:this.spec.fit,extent:this.spec.extent,size:this.spec.size,pointRadius:this.spec.pointRadius}:(Object.assign(this.spec,t),this.attach(YB(this.spec,this.view))),this.commit(),this}evaluate(t,e){if(this.projection&&this.projection.type===this.spec.type||(this.projection=function(t){const e=OB((t||"mercator").toLowerCase());return e||Cm("Unrecognized projection type: "+t),e()}(this.spec.type),this.projection.type=this.spec.type),PB.forEach((t=>{D(this.spec[t])||function(t,e,i){xs(t[e])&&t[e](i)}(this.projection,t,Up(this.spec[t],e,OB))})),D(this.spec.pointRadius)||this.projection.path.pointRadius(Up(this.spec.pointRadius,e,OB)),!(D(this.spec.fit)||D(this.spec.extent)&&D(this.spec.size))){const t=function(t){const e=Fa(t);return 1===e.length?e[0]:{type:IB,features:e.reduce(((t,e)=>t.concat(function(t){return t.type===IB?t.features:Fa(t).filter((t=>!D(t))).map((t=>t.type===BB?t:{type:BB,geometry:t}))}(e))),[])}}(Up(this.spec.fit,e,OB));this.spec.extent?this.projection.fitExtent(Up(this.spec.extent,e,OB),t):this.spec.size&&this.projection.fitSize(Up(this.spec.size,e,OB),t)}return this.projection}output(){return this.projection}}const HB=(t,e)=>{if(!e.from||!e.from())return t;const i=e.fields,s=e.key,n=e.values,r=e.default,a=e.as||[i],o=e.from().reduce((function(t,e){return e[i]&&t.set(e[i],e),t}),new Map);let l;if(xs(e.set))l=function(t){const i=o.get(t[s]);e.set(t,i)};else if(n){const t=n.length;l=function(e){const i=o.get(e[s]);if(D(i))for(let i=0;i(l(t),t)))};class zB extends KC{constructor(){super(...arguments),this.type=fl.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return null===(t=this._mapViewData)||void 0===t?void 0:t.getDataView()}get nameField(){return this._nameField}set nameField(t){this._nameField=t}get valueField(){return this._valueField}set valueField(t){this._valueField=t}getNameProperty(){return this._nameProperty}getCentroidProperty(){return this._centroidProperty}getCoordinateHelper(){return this._coordinateHelper}setCoordinateHelper(t){this._coordinateHelper=t}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){var i;let s=null;if(!t)return s;if(e&&!this.isDatumInViewData(t))return s;const{dataToPosition:n,latitudeField:r,longitudeField:a}=this._coordinateHelper;if(s=this.nameToPosition(t),null===s){const e=a?null==t?void 0:t[a]:Number.NaN,o=r?null==t?void 0:t[r]:Number.NaN;s=null!==(i=null==n?void 0:n([e,o]))&&void 0!==i?i:null}return s}nameToPosition(t){const e=this.getDatumName(t);return D(e)?null:this.nameValueToPosition(e)}nameValueToPosition(t){var e,i;const s=null===(i=null===(e=this.getMapViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.filter((e=>this.getDatumName(e)===t))[0];if(D(s))return null;const{dataToPosition:n}=this._coordinateHelper,r=this.getDatumCenter(s),a=null==n?void 0:n(r);return D(a)||isNaN(a.x)||isNaN(a.y)?null:a}dataToLatitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}valueToPosition(t,e){return{x:this.dataToLongitude(t),y:this.dataToLatitude(e)}}positionToData(t){}latitudeToData(t){}longitudeToData(t){}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}release(){super.release(),this._mapViewData.release(),this._mapViewData=this._mapViewDataStatistics=null}getStackGroupFields(){return[this._nameField]}getStackValueField(){return this._spec.valueField}compileData(){var t;null===(t=this._mapViewData)||void 0===t||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){const t=`${nh}_series_${this.id}_mapViewDataStatic`;this._mapViewDataStatistics=this.createStatisticalData(t,this._mapViewData.getDataView()),this._mapViewData.getDataView().target.removeListener("change",this._mapViewDataStatistics.reRunAllTransform)}}getSeriesKeys(){var t,e,i,s,n;return this._seriesField?null!==(n=null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:null===(s=null===(i=this._mapViewDataStatistics)||void 0===i?void 0:i.latestData[this._seriesField])||void 0===s?void 0:s.values)&&void 0!==n?n:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),null===(t=this._mapViewData.getDataView())||void 0===t||t.reRunAllTransform(),null===(e=this._mapViewDataStatistics)||void 0===e||e.reRunAllTransform()}getActiveMarks(){return[]}}const NB=`${nh}_MAP_LOOK_UP_KEY`,VB=(t,e)=>(t.features&&t.features.forEach(((t,i)=>{var s;t[yT]=i;const n=null===(s=t.properties)||void 0===s?void 0:s[e.nameProperty];e.nameMap&&e.nameMap[n]?t[NB]=e.nameMap[n]:t[NB]=n})),t.features);class WB extends iL{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)}}}class GB extends yx{constructor(){super(...arguments),this.type=GB.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}GB.type="path";const UB=()=>{Xl.registerMark(GB.type,GB),NA()},$B=Object.assign(Object.assign({},mL),{area:{name:"area",type:"path"}});class XB{constructor(t){this.projection=OB(t.type)()}fit(t,e,i){const s={type:"FeatureCollection",features:i};this.projection.fitExtent([t,e],s)}center(t){var e,i;null===(i=null===(e=this.projection)||void 0===e?void 0:e.center)||void 0===i||i.call(e,t)}project(t){var e;return null===(e=this.projection)||void 0===e?void 0:e.call(this,t)}shape(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.path)||void 0===i?void 0:i.call(e,t)}invert(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.invert)||void 0===i?void 0:i.call(e,t)}scale(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.scale();this.projection.scale(t)}}translate(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){const s=this.projection.copy();return null==s?void 0:s.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class KB{parserScrollEvent(t){return t?!(t.ctrlKey||0===t.deltaY&&0===t.deltaX)&&(t.scrollX=t.deltaX,t.scrollY=t.deltaY,t):t}parserZoomEvent(t){if(!t)return t;const e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}clearZoom(){}clearScroll(){}clearDrag(){}parserDragEvent(){return!0}}class qB{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0,this.pointerId=null}parserDragEvent(t){return!0}parserZoomEvent(t){const e=t.scale;if(0===this._lastScale)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;const i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function ZB(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:KB}:ul(t)||pl(t)?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:qB}:null}const JB={debounce:Kd,throttle:qd};class QB{constructor(){this._isGestureListener=!1}initZoomable(t,e=n["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getChart().getVGrammarView().renderer._gestureController,this._isGestureListener=ul(this._renderMode)||pl(this._renderMode),ZB(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return ZB(this._renderMode)[t]}_zoomEventDispatch(t,e,i){if(!this._isGestureListener&&!t.event)return;const s=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(s);const{zoomDelta:n,zoomX:r,zoomY:a}=s;if(D(n))return;if(!Nt({x:r,y:a},this._getRegionOrSeriesLayout(e),!1))return;let o={};i&&(o=i({zoomDelta:n,zoomX:r,zoomY:a},s)),this._eventObj.emit("zoom",Object.assign(Object.assign({scale:s.zoomDelta,scaleCenter:{x:s.zoomX,y:s.zoomY}},o),{model:this}))}_getRegionOrSeriesLayout(t){"region"!==t.type&&(t=t.getRegion());const{x:e,y:i,width:s,height:n}=t.layout.getLayout();return{x1:e,y1:i,x2:e+s,y2:i+n}}_bindZoomEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:Vd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:Vd.chart,consume:!1}];l.on(...d,JB[a]((t=>{this._zoomableTrigger.clearZoom()}),o)),l.on(...h,JB[a]((t=>{this._zoomEventDispatch(t,e,i)}),o))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||ZB(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||ZB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindZoomEventAsRegion(t.event,t,i,s)})):this._bindZoomEventAsRegion(this._eventObj,t,i,s)}))}_scrollEventDispatch(t,e,i){let s=!1;if(!this._isGestureListener&&(!t.event||this._option.disableTriggerEvent))return s;const n=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(n);const{scrollX:r,scrollY:a,canvasX:o,canvasY:l}=n;return D(r)&&D(a)?s:Nt({x:o,y:l},this._getRegionOrSeriesLayout(e),!1)?(i&&(s=i({scrollX:r,scrollY:a},n)),this._eventObj.emit("scroll",{scrollX:r,scrollY:a,model:this}),s):s}_bindScrollEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:Vd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:Vd.chart,consume:!1}];l.on(...d,JB[a]((t=>{this._zoomableTrigger.clearScroll()}),o)),l.on(...h,JB[a]((t=>this._scrollEventDispatch(t,e,i)),o))}initScrollEventOfSeries(t,e,i){ZB(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||ZB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindScrollEventAsRegion(t.event,t,i,s)})):this._bindScrollEventAsRegion(this._eventObj,t,i,s)}))}_bindDragEventAsRegion(t,e,i,s){t.on(this._getZoomTriggerEvent("start"),{level:Vd.chart},(t=>{if(!t.event)return;const{event:n}=t;Nt({x:n.canvasX,y:n.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(t,i,s)})),t.on("click",{level:Vd.chart},(()=>!this._clickEnable))}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||ZB(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,e,i)}))}initDragEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||ZB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&(t.event.on(this._getZoomTriggerEvent("start"),{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,i)})),t.event.on("click",{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>!this._clickEnable)))})):this._bindDragEventAsRegion(this._eventObj,t,i,s)}))}_handleDrag(t,e,i){var s,n,r;if(this._option.disableTriggerEvent)return;if(this._clickEnable=!1,!this._zoomableTrigger.parserDragEvent(t.event))return;const a=null!==(s=null==i?void 0:i.delayType)&&void 0!==s?s:"throttle",o=null!==(n=null==i?void 0:i.delayTime)&&void 0!==n?n:0,l=null===(r=null==i?void 0:i.realTime)||void 0===r||r,h=this._getZoomTriggerEvent("move"),d=this._getZoomTriggerEvent("end"),c=t.event;let u=c.canvasX,p=c.canvasY,g=c.canvasX,m=c.canvasY;const _=JB[a]((t=>{this._clickEnable=!0;const i=t.event,s=[i.canvasX-g,i.canvasY-m];g=i.canvasX,m=i.canvasY,!l&&e&&e(s,t.event),this._eventObj.emit("panend",{delta:s,model:this}),this._zoomableTrigger.pointerId=null,this._eventObj.off(h,{level:Vd.chart,source:Nd.chart},f),this._eventObj.off(d,{level:Vd.chart,source:Nd.window},_),this._eventObj.allow(d)}),o),f=JB[a]((t=>{if(!this._zoomableTrigger.parserDragEvent(t.event))return;this._clickEnable=!1,this._eventObj.prevent(d,_);const i=t.event,s=[i.canvasX-u,i.canvasY-p];u=i.canvasX,p=i.canvasY,l&&e&&e(s,t.event),this._eventObj.emit("panmove",{delta:s,model:this})}),o);this._eventObj.on(h,{level:Vd.chart,source:Nd.chart},f),this._eventObj.on(d,{level:Vd.chart,source:Nd.chart},_)}}function tI(t,e){return`${nh}_${e}_${t}`}class eI extends rD{constructor(){super(...arguments),this.type=r.geoCoordinate,this.name=r.geoCoordinate,this.layoutType="none",this.layoutZIndex=Dy.Mark,this._projectionSpec={name:tI(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,s,n,r,a,o;let l=t.zoomDelta;const h=this._actualScale;return this._actualScale*=l,this._actualScale<(null===(i=this._spec.zoomLimit)||void 0===i?void 0:i.min)?(this._actualScale=null===(s=this._spec.zoomLimit)||void 0===s?void 0:s.min,l=(null===(n=this._spec.zoomLimit)||void 0===n?void 0:n.min)/h):this._actualScale>(null===(r=this._spec.zoomLimit)||void 0===r?void 0:r.max)&&(this._actualScale=null===(a=this._spec.zoomLimit)||void 0===a?void 0:a.max,l=(null===(o=this._spec.zoomLimit)||void 0===o?void 0:o.max)/h),this.zoom(l,[t.zoomX,t.zoomY]),{scale:l,totalScale:this._actualScale}},this.pan=(t=[0,0])=>{var e,i,s;const n=null!==(i=null===(e=this._projection)||void 0===e?void 0:e.translate())&&void 0!==i?i:[0,0];let r=n[0],a=n[1];r+=t[0],a+=t[1],null===(s=this._projection)||void 0===s||s.translate([r,a])}}get longitudeField(){return this._longitudeField}get latitudeField(){return this._latitudeField}get projectionSpec(){return this._projectionSpec}setProjection(t){this._projectionSpec=Object.assign(Object.assign({},t),{name:this._projectionSpec.name})}getZoom(){return this._actualScale}static getSpecInfo(t){if(D(t))return null;const e=[];return t.region.forEach(((t,i)=>{if("geo"===t.coordinate){const s=Object.assign(Object.assign({},t),{padding:0});e.push({spec:s,regionIndex:i,type:r.geoCoordinate,specInfoPath:["component","geoCoordinate",i]})}})),e}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this._spec.roam&&this.initZoomable(this.event,this._option.mode),this._projectionSpec=Ll(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>(null===(t=this._spec.zoomLimit)||void 0===t?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<(null===(e=this._spec.zoomLimit)||void 0===e?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=null!==(i=this._projectionSpec.zoom)&&void 0!==i?i:1,this._initialScale=this._actualScale,this._longitudeField=this._spec.longitudeField,this._latitudeField=this._spec.latitudeField}created(){super.created(),this._regions=this._option.getRegionsInIndex([this._option.regionIndex]),this.initProjection(),this.coordinateHelper(),this.initEvent(),this._initCenterCache()}dispatchZoom(t,e){const i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},{scale:s,totalScale:n}=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});1!==s&&this.event.emit("zoom",{scale:s,scaleCenter:i,totalScale:n,model:this})}initEvent(){this.event.on(zd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const{roam:t}=this._spec;t&&(this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),this.initDragEventOfRegions(this._regions,t.blank?null:()=>!0,this.pan),this._regions.forEach((t=>{t.getSeries().forEach((t=>{t.event.on("zoom",(e=>(t.handleZoom(e),!0))),t.event.on("panmove",(e=>(t.handlePan(e),!0)))}))})))}initProjection(){var t;this._projection=new XB(this._projectionSpec),null!==this._projection.projection||null===(t=this._option)||void 0===t||t.onError("unsupported projection type!")}coordinateHelper(){const t={longitudeField:this._longitudeField,latitudeField:this._latitudeField,dataToPosition:this.dataToPosition.bind(this),dataToLongitude:this.dataToLongitude.bind(this),dataToLatitude:this.dataToLatitude.bind(this),shape:this.shape.bind(this),getCoordinateId:()=>this.id};this._regions.forEach((e=>{e.getSeries().forEach((e=>{e.type===fl.map?e.setCoordinateHelper(t):(e.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.x}return this.dataToLongitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.x}return this.dataToLongitude(t)},getFields:()=>[this._longitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})),e.setYAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.y}return this.dataToLatitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.y}return this.dataToLatitude(t)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))}))}))}onLayoutEnd(t){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());const{width:e,height:i}=this.getLayoutRect(),{translate:s,scale:n,center:r}=this.evaluateProjection([0,0],[e,i]);s&&this._projection.translate(s),n&&this._projection.scale(n),r&&this._projection.center(r),AE(this._regions,(t=>{var e;if(t.type===fl.map){t.areaPath.clear();const i=null===(e=t.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();i&&i.attribute.postMatrix&&i.setAttributes({postMatrix:new Pt})}})),this._actualScale=this._initialScale,super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}collectFeatures(){const t=[];return this._regions.forEach((e=>{e.getSeries().forEach((e=>{var i,s;e.type===fl.map&&t.push(...null!==(s=null===(i=e.getMapViewData())||void 0===i?void 0:i.latestData)&&void 0!==s?s:[])}))})),t}dataToPosition(t=[]){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t[0],t[1]]);return{x:null==i?void 0:i[0],y:null==i?void 0:i[1]}}dataToLatitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([0,t]);return null==i?void 0:i[1]}dataToLongitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t,0]);return null==i?void 0:i[0]}zoom(t,e=[0,0]){var i,s,n,r,a,o;let l=null!==(s=null===(i=this._projection)||void 0===i?void 0:i.scale())&&void 0!==s?s:0;const h=null!==(r=null===(n=this._projection)||void 0===n?void 0:n.translate())&&void 0!==r?r:[0,0];let d=h[0],c=h[1];l*=t,d-=(e[0]-d)*(t-1),c-=(e[1]-c)*(t-1),null===(a=this._projection)||void 0===a||a.scale(l),null===(o=this._projection)||void 0===o||o.translate([d,c])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;const s=this._projection.evaluate(t,e,this.collectFeatures());let n=s.translate();const r=s.scale()*this._initialScale,a=null!==(i=this._projectionSpec.center)&&void 0!==i?i:s.invert([e[0]/2,e[1]/2]);return a&&(n=[e[0]/2,e[1]/2]),{translate:n,scale:r,center:a}}_initCenterCache(){this._centerCache||(this._centerCache=new Map),this._regions.forEach((t=>{t.getSeries().forEach((t=>{var e,i;"map"===t.type&&(null!==(i=null===(e=t.getMapViewData())||void 0===e?void 0:e.latestData)&&void 0!==i?i:[]).forEach(((e={})=>{const i=e[t.getDimensionField()[0]]||e[NB],s=t.getDatumCenter(e);i&&M(s)&&this._centerCache.set(i,{x:s[0],y:s[1]})}))}))}))}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}eI.type=r.geoCoordinate,QA(eI,QB);const iI=()=>{Xl.registerComponent(eI.type,eI)};class sI extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class nI extends zB{constructor(){super(...arguments),this.type=fl.map,this.transformerConstructor=sI,this._areaCache=new Map}getNameMap(){return this._nameMap}get areaPath(){return this._areaCache}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.map=this._spec.map,this._nameMap=this._spec.nameMap,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._spec.nameProperty&&(this._nameProperty=this._spec.nameProperty),this._spec.centroidProperty&&(this._centroidProperty=this._spec.centroidProperty),this.map||null===(t=this._option)||void 0===t||t.onError(`map type '${this.map}' is not specified !`),Dp.get(this.map)||null===(e=this._option)||void 0===e||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),Cp(this._dataSet,"copyDataView",Fp),Cp(this._dataSet,"map",VB),Cp(this._dataSet,"lookup",HB);const i=Dp.get(this.map);i||null===(t=this._option)||void 0===t||t.onError("no valid map data found!");const s=new R(this._dataSet,{name:`map_${this.id}_data`});s.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:zp.copyDataView}).transform({type:"map",options:{nameMap:this._nameMap,nameProperty:this._nameProperty}}).transform({type:"lookup",options:{from:()=>{var t;return null===(t=this._data)||void 0===t?void 0:t.getLatestData()},key:NB,fields:this._nameField,set:(t,e)=>{e&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new oL(this._option,s)}initMark(){this._pathMark=this._createMark(nI.mark.area,{morph:WC(this._spec,nI.mark.area.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0,dataView:this._mapViewData.getDataView(),dataProductId:this._mapViewData.getProductId()})}initMarkStyle(){const t=this._pathMark;t&&(this.setMarkStyle(t,{fill:t=>{var e,i,s,n;return M(t[null!==(e=this._seriesField)&&void 0!==e?e:xT])?(null!==(i=this._option.globalScale.getScale("color"))&&void 0!==i?i:this._getDefaultColorScale()).scale(t[null!==(s=this._seriesField)&&void 0!==s?s:xT]):null===(n=this._spec)||void 0===n?void 0:n.defaultFillColor},path:this.getPath.bind(this)},"normal",Oy.Series),t.setPostProcess("fill",(t=>M(t)?t:this._spec.defaultFillColor)),this.setMarkStyle(t,{smoothScale:!0},"normal",Oy.Built_In))}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{text:t=>this.getDatumName(t),x:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(HC(null===(t=Xl.getAnimationInKey("fadeInOut"))||void 0===t?void 0:t(),zC("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new WB(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;const i=this._areaCache.get(t[yT]);if(i)return i.shape;const s=null===(e=this._coordinateHelper)||void 0===e?void 0:e.shape(t);return this._areaCache.set(t[yT],{shape:s}),s}onEvaluateEnd(){this._mapViewData.updateData()}getDimensionField(){return[this.nameField]}getMeasureField(){return[this.valueField]}release(){super.release(),this._areaCache.clear(),this._nameMap={},this._mapViewData=null}handleZoom(t){var e,i,s;const{scale:n,scaleCenter:r}=t;if(1===n)return;const a=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new Pt}),a.scale(n,n,r));const o=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();o&&o.evaluate(null,null)}handlePan(t){var e,i,s;const{delta:n}=t;if(0===n[0]&&0===n[1])return;const r=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new Pt}),r.translate(n[0],n[1]));const a=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();a&&a.evaluate(null,null)}getDatumCenter(t){var e,i,s,n;return this._centroidProperty&&(null===(e=t.properties)||void 0===e?void 0:e[this._centroidProperty])?null===(i=t.properties)||void 0===i?void 0:i[this._centroidProperty]:Zo(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:(null===(s=t.properties)||void 0===s?void 0:s.center)?t.properties.center:(null===(n=t.properties)||void 0===n?void 0:n.centroid)?t.properties.centroid:[Number.NaN,Number.NaN]}getDatumName(t){var e;if(t[this.nameField])return t[this.nameField];const i=null===(e=t.properties)||void 0===e?void 0:e[this._nameProperty];if(i){if(this._spec.nameMap&&this._spec.nameMap[i])return this._spec.nameMap[i];if(this._spec.showDefaultName||!this._spec.nameMap)return i}return""}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._mapViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._mapViewData)||void 0===s||s.updateData()}_getDataIdKey(){return yT}getActiveMarks(){return[this._pathMark]}}nI.type=fl.map,nI.mark=$B,nI.transformerConstructor=sI;class rI extends cO{_isValidSeries(t){return t===fl.map}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:t.type,nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,map:t.map,nameProperty:t.nameProperty,centroidProperty:t.centroidProperty,nameMap:t.nameMap,area:t.area,defaultFillColor:t.defaultFillColor,showDefaultName:t.showDefaultName})}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"}));const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class aI extends fO{constructor(){super(...arguments),this.transformerConstructor=rI,this.type="map",this.seriesType=fl.map}}function oI(t){return function(e){let i;return i=y(t)?t.reduce(((t,e)=>null==t?void 0:t[e]),e):null==e?void 0:e[t],i}}aI.type="map",aI.seriesType=fl.map,aI.transformerConstructor=rI;class lI extends KC{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=fh,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(t){return this._angleField=M(t)?Fa(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=M(t)?Fa(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=Fa(t),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(t){return this._radiusScale=t,t}get angleScale(){return this._angleScale}setAngleScale(t){return this._angleScale=t,t}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(t){this._angleAxisHelper=t,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(t){this._radiusAxisHelper=t,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(t,e){if(D(t)||D(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:Number.NaN,y:Number.NaN};const i=this.radiusAxisHelper.dataToPosition(Fa(e));if(i<0){if("break"===this._invalidType||"link"===this._invalidType)return{x:Number.NaN,y:Number.NaN};if("zero"===this._invalidType)return this.angleAxisHelper.center()}const s=this.angleAxisHelper.dataToPosition(Fa(t));return this.angleAxisHelper.coordToPoint({angle:s,radius:i})}dataToPosition(t,e){return t&&this.angleAxisHelper&&this.radiusAxisHelper?e&&!this.isDatumInViewData(t)?null:this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getDatumPositionValues(t,this._radiusField)):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}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;const i=[];return(null===(t=this.radiusAxisHelper)||void 0===t?void 0:t.getScale)&&this._radiusField.forEach((t=>{const e={key:t,operations:[]};Qh(this.radiusAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),(null===(e=this.angleAxisHelper)||void 0===e?void 0:e.getScale)&&this._angleField.forEach((t=>{const e={key:t,operations:[]};Qh(this.angleAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),i}setAttrFromSpec(){super.setAttrFromSpec(),M(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),M(this._spec.radius)&&(this._outerRadius=this._spec.radius),M(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){const t=this._angleAxisHelper||this._radiusAxisHelper;if(t)return t.layoutRadius();const{width:e,height:i}=this._region.getLayoutRect();return Math.min(e/2,i/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(zd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e=this._angleAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&qC(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){const t=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach((e=>{t.push(e)})),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach((e=>{t.push(e)})),t}}function hI(t){return Jo(t)?Number.parseFloat(t):0}const dI=(t,e)=>{const{asStartAngle:i,asEndAngle:s,asMiddleAngle:n,asRadian:r,asRatio:a,asQuadrant:o,asK:l,showAllZero:h,supportNegative:d,showEmptyCircle:c}=e,u=e.angleField(),p=e.startAngle(),g=e.endAngle(),m=e.minAngle(),_=t.map((t=>Object.assign({},t)));if(!_||0===_.length)return _;if(!h&&c&&cI(_,u,d))return _;const f=(t,e,a)=>{t[i]=e,t[s]=e+a,t[n]=e+a/2,t[r]=a,t[o]=Dt(e+a/2)};let v=0,y=-1/0,b=!0;for(let t=0;t<_.length;t++){const e=d?Math.abs(hI(_[t][u])):hI(_[t][u]);v+=e,y=Math.max(e,y),b&&0!==e&&(b=!1),_[t][oh]=e}const x=_.map((t=>Number(t[u]))),S=g-p;let M=p,k=S,A=0;const w=function(t,e=2){const i=t.reduce(((t,e)=>t+(isNaN(e)?0:e)),0);if(0===i)return 0;const s=Math.pow(10,e),n=t.map((t=>(isNaN(t)?0:t)/i*s*100)),r=100*s,a=n.map((t=>Math.floor(t)));let o=a.reduce(((t,e)=>t+e),0);const l=n.map(((t,e)=>t-a[e]));for(;ot&&(t=l[i],e=i);++a[e],l[e]=0,++o}return a.map((t=>t/s))}(x);if(_.forEach(((t,e)=>{const i=t[oh],s=v?i/v:0;let n=s*S;n{f(e,p+i*t,t)}))}else{const t=k/A;M=p,_.forEach((e=>{const i=e[r]===m?m:e[oh]*t;f(e,M,i),M+=i}))}if(0!==v&&(_[_.length-1][s]=g),b&&h){const t=S/_.length;_.forEach(((e,i)=>{f(e,p+i*t,t)}))}return _},cI=(t,e,i)=>!!D(t)||0===t.length||!!t.every((t=>0===hI(t[e])))||!i&&0===t.reduce(((t,i)=>t+hI(i[e])),0);function uI(t,e,i){return(s,n,r)=>e?"radius"===t.growField?{overall:0}:{overall:t.growFrom(s,n,i)}:{overall:!1}}const pI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",options:uI(t,!0,Np.appear)}),gI={type:"fadeIn"},mI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",easing:"linear",options:uI(t,!0,Np.enter)}),_I=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",easing:"linear",options:uI(t,!0,Np.exit)}),fI=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",options:uI(t,!0,Np.exit)});function vI(t,e){if(!1===e)return{};switch(e){case"fadeIn":return gI;case"growRadius":return pI(Object.assign(Object.assign({},t),{growField:"radius"}));default:return pI(Object.assign(Object.assign({},t),{growField:"angle"}))}}class yI extends yx{constructor(t,e){super(t,e),this.type=bI.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(t,e,i="normal",s,n)=>{var r;return n+(null!==(r=this.getAttribute("radiusOffset",e,i,s))&&void 0!==r?r:0)},this.computeCenter=(t,e,i="normal",s,n)=>Tt({x:0,y:0},this.getAttribute("centerOffset",e,i,s),e[uh])[t]+n,this._computeExChannel.x=this.computeCenter,this._computeExChannel.y=this.computeCenter,this._computeExChannel.outerRadius=this.computeOuterRadius,this._extensionChannel.centerOffset=["x","y"],this._extensionChannel.radiusOffset=["outerRadius"]}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{startAngle:0,endAngle:0,outerRadius:0,innerRadius:0,cornerRadius:0,lineWidth:0,innerPadding:0,outerPadding:0})}}class bI extends yI{constructor(){super(...arguments),this.type=bI.type}}bI.type="arc";const xI=()=>{Mx(),Gx(),fc.registerGraphic(Qd.arc,wx),OA("arc",BA),IC(),Xl.registerMark(bI.type,bI)},SI=Object.assign(Object.assign({},mL),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),MI=Object.assign(Object.assign({},mL),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class kI extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const i=this._getDefaultSpecFromChart(e);s=Ll({},this._theme,i,t);const n=(t,e)=>Ll({},"inside"===t||"inside-center"===t?this._theme.innerLabel:this._theme.outerLabel,e);y(s.label)?s.label=s.label.map((t=>n(t.position,t))):s.label=n(s.label.position,s.label)}return{spec:s,theme:i}}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{centerX:s,centerY:n}=t;return M(s)&&(i.centerX=s),M(n)&&(i.centerY=n),Object.keys(i).length>0?i:void 0}}const AI=`${nh}_LABEL_VISIBLE`,wI=(t,e,i,s)=>{const n=t();if(h(n))return n;if(xs(n))return n(e(),i());const r=e();if("auto"===n&&r.width>0&&r.height>0){const{startAngle:t=0,endAngle:e=2*Math.PI}=s();return function(t,e,i,s){const{x:n,y:r}=e,a=function(t,e){const i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const s=Et(Math.min(t,e)),n=s+i,r=[s,n];let a=Math.floor(s/Math.PI)*Math.PI/2;for(;as&&r.push(a),a+=Math.PI/2;return r}(i,s),{width:o,height:l}=t,h=[];return a.forEach((t=>{const e=Math.sin(t),i=Math.cos(t);1===e?h.push(l-r):-1===e?h.push(r):1===i?h.push(o-n):-1===i?h.push(n):(e>0?h.push(Math.abs((l-r)/i)):h.push(Math.abs(r/i)),i>0?h.push(Math.abs((o-n)/e)):h.push(Math.abs(n/e)))})),Math.min.apply(null,h)}(r,i(),t,e)}return Math.min(r.width/2,r.height/2)};class TI extends lI{constructor(){super(...arguments),this.transformerConstructor=kI,this._pieMarkName="pie",this._pieMarkType="arc",this.getCenter=()=>{var t,e,i,s;const{width:n,height:r}=this._region.getLayoutRect();return{x:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.centerX)&&void 0!==e?e:n/2,y:null!==(s=null===(i=this._spec)||void 0===i?void 0:i.centerY)&&void 0!==s?s:r/2}},this._startAngle=mh,this._endAngle=_h,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=t=>{const e=t[uh];if(D(e))return null;const i=this.computeDatumRadius(t),s=this.computeDatumInnerRadius(t);return Tt(this.computeCenter(t),(i+s)/2,e)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.getCenter().x,y:()=>this.getCenter().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}setAttrFromSpec(){var t,e,i,s,n,r;super.setAttrFromSpec(),this._centerOffset=null!==(t=this._spec.centerOffset)&&void 0!==t?t:0,this._cornerRadius=null!==(e=this._spec.cornerRadius)&&void 0!==e?e:0;const a=function(t,e){let i=0,s=2*Math.PI;const n=M(t),r=M(e);for(n||r?r?n?(i=t,s=e):(i=e-2*Math.PI,s=e):(i=t,s=t+2*Math.PI):(i=0,s=2*Math.PI);s<=i;)s+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI,s-=2*Math.PI;for(;s<0;)i+=2*Math.PI,s+=2*Math.PI;return{startAngle:i,endAngle:s}}(M(this._spec.startAngle)?At(this._spec.startAngle):this._startAngle,M(this._spec.endAngle)?At(this._spec.endAngle):this._endAngle);this._startAngle=a.startAngle,this._endAngle=a.endAngle,this._padAngle=M(this._spec.padAngle)?At(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[],this._showEmptyCircle=null!==(s=null===(i=this._spec.emptyPlaceholder)||void 0===i?void 0:i.showEmptyCircle)&&void 0!==s&&s,this._showAllZero=null!==(n=this._spec.showAllZero)&&void 0!==n&&n,this._supportNegative=null!==(r=this._spec.supportNegative)&&void 0!==r&&r}initData(){super.initData();const t=this.getViewData();if(!t)return;Cp(this._dataSet,"pie",dI),t.transform({type:"pie",options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>M(this._spec.minAngle)?At(this._spec.minAngle):0,asStartAngle:hh,asEndAngle:dh,asRatio:lh,asMiddleAngle:uh,asRadian:gh,asQuadrant:ph,asK:ch,showAllZero:this._showAllZero,supportNegative:this._supportNegative,showEmptyCircle:this._showEmptyCircle}},!1);const e=new R(this._dataSet,{name:`${nh}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new oL(this._option,e)}initMark(){var t,e;this._pieMark=this._createMark(Object.assign(Object.assign({},TI.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{morph:WC(this._spec,this._pieMarkName),defaultMorphElementKey:this._seriesField,key:bT,groupKey:this._seriesField,skipBeforeLayouted:!0,isSeriesMark:!0,customShape:null===(t=this._spec.pie)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.pie)||void 0===e?void 0:e.stateSort}),this._showEmptyCircle&&(this._emptyArcMark=this._createMark({name:"emptyCircle",type:"arc"},{dataView:!1}))}startAngleScale(t){return oI(hh)(t)}endAngleScale(t){return oI(dh)(t)}_computeLayoutRadius(){return wI((()=>this._spec.layoutRadius),this.getLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}initMarkStyle(){const t={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:lx(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:lx(this._innerRadius)?this._innerRadius:()=>this._computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this._computeLayoutRadius()*this._cornerRadius,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),padAngle:this._padAngle,centerOffset:this._centerOffset},e=this._pieMark;e&&this.setMarkStyle(e,t,"normal",Oy.Series);const i=this._emptyArcMark;i&&this.setMarkStyle(i,Object.assign(Object.assign({},t),{visible:()=>{const t=this.getAngleField()[0];return cI(this.getViewData().latestData,t,this._supportNegative)}}),"normal",Oy.Series)}initInteraction(){this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e,i){if(super.initMarkStyleWithSpec(t,e,i),t.name===this._pieMarkName){const e=this.getSpec()[t.name];if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,Oy.User_Mark)}"emptyCircle"===t.name&&this.setMarkStyle(t,this.generateRadiusStyle(e.style),"normal",Oy.User_Mark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{visible:oI(AI).bind(this),text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark()}initEvent(){var t;super.initEvent(),null===(t=this._viewDataLabel.getDataView())||void 0===t||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(t){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd(t)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(zd.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),t.cornerRadius&&(e.cornerRadius=()=>this._computeLayoutRadius()*t.cornerRadius),e}computeCenter(t){return{x:this._pieMark.getAttribute("x",t,"normal"),y:this._pieMark.getAttribute("y",t,"normal")}}getRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.outerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.outerRadius;return null!=l?l:this._outerRadius}getInnerRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.innerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.innerRadius;return null!=l?l:this._innerRadius}computeRadius(t,e){return this._computeLayoutRadius()*t*(D(e)?1:e)+this._centerOffset}computeDatumRadius(t,e){return this._computeLayoutRadius()*this.getRadius(e)+this._centerOffset}_compareSpec(t,e,i){i=null!=i?i:{data:!0};const s=["centerX","centerY","centerOffset","radius","innerRadius","cornerRadius","startAngle","endAngle","padAngle"];s.forEach((t=>{i[t]=!0}));const n=super._compareSpec(t,e,i);return t=null!=t?t:{},s.some((i=>t[i]!==e[i]))&&(n.reRender=!0,n.change=!0),n}computeDatumInnerRadius(t,e){return this._computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t,e){const i=t[uh];if(D(i))return null;if(e&&!this.isDatumInViewData(t))return null;const s=this.computeDatumRadius(t);return Tt(this.computeCenter(t),s,i)}initAnimation(){var t,e,i;const s={growFrom:(t,e,i)=>{var s;if(i===Np.appear)return this._startAngle;if(i===Np.disappear)return this._endAngle;const n=[Np.disappear,Np.exit],r=e.mark.elements,a=null==t?void 0:t[yT];if(void 0===r.find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[yT]){var e;return(null===(e=t.data[0])||void 0===e?void 0:e[yT])>a})))return this._endAngle;const o=[...r].reverse().find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[yT])t.getAttribute("x",e),to:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[uh]).x},y:{from:e=>t.getAttribute("y",e),to:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[uh]).y}}}},{duration:o,effects:{easing:l,channel:{x:{to:e=>t.getAttribute("x",e),from:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[uh]).x},y:{to:e=>t.getAttribute("y",e),from:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[uh]).y}}}}]}}(this._pieMark,t.normal)),this._pieMark.setAnimationConfig(t)}if(this._emptyArcMark){const t=HC(null===(i=Xl.getAnimationInKey("emptyCircle"))||void 0===i?void 0:i(s,null!=n?n:"fadeIn"));this._emptyArcMark.setAnimationConfig(t)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}TI.transformerConstructor=kI,TI.mark=SI;class LI extends TI{constructor(){super(...arguments),this.type=fl.pie}}LI.type=fl.pie;class CI extends cO{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Fa(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return M(r)&&n.forEach((t=>{D(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:t.radius,outerRadius:t.outerRadius,innerRadius:t.innerRadius,startAngle:t.startAngle,endAngle:t.endAngle,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),y(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class EI extends CI{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.seriesField,valueField:t.valueField||t.angleField,center:t.center,centerOffset:t.centerOffset,cornerRadius:t.cornerRadius,padAngle:t.padAngle,minAngle:t.minAngle,emptyPlaceholder:t.emptyPlaceholder,emptyCircle:null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,showAllZero:t.showAllZero,supportNegative:t.supportNegative,layoutRadius:t.layoutRadius})}}class DI extends fO{constructor(){super(...arguments),this.transformerConstructor=EI}}DI.transformerConstructor=EI;class PI extends DI{constructor(){super(...arguments),this.transformerConstructor=EI,this.type="pie",this.seriesType=fl.pie}}PI.type="pie",PI.seriesType=fl.pie,PI.transformerConstructor=EI;class OI extends yI{constructor(){super(...arguments),this.type=OI.type,this._support3d=!0}}OI.type="arc3d";const RI=()=>{IC(),Mx(),rS(),fc.registerGraphic(Qd.arc3d,$x),Xl.registerMark(OI.type,OI)};class BI extends kI{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class II extends TI{constructor(){super(...arguments),this.type=fl.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=BI}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",Oy.Series)}initLabelMarkStyle(t,e={}){if(!t)return;super.initLabelMarkStyle(t);const i={};t.setSupport3d(!0),i.beta=this._angle3d,i.anchor3d=t=>{const{x:e,y:i}=this.getCenter();return[e,i]},i.angle=t=>{const i=t[uh];return"inside"===e.position?wt(i):0},this.setMarkStyle(t,Object.assign(Object.assign({},i),{z:100}),void 0,Oy.Mark)}}II.type=fl.pie3d,II.mark=MI,II.transformerConstructor=BI;class FI extends EI{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class YI extends DI{constructor(){super(...arguments),this.transformerConstructor=FI,this.type="pie3d",this.seriesType=fl.pie3d}}YI.type="pie3d",YI.seriesType=fl.pie3d,YI.transformerConstructor=FI;const jI=t=>{const e="angle"===t.growField?0:t.innerRadius;return"angle"===t.growField?{type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}:{channel:{innerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.innerRadius}},outerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.outerRadius}}}}},HI={type:"fadeIn"},zI=t=>({type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}),NI=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"}),VI=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"});function WI(t,e){if(!1===e)return{};switch(e){case"fadeIn":return HI;case"growAngle":return jI(Object.assign(Object.assign({},t),{growField:"angle"}));default:return jI(Object.assign(Object.assign({},t),{growField:"radius"}))}}class GI extends lI{getStackGroupFields(){return this._angleField}getStackValueField(){return Fa(this._spec.valueField)[0]||Fa(this._spec.radiusField)[0]}getGroupFields(){return this._angleField}setAttrFromSpec(){super.setAttrFromSpec(),this.setAngleField(this._spec.categoryField||this._spec.angleField),this.setRadiusField(this._spec.valueField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice(),this.setInnerRadiusField(this._spec.valueField||this._spec.radiusField),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(AT),this.setInnerRadiusField(kT)}setValueFieldToPercent(){this.setRadiusField(TT),this.setInnerRadiusField(wT)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}const UI=Object.assign(Object.assign({},mL),{rose:{name:"rose",type:"arc"}});class $I extends XC{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}var XI=function(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{if(!function(t){const e=null==t?void 0:t.orient;return"angle"===e||"radius"===e}(i))return;const{axisType:d,componentName:c,startAngle:u,endAngle:p,center:g,outerRadius:m,layoutRadius:_}=((t,e)=>{var i,s,n,a,o,l;const h=null!==(i=t.type)&&void 0!==i?i:"angle"===t.orient?"band":"linear",d=`${r.polarAxis}-${h}`,c=null!==(s=t.startAngle)&&void 0!==s?s:e.startAngle,u=null!==(n=t.endAngle)&&void 0!==n?n:e.endAngle;return{axisType:h,componentName:d,startAngle:null!=c?c:-90,endAngle:null!=u?u:M(c)?c+360:270,center:M(e.center)?e.center:M(null==e?void 0:e.centerX)||M(null==e?void 0:e.centerY)?{x:null==e?void 0:e.centerX,y:null==e?void 0:e.centerY}:void 0,outerRadius:null!==(l=null!==(o=null!==(a=t.outerRadius)&&void 0!==a?a:t.radius)&&void 0!==o?o:e.outerRadius)&&void 0!==l?l:e.radius,layoutRadius:e.layoutRadius}})(i,t);i.center=g,i.startAngle=u,i.endAngle=p,i.outerRadius=m,i.type=d,i.layoutRadius=_;const f={spec:i,specPath:e?[this.specKey,h]:[this.specKey],specInfoPath:["component",this.specKey,h],type:c};s.push(f),"radius"===i.orient?(o.push(f),a=h):(l.push(f),n=h)})),o.forEach((t=>{t.angleAxisIndex=n})),l.forEach((t=>{t.radiusAxisIndex=a})),s}static createComponent(t,e){const{spec:i}=t,s=XI(t,["spec"]),n=Xl.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}constructor(t,e){super(t,e),this.type=r.polarAxis,this.name=r.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=Dy.Axis,this._tick=void 0,this._center=null,this._startAngle=mh,this._endAngle=_h,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),AE(this._regions,(t=>{"radius"===this.getOrient()?QE(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.radiusAxisHelper=this.axisHelper()):QE(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;const i=null===(e=this.getRegions())||void 0===e?void 0:e[0];return i?i.getLayoutStartPoint():t},this.getCenter=()=>{var t,e;const i=this.getRefLayoutRect(),{width:s,height:n}=i;return{x:il(null===(t=this._center)||void 0===t?void 0:t.x,s,i,s/2),y:il(null===(e=this._center)||void 0===e?void 0:e.y,n,i,n/2)}},this.getRefLayoutRect=()=>this.getRegions()[0].getLayoutRect(),this._coordinateType="polar"}setAttrFromSpec(){super.setAttrFromSpec(),this.visible&&(this._axisStyle=this._getAxisAttributes(),this._gridStyle=this._getGridAttributes()),this._tick=this._spec.tick,this._orient="angle"===this._spec.orient?"angle":"radius",this._center=this._spec.center,this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._inverse=this._spec.inverse}onRender(t){}changeRegions(){}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimal:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,startAngle:this.startAngle,labelOffset:UE(this._spec),getRadius:()=>this.getOuterRadius(),inside:this._spec.inside})}updateScaleRange(){const t=this._scale.range();let e;return e="radius"===this.getOrient()?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],!(t&&e&&t[0]===e[0]&&t[1]===e[1]||(this._scale.range(e),0))}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:"radius"===this.getOrient()?e.getRadiusField():e.getAngleField(),n}updateSeriesScale(){AE(this._regions,(t=>{"radius"===this.getOrient()?QE(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setRadiusScale(this._scale),t.radiusAxisHelper=this.axisHelper()):QE(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){const e="radius"===this.getOrient()?t.getRadiusField():t.getAngleField();return Qh(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:Qh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),coordToPoint:this.coordToPoint.bind(this),pointToCoord:this.pointToCoord.bind(this),center:this.getCenter.bind(this),layoutRadius:this._computeLayoutRadius.bind(this),getScale:(t=0)=>this._scales[t],getAxisId:()=>this.id,getSpec:()=>this._spec}}positionToData(t){const e=this.pointToCoord(t);return"radius"===this.getOrient()?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){return Tt(this.getCenter(),t.radius,t.angle)}pointToCoord(t){return Lt(t,this.getCenter(),this._startAngle,this._endAngle)}getOuterRadius(){return this.computeLayoutOuterRadius()}getInnerRadius(){return this.computeLayoutInnerRadius()}updateLayoutAttribute(){this._visible&&("radius"===this.getOrient()?this._layoutRadiusAxis():this._layoutAngleAxis()),super.updateLayoutAttribute()}_getNormalizedValue(t,e){return 0===e?0:(this.dataToPosition(t)-this._getStartValue())/e}getLabelItems(t){var e;const i=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();return i&&i.length?[i.map((e=>JE(e.value,this._getNormalizedValue([e.value],t))))]:[]}_getStartValue(){return"radius"===this.getOrient()?this.computeLayoutInnerRadius():this._startAngle}_layoutAngleAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this._endAngle-this._startAngle,o=this.getLabelItems(a),l=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:s,radius:n,innerRadius:r,startAngle:this._startAngle,endAngle:this._endAngle,sides:(null===(i=null===(e=null===(t=this._getRelatedAxis(this._option.radiusAxisIndex))||void 0===t?void 0:t.getSpec())||void 0===e?void 0:e.grid)||void 0===i?void 0:i.smooth)?void 0:this.getScale().domain().length}),h=Object.assign(Object.assign(Object.assign({},l),this.getRefLayoutRect()),{title:{text:this._spec.title.text||this._dataFieldText},items:o,orient:"angle"});this._spec.grid.visible&&(h.grid=Object.assign({type:"line",smoothLink:!0,items:o[0]},l)),this._update(h)}_layoutRadiusAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this.coordToPoint({angle:this._startAngle,radius:n}),o=this.coordToPoint({angle:this._startAngle,radius:r}),l=xe.distancePP(o,a),h=this.getLabelItems(l),d=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:o,end:a,verticalFactor:-1}),c=Object.assign(Object.assign({},d),{title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"radius"});(null===(t=this._spec.grid)||void 0===t?void 0:t.visible)&&(c.grid=Object.assign({items:h[0],type:(null===(e=this._spec.grid)||void 0===e?void 0:e.smooth)?"circle":"polygon",center:s,closed:!0,sides:null===(i=this._getRelatedAxis(this._option.angleAxisIndex))||void 0===i?void 0:i.getScale().domain().length,startAngle:this._startAngle,endAngle:this._endAngle},d)),this._update(c)}_getRelatedAxis(t){if(M(t))return this._option.getComponentByIndex(this.specKey,t)}_computeLayoutRadius(){return wI((()=>this._spec.layoutRadius),this.getRefLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}computeLayoutOuterRadius(){var t;const e=null!==(t=this._spec.outerRadius)&&void 0!==t?t:this._spec.radius,i=null!=e?e:this.getRefSeriesRadius().outerRadius;return this._computeLayoutRadius()*i}computeLayoutInnerRadius(){var t;const e=null!==(t=this._spec.innerRadius)&&void 0!==t?t:this.getRefSeriesRadius().innerRadius;return this._computeLayoutRadius()*e}getRefSeriesRadius(){let t=fh,e=0;const i=this.getChart().getSpec();return AE(this.getRegions(),(s=>{const n=s;if(r=n.type,[fl.rose,fl.radar,fl.circularProgress].includes(r)){const{outerRadius:s=i.outerRadius,innerRadius:r=i.innerRadius}=n;Zo(s)&&(t=s),Zo(r)&&(e=r)}var r}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){const{grid:e}=t,i=XI(t,["grid"]);this._axisMark.getProduct().encode(Ll({},this._axisStyle,i)),this._gridMark&&this._gridMark.getProduct().encode(Ll({},this._gridStyle,e))}invert(t){var e;if("angle"===this.getOrient()&&"band"===this._scale.type){const i=this._scale.range(),s=i[i.length-1]-i[0],n=.5===(null!==(e=this.getSpec().bandPosition)&&void 0!==e?e:this._defaultBandPosition)?0:this._scale.bandwidth()/2;if(i[0]<0){const e=(t+n+Math.abs(i[0]))%s-Math.abs(i[0]);return this._scale.invert(e)}return this._scale.invert((t+n)%s)}return this._scale.invert(t)}}KI.type=r.polarAxis,KI.specKey="axes";const qI=(t,e)=>{const{tickCount:i,forceTickCount:s,tickStep:n,getRadius:r,labelOffset:a,labelGap:o=0,labelStyle:l}=e,h=null==r?void 0:r();if(!h)return RE(t.domain());let d;if(M(n))d=t.stepTicks(n);else if(M(s))d=t.forceTicks(s);else if(M(i)){const e=t.range(),s=Math.abs(e[e.length-1]-e[0]),n=xs(i)?i({axisLength:s,labelStyle:l}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),s=t.range(),n=((t,e,i)=>{var s;const{labelStyle:n,getRadius:r,labelOffset:a,labelFormatter:o,inside:l}=i,h=null==r?void 0:r(),d=null!==(s=n.angle)&&void 0!==s?s:0,c=Qk(n);return e.map((e=>{const i=o?o(e):`${e}`,{width:s,height:r}=c.quickMeasure(i),u=Math.max(s,12),p=Math.max(r,12),g=t.scale(e),m={x:0,y:0};let _=0,f=0;const v={align:n.textAlign,baseline:n.textBaseline},{x:y,y:b}=function(t,e,i,s,n){const r=Tt({x:0,y:0},i,t),a=RD(r,BD(s,r,e,n));return o=a,l=BD(s||1,a,e,n),{x:o.x+l[0],y:o.y+l[1]};var o,l}(g,m,h,a,l);return v.align||(dd(y,m.x)?v.baseline||(v.baseline=b>m.y?"top":"bottom"):y>m.x?v.align="left":yMath.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-p)}else d=t.domain();return RE(d)},ZI=(t,e,i,s)=>{let n=s;do{let s=!0;n++;let r=0;do{r+n2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&BE(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}};class JI extends KI{constructor(){super(...arguments),this.type=r.polarBandAxis,this._scale=new ix}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){const t=super.axisHelper();return Object.assign(Object.assign({},t),{getBandwidth:e=>t.getScale(e).bandwidth()})}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,qI),t}transformScaleDomain(){}}JI.type=r.polarBandAxis,JI.specKey="axes",QA(JI,vD);const QI=()=>{PP(),HP(),OP(),zP(),gD(),Xl.registerComponent(JI.type,JI)};class tF extends KI{constructor(){super(...arguments),this.type=r.polarLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new Zb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,rO),t}}tF.type=r.polarLinearAxis,tF.specKey="axes",QA(tF,iO);const eF=()=>{PP(),HP(),OP(),zP(),gD(),Xl.registerComponent(tF.type,tF)};class iF extends GI{constructor(){super(...arguments),this.type=fl.rose,this.transformerConstructor=$I,this._roseMark=null,this._labelMark=null}initMark(){this.initRoseMark()}initMarkStyle(){this.initRoseMarkStyle()}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}initRoseMark(){var t,e;this._roseMark=this._createMark(iF.mark.rose,{morph:WC(this._spec,iF.mark.rose.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(t=this._spec.rose)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.rose)||void 0===e?void 0:e.stateSort})}getRoseAngle(){var t,e,i;return null!==(i=null===(e=(t=this.angleAxisHelper).getBandwidth)||void 0===e?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))&&void 0!==i?i:.5}startAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}endAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+this.getRoseAngle()-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}initRoseMarkStyle(){const t=this._roseMark;t&&this.setMarkStyle(t,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),fill:this.getColorAttribute(),outerRadius:t=>ox(this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:t=>{var e;if(!this.getStack())return 0;const i=ox(this.radiusAxisHelper.dataToPosition([t[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return i<=Number.MIN_VALUE?this._computeLayoutRadius()*(null!==(e=this._spec.innerRadius)&&void 0!==e?e:0):i}})}initTooltip(){super.initTooltip(),this._roseMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._roseMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:0})}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._roseMark){const t={innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)}};this._roseMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("rose"))||void 0===i?void 0:i(t,s),zC("rose",this._spec,this._markAttributeContext)))}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}iF.type=fl.rose,iF.mark=UI,iF.transformerConstructor=$I;class sF extends CI{needAxes(){return!0}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.angleField,valueField:t.valueField||t.radiusField})}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class nF extends sF{_getDefaultSeriesSpec(t){var e,i,s;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:null!==(e=t.radius)&&void 0!==e?e:fh,outerRadius:null!==(i=t.outerRadius)&&void 0!==i?i:fh,innerRadius:null!==(s=t.innerRadius)&&void 0!==s?s:0,seriesField:t.seriesField,stack:t.stack,percent:t.percent})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&D(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Fa(t.crosshair||{}).map((t=>Ll({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}class rF extends fO{constructor(){super(...arguments),this.transformerConstructor=nF,this.type="rose",this.seriesType=fl.rose}}rF.type="rose",rF.seriesType=fl.rose,rF.transformerConstructor=nF,QA(rF,bO);class aF extends Cs{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center,this._center&&this._prevCenter||(this.valid=!1)}getEndProps(){return!1===this.valid?{}:Tt(this._center,this._toRadius,this._toAngle)}onBind(){const{angle:t,radius:e}=Lt(this.from,this._prevCenter),{angle:i,radius:s}=Lt(this.to,this._center);Zo(i*s)||(this.valid=!1),this._fromAngle=Zo(t)?t:i,this._fromRadius=Zo(e)?e:s,this._toAngle=i,this._toRadius=s,md(this._fromAngle,this._toAngle)&&md(this._fromRadius,this._toRadius)&&(this.valid=!1)}onUpdate(t,e,i){if(!1===this.valid)return i.x=this.to.x,void(i.y=this.to.y);if(t){const{x:t,y:e}=this.getEndProps();i.x=t,i.y=e,i.center=this._center}else{const{x:t,y:s}=Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*e,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*e},this._fromRadius+(this._toRadius-this._fromRadius)*e,this._fromAngle+(this._toAngle-this._fromAngle)*e);i.x=t,i.y=s}}}class oF extends fA{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center}onUpdate(t,e,i){this.points=this.points.map(((s,n)=>{const r=this.polarPointInterpolation(this.interpolatePoints[n][0],this.interpolatePoints[n][1],e);return t&&(i.center=this._center),r.context=s.context,r})),i.points=this.points}_interpolationSinglePoint(t,e,i){if(!Md(t)&&!Md(e))return e;const s=Lt(t,this._prevCenter),n=Lt(e,this._center);let r=Et(s.angle),a=Et(n.angle);!Zo(r)&&Zo(a)&&(r=a),Zo(r)&&!Zo(a)&&(a=r);const o=r+(a-r)*i,l=s.radius+(n.radius-s.radius)*i;return Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*i,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*i},l,o)}polarPointInterpolation(t,e,i){const{x:s,y:n}=this._interpolationSinglePoint(t,e,i),{x:r,y:a}=this._interpolationSinglePoint({x:t.x1,y:t.y1},{x:e.x1,y:e.y1},i),o=new be(s,n,r,a);return o.defined=e.defined,o}}const lF=t=>({type:"in"===t?"fadeIn":"fadeOut"});function hF(t,e,i){return"fadeIn"===e?lF(i):((t,e)=>({type:"in"===e?"growPointsIn":"growPointsOut",options:()=>({center:t.center()})}))(t,i)}function dF(t,e,i){return"fadeIn"===e?lF(i):((t,e)=>{const i=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.x},s=(t,e)=>e.getGraphicAttribute("x"),n=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.y},r=(t,e)=>e.getGraphicAttribute("y");return"in"===e?{channel:{x:{from:i,to:s},y:{from:n,to:r}}}:{channel:{x:{from:s,to:i},y:{from:r,to:n}}}})(t,i)}const cF=(t,e)=>({custom:yA,customParameters:(i,s)=>{var n;return{group:s.getGraphicItem(),startAngle:null!==(n=t.startAngle)&&void 0!==n?n:Math.PI/2,orient:"clockwise",center:t.center(),radius:t.radius(),animationType:e}}}),uF=Object.assign(Object.assign(Object.assign({},mL),eE),{area:{name:"area",type:"area"}});class pF extends GI{constructor(){super(...arguments),this.type=fl.radar,this.transformerConstructor=kE,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},r=!1!==(null===(t=this._spec.area)||void 0===t?void 0:t.visible)&&!1!==(null===(i=null===(e=this._spec.area)||void 0===e?void 0:e.style)||void 0===i?void 0:i.visible),a=null!==(s=this._spec.seriesMark)&&void 0!==s?s:"area";this.initAreaMark(n,r&&"area"===a),this.initLineMark(n,"line"===a||"area"===a&&!r),this.initSymbolMark(n,"point"===a)}initMarkStyle(){this.initAreaMarkStyle(),this.initLineMarkStyle(),this.initSymbolMarkStyle(),[this._lineMark,this._symbolMark,this._areaMark].forEach((t=>{t&&this.setMarkStyle(t,{center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()}})}))}initAreaMark(t,e){var i,s;this._areaMark=this._createMark(pF.mark.area,{groupKey:this._seriesField,progressive:t,isSeriesMark:e,customShape:null===(i=this._spec.area)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.area)||void 0===s?void 0:s.stateSort})}initAreaMarkStyle(){const t=this._areaMark;t&&(this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),x1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).x:Number.NaN,y1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).y:Number.NaN,fill:this.getColorAttribute(),curveType:tE,closePath:!0},"normal",Oy.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Oy.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"defined")})))}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._areaMark&&t.add(this._areaMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initAnimation(){var t,e,i,s;const n={center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()},radius:()=>{const t=this.getLayoutRect();return Math.min(t.width,t.height)},startAngle:M(this._spec.startAngle)?At(this._spec.startAngle):mh},r=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===r&&this._rootMark&&this._rootMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("radarGroup"))||void 0===s?void 0:s(n,r),zC("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach((([t,e])=>{if(M(t)){const i=Xl.getAnimationInKey(e);t.setAnimationConfig(HC(null==i?void 0:i(n,r),zC(t.name,this._spec,this._markAttributeContext)))}}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,s,n,r;let a=null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0;return"fill"!==e||a||(e="stroke",a=null!==(r=null===(n=this._seriesMark)||void 0===n?void 0:n.getAttribute(e,t))&&void 0!==r?r:void 0),"stroke"===e&&y(a)?a[0]:a}}}pF.type=fl.radar,pF.mark=uF,pF.transformerConstructor=kE,QA(pF,iE);class gF extends sF{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,line:t.line,point:t.point,stack:t.stack,percent:t.percent,area:Ll({visible:!1},t.area),seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"area",activePoint:t.activePoint,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Fa(t.crosshair||{}).map((t=>Ll({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class mF extends fO{constructor(){super(...arguments),this.transformerConstructor=gF,this.type="radar",this.seriesType=fl.radar}}mF.type="radar",mF.seriesType=fl.radar,mF.transformerConstructor=gF,QA(mF,bO);class _F extends cO{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=bs(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{$d(e,"trimPadding")&&Ll(e,xy(this.type,t))})),this._transformAxisSpec(t)}}class fF extends fO{constructor(){super(...arguments),this.transformerConstructor=_F,this.type="common"}}fF.type="common",fF.transformerConstructor=_F,QA(fF,bO);class vF extends iL{constructor(){super(...arguments),this.shapeTypeCallback=()=>"square"}enableByType(t){return"mark"===t}getDefaultTitlePattern(t){return{key:"link info",value:"link info"}}getDefaultContentList(){return[{key:"time",value:t=>UT.getInstance().timeFormat("%Y%m%d %H:%M",t.from.split("_")[1])},{key:"type",value:t=>t.action_type},{key:"from",value:t=>t.from},{key:"to",value:t=>t.to}]}}class yF extends yx{constructor(){super(...arguments),this.type=yF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}}yF.type="rule";const bF=()=>{Xl.registerMark(yF.type,yF),WA()},xF=Object.assign(Object.assign({},mL),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),SF=(t,e)=>{const{infoKey:i,fields:s,linkData:n,dotData:r}=e,{fromField:a,toField:o,xField:l,yField:h}=s(),d=n(),c=r(),u={};return c.forEach((t=>{const e={};for(const s in t)s!==i&&(e[s]=t[s]);const s=t[i];null==s||s.forEach((t=>{u[t.node_name]=Object.assign({},e,t)}))})),d.forEach((t=>{var e,i,s,n;t[a+"_xField"]=null===(e=null==u?void 0:u[t[a]])||void 0===e?void 0:e[l],t[a+"_yField"]=null===(i=null==u?void 0:u[t[a]])||void 0===i?void 0:i[h],t[o+"_xField"]=null===(s=null==u?void 0:u[t[o]])||void 0===s?void 0:s[l],t[o+"_yField"]=null===(n=null==u?void 0:u[t[o]])||void 0===n?void 0:n[h]})),d};class MF extends JC{constructor(){super(...arguments),this.type=fl.link}getFromField(){return this._fromField}setFromField(t){M(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){M(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){M(t)&&(this._dotSeriesSpec=t)}_getDotData(){const t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),Cp(this._option.dataSet,"linkDotInfo",SF),null===(t=this.getViewData())||void 0===t||t.transform({type:"linkDotInfo",options:{infoKey:"dots",fields:()=>({fromField:this._fromField,toField:this._toField,xField:this._dotSeriesSpec.xField,yField:this._dotSeriesSpec.yField}),linkData:()=>this._rawData.latestData,dotData:()=>this._getDotData()},level:zp.linkDotInfo},!1)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFromField(this._spec.fromField),this.setToField(this._spec.toField),this.setDotTypeField(this._spec.dotTypeField),this.setDotSeriesSpec(this._spec.dotSeriesSpec)}initMark(){this._clipMark=this._createMark(MF.mark.group),this._containerMark=this._createMark(MF.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(MF.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(MF.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,s;const n=this._clipMark;n&&(this.setMarkStyle(n,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Oy.Series),n.setInteractive(!1));const r=this._containerMark;r&&(this.setMarkStyle(r,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",Oy.Series),r.setInteractive(!1));const a=this._linkMark;a&&this.setMarkStyle(a,{stroke:this.getColorAttribute(),strokeOpacity:this.dataToOpacity.bind(this),x:this.dataToPositionXFrom.bind(this),y:this.dataToPositionYFrom.bind(this),x1:this.dataToPositionXTo.bind(this),y1:this.dataToPositionYTo.bind(this)},"normal",Oy.Series);const o=this._arrowMark;if(o){const n=null!==(s=null===(i=null===(e=null===(t=this._theme)||void 0===t?void 0:t.arrow)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)&&void 0!==s?s:10;this.setMarkStyle(o,{x:this.dataToPositionXTo.bind(this),y:t=>this.dataToPositionArrowYTo(t,n),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:n,symbolType:t=>this.isPositionYFromHigher(t)?"triangleDown":"triangleUp"},"normal",Oy.Series)}}afterInitMark(){super.afterInitMark()}dataToPositionXFrom(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:i}=this._yAxisHelper,s=this.isPositionYFromHigher(t)?-e/2:e/2;return i(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})+s}dataToOpacity(t){return this.isPositionXOuterRange(t,this._fromField+"_xField")||this.isPositionXOuterRange(t,this._toField+"_xField")||t[this._fromField]===t[this._toField]?0:1}isPositionYFromHigher(t){return this.dataToPositionYFrom(t)s(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:xT}}initInteraction(){const t=[];this._linkMark&&t.push(this._linkMark),this._arrowMark&&t.push(this._arrowMark),this._parseInteractionConfig(t)}initTooltip(){this._tooltipHelper=new vF(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotInfoData(){var t,e;return null===(e=null!==(t=this._linkMark)&&void 0!==t?t:this._arrowMark)||void 0===e?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}MF.type=fl.link,MF.mark=xF;class kF extends iL{constructor(){super(...arguments),this.shapeTypeCallback=()=>"square"}enableByType(t){return"mark"===t}getDefaultTitlePattern(t){return{key:"event info",value:"event info"}}getDefaultContentList(){return[{key:t=>t.type,value:t=>t.id},{key:"event_time",value:t=>UT.getInstance().timeFormat("%Y%m%d",t.event_time)},{key:"action_type",value:t=>t.action_type},{key:"children",value:t=>t.children}]}getTooltipData(t,e,i,s,n){var r,a,o,l;const h=super.getTooltipData(t,e,i,s,n),d=null!==(o=null===(a=null===(r=this.spec)||void 0===r?void 0:r[t])||void 0===a?void 0:a.updateContent)&&void 0!==o?o:null===(l=null==e?void 0:e[t])||void 0===l?void 0:l.updateContent;return h&&!d&&(h.updateContent=(t,e,i)=>{const s=[],n=t.filter((t=>"children"===t.key));return n.length>0&&n[0].value.forEach((t=>{let e=!0;for(const i in t)s.push(Object.assign(Object.assign({},n[0]),{shapeType:"circle",hasShape:e,key:i,value:t[i]+""})),e=!1})),t.concat(s)}),h}}const AF=(t,e)=>{var i;const s=(null===(i=t[0])||void 0===i?void 0:i.latestData)?t[0].latestData:t||[],n=[];return s.forEach((t=>{const i={};for(const s in t)s!==e&&(i[s]=t[s]);const s=t[e];null==s||s.forEach((t=>{n.push(Object.assign({},i,t))}))})),n},wF={fill:"#bbb",fillOpacity:.2};class TF extends yx{getTextType(){return this._textType}constructor(t,e){super(t,e),this.type=TF.type,this._textType="text"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}initStyleWithSpec(t,e){super.initStyleWithSpec(t,e),t.textType&&(this._textType=t.textType)}compileEncode(){super.compileEncode(),"rich"===this._textType&&this._product.encodeState("group",{textType:this._textType})}}TF.type="text";const LF=()=>{Xl.registerMark(TF.type,TF),UA(),Mx(),ik(),fc.registerGraphic(Qd.richtext,UM)},CF=Object.assign(Object.assign({},mL),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}});class EF extends JC{constructor(){super(...arguments),this.type=fl.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){M(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){M(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){M(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){M(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){M(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map((t=>t[this._fieldY[0]])),Cp(this._option.dataSet,"objFlat",AF),Cp(this._option.dataSet,"copyDataView",Fp),Ep(this._option.dataSet,"dataview",b),null===(t=this.getViewData())||void 0===t||t.transform({type:"objFlat",options:"dots",level:zp.dotObjFlat},!1)}getStatisticFields(){return[{key:this._fieldY[0],operations:["values"],customize:this._xDimensionStatisticsDomain}]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setSeriesGroupField(this._spec.seriesGroupField),this.setTitleField(this._spec.titleField),this.setSubTitleField(this._spec.subTitleField),this.setDotTypeField(this._spec.dotTypeField),this.setHighLightSeriesGroup(this._spec.highLightSeriesGroup),this.setGridBackground(Ll(wF,(null===(t=this._spec.grid)||void 0===t?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(EF.mark.group),this._containerMark=this._createMark(EF.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(EF.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(EF.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(EF.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(EF.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(EF.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(EF.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){const t=this._clipMark;t&&(this.setMarkStyle(t,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Oy.Series),t.setInteractive(!1));const e=this._containerMark;e&&(this.setMarkStyle(e,{x:this._spec.leftAppendPadding},"normal",Oy.Series),e.setInteractive(!1));const i=this._gridBackgroundMark;i&&this.setMarkStyle(i,{x:this.getRegionRectLeft.bind(this),x1:this.getRegionRectRight.bind(this),y:this.dataToGridBackgroundPositionY.bind(this),y1:this.dataToGridBackgroundPositionY1.bind(this),fill:this._gridBackground.fill,fillOpacity:this.dataToGridBackgroundOpacity.bind(this)},"normal",Oy.Series);const s=this._gridMark;s&&this.setMarkStyle(s,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",Oy.Series);const n=this._dotMark;n&&this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",Oy.Series);const r=this._titleMark;r&&this.setMarkStyle(r,{fill:this.getColorAttribute(),text:t=>t[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Oy.Series);const a=this._subTitleMark;a&&this.setMarkStyle(a,{fill:this.getColorAttribute(),text:t=>t[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Oy.Series);const o=this._symbolMark;o&&this.setMarkStyle(o,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",Oy.Series)}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})-i(0)/2}dataToGridBackgroundPositionY1(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})+i(0)/2}dataToOpacity(t){var e,i,s,n;if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:r,getScale:a}=this._xAxisHelper;return r(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})a(0).range()[1]?0:null!==(n=null===(s=null===(i=null===(e=this._theme)||void 0===e?void 0:e.dot)||void 0===i?void 0:i.style)||void 0===s?void 0:s.fillOpacity)&&void 0!==n?n:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(t){var e,i;super.onLayoutEnd(t);const s=null!==(i=null===(e=this._spec)||void 0===e?void 0:e.leftAppendPadding)&&void 0!==i?i:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+s},"normal",Oy.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._seriesGroupField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:xT}}getDotColorScale(){var t,e,i;const s=this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?null===(i=this.getViewDataStatistics())||void 0===i?void 0:i.latestData[this._seriesField].values:[],n=this._getDataScheme();return(new nx).domain(s).range(n)}getDotColorAttribute(){var t,e,i,s;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this.getDotColorScale(),field:null!==(s=null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesGroupField)&&void 0!==i?i:this._seriesField)&&void 0!==s?s:xT}}initTooltip(){this._tooltipHelper=new kF(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotData(){var t;return null===(t=this._dotMark)||void 0===t?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}EF.type=fl.dot,EF.mark=CF;class DF extends cO{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Fa(e.data)[0];return t instanceof R?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Fa(t.data).find(((t,i)=>e.dataId?t instanceof R?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof R?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;super.transformSpec(t);let _=0;const f=[],v=[],y=[],b=[],x=[],S=(this._option.getCompiler().getVGrammarView().width(),this._option.getCompiler().getVGrammarView().height());let M=0;if(null==t?void 0:t.legends){f.push({modelId:`legendRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${_}`);const o=Fa(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=nl(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:_,size:l}),M+=l,_++}(null==t?void 0:t.dataZoom)&&(f.push({modelId:`dataZoomRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${_}`),M+=60,_++,this.addPaddingRow(x,_,10),M+=10,_++),M+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(v,f,_,t),_++);const k=t.series.filter((t=>t.type!==fl.link)).length,A=(S-M-20*k)/k,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(d=null==t?void 0:t.appendPadding)||void 0===d?void 0:d.right)||0;null===(c=null==t?void 0:t.series)||void 0===c||c.forEach((e=>{var i,s;if([fl.bar,fl.line,fl.area,fl.dot].includes(e.type)){if(f.push({modelId:`${e.type}Row${_}`,col:1,row:_}),f.push({modelId:`axesLeftRow${_}`,col:0,row:_}),v.push({id:`${e.type}Row${_}`,clip:!1}),x.push({index:_,size:(null==e?void 0:e.height)||A}),y.push({orient:"left",id:`axesLeftRow${_}`,type:e.type===fl.dot?"band":"linear",visible:e.type!==fl.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:v.length-1}),e.type===fl.dot){f.push({modelId:`scrollBarRightRow${_}`,col:2,row:_});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||A)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===fl.dot&&s<1,id:`scrollBarRightRow${_}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:v.length-1,axisId:`axesLeftRow${_}`},Fa(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=v.length-1,_++,this.addPaddingRow(x,_,(null==e?void 0:e.padding)||20),_++,e.leftAppendPadding=w,e.type===fl.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,_,20),_++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===fl.link){const i=e.dotSeriesIndex+1;f.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[v.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(v,f,_,t),_++);const L={type:"grid",col:4,row:_,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:f};t.layout=L,t.region=v,null===(m=t.axes)||void 0===m||m.push(...y),t.scrollBar=b}}class PF extends fO{constructor(){super(...arguments),this.transformerConstructor=DF,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=function(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);nt.type="linear"))}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{x2Field:null==t?void 0:t.x2Field,y2Field:null==t?void 0:t.y2Field,barMinHeight:null==t?void 0:t.barMinHeight,barBackground:null==t?void 0:t.barBackground})}}class RF extends fO{constructor(){super(...arguments),this.transformerConstructor=OF}}RF.transformerConstructor=OF,QA(RF,bO);class BF extends OF{transformSpec(t){super.transformSpec(t),vy(t)}}class IF extends RF{constructor(){super(...arguments),this.transformerConstructor=BF,this.type="histogram",this.seriesType=fl.bar}}IF.type="histogram",IF.seriesType=fl.bar,IF.transformerConstructor=BF;class FF extends RF{constructor(){super(...arguments),this.transformerConstructor=BF,this.type="histogram3d",this.seriesType=fl.bar3d}}FF.type="histogram3d",FF.seriesType=fl.bar3d,FF.transformerConstructor=BF;const YF=Object.assign(Object.assign({},mL),{group:{name:"group",type:"group"}});class jF extends lI{constructor(){super(...arguments),this._arcGroupMark=null,this._getAngleValueStart=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?kT:RT],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle);let o;if(M(s)){const t=nb(n,(t=>t.value-s)),e=t>=n.length||s>n[t].value-r/2?Math.min(t,n.length-1):t>0?t-1:void 0;void 0!==e&&(o=this.angleAxisHelper.dataToPosition([n[e].value-r/2]))}return D(o)&&(o=this.angleAxisHelper.dataToPosition([n[0].value-r/2])),o+a}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?AT:this._angleField[0]],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle),o=nb(n,(t=>t.value-s)),l=o>=n.length||s>n[o].value-r/2?Math.min(o,n.length-1):o>0?o-1:void 0;let h;return h=void 0!==l?this.angleAxisHelper.dataToPosition([n[l].value+r/2]):this.angleAxisHelper.dataToPosition([n[0].value-r/2]),h+a}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();const s=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getSpec(),n=null!==(e=this._spec.startAngle)&&void 0!==e?e:null==s?void 0:s.startAngle;this._startAngle=M(n)?At(n):mh;const r=null!==(i=this._spec.endAngle)&&void 0!==i?i:null==s?void 0:s.endAngle;this._endAngle=M(r)?At(r):_h,this.setAngleField(this._spec.valueField||this._spec.angleField),this.setRadiusField(this._spec.categoryField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice()}getStackGroupFields(){return this._radiusField}getStackValueField(){var t;return null===(t=this._angleField)||void 0===t?void 0:t[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){const e=super._convertMarkStyle(t);if(e.fill){const i=t.fill;"conical"!==(null==i?void 0:i.gradient)||M(null==i?void 0:i.startAngle)||M(null==i?void 0:i.endAngle)||(e.fill=Object.assign(Object.assign({},i),{startAngle:this._startAngle,endAngle:this._endAngle}))}return e}_getAngleValueStartWithoutMask(t){if(this.getStack()){const e=ox(this.angleAxisHelper.dataToPosition([t[kT]]),this.angleAxisHelper.getScale(0));if(Zo(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this.getStack()){const e=ox(this.angleAxisHelper.dataToPosition([t[AT]]),this.angleAxisHelper.getScale(0));if(Zo(e))return e}return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(jF.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){const t=this._arcGroupMark;t.setZIndex(this.layoutZIndex),t.created(),this.setMarkStyle(t,{x:0,y:0},"normal",Oy.Series),t.setClip((()=>{const t=this._getAngleAxis();if(this._isTickMaskVisible(t)){const{tickMask:e}=this._spec,{angle:i,offsetAngle:s,style:n={}}=e,r=this._getAngleAxisSubTickData(t),{x:a,y:o}=this.angleAxisHelper.center(),l=this._computeLayoutRadius(),h=n;return r.map((({value:t})=>{const e=this.angleAxisHelper.dataToPosition([t])+At(s),n=At(i)/2;return wx(Object.assign(Object.assign({},h),{x:a,y:o,startAngle:e-n,endAngle:e+n,innerRadius:l*this._innerRadius,outerRadius:l*this._outerRadius,fill:!0}))}))}const{width:e,height:i}=this.getLayoutRect();return[qv({width:e,height:i,fill:!0})]})),this._arcGroupMark.setInteractive(!1)}_getAngleAxis(){if(!this.angleAxisHelper)return;const t=this.angleAxisHelper.getAxisId();return this._option.getChart().getAllComponents().find((e=>e.id===t))}_getAngleAxisTickData(t){var e;return null===(e=null==t?void 0:t.getTickData())||void 0===e?void 0:e.getLatestData()}_isTickMaskVisible(t){const e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&!1!==i.visible&&(null==e?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;const i=this._getAngleAxisTickData(t),s=[],{subTick:n={},tick:r={}}=null!==(e=null==t?void 0:t.getSpec())&&void 0!==e?e:{},{tickCount:a=4}=n,{alignWithLabel:o}=r;if((null==i?void 0:i.length)>=2){const t=i[1].value-i[0].value;for(let e=0;e({type:"growAngleIn",options:{overall:t.startAngle}}))(t)}const VF=()=>{Xl.registerAnimation("circularProgress",((t,e)=>({appear:NF(t,e),enter:{type:"growAngleIn"},disappear:{type:"growAngleOut"}})))};class WF extends XC{constructor(){super(...arguments),this._supportStack=!0}}class GF extends jF{constructor(){super(...arguments),this.type=fl.circularProgress,this.transformerConstructor=WF,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){const e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(Zo(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){const s=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+(null===(i=(e=this.radiusAxisHelper).getBandwidth)||void 0===i?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(Zo(s))return s}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])+this.radiusAxisHelper.getScale(0).step()}}getStackGroupFields(){return this.getGroupFields()}getGroupFields(){return this._radiusField}initMark(){super.initMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){super.initMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e;return this._progressMark=this._createMark(GF.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0,customShape:null===(t=this._spec.progress)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.progress)||void 0===e?void 0:e.stateSort}),this._progressMark}_initProgressMarkStyle(){var t;const e=this._progressMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart,endAngle:this._getAngleValueEnd,innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",Oy.Series)}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initTooltip(){super.initTooltip(),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark)}_initTrackMark(){var t,e;return this._trackMark=this._createMark(GF.mark.track,{parent:this._arcGroupMark,customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&this.setMarkStyle(t,{visible:t=>{const e=this.angleAxisHelper.getScale(0).range(),i=Math.min(e[0],e[e.length-1]),s=this._getAngleValueStartWithoutMask(t);return Math.abs(s-i)<=1e-14},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{const t=this.getStack()?kT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[t]:e[0]})},endAngle:()=>{const t=this.getStack()?AT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueEnd({[t]:e[e.length-1]})},innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:100},"normal",Oy.Series)}initAnimation(){var t,e,i,s;const n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),zC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),zC("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}GF.type=fl.circularProgress,GF.mark=HF,GF.transformerConstructor=WF;class UF extends CI{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,categoryField:t.categoryField||t.radiusField,valueField:t.valueField||t.angleField,startAngle:t.startAngle,endAngle:t.endAngle,radius:t.radius,innerRadius:t.innerRadius,centerX:t.centerX,centerY:t.centerY})}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),D(l.type)&&(l.type="linear"),D(o.type)&&(o.type="band");const h=$E(l,{min:0,max:1});D(l.min)&&(l.min=h.min),D(l.max)&&(l.max=h.max),s&&Object.assign(l,Ll({},s,l)),n&&Object.assign(o,Ll({},n,o))}}class $F extends UF{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{cornerRadius:null!==(e=t.cornerRadius)&&void 0!==e?e:0,roundCap:null!==(i=t.roundCap)&&void 0!==i&&i,progress:t.progress,track:t.track,tickMask:t.tickMask})}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}class XF extends fO{constructor(){super(...arguments),this.transformerConstructor=$F,this.type="circularProgress",this.seriesType=fl.circularProgress}}XF.type="circularProgress",XF.seriesType=fl.circularProgress,XF.transformerConstructor=$F,QA(XF,bO);const KF=Object.assign(Object.assign({},YF),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),qF=Object.assign(Object.assign({},mL),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),ZF={type:"fadeIn"};class JF extends XC{constructor(){super(...arguments),this._supportStack=!1}}class QF extends iL{enableByType(t){return"dimension"!==t}}class tY extends jF{constructor(){super(...arguments),this.type=fl.gaugePointer,this.transformerConstructor=JF,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(tY.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},tY.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(tY.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new QF(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return M(this.radiusAxisHelper)&&M(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=ja(e),s=Ha(e),n=Rs(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),d=Math.sin(l);return{x:a*h+o*d,y:-(o*h-a*d)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}initInteraction(){this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),zC("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}tY.type=fl.gaugePointer,tY.mark=qF,tY.transformerConstructor=JF;const eY=()=>{Xl.registerSeries(tY.type,tY),UB(),FO(),Xl.registerAnimation("gaugePointer",((t,e)=>{const i=function(t,e){return"fadeIn"===e?ZF:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),QI(),eF()};class iY extends XC{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class sY extends jF{constructor(){super(...arguments),this.type=fl.gauge,this.transformerConstructor=iY,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=At(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),Cp(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[BT]=t[this._angleField[0]],t[RT]=e>0?i[e-1][BT]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(sY.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(sY.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Kb(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Kb(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueStartWithoutPadAngle(t){return M(t[RT])?this.angleAxisHelper.dataToPosition([t[RT]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[BT]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),zC("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}sY.type=fl.gauge,sY.mark=KF,sY.transformerConstructor=iY;class nY extends UF{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{radiusField:t.radiusField,pin:t.pin,pinBackground:t.pinBackground,pointer:t.pointer})}_getDefaultCircularProgressSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:fl.circularProgress})}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===fl.gauge||t.type===fl.circularProgress));D(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(D(a.radiusField)&&D(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),D(a.valueField)&&D(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===fl.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:Dy.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),D(i.angle.type)&&(i.angle.type="linear"),D(i.radius.type)&&(i.radius.type="linear"),D(i.angle.zIndex)&&(i.angle.zIndex=Dy.Region+50)}}class rY extends fO{constructor(){super(...arguments),this.transformerConstructor=nY,this.type="gauge",this.seriesType=fl.gaugePointer}}rY.type="gauge",rY.seriesType=fl.gaugePointer,rY.transformerConstructor=nY;class aY extends cO{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class oY extends fO{constructor(){super(...arguments),this.transformerConstructor=aY,this.type="wordCloud",this.seriesType=fl.wordCloud}}oY.transformerConstructor=aY;const lY=[0],hY=[20,40],dY=[200,500],cY={shrink:!1,enlarge:!1,fontSizeLimitMin:0},uY=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon","rect"],pY=`${nh}_WORD_CLOUD_TEXT`,gY=Object.assign(Object.assign({},mL),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"},wordMask:{name:"wordMask",type:"rect"}});class mY extends KC{constructor(){super(...arguments),this._fontSizeRange=[20,20],this._isWordCloudShape=!1,this._dataChange=!0,this.handleMaskCanvasUpdate=(t,e)=>{this._maskCanvas=t},this.getWordColor=t=>t.isFillingWord?(this._fillingColorCallback&&!this._dataChange||(this._fillingColorCallback=this._wordCloudShapeConfig.fillingColorHexField?t=>t[this._wordCloudShapeConfig.fillingColorHexField]:this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField,!0)),this._fillingColorCallback(t)):(this._keyWordColorCallback&&!this._dataChange||(this._keyWordColorCallback=this._spec.colorHexField?t=>t[this._spec.colorHexField]:this.initColorCallback(this._seriesField,!1)),this._keyWordColorCallback(t)),this._calculateFontWeight=t=>{const e=this.getRawDataStatisticsByField(this._valueField,!0);return e.min===e.max?this._fontWeightRange[0]:this._fontWeightRange[0]+(this._fontWeightRange[this._fontWeightRange.length-1]-this._fontWeightRange[0])*(t[this._valueField]-e.min)/(e.max-e.min)}}setValueField(t){M(t)&&(this._valueField=t)}setFontSizeRange(t){M(t)?this._fontSizeRange=t:this._fontSizeRange=hY}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._colorMode=null!==(t=this._spec.colorMode)&&void 0!==t?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=null!==(e=this._spec.fontWeightRange)&&void 0!==e?e:dY,this._rotateAngles=null!==(i=this._spec.rotateAngles)&&void 0!==i?i:lY,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=null!==(s=this._spec.maskShape)&&void 0!==s?s:"circle",this._textField=(null===(n=this._spec.word)||void 0===n?void 0:n.formatMethod)?pY:this._nameField;const r=this._spec.wordCloudConfig;this._wordCloudConfig=Object.assign({drawOutOfBound:"hidden",layoutMode:"default",zoomToFit:cY},this._spec.wordCloudConfig),r&&!D(r.layoutMode)||cl(this._option.mode)||(this._wordCloudConfig.layoutMode="fast"),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:lY,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._isWordCloudShape=!uY.includes(this._maskShape)&&!["fast","grid","cloud"].includes(this._wordCloudConfig.layoutMode),this._defaultFontFamily=this._option.getTheme().fontFamily}initData(){var t,e;super.initData(),null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.target)||void 0===e||e.addListener("change",(()=>{this._dataChange=!0,this.compile()}))}initMark(){var t;(null===(t=this._spec.wordMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(mY.mark.wordMask,{dataView:!1})),this._wordMark=this._createMark(mY.mark.word,{key:bT,defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){this.initMarkStyleOfWord(this._wordMark,this._spec.word,this._spec.colorHexField,this._seriesField),this._maskMark&&this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,background:()=>this._maskCanvas},"normal",Oy.Series)}initMarkStyleOfWord(t,e,i,s,n){var r,a;t&&(this.setMarkStyle(t,{text:(null==e?void 0:e.formatMethod)?t=>e.formatMethod(t):t=>t[this._textField],x:t=>t.x,y:t=>t.y,fontSize:t=>t.fontSize,fontStyle:t=>t.fontStyle,angle:t=>t.angle,visible:t=>t.visible},"normal",Oy.Series),this.setMarkStyle(t,{fill:null!==(a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:this.getWordColor,fontWeight:t=>t.fontWeight,fontFamily:t=>t.fontFamily},"normal",Oy.User_Mark))}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark)}initAnimation(){[this._wordMark].forEach((t=>{var e,i;if(t){const s=null===(i=null===(e=this._spec)||void 0===e?void 0:e.animationAppear)||void 0===i?void 0:i.preset,n={animationConfig:()=>{var e,i;return null===(i=null===(e=t.getAnimationConfig())||void 0===e?void 0:e.appear)||void 0===i?void 0:i[0]}};t.setAnimationConfig(HC(Xl.getAnimationInKey("wordCloud")(n,s),zC("word",this._spec,this._markAttributeContext)))}}))}getWordOrdinalColorScale(t,e){var i,s,n,r,a;const o=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,l=t?null===(i=this.getViewData())||void 0===i?void 0:i.latestData.map((e=>e[t])):[],h=null!==(n=null!=o?o:null===(s=this._option.globalScale.getScale("color"))||void 0===s?void 0:s.range())&&void 0!==n?n:this._getDataScheme();return null===(a=(r=(new nx).domain(l)).range)||void 0===a?void 0:a.call(r,h)}initColorCallback(t,e){var i,s,n,r;if("ordinal"===this._colorMode){const i=this.getWordOrdinalColorScale(t,e);return e=>i.scale(e[null!=t?t:xT])}const a=null!==(i=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)&&void 0!==i?i:this._option.globalScale.getScale("color").range();if(1===a.length)return t=>a[0];if(this._valueField){const t=this.getRawDataStatisticsByField(this._valueField,!0);if(t.min===t.max)return a[0];const e=(new Zb).domain([t.min,t.max]).range(a);return t=>e.scale(t[this._valueField])}const o=(new Zb).domain([0,null!==(r=null===(n=null===(s=this.getViewData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)&&void 0!==r?r:1]).range(a);return t=>o.scale(t[yT])}compile(){super.compile();const{width:t,height:e}=this._region.getLayoutRect();if(!Zo(t)||!Zo(e)||!(e>0&&t>0))return;const i=[];this._isWordCloudShape?i.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):i.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.getProduct().transform(i)}_getCommonTransformOptions(){var t,e,i,s,n,r;const{width:a,height:o}=this._region.getLayoutRect(),l=null!==(t=this._spec.word)&&void 0!==t?t:{},h=null!==(e=l.style)&&void 0!==e?e:{};return{size:[a,o],shape:bs(this._maskShape)&&"text"===this._maskShape.type&&D(this._maskShape.fontFamily)?Object.assign({fontFamily:null===(i=this._option.getTheme())||void 0===i?void 0:i.fontFamily},this._maskShape):this._maskShape,onUpdateMaskCanvas:this.handleMaskCanvasUpdate,dataIndexKey:bT,text:l.formatMethod?t=>l.formatMethod(t):{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:"auto"===this._fontSizeRange?null:this._fontSizeRange,padding:null!==(n=null===(s=this._spec.word)||void 0===s?void 0:s.padding)&&void 0!==n?n:1,fontFamily:M(this._spec.fontFamilyField)?{field:this._spec.fontFamilyField}:null!==(r=h.fontFamily)&&void 0!==r?r:this._defaultFontFamily,fontWeight:M(this._spec.fontWeightField)?{field:this._spec.fontWeightField}:M(h.fontWeight)?h.fontWeight:M(this._valueField)?this._calculateFontWeight:"normal",fontStyle:M(this._spec.fontStyleField)?{field:this._spec.fontStyleField}:h.fontStyle}}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},this._getCommonTransformOptions()),{layoutType:this._wordCloudConfig.layoutMode,rotate:this._rotateAngles,randomVisible:null===(t=this._spec.random)||void 0===t||t,clip:"clip"===this._wordCloudConfig.drawOutOfBound,shrink:this._wordCloudConfig.zoomToFit.shrink,enlarge:this._wordCloudConfig.zoomToFit.enlarge,minFontSize:this._wordCloudConfig.zoomToFit.fontSizeLimitMin,progressiveTime:this._wordCloudConfig.progressiveTime,progressiveStep:this._wordCloudConfig.progressiveStep,repeatFill:this._wordCloudConfig.zoomToFit.repeat})}_wordCloudShapeTransformOption(){var t,e,i,s,n,r;const a=null!==(e=null===(t=this._spec.fillingWord)||void 0===t?void 0:t.style)&&void 0!==e?e:{},o=null!==(i=this._wordCloudShapeConfig)&&void 0!==i?i:{};return Object.assign(Object.assign(Object.assign({},o),this._getCommonTransformOptions()),{rotateList:this._rotateAngles,fillingRotateList:o.fillingRotateAngles,fillingFontFamily:M(o.fillingFontFamilyField)?{field:o.fillingFontFamilyField}:null!==(s=a.fontFamily)&&void 0!==s?s:this._defaultFontFamily,fillingPadding:null!==(r=null===(n=this._spec.fillingWord)||void 0===n?void 0:n.padding)&&void 0!==r?r:1,fillingFontStyle:M(o.fillingFontStyleField)?{field:o.fillingFontStyleField}:a.fontStyle,fillingFontWeight:M(o.fillingFontWeightField)?{field:o.fillingFontWeightField}:a.fontWeight})}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}dataToPositionZ(t){return null}valueToPosition(t,e){return null}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}onLayoutEnd(t){super.onLayoutEnd(t),this.compile(),this._dataChange=!1}getActiveMarks(){return[this._wordMark]}reInit(){super.reInit(),this._keyWordColorCallback&&(this._keyWordColorCallback=null),this._fillingColorCallback&&(this._fillingColorCallback=null)}}mY.mark=gY;const _Y=t=>({custom:xA,customParameters:(e,i)=>t,easing:"linear",loop:1/0,duration:6e3});function fY(t,e){return!1===e?{}:"fadeIn"===e?{type:"fadeIn"}:(t=>({channel:{fontSize:{from:0}},duration:200,delay:(e,i,s)=>{const n=t.animationConfig(),r=(null==n?void 0:n.duration)||200,a=(null==n?void 0:n.totalTime)||LC.appear.duration,o=s.VGRAMMAR_ANIMATION_PARAMETERS.elementCount;return s.VGRAMMAR_ANIMATION_PARAMETERS.elementIndex*function(t,e,i){return t*i{Xl.registerAnimation("wordCloud",((t,e)=>({appear:fY(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}})))},yY=()=>{Xl.registerAnimation("wordCloud3d",(t=>({appear:_Y(t)})))},bY={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:xY,triangle:xY,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 xY(){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))}}function SY(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}const MY=t=>bY[t]?bY[t]():bY.circle();function kY(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}const AY=(t,e)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)";function wY(t){return xs(t)?t:function(){return t}}class TY{constructor(t){var e,i;switch(this.options=E({},TY.defaultOptions,t),xs(this.options.shape)?this.shape=this.options.shape:this.shape=MY(this.options.shape),this.getText=null!==(e=wY(this.options.text))&&void 0!==e?e:t=>t,this.getTextFontWeight=wY(this.options.fontWeight),this.getTextFontSize=wY(this.options.fontSize),this.getTextFontStyle=wY(this.options.fontStyle),this.getTextFontFamily=wY(this.options.fontFamily),this.outputCallback=null!==(i=this.options.outputCallback)&&void 0!==i?i:t=>t,this.options.color){case"random-dark":this.getTextColor=()=>AY(10,50);break;case"random-light":this.getTextColor=()=>AY(50,90);break;default:this.getTextColor=wY(this.options.color)}if(D(this.options.rotate))if(this.options.useRandomRotate){const t=Math.abs(this.options.maxRotation-this.options.minRotation),e=Math.abs(Math.floor(this.options.rotationSteps)),i=Math.min(this.options.maxRotation,this.options.minRotation);this.getTextRotate=()=>0===this.options.rotateRatio||Math.random()>this.options.rotateRatio?0:0===t?i:e>0?i+Math.floor(Math.random()*e)*t/(e-1):i+Math.random()*t}else this.getTextRotate=()=>0;else this.getTextRotate=xs(this.options.rotate)?t=>{var e;return At(null!==(e=this.options.rotate(t))&&void 0!==e?e:0)}:(t,e)=>{const i=Fa(this.options.rotate),s=this.options.random?Math.random():kY(e);return At(i[Math.floor(s*i.length)])}}canRepeat(){return!1}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>=((null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1)*this.options.progressiveStep:this.options.progressiveTime>0&&(new Date).getTime()-this.escapeTime>this.options.progressiveTime}progressiveRun(){var t;if(this.options.progressiveStep>0?this.currentStepIndex=(null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndexi)&&(t++,e=0,this.failCount=n?0:this.failCount+1),this.progressiveIndex=t,this.exceedTime())break;t===this.data.length&&this.failCountObject.assign(Object.assign({},t),{isFill:!0})))],this.isTryRepeatFill=!0)}return this.progressiveResult}return this.result}initProgressive(){this.failCount=0,this.progressiveIndex=0,this.options.progressiveStep>0?this.currentStepIndex=-1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.progressiveResult=[]}output(){return this.result?this.outputCallback(this.result):null}progressiveOutput(){return this.progressiveResult?this.outputCallback(this.progressiveResult):null}unfinished(){return this.data&&this.data.length&&!D(this.progressiveIndex)&&this.progressiveIndex[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};class CY extends TY{constructor(t){var e;super(E({},CY.defaultOptions,t)),this.cw=64,this.ch=2048,this._size=[256,256],this._isBoardExpandCompleted=!1,this._placeStatus=0,this._tTemp=null,this._dtTemp=null,this._dy=0,this.cacheMap=new Map,this.options.minFontSize<=CY.defaultOptions.minFontSize&&(this.options.minFontSize=CY.defaultOptions.minFontSize),this.spiral=S(this.options.spiral)?null!==(e=LY[this.options.spiral])&&void 0!==e?e:LY.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=wY(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){const e=this.data[t];if(""===(""+e.text).trim())return!0;const{maxRadius:i,center:s}=SY(this.options.shape,this._size);if(e.x=s[0],e.y=s[1],function(t,e,i,s,n,r){if(e.sprite)return;const a=t.context,o=t.ratio;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,(n<<5)/o,r/o);let l=0,h=0,d=0;const c=i.length;let u,p,g,m,_;for(--s;++s>5<<5,g=~~Math.max(Math.abs(n+r),Math.abs(n-r))}else u=u+31>>5<<5;if(g>d&&(d=g),l+u>=n<<5&&(l=0,h+=d,d=0),h+g>=r)break;a.translate((l+(u>>1))/o,(h+(g>>1))/o),e.angle&&a.rotate(e.angle),a.fillText(e.text,0,0),e.padding&&(a.lineWidth=2*e.padding,a.strokeText(e.text,0,0)),a.restore(),e.width=u,e.height=g,e.xoff=l,e.yoff=h,e.x1=u>>1,e.y1=g>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=u}const f=a.getImageData(0,0,(n<<5)/o,r/o).data,v=[];for(;--s>=0;){if(!(e=i[s]).hasText)continue;for(u=e.width,p=u>>5,g=e.y1-e.y0,m=0;m>5),i=f[(h+_)*(n<<5)+(l+m)<<2]?1<<31-m%32:0;v[e]|=i,t|=i}t?r=_:(e.y0++,g--,_--,h++)}e.y1=e.y0+r,e.sprite=v.slice(0,(e.y1-e.y0)*p)}}(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i))return this.result.push(e),this._bounds?function(t,e){const i=t[0],s=t[1];e.x+e.x0s.x&&(s.x=e.x+e.x1),e.y+e.y1>s.y&&(s.y=e.y+e.y1)}(this._bounds,e):this._bounds=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=this._size[0]>>1,e.y-=this._size[1]>>1,this._tTemp=null,this._dtTemp=null,!0;if(this.updateBoardExpandStatus(e.fontSize),e.hasText&&this.shouldShrinkContinue()){if(1===this._placeStatus){const t=e.fontSize*this._originSize[0]/this.options.minFontSize,i=Math.max(e.width,e.height);if(i<=t)this.expandBoard(this._board,this._bounds,i/this._size[0]);else{if(!this.options.clip)return!0;this.expandBoard(this._board,this._bounds,t/this._size[0])}}else this._placeStatus,this.expandBoard(this._board,this._bounds);return this.updateBoardExpandStatus(e.fontSize),!1}return this._tTemp=null,this._dtTemp=null,!0}layout(t,e){this.initProgressive(),this.result=[],this._size=[e.width,e.height],this.clearCache(),this._originSize=[...this._size];const i=this.getContext(No.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null,t.length,this.result=[];const s=t.map(((t,e)=>({text:this.getText(t),fontFamily:this.getTextFontFamily(t),fontStyle:this.getTextFontStyle(t),fontWeight:this.getTextFontWeight(t),angle:this.getTextRotate(t,e),fontSize:~~this.getTextFontSize(t),padding:this.getTextPadding(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:t,x:0,y:0,width:0,height:0}))).sort((function(t,e){return e.fontSize-t.fontSize}));if(this.originalData=s,this.data=s,this.progressiveRun(),!this.options.clip&&this.options.enlarge&&this._bounds&&this.shrinkBoard(this._bounds),this._bounds&&["cardioid","triangle","triangle-upright"].includes(this.options.shape)){const t=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(t-this._size[1]/2)}return this.result}formatTagItem(t){const e=this._size,i=this.zoomRatio(),s=this.dy(),n=e[0]>>1,r=e[1]>>1,a=t.length,o=[];let l,h;for(let e=0;e=this._size[0]||i.y>=this._size[1])return;const s=Math.min(e.x,this._size[0]-i.x),n=Math.min(e.y,this._size[1]-i.y),r=2*Math.min(s/this._size[0],n/this._size[1]);this._size=this._size.map((t=>t*(1-r)))}expandBoard(t,e,i){const s=this._size[0]*(i||1.1)-this._size[0]>>5;let n=2*s>2?s:2;n%2!=0&&n++;let r=Math.ceil(this._size[1]*(n<<5)/this._size[0]);r%2!=0&&r++;const a=this._size[0],o=this._size[1],l=new Array(n).fill(0),h=new Array(r/2*(n+(a>>5))).fill(0);this.insertZerosToArray(t,o*(a>>5),h.length+n/2);for(let e=o-1;e>0;e--)this.insertZerosToArray(t,e*(a>>5),l.length);this.insertZerosToArray(t,0,h.length+n/2),this._size=[a+(n<<5),o+r],e&&(e[0].x+=(n<<5)/2,e[0].y+=r/2,e[1].x+=(n<<5)/2,e[1].y+=r/2)}insertZerosToArray(t,e,i){const s=Math.floor(i/6e4),n=i%6e4;for(let i=0;i>2);t.width=(this.cw<<5)/i,t.height=this.ch/i;const s=t.getContext("2d");return s.fillStyle=s.strokeStyle="red",s.textAlign="center",{context:s,ratio:i,canvas:t}}place(t,e,i,s){let n=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;const r=this.random()<.5?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,r))return null;const a=e.x,o=e.y,l=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),h=this.spiral(this._size);let d,c,u,p,g=-r;for(this._tTemp=null,this._dtTemp=null;d=h(g+=r);){c=d[0],u=d[1];const h=Math.sqrt(c**2+u**2);let f=Math.atan(u/c);c<0?f+=Math.PI:u<0&&(f=2*Math.PI+f);const v=this.shape(f);if(Math.min(Math.abs(c),Math.abs(u))>=l)break;if(h>=s)n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);else{if(e.x=a+~~(h*v*Math.cos(-f)),e.y=o+~~(h*v*Math.sin(-f)),p=e,this.options.clip)if(this.shouldShrinkContinue()){if(PY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}}else{if(DY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}PY(p,this._size)&&(p=OY(p,this._size))}else if(PY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}if(n=!0,!(i&&(m=p,_=i,!(m.x+m.x1>_[0].x&&m.x+m.x0<_[1].x&&m.y+m.y1>_[0].y&&m.y+m.y0<_[1].y))||i&&EY(p,t,this._size))){const i=p.sprite,s=p.width>>5,n=this._size[0]>>5,r=p.x-(s<<4),a=127&r,o=32-a,l=p.y1-p.y0;let h,d=(p.y+p.y0)*n+(r>>5);for(let e=0;e>>a:0);d+=n}return e.sprite=null,p.sprite=null,!0}}}var m,_;return null!==this._tTemp&&(this._placeStatus=3),!this.shouldShrinkContinue()&&this.setCache(p,r),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){const i=`${t.angle}-${e}`,s=t.x1-t.x0,n=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:s,height:n});const{width:r,height:a}=this.cacheMap.get(i);(s=s&&a>=n}}function EY(t,e,i){const s=i[0]>>5,n=t.sprite,r=t.width>>5,a=t.x-(r<<4),o=127&a,l=32-o,h=t.y1-t.y0;let d,c=(t.y+t.y0)*s+(a>>5);for(let t=0;t>>o:0))&e[c+i])return!0;c+=s}return!1}CY.defaultOptions={enlarge:!1,minFontSize:2,maxSingleWordTryCount:2};const DY=(t,e)=>t.x+t.x0>e[0]||t.y+t.y0>e[0]||t.x+t.x1<0||t.y+t.y1<0,PY=(t,e)=>t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>e[0]||t.y+t.y1>e[1];function OY(t,e){const i=t.sprite,s=t.y1-t.y0,n=t.width>>5;let r=0;const a=[],o=Math.max(-(t.y0+t.y),0),l=Math.min(s+(e[1]-(t.y1+t.y)),s),h=Math.max(-(t.x0+t.x),0)>>5,d=Math.min(n+(e[0]-(t.x1+t.x)>>5)+1,n);for(let t=0;t{if(!t||"#fff"===t)return(t,e,i)=>{const s=t.width;return 0===t.data[e*s*4+4*i+3]||255===t.data[e*s*4+4*i+0]&&255===t.data[e*s*4+4*i+1]&&255===t.data[e*s*4+4*i+2]};const e=No.createCanvas({width:1,height:1}).getContext("2d",{willReadFrequently:!0});e.fillStyle=t,e.fillRect(0,0,1,1);const i=e.getImageData(0,0,1,1).data;return(t,e,s)=>{const n=t.width;return[0,1,2,3].every((r=>t.data[4*(e*n+s)+r]===i[r]))}},BY=(t,e,i,s)=>{const{backgroundColor:n="#fff"}=t,r=s||No.createCanvas({width:e,height:i,dpr:1}),a=r.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;a.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return a.fillStyle=n,a.fillRect(0,0,r.width,r.height),"text"===t.type?IY(t,r.width,r.height,a):"geometric"===t.type&&jY(t,r.width,r.height,a),r},IY=(t,e,i,s)=>{const{fontFamily:n="sans-serif",fontWeight:r="normal",fontStyle:a="normal",fontVariant:o="normal",fill:l,text:h,hollow:d}=t;let c=12;s.font=`${a} ${o} ${r} ${c}px ${n}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=null!=l?l:"black";const u=s.measureText(h),p="normal"!==a?1.1:1,g=M(u.actualBoundingBoxRight)&&M(u.actualBoundingBoxLeft)?Math.ceil(p*(Math.abs(u.actualBoundingBoxRight)+Math.abs(u.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(u.width),g,c);if(d&&(s.globalCompositeOperation="xor"),m>e){const t=Math.min(e/m,i/c);s.fillText(h,e/2,i/2),s.scale(t,t)}else c=Math.floor(c*e/m),c=Math.min(c,i),s.font=`${a} ${o} ${r} ${c}px ${n}`,s.fillText(h,Math.floor(e/2),Math.floor(i/2))},FY=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>Tt(t,e,i+r*n)))},YY=(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()},jY=(t,e,i,s)=>{const{fill:n,hollow:r}=t,{center:a,maxRadius:o}=SY(t.shape,[e,i]);s.fillStyle=null!=n?n:"black",r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?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,((t,e,i=0,s)=>{const n=2*Math.PI/s,r=MY("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return Tt(t,l,o)}))})({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)YY(s,FY({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)YY(s,FY({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)YY(s,FY({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)YY(s,FY({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)YY(s,FY({x:l,y:h},o,0,3));else if("star"===t.shape){const t=FY({x:l,y:h},o,-Math.PI/2,5),e=FY({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);YY(s,i)}else s.fillRect(0,0,e,i)};class HY extends TY{constructor(t){super(E({},HY.defaultOptions,t)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,d=this.getTextFontFamily(t),c=document.createElement("canvas"),u=c.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+d;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let m=p+2*g,_=3*g;const f=Math.ceil(m/this.gridSize),v=Math.ceil(_/this.gridSize);m=f*this.gridSize,_=v*this.gridSize;const y=-p/2,b=.4*-g,x=Math.ceil((m*Math.abs(Math.sin(h))+_*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((m*Math.abs(Math.cos(h))+_*Math.abs(Math.sin(h)))/this.gridSize),M=S*this.gridSize,k=x*this.gridSize;c.setAttribute("width",""+M),c.setAttribute("height",""+k),u.scale(1,1),u.translate(M/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+d,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,y,b);const A=u.getImageData(0,0,M,k).data;if(this.exceedTime())return null;const w=[];let T,L=S;const C=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(A[4*((e*this.gridSize+s)*M+(t*this.gridSize+n))+3])return i.push([t,e]),tC[1]&&(C[1]=t),eC[2]&&(C[2]=e))}};for(;L--;)for(T=x;T--;)E(L,T,w);return{datum:t,occupied:w,bounds:C,gw:S,gh:x,fillTextOffsetX:y,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:d,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),Na(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(bs(e)){const i=BY(e,t.width,t.height);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n,r=RY(e.backgroundColor);const a=(t,e)=>{let i=this.gridSize;for(;i--;){let a=this.gridSize;for(;a--;)if(n=4,!r(s,e*this.gridSize+i,t*this.gridSize+a))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let o=this.ngx;for(;o--;){this.grid[o]=[];let t=this.ngy;for(;t--;)a(o,t),!1!==this.grid[o][t]&&(this.grid[o][t]=!0)}s=r=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=SY(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}}HY.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class zY extends TY{constructor(t){super(E({},zY.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let s=0,n=this.result.length;si.left+i.width||e.top>i.top+i.height))return!1;var e,i;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=b_(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,d=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();d[0]=Math.floor(d[0]),d[1]=Math.floor(d[1]);const c=t.fontFamily?WY(t.fontFamily):"sans-serif",u=t.fontStyle?WY(t.fontStyle):"normal",p=t.fontWeight?WY(t.fontWeight):"normal",m=t.rotate?WY(t.rotate):0,_=WY(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",v=t.padding?WY(t.padding):1,y=null!==(n=t.shape)&&void 0!==n?n:"square",b=null!==(r=t.shrink)&&void 0!==r&&r,x=null!==(a=t.enlarge)&&void 0!==a&&a,S=null!==(o=t.clip)&&void 0!==o&&o,M=t.minFontSize,k=t.randomVisible,A=t.as?Object.assign(Object.assign({},NY),t.as):NY,w=t.depth_3d,T=t.postProjection;let L=t.fontSize?WY(t.fontSize):14;const C=t.fontSizeRange;if(C&&!h(L)){const t=L,e=UY($Y(t,l),C);L=i=>e(t(i))}let E=CY;"fast"===t.layoutType?E=zY:"grid"===t.layoutType&&(E=HY);const D=new E(Object.assign(Object.assign({},t),{text:_,padding:v,spiral:f,shape:y,rotate:m,fontFamily:c,fontStyle:u,fontWeight:p,fontSize:L,shrink:b,clip:S,enlarge:x,minFontSize:M,random:k,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r0||t.progressiveTime>0?{progressive:D}:D.output()},WY=t=>S(t)||h(t)||xs(t)||y(t)?t:e=>e[t.field],GY=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),UY=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=GY(t[0]),n=GY(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(GY(t)-r)/(a-r)*(e[1]-e[0])+e[0]},$Y=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function XY(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l{fc.registerTransform("wordcloud",{transform:VY,markPhase:"beforeJoin"},!0)};var qY;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(qY||(qY={}));const ZY=t=>/^[\u4e00-\u9fa5]+$/.test(t),JY=(t,e)=>{if(D(t))return 0;let i=0;for(const e of t)ZY(e)?i+=1:i+=.53;return i};class QY extends Zb{constructor(){super(ob,lb),this.type=qh.Sqrt}clone(){return(new QY).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}function tj(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:d,shapeMaxR:c,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=rj(i);let m=g.slice(0);const _=e.fontSizeShrinkFactor;let f=null,v=1,y=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;ex&&y>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==f&&(f=e,v=y),y*=_,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*_})),m=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===f){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/y})),i.skip=!0,y=v,f=null,m=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-d<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||sj(e,t,r)))return ij(e,t,r),!0}return!1}function ij(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,d=s[1];let c,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t>>l:0);u+=a}}function sj(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,d=n[1];let c,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t>>l:0))&e[u+i])return!0;u+=r}return!1}function nj(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,d=0,c=0,u=0;const p=s;for(--s;++s>5<<5,l=Math.ceil(l),l>c&&(c=l),h+o>=n&&(h=0,d+=c,c=l),d+l>=2048){if(0===d){t.hasText=!1;continue}break}d+l>=u&&(u=d+l),e.translate(h+(o>>1),d+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,d],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let m,_;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,d]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,c,u,p]=[1/0,-1/0,1/0,-1/0];for(_=0;_0){const e=1<<31-m%32;o[a*_+(m>>5)]|=e,mp&&(p=m),t|=e}t&&(_c&&(c=_))}t.bounds={dTop:(r[1]>>1)-l,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function rj(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t>5)]|=e}if(i[0]>s[0]){const t=(1<>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,S(i.shapeUrl)){i.isEmptyPixel=RY();const t=(a=i.shapeUrl)&&(vs(a)||ys(a)||a.startsWith("{var i;const s=BS({image:a}),n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):(s.successCallback=()=>{var i;if(s){const n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):e(new Error("image load failed"+a))}else e(new Error("image load failed"+a))},s.failCallback=()=>{g.getInstance().error("image 加载失败!",a)})})):null;t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=No.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const d=(t,e)=>{for(let s=0;s{for(let n=e;na&&d(n,o-1);)--o;for(;ll&&c(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=RY(i.shapeUrl.backgroundColor);const t=BY(i.shapeUrl,e.size[0],e.size[1]);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}var a}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x;const S=this.segmentationInput,M=function(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=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]?e[1]-1:h,d=d<0?0:d>=e[0]?e[0]-1:d,0!==n[h*e[0]+d]||t.isEmptyPixel(s,h,d)||(n[h*e[0]+d]=r,o.push([h,d]))}r++,o=[]}const l={},h={},d={},c={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0};for(let t=0;tc[s][1]&&(c[s][1]=t),ic[s][3]&&(c[s][3]=i),ig.x2&&(g.x2=i),tg.y2&&(g.y2=t)),h[s]=h[s]||0,h[s]++)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);d[t]=[i,s],m.push(...e);const[n,r,a,o]=c[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const _=Object.keys(d).map((t=>({label:t-1,boundary:l[t],area:h[t],center:d[t],maxPoint:c[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const f=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),y=~~Math.max(Math.sqrt((f-g.x1)**2+(v-g.y1)**2),Math.sqrt((f-g.x2)**2+(v-g.y2)**2),Math.sqrt((f-g.x1)**2+(v-g.y2)**2),Math.sqrt((f-g.x2)**2+(v-g.y1)**2)),b=g.width/g.height,x=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:_,labels:n,labelNumber:r-1};return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:y,shapeRatio:b,shapeCenter:[f,v],shapeArea:x});function M(t,i){const s=[[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+s[r][0],o=i+s[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===n[a*e[0]+o])return!0}return!1}}(S);if(!M.segmentation.regions.length)return;const k=this.options,A=this.data,w=k.colorMode||"ordinal",T={getText:uj(k.text),getFontSize:uj(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:w,getColor:k.colorField?uj(k.colorField):uj(k.text),getFillingColor:uj(k.fillingColorField),colorList:k.colorList||("ordinal"===w?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:uj(k.colorHexField),getFontFamily:uj(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:uj(k.padding||1),getFontStyle:uj(k.fontStyle||"normal"),getFontWeight:uj(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?uj(k.fontOpacity):()=>1};hj(A,T,M);const L={size:k.size,ratio:k.ratio||.8,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(t=k.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(e=k.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=k.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=k.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=k.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=k.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=k.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=k.fillingTimes)&&void 0!==o?o:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(l=k.fillingXStep)&&void 0!==l?l:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(h=k.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(c=k.fillingDeltaOpacity)&&void 0!==c?c:.05,getFillingFontFamily:uj(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:uj(k.fillingFontStyle||"normal"),getFillingFontWeight:uj(k.fillingFontWeight||"normal"),getFillingPadding:uj(null!==(u=k.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=k.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=k.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(_=k.minFontSize)&&void 0!==_?_:4,minFillFontSize:null!==(f=k.minFillFontSize)&&void 0!==f?f:2},C=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i{const i=JY(n(e));return i>l?t:t+i}),0)/t.length;let d;if(0===h)d=8;else{const t=.2*s.shapeArea;d=Math.sqrt(e*(t/h))}r=~~d,a=d*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(A,T,L,M);const{getText:E,getFontFamily:D,getFontStyle:P,getFontWeight:O,getPadding:R,getColor:B,getFillingColor:I,getColorHex:F,fontSizeScale:Y,colorScale:j,fillingColorScale:H,getFontOpacity:z,rotateList:N}=T,V=A.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:D(t),fontWeight:O(t),fontStyle:P(t),rotate:N[~~(S.randomGenerator()*N.length)],fontSize:Math.max(L.minInitFontSize,~~Y(t)),opacity:z(t),padding:R(t),color:F&&F(t)||j&&j(B(t))||"black",fillingColor:!I||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&C?void 0:F&&F(t)||H&&H(I(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=ja(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/W)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:U,failedWords:$}=function(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),at.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?tj(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:d,shapeRatio:c}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=rj(i);let g=p.slice(0);const m=e.fontSizeEnlargeFactor,_=Math.min(r,t.length);let f=0;t.length>_&&(f=t.sort(((t,e)=>e.weight-t.weight))[_-1].weight);let v=0,y=1,b=!1;for(let r=0;r=f&&v++,v>=_&&!b){y*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),g=p.slice(0),M=!0,v=0;break}}else{if(a.weight>=f&&y>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/m})),y/=m,b=!0,g=p.slice(0),M=!0;break}if(a.weight>=f)return tj(t,e,i)}}M&&(r=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;tc?k-c:c,v),A=A>p?A-p:p;return w;function T(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:d}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(d),fontStyle:o(d),fontWeight:l(d),fontSize:e,rotate:g[~~(S()*g.length)],padding:m(d),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:d}}));L(n);let d=0;const{x1:c,y1:u,x2:p,y2:v}=b,[k,A]=[c+~~(S()*r*2),u+~~(S()*a*2)];for(let t=A;t<=v;t+=a)for(let e=k;e<=p;e+=r){nj(x,M,n,d);const i=n[d];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++d===n.length&&(d=0,_&&L(n));continue}const{dTop:l,dBottom:h,dLeft:c,dRight:u}=a;i.x-c<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!sj(i,f,y)&&(ij(i,f,y),w.push(Object.assign({},i)),++d===n.length&&(d=0,_&&L(n)))}}function L(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;et.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}(V,L,M),X=null!==(y=null===(v=k.text)||void 0===v?void 0:v.field)&&void 0!==y?y:"textKey",K=null!==(b=k.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=k.as?Object.assign(Object.assign({},aj),k.as):aj;let Z,J;const Q=[];for(let t=0;t{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=At(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=I?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&C?t.color:t.fillingColor:L.fillingColorList[~~(S.randomGenerator()*L.fillingColorList.length)],n[X]=t.text,n[K]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.view&&this.view.emit){this.view.emit(qY.AFTER_WORDCLOUD_SHAPE_LAYOUT,{successedWords:U,failedWords:$});const t=null===(x=this.view.renderer)||void 0===x?void 0:x.stage();t&&t.hooks.afterRender.tap(qY.AFTER_WORDCLOUD_SHAPE_DRAW,(()=>{this.view.emit(qY.AFTER_WORDCLOUD_SHAPE_DRAW,{successedWords:U,failedWords:$}),t.hooks.afterRender.unTap(qY.AFTER_WORDCLOUD_SHAPE_DRAW)}))}this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const lj=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:d}=e,{sameColorList:c}=i;let u,p,g=e.colorList,m=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new Qb).domain(e).range(g).scale(t),d&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!c)){const e=t.map((t=>d(t)));p=t=>(new Qb).domain(e).range(m).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new Zb).domain(cj(h,t)).range(g);if(u=t=>e.scale(t),d&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!c)){1===m.length&&(m=[m[0],m[0]]);const e=(new Zb).domain(cj(d,t)).range(m);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},hj=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new QY).domain(cj(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&xs(n)&&!s){const e=.5,[o,l]=cj(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),d=dj(h,i,!0);s=[~~(e*d),~~d];const c=(new QY).domain(cj(n,t)).range(s);a=t=>c.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=dj(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},dj=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=JY(e.text);return s{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},uj=t=>t?"string"==typeof t||"number"==typeof t?()=>t:xs(t)?t:e=>e[t.field]:null,pj=(t,e,i,s)=>{if(!t.size||D(t.size[0])||D(t.size[1])||t.size[0]<=0||t.size[1]<=0)return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||Cm("WordcloudShape shape must be specified."),t.text||Cm("WordcloudShape text must be specified."),(null==s?void 0:s.emit)&&s.emit(qY.BEFORE_WORDCLOUD_SHAPE_LAYOUT),!e||0===e.length)return[];const n=new oj(t,s);return n.layout(e),n.unfinished()?{progressive:n}:n.output()},gj=()=>{fc.registerTransform("wordcloudShape",{transform:pj,markPhase:"beforeJoin"},!0)};class mj extends mY{constructor(){super(...arguments),this.type=fl.wordCloud}}mj.type=fl.wordCloud;const _j=()=>{KY(),LF(),vY(),Xl.registerSeries(mj.type,mj)};class fj extends aY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord,wordMask:t.wordMask}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class vj extends oY{constructor(){super(...arguments),this.transformerConstructor=fj,this.type="wordCloud",this.seriesType=fl.wordCloud}}vj.type="wordCloud",vj.seriesType=fl.wordCloud,vj.transformerConstructor=fj;class yj extends mY{constructor(){super(...arguments),this.type=fl.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(mY.mark.word,{groupKey:this._seriesField,support3d:!0,isSeriesMark:!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",Oy.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getVGrammarView(),s=e.width()-i.left||0-i.right||0,n=e.height()-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r}})),zC("word",this._spec,this._markAttributeContext)))}}yj.type=fl.wordCloud3d;const bj=()=>{KY(),LF(),yY(),Xl.registerSeries(yj.type,yj)};class xj extends aY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,depth_3d:t.depth_3d,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class Sj extends oY{constructor(){super(...arguments),this.transformerConstructor=xj,this.type="wordCloud3d",this.seriesType=fl.wordCloud3d}}Sj.type="wordCloud3d",Sj.seriesType=fl.wordCloud3d,Sj.transformerConstructor=xj;const Mj=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:d,asLastValueRatio:c,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:m=!1,isCone:_=!0,range:f}=e,v=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),y=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==f?void 0:f.min)&&void 0!==i?i:y,null!==(s=null==f?void 0:f.max)&&void 0!==s?s:v];return n.forEach(((t,e)=>{var i,s;const f=Number.parseFloat(t[r]),v=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),y=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=Zo(y*f)&&0!==f?y/f:0,S=Zo(f*v)&&0!==v?f/v:0;u&&(t[u]=v),g&&(t[g]=y),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===m?x:1/n.length),h&&(t[h]=f/b[1]),d&&(t[d]=e===n.length-1?_?0:t[h]:y/b[1]),c&&(t[c]=0===e?1:v/b[1]),p&&(t[p]=f)})),n},kj=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},Aj=`${nh}_FUNNEL_TRANSFORM_RATIO`,wj=`${nh}_FUNNEL_REACH_RATIO`,Tj=`${nh}_FUNNEL_HEIGHT_RATIO`,Lj=`${nh}_FUNNEL_VALUE_RATIO`,Cj=`${nh}_FUNNEL_LAST_VALUE_RATIO`,Ej=`${nh}_FUNNEL_NEXT_VALUE_RATIO`,Dj=`${nh}_FUNNEL_LAST_VALUE`,Pj=`${nh}_FUNNEL_CURRENT_VALUE`,Oj=`${nh}_FUNNEL_NEXT_VALUE`,Rj=`${nh}_FUNNEL_TRANSFORM_LEVEL`;class Bj extends iL{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"转化率":null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[wj])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return"转化率";const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return M(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]}}}class Ij extends yx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class Fj extends Ij{constructor(){super(...arguments),this.type=Fj.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}Fj.type="polygon";const Yj=()=>{Xl.registerMark(Fj.type,Fj),Mx(),yk(),fc.registerGraphic(Qd.polygon,lS),YC()},jj=Object.assign(Object.assign({},mL),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),Hj=Object.assign(Object.assign({},mL),{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 zj extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class Nj extends KC{constructor(){super(...arguments),this.type=fl.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=zj,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;Cp(this._dataSet,"funnel",Mj),Cp(this._dataSet,"funnelTransform",kj);const t=new R(this._dataSet,{name:`${nh}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new oL(this._option,t)}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:Pj,asTransformRatio:Aj,asReachRatio:wj,asHeightRatio:Tj,asValueRatio:Lj,asNextValueRatio:Ej,asLastValueRatio:Cj,asLastValue:Dj,asNextValue:Oj,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:Rj}})}initMark(){var t,e,i,s,n,r,a,o,l,h,d,c;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Nj.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,morph:WC(this._spec,this._funnelMarkName),defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.funnel)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.funnel)||void 0===i?void 0:i.stateSort,noSeparateStyle:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Nj.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(s=this._theme)||void 0===s?void 0:s.transform,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId(),customShape:null===(n=this._spec.transform)||void 0===n?void 0:n.customShape,stateSort:null===(r=this._spec.transform)||void 0===r?void 0:r.stateSort,noSeparateStyle:!0})),null===(o=null===(a=this._spec)||void 0===a?void 0:a.outerLabel)||void 0===o?void 0:o.visible){const{line:t}=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{},{line:e}=null!==(d=null===(h=this._theme)||void 0===h?void 0:h.outerLabel)&&void 0!==d?d:{};this._funnelOuterLabelMark.label=this._createMark(Nj.mark.outerLabel,{themeSpec:null===(c=this._theme)||void 0===c?void 0:c.outerLabel,markSpec:this._spec.outerLabel,skipBeforeLayouted:!0,noSeparateStyle:!0}),this._funnelOuterLabelMark.line=this._createMark(Nj.mark.outerLabelLine,{themeSpec:e,markSpec:t,depend:[this._funnelOuterLabelMark.label],noSeparateStyle:!0})}}initTooltip(){this._tooltipHelper=new Bj(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){const t=this._funnelMark;t&&this.setMarkStyle(t,{points:t=>this.getPoints(t),visible:t=>M(t[this._valueField]),fill:this.getColorAttribute()},"normal",Oy.Series);const e=this._funnelTransformMark;e&&this.setMarkStyle(e,{points:t=>this.getPoints(t)},"normal",Oy.Series);const i=this._funnelOuterLabelMark.label;i&&this.setMarkStyle(i,{text:t=>{const e=`${t[this.getCategoryField()]}`;return xs(this._spec.outerLabel.formatMethod)?this._spec.outerLabel.formatMethod(e,t):e},x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t)},"normal",Oy.Series);const s=this._funnelOuterLabelMark.line;s&&i&&this.setMarkStyle(s,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",Oy.Series)}initLabelMarkStyle(t){var e,i;if(!t)return;const s=t.getTarget(),n=t.getComponent();s===this._funnelMark?(this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",Oy.Series),(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(n),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())):this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*oI(wj).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",Oy.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),zC("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(HC(Xl.getAnimationInKey("fadeInOut")(),zC(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(HC(Xl.getAnimationInKey("funnel")({},o),zC(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(HC(null===(a=Xl.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),zC("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[Cj])/2:this._getSecondaryAxisLength(t[Lj])/2,n=this._getSecondaryAxisLength(t[Lj])/2):(s=this._getSecondaryAxisLength(t[Lj])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[Ej])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[Rj])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return M(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}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}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[bT]===t[bT]));if(!M(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),d=this._getMainAxisLength(!0);return l+=i*(h+d),l+=s?-d/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(h(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const a=this.getPoints(t),o=(Math.abs(a[0].x-a[1].x)+Math.abs(a[2].x-a[3].x))/2,l=this.getCategoryField(),h=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[l])===t[l]}),!0))||void 0===s?void 0:s.AABBBounds,d=h?h.x2-h.x1:0,c=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let u=this.getLayoutRect().width-Math.max(o,d);return"center"===this._funnelAlign&&(u/=2),u-c-(null!==(r=null===(n=this._spec.outerLabel)||void 0===n?void 0:n.spaceWidth)&&void 0!==r?r:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,d,c;const u=this.getCategoryField(),p=null===(r=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.elements)||void 0===n?void 0:n.find((e=>{var i;return(null===(i=e.data[0])||void 0===i?void 0:i[u])===t[u]})))||void 0===r?void 0:r.getBounds(),g=null===(l=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[u])===t[u]}),!0))||void 0===l?void 0:l.AABBBounds,m=null!==(h=this._spec.outerLabel)&&void 0!==h?h:{};let _,f,v,y;if(this._isHorizontal()){const e=null!==(d=m.spaceWidth)&&void 0!==d?d:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(i).y-s/2-e,y=!1!==m.alignLabel?(null==p?void 0:p.y2)+e:v-e,_=this._getPolygonCenter(i).x,v-y{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class Wj extends fO{constructor(){super(...arguments),this.transformerConstructor=Vj,this.type="funnel",this.seriesType=fl.funnel}}Wj.type="funnel",Wj.seriesType=fl.funnel,Wj.transformerConstructor=Vj;class Gj extends Ij{constructor(){super(...arguments),this.type=Gj.type}}Gj.type="pyramid3d";const Uj=()=>{Xl.registerMark(Gj.type,Gj),Mx(),yS(),fc.registerGraphic(Qd.pyramid3d,dS),YC()};class $j extends zj{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class Xj extends Nj{constructor(){super(...arguments),this.type=fl.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=$j}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Xj.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({},Xj.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===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(Xj.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(Xj.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t,depend:[this._funnelOuterLabelMark.label]})}}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",Oy.Series)}initLabelMarkStyle(t){var e,i;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",Oy.Series),this._labelMark=t,(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(t.getComponent()),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())}}Xj.type=fl.funnel3d,Xj.mark=Hj,Xj.transformerConstructor=$j;class Kj extends fO{constructor(){super(...arguments),this.transformerConstructor=Vj,this.type="funnel3d",this.seriesType=fl.funnel3d}}function qj(t){return()=>"vertical"===t.direction?{orient:"negative"}:{orient:"positive"}}Kj.type="funnel3d",Kj.seriesType=fl.funnel3d,Kj.transformerConstructor=Vj;const Zj=t=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:qj(t)}),Jj={type:"fadeIn"};function Qj(t,e){return!1===e?{}:"fadeIn"===e?Jj:(t=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:qj(t)}))(t)}class tH extends iL{enableByType(t){return"dimension"!==t}}const eH=Object.assign(Object.assign({},mL),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}});class iH extends JC{constructor(){super(...arguments),this.type=fl.linearProgress,this._progressMark=null,this._trackMark=null,this._defaultProgressCustomShape=(t,e,i)=>{var s,n;const r=null===(s=this._spec)||void 0===s?void 0:s.cornerRadius,a=M(e.width)?e.width:e.x1-e.x,o=M(e.height)?e.height:e.y1-e.y,l=Math.min(0,a),h=Math.max(0,a),d=Math.min(0,o),c=Math.max(0,o);if(r>0){let t=r;if("vertical"===(null===(n=this._spec)||void 0===n?void 0:n.direction)){if(t=Math.min(Math.abs(a/2),r),2*t>Math.abs(o)){const e=Math.acos((t-Math.abs(o)/2)/t);return i.moveTo(l+t,d),i.arc(l+t,d+t,t,1.5*Math.PI,1.5*Math.PI-e,!0),i.arc(l+t,c-t,t,e+Math.PI/2,Math.PI/2,!0),i.lineTo(h-r,c),i.arc(h-t,c-t,t,Math.PI/2,Math.PI/2-e,!0),i.arc(h-t,d+t,t,-Math.PI/2+e,-Math.PI/2,!0),i.lineTo(l+t,d),i.closePath(),i}}else if(t=Math.min(Math.abs(o/2),r),2*t>Math.abs(a)){const e=Math.acos((t-Math.abs(a)/2)/t);return i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,Math.PI+e),i.arc(h-t,d+t,t,-e,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,e),i.arc(l+t,c-t,t,Math.PI-e,Math.PI),i.closePath(),i}i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,1.5*Math.PI),i.lineTo(h-t,d),i.arc(h-t,d+t,t,-Math.PI/2,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,Math.PI/2),i.lineTo(l+t,c),i.arc(l+t,c-t,t,Math.PI/2,Math.PI),i.closePath()}else i.moveTo(l,d),i.lineTo(h,d),i.lineTo(h,c),i.lineTo(l,c),i.closePath();return i}}initMark(){this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e,i;return this._progressMark=this._createMark(iH.mark.progress,{isSeriesMark:!0,customShape:null!==(e=null===(t=this._spec.progress)||void 0===t?void 0:t.customShape)&&void 0!==e?e:this._defaultProgressCustomShape,stateSort:null===(i=this._spec.progress)||void 0===i?void 0:i.stateSort}),this._progressMark}_initProgressMarkStyle(){var t,e,i,s;const n=this._progressMark;if(n)if("vertical"===this._spec.direction){const i=this._spec.progress||{},s=null!==(t=i.leftPadding)&&void 0!==t?t:0,r=null!==(e=i.rightPadding)&&void 0!==e?e:0;this.setMarkStyle(n,{x:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2+s},y1:t=>{var e,i;return ox(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:()=>{var t;return null===(t=this._yAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},width:this._spec.bandWidth-s-r,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Oy.Series)}else{const t=this._spec.progress||{},e=null!==(i=t.topPadding)&&void 0!==i?i:0,r=null!==(s=t.bottomPadding)&&void 0!==s?s:0;this.setMarkStyle(n,{x1:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:t=>{var i,s;return ox(this.dataToPositionY(t),null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0))-this._spec.bandWidth/2+e},height:this._spec.bandWidth-e-r,x:()=>{var t;return null===(t=this._xAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Oy.Series)}}_initTrackMark(){var t,e;return this._trackMark=this._createMark(iH.mark.track,{customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&("vertical"===this._spec.direction?this.setMarkStyle(t,{x:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",Oy.Series):this.setMarkStyle(t,{x:0,y:t=>{var e,i;return ox(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",Oy.Series))}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("linearProgress"))||void 0===i?void 0:i(n,r),zC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),zC("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new tH(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}iH.type=fl.linearProgress,iH.mark=eH;class sH extends uO{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{direction:null!==(e=t.direction)&&void 0!==e?e:"horizontal",cornerRadius:null!==(i=t.cornerRadius)&&void 0!==i?i:0,bandWidth:t.bandWidth,progress:t.progress,track:t.track})}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="band"),D(i.type)&&(i.type="linear");const n=$E(i,{min:0,max:1});D(i.min)&&(i.min=n.min),D(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="linear"),D(e.type)&&(e.type="band");const n=$E(s,{min:0,max:1});D(s.min)&&(s.min=n.min),D(s.max)&&(s.max=n.max)}}}class nH extends fO{constructor(){super(...arguments),this.transformerConstructor=sH,this.type="linearProgress",this.seriesType=fl.linearProgress}}function rH(t,e,i,s,n,r,a,o,l){t.setMarkStyle(e,{textAlign:t=>{if("vertical"===l())return"center";const e=n(t),s=r(t);if("middle"===i)return"center";if(e>=s){if("start"===i)return"left";if("end"===i)return"right";if("outside"===i)return"left"}else{if("start"===i)return"right";if("end"===i)return"left";if("outside"===i)return"right"}return"center"},textBaseline:t=>{if("horizontal"===l())return"middle";const e=a(t),s=o(t);if("middle"===i)return"middle";if(s>=e){if("start"===i)return"bottom";if("end"===i)return"top";if("outside"===i)return"bottom"}else{if("start"===i)return"top";if("end"===i)return"bottom";if("outside"===i)return"top"}return"middle"}}),t.setMarkStyle(e,{x:t=>{const e=l(),a=n(t),o=r(t);if("vertical"===e)return(a+o)/2;if("middle"===i)return(a+o)/2;if(a>=o){if("start"===i)return o+s;if("end"===i)return a-s;if("outside"===i)return a+s}else{if("start"===i)return o-s;if("end"===i)return a+s;if("outside"===i)return a-s}return(a+o)/2},y:t=>{const e=l(),n=a(t),r=o(t);if("horizontal"===e)return(n+r)/2;if("middle"===i)return(n+r)/2;if(n>=r){if("start"===i)return r+s;if("end"===i)return n-s;if("outside"===i)return n+s}else{if("start"===i)return r-s;if("end"===i)return n+s;if("outside"===i)return n-s}return(n+r)/2}},"normal",Oy.Series)}nH.type="linearProgress",nH.seriesType=fl.linearProgress,nH.transformerConstructor=sH,QA(nH,bO);class aH extends iL{constructor(){super(...arguments),this._getMeasureData=t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]]}}const oH=t=>({type:"growCenterIn",options:{direction:"horizontal"===t.direction?"x":"y"}}),lH={type:"fadeIn"},hH=t=>({type:"growCenterOut",options:{direction:"horizontal"===t.direction?"x":"y"}});function dH(t,e){return"fadeIn"===e?lH:oH(t)}const cH=Object.assign(Object.assign({},YO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),uH=Object.assign(Object.assign({},jO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class pH extends NO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar")}}class gH extends VO{constructor(){super(...arguments),this.type=fl.rangeColumn,this._barMarkType="rect",this._barName=fl.bar,this.transformerConstructor=pH}initMark(){var t,e,i,s,n,r,a,o,l,h;this._initBarBackgroundMark();const d=null===(t=this._spec.label)||void 0===t?void 0:t.position;this._barMark=this._createMark(gH.mark.bar,{morph:WC(this._spec,gH.mark.bar.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.bar)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.bar)||void 0===i?void 0:i.stateSort}),!1!==(null===(s=this._spec.label)||void 0===s?void 0:s.visible)&&"bothEnd"===d&&(!1!==(null===(r=null===(n=this._spec.label)||void 0===n?void 0:n.minLabel)||void 0===r?void 0:r.visible)&&(this._minLabelMark=this._createMark(gH.mark.minLabel,{markSpec:null===(a=this._spec.label)||void 0===a?void 0:a.minLabel})),!1!==(null===(l=null===(o=this._spec.label)||void 0===o?void 0:o.maxLabel)||void 0===l?void 0:l.visible)&&(this._maxLabelMark=this._createMark(gH.mark.maxLabel,{markSpec:null===(h=this._spec.label)||void 0===h?void 0:h.maxLabel})))}initMarkStyle(){var t,e,i,s,n,r,a,o,l,h;super.initMarkStyle();const d=this._minLabelMark,c=null===(t=this._spec.label)||void 0===t?void 0:t.minLabel;d&&(this.setMarkStyle(d,{fill:null!==(i=null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[0]]:t[this._spec.yField[0]];return(null==c?void 0:c.formatMethod)?c.formatMethod(e,t):e}}),rH(this,d,null!==(s=null==c?void 0:c.position)&&void 0!==s?s:"end",null!==(n=null==c?void 0:c.offset)&&void 0!==n?n:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)));const u=this._maxLabelMark,p=null===(r=this._spec.label)||void 0===r?void 0:r.maxLabel;u&&(this.setMarkStyle(u,{fill:null!==(o=null===(a=null==p?void 0:p.style)||void 0===a?void 0:a.fill)&&void 0!==o?o:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[1]]:t[this._spec.yField[1]];return(null==p?void 0:p.formatMethod)?p.formatMethod(e,t):e}}),rH(this,u,null!==(l=null==p?void 0:p.position)&&void 0!==l?l:"start",null!==(h=null==p?void 0:p.offset)&&void 0!==h?h:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)))}initLabelMarkStyle(t){t&&(this.setMarkStyle(t,{text:t=>{let e,i;return"horizontal"===this._spec.direction?(e=t[this._spec.xField[0]],i=t[this._spec.xField[1]]):(e=t[this._spec.yField[0]],i=t[this._spec.yField[1]]),e+"-"+i},z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._labelMark=t)}_dataToPosX(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[0]),{bandPosition:this._bandPosition})}_dataToPosX1(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}_dataToPosY(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[0]),{bandPosition:this._bandPosition})}_dataToPosY1(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}initAnimation(){var t,e,i,s,n;const r=ZC(this),a=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._barMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("rangeColumn"))||void 0===i?void 0:i({direction:this.direction},a),zC("bar",this._spec,this._markAttributeContext),r)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),zC("label",this._spec,this._markAttributeContext),r)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(HC(null===(n=Xl.getAnimationInKey("fadeInOut"))||void 0===n?void 0:n(),zC("label",this._spec,this._markAttributeContext),r))}initTooltip(){this._tooltipHelper=new aH(this),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark),this._minLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._minLabelMark),this._maxLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._maxLabelMark),this._labelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._labelMark)}}gH.type=fl.rangeColumn,gH.mark=cH,gH.transformerConstructor=pH;class mH extends uO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barBackground:t.barBackground,barMinHeight:t.barMinHeight,stackCornerRadius:t.stackCornerRadius});return s.bar=t.bar,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),vy(t)}}class _H extends fO{constructor(){super(...arguments),this.transformerConstructor=mH,this.type="rangeColumn",this.seriesType=fl.rangeColumn}}_H.type="rangeColumn",_H.seriesType=fl.rangeColumn,_H.transformerConstructor=mH;class fH extends gH{constructor(){super(...arguments),this.type=fl.rangeColumn3d,this._barMarkType="rect3d",this._barName=fl.bar3d}}fH.type=fl.rangeColumn3d,fH.mark=uH;class vH extends uO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup});return s.bar3d=t.bar3d,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class yH extends fO{constructor(){super(...arguments),this.transformerConstructor=vH,this.type="rangeColumn3d",this.seriesType=fl.rangeColumn3d}}yH.type="rangeColumn3d",yH.seriesType=fl.rangeColumn3d,yH.transformerConstructor=vH;const bH=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},xH=t=>{const e=t.mark.elements.filter((t=>t.diffState===Jd.update)),i=Ha(e.map((t=>{var e;return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth})));return e.filter((t=>{var e;return(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth)===i}))},SH=(t,e,i)=>jm(t)?[e,i]:[Ha(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),ja(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],MH=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=xH(i),a=SH(r,s,n);return bH(e.startAngle,a)*(n-s)+s},to:t=>t.startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=xH(i),a=SH(r,s,n);return bH(e.endAngle,a)*(n-s)+s},to:t=>t.endAngle},outerRadius:{from:t=>t.innerRadius,to:t=>t.outerRadius},innerRadius:{from:t=>t.innerRadius,to:t=>t.innerRadius}}}),kH=t=>[Ha(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),ja(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],AH=t=>({channel:{startAngle:{from:(t,e)=>e.getGraphicAttribute("startAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=xH(i),a=kH(r);return bH(i.getGraphicAttribute("startAngle",!1),a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getGraphicAttribute("endAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=xH(i),a=kH(r);return bH(i.getGraphicAttribute("endAngle",!1),a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getGraphicAttribute("outerRadius",!1),to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getGraphicAttribute("innerRadius",!1),to:()=>t.animationInfo().innerRadius}}}),wH=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},TH=(t,e=[],i)=>{const s=(null==i?void 0:i.maxDepth)>=0;return t.forEach((t=>{(!s||t.depth<=i.maxDepth)&&(e.push((null==i?void 0:i.callback)?i.callback(t):t),t.children&&(s&&t.depth===i.maxDepth?(t.children=null,t.isLeaf=!0):TH(t.children,e,i)))})),e},LH=(t,e={})=>{if(!t)return[];const i=[];return TH(t,i,e),i};function CH(t,e,i,s,n,r={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){const a=t.children;let o,l=-1;const h=a.length,d=t.value&&(s-e)/t.value;for(;++lD(t)?e:S(t)?e*parseFloat(t)/100:t;function DH(t){if(Zo(t))return t;const e=+t;return Zo(e)?e:0}const PH=(t,e,i=0,s=-1,n,r,a="value")=>{let o=0,l=null!=s?s:-1,h=i;return t.forEach(((t,s)=>{var d,c;const u={flattenIndex:++l,key:r?r(t):`${null!==(d=null==n?void 0:n.key)&&void 0!==d?d:""}-${s}`,maxDepth:-1,depth:i,index:s,value:t[a],isLeaf:!0,datum:n?n.datum.concat(t):[t],parentKey:null==n?void 0:n.key};if(null===(c=t.children)||void 0===c?void 0:c.length){u.children=[],u.isLeaf=!1;const e=PH(t.children,u.children,i+1,l,u,r,a);u.value=D(t[a])?e.sum:Math.max(e.sum,DH(t[a])),l=e.flattenIndex,h=Math.max(e.maxDepth,h)}else u.isLeaf=!0,u.value=DH(t[a]);o+=Math.abs(u.value),e.push(u)})),{sum:o,maxDepth:h,flattenIndex:l}},OH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;n=e(t,s,i,n),(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=OH(t.children,e,t,n))})),s},RH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=RH(t.children,e,t,n)),n=e(t,s,i,n)})),n},BH={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class IH{constructor(t){this._layoutNode=t=>{if(t.maxDepth=this._maxDepth,t.children){const e=this._parsedInnerRadius[t.depth+1],i=this._parsedOutterRadius[t.depth+1];CH(t,t.startAngle,Math.min(e,i),t.endAngle,Math.max(e,i),BH);const s=y(this.options.label)?this.options.label[t.depth+1]:this.options.label;t.children.forEach((t=>{if(t.x=this._parsedCenter[0],t.y=this._parsedCenter[1],s)return this._layoutLabel(t,v(s)?{align:"center",rotate:"radial"}:s)}))}},this.options=t?Object.assign({},IH.defaultOpionts,t):Object.assign({},IH.defaultOpionts);const e=this.options.nodeKey,i=xs(e)?e:e?Dm(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){const i=t.x0+EH(this.options.center[0],t.width),s=t.y0+EH(this.options.center[1],t.height),n=Math.min(t.width/2,t.height/2),r=this.options.innerRadius,a=this.options.outerRadius,o=y(r),l=o?r.map((t=>EH(t,n))):EH(r,n),h=y(a),d=this.options.gapRadius,c=h?a.map((t=>EH(t,n))):EH(a,n),u=eb(0,e+1);if(o)this._parsedInnerRadius=u.map(((t,e)=>{const i=l[e];return D(i)?n:i})),this._parsedOutterRadius=u.map(((t,i)=>{var s,r;return h?null!==(s=c[i])&&void 0!==s?s:n:iD(c[e])?n:c[e])),this._parsedInnerRadius=u.map(((t,e)=>{var i;return 0===e?l:this._parsedOutterRadius[e-1]-(y(d)?null!==(i=d[e])&&void 0!==i?i:0:d)}));else{const t=EH(r,n),i=(c-t)/(e+1);this._parsedInnerRadius=u.map(((e,s)=>t+s*i)),this._parsedOutterRadius=u.map(((t,e)=>{var s;return this._parsedInnerRadius[e]+i-(y(d)?null!==(s=d[e])&&void 0!==s?s:0:d)}))}this._parsedCenter=[i,s],this._maxRadius=n}layout(t,e){const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const s=[],n=PH(t,s,0,-1,null,this._getNodeKey);return this._parseRadius(i,n.maxDepth),this._maxDepth=n.maxDepth,this._layout(s,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:n.sum,datum:null,children:s,startAngle:this.options.startAngle,endAngle:this.options.endAngle}),s}_layout(t,e){this._layoutNode(e),t.forEach((t=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t.children,t):this._layoutNode(t)}))}_layoutLabel(t,e){var i;const s=(t.startAngle+t.endAngle)/2,n=("start"===e.align?t.innerRadius:"end"===e.align?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+(null!==(i=e.offset)&&void 0!==i?i:0),r=Tt({x:this._parsedCenter[0],y:this._parsedCenter[1]},n,s);if(t.label={x:r.x,y:r.y,textBaseline:"middle"},"tangential"===e.rotate)t.label.angle=s-Math.PI/2,t.label.textAlign="center",t.label.maxLineWidth=Math.abs(t.endAngle-t.startAngle)*n;else{const i=s%(2*Math.PI),n=i<0?i+2*Math.PI:i;n>Math.PI/2&&n<1.5*Math.PI?(t.label.angle=n+Math.PI,t.label.textAlign="start"===e.align?"end":"end"===e.align?"start":"center"):(t.label.angle=n,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}IH.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};const FH=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new IH(i).layout(t,{width:s,height:n})};class YH extends iL{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const jH=(t,e,i="key",s="children")=>{for(let n=0;n{for(let n=0;n{const r=Object.assign({},t);return Array.isArray(r[n])&&(r[n]=zH(r[n],e,i,s,n)),r})).filter((t=>+t[s]>=e&&+t[s]<=i||t[n]&&t[n].length>0)):t}var NH;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(NH||(NH={}));const VH=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(D(n))return t;if(i.type===NH.DrillDown)return Fa(jH(t,n,s,"children"));if(i.type===NH.DrillUp){const e=HH(t,n,s,"children");if(e)return Fa(e)}return t};class WH{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=ZB(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;Cp(t,"drillFilter",VH),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(D(t.datum)||D(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!y(t)||jm(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:NH.DrillDown},e().reRunAllTransform(),i.emit(zd.drill,{value:{path:t,type:NH.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!y(n)||jm(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:NH.DrillUp},i().reRunAllTransform(),s.emit(zd.drill,{value:{path:n,type:NH.DrillUp},model:this}),n}}const GH=Object.assign(Object.assign({},mL),{sunburst:{name:"sunburst",type:"arc"}});class UH extends lI{constructor(){super(...arguments),this.type=fl.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:hL),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:bT},getRawData:()=>this.getRawData()}),this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),Cp(this._dataSet,"sunburstLayout",FH),Cp(this._dataSet,"flatten",LH),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[M(this._centerX)?this._centerX:this.getLayoutRect().width/2,M(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:lL,operations:["max","min","values"]},{key:hL,operations:["values"]}])}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Cp(t.dataSet,"addVChartProperty",GT),t.transform({type:"addVChartProperty",options:{beforeCall:pL.bind(this),call:gL}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){var t,e;if(!1===this._sunburst.visible)return;const i=this._createMark(UH.mark.sunburst,{isSeriesMark:!0,customShape:null===(t=this._spec.sunburst)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.sunburst)||void 0===e?void 0:e.stateSort});this._sunburstMark=i}_initArcMarkStyle(){D(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(M(this._offsetX)?this._offsetX:0),y:t=>t.y+(M(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Oy.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(UH.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return bs(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(M(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(M(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},Sy.STATE_NORMAL,Oy.Series)}initTooltip(){this._tooltipHelper=new YH(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Fa(this.__innerRadius))[0],outerRadius:this._computeRadius(Fa(this.__outerRadius))[0],startAngle:Fa(this._startAngle)[0],endAngle:Fa(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),zC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),zC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_computeRadius(t){return y(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}UH.type=fl.sunburst,UH.mark=GH,QA(UH,WH);class $H extends cO{_getDefaultSeriesSpec(t){const e=M(t.startAngle)?t.startAngle:-90,i=M(t.endAngle)?t.endAngle:e+wt(2*Math.PI),s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,centerX:t.centerX,centerY:t.centerY,offsetX:t.offsetX,offsetY:t.offsetY,startAngle:e,endAngle:i,innerRadius:t.innerRadius,outerRadius:t.outerRadius,gap:t.gap,labelLayout:t.labelLayout,label:t.label,labelAutoVisible:t.labelAutoVisible,drill:t.drill,drillField:t.drillField}),n=fl.sunburst;return s.type=n,s[n]=t[n],s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class XH extends fO{constructor(){super(...arguments),this.transformerConstructor=$H,this.type="sunburst",this.seriesType=fl.sunburst}}XH.type="sunburst",XH.seriesType=fl.sunburst,XH.transformerConstructor=$H;const KH=4294967296;function qH(t,e){let i,s;if(QH(e,t))return[e];for(i=0;i0&&i*i>s*s+n*n}function QH(t,e){for(let i=0;i1e-6?(T+Math.sqrt(T*T-4*w*L))/(2*w):L/T);return{x:s+S+M*C,y:n+k+A*C,radius:C}}function sz(t,e,i){const s=t.x-e.x;let n,r;const a=t.y-e.y;let o,l;const h=s*s+a*a;h?(r=e.radius+i.radius,r*=r,l=t.radius+i.radius,l*=l,r>l?(n=(h+l-r)/(2*h),o=Math.sqrt(Math.max(0,l/h-n*n)),i.x=t.x-n*s-o*a,i.y=t.y-n*a+o*s):(n=(h+r-l)/(2*h),o=Math.sqrt(Math.max(0,r/h-n*n)),i.x=e.x+n*s-o*a,i.y=e.y+n*a+o*s)):(i.x=e.x+i.radius,i.y=e.y)}function nz(t,e){const i=t.radius+e.radius-1e-6,s=e.x-t.x,n=e.y-t.y;return i>0&&i*i>s*s+n*n}function rz(t){const e=t._,i=t.next._,s=e.radius+i.radius,n=(e.x*i.radius+i.x*e.radius)/s,r=(e.y*i.radius+i.y*e.radius)/s;return n*n+r*r}function az(t){return{_:t,next:null,prev:null}}function oz(t,e){const i=(t=Fa(t)).length;if(!i)return 0;let s=t[0];if(s.x=0,s.y=0,1===i)return s.radius;const n=t[1];if(s.x=-n.radius,n.x=s.radius,n.y=0,2===i)return s.radius+n.radius;let r=t[2];sz(n,s,r);let a,o,l,h,d,c,u,p=az(s),g=az(n),m=az(r);p.next=g,m.prev=g,g.next=m,p.prev=m,m.next=p,g.prev=p;for(let e=3;et.padding:y(null==t?void 0:t.padding)?e=>{var i;return null!==(i=t.padding[e.depth+1])&&void 0!==i?i:0}:()=>0,this._maxDepth=-1}layout(t,e){var i;const s="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const n=[],r=PH(t,n,0,-1,null,this._getNodeKey);this._maxDepth=r.maxDepth;const a=function(t=1){let e=t;return()=>(e=(1664525*e+1013904223)%KH)/KH}(),o={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:r.sum,datum:null,children:n,x:s.x0+s.width/2,y:s.y0+s.height/2},{nodeSort:l,setRadius:h,padding:d,includeRoot:c}=null!==(i=this.options)&&void 0!==i?i:{};if(!1!==l){const t=xs(l)?this.options.nodeKey:cz.defaultOpionts.nodeSort;OH([o],(e=>{e.children&&e.children.length&&e.children.sort(t)}))}if(h)OH([o],lz(h)),RH([o],hz(this._getPadding,.5,a)),OH([o],dz(1,this._maxDepth));else{const t=Math.min(s.width,s.height);OH([o],lz(cz.defaultOpionts.setRadius)),RH([o],hz(lg,1,a)),d&&RH([o],hz(this._getPadding,o.radius/t,a)),OH([o],dz(t/(2*o.radius),this._maxDepth))}return c?[o]:n}}cz.defaultOpionts={setRadius:t=>Math.sqrt(t.value),padding:0,nodeSort:(t,e)=>e.value-t.value};const uz=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new cz(i).layout(t,{width:s,height:n})};class pz extends iL{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const gz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},mz=Object.assign(Object.assign({},mL),{circlePacking:{name:"circlePacking",type:"arc"}});class _z extends JC{constructor(){super(...arguments),this.type=fl.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:hL),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:bT},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();D(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),Cp(this._dataSet,"circlePackingLayout",uz),Cp(this._dataSet,"flatten",LH),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Cp(t.dataSet,"addVChartProperty",GT),t.transform({type:"addVChartProperty",options:{beforeCall:pL.bind(this),call:gL}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t,e;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const i=this._createMark(_z.mark.circlePacking,{isSeriesMark:!0,customShape:null===(e=this._spec.circlePacking)||void 0===e?void 0:e.customShape});this._circlePackingMark=i}_initCirclePackingMarkStyle(){D(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},Sy.STATE_NORMAL,Oy.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(_z.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},Sy.STATE_NORMAL,Oy.Series)}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:lL,operations:["max","min","values"]},{key:hL,operations:["values"]}])}initTooltip(){this._tooltipHelper=new pz(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),zC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),zC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}_z.type=fl.circlePacking,_z.mark=mz,QA(_z,WH);class fz extends cO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,layoutPadding:t.layoutPadding,label:t.label,circlePacking:t.circlePacking,drill:t.drill,drillField:t.drillField}),i=fl.circlePacking;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class vz extends fO{constructor(){super(...arguments),this.transformerConstructor=fz,this.type="circlePacking",this.seriesType=fl.circlePacking}}function yz(t,e,i,s,n){const r=t.children;let a,o=-1;const l=r.length,h=t.value&&(n-i)/t.value;for(;++o{if(t>=e-1){const e=r[t];return e.x0=s,e.y0=n,e.x1=a,void(e.y1=o)}const d=l[t],c=i/2+d;let u=t+1,p=e-1;for(;u>>1;l[t]o-n){const r=i?(s*m+a*g)/i:a;h(t,u,g,s,n,r,o),h(u,e,m,r,n,a,o)}else{const r=i?(n*m+o*g)/i:o;h(t,u,g,s,n,a,r),h(u,e,m,s,r,a,o)}};h(0,a,t.value,e,i,s,n)},dice:CH,slice:yz,sliceDice:function(t,e,i,s,n){(t.depth%2==1?yz:CH)(t,e,i,s,n)}};class xz{constructor(t){var e;this._filterByArea=(t,e)=>{var i;const s=this._getMinAreaByDepth(t.depth);if(s>0&&t.value*ethis._filterByArea(t,e)));i.length?i.length!==t.children.length&&(t.children=i):(t.isLeaf=!0,t.children=null)}return!0},this._getMinAreaByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.minVisibleArea)?this.options.minVisibleArea[t]:this.options.minVisibleArea)&&void 0!==e?e:0},this._getGapWidthByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.gapWidth)?this.options.gapWidth[t]:this.options.gapWidth)&&void 0!==e?e:0},this._getPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.padding)?this.options.padding[t]:this.options.padding)&&void 0!==e?e:0},this._getLabelPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.labelPadding)?this.options.labelPadding[t]:this.options.labelPadding)&&void 0!==e?e:0},this._layoutNode=t=>{const e=this._getGapWidthByDepth(t.depth);let i=t.x0,s=t.y0,n=t.x1,r=t.y1;if(t.maxDepth=this._maxDepth,e>0&&(i+=e/2,n-=e/2,s+=e/2,r-=e/2,i>n&&(i=(i+n)/2,n=i),s>r&&(s=(s+r)/2,r=s),t.x0=i,t.x1=n,t.y0=s,t.y1=r),t.children){const e=this._getLabelPaddingByDepth(t.depth),a=this._getPaddingByDepth(t.depth);a>0&&a0&&("top"===this.options.labelPosition&&s+es?(t.labelRect={x0:i,y0:r-e,x1:n,y1:r},r-=e):"left"===this.options.labelPosition&&i+ei&&(t.labelRect={x0:n-e,y0:s,x1:n,y1:r},n-=e));const o=this._getGapWidthByDepth(t.depth+1);o>0&&(i-=o/2,n+=o/2,s-=o/2,r+=o/2),this._splitNode(t,i,s,n,r)}},this.options=Object.assign({},xz.defaultOpionts,t);const i=this.options.nodeKey,s=xs(i)?i:i?Dm(i):null;var n;this._getNodeKey=s,this._splitNode="squarify"===this.options.splitType?(n=this.options.aspectRatio,(t,e,i,s,r)=>{!function(t,e,i,s,n,r){const a=[],o=e.children;let l,h,d=0,c=0;const u=o.length;let p,g,m,_,f,v,y,b,x,S=e.value;for(;df&&(f=h),x=m*m*b,v=Math.max(f/x,x/_),v>y){m-=h;break}y=v}l=Object.assign({},e,{value:m,children:o.slice(d,c)}),a.push(l),p=0&&t.depth>=e)return!1;const i=this.options.minChildrenVisibleArea;if(h(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0)){var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t):this._layoutNode(t)}))}}xz.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};const Sz=(t,e)=>{const i=new xz(t).layout(e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});if(t.flatten){const e=[];return TH(i,e,{maxDepth:null==t?void 0:t.maxDepth}),e}return i},Mz=(t,e)=>{let i={},s=e.fields;if(xs(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=LH(n);return i=nL([{latestData:r}],e),i};class kz extends iL{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:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const Az=Object.assign(Object.assign({},mL),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),wz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class Tz extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}class Lz extends JC{constructor(){super(...arguments),this.type=fl.treemap,this.transformerConstructor=Tz,this._categoryField="name",this._valueField="value",this._viewBox=new Kt,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:hL),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Pt),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:bT},getRawData:()=>this.getRawData()}),Zo(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){super.initData(),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}compile(){super.compile(),this._runTreemapTransform()}_runTreemapTransform(t=!1){var e,i,s,n;const r=this._data.getProduct();r&&r.transform([{type:"treemap",nameField:this._categoryField,valueField:this._valueField,x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize,flatten:!0},{type:"map",callback:t=>(t&&[hL,"name"].forEach((e=>{t[e]=t.datum[t.depth][this._categoryField]})),t)}]),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"addVChartProperty",GT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:pL.bind(this),call:gL}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=Mz([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=E(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){Cp(this._dataSet,"hierarchyDimensionStatistics",Mz),Cp(this._dataSet,"flatten",LH);const i=new R(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:lL,operations:["max","min","values"]},{key:hL,operations:["values"]}])}initMark(){var t,e,i,s;const n=this._createMark(Lz.mark.nonLeaf,{isSeriesMark:!0,customShape:null===(t=this._spec.nonLeaf)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nonLeaf)||void 0===e?void 0:e.stateSort});n&&(n.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=n);const r=this._createMark(Lz.mark.leaf,{isSeriesMark:!0,customShape:null===(i=this._spec.leaf)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.leaf)||void 0===s?void 0:s.stateSort});r&&(r.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=r)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Oy.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Oy.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},Sy.STATE_NORMAL,Oy.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},Sy.STATE_NORMAL,Oy.Series))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},Sy.STATE_NORMAL,Oy.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},Sy.STATE_NORMAL,Oy.Series))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("treemap"))||void 0===e?void 0:e(),zC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new kz(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:d}=this._matrix;this._matrix.multiply(r,a,o,l,h,d),this.disableMarkAnimation(),this.event.on(hc.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.enable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().enableAnimation()})),this.event.off(hc.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.disable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}Lz.type=fl.treemap,Lz.mark=Az,Lz.transformerConstructor=Tz,QA(Lz,WH),QA(Lz,QB);class Cz extends cO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,aspectRatio:t.aspectRatio,splitType:t.splitType,maxDepth:t.maxDepth,gapWidth:t.gapWidth,nodePadding:t.nodePadding,minVisibleArea:t.minVisibleArea,minChildrenVisibleArea:t.minChildrenVisibleArea,minChildrenVisibleSize:t.minChildrenVisibleSize,roam:t.roam,drill:t.drill,drillField:t.drillField,leaf:t.leaf,nonLeaf:t.nonLeaf,nonLeafLabel:t.nonLeafLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class Ez extends fO{constructor(){super(...arguments),this.transformerConstructor=Cz,this.type="treemap",this.seriesType=fl.treemap}}Ez.type="treemap",Ez.seriesType=fl.treemap,Ez.transformerConstructor=Cz;const Dz=`${nh}_waterfall_default_seriesField`,Pz=(t,e)=>{if(!t||0===t.length)return t;const{indexField:i,total:s,groupData:n}=e,r=[],{dimensionValues:a,dimensionData:o}=n().latestData,l=Array.from(a[i]);let h={start:0,end:0,positive:0,negative:0,lastIndex:null};return l.forEach(((t,i)=>{const n={start:h.end,end:h.end,lastIndex:h.lastIndex,lastEnd:h.end,index:t,isTotal:!1,positive:h.end,negative:h.end},a=o[t];if(null==a||a.forEach(((t,e)=>{e===a.length-1?t[PT]=!0:delete t[PT]})),a.length>1){const o=t=>{if(s&&"end"!==s.type){if("field"===s.type||"custom"===s.type)return!!t[s.tagField]}else if(i===l.length-1)return!0;return!1};if(a.some((t=>o(t))))return h=function(t,e,i,s,n,r,a,o,l){i.isTotal=!0;const{valueField:h,startAs:d,endAs:c,total:u}=o,p=[],g=[];if(t.forEach((t=>{l(t)?g.push(t):p.push(t)})),g.length===t.length){const l=Oz([t[0]],e,i,s,n,r,a,o);return g.forEach((e=>{e[d]=t[0][d],e[c]=t[0][c],e[h]=t[0][h]})),l}const m=g[0];let{start:_,end:f}=Rz(m,i,s,n,u);i.start=_,i.end=f;let v=_,y=_,b=f-_;return p.forEach((t=>{const e=+t[h];e>=0?(t[d]=+v,v=Mt(v,e)):(t[d]=+y,y=Mt(y,e)),t[c]=Mt(t[d],e),_=Mt(_,e),b=kt(b,e)})),g.forEach((t=>{t[d]=+_,t[c]=Mt(t[d],b),t[h]=b})),Object.assign(Object.assign({},i),{lastIndex:e})}(a,t,n,r,h,l,i,e,o),void r.push(n)}h=Oz(a,t,n,r,h,l,i,e),r.push(n)})),r};function Oz(t,e,i,s,n,r,a,o){const{valueField:l,startAs:h,endAs:d,total:c,seriesField:u,seriesFieldName:p}=o;return t.forEach((t=>{let e=!1;if(c&&"end"!==c.type){if(("field"===c.type||"custom"===c.type)&&t[c.tagField]){e=!0;const{start:r,end:a}=Rz(t,i,s,n,c);t[h]=r,t[d]=a,t[l]=a-r,i.start=r,i.end=a}}else a===r.length-1&&(i.start=0,t[h]=i.start,t[d]=i.end,e=!0);if(!e){const e=+t[l];e>=0?(t[h]=+i.positive,i.positive=Mt(i.positive,e)):(t[h]=+i.negative,i.negative=Mt(i.negative,e)),t[d]=Mt(t[h],e),i.end=Mt(i.end,e)}i.isTotal=e,(D(u)||u===Dz)&&(t[Dz]=e?p.total:+t[l]>=0?p.increase:p.decrease)})),Object.assign(Object.assign({},i),{lastIndex:e})}function Rz(t,e,i,s,n){return n&&"end"!==n.type?"field"===n.type||"custom"===n.type?"custom"===n.type?function(t,e,i){return i.product(t,e)}(t,s,n):n.collectCountField&&!D(t[n.collectCountField])?function(t,e,i,s){let n=0,r=i.end;const a=e.length-+t[s.collectCountField],o=e.length-1;return a<0?gl("total.collectCountField error"):n=e[a].start,o<0?gl("total.collectCountField error"):r=e[o].end,{start:n,end:r}}(t,i,e,n):function(t,e,i){let s=0,n=e.end;return i.startField&&!D(t[i.startField])&&(s=+t[i.startField]),i.valueField&&!D(t[i.valueField])&&(n=Mt(s,+t[i.valueField])),{start:s,end:n}}(t,e,n):{start:0,end:0}:function(t){return{start:0,end:t.end}}(e)}const Bz=(t,e)=>{if(!t)return t;const{indexField:i,valueField:s,total:n,seriesField:r}=e,a={[i]:(null==n?void 0:n.text)||"total",[s]:t.reduce(((t,e)=>Mt(t,+e[s])),0)};return r&&(a[r]="total"),t.push(a),t},Iz={type:"fadeIn"},Fz={type:"growCenterIn"};function Yz(t,e){switch(e){case"fadeIn":return Iz;case"scaleIn":return Fz;default:return DO(t,!1)}}const jz=Object.assign(Object.assign({},YO),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),Hz=(t,e)=>{if(!e.fields)return t;const i={};return{dimensionValues:i,dimensionData:zz(t.map((t=>t.latestData)).flat(),e.fields,i)}};function zz(t,e,i){if(0===e.length)return t;const s=e[0],n=e.slice(1);i[s]=new Set;const r=function(t,e,i){const s={};return t.forEach((t=>{const n=t[e];s[n]||(s[n]=[],i.add(n)),s[n].push(t)})),s}(t,s,i[s]);return n.length?(a=r,o=(t,e)=>zz(t,n,i),Object.keys(a).reduce(((t,e)=>(t[e]=o(a[e]),t)),{})):r;var a,o}class Nz{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){const i=t.name,s=new R(e instanceof f?e:t.dataSet);s.name=i,s.parse([t],{type:"dataview"}),Cp(e,"dimensionTree",Hz),s.transform({type:"dimensionTree",options:{fields:this._fields}},!1),s.target.addListener("change",this.groupDataUpdate.bind(this)),this._groupData=s}groupDataUpdate(){}getGroupValueInField(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.groupData)||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.dimensionValues)||void 0===s?void 0:s[t];return n?Array.from(n):[]}}class Vz extends NO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel","initStackLabelMarkStyle")}}const Wz={rect:Xz,symbol:$z,arc:qz,point:function(t){const{labelSpec:e}=t;let i;return i=!1!==e.overlap&&{avoidBaseMark:!1},{position:"center",overlap:i}},"line-data":function(t){const e=$z(t);return v(e.overlap)||(e.overlap.avoidBaseMark=!1),e},stackLabel:Zz,line:Jz,area:Jz,rect3d:Xz,arc3d:qz,treemap:function(t){return{customLayoutFunc:(t,e)=>e,overlap:!1}},venn:function(t){return{customLayoutFunc:(t,e)=>e,smartInvert:!0}}};function Gz(t,e,i,s){var n;const{labelMark:r,series:a}=t,o={text:e[a.getMeasureField()[0]],data:e,textType:null!==(n=t.labelSpec.textType)&&void 0!==n?n:"text"},l=Object.keys(r.stateStyle.normal);for(const t of l){const i=r.getAttribute(t,e);o[t]=i}if(a.type!==fl.sankey){const{formatFunc:t,args:n}=XT(i,s,o.text,e);t&&(o._originText=o.text,o.text=t(...n,{series:a}))}return o}function Uz(t){return xs(t)?e=>t(e.data):t}function $z(t){var e,i,s;const{series:n,labelSpec:r}=t,a="horizontal"===n.direction?"right":"top",o=null!==(e=Uz(r.position))&&void 0!==e?e:a;let l;return l=!1!==r.overlap&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}],avoidBaseMark:"center"!==o},{position:o,overlap:l}}function Xz(t){var e,i,s,n,r,a;const{series:o,labelSpec:l={}}=t,h=null!==(e=Uz(l.position))&&void 0!==e?e:"outside",d=null!==(i=o.direction)&&void 0!==i?i:"vertical",c="horizontal"===o.direction?null===(s=o.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=o.getYAxisHelper())||void 0===n?void 0:n.isInverse();let u,p=h;p=t=>{var e;const{data:i}=t,s=null!==(e="function"==typeof l.position?l.position(i):l.position)&&void 0!==e?e:"outside";if("outside"===s){const t=o.getMeasureField()[0],e={vertical:["top","bottom"],horizontal:["right","left"]},s=(null==i?void 0:i[t])>=0&&c||(null==i?void 0:i[t])<0&&!c?1:0;return e[d][s]}return s},u=!1!==l.overlap&&{strategy:null!==(a=null===(r=l.overlap)||void 0===r?void 0:r.strategy)&&void 0!==a?a:Kz(o)};let g=!1;return S(h)&&h.includes("inside")&&(g=!0),{position:p,overlap:u,smartInvert:g}}function Kz(t){return[{type:"position",position:e=>{var i,s;const{data:n}=e,r=t.getMeasureField()[0];return("horizontal"===t.direction?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]:"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]}}]}function qz(t){var e;const{labelSpec:i}=t,s=null!==(e=Uz(i.position))&&void 0!==e?e:"outside",n=s;let r;return r=i.smartInvert?i.smartInvert:S(s)&&s.includes("inside"),{position:n,smartInvert:r}}function Zz(t,e,i){const s=t.series,n=t.labelSpec||{},r=s.getTotalData();return{customLayoutFunc:r=>r.map((r=>{const a=n.position||"withChange",o=n.offset||0,l=e?e(r.data):r.data,h=Gz(t,l,n.formatMethod);return h.x=function(t,e,i,s){return"horizontal"===e.direction?"middle"===i?.5*(e.totalPositionX(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionX(t,t.end>=t.start?"end":"start")+s:"min"===i?e.totalPositionX(t,t.end>=t.start?"start":"end")-s:e.totalPositionX(t,"end")+(t.end>=t.start?s:-s):e.totalPositionX(t,"index",.5)}(l,s,a,o),h.y=function(t,e,i,s){return"horizontal"===e.direction?e.totalPositionY(t,"index",.5):"middle"===i?.5*(e.totalPositionY(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionY(t,t.end>=t.start?"end":"start")-s:"min"===i?e.totalPositionY(t,t.end>=t.start?"start":"end")+s:e.totalPositionY(t,"end")+(t.end>=t.start?-s:s)}(l,s,a,o),"horizontal"===s.direction?h.textAlign="middle"===a?"center":"withChange"===a&&l.end-l.start>=0||"max"===a?"left":"right":h.textBaseline="middle"===a?a:"withChange"===a&&l.end-l.start>=0||"max"===a?"bottom":"top",null==i||i(r,l,h),f_(Object.assign(Object.assign({},h),{id:r.id}))})),dataFilter:t=>{const e=[];return r.forEach((i=>{const n=t.find((t=>{var e;return i.index===(null===(e=t.data)||void 0===e?void 0:e[s.getDimensionField()[0]])}));n&&(n.data=i,e.push(n))})),e},overlap:{strategy:[]}}}function Jz(t){var e,i,s,n;const{labelSpec:r,series:a}=t,o=null===(s=null===(i=null===(e=a.getViewDataStatistics)||void 0===e?void 0:e.call(a).latestData)||void 0===i?void 0:i[a.getSeriesField()])||void 0===s?void 0:s.values,l=o?o.map(((t,e)=>({[a.getSeriesField()]:t,index:e}))):[];return{position:null!==(n=r.position)&&void 0!==n?n:"end",data:l}}function Qz(t){return[{type:"position",position:e=>"horizontal"===t.direction?["right","left"]:["bottom","top"]}]}class tN extends VO{constructor(){super(...arguments),this.type=fl.waterfall,this.transformerConstructor=Vz,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null}getTotalData(){var t;return null===(t=this._totalData)||void 0===t?void 0:t.getLatestData()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups=new Nz(t),this._data&&this._groups.initData(this._data.getDataView(),this._dataSet))}setAttrFromSpec(){super.setAttrFromSpec(),this.setValueFieldToStack(),this._fieldX=[this._fieldX[0]],this._fieldY=[this._fieldY[0]],D(this._seriesField)&&(this._seriesField=Dz)}getSeriesKeys(){return this._seriesField===Dz?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t;super.initData(),Cp(this._dataSet,"waterfallFillTotal",Bz),Cp(this._dataSet,"waterfall",Pz),(D(this._spec.total)||"end"===this._spec.total.type)&&(null===(t=this._rawData)||void 0===t||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total}},!1));const e=Yp(this.getViewData(),this._dataSet,{name:`${nh}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",e.reRunAllTransform),this._totalData=new oL(this._option,e),e.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:kT,endAs:AT,total:this._spec.total,groupData:()=>this.getGroups().groupData}},!1)}initAnimation(){var t,e,i,s;const n={yField:"horizontal"===this.direction?this._fieldY[0]:this.getStackValueField(),xField:"horizontal"===this.direction?this.getStackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,a=ZC(this);this._barMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("waterfall"))||void 0===i?void 0:i(n,r),zC("bar",this._spec,this._markAttributeContext),a)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),zC("leaderLine",this._spec,this._markAttributeContext)))}viewDataUpdate(t){this._totalData.getDataView().reRunAllTransform(),this._totalData.updateData(),super.viewDataUpdate(t)}addViewDataFilter(t){}reFilterViewData(){}onEvaluateEnd(t){super.onEvaluateEnd(t),this._totalData.updateData()}initMark(){var t,e;super.initMark();const i=this._createMark(tN.mark.leaderLine,{key:"index",customShape:null===(t=this._spec.leaderLine)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.leaderLine)||void 0===e?void 0:e.stateSort});i&&(this._leaderLineMark=i,i.setDataView(this._totalData.getDataView(),this._totalData.getProductId()))}initLabelMarkStyle(t){var e;if(t)return!this._labelMark&&(null===(e=this._spec.label)||void 0===e?void 0:e.visible)?(super.initLabelMarkStyle(t),void(this._labelMark=t)):void 0}initStackLabelMarkStyle(t){t&&(this._stackLabelMark=t,t.skipEncode=!0,t.setRule("stackLabel"),t.setDataView(this._totalData.getDataView(),this._totalData.getProductId()),this.setMarkStyle(t,{text:t=>{var e;return"absolute"===(null===(e=this._spec.stackLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start)}}))}initTotalLabelMarkStyle(t){this.setMarkStyle(t,{text:t=>{var e;return"end"in t?"absolute"===(null===(e=this._spec.totalLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start):"horizontal"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]]}})}getTotalLabelComponentStyle(t){return Zz(Object.assign(Object.assign({},t),{series:this,labelSpec:this._spec.totalLabel}),(t=>{const e="vertical"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]];return this._totalData.getLatestData().find((t=>t.index===e))}))}totalPositionX(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._xAxisHelper;return"horizontal"===this._direction?ox(s([t[e]],{bandPosition:this._bandPosition})):s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("width",t)*(.5-i)}totalPositionY(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._yAxisHelper;return"horizontal"===this._direction?s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("height",t)*(.5-i):ox(s([t[e]],{bandPosition:this._bandPosition}))}initMarkStyle(){super.initMarkStyle(),this._leaderLineMark&&("horizontal"===this._direction?this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:t=>t.lastIndex?this.totalPositionY(t,"lastIndex",1):0,y1:t=>this.totalPositionY(t,"index",0)},"normal",Oy.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>t.lastIndex?this.totalPositionX(t,"lastIndex",1):0,x1:t=>this.totalPositionX(t,"index",0),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",Oy.Series))}}tN.type=fl.waterfall,tN.mark=jz,tN.transformerConstructor=Vz;class eN extends GO{transformSpec(t){super.transformSpec(t),t.legends&&Fa(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),vy(t)}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{bar:t.bar,stackLabel:t.stackLabel,leaderLine:t.leaderLine,total:t.total})}}class iN extends UO{constructor(){super(...arguments),this.transformerConstructor=eN,this.type="waterfall",this.seriesType=fl.waterfall}}iN.type="waterfall",iN.seriesType=fl.waterfall,iN.transformerConstructor=eN;const sN=`${nh}_BOX_PLOT_OUTLIER_VALUE`;var nN;!function(t){t.OUTLIER="outlier",t.MAX="max",t.MIN="min",t.MEDIAN="median",t.Q1="q1",t.Q3="q3",t.SERIES_FIELD="seriesField"}(nN||(nN={}));const rN=(t,e)=>{const i=[],{outliersField:s,dimensionField:n}=e;return(t[0].latestData||[]).forEach((t=>{let e=t[s];y(e)||(e=[e]),i.push(...e.map((e=>{const i={[sN]:e};return n.forEach((e=>{i[e]=t[e]})),i})))})),i};class aN extends iL{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===nN.OUTLIER?this.series.getOutliersField():t===nN.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case nN.MIN:return this.series.getMinField();case nN.MAX:return this.series.getMaxField();case nN.MEDIAN:return this.series.getMedianField();case nN.Q1:return this.series.getQ1Field();case nN.Q3:return this.series.getQ3Field();case nN.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===nN.OUTLIER?e[sN]:t===nN.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case nN.MIN:return e[this.series.getMinField()];case nN.MAX:return e[this.series.getMaxField()];case nN.MEDIAN:return e[this.series.getMedianField()];case nN.Q1:return e[this.series.getQ1Field()];case nN.Q3:return e[this.series.getQ3Field()];case nN.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>"line"===this.series.getShaftShape()?this.series.getMarkInName("boxPlot").getAttribute("stroke",t):this.series.getMarkInName("boxPlot").getAttribute("fill",t),this.getOutlierFillColor=t=>{var e;const i=this.series.getOutliersStyle();return null!==(e=null==i?void 0:i.fill)&&void 0!==e?e:this.series.getMarkInName("outlier").getAttribute("fill",t)},this.isOutlierMark=t=>M(t[sN])}getDefaultContentList(t){return[{key:this.getContentKey(nN.OUTLIER),value:this.getContentValue(nN.OUTLIER),shapeType:this.shapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor},{key:this.getContentKey(nN.MAX),value:this.getContentValue(nN.MAX)},{key:this.getContentKey(nN.Q3),value:this.getContentValue(nN.Q3)},{key:this.getContentKey(nN.MEDIAN),value:this.getContentValue(nN.MEDIAN)},{key:this.getContentKey(nN.Q1),value:this.getContentValue(nN.Q1)},{key:this.getContentKey(nN.MIN),value:this.getContentValue(nN.MIN)},{key:this.getContentKey(nN.SERIES_FIELD),value:this.getContentValue(nN.SERIES_FIELD)}]}}function oN(t){return"horizontal"===t}function lN(t){return"vertical"===t}class hN extends Wm{constructor(t){super(t),this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t],l={};if(!o)return l;if(xs(o))return l.attributes=o(this.getDatum(),this,t,e),l;if(!a&&(null===(r=this.graphicItem.glyphStates)||void 0===r?void 0:r[t]))return this.graphicItem.glyphStates[t];if(o){const e=this.items[0],i=[Object.assign({},e,{nextAttrs:{}})];return Pm(this,i,o,this.mark.parameters()),this.coordinateTransformEncode(i),l.attributes=i[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[t]||(this.graphicItem.glyphStates[t]=l):this.graphicItem.glyphStates={[t]:l},l}return l},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[Wg]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);const e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach((t=>{const i=e[t.name];this.glyphGraphicItems[t.name]=t,t.onBeforeAttributeUpdate=e=>this.mark?bm(i,e,this,t.name):e})),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(hc.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();const i=v(e)?e:this.hasStateAnimation();return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(hc.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);const t=this.transformElementItems(this.items,this.mark.markType),e=!this.graphicItem;this.graphicItem||this.initGraphicItem(),this.diffState===Jd.enter||e?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==Jd.enter&&this.diffState!==Jd.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach((t=>{t.states={}})),this.useStates(this.states)),this.items.map((t=>{t.nextAttrs={}}))}encodeCustom(t){var e;let i={};const s=this.glyphMeta.getChannelEncoder(),n=this.glyphMeta.getFunctionEncoder();if(n&&(i=n.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),s){let e;Object.keys(s).forEach((n=>{var r;if(!D(t[n])){e||(e=Object.assign({},null===(r=this.graphicItem)||void 0===r?void 0:r.attribute,t));const a=s[n].call(null,n,t[n],e,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(null!=a?a:{}).forEach((t=>{var e;i[t]=Object.assign(null!==(e=i[t])&&void 0!==e?e:{},a[t])}))}}))}return i}encodeDefault(){const t={};if(this.glyphMeta.getDefaultEncoder()){const e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;const i=this.glyphMeta.getMarks(),s=bm(this.mark.getAttributeTransforms(),e,this),n=t?this.encodeDefault():null,r=this.encodeCustom(e);return Object.keys(i).forEach((s=>{const a=i[s],o=this.glyphGraphicItems[s],l=null==r?void 0:r[s],h=Object.assign({},l);if(t){const t=null==n?void 0:n[s];Object.keys(null!=t?t:{}).forEach((e=>{fs(this.items[0].nextAttrs,e)||fs(h,e)||(h[e]=t[e])}))}const d=Object.assign({},function(t,e){var i;return(null!==(i=ym[t])&&void 0!==i?i:[]).reduce(((t,i)=>(i.channels.forEach((i=>{fs(e,i)&&(t[i]=e[i])})),t)),{})}(a,e),h),c=this._generateGlyphItems(a,this.items,d);this.coordinateTransformEncode(c);const u=this.transformElementItems(c,a);this.applyGlyphGraphicAttributes(u,s,o),a===Qd.shape&&(o.datum=c[0].datum)})),s}}_generateGlyphItems(t,e,i){const s=e.map((t=>Object.assign({},t,{nextAttrs:i})));return Gg.includes(t)&&this.mark.getSpec().enableSegments&&s.forEach(((t,s)=>{t.nextAttrs=Object.assign({},e[s].nextAttrs,i)})),s}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;const s=this.getPrevGraphicAttributes(i);return e&&fs(s,t)?s[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,s){if(!this.graphicItem)return;const n=s?this.glyphGraphicItems[s]:this.graphicItem,r=this.getFinalGraphicAttributes(s),a=this.getPrevGraphicAttributes(s);i&&(r[t]=e),fs(a,t)||(a[t]=n.attribute[t]),n.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;const s=i?this.glyphGraphicItems[i]:this.graphicItem,n=this.getFinalGraphicAttributes(i),r=this.getPrevGraphicAttributes(i);Object.keys(t).forEach((i=>{e&&(n[i]=t[i]),fs(r,i)||(r[i]=s.attribute[i])})),s.setAttributes(t)}diffAttributes(t,e){const i={},s=this.getFinalGraphicAttributes(e);for(const e in t)fs(s,e)&&Im(s[e],t[e])||(i[e]=t[e]);return i}applyGlyphGraphicAttributes(t,e,i){var s,n;if(this.mark.needAnimate()){const r=this.diffAttributes(t,e),a=null!==(s=this.getPrevGraphicAttributes(e))&&void 0!==s?s:{},o=null!==(n=this.getFinalGraphicAttributes(e))&&void 0!==n?n:{};Object.keys(r).forEach((t=>{a[t]=i.attribute[t],o[t]=r[t]})),this.setNextGraphicAttributes(r,e),this.setPrevGraphicAttributes(a,e),this.setFinalGraphicAttributes(o,e),i.setAttributes(r)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)}))}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)}))}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach((t=>{t[Wg]=null})),this.glyphGraphicItems=null),super.release()}}class dN extends Gm{constructor(t,e,i){super(t,Qd.glyph,i),this.glyphType=e,this.glyphMeta=fc.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){const i=function(t,e,i={}){if(!fc.getGraphicType(Qd.glyph))return;const s=fc.createGraphic(Qd.glyph,i),n=e.getMarks(),r=Object.keys(n).map((t=>{if(fc.getGraphicType(n[t])){const e=fc.createGraphic(n[t]);if(e)return e.name=t,e}}));return s.setSubGraphic(r),s}(0,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}createElement(){return new hN(this)}}dN.markType=Qd.glyph;const cN=()=>{fc.registerMark(Qd.glyph,dN)},uN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!Zo(l))return{};const h=e.getGraphicAttribute("x",!1),d=e.getGraphicAttribute("y",!1),c=e.getGraphicAttribute("min",!1),u=e.getGraphicAttribute("max",!1),p=e.getGraphicAttribute("q1",!1),g=e.getGraphicAttribute("q3",!1),m=e.getGraphicAttribute("median",!1),_={from:{x:h,y:d},to:{x:h,y:d}};return Zo(c)&&(_.from.min=l,_.to.min=c),Zo(u)&&(_.from.max=l,_.to.max=u),Zo(p)&&(_.from.q1=l,_.to.q1=p),Zo(g)&&(_.from.q3=l,_.to.q3=g),Zo(m)&&(_.from.median=l,_.to.median=m),_},pN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!Zo(l))return{};const h=e.getGraphicAttribute("x",!0),d=e.getGraphicAttribute("y",!0),c=e.getGraphicAttribute("min",!0),u=e.getGraphicAttribute("max",!0),p=e.getGraphicAttribute("q1",!0),g=e.getGraphicAttribute("q3",!0),m=e.getGraphicAttribute("median",!0),_={from:{x:h,y:d},to:{x:h,y:d}};return Zo(c)&&(_.to.min=l,_.from.min=c),Zo(u)&&(_.to.max=l,_.from.max=u),Zo(p)&&(_.to.q1=l,_.from.q1=p),Zo(g)&&(_.to.q3=l,_.from.q3=g),Zo(m)&&(_.to.median=l,_.from.median=m),_},gN=(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;if(i&&Zo(i.center))return i.center;let m,_,f,v,y;if(oN(e)){m=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x,_=null===(a=null===(r=t.getGraphicAttribute("points",!1,"max"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.x,f=null===(l=null===(o=t.getGraphicAttribute("points",!1,"min"))||void 0===o?void 0:o[0])||void 0===l?void 0:l.x;const e=t.getGraphicAttribute("width",!1,"box"),i=t.getGraphicAttribute("x",!1,"box");v=i,y=i+e}else{m=null===(d=null===(h=t.getGraphicAttribute("points",!1,"median"))||void 0===h?void 0:h[0])||void 0===d?void 0:d.y,_=null===(u=null===(c=t.getGraphicAttribute("points",!1,"max"))||void 0===c?void 0:c[0])||void 0===u?void 0:u.y,f=null===(g=null===(p=t.getGraphicAttribute("points",!1,"min"))||void 0===p?void 0:p[0])||void 0===g?void 0:g.y;const e=t.getGraphicAttribute("height",!1,"box"),i=t.getGraphicAttribute("y",!1,"box");v=i,y=i+e}return Zo(m)?m:Zo(v)&&Zo(y)?(v+y)/2:Zo(_)&&Zo(f)?(_+f)/2:Zo(f)?f:Zo(_)?_:NaN},mN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={shaft:{},box:{},max:{},min:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.height)&&void 0!==o?o:i.getGraphicAttribute("height",!1),f=null!==(l=t.boxWidth)&&void 0!==l?l:i.getGraphicAttribute("boxWidth",!1),v=null!==(h=t.boxHeight)&&void 0!==h?h:i.getGraphicAttribute("boxHeight",!1),y=null!==(d=t.ruleWidth)&&void 0!==d?d:i.getGraphicAttribute("ruleWidth",!1),b=null!==(c=t.ruleHeight)&&void 0!==c?c:i.getGraphicAttribute("ruleHeight",!1);return s&&oN(s.direction)?(Zo(v)?(Object.assign(u.box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2})):(Object.assign(u.box,{y:g-_/2,y1:g+_/2}),Object.assign(u.median,{y:g-_/2,y1:g+_/2})),Zo(b)?(Object.assign(u.max,{y:g-b/2,y1:g+b/2}),Object.assign(u.min,{y:g-b/2,y1:g+b/2})):(Object.assign(u.max,{y:g-_/2,y1:g+_/2}),Object.assign(u.min,{y:g-_/2,y1:g+_/2}))):(Zo(f)?(Object.assign(u.box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2})),Zo(y)?(Object.assign(u.max,{x:p-y/2,x1:p+y/2}),Object.assign(u.min,{x:p-y/2,x1:p+y/2})):(Object.assign(u.max,{x:p-m/2,x1:p+m/2}),Object.assign(u.min,{x:p-m/2,x1:p+m/2}))),u},_N=uN(gN),fN=pN(gN),vN=(t,e,i)=>{var s,n,r,a;if(Zo(null==i?void 0:i.center))return i.center;let o,l,h,d,c;if(oN(e)){o=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x;const e=t.getGraphicAttribute("width",!1,"minMaxBox"),i=t.getGraphicAttribute("x",!1,"minMaxBox");h=i,l=i+e;const r=t.getGraphicAttribute("width",!1,"q1q3Box"),a=t.getGraphicAttribute("x",!1,"q1q3Box");d=a,c=a+r}else{o=null===(a=null===(r=t.getGraphicAttribute("points",!1,"median"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.y;const e=t.getGraphicAttribute("height",!1,"minMaxBox"),i=t.getGraphicAttribute("y",!1,"minMaxBox");h=i,l=i+e;const s=t.getGraphicAttribute("height",!1,"q1q3Box"),n=t.getGraphicAttribute("y",!1,"q1q3Box");d=n,c=n+s}return Zo(o)?o:Zo(d)&&Zo(c)?(d+c)/2:Zo(l)&&Zo(h)?(l+h)/2:Zo(h)?h:Zo(l)?l:NaN},yN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={minMaxBox:{},q1q3Box:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.minMaxWidth)&&void 0!==o?o:i.getGraphicAttribute("minMaxWidth",!1),f=null!==(l=t.q1q3Width)&&void 0!==l?l:i.getGraphicAttribute("q1q3Width",!1),v=null!==(h=t.height)&&void 0!==h?h:i.getGraphicAttribute("height",!1),y=null!==(d=t.minMaxHeight)&&void 0!==d?d:i.getGraphicAttribute("minMaxHeight",!1),b=null!==(c=t.q1q3Height)&&void 0!==c?c:i.getGraphicAttribute("q1q3Height",!1);return s&&oN(s.direction)?(Zo(y)?Object.assign(u.minMaxBox,{y:g-y/2,y1:g+y/2}):Object.assign(u.minMaxBox,{y:g-v/2,y1:g+v/2}),Zo(b)?(Object.assign(u.q1q3Box,{y:g-b/2,y1:g+b/2}),Object.assign(u.median,{y:g-b/2,y1:g+b/2})):(Object.assign(u.q1q3Box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2}))):(Zo(_)?Object.assign(u.minMaxBox,{x:p-_/2,x1:p+_/2}):Object.assign(u.minMaxBox,{x:p-m/2,x1:p+m/2}),Zo(f)?(Object.assign(u.q1q3Box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.q1q3Box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2}))),u},bN=uN(vN),xN=pN(vN);class SN extends yx{constructor(){super(...arguments),this.type=SN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}_initProduct(t){const e=this.getStyle("shaftShape"),i=this.getVGrammarView(),s=this.getProductId(),n="bar"===e?"barBoxplot":"boxplot",r=this.getStyle("direction");this._product=i.glyph(n,null!=t?t:i.rootMark).id(s).configureGlyph({direction:r}),this._compiledProductId=s}}SN.type="boxPlot";const MN=Object.assign(Object.assign({},mL),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}});class kN extends JC{constructor(){super(...arguments),this.type=fl.boxPlot}getMinField(){return this._minField}getMaxField(){return this._maxField}getQ1Field(){return this._q1Field}getMedianField(){return this._medianField}getQ3Field(){return this._q3Field}getOutliersField(){return this._outliersField}getShaftShape(){return this._shaftShape}getBoxFillColor(){return this._boxFillColor}getStrokeColor(){return this._strokeColor}getOutliersStyle(){return this._outliersStyle}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec();const r=null!==(e=null===(t=this._spec.boxPlot)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._minField=this._spec.minField,this._maxField=this._spec.maxField,this._q1Field=this._spec.q1Field,this._medianField=this._spec.medianField,this._q3Field=this._spec.q3Field,this._outliersField=this._spec.outliersField,this._lineWidth=null!==(i=r.lineWidth)&&void 0!==i?i:2,this._boxWidth=r.boxWidth,this._shaftShape=null!==(s=r.shaftShape)&&void 0!==s?s:"line",this._shaftWidth=r.shaftWidth,this._boxFillColor=r.boxFill,this._strokeColor=r.stroke,this._shaftFillOpacity="bar"===this._shaftShape?null!==(n=r.shaftFillOpacity)&&void 0!==n?n:.5:void 0,this._outliersStyle=this._spec.outliersStyle}initMark(){const t={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._boxPlotMark=this._createMark(kN.mark.boxPlot,{isSeriesMark:!0,progressive:t}),this._outlierMark=this._createMark(kN.mark.outlier,{progressive:t,key:yT,dataView:this._outlierDataView.getDataView(),dataProductId:this._outlierDataView.getProductId()})}initMarkStyle(){var t,e,i,s,n;const r=this._boxPlotMark;if(r){const i={direction:this._direction,lineWidth:this._lineWidth,shaftShape:this._shaftShape,fill:null!==(t=this._boxFillColor)&&void 0!==t?t:"line"===this._shaftShape?"#FFF":this.getColorAttribute(),minMaxFillOpacity:this._shaftFillOpacity,stroke:null!==(e=this._strokeColor)&&void 0!==e?e:"line"===this._shaftShape?this.getColorAttribute():"#000"},s="horizontal"===this._direction?Object.assign(Object.assign({y:this.dataToPositionY.bind(this)},i),{boxHeight:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Height:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}}):Object.assign(Object.assign({x:this.dataToPositionX.bind(this)},i),{boxWidth:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Width:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}});this.setMarkStyle(r,s,Sy.STATE_NORMAL,Oy.Series)}const a=this._outlierMark;a&&this.setMarkStyle(a,{fill:null!==(s=null===(i=this._outliersStyle)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),size:h(null===(n=this._outliersStyle)||void 0===n?void 0:n.size)?this._outliersStyle.size:10,symbolType:"circle"},Sy.STATE_NORMAL,Oy.Series)}initBoxPlotMarkStyle(){var t,e;const i=this._boxPlotMark,s="horizontal"===this._direction?this._xAxisHelper:this._yAxisHelper;if(i&&s){const{dataToPosition:e}=s,n=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{min:t=>ox(e(this.getDatumPositionValues(t,this._minField),{bandPosition:this._bandPosition}),n),q1:t=>ox(e(this.getDatumPositionValues(t,this._q1Field),{bandPosition:this._bandPosition}),n),median:t=>ox(e(this.getDatumPositionValues(t,this._medianField),{bandPosition:this._bandPosition}),n),q3:t=>ox(e(this.getDatumPositionValues(t,this._q3Field),{bandPosition:this._bandPosition}),n),max:t=>ox(e(this.getDatumPositionValues(t,this._maxField),{bandPosition:this._bandPosition}),n)},Sy.STATE_NORMAL,Oy.Series)}const n=this._outlierMark;if(n&&s){const{dataToPosition:t}=s,i=null===(e=null==s?void 0:s.getScale)||void 0===e?void 0:e.call(s,0),r="horizontal"===this._direction?{y:this.dataToPositionY.bind(this),x:e=>ox(t(this.getDatumPositionValues(e,sN),{bandPosition:this._bandPosition}),i)}:{x:this.dataToPositionX.bind(this),y:e=>ox(t(this.getDatumPositionValues(e,sN),{bandPosition:this._bandPosition}),i)};this.setMarkStyle(n,r,Sy.STATE_NORMAL,Oy.Series)}}initData(){if(super.initData(),!this._data)return;Cp(this._dataSet,"foldOutlierData",rN),Cp(this._dataSet,"addVChartProperty",GT);const t=new R(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${nh}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:"horizontal"===this._direction?this._fieldY:this._fieldX,outliersField:this._outliersField}}),t.transform({type:"addVChartProperty",options:{beforeCall:cL.bind(this),call:uL}},!1),this._outlierDataView=new oL(this._option,t)}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,e="horizontal"===this._direction?this._fieldY:this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(t){super.onLayoutEnd(t),this._autoBoxWidth=null}_initAnimationSpec(t={}){const e=E({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="line"===this._shaftShape?"boxplotScaleIn":"barBoxplotScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="line"===this._shaftShape?"boxplotScaleOut":"barBoxplotScaleOut")})),e}initAnimation(){var t,e,i,s,n,r,a;const o=ZC(this);if(this._boxPlotMark){const e=this._initAnimationSpec(null===(t=Xl.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),i=this._initAnimationSpec(zC("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(HC(e,i,o))}if(this._outlierMark){const t={appear:null===(e=this._spec.animationAppear)||void 0===e?void 0:e.symbol,disappear:null===(i=this._spec.animationDisappear)||void 0===i?void 0:i.symbol,enter:null===(s=this._spec.animationEnter)||void 0===s?void 0:s.symbol,exit:null===(n=this._spec.animationExit)||void 0===n?void 0:n.symbol,update:null===(r=this._spec.animationUpdate)||void 0===r?void 0:r.symbol};this._outlierMark.setAnimationConfig(HC(null===(a=Xl.getAnimationInKey("scaleInOut"))||void 0===a?void 0:a(),t,o))}}initTooltip(){this._tooltipHelper=new aN(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){const t=super.getStatisticFields(),e=t.find((t=>t.key===this._outliersField));return e&&(e.operations=["array-min","array-max"]),t}onEvaluateEnd(t){super.onEvaluateEnd(t),this._outlierDataView.updateData()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}kN.type=fl.boxPlot,kN.mark=MN;class AN extends uO{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{boxPlot:t.boxPlot,direction:null!==(e=t.direction)&&void 0!==e?e:"vertical",minField:t.minField,maxField:t.maxField,q1Field:t.q1Field,medianField:t.medianField,q3Field:t.q3Field,outliersField:t.outliersField,outliersStyle:t.outliersStyle});return s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),vy(t)}}class wN extends fO{constructor(){super(...arguments),this.transformerConstructor=AN,this.type="boxPlot",this.seriesType=fl.boxPlot}}wN.type="boxPlot",wN.seriesType=fl.boxPlot,wN.transformerConstructor=AN;const TN=t=>{let e=0;return t.forEach(((t,i)=>{var s;D(t.value)&&((null===(s=t.children)||void 0===s?void 0:s.length)?t.value=TN(t.children):t.value=0),e+=Math.abs(t.value)})),e};function LN(t){return t.depth}function CN(t,e){return e-1-t.endDepth}const EN=(t,e)=>(null==t?void 0:t.y0)-(null==e?void 0:e.y0),DN=(t,e)=>{if(D(t.value))return null;const i=(e?t.targetLinks:t.sourceLinks).reduce(((t,e)=>(D(e.value)?t.count+=1:t.sum+=e.value,t)),{sum:0,count:0});return i.count>0?(t.value-i.sum)/i.count:null},PN={left:LN,right:CN,justify:function(t,e){return t.sourceLinks.length?t.depth:e-1},center:function(t,e,i){return t.targetLinks.length?t.depth:t.sourceLinks.length?Ha(t.sourceLinks.map((t=>i[t.target].depth)))-1:0},start:LN,end:CN},ON=Kb(0,1);class RN{constructor(t){this._ascendingSourceBreadth=(t,e)=>EN(this._nodeMap[t.source],this._nodeMap[e.source])||t.index-e.index,this._ascendingTargetBreadth=(t,e)=>EN(this._nodeMap[t.target],this._nodeMap[e.target])||t.index-e.index,this.options=Object.assign({},RN.defaultOptions,t);const e=this.options.nodeKey,i=xs(e)?e:e?Dm(e):null;this._getNodeKey=i,this._logger=g.getInstance(),this._alignFunc=xs(this.options.setNodeLayer)?t=>this.options.setNodeLayer(t.datum):PN[this.options.nodeAlign]}layout(t,e){if(!t)return null;const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};lN(this.options.direction)?this._viewBox={x0:i.y0,x1:i.y1,y0:i.x0,y1:i.x1,width:i.height,height:i.width}:this._viewBox=i;const s=this.computeNodeLinks(t),n=s.nodes;let r=s.links;if(this._nodeMap=s.nodeMap,this.computeNodeValues(n),this.computeNodeDepths(n),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(n),this._maxDepth<=1)return null;const a=this.computeNodeBreadths(n);if(this.computeLinkBreadths(n),n.forEach((t=>{t.sourceLinks=t.sourceLinks.filter((t=>!D(t.source)&&!D(t.target))),t.targetLinks=t.targetLinks.filter((t=>!D(t.source)&&!D(t.target)))})),r=r.filter((t=>!D(t.source)&&!D(t.target))),lN(this.options.direction))if(this.options.inverse){const t=this._viewBox.x1;n.forEach((e=>{const{y0:i,y1:s,x0:n,x1:r}=e;e.y0=t-r,e.y1=t-n,e.x0=i,e.x1=s})),r.forEach((e=>{e.vertical=!0;const{x0:i,x1:s,y0:n,y1:r}=e;e.x0=n,e.x1=r,e.y0=t-i,e.y1=t-s}))}else n.forEach((t=>{const{y0:e,y1:i}=t;t.y0=t.x0,t.y1=t.x1,t.x0=e,t.x1=i})),r.forEach((t=>{t.vertical=!0;const e=t.x0,i=t.x1;t.x0=t.y0,t.x1=t.y1,t.y0=e,t.y1=i}));else this.options.inverse&&(n.forEach((t=>{const{x0:e,x1:s}=t;t.x0=i.x1-s,t.x1=i.x1-e})),r.forEach((t=>{t.x0=i.x1-t.x0,t.x1=i.x1-t.x1})));return r.forEach((t=>{const e=this._nodeMap[t.source],i=this._nodeMap[t.target];t.sourceRect={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},t.targetRect={x0:i.x0,x1:i.x1,y1:i.y1,y0:i.y0}})),{nodes:n,links:r,columns:a}}computeHierarchicNodeLinks(t){const e=[],i=[],s={},n={},r=[];TN(t);const a=(t,i,n)=>{t.forEach(((t,o)=>{const l=this._getNodeKey?this._getNodeKey(t):n?`${n[n.length-1].key}-${o}`:`${i}-${o}`,h=D(t.value)?0:DH(t.value);if(s[l])s[l].value=void 0;else{const n={depth:i,datum:t,index:o,key:l,value:h,sourceLinks:[],targetLinks:[]};s[l]=n,e.push(n)}n&&r.push({source:n[n.length-1].key,target:l,value:h,parents:n}),t.children&&t.children.length&&a(t.children,i+1,n?n.concat([s[l]]):[s[l]])}))};return a(t,0,null),r.forEach(((t,e)=>{const r=`${t.source}-${t.target}`,a=aD(t,["parents"]);if(a.parents=t.parents.map((t=>aD(t,["sourceLinks","targetLinks"]))),n[r])return n[r].value+=DH(t.value),void n[r].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};i.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),n[r]=o})),{nodes:e,links:i,nodeMap:s}}computeSourceTargetNodeLinks(t){const e=[],i=[],s={};t.nodes&&t.nodes.forEach(((t,i)=>{const n={depth:-1,datum:t,index:i,key:this._getNodeKey?this._getNodeKey(t):i,value:t.value,sourceLinks:[],targetLinks:[]};s[n.key]=n,e.push(n)}));const n=[];return t.links.forEach(((r,a)=>{const o=!D(r.source),l=!D(r.target);if(t.nodes&&(!s[r.source]||!s[r.target]))return;t.nodes||!o||s[r.source]||(s[r.source]={value:void 0,depth:-1,index:e.length,key:r.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.source])),t.nodes||!l||s[r.target]||(s[r.target]={value:void 0,depth:-1,index:e.length,key:r.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.target]));const h={index:a,source:r.source,target:r.target,datum:r,value:r.value};this.options.divideNodeValueToLink&&D(r.value)&&n.push(h),i.push(h),o&&s[r.source].sourceLinks.push(h),l&&s[r.target].targetLinks.push(h)})),this.options.divideNodeValueToLink&&n.length&&n.forEach((t=>{const e=[DN(s[t.source]),DN(s[t.target],!0)].filter((t=>!D(t)));e.length&&(t.value=Ha(e))})),{nodeMap:s,nodes:e,links:i}}computeNodeLinks(t){let e;"links"in t?e=this.computeSourceTargetNodeLinks(t):(this._isHierarchic=!0,e=this.computeHierarchicNodeLinks(t.nodes));let i=e.nodes;const s=e.links;if(this.options.linkSortBy)for(let t=0,e=i.length;tt.targetLinks.length||t.sourceLinks.length))),{nodes:i,links:s,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e{var i;return t+(null!==(i=DH(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=DH(e.value))&&void 0!==i?i:0)}),0))}}computeNodeDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link"),this._maxDepth=r}computeNodeEndDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){const e=this.options.nodeWidth,i=this.options.linkWidth,s=this.options.minStepWidth,n=this._viewBox.width;let r=null,a=null,o=!1;if(S(e)){const t=Rs(parseFloat(e.replace("%",""))/100,0,1);let i=n/(this._maxDepth-1+t);s>0&&(i=Math.max(s,i)),r=i*t,a=i*(1-t),o=!0}else if(h(e)){if(r=e,h(i))a=i;else if(D(i)){let t=(n-e)/(this._maxDepth-1);s>0&&(t=Math.max(s,t)),a=t-e}o=!0}else xs(e)&&h(i)&&(a=i);const l=[];for(let e=0,i=t.length;e{const i=e.reduce(((t,e)=>t+e.value),0),s=e.reduce(((t,e)=>t+this.options.nodeGap(e)),0);return Math.min(t,(this._viewBox.height-s)/i)}),1/0);else{const e=t.reduce(((t,e)=>Math.max(t,e.length)),0),i=this._viewBox.height/e,s=Math.min(this.options.nodeGap,i);if(a=()=>s,this._gapY=s,(n+s)*e>this._viewBox.height&&(n=i-s),this.options.equalNodeHeight)o=this._viewBox.height/e-s;else{const e=n>0?Math.max(s,n):s;r=t.reduce(((t,i)=>{const s=i.reduce(((t,e)=>t+e.value),0);return Math.min(t,(this._viewBox.height-((i.length-1)*e+n))/s)}),1/0)}}const l="start"===this.options.gapPosition,d=!l&&"end"!==this.options.gapPosition,c=h(this.options.nodeHeight)?t=>this.options.nodeHeight:xs(this.options.nodeHeight)?this.options.nodeHeight:o>0?t=>o:t=>Math.max(t.value*r,0),u=h(this.options.linkHeight)?()=>this.options.linkHeight:xs(this.options.linkHeight)?this.options.linkHeight:(t,e,i)=>Math.max(e.value?i*ON(t.value/e.value):0,s,0);for(let e=0,i=t.length;e0)if("start"===this.options.crossNodeAlign);else if("end"===this.options.crossNodeAlign)for(let t=0,e=i.length;t1&&(p/=i.length-1,r+p>=0)){r+=p,this._gapY=Math.min(r);for(let t=1,e=i.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}D(this.options.nodeSortBy)&&n.sort(EN),this.resolveCollisions(n,i)}}relaxRightToLeft(t,e,i){for(let s=t.length-2;s>=0;--s){const n=t[s];for(let t=0,i=n.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}void 0===this.options.nodeSortBy&&n.sort(EN),this.resolveCollisions(n,i)}}resolveCollisions(t,e){const i=t.length>>1,s=t[i];this.resolveCollisionsBottomToTop(t,s.y0-this._gapY,i-1,e),this.resolveCollisionsTopToBottom(t,s.y1+this._gapY,i+1,e),this.resolveCollisionsBottomToTop(t,this._viewBox.y1,t.length-1,e),this.resolveCollisionsTopToBottom(t,this._viewBox.y0,0,e)}resolveCollisionsTopToBottom(t,e,i,s){for(;i1e-6&&(n.y0+=r,n.y1+=r),e=n.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,s){for(;i>=0;--i){const n=t[i],r=(n.y1-e)*s;r>1e-6&&(n.y0-=r,n.y1-=r),e=n.y0-this._gapY}}targetTop(t,e){let i,s,n,r=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,s=t.sourceLinks.length;ii.y1||n?(e.y0=i.y1-e.thickness/2,n=!0):s+=e.thickness}let r=i.y0;n=!1;for(let t=0,e=i.targetLinks.length;ti.y1||n?(e.y1=i.y1-e.thickness/2,n=!0):r+=e.thickness}}}computeLinkBreadthsOverlap(t){const e=this.options.linkOverlap;for(let i=0,s=t.length;i{const i=new RN(t).layout(Array.isArray(e)?e[0]:e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});return i?[i]:[]},IN=(t,e,i)=>{e.forEach((e=>{D(e[i])||t.add(e[i]),e.children&&e.children.length>0&&IN(t,e.children,i)}))},FN=t=>{var e;if(!t||!y(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},YN=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new RN(e),r=[];return r.push(n.layout(s,i)),r},jN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},HN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class zN extends iL{constructor(){super(...arguments),this._getDimensionData=t=>{if(t.source){if(h(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const NN=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),VN=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"},WN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.y0-n/2),l=c(t.y1-n/2)):"end"===t.align?(o=c(t.y0+t.thickness/2-n),l=c(t.y1+t.thickness/2-n)):(o=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${a},${c(l-n/2)}L${c(a+n)},${c((l+p)/2)}L${a},${c(p+n/2)}`:"",_=t.startArrow&&g?`L${r},${c(u+n/2)}L${c(r-n)},${c((o+u)/2)}L${r},${c(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${m}L${a},${p}L${r},${u}${_}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${m}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${_}Z`:`M${r},${o}C${h},${o},${d},${l},${a},${l}\n ${m}L${a},${p}C${d},${p},${h},${u},${r},${u}${_}Z`},GN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(c=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d)),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.x0-n/2),l=c(t.x1-n/2)):"end"===t.align?(o=c(t.x0+t.thickness/2-n),l=c(t.x1+t.thickness/2-n)):(o=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${c(l-n/2)},${a}L${c((l+p)/2)},${c(a+n)}L${c(p+n/2)},${a}`:"",_=t.startArrow&&g?`L${c(u+n/2)},${r}L${c((u+o)/2)},${c(r-n)}L${c(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${m}L${p},${a}L${u},${r}${_}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${m}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${_}Z`:`M${o},${r}C${o},${h},${l},${d},${l},${a}\n ${m}L${p},${a}C${p},${d},${u},${h},${u},${r}${_}Z`},UN=(t,e,i,s)=>{var n;const r=null!==(n=t.direction)&&void 0!==n?n:null==s?void 0:s.direction,a=["vertical","TB","BT"].includes(r)?GN:WN,o="number"==typeof t.ratio&&t.ratio>=0&&t.ratio<=1,l=Object.keys(t);return["x0","y0","x1","y1"].every((t=>l.includes(t)))?{back:{path:o?a(t,1):""},front:{path:a(t,o?t.ratio:1)}}:{}},$N=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1),thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}},XN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0),thickness:t.getGraphicAttribute("thickness",!0),round:t.getGraphicAttribute("round",!0),align:t.getGraphicAttribute("align",!0),pathType:t.getGraphicAttribute("pathType",!0),endArrow:t.getGraphicAttribute("endArrow",!0),startArrow:t.getGraphicAttribute("startArrow",!0)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}},KN=(t,e,i)=>{const s={thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign(Object.assign({x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0)},s),s),to:Object.assign({x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1)},s)}};class qN extends yx{constructor(){super(...arguments),this.type=qN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId(),s=this.getStyle("direction");this._product=e.glyph("linkPath",null!=t?t:e.rootMark).id(i).configureGlyph({direction:s}),this._compiledProductId=i}}qN.type="linkPath";const ZN=Object.assign(Object.assign({},mL),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class JN extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}class QN extends JC{constructor(){super(...arguments),this.type=fl.sankey,this.transformerConstructor=JN,this._nodeLayoutZIndex=Dy.Node,this._labelLayoutZIndex=Dy.Label,this._viewBox=new Kt,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(M(a))return a;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a,o;const l=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(l)return l;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._nodesSeriesData)||void 0===s?void 0:s.getLatestData())||void 0===n?void 0:n.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,o=null===(a=null===(r=this._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color");return null==o?void 0:o.scale(null==i?void 0:i[this._spec.seriesField])}const d=h(t.source)?this.getNodeList()[t.source]:t.source;return null===(o=this._colorScale)||void 0===o?void 0:o.scale(d)},this._handleEmphasisElement=t=>{var e,i,s,n,r;const a=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},o=t.item;"adjacency"===a.effect?o&&o.mark===(null===(i=this._nodeMark)||void 0===i?void 0:i.getProduct())?this._handleNodeAdjacencyClick(o):o&&o.mark===(null===(s=this._linkMark)||void 0===s?void 0:s.getProduct())?this._handleLinkAdjacencyClick(o):this._handleClearEmpty():"related"===a.effect&&(o&&o.mark===(null===(n=this._nodeMark)||void 0===n?void 0:n.getProduct())?this._handleNodeRelatedClick(o):o&&o.mark===(null===(r=this._linkMark)||void 0===r?void 0:r.getProduct())?this._handleLinkRelatedClick(o):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getProductElements();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getProductElements();if(!s||!s.length)return;const n=[Sy.STATE_SANKEY_EMPHASIS,Sy.STATE_SANKEY_EMPHASIS_REVERSE];i.forEach((t=>{t.removeState(n)})),s.forEach((t=>{t.removeState(n)})),this._needClear=!1},this._handleNodeAdjacencyClick=t=>{const e=t.getDatum(),i=[e.key];if(this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=t.getDatum(),r=(null==n?void 0:n.parents)?"parents":"source";if(Fa(n[r]).includes(e.key)){let s;if(i.includes(n.source)||i.push(n.source),i.includes(n.target)||i.push(n.target),"parents"===r){const t=n.datum;s=(t?t.filter((t=>t.parents.some((t=>t.key===e.key)))).reduce(((t,e)=>t+e.value),0):0)/n.value}t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:s})}else n.target===e.key?i.includes(n.source)||i.push(n.source):(t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=t.getDatum(),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getProductElements();if(!e||!e.length)return;e.forEach((e=>{e===t?(e.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(Sy.STATE_SANKEY_EMPHASIS),e.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=t.getDatum(),s=this._nodeMark.getProductElements();if(!s||!s.length)return;const n=this._linkMark.getProductElements();if(n&&n.length){if("source"==((null===(e=n[0].getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const d=n.getDatum(),c=(null==d?void 0:d.parents)?"parents":"source";if(Fa(d[c]).includes(i.key)){if(e.includes(null!==(a=d.key)&&void 0!==a?a:d.index)||e.push(null!==(o=d.key)&&void 0!==o?o:d.index),t.includes(d.source)||t.push(d.source),!t.includes(d.target)){t.push(d.target);let i=s.find((t=>t.data[0].key===d.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(d.target===i.key&&(e.includes(null!==(l=d.key)&&void 0!==l?l:d.index)||e.push(null!==(h=d.key)&&void 0!==h?h:d.index),!t.includes(d.source))){t.push(d.source);let i=s.find((t=>t.data[0].key===d.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;e.includes(null!==(s=t.getDatum().key)&&void 0!==s?s:t.getDatum().index)?(t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS)):(t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Fa(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;rt.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const r=s.getDatum(),a=(null==r?void 0:r.parents)?"parents":"source",o=r.datum,l=o?o.filter((t=>t[a].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===r.source&&t.target===r.target));if(l&&l.length){t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target);const e=l.reduce(((t,e)=>t+e.value),0)/r.value;return s.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(Sy.STATE_SANKEY_EMPHASIS),void s.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target),s.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(Sy.STATE_SANKEY_EMPHASIS),void s.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:h.value/r.value});s.removeState(Sy.STATE_SANKEY_EMPHASIS),s.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}this._needClear=!0}},this._handleLinkRelatedClick=t=>{var e;const i=this._nodeMark.getProductElements();if(!i||!i.length)return;const s=this._linkMark.getProductElements();if(s&&s.length){if("source"==((null===(e=t.getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[Sy.STATE_SANKEY_EMPHASIS,Sy.STATE_SANKEY_EMPHASIS_REVERSE];this._linkMark&&s.forEach((e=>{e.removeState(t)})),this._nodeMark&&i.forEach((e=>{e.removeState(t)}))}else{const e=t.getDatum(),n=[e.source,e.target],r=[];Fa(e.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;st.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),s.forEach((t=>{const i=t.getDatum(),s=i.datum;if(i.source===e.source&&i.target===e.target)return t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:1});const a=s?s.filter((t=>{const i=t.parents.map((t=>t.key));return i.includes(e.source)&&i.includes(e.target)})):null;if(a&&a.length){n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target);const s=a.filter((t=>t.parents.some(((i,s)=>{var n;return i.key===e.source&&(null===(n=t.parents[s+1])||void 0===n?void 0:n.key)===e.target})))).reduce(((t,e)=>t+e.value),0),r=s/i.value;return t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:r})}const o=r.find((t=>t.source===i.source&&t.target===i.target));if(o)return n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target),t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:o.value/i.value});t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._highLightElements(i,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var t,e,i,s;super.initData();const n=this.getViewData(),r=this.getRawData();if(r&&n){Cp(this._dataSet,"sankeyLayout",YN),Cp(this._dataSet,"sankeyFormat",FN),r.transform({type:"sankeyFormat"},!1),n.transform({type:"sankeyLayout",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,crossNodeAlign:this._spec.crossNodeAlign,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,minLinkHeight:this._spec.minLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse},level:zp.sankeyLayout});const{dataSet:a}=this._option;Cp(a,"sankeyNodes",jN),Cp(a,"flatten",LH);const o=new R(a,{name:`sankey-node-${this.id}-data`});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:cL.bind(this),call:uL}},!1),this._nodesSeriesData=new oL(this._option,o),Cp(a,"sankeyLinks",HN);const l=new R(a,{name:`sankey-link-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyLinks"}),l.transform({type:"addVChartProperty",options:{beforeCall:cL.bind(this),call:uL}},!1),this._linksSeriesData=new oL(this._option,l)}}initMark(){var t,e,i,s;const n=this._createMark(QN.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId(),customShape:null===(t=this._spec.node)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.node)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(this._nodeLayoutZIndex),this._nodeMark=n);const r=this._createMark(QN.mark.link,{dataView:this._linksSeriesData.getDataView(),dataProductId:this._linksSeriesData.getProductId(),customShape:null===(i=this._spec.link)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.link)||void 0===s?void 0:s.stateSort});r&&(this._linkMark=r)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.getLatestData(),i=Fa(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.getLatestData(),i=Fa(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},Sy.STATE_NORMAL,Oy.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",Oy.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness,direction:this.direction},Sy.STATE_NORMAL,Oy.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",Oy.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setZIndex(this._labelLayoutZIndex)}_createText(t,e){if(D(t)||D(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=XT(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),zC("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(HC(null===(s=Xl.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),zC("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData.getDataView())||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData.getDataView())||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:Vd.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodesSeriesData.updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linksSeriesData.updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{t.removeState([Sy.STATE_SANKEY_EMPHASIS_REVERSE,Sy.STATE_SANKEY_EMPHASIS]),e.includes(t.getDatum().key)||t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)}))}initTooltip(){this._tooltipHelper=new zN(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!D(a[0])||(a=this.getNodeList(),a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new nx;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{M(t[i])&&e.add(t[i]),M(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return IN(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?y(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}QN.type=fl.sankey,QN.transformerConstructor=JN,QN.mark=ZN;const tV=()=>{fc.registerTransform("sankey",{transform:BN,markPhase:"beforeJoin"},!0),FO(),fc.registerGlyph("linkPath",{back:"path",front:"path"}).registerFunctionEncoder(UN).registerChannelEncoder("backgroundStyle",((t,e)=>({back:e}))).registerDefaultEncoder((()=>({back:{zIndex:0},front:{zIndex:1}}))),fc.registerAnimationType("linkPathGrowIn",$N),fc.registerAnimationType("linkPathGrowOut",XN),fc.registerAnimationType("linkPathUpdate",KN),cN(),$A(),NA(),Xl.registerMark(qN.type,qN),LF(),Xl.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:NN(t,e)},EC))),Xl.registerAnimation("sankeyLinkPath",((t,e)=>({appear:VN(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),PC(),Xl.registerSeries(QN.type,QN)};class eV extends cO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,sourceField:t.sourceField,targetField:t.targetField,direction:t.direction,nodeAlign:t.nodeAlign,crossNodeAlign:t.crossNodeAlign,nodeGap:t.nodeGap,nodeWidth:t.nodeWidth,linkWidth:t.linkWidth,minStepWidth:t.minStepWidth,minNodeHeight:t.minNodeHeight,minLinkHeight:t.minLinkHeight,dropIsolatedNode:t.dropIsolatedNode,nodeHeight:t.nodeHeight,linkHeight:t.linkHeight,equalNodeHeight:t.equalNodeHeight,linkOverlap:t.linkOverlap,iterations:t.iterations,nodeKey:t.nodeKey,linkSortBy:t.linkSortBy,nodeSortBy:t.nodeSortBy,setNodeLayer:t.setNodeLayer,node:t.node,link:t.link,label:t.label,emphasis:t.emphasis,inverse:t.inverse}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class iV extends fO{constructor(){super(...arguments),this.transformerConstructor=eV,this.type="sankey",this.seriesType=fl.sankey}_setStateInDatum(t,e,i,s,n){const r=y(i)?i[0]:i,a=r?Object.keys(r):null;this.getRegionsInQuerier(n).forEach((i=>{if(!r)return void i.interaction.clearEventElement(t,!0);let n=!1;i.getSeries().forEach((e=>{var o,l;let h=null;e.getMarksWithoutRoot().forEach((o=>{if("text"===o.type)return;let l=null;const d=o.getProduct();d&&((!s||xs(s)&&s(e,o))&&(l=d.elements.find((t=>a.every((e=>{var i;let s=null===(i=t.getDatum())||void 0===i?void 0:i.datum;return y(s)&&(s=s[0]),r[e]==(null==s?void 0:s[e])}))))),l&&(n=!0,i.interaction.startInteraction(t,l),(d.id().includes("node")||d.id().includes("link"))&&(h=l)))})),h&&(null===(l=(o=e)._handleEmphasisElement)||void 0===l||l.call(o,{item:h}))})),e&&n&&i.interaction.reverseEventElement(t)}))}}iV.type="sankey",iV.seriesType=fl.sankey,iV.transformerConstructor=eV;class sV extends iL{constructor(){super(...arguments),this._getMeasureData=t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]]}}const nV=Object.assign({},AO);class rV extends TO{constructor(){super(...arguments),this.type=fl.rangeArea}initMark(){var t;const{customShape:e,stateSort:i}=null!==(t=this._spec.area)&&void 0!==t?t:{};this._areaMark=this._createMark(rV.mark.area,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:e,stateSort:i})}initMarkStyle(){this.initAreaMarkStyle()}initAreaMarkStyle(){const t=this._areaMark;t&&(super.initAreaMarkStyle(),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x1:t=>{if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}},"normal",Oy.Series):this.setMarkStyle(this._areaMark,{y1:t=>{if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}},"normal",Oy.Series),this.setMarkStyle(t,{stroke:!1},"normal",Oy.Series))}initTooltip(){this._tooltipHelper=new sV(this)}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.fieldY;return!!(t&&t.latestData&&e.length)&&e.every((e=>t.latestData[e]&&t.latestData[e].allValid))}}rV.type=fl.rangeArea,rV.mark=nV;class aV extends uO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign({},super._getDefaultSeriesSpec(t));return s.area=t.area,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),vy(t)}}class oV extends fO{constructor(){super(...arguments),this.transformerConstructor=aV,this.type="rangeArea",this.seriesType=fl.rangeArea}}function lV(t){if(t)return t.type===qh.Band?t.bandwidth():t.type===qh.Point?t.step():void 0}oV.type="rangeArea",oV.seriesType=fl.rangeArea,oV.transformerConstructor=aV;class hV extends Gm{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});const e=this.spec.encode[t];if(e&&"update"===t){const i=this.parameters(),s=Gp(e)?null:Object.keys(e).reduce(((t,s)=>(Am(e[s])&&(t[s]=$p(e[s].scale,i)),t)),{});this._encoders[t]={callback:(t,i,n)=>{const r=Om(e,t,i,n);if(D(r.size)){const t=s.x?lV(s.x):void 0,e=s.y?lV(s.y):void 0;D(t)&&D(e)?r.size=10:D(t)?r.size=e:D(e)&&(r.size=t),r.size=[t,e]}return D(r.shape)&&(r.shape="rect"),r}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if(h(i.padding)&&i.padding>0)t.size=y(i.size)?i.size.map((t=>Math.max(t-i.padding,1))):Math.max(i.size-i.padding,1);else if(y(i.padding)&&2===i.padding.length){const e=y(i.size)?i.size:[i.size,i.size];t.size=[Math.max(e[0]-i.padding[0],1),Math.max(e[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(ym.symbol)}release(){super.release(),this._encoders=null}}hV.markType=Qd.cell;class dV extends oE{constructor(){super(...arguments),this.type=dV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{padding:0})}}dV.type="cell";function cV(t){return!1===t?{}:{type:"fadeIn"}}class uV extends iL{enableByType(t){return"dimension"!==t}}const pV=Object.assign(Object.assign({},mL),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class gV extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class mV extends JC{constructor(){super(...arguments),this.type=fl.heatmap,this.transformerConstructor=gV}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Fa(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._cellMark=this._createMark(mV.mark.cell,{morph:WC(this._spec,mV.mark.cell.name),defaultMorphElementKey:this.getDimensionField()[0],isSeriesMark:!0,progressive:n,customShape:null===(t=this._spec.cell)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.cell)||void 0===e?void 0:e.stateSort}),this._backgroundMark=this._createMark(mV.mark.cellBackground,{progressive:n,customShape:null===(i=this._spec.cellBackground)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.cellBackground)||void 0===s?void 0:s.stateSort})}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",Oy.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=yD(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",Oy.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}initInteraction(){this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=ZC(this);this._cellMark.setAnimationConfig(HC(null===(i=Xl.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),zC("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new uV(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}mV.type=fl.heatmap,mV.mark=pV,mV.transformerConstructor=gV;const _V=()=>{LF(),Xl.registerMark(dV.type,dV),Mx(),Uv(),jA(),fc.registerGraphic(Qd.cell,Ev),fc.registerMark(Qd.cell,hV),Xl.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},EC),{appear:cV(e)}))),XP(),lO(),Xl.registerSeries(mV.type,mV)};class fV extends uO{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{valueField:t.valueField,cell:t.cell})}}class vV extends fO{constructor(){super(...arguments),this.transformerConstructor=fV,this.type="heatmap",this.seriesType=fl.heatmap}}vV.type="heatmap",vV.seriesType=fl.heatmap,vV.transformerConstructor=fV;const yV=Object.assign(Object.assign({},mL),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),bV=(t,e)=>{const i=xs(e)?e:t=>t;let s,n;if(t&&t.length){const e=t.length;for(let r=0;r{var i,s,n,r,a,o,l,d,c,u,p,g,m,_,f;if(!t||!(null==e?void 0:e.view)||!y(t))return t;const v=e.view();if(v.x1-v.x0==0||v.y1-v.y0==0||v.x1-v.x0==-1/0||v.x1-v.x0==1/0||v.y1-v.y0==-1/0||v.y1-v.y0==1/0)return t;const b=At(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=At(null!==(s=e.endAngle)&&void 0!==s?s:270),S=Math.max((v.x1-v.x0)/2,(v.y1-v.y0)/2),M=EH(null!==(n=e.innerRadius)&&void 0!==n?n:0,S),k=EH(e.outerRadius,S),A=[h(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:v.x0+EH(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",v.x1-v.x0),h(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:v.y0+EH(null!==(c=null===(d=e.center)||void 0===d?void 0:d[1])&&void 0!==c?c:"50%",v.y1-v.y0)],w=Dm(e.field),T=t.map(w),[L,C]=bV(T),E=L===C?t=>(M+k)/2:t=>M+(k-M)*(t-L)/(C-L),P=D(e.radiusField)?w:Dm(e.radiusField),O=null!==(p=null===(u=null==e?void 0:e.radiusRange)||void 0===u?void 0:u[1])&&void 0!==p?p:5;let R=t=>O;if(P){const[i,s]=P!==w?bV(t.map(P)):[L,C],n=null!==(m=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==m?m:5,r=null!==(f=null===(_=e.radiusRange)||void 0===_?void 0:_[1])&&void 0!==f?f:5;i!==s&&(R=t=>n+(r-n)*(P(t)-i)/(s-i))}const B=Math.min(b,x),I=Math.max(b,x),F=AV(B,I,t.length),Y=[],j=(I-B)/60;return t.forEach(((t,e)=>{const i=E(T[e]),s=R(t);let n,r,a=F[e];for(let t=0;t<60&&(n=A[0]+i*Math.cos(a),r=A[1]+i*Math.sin(a),wV({x:n,y:r,size:s},Y)||n-sv.x1||r-sv.y1);t++)t<59&&(a+=j,a>I?a=B:a{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const d=[];let c=t;for(;l=2&&(r/=2,n*=2));return d},wV=(t,e)=>!(!e||!e.length)&&e.some((e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2){if(!t||!y(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[yT]:null==n?void 0:n[yT],[xT]:null==n?void 0:n[xT]}};class LV extends yx{constructor(){super(...arguments),this.type=LV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.glyph("ripplePoint",null!=t?t:e.rootMark).id(i),this._compiledProductId=i}}LV.type="ripple";const CV=()=>{Xl.registerMark(LV.type,LV),fc.registerGlyph("ripplePoint",{symbol:"symbol",ripple0:"symbol",ripple1:"symbol",ripple2:"symbol"}).registerFunctionEncoder(((t,e,i,s)=>{var n;const r=Math.max(0,Math.min(t.ripple,1)),a=null!==(n=t.size)&&void 0!==n?n:i.getGraphicAttribute("size"),o=.5*a;return{ripple0:{size:a+o*r,fillOpacity:.75-.25*r},ripple1:{size:a+o*(1+r),fillOpacity:.5-.25*r},ripple2:{size:a+o*(2+r),fillOpacity:.25-.25*r}}})).registerDefaultEncoder((()=>({ripple0:{fillOpacity:.75},ripple1:{fillOpacity:.5},ripple2:{fillOpacity:.25}}))),cN(),$A(),GA()},EV=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class DV extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class PV extends lI{constructor(){super(...arguments),this.type=fl.correlation,this.transformerConstructor=DV,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){M(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){M(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){var t,e,i;if(super.initData(),!this._data)return;Cp(this._dataSet,"correlation",kV);const s=new f;Ep(s,"dataview",b),Cp(s,"correlationCenter",TV);const n=new R(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new oL(this._option,n)}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){var t,e,i,s;const n=this._createMark(PV.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:yT,customShape:null===(t=this._spec.nodePoint)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nodePoint)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(Dy.Node),this._nodePointMark=n);const r=this._createMark(PV.mark.ripplePoint,{key:yT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});r&&(this._ripplePointMark=r);const a=this._createMark(PV.mark.centerPoint,{key:yT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId(),customShape:null===(i=this._spec.centerPoint)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.centerPoint)||void 0===s?void 0:s.stateSort});a&&(a.setZIndex(Dy.Node),this._centerPointMark=a)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[xV],y:t=>t[SV],size:t=>t[MV],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},Sy.STATE_NORMAL,Oy.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},Sy.STATE_NORMAL,Oy.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},Sy.STATE_NORMAL,Oy.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},Sy.STATE_NORMAL,Oy.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),zC("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}PV.type=fl.correlation,PV.mark=yV,PV.transformerConstructor=DV;class OV extends cO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,sizeField:t.sizeField,sizeRange:t.sizeRange,centerX:t.centerX,centerY:t.centerY,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,ripplePoint:t.ripplePoint,centerPoint:t.centerPoint,centerLabel:t.centerLabel,nodePoint:t.nodePoint,label:t.label}),i=fl.correlation;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class RV extends fO{constructor(){super(...arguments),this.transformerConstructor=OV,this.type="correlation",this.seriesType=fl.correlation}}RV.type="correlation",RV.seriesType=fl.correlation,RV.transformerConstructor=OV;class BV extends oO{constructor(){super(...arguments),this.type=r.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),AE(this._regions,(t=>{Ad(this.getOrient())?QE(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):QE(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=Ll({},this._spec.tick,null===(t=this._spec.layers)||void 0===t?void 0:t[0])}_initData(){var t;if(super._initData(),null===(t=this._spec.layers)||void 0===t?void 0:t[1]){const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_layer_1_ticks`}).parse(this._scale,{type:"scale"}).transform({type:`${this.type}-ticks`,options:Object.assign(Object.assign({},this._tickTransformOption()),{tickCount:this._spec.layers[1].tickCount,forceTickCount:this._spec.layers[1].forceTickCount,tickStep:this._spec.layers[1].tickStep})},!1);this._layerTickData=new gx(this._option,t)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}_getLabelFormatMethod(){var t,e,i,s,n,r,a,o;const l=UT.getInstance(),h=(null===(e=null===(t=this._spec.layers)||void 0===t?void 0:t[1])||void 0===e?void 0:e.timeFormat)||"%Y%m%d",d="local"===((null===(s=null===(i=this._spec.layers)||void 0===i?void 0:i[1])||void 0===s?void 0:s.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat,c=(null===(r=null===(n=this._spec.layers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.timeFormat)||"%Y%m%d",u="local"===((null===(o=null===(a=this._spec.layers)||void 0===a?void 0:a[0])||void 0===o?void 0:o.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat;return(t,e,i,s,n)=>{var r;let a;return a=0===n?u(c,t):d(h,t),(null===(r=this._spec.label)||void 0===r?void 0:r.formatMethod)?this._spec.label.formatMethod(a,e):a}}getLabelItems(t){var e,i;const s=[],n=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();n&&n.length&&s.push(n.map((e=>JE(e.value,this._getNormalizedValue([e.value],t)))));const r=null===(i=this._layerTickData)||void 0===i?void 0:i.getLatestData();return r&&r.length&&s.push(r.map((e=>JE(e.value,this._getNormalizedValue([e.value],t))))),s}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,rO),t}transformScaleDomain(){}}BV.type=r.cartesianTimeAxis,BV.specKey="axes";class IV{nice(t=10,e){var i,s,n,r;const a=this._domain;let o=[],l=null;if(e){const t=Ib(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,l=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else l="all";if(l){const t=((t,e)=>{const i=t.slice();let s=0,n=i.length-1,r=i[s],a=i[n];return aMath.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(n=o[1])&&void 0!==n?n:t[t.length-1]:"max"===l&&(t[0]=null!==(r=o[0])&&void 0!==r?r:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function FV(t){return e=>-t(-e)}function YV(t=Number.EPSILON){return e=>Math.max(e,t)}class jV extends qb{constructor(){super(pb(10),ub(10)),this.type=qh.Log,this._limit=YV(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new jV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=pb(this._base),s=ub(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=FV(i),this._pows=FV(s),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=hb,this.untransformer=db):(this._logs=i,this._pows=s,this._limit=YV(),this.transformer=this._logs,this.untransformer=s),this}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._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return ab}d3Ticks(t=10,e){const i=this.domain(),s=this._limit(i[0]),n=this._limit(i[i.length-1]);return Yb(s,n,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Hb(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}QA(jV,IV);class HV extends oO{constructor(){super(...arguments),this.type=r.cartesianLogAxis,this._zero=!1,this._scale=new jV}initScales(){var t;super.initScales(),this._scale.base(null!==(t=this._spec.base)&&void 0!==t?t:10),this._scale.clamp(!0,null,!1)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,rO),t}transformScaleDomain(){}}HV.type=r.cartesianLogAxis,HV.specKey="axes",QA(HV,iO);class zV extends Zb{constructor(){super(gb(1),mb(1)),this.type=qh.Symlog,this._const=1}clone(){return(new zV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=gb(t),this.untransformer=mb(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),s=i[0],n=i[i.length-1];return Yb(s,n,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}QA(zV,IV);class NV extends oO{constructor(){super(...arguments),this.type=r.cartesianSymlogAxis,this._zero=!1,this._scale=new zV}initScales(){var t;super.initScales(),this._scale.constant(null!==(t=this._spec.constant)&&void 0!==t?t:10)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,rO),t}transformScaleDomain(){}}function VV(t){var e,i;const s=Object.assign({},t);return jm(t.style)||(s.textStyle=WE(t.style)),jm(t.textStyle)||Ll(s.textStyle,WE(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&WE(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&WE(s.background.style),s}NV.type=r.cartesianSymlogAxis,NV.specKey="axes",QA(NV,iO);class WV extends Bk{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute,s=yD(i),n=aa.group({x:s[3],y:s[0],pickable:t,childrenPickable:t});n.name=uT.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+s[1]+s[3],this.attribute.height=r.height()+s[0]+s[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:s=0,background:n,minWidth:r,maxWidth:a,shape:o}=t,l={x:0,y:0,text:e,textStyle:i,padding:yD(s),minWidth:r,maxWidth:a};o&&o.visible&&(l.shape=Object.assign({visible:!0},o.style),M(o.space)&&(l.space=o.space)),n&&n.visible&&(l.panel=Object.assign({visible:!0},n.style));const h=new PD(l);h.name=uT.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}function GV(){p_(),Uv(),cf()}const UV={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};GV();class $V extends Bk{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},$V.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current{let[s,n]=t;n=i-e?[e,i]:(s=Math.min(Math.max(s,e),i-r),[s,s+r])},JV={debounce:Kd,throttle:qd};KV();class QV extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},QV.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:s,width:n,height:r,range:a}=this.attribute,o=this._sliderSize,[l,h]=this._getScrollRange();let d;if("vertical"===s){const t=i-this._viewPosition.y,e=Rs(t-o/2,l,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=Rs(t-o/2,l,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(a[1]-a[0])/2,d+(a[1]-a[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:s,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?s:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===No.env?(No.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),No.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:s}=this.stage.eventPointTransform(t);let n,r,a=0;const{width:o,height:l}=this.getSliderRenderBounds();return"vertical"===e?(r=s,a=r-this._prePos,n=a/l):(r=i,a=r-this._prePos,n=a/o),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[s,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:JV[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:s=[0,1]}=this.attribute,n=this.getScrollRange(),[r,a]=this._computeScrollValue(t),o=[n[0]+a,n[1]+a];this._dispatchEvent("scrollUp",{pre:i,value:ZV(o,s[0],s[1])}),"browser"===No.env?(No.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),No.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:s=[0,1],range:n,realTime:r=!0}=this.attribute,a=ZV(t,s[0],s[1]);if(e){const t=this._getSliderPos(a);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=a,r&&this._dispatchEvent("scrollDrag",{pre:n,value:a})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",JV[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:s,limitRange:n=[0,1],railStyle:r,sliderStyle:a,padding:o=2}=this.attribute,l=this.createOrUpdateChild("scrollbar-container",{},"group"),h=l.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this.getSliderRenderBounds(),c=this._getSliderPos(ZV(s,n[0],n[1])),u=c[1]-c[0];let p;this._sliderSize=u,p="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const g=l.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{cornerRadius:this._getDefaultSliderCornerRadius()}),a),{boundsPadding:yD(o),pickMode:"imprecise"}),"rect");this._slider=g,this._container=l;const m=this._container.AABBBounds;this._viewPosition={x:m.x1,y:m.y1}}getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[s,n,r,a]=yD(i),o={x1:a,y1:s,x2:t-n,y2:e-r,width:Math.max(0,t-(a+n)),height:Math.max(0,e-(s+r))};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this.getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:n,y1:r}=this.getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[s*t[0]+r,s*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,s]=ZV(t,0,1),{width:n,height:r,x1:a,y1:o}=this.getSliderRenderBounds(),l=this._sliderSize;return"horizontal"===e?ZV([a+i*n,a+s*n],a,n-l):ZV([o+i*r,o+s*r],o,r-l)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}QV.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};var tW=function(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{const e=t.target;if(e&&e.name&&e.name.startsWith(uT.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,s,n;const r=t.target;if(r&&r.name&&r.name.startsWith(uT.item)){const a=r.delegate,{selectMode:o="multiple"}=this.attribute;if(r.name===uT.focus||"focus"===o){const s=a.hasState(dT.focus);a.toggleState(dT.focus),s?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[dT.unSelected,dT.unSelectedHover,dT.focus],t),this._setLegendItemState(e,dT.selected,t)})):(this._setLegendItemState(a,dT.selected,t),this._removeLegendItemState(a,[dT.unSelected,dT.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[dT.selected,dT.selectedHover,dT.focus],t),this._setLegendItemState(e,dT.unSelected,t))})))}else{null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((t=>{t.removeState(dT.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=a.hasState(dT.selected),r=this._getSelectedLegends();if("multiple"===o){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(cT.legendItemClick,a,t);i?(this._removeLegendItemState(a,[dT.selected,dT.selectedHover],t),this._setLegendItemState(a,dT.unSelected,t)):(this._setLegendItemState(a,dT.selected,t),this._removeLegendItemState(a,[dT.unSelected,dT.unSelectedHover],t))}else this._setLegendItemState(a,dT.selected,t),this._removeLegendItemState(a,[dT.unSelected,dT.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[dT.selected,dT.selectedHover],t),this._setLegendItemState(e,dT.unSelected,t))}))}this._dispatchLegendEvent(cT.legendItemClick,a,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,dT.selected),this._removeLegendItemState(e,[dT.unSelected,dT.unSelectedHover])):(this._removeLegendItemState(e,[dT.selected,dT.selectedHover]),this._setLegendItemState(e,dT.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:s,maxHeight:n,defaultSelected:r,lazyload:a,autoPage:o}=this.attribute,{spaceCol:l=oT,spaceRow:h=lT}=t,d=this._itemsContainer,{items:c,isHorizontal:u,startIndex:p,isScrollbar:g}=this._itemContext,m=g?1:u?i:e;let _,{doWrap:f,maxWidthInCol:v,startX:b,startY:x,pages:S}=this._itemContext,k=0;for(let t=p,e=c.length;tthis._itemContext.currentPage*m);t++){a&&(this._itemContext.startIndex=t+1),_=c[t],_.id||(_.id=_.label),_.index=t;let e=!0;y(r)&&(e=r.includes(_.label));const i=this._renderEachItem(_,e,t,c),p=i.attribute.width,m=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,m),v=Math.max(p,v),this._itemMaxWidth=Math.max(p,this._itemMaxWidth),u?(M(s)&&(g&&o?(S=Math.ceil((b+p)/s),f=S>1):b+p>s&&(f=!0,b>0&&(S+=1,b=0,x+=m+h))),0===b&&0===x||i.setAttributes({x:b,y:x}),b+=l+p):(M(n)&&(g&&o?(S=Math.ceil((x+m)/n),f=S>1):n<=m?(S+=1,f=!0,x=0,t>0&&(b+=k+l)):nthis._itemContext.maxPages&&(g=this._renderPagerComponent()),g||(r.setAttribute("y",this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0),this._innerView.add(r))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,s){var n,r;const{label:a,value:o}=this.attribute.item,l=s.AABBBounds,h=i.AABBBounds,d=l.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:s.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(s.setAttribute("maxLineWidth",Math.max(e*(null!==(n=a.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=o.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,s){var n,r;const{id:a,label:o,value:l,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:p,autoEllipsisStrategy:g}=this.attribute.item,{shape:m,label:_,value:f,background:v}=this.attribute.item,b=this._handleStyle(m,t,e,i,s),x=this._handleStyle(_,t,e,i,s),S=this._handleStyle(f,t,e,i,s),k=this._handleStyle(v,t,e,i,s),A=yD(d);let w;!1===v.visible?(w=aa.group({x:0,y:0,cursor:null===(n=k.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(w,uT.item,t,w)):(w=aa.group(Object.assign({x:0,y:0},k.style)),this._appendDataToShape(w,uT.item,t,w,k.state)),w.id=`${null!=a?a:o}-${i}`,w.addState(e?dT.selected:dT.unSelected);const T=aa.group({x:0,y:0,pickable:!1});w.add(T);let L,C=0,E=0,P=0;if(m&&!1!==m.visible){const i=$d(b,"style.size",10);E=y(i)?i[0]||0:i,P=$d(m,"space",8);const s=aa.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),b.style));Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&D(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&D(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(s,uT.itemShape,t,w,b.state),s.addState(e?dT.selected:dT.unSelected),T.add(s)}let O=0;if(c){const e=$d(u,"size",10);L=aa.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0,boundsPadding:A},u),{visible:!0,pickMode:"imprecise"})),this._appendDataToShape(L,uT.focus,t,w),O=e}const R=_.formatMethod?_.formatMethod(o,t,i):o,B=sA(Object.assign(Object.assign({x:E/2+P,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=x.style)||void 0===r?void 0:r.fontSize},x.style),{text:R,_originText:_.formatMethod?o:void 0}));this._appendDataToShape(B,uT.itemLabel,t,w,x.state),B.addState(e?dT.selected:dT.unSelected),T.add(B);const I=$d(_,"space",8);if(M(l)){const s=$d(f,"space",c?8:0),n=f.formatMethod?f.formatMethod(l,t,i):l,r=sA(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:S.style.fontSize},S.style),{text:n,_originText:f.formatMethod?l:void 0}));if(this._appendDataToShape(r,uT.itemValue,t,w,S.state),r.addState(e?dT.selected:dT.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-A[1]-A[3]-E-P-I-O-s;this._autoEllipsis(g,t,B,r),f.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-E/2-A[1]-A[3]-O-s}):r.setAttribute("x",I+(B.AABBBounds.empty()?0:B.AABBBounds.x2))}else r.setAttribute("x",I+(B.AABBBounds.empty()?0:B.AABBBounds.x2));C=s+(r.AABBBounds.empty()?0:r.AABBBounds.x2),T.add(r)}else this._itemWidthByUser?(B.setAttribute("maxLineWidth",this._itemWidthByUser-A[1]-A[3]-E-P-O),C=I+(B.AABBBounds.empty()?0:B.AABBBounds.x2)):C=I+(B.AABBBounds.empty()?0:B.AABBBounds.x2);L&&(L.setAttribute("x",C),T.add(L));const F=T.AABBBounds,Y=F.width();if("right"===p){const t=F.x2,e=F.x1;T.forEachChildren(((i,s)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===L?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const j=F.height(),H=M(this.attribute.item.width)?this.attribute.item.width:Y+A[1]+A[3],z=this._itemHeightByUser||j+A[0]+A[2];return w.attribute.width=H,w.attribute.height=z,L&&L.setAttribute("visible",!1),T.translateTo(-F.x1+A[3],-F.y1+A[0]),w}_createPager(t){var e,i;const{disableTriggerEvent:s,maxRow:n}=this.attribute,r=t=>t<=99?99:t<=999?999:9999;return this._itemContext.isHorizontal?new $V(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:r(this._itemContext.pages)},E({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:s})):new $V(Object.assign({layout:"horizontal",total:r(this._itemContext.pages),disableTriggerEvent:s,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new QV(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e})):new QV(Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i){const{pager:s}=this.attribute,{totalPage:n,isHorizontal:r}=this._itemContext,a=s&&s.position||"middle";if(this._pagerComponent.setTotal(n),r){let s;s="start"===a?t:"end"===a?t+i-this._pagerComponent.AABBBounds.height()/2:t+i/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:e-this._pagerComponent.AABBBounds.width(),y:s})}else{let t;t="start"===a?0:"end"===a?e-this._pagerComponent.AABBBounds.width():(e-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:i-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){const{currentPage:s,totalPage:n,isHorizontal:r}=this._itemContext;this._pagerComponent.setScrollRange([(s-1)/n,s/n]),r?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:s=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,a=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let s;return 0===e[0]?s=1:1===e[1]?s=this._itemContext.totalPage:(s=e[0]*this._itemContext.totalPage,i.scrollByPosition?s+=1:s=Math.floor(s)+1),s}:t=>t.detail.current,o=t=>{const e=this._pagerComponent,i=e.getScrollRange(),{direction:s}=e.attribute,{width:n,height:r}=e.getSliderRenderBounds(),a="vertical"===s?t.deltaY/r:t.deltaX/n;e.setScrollRange([i[0]+a,i[1]+a],!0)},l=i=>{const o=a(i);if(o!==this._itemContext.currentPage){if(this._itemContext.currentPage=o,this._itemContext&&this._itemContext.startIndext.nativeEvent.preventDefault())),this.addEventListener("wheel",qd(o,t))}}else this._pagerComponent.addEventListener("toPrev",l),this._pagerComponent.addEventListener("toNext",l)}_renderPager(){const t=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,maxCol:s=1,maxRow:n=2,item:r={},pager:a={}}=this.attribute,{spaceCol:o=oT,spaceRow:l=lT}=r,h=this._itemsContainer,{space:d=hT,defaultCurrent:c=1}=a,u=tW(a,["space","defaultCurrent"]),{isHorizontal:p}=this._itemContext;let g,m=0,_=0,f=0,v=0,y=0,b=0,x=1;if(p){if(_=(n-1)*l+this._itemHeight*n,m=e,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),f=e-g.AABBBounds.width()-d,f<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;f0&&t.setAttributes({x:y,y:b}),y+=o+i})),this._itemContext.startX=y,this._itemContext.startY=b,this._itemContext.pages=x;const i=Math.ceil(x/n);this._itemContext.totalPage=i,this._updatePositionOfPager(t,m,_)}else{if(m=this._itemMaxWidth*s+(s-1)*o,_=i,f=m,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),v=i-g.AABBBounds.height()-d-t,v<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;v0&&t.setAttributes({x:y,y:b}),b+=l+i}));const e=Math.ceil(x/s);this._itemContext.totalPage=e,this._updatePositionOfPager(t,m,_)}c>1&&(p?h.setAttribute("y",-(c-1)*(_+l)):h.setAttribute("x",-(c-1)*(m+o)));const S=aa.group({x:0,y:t,width:p?f:m,height:p?_:v,clip:!0,pickable:!1});return S.add(h),this._innerView.add(S),this._bindEventsOfPager(p?_+l:m+o,p?"y":"x"),!0}_renderScrollbar(){const t=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:s={},pager:n={}}=this.attribute,{spaceCol:r=oT,spaceRow:a=lT}=s,o=this._itemsContainer,{space:l=hT,defaultCurrent:h=1}=n,d=tW(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext;let u,p=0,g=0,m=0,_=0,f=1;if(c)p=e,g=e,m=this._itemHeight,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),this._updatePositionOfScrollbar(g,m,t);else{if(p=i,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),m=i-t,g=this._itemMaxWidth,m<=0)return this._innerView.removeChild(u),!1;o.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;f=Math.floor((_+i)/m)+1,_+=a+i})),this._itemContext.totalPage=f,this._itemContext.pages=f,this._updatePositionOfScrollbar(g,m,t)}h>1&&(c?o.setAttribute("x",-(h-1)*(g+r)):o.setAttribute("y",-(h-1)*(m+a)));const v=aa.group({x:0,y:t,width:g,height:m,clip:!0,pickable:!1});return v.add(o),this._innerView.add(v),this._bindEventsOfPager(c?g:m,c?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(dT.selected)?this._setLegendItemState(t,dT.selectedHover,e):this._setLegendItemState(t,dT.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===uT.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(cT.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(dT.unSelectedHover)||t.hasState(dT.selectedHover))&&(i=!0),t.removeState(dT.unSelectedHover),t.removeState(dT.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(dT.unSelectedHover)&&!t.hasState(dT.selectedHover)||(i=!0),t.removeState(dT.unSelectedHover),t.removeState(dT.selectedHover)}));const s=t.getChildren()[0].find((t=>t.name===uT.focus),!1);s&&s.setAttribute("visible",!1),i&&this._dispatchLegendEvent(cT.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(cT.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let s=!1;t.hasState(e)||(s=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==uT.focus&&(s||t.hasState(e)||(s=!0),t.addState(e,!0))})),s&&this._dispatchLegendEvent(cT.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let s=!1;e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==uT.focus&&e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)}))})),s&&this._dispatchLegendEvent(cT.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(dT.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,s,n={}){t.name=e,t.data=i,t.delegate=s,t.states=E({},eW,n)}_dispatchLegendEvent(t,e,i){const s=this._getSelectedLegends();s.sort(((t,e)=>t.index-e.index));const n=s.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(dT.selected),currentSelectedItems:s,currentSelected:n,event:i})}_handleStyle(t,e,i,s,n){const r={};return t.style&&(xs(t.style)?r.style=t.style(e,i,s,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((a=>{t.state[a]&&(xs(t.state[a])?r.state[a]=t.state[a](e,i,s,n):r.state[a]=t.state[a])}))),r}release(){super.release(),this.removeAllEventListeners()}}iW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:oT,spaceRow:lT,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:hT,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};const sW=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},nW=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l}=e,h=a(),d=l();if(0===h.length&&d.length)return[];if(h.length===d.length)return t;const c={};h.forEach((t=>{c[t]=!0}));const u=null!==(i=o())&&void 0!==i?i:xT;return y(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===c[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===c[t.source]&&!0===c[t.target])))):M(u)&&(t=t.filter((t=>!0===c[r.getSeriesFieldValue(t,u)]))),t};class rW extends rD{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=Dy.Legend,this.layoutLevel=Py.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{AE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),AE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=tl(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;M(s)&&(this._seriesUserId=Fa(s)),M(e)&&(this._regionUserId=Fa(e)),M(n)&&(this._seriesIndex=Fa(n)),M(i)&&(this._regionUserIndex=Fa(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(Im(e,t)||(i.reCompile=!0),i)}changeRegions(t){}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new gx(this._option,t),this._initSelectedData(),AE(this._regions,(t=>{t.event.on(zd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;D(t)||JSON.stringify(n)===JSON.stringify(t)||(AE(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(zd.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;Zo(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)Im(s,this._cacheAttrs)||this._legendComponent.setAttributes(Ll({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Ll({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());Im(t,this._cacheAttrs)||this._legendComponent.setAttributes(Ll({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),null===(i=this.getChart())||void 0===i||i.setLayoutTag(!0,null,!1),this.event.emit(zd.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}rW.specKey="legends";class aW extends rW{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(t){super.init(t),AE(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData()},level:zp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){Cp(this._option.dataSet,"discreteLegendFilter",nW),Cp(this._option.dataSet,"discreteLegendDataMake",sW);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return AE(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(D(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!Qo(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return xs(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=YT(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const{title:i={},item:s={},pager:n={},background:r={},type:a,id:o,visible:l,orient:h,position:d,data:c,filter:u,regionId:p,regionIndex:g,seriesIndex:m,seriesId:_,padding:f}=t,v=function(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!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(cT.legendItemClick,(e=>{const i=$d(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(zd.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(cT.legendItemHover,(t=>{const e=$d(t,"detail");this.event.emit(zd.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(cT.legendItemUnHover,(t=>{const e=$d(t,"detail");this.event.emit(zd.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:Zo(s)?s:1,strokeOpacity:Zo(n)?n:1,opacity:Zo(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return xs(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=XT(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:d}=XT(o,l);l&&!o&&d&&(t.item.value.formatMethod=(t,e)=>d(l,t,e,a))}}aW.specKey="legends",aW.type=r.discreteLegend;const oW=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;Zo(n)&&(t=Math.min(n,t)),Zo(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},lW=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r}=e,a=i(),o=s(),l=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!bs(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(a===n())return t;if(o&&!jm(a)){const[e,i]=a;return l(t)?zH(t,+e,+i,o):t.filter((t=>t[o]>=e&&t[o]<=i))}return t};var hW;function dW(t){return y(t)?t:[t,t]}function cW(t){return t?"ew-resize":"ns-resize"}!function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(hW||(hW={})),XV();class uW extends Bk{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},uW.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=Rs(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===No.env?(No.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),No.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:s,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{x:o,y:l}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=o,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=s):(h=l,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const p=Rs(d+u,0,c),g=this.calculateValueByPos(p);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,p,g):this._updateHandler(this._currentHandler,p,g),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===No.env?(No.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),No.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===No.env?(No.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),No.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n,inverse:r}=this.attribute;if(n===s)return;const{startHandler:a,endHandler:o}=this._getHandlers();let l,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(l=c,h=this._track.attribute.width,d=e):(l=u,h=this._track.attribute.height,d=i);const p=l-this._prePos;if(a){const t=this._isHorizontal?a.attribute.x:a.attribute.y,e=r?Rs(t+p,h,d):Rs(t+p,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(a,e,i)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,e=r?Rs(t+p,0,d-h):Rs(t+p,h,d),i=this.calculateValueByPos(e),s=null==a?void 0:a.attribute;this._updateHandler(o,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(s.x,o.attribute.x),width:Math.abs(s.x-o.attribute.x)}:{y:Math.min(s.y,o.attribute.y),height:Math.abs(s.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===No.env?(No.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),No.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n}=this.attribute;if(n===s)return;const r=this._startHandler,a=this._endHandler;let o,l,h,d;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,l=null==r?void 0:r.attribute.x,h=null==a?void 0:a.attribute.x,d=e):(o=t.viewY-this._rail.globalAABBBounds.y1,l=null==r?void 0:r.attribute.y,h=null==a?void 0:a.attribute.y,d=i);const c=this.calculateValueByPos(o);if(M(h)){const t=Math.abs(o-l)>Math.abs(o-h)?a:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:s,railHeight:n,min:r,max:a,inverse:o}=this.attribute;let l=0;return l=r===a?"start"===e?0:"end"===e?1:0:(t-r)/(a-r),(o?1-l:l)*("vertical"===i?n:s)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:s,min:n,max:r,inverse:a}=this.attribute,o="vertical"===e?s:i;return n+(r-n)*(a?1-t/o:t/o)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[s,n]=Fa(t),{startHandler:r,endHandler:a}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(s),s),a&&this._updateHandler(a,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:s,railHeight:n,startText:r,endText:a,min:o,max:l,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;D(c)&&(c=[o,l]),this._currentValue={startValue:dW(c)[0],endValue:dW(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const p=aa.group({x:0,y:0});p.name=hW.innerView,this.add(p),this._innerView=p;let g,m=0;if(r&&r.visible){g=aa.text(Object.assign({x:u?0:s/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),g.name=hW.startText,p.add(g);const e=M(r.space)?r.space:0;m+=(u?g.AABBBounds.width():g.AABBBounds.height())+e}const _=aa.group({x:u?m:0,y:u?0:m});p.add(_);const f=aa.group({x:0,y:0});let v;if(f.name=hW.railContainer,this._railContainer=f,_.add(f),this._mainContainer=_,this._renderRail(f),m+=u?s:n,a&&a.visible){const t=M(a.space)?a.space:0;v=aa.text(Object.assign({x:u?m+t:s/2,y:u?n/2:m+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:a.text,lineHeight:null===(e=a.style)||void 0===e?void 0:e.fontSize},a.style)),v.name=hW.endText,p.add(v)}this._renderTrack(f),h&&(this._renderHandlers(_),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:s,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const a=aa.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},s));return a.name=hW.rail,t.add(a),this._rail=a,a}_renderHandlers(t){const{range:e,min:i,max:s,handlerSize:n=14,handlerStyle:r,handlerText:a,railHeight:o,railWidth:l,slidable:h}=this.attribute;let{value:d}=this.attribute;D(d)&&(d=[i,s]);const c=a&&a.visible,u=this._isHorizontal,[p,g]=dW(d),m=this.calculatePosByValue(p,e?"start":"end"),_=this._renderHandler(Object.assign({x:u?m:l/2,y:u?o/2:m,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":cW(u)},r));if(_.name=hW.startHandler,this._startHandler=_,t.add(_),this._currentValue.startPos=m,c){const i=this._renderHandlerText(p,e?"start":"end");i.name=hW.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(g,"end"),i=this._renderHandler(Object.assign({x:u?e:l/2,y:u?o/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":cW(u)},r));if(i.name=hW.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(g,"end");e.name=hW.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:s,railHeight:n,railWidth:r,trackStyle:a,railStyle:o,slidable:l,value:h}=this.attribute;let d,c;if(D(h))e?(d=i,c=s):d=c=i;else if(e){const t=ZV(h,i,s);d=t[0],c=t[1]}else d=i,c=Rs(h,i,s);const u=this._isHorizontal;e||(d=i);const p=aa.group({x:0,y:0,width:r,height:n,cornerRadius:null==o?void 0:o.cornerRadius,clip:!0,pickable:!1});p.name=hW.trackContainer;const g=bs(e)&&!0===e.draggableTrack;let m;m=!1===l?"default":!1===e||!1===g?"pointer":cW(u);const _=this.calculatePosByValue(d,"start"),f=this.calculatePosByValue(c,e?"end":"start"),v=aa.rect(Object.assign({x:u?Math.min(_,f):0,y:u?0:Math.min(_,f),width:u?Math.abs(f-_):r,height:u?n:Math.abs(f-_),cursor:m},a));v.name=hW.track,this._track=v,p.add(v),t.add(p)}_renderHandler(t){return aa.symbol(t)}_renderHandlerText(t,e){var i,s,n;const{align:r,handlerSize:a=14,handlerText:o={},railHeight:l,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),p=null!==(i=o.space)&&void 0!==i?i:4,g={text:o.formatter?o.formatter(t):t.toFixed(null!==(s=o.precision)&&void 0!==s?s:0),lineHeight:null===(n=o.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":cW(c)};return c?"top"===r?(g.textBaseline="bottom",g.textAlign="center",g.x=u,g.y=(l-a)/2-p):(g.textBaseline="top",g.textAlign="center",g.x=u,g.y=(l+a)/2+p):"left"===r?(g.textBaseline="middle",g.textAlign="end",g.x=(h-a)/2-p,g.y=u):(g.textBaseline="middle",g.textAlign="start",g.x=(h+a)/2+p,g.y=u),aa.text(Object.assign(Object.assign({},g),o.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:s,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:s/2,a=this._isHorizontal?i/2:0;if(e&&e.shape){const t=aa.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:a,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const o=e&&e.text||{},l=null!==(t=o.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?a-i/2-l:a+i/2+l,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=a,h.x="left"===n?r-s/2-l:a+s/2+l,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=aa.text(Object.assign(Object.assign({},h),o.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:s}=this.attribute,n=this._isHorizontal?i:s,r=this._tooltipState.pos*n,a=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[a]:r});const{align:o}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[a]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==o?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),bs(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,s=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==s?void 0:s.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==s?void 0:s.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var s;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===hW.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(s=t.precision)&&void 0!==s?s:0),[n?"x":"y"]:e})}t.name===hW.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var s;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(s=r.precision)&&void 0!==s?s:0)});const a=t.name===hW.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[n?"x":"y"]:e}),t.name===hW.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}uW.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},qV(),XV();class pW extends WV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},pW.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!D(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:s,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:p,startText:g,endText:m,handlerText:_,showTooltip:f,tooltip:v,inverse:y,disableTriggerEvent:b}=this.attribute,x=[],S=(r-n)/(t.length-1);for(let e=0;e1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),s=e/g,n=i/g,r=n-s,a=t.filter((t=>t.offset>s&&t.offset{f.push({offset:(t.offset-s)/r,color:t.color})})),f.push({offset:1,color:_}),o.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}function gW(t="bottom"){let e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}pW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},qV(),XV(),TM();class mW extends WV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},mW.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,sizeBackground:v,disableTriggerEvent:y,inverse:b}=this.attribute,x=aa.group({x:0,y:0});this._innerView.add(x);const S=new uW({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l,handlerSize:h,handlerStyle:Object.assign({symbolType:gW(i)},d),railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,disableTriggerEvent:y,inverse:b});x.add(S);let M,k=0;"horizontal"===e?"top"===i?(M=`M0,0L${a},0L${b?0:a},12Z`,k=o):(M=`M0,12L${a},12L${b?0:a},0Z`,S.setAttribute("y",12)):"left"===i?M=`M${a},0L${a+12},${b?0:o}L${a},${o}Z`:(M=`M0,${b?0:o}L12,${o}L12,0Z`,S.setAttribute("x",12));const A=aa.path(Object.assign(Object.assign({x:0,y:k,path:M},v),{zIndex:0}));x.add(A);const w=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,w-x.AABBBounds.y1),this._slider=S}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}mW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};const _W={color:pW,size:mW},fW=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],vW=[2,10];class yW extends rW{static getSpecInfo(t){const e=KT(t,this.specKey,this.type,(t=>{return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),AE(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData},level:zp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){Cp(this._option.dataSet,"continuousLegendFilter",lW),Cp(this._option.dataSet,"continuousLegendDataMake",oW);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>wE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=YT(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!Qo(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=YT(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),jm(r)&&(r="color"===this._legendType?fW:vW);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},function(t){const e=Ll({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:d={},type:c,id:u,visible:p,orient:g,position:m,data:_,defaultSelected:f,field:v,filter:y,regionId:b,regionIndex:x,seriesIndex:S,seriesId:k,padding:A}=e,w=function(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{const i=$d(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(zd.legendFilter,{model:this,value:i,event:e})}),30))}}}yW.specKey="legends",yW.type=r.continuousLegend;const bW=(t,e)=>M(e)?t.map((t=>e[t])):void 0,xW=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),SW=t=>!D(t)&&(y(t)?t.length>0&&t.every(M):Object.keys(t).length>0),MW=["updateTitle","updateContent","updatePosition","maxLineCount","othersLine"],kW=t=>{const e=[];return t.forEach((t=>{t.data.forEach((t=>{M(t.series)&&e.push(t.series)}))})),e},AW={dom:`${nh}_TOOLTIP_HANDLER_DOM`,canvas:`${nh}_TOOLTIP_HANDLER_CANVAS`},wW={key:"其他",value:"..."},TW=["group","mark","dimension"];class LW{constructor(t){this._showTooltipByHandler=(t,e)=>{var i,s,n;if(D(t))return 1;e.changePositionOnly||this.clearCache(),this._updateViewSpec(t,e);const r=this._cacheActiveSpec;if(D(r)||!1===r.visible)return 1;e.tooltipSpec=this.component.getSpec(),e.activeTooltipSpec=r;const{title:a,content:o}=r,l=D(null==a?void 0:a.key)&&D(null==a?void 0:a.value)&&!(null==o?void 0:o.length);if(this.component.event.emit(zd.tooltipShow,Object.assign(Object.assign({},e),{isEmptyTooltip:l,tooltipData:t,activeType:this.activeType,tooltip:this.component})),l)return 1;let h;return(null===(i=r.handler)||void 0===i?void 0:i.showTooltip)?h=r.handler.showTooltip.bind(r.handler):(null===(s=this.component.tooltipHandler)||void 0===s?void 0:s.showTooltip)&&(h=this.component.tooltipHandler.showTooltip.bind(this.component.tooltipHandler)),h?null!==(n=h(this.activeType,t,e))&&void 0!==n?n:0:1},this.component=t}_preprocessDimensionInfo(t){const e=[];if(null==t||t.forEach((t=>{const i=Object.assign(Object.assign({},t),{data:t.data.filter((({series:t})=>{var e,i;return!1!==(null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.visible)}))});i.data.length>0&&e.push(i)})),e.length>0)return e}_updateViewSpec(t,e){var i,s,n,r,a,o,l,h,d;const{changePositionOnly:c,model:u}=e;if(!c||!this._cacheActiveSpec){const c=this.component.getSpec();if(this._cacheActiveSpec=((t,e,i,s,n)=>{var r,a,o;const l={activeType:t};switch(t){case"mark":case"group":if(i){const o=null===(r=i.getSpec())||void 0===r?void 0:r.tooltip;return l.visible=!0,(null==o?void 0:o.handler)&&(l.handler=o.handler),(null===(a=l.handler)||void 0===a?void 0:a.showTooltip)?l:((null==o?void 0:o[t])&&MW.forEach((e=>{M(o[t][e])&&(l[e]=o[t][e])})),Object.assign(Object.assign({},l),i.tooltipHelper.getTooltipData(t,e,s,s[0].datum,n)))}break;case"dimension":if(null==s?void 0:s.length){if(kW(s).every((t=>{var e;return!JT("dimension",null===(e=t.tooltipHelper)||void 0===e?void 0:e.spec)}))?l.visible=!1:l.visible=!0,l.handler=e.handler,null===(o=l.handler)||void 0===o?void 0:o.showTooltip)return l;const i=[];return s.forEach((r=>r.data.forEach((r=>{const{series:a}=r,o=a.tooltipHelper.getTooltipData(t,e,s,r.datum,n);o&&i.push(o)})))),function(t){if(!t||!t.length)return null;const e=[];return t.forEach((({content:t})=>{t&&t.forEach((t=>{e.push(t)}))})),e.length?Object.assign(Object.assign({},t[0]),{content:e}):t[0]}(i)}}return null})(this.activeType,this.component.getSpec(),u,t,e),this._cacheActiveSpec){D(this._cacheActiveSpec.handler)&&M(c.handler)&&(this._cacheActiveSpec.handler=c.handler);const u=null!==(i=c[this.activeType])&&void 0!==i?i:{},p=null!==(s=this._cacheActiveSpec.updateTitle)&&void 0!==s?s:u.updateTitle,g=null!==(n=this._cacheActiveSpec.updateContent)&&void 0!==n?n:u.updateContent,m=null!==(a=null!==(r=this._cacheActiveSpec.maxLineCount)&&void 0!==r?r:u.maxLineCount)&&void 0!==a?a:20;if(p&&(this._cacheActiveSpec.title=null!==(o=p(this._cacheActiveSpec.title,t,e))&&void 0!==o?o:this._cacheActiveSpec.title),g)this._cacheActiveSpec.content=null!==(l=g(this._cacheActiveSpec.content,t,e))&&void 0!==l?l:this._cacheActiveSpec.content;else if(m>=1&&(null===(h=this._cacheActiveSpec.content)||void 0===h?void 0:h.length)>m){const t=null!==(d=this._cacheActiveSpec.othersLine)&&void 0!==d?d:u.othersLine,e=t?Object.assign(Object.assign({},wW),t):wW;this._cacheActiveSpec.content=[...this._cacheActiveSpec.content.slice(0,m-1),Object.assign(Object.assign({},this._cacheActiveSpec.content[m-1]),e)]}}}}shouldHandleTooltip(t,e){var i,s;return!D(e)&&JT(this.activeType,null===(s=null===(i=t.model)||void 0===i?void 0:i.tooltipHelper)||void 0===s?void 0:s.spec)}clearCache(){this._cacheActiveSpec=void 0}}class CW extends LW{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){const s=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(t),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(t,s)}_getDimensionInfo(t){var e,i;let s;const n=this.component.getChart(),r=n.getCompiler().getStage().getLayer(void 0),a={x:t.event.viewX,y:t.event.viewY};if(r.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},a),s=[...null!==(e=Id(n,a,!0))&&void 0!==e?e:[],...null!==(i=kd(n,a))&&void 0!==i?i:[]],0===s.length)s=void 0;else if(s.length>1){const t=s.filter((t=>{var e;const i=t.axis;if(i.getSpec().hasDimensionTooltip)return!0;if(!ed(i.getScale().type))return!1;let s;for(const t of null!==(e=null==i?void 0:i.getRegions())&&void 0!==e?e:[]){for(const e of t.getSeries())if("cartesian"===e.coordinate){s=e;break}if(M(s))break}return M(s)&&s.getDimensionField()[0]===s.fieldY[0]?"left"===i.getOrient()||"right"===i.getOrient():"bottom"===i.getOrient()||"top"===i.getOrient()}));if(s=t.length?t:s.slice(0,1),s.length>1){const t=new Set;s.forEach((e=>{e.data=e.data.filter((({key:e})=>!t.has(e)&&(t.add(e),!0)))}))}}return s}getMouseEventData(t){return{tooltipInfo:this._getDimensionInfo(t),ignore:!1}}}class EW extends LW{constructor(){super(...arguments),this.activeType="group"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:Fa(s),series:n}],a=Object.assign(Object.assign({},e),{groupDatum:this._getGroupDatum(e),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e,i;let s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.group;if(null==r?void 0:r.has(t.mark)){const n=this.component.getSpec()[this.activeType];((null==n?void 0:n.triggerMark)?Fa(n.triggerMark):[]).includes(null===(i=t.mark)||void 0===i?void 0:i.name)&&(s={mark:t.mark,datum:t.datum,series:e})}}return{tooltipInfo:s,ignore:!1}}_getGroupDatum(t){const{model:e,mark:i,datum:s}=t,n=e;if(["line","area"].includes(i.type))return Fa(s);const r=n.getViewData().latestData,a=n.getSeriesField();if(!a)return r;const o=Fa(s)[0][a];return r.filter((t=>t[a]===o))}}class DW extends LW{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:[s],series:n}],a=Object.assign(Object.assign({},e),{changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e;let i,s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.mark,a=null==n?void 0:n.ignoreTriggerSet.mark;(null==r?void 0:r.has(t.mark))?i={mark:t.mark,datum:t.datum,series:e}:(null==a?void 0:a.has(t.mark))&&(s=!0)}return{tooltipInfo:i,ignore:s}}}const PW=t=>M(t)&&!y(t),OW=t=>M(t)&&y(t);class RW extends nD{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i;const{spec:s,theme:n}=super._initTheme(t,e);return s.style=Ll({},this._theme,s.style),s.offset=Ll({},n.offset,t.offset),s.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:n.transitionDuration,{spec:s,theme:n}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h,d;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:pl(this._option.mode)||!cl(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.triggerOff=null!==(h=t.triggerOff)&&void 0!==h?h:t.trigger,t.confine=null!==(d=t.confine)&&void 0!==d?d:"canvas"===t.renderMode,M(t.parentElement)?S(t.parentElement)&&(t.parentElement=No.getElementById(t.parentElement)):cl(this._option.mode)&&(t.parentElement=null==dl?void 0:dl.body)}}class BW extends rD{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=RW,this.specKey="tooltip",this.layoutType="none",this._alwaysShow=!1,this._eventList=[],this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{this._clickLock?(this._handleChartMouseOut(t),this._clickLock=!1):this._clickLock=!0},this._getMouseOutHandler=t=>e=>{var i,s,n,r;if(this._alwaysShow||this._clickLock)return;if(!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const a=cl(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:o,clientY:l}=e.event;a&&t&&this._isPointerInChart({x:o,y:l})||this._enterable&&(this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(r=this._spec.showDelay)&&void 0!==r?r:50))},this._handleChartMouseOut=t=>{this._alwaysShow||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._cacheEnterableRect=null,this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{var i;this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow||(this._clickLock?t&&(this._handleChartMouseOut(e),this._clickLock=!1):!t&&this._enterable&&this.isTooltipShown()?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(i=this._spec.showDelay)&&void 0!==i?i:50)):this._handleChartMouseMove(e,t))},this._handleChartMouseMove=(t,e)=>{const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1};for(let s=0,n=TW.length;s!t))&&!function(t){return D(t.mark)&&D(t.model)&&D(t.datum)}(t)&&(n&&PW(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):M(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),r.mark||r.group||r.dimension&&!D(s)?this._initEventOfTooltipContent():this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&vT.globalConfig.uniqueTooltip&&l&&vT.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(zd.tooltipHide,Object.assign(Object.assign({},t),{source:Nd.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;return n.hideTooltip?n.hideTooltip.call(n,t):1},this.hideTooltip=()=>{const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:Nd.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}}isTooltipShown(){var t,e;return null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.isTooltipShown)||void 0===e?void 0:e.call(t)}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_registerEvent(){}_releaseEvent(){}onLayout(t){}onLayoutEnd(t){}onRender(t){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t)}beforeRelease(){this.event.emit(zd.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(zd.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?AW.canvas:AW.dom,n=Xl.getComponentPluginInType(t);n||ml("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip||!this._enterable)return;const i=null===(e=(t=this.tooltipHandler).getTooltipContainer)||void 0===e?void 0:e.call(t),s=null==i?void 0:i.firstChild;s&&(s.addEventListener("mouseenter",(()=>{var t;const e=null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s);e&&(this._cacheEnterableRect={x:e.x,y:e.y,width:e.width,height:e.height}),this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this._showTimer&&(clearTimeout(this._showTimer),this._showTimer=null)})),s.addEventListener("mouseleave",(()=>{var t,e;if(this._cacheEnterableRect){const i=null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s);i&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===i[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(e=this._spec.showDelay)&&void 0!==e?e:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.includes("dimension")&&(this.processor.dimension=new CW(this)),t.includes("group")&&(this.processor.group=new EW(this)),t.includes("mark")&&(this.processor.mark=new DW(this))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Fa(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=this._option.mode;e.includes("hover")&&(this._mountEvent("pointermove",{source:"chart"},this._getMouseMoveHandler(!1)),(ul(i)||pl(i))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerleave",{source:"canvas"},this._getMouseOutHandler(!1))),e.includes("click")?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}reInit(t){var e,i;super.reInit(t),this.tooltipHandler?null===(i=(e=this.tooltipHandler).reInit)||void 0===i||i.call(e):this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(M(a.regionId)?[a.regionId]:void 0,M(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=((t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const d=e.getDimensionField(),c=e.getMeasureField(),u=e.getSeriesField(),p=M(u)?t[u]:void 0,g=M(u)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[u])||void 0===r?void 0:r.values)&&void 0!==a?a:[],m=bW(d,t);let _=bW(c,t);const f=SW(_),v=!f&&M(u)&&D(p)&&g.length>0,y=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(xW(d,m));if(!f&&(_=bW(c,i),!SW(_)))return;const n=e.type===fl.pie?e.dataToCentralPosition(i):e.dataToPosition(i);D(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},series:e})};if("cartesian"===e.coordinate){const t=e,i=ed(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=d.map(((t,e)=>[t,e])).filter((([,t])=>D(null==m?void 0:m[t])));let r=[null!=m?m:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(v){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(xW(d,n));g.forEach((r=>{const o=a.find((t=>t[u]===r));if(_=bW(c,o),!SW(_))return;const l=t.dataToPosition(o);D(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(xW(d,n));if(!f&&(_=bW(c,r),!SW(_)))return;const o=t.dataToPosition(r);if(D(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===fl.pie)y();else{const t=e;if(v){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(xW(d,m))).find((t=>t[u]===p));g.forEach((n=>{if(_=bW(c,i),!SW(_))return;const r=t.dataToPosition(i);D(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:n},series:e})}))}else y()}else"geo"===e.coordinate&&y()})),s})(t,l),d=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",c=l.getLayoutStartPoint(),u=l.getLayoutRect(),p=o.globalInstance.getContainer(),g=Object.assign({x:0,y:0},p?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(p):{}),m=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>xW(i,s)(t)&&xW(n,r)(t)&&(D(a)||xW([a],[o])(t))));return l},_=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),u.width),y:Math.min(Math.max(t.y,0),u.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:c.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:c.y+s.y;return{canvasX:n,canvasY:r,clientX:g.x+n,clientY:g.y+r}};if("dimension"===d){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>m(t))))&&void 0!==i?i:[]}}))}];M(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:Nd.chart,event:_({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0,itemMap:new Map};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return vT.globalConfig.uniqueTooltip&&vT.hideTooltip(l.id),d}if("mark"===d){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},m(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:Nd.chart,event:_(e.pos),item:void 0,itemMap:new Map};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return vT.globalConfig.uniqueTooltip&&vT.hideTooltip(l.id),d}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(D(this._cacheInfo)||D(t))return!1;if(OW(t)){if(PW(this._cacheInfo))return!1;const e=this._cacheInfo;if(e.length!==t.length||!t.every(((t,i)=>id(t,e[i]))))return!1}else{if(OW(this._cacheInfo))return!1;const e=this._cacheInfo;if((null==t?void 0:t.datum)!==e.datum||(null==t?void 0:t.mark)!==e.mark||(null==t?void 0:t.series)!==e.series)return!1}const s=this._cacheParams;return!D(s)&&!D(e)&&s.mark===e.mark&&s.model===e.model&&s.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}}BW.type=r.tooltip,BW.transformerConstructor=RW,BW.specKey="tooltip";class IW extends Bk{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}p_(),dM();class FW extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},FW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}FW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p_(),fy();class YW extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},YW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},s),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}var jW;YW.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(jW||(jW={}));var HW=function(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{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),h(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=qd((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(bs(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshair(){this.showDefault&&this._showDefaultCrosshairBySpec()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:Vd.chart}:{source:Nd.chart};y(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;y(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}updateLayoutAttribute(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:ul(t)||pl(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Fa(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(zd.tooltipHide,{source:Nd.chart},this._handleTooltipHideOrRelease),this.event.on(zd.tooltipShow,{source:Nd.chart},this._handleTooltipShow),this.event.on(zd.tooltipRelease,{source:Nd.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=$d(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{zW[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:d,y:c}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));e&&(e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-d),o=Math.min(o,i-c),l=Math.max(l,e+t.getLayoutRect().width-d),h=Math.max(h,i+t.getLayoutRect().height-c)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e}))})),r}changeRegions(t){}onLayoutEnd(t){const e=this._regions[0];this.setLayoutRect(e.getLayoutRect()),this.setLayoutStartPosition(e.getLayoutStartPoint()),super.onLayoutEnd(t)}onRender(t){}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||h(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const t=a.style||{},{stroke:o,fill:l,lineWidth:d}=t,c=t,{strokeOpacity:u,fillOpacity:p,opacity:g}=c,m=HW(c,["strokeOpacity","fillOpacity","opacity"]),_="line"===r.type;let f=_?u:p;if(h(g)&&(f=(null!=f?f:1)*g),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},m),_)r.style.stroke=o||l,r.style.lineWidth=$d(a,"width",d||2);else{r.style.fill=l||o,(null===(n=null===(s=null===(i=this._spec[e])||void 0===i?void 0:i.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(r.style.stroke=this._spec[e].line.style.stroke);const t=$d(a,"width");if("string"==typeof t){const e=parseInt(t.substring(0,t.length-1),10)/100;r.style.sizePercent=e}else"number"!=typeof t&&"function"!=typeof t||(r.style.size=t)}}if(o.visible){const t=o.labelBackground||{},e=o.style||{},i=t.style||{},{fill:s="rgba(47, 59, 82, 0.9)",stroke:n,outerBorder:a}=i,l=HW(i,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},e),{fill:e.fill||"#fff",stroke:$d(e,"stroke")}),panel:(v(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:s,stroke:n,outerBorder:Object.assign({stroke:s,distance:0,lineWidth:3},a)},l):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(function(t,e,i){return t.x1>e||t.x2i||t.y2a||o{const d=1&t,c=2&t;i||(i={x:0,y:0});let u=null,p=null,g=0,m=0;if(s.size){const t=Array.from(s.values())[0];g=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().x-i.x,u=t.axis}if(n.size){const t=Array.from(n.values())[0];m=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().y-i.y,p=t.axis}const _=!!s.size&&Number.isFinite(g),f=!!n.size&&Number.isFinite(m),v=o&&!_&&M(l),y=o&&!f&&M(h);let b,x,S;d&&(b=v?l:{height:0,leftPos:0,rightPos:0,topPos:0,x:0,bottom:{visible:!1,text:"",dx:0,dy:0},top:{visible:!1,text:"",dx:0,dy:0},visible:_,axis:u}),c&&(x=y?h:{width:0,leftPos:0,topPos:0,bottomPos:0,y:0,left:{visible:!1,text:"",dx:0,dy:0},right:{visible:!1,text:"",dx:0,dy:0},visible:f,axis:p});let k,A=0,w=0;if(r&&s.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const a=t.getScale();if(ed(a.type))S=a.bandwidth(),0===S&&a.step&&(A=a.step());else if(Qh(a.type)){const s=e.fieldX[0],r=e.fieldX2,a=iD(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionX(a);r?(S=Math.abs(t-e.dataToPositionX1(a)),i=`${a[s]} ~ ${a[r]}`):S=1,g=t}n=t.niceLabelFormatter}if(b&&(null===(s=r.label)||void 0===s?void 0:s.visible)&&!v){const e=UE(t.getSpec());"bottom"===t.getOrient()?(b.bottom.visible=!0,b.bottom.defaultFormatter=n,b.bottom.text=i,b.bottom.dx=0,b.bottom.dy=e):"top"===t.getOrient()&&(b.top.visible=!0,b.top.defaultFormatter=n,b.top.text=i,b.top.dx=0,b.top.dy=-e)}})),a&&n.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const r=t.getScale();if(ed(r.type))k=r.bandwidth(),0===k&&r.step&&(w=r.step());else if(Qh(r.type)){const s=e.fieldY[0],r=e.fieldY2,a=iD(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionY(a);r?(k=Math.abs(t-e.dataToPositionY1(a)),i=`${a[s]} ~ ${a[r]}`):k=1,m=t}n=t.niceLabelFormatter}if(x&&(null===(s=a.label)||void 0===s?void 0:s.visible)&&!y){const e=UE(t.getSpec());"left"===t.getOrient()?(x.left.visible=!0,x.left.defaultFormatter=n,x.left.text=i,x.left.dx=-e,x.left.dy=0):"right"===t.getOrient()&&(x.right.visible=!0,x.right.defaultFormatter=n,x.right.text=i,x.right.dx=e,x.right.dy=0)}})),b&&!v){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(GW(t,s),b.leftPos=t.x1,b.rightPos=t.x2,b.topPos=t.y1,b.height=t.y2-t.y1,b.x=g+i.x,r&&r.label){const{top:t,bottom:e}=b;t.visible&&WW(t,"top",r.label),e.visible&&WW(e,"bottom",r.label)}}if(x&&!y){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(GW(t,n),x.leftPos=t.x1,x.topPos=t.y1,x.bottomPos=t.y2,x.width=t.x2-t.x1,x.y=m+i.y,a&&a.label){const{left:t,right:e}=x;t.visible&&WW(t,"left",a.label),e.visible&&WW(e,"right",a.label)}}return{x:d&&b?b:void 0,y:c&&x?x:void 0,offsetWidth:A,offsetHeight:w,bandWidth:null!=S?S:0,bandHeight:null!=k?k:0}},WW=(t,e,i)=>{const{formatMethod:s,formatter:n}=i,{formatFunc:r,args:a}=XT(s,n,t.text,{label:t.text,position:e});r?t.text=r(...a):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))},GW=(t,e)=>{e.forEach((({axis:e})=>{e.getRegions().forEach((e=>{t.x1=Math.min(t.x1,e.getLayoutStartPoint().x),t.y1=Math.min(t.y1,e.getLayoutStartPoint().y),t.x2=Math.max(t.x2,e.getLayoutStartPoint().x+e.getLayoutRect().width),t.y2=Math.max(t.y2,e.getLayoutStartPoint().y+e.getLayoutRect().height)}))}))},UW=(t,e,i,s)=>{const{x:n,topPos:r,height:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n+i/2,y:r},end:{x:n+i/2,y:r+a}};else if("rect"===o){const o=XW(t,i,e.axis),{leftPos:h,rightPos:d}=e;l={visible:!0,start:{x:Math.max(n-o/2-s/2,h),y:r},end:{x:Math.min(n+i+o/2+s/2,d),y:r+a}}}return l},$W=(t,e,i,s)=>{const{leftPos:n,width:r,y:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n,y:a+i/2},end:{x:n+r,y:a+i/2}};else if("rect"===o){const o=XW(t,i,e.axis),{topPos:h,bottomPos:d}=e;l={visible:!0,start:{x:n,y:Math.max(a-o/2-s/2,h)},end:{x:n+r,y:Math.min(a+i+o/2+s/2,d)}}}return l},XW=(t,e,i)=>{var s,n,r;let a=0;if(null===(s=t.style)||void 0===s?void 0:s.sizePercent)a=(t.style.sizePercent-1)*e;else if("number"==typeof(null===(n=t.style)||void 0===n?void 0:n.size))a=t.style.size-e;else if("function"==typeof(null===(r=t.style)||void 0===r?void 0:r.size)){const s=i.getLayoutRect();a=t.style.size(s,i)-e}return a};class KW extends NW{static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._currValueX=new Map,this._currValueY=new Map}_showDefaultCrosshairBySpec(){const{xField:t,yField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));s&&(1===i?(this._currValueX.clear(),this._currValueX.set(t,{axis:s,value:e})):(this._currValueY.clear(),this._currValueY.set(t,{axis:s,value:e})),this.layoutByValue(i))}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getValueAt(t,e){return t.getScale().invert(e)}clearAxisValue(){this._currValueX.clear(),this._currValueY.clear()}setAxisValue(t,e){Ad(e.getOrient())?this._currValueX.set(e.getSpecIndex(),{value:t,axis:e}):this._currValueY.set(e.getSpecIndex(),{value:t,axis:e})}_getAllAxisValues(t,e,i,s){let n=!1;return t.forEach((t=>{ed(t.axis.getScale().type)&&(n?this.enable=!1:n=!0)})),!!this.enable&&(t.forEach(((t,n)=>{const r=t.axis;i.set(n,{value:this._getValueAt(r,e-(s?r.getLayoutStartPoint().x-this.getLayoutStartPoint().x:r.getLayoutStartPoint().y-this.getLayoutStartPoint().y)),axis:r})})),!0)}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(M(t.dimType)?"y"===t.dimType:wd(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else this._currValueX.clear(),this._currValueY.clear(),o&&o.size&&this._getAllAxisValues(o,r,this._currValueX,!0),l&&l.size&&this._getAllAxisValues(l,a,this._currValueY,!1),this.layoutByValue(3)}hide(){this._xCrosshair&&this._xCrosshair.hideAll(),this._xTopLabel&&this._xTopLabel.hideAll(),this._xBottomLabel&&this._xBottomLabel.hideAll(),this._yCrosshair&&this._yCrosshair.hideAll(),this._yLeftLabel&&this._yLeftLabel.hideAll(),this._yRightLabel&&this._yRightLabel.hideAll()}layoutByValue(t=3){if(!this.enable)return;const e=TE(this._regions,"cartesian");if(!e)return;const{x:i,y:s,offsetWidth:n,offsetHeight:r,bandWidth:a,bandHeight:o}=VW(t,e,this.getLayoutStartPoint(),this._currValueX,this._currValueY,this._xHair,this._yHair,this.enableRemain,this._cacheXCrossHairInfo,this._cacheYCrossHairInfo);this.enableRemain&&(i&&(this._cacheXCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0})),s&&(this._cacheYCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0}))),i&&this._layoutVertical(i,a,n),s&&this._layoutHorizontal(s,o,r)}_layoutVertical(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._xHair)return;const{x:r,topPos:a,height:o,top:l,bottom:h,visible:d}=t;if(d){const d=this._xHair.type,c=UW(this._xHair,t,e,i);if(this._updateCrosshair("x",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a},l),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._xHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"center",textBaseline:"bottom"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xTopLabel,t,(t=>{t.name="crosshair-x-top-label",this._xTopLabel=t}))}else this._xTopLabel&&this._xTopLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a+o},h),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._xHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"center",textBaseline:"top"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xBottomLabel,t,(t=>{t.name="crosshair-x-bottom-label",this._xBottomLabel=t}))}else this._xBottomLabel&&this._xBottomLabel.hideAll()}}_layoutHorizontal(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._yHair)return;const{leftPos:r,width:a,y:o,left:l,right:h,visible:d}=t;if(d){const d=this._yHair.type,c=$W(this._yHair,t,e,i);if(this._updateCrosshair("y",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r,y:o+e/2},l),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._yHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"right",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yLeftLabel,t,(t=>{t.name="crosshair-y-left-label",this._yLeftLabel=t}))}else this._yLeftLabel&&this._yLeftLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+a,y:o+e},h),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._yHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"left",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yRightLabel,t,(t=>{t.name="crosshair-y-right-label",this._yRightLabel=t}))}else this._yRightLabel&&this._yRightLabel.hideAll()}}_parseFieldInfo(){const{xField:t,yField:e}=this._spec;this._parseAndSetCrosshair(t,"x"),this._parseAndSetCrosshair(e,"y")}_parseAndSetCrosshair(t,e){const i=`_${e}Hair`,s=`_${e}Crosshair`;if(t&&t.visible){if(this[i]=this._parseField(t,`${e}Field`),this[s]){const{style:t,type:e}=this[i],n="rect"===e?"rectStyle":"lineStyle";this[s].setAttributes({[n]:t})}}else this[s]&&this[s].parent&&this[s].parent.removeChild(this[s])}_updateCrosshair(t,e,i){const s=this.getContainer();let n;if(n="x"===t?this._xCrosshair:this._yCrosshair,n)n.setAttributes(i);else{const r="x"===t?this._xHair.style:this._yHair.style;"line"===e?n=new FW(Object.assign(Object.assign({},i),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===e&&(n=new YW(Object.assign(Object.assign({},i),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==s||s.add(n),"x"===t?this._xCrosshair=n:this._yCrosshair=n}}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(i(t=new PD(e)),null==s||s.add(t)),eD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._xCrosshair,this._xTopLabel,this._xBottomLabel,this._yCrosshair,this._yLeftLabel,this._yRightLabel]}}KW.specKey="crosshair",KW.type=r.cartesianCrosshair,p_(),Gx();class qW extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},qW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:r,endAngle:a}),n),"arc")}setLocation(t){const{center:e,startAngle:i=$k,endAngle:s=Xk}=this.attribute,n=s-i,r=wt(Ct(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}qW.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},p_(),TM();class ZW extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},ZW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,sides:s=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute,o=(a-r)%(2*Math.PI)==0,l=(a-r)/s;let h;for(let t=0;t<=s;t++){const n=Tt(e,i,r+l*t);0===t?h=`M${n.x},${n.y}`:h+=`L${n.x},${n.y}`,t===s&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,i=xe.distancePP(t,e);this.setAttribute("radius",i)}}ZW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p_(),Gx();class JW extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},JW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,i=xe.distancePP(t,e);this.setAttribute("radius",i)}}JW.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};var QW=function(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);nt.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible))}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._currValueAngle=new Map,this._currValueRadius=new Map}_showDefaultCrosshairBySpec(){const{categoryField:t,valueField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));if(s){if(1===i){this._currValueAngle.clear();const i={angle:s.valueToPosition(e),radius:s.getOuterRadius()},n=s.coordToPoint(i);this._currValueAngle.set(t,this._getValueByAxis(s,n))}else{this._currValueRadius.clear();const i={angle:s.startAngle,radius:s.valueToPosition(e)},n=s.coordToPoint(i);this._currValueRadius.set(t,this._getValueByAxis(s,n))}this.layoutByValue(3)}}hide(){this._radiusCrosshair&&this._radiusCrosshair.hideAll(),this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll(),this._angleCrosshair&&this._angleCrosshair.hideAll(),this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getAllAxisValues(t,e,i){let s=!1;return t.forEach((t=>{ed(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!!this.enable&&(t.forEach(((t,s)=>{const n=t.axis;i.set(s,this._getValueByAxis(n,e))})),!0)}_getValueByAxis(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint(),a=t.positionToData({x:e.x-(i-n),y:e.y-(s-r)}),o={x:t.getCenter().x+this.getLayoutStartPoint().x,y:t.getCenter().y+this.getLayoutStartPoint().y};return{value:a,axis:t,center:o,innerRadius:t.getInnerRadius(),radius:t.getOuterRadius(),startAngle:t.startAngle,endAngle:t.endAngle,distance:xe.distancePP(e,t.getCenter()),coord:t.pointToCoord(e),point:e}}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)this._currValueAngle.clear(),this._currValueRadius.clear(),a&&this._getAllAxisValues(a,{x:n,y:r},this._currValueAngle),o&&this._getAllAxisValues(o,{x:n,y:r},this._currValueRadius),this.layoutByValue(3);else{if(this.enableRemain)return;this.hide()}}layoutByValue(t=3){if(!this.enable)return;const e=TE(this._regions,"polar");if(!e)return;const{angle:i,radius:s}=((t,e,i,s,n,r=!1,a,o)=>{let l={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,label:{visible:!1,text:"",offset:0}},h={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,sides:t.angleAxisHelper.getScale(0).domain().length,label:{visible:!1,text:"",offset:0}};if(s){l.visible=!!e.size;const i=t.angleAxisHelper.getBandwidth(0);e.forEach((e=>{var n,{axis:r,value:a,coord:o}=e,h=QW(e,["axis","value","coord"]);a=null!=a?a:"",Ll(l,h);const d=t.angleAxisHelper.dataToPosition([a]);l.angle=d;const c=r.niceLabelFormatter;(null===(n=s.label)||void 0===n?void 0:n.visible)&&(l.label.visible=!0,l.label.defaultFormatter=c,l.label.text=a,l.label.offset=UE(r.getSpec())),l.startAngle=d-i/2,l.endAngle=d+i/2}))}if(n&&(h.visible=!!i.size,i.forEach((t=>{var e,{axis:i,value:s,coord:r}=t,a=QW(t,["axis","value","coord"]);s=null!=s?s:"";const o=i.niceLabelFormatter;(null===(e=n.label)||void 0===e?void 0:e.visible)&&(h.label.visible=!0,h.label.defaultFormatter=o,h.label.text=s,h.label.offset=UE(i.getSpec())),h.angle=r.angle,h.axis=i,Ll(h,a)}))),r&&!l.visible&&M(a))l=a;else if(l.label.visible&&s&&s.label){const{label:t}=l,{formatMethod:e,formatter:i}=s.label,{formatFunc:n,args:r}=XT(e,i,t.text,{label:t.text,orient:"angle"});n?t.text=n(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}if(r&&!h.visible&&M(o))h=o;else if(h.label.visible&&n&&n.label){const{label:t}=h,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=XT(e,i,t.text,{label:t.text,orient:"radius"});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}return{angle:l,radius:h}})(e,this._currValueAngle,this._currValueRadius,this._angleHair,this._radiusHair,this.enableRemain,this._cacheAngleCrossHairInfo,this._cacheRadiusCrossHairInfo);this.enableRemain&&(this._cacheAngleCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0}),this._cacheRadiusCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0})),t&&(this._layoutRadius(s),this._layoutAngle(i))}_layoutAngle(t){var e;if(t._isCache&&this.enableRemain)return;const i=this.getContainer(),{angle:s,radius:n,label:r,center:a,visible:o}=t;if(o){const o="rect"===this._angleHair.type?"sector":"line",l=((t,e)=>{const{angle:i,innerRadius:s,radius:n,startAngle:r,endAngle:a,center:o}=e;let l;return l="sector"==("rect"===t.type?"sector":"line")?{center:o,innerRadius:s,radius:n,startAngle:r,endAngle:a}:{start:Tt(o,s,i),end:Tt(o,n,i)},l})(this._angleHair,t);if(this._angleCrosshair)this._angleCrosshair.setAttributes(l);else{let t;"line"===o?t=new FW(Object.assign(Object.assign({},l),{lineStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===o&&(t=new qW(Object.assign(Object.assign({},l),{sectorStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1}))),this._angleCrosshair=t,i.add(t)}if(r.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(s),i=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(a,n+r.offset,s)),this._angleHair.label),r),{textStyle:Object.assign(Object.assign({},null===(e=this._angleHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._angleLabelCrosshair,i,(t=>{t.name="crosshair-angle-label",this._angleLabelCrosshair=t}))}else this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}}_layoutRadius(t){var e;if(t._isCache&&this.enableRemain)return;const{center:i,startAngle:s,label:n,visible:r}=t,a=this.getContainer();if(r){const r=this._radiusHair.smooth?"circle":"polygon",o=((t,e)=>{const{center:i,startAngle:s,endAngle:n,distance:r,sides:a,axis:o,point:l,radius:h,innerRadius:d}=e;let c=r;if("polygon"==(t.smooth?"circle":"polygon")){const t=o.getCenter(),e=Ct(t,l),i=(n-s)/a,u=Math.floor((e-s)/i),p=u*i+s,g=Math.min((u+1)*i+s,n),m=Tt(t,r,p),_=Tt(t,r,g),f=function(t,e,i,s){if(!It(t,e,i,s))return!1;const n=[0,0],r=[0,0],a=[0,0];if(Bt(n,e,t),Bt(r,s,i),ht((o=n)[0]-(l=r)[0])+ht(o[1]-l[1])<1e-12)return!0;var o,l;Bt(a,i,t);const h=yt(a,r)/yt(n,r);return h>=0&&h<=1&&[t[0]+n[0]*h,t[1]+n[1]*h]}([_.x,_.y],[m.x,m.y],[t.x,t.y],[l.x,l.y]);f&&(c=Rs(xe.distancePN(l,f[0],f[1])+r,d,h))}return{center:i,startAngle:s,endAngle:n,radius:c,sides:a}})(this._radiusHair,t),l=o.radius;if(this._radiusCrosshair)this._radiusCrosshair.setAttributes(o);else{let t;t="polygon"===r?new ZW(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex+1})):new JW(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex})),this._radiusCrosshair=t,a.add(t)}if(n.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(s),r=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(i,l,s)),this._radiusHair.label),n),{textStyle:Object.assign(Object.assign({},null===(e=this._radiusHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._radiusLabelCrosshair,r,(t=>{t.name="crosshair-radius-label",this._radiusLabelCrosshair=t}))}else this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll()}}_parseFieldInfo(){var t;const{categoryField:e,valueField:i}=this._spec;e&&e.visible&&(this._angleHair=this._parseField(e,"categoryField")),i&&i.visible&&(this._radiusHair=this._parseField(i,"valueField"),this._radiusHair.smooth=null===(t=null==i?void 0:i.line)||void 0===t?void 0:t.smooth)}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new PD(e),null==s||s.add(t),i(t)),eD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._radiusCrosshair,this._radiusLabelCrosshair,this._angleCrosshair,this._angleLabelCrosshair]}}tG.specKey="crosshair",tG.type=r.polarCrosshair;const eG=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(D(a)||D(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Fa(r).every((i=>{t[i]>=a[0]&&t[i]<=Ya(a)&&(e=!0)})),e}:t=>{let e=!1;return Fa(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},iG=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n}=e.input,{stateField:r,valueField:a}=e.output,o={},l=[];return n.forEach(((t,e)=>{var n;if(D(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&r.domain.forEach((t=>{o[t]=0})),t.latestData.forEach((t=>{Fa(i[e]).forEach((i=>{D(t[i])||(D(o[t[i]])&&(o[t[i]]=0),D(s[e])||(o[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),Object.keys(o).forEach(((t,e)=>{const i={[r]:t};a&&(i[a]=o[t]),l.push(i)})),l};class sG extends rD{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-tthis._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent.getScale(),i=this._isReverse(),s=i?[1-this._end,1-this._start]:[this._start,this._end];if(i)switch(t){case"startHandler":e.rangeFactorEnd(s[1]);break;case"endHandler":e.rangeFactorStart(s[0]);break;default:e.rangeFactorStart(s[0],!0),e.rangeFactorEnd(s[1])}else switch(t){case"startHandler":e.rangeFactorStart(s[0]);break;case"endHandler":e.rangeFactorEnd(s[1]);break;default:e.rangeFactorEnd(s[1],!0),e.rangeFactorStart(s[0])}const n=e.rangeFactor();n?(this._start=i?1-n[1]:n[0],this._end=i?1-n[0]:n[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate()}else AE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),AE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=t=>{var e,i;if(!this._activeRoam)return;const{zoomDelta:s,zoomX:n,zoomY:r}=t,{x:a,y:o}=this._regions[0].getLayoutStartPoint(),{width:l,height:h}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),c=null!==(i=null===(e=this._spec.roamZoom)||void 0===e?void 0:e.rate)&&void 0!==i?i:1;if(d>=1&&s<1)return;if(d<=.01&&s>1)return;const u=this._isHorizontal?n:r,p=d*(s-1)*c;let g=p/2,m=p/2;if(u){const t=this._isHorizontal?a:o,e=this._isHorizontal?l:h;g=Math.abs(t-u)/Math.abs(e-t)*p,m=Math.abs(e-u)/Math.abs(e-t)*p}const _=Rs(this._start+g,0,1),f=Rs(this._end-m,0,1);this._handleChange(Math.min(_,f),Math.max(_,f),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam)return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?ht(s/n)>=.5:ht(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i;if(!this._activeRoam)return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this._handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=Ld(t),this._isHorizontal="horizontal"===Cd(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),D(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!Qh(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=Fa(i.userId)),M(i.specIndex)&&(this._seriesIndex=Fa(i.specIndex))),M(this._spec.seriesId)){const t=Fa(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(M(this._spec.seriesIndex)){const t=Fa(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(M(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Fa(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(M(this._spec.regionId)){const t=Fa(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(Qh(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&(this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[Ha(t),ja(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];if(this._relatedAxisComponent){const s={};AE(this._regions,(n=>{var r,a;const o="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,l="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(!o||!l)return;const h=o.getAxisId()===this._relatedAxisComponent.id?o:l.getAxisId()===this._relatedAxisComponent.id?l:this._isHorizontal?o:l,d=h===o?l:o,c=Qh(d.getScale(0).type),u=Qh(h.getScale(0).type);t.push(n.getRawData());const p=n.getSpec(),g="cartesian"===n.coordinate?Fa(p.xField):Fa(null!==(r=p.angleField)&&void 0!==r?r:p.categoryField),m="cartesian"===n.coordinate?Fa(p.yField):Fa(null!==(a=p.radiusField)&&void 0!==a?a:p.valueField);if(s[n.id]="link"===n.type?["from_xField"]:h===o?g:m,u?e.push(s[n.id]):e.push(s[n.id][0]),this._valueField){const t="link"===n.type?["from_yField"]:d===o?g:m;c&&i.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=s}else AE(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:s}=this._option;Ep(s,"dataview",b),Cp(s,"dataFilterComputeDomain",iG);const n=new R(s,{name:`${this.type}_${this.id}_data`});n.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new gx(this._option,n),n.reRunAllTransform(),s.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=E({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=E({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=E({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_statePointToData(t){const e=this._stateScale,i=e.domain();if(Qh(e.type))return this._isReverse()?i[0]+(Ya(i)-i[0])*(1-t):i[0]+(Ya(i)-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(Ya(s)-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&Qh(e.type)&&(s=s.slice().reverse()),(i-s[0])/(Ya(s)-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&M(this._spec.start)||"value"===e&&M(this._spec.startValue):"percent"===e&&M(this._spec.end)||"value"===e&&M(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this._statePointToData(i),this._endValue=this._statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,Qh(this._stateScale.type)&&this._stateScale.domain()[0]!==Ya(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(Ya(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(Ya(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=Qh(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[Ha(e),ja(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new ix,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(Cp(this._option.dataSet,"dataFilterWithNewDomain",eG),AE(this._regions,(t=>{t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>Qh(this._stateScale.type)},level:zp.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}changeRegions(){}update(t){}resize(t){}_parseDomainFromState(t,e){if(Qh(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a};this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,o)}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}onLayoutStart(t,e,i){super.onLayoutStart(t,e,i);const s=this._autoUpdate(t),n=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[n]:s?this[`_${n}`]:0},{[n]:Oy.Built_In}),this._dataUpdating=!1}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),d=null==l?void 0:l.getScale(),c=this._getAxisBandSize(h);if(!this._dataUpdating&&ed(d.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;let u=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?d.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&d.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,ed(d.type)){c&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=d.rangeFactor())&&void 0!==a?a:[];u=!(D(t)&&D(e)||0===t&&1===e)}else{const[t,e]=null!==(o=d.rangeFactor())&&void 0!==o?o:[this._start,this._end];u=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),u?this.show():this.hide(),this._cacheVisibility=u,u}_getNeedClearVRenderComponents(){return[this._component]}}function nG(t,e,i,s,n){let r=s,a=e;const o=t[e].x,l=t[e].y,h=t[i].x-o,d=t[i].y-l,c=h*h+d*d;let u,p,g,m,_;for(let s=e+1,n=i-1;sr&&(r=g,a=s);r>s&&(a-e>2&&nG(t,e,a,s,n),n.push(t[a],t[a+1]),i-a>2&&nG(t,a,i,s,n))}function rG(t,e){const i=t.length-1,s=[t[0]];return nG(t,0,i,e,s),s.push(t[i]),s}QA(sG,QB);const aG="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",oG={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:aG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:aG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},lG={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var hG;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(hG||(hG={}));var dG=function(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);nt,this._onHandlerPointerDown=(t,e)=>{t.stopPropagation(),"start"===e?(this._activeTag=hG.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=hG.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=hG.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=hG.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=hG.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t),"browser"===No.env&&(No.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),No.addEventListener("pointerup",this._onHandlerPointerUp)),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._pointerMove=t=>{t.stopPropagation();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute,r=this.eventPosToStagePos(t),{attPos:a,max:o}=this._layoutCache,l=(r[a]-this._activeCache.lastPos[a])/o;let{start:h,end:d}=this.state;this._activeState&&(this._activeTag===hG.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===hG.startHandler?h+l>d?(h=d,d=h+l,this._activeTag=hG.endHandler):h+=l:this._activeTag===hG.endHandler&&(d+l{t.preventDefault();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute;if(this._activeState&&this._activeTag===hG.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===No.env&&(No.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),No.removeEventListener("pointerup",this._onHandlerPointerUp)),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.removeEventListener("pointerup",this._onHandlerPointerUp)};const{position:i,showDetail:s}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText="auto"!==s&&s,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return void this.setAttribute("childrenPickable",!1);const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:s=!1,minSpan:n=0,maxSpan:r=1}=this.attribute,a=e-t;a!==this._spanCache&&(s||ar)||(this._spanCache=a,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){return this.stage.eventPointTransform(t)}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:n}=this.attribute,r=t[i]-n[i],a=e[i]-n[i],o=Math.min(Math.max(Math.min(r,a)/s,0),1),l=Math.min(Math.max(Math.max(r,a)/s,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:Rs(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===hG.background&&Math.abs(this.dragMaskSize())||0,height:s},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:Rs(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+s),width:i,height:this._activeState&&this._activeTag===hG.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if("start"===i){if(e.x1t.x2)return!0}else if("start"===i){if(e.y1t.y2)return!0;return!1}setTextAttr(t,e){var i,s,n,r,a,o,l,h;const{startTextStyle:d,endTextStyle:c}=this.attribute,{formatMethod:u}=d,p=dG(d,["formatMethod"]),{formatMethod:g}=c,m=dG(c,["formatMethod"]),{start:_,end:f}=this.state;this._startValue=this._statePointToData(_),this._endValue=this._statePointToData(f);const{position:v,width:y,height:b}=this.getLayoutAttrFromConfig(),x=u?u(this._startValue):this._startValue,S=g?g(this._endValue):this._endValue,M={x1:v.x,y1:v.y,x2:v.x+y,y2:v.y+b};let k,A,w,T;this._isHorizontal?(k={x:v.x+_*y,y:v.y+b/2},A={x:v.x+f*y,y:v.y+b/2},w={textAlign:this.isTextOverflow(M,t,"start")?"left":"right",textBaseline:null!==(s=null===(i=null==p?void 0:p.textStyle)||void 0===i?void 0:i.textBaseline)&&void 0!==s?s:"middle"},T={textAlign:this.isTextOverflow(M,e,"end")?"right":"left",textBaseline:null!==(r=null===(n=null==m?void 0:m.textStyle)||void 0===n?void 0:n.textBaseline)&&void 0!==r?r:"middle"}):(k={x:v.x+y/2,y:v.y+_*b},A={x:v.x+y/2,y:v.y+f*b},w={textAlign:null!==(o=null===(a=null==p?void 0:p.textStyle)||void 0===a?void 0:a.textAlign)&&void 0!==o?o:"center",textBaseline:this.isTextOverflow(M,t,"start")?"top":"bottom"},T={textAlign:null!==(h=null===(l=null==m?void 0:m.textStyle)||void 0===l?void 0:l.textAlign)&&void 0!==h?h:"center",textBaseline:this.isTextOverflow(M,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,E({},p,{text:x,x:k.x,y:k.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:w}),`data-zoom-start-text-${v}`),this._endText=this.maybeAddLabel(this._container,E({},m,{text:S,x:A.x,y:A.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:T}),`data-zoom-end-text-${v}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;const{x1:i,x2:s,y1:n,y2:r}=t,{dx:a=0,dy:o=0}=this.attribute.startTextStyle;if((new Kt).set(i,n,s,r).intersects(e)){const t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",o+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",a+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",o):this._startText.setAttribute("dx",a)}getLayoutAttrFromConfig(){var t,e,i,s,n,r;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:o,orient:l,middleHandlerStyle:h={},startHandlerStyle:d={},endHandlerStyle:c={},backgroundStyle:u={}}=this.attribute,{width:p,height:g}=o,m=null!==(e=null===(t=h.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let _,f,v;h.visible?this._isHorizontal?(_=p,f=g-m,v={x:a.x,y:a.y+m}):(_=p-m,f=g,v={x:a.x+("left"===l?m:0),y:a.y}):(_=p,f=g,v=a);const y=null!==(i=d.size)&&void 0!==i?i:this._isHorizontal?f:_,b=null!==(s=c.size)&&void 0!==s?s:this._isHorizontal?f:_;return d.visible&&(this._isHorizontal?(_-=(y+b)/2,v={x:v.x+y/2,y:v.y}):(f-=(y+b)/2,v={x:v.x,y:v.y+y/2})),f+=null!==(n=u.lineWidth/2)&&void 0!==n?n:1,_+=null!==(r=u.lineWidth/2)&&void 0!==r?r:1,this._layoutAttrFromConfig={position:v,width:_,height:f},this._layoutAttrFromConfig}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x,S,M,k,A,w,T,L,C,E,D,P,O;this._layoutAttrFromConfig=null;const{orient:R,backgroundStyle:B,backgroundChartStyle:I={},selectedBackgroundStyle:F={},selectedBackgroundChartStyle:Y={},middleHandlerStyle:j={},startHandlerStyle:H={},endHandlerStyle:z={},brushSelect:N,zoomLock:V}=this.attribute,{start:W,end:G}=this.state,{position:U,width:$,height:X}=this.getLayoutAttrFromConfig(),K=null!==(t=H.triggerMinSize)&&void 0!==t?t:40,q=null!==(e=z.triggerMinSize)&&void 0!==e?e:40,Z=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=Z,this._background=Z.createOrUpdateChild("background",Object.assign(Object.assign({x:U.x,y:U.y,width:$,height:X,cursor:N?"crosshair":"auto"},B),{pickable:!V&&(null===(i=B.pickable)||void 0===i||i)}),"rect"),(null===(s=I.line)||void 0===s?void 0:s.visible)&&this.setPreviewAttributes("line",Z),(null===(n=I.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",Z),N&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x+W*$,y:U.y,width:(G-W)*$,height:X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(r=Y.pickable)||void 0===r||r)}),"rect"):this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x,y:U.y+W*X,width:$,height:(G-W)*X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(a=F.pickable)||void 0===a||a)}),"rect"),(null===(o=Y.line)||void 0===o?void 0:o.visible)&&this.setSelectedPreviewAttributes("line",Z),(null===(l=Y.area)||void 0===l?void 0:l.visible)&&this.setSelectedPreviewAttributes("area",Z),this._isHorizontal){if(j.visible){const t=(null===(h=j.background)||void 0===h?void 0:h.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:U.x+W*$,y:U.y-t,width:(G-W)*$,height:t},null===(d=j.background)||void 0===d?void 0:d.style),{pickable:!V&&(null===(p=null===(u=null===(c=j.background)||void 0===c?void 0:c.style)||void 0===u?void 0:u.pickable)||void 0===p||p)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:U.x+(W+G)/2*$,y:U.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(m=null===(g=j.icon)||void 0===g?void 0:g.symbolType)&&void 0!==m?m:"square"},j.icon),{pickable:!V&&(null===(_=j.icon.pickable)||void 0===_||_)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+W*$,y:U.y+X/2,size:X,symbolType:null!==(f=H.symbolType)&&void 0!==f?f:"square"},lG.horizontal),H),{pickable:!V&&(null===(v=H.pickable)||void 0===v||v)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+G*$,y:U.y+X/2,size:X,symbolType:null!==(y=z.symbolType)&&void 0!==y?y:"square"},lG.horizontal),z),{pickable:!V&&(null===(b=z.pickable)||void 0===b||b)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+W*$-t/2,y:U.y+X/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},lG.horizontal),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+G*$-i/2,y:U.y+X/2-s/2,width:i,height:s,fill:"white",fillOpacity:0,zIndex:999},lG.horizontal),{pickable:!V}),"rect")}else{if(j.visible){const t=(null===(x=j.background)||void 0===x?void 0:x.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===R?U.x-t:U.x+$,y:U.y+W*X,width:t,height:(G-W)*X},null===(S=j.background)||void 0===S?void 0:S.style),{pickable:!V&&(null===(A=null===(k=null===(M=j.background)||void 0===M?void 0:M.style)||void 0===k?void 0:k.pickable)||void 0===A||A)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===R?U.x-t/2:U.x+$+t/2,y:U.y+(W+G)/2*X,angle:Math.PI/180*90,symbolType:null!==(T=null===(w=j.icon)||void 0===w?void 0:w.symbolType)&&void 0!==T?T:"square",strokeBoundsBuffer:0},j.icon),{pickable:!V&&(null===(C=null===(L=j.icon)||void 0===L?void 0:L.pickable)||void 0===C||C)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+W*X,size:$,symbolType:null!==(E=H.symbolType)&&void 0!==E?E:"square"},lG.vertical),H),{pickable:!V&&(null===(D=H.pickable)||void 0===D||D)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+G*X,size:$,symbolType:null!==(P=z.symbolType)&&void 0!==P?P:"square"},lG.vertical),z),{pickable:!V&&(null===(O=z.pickable)||void 0===O||O)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+$/2+t/2,y:U.y+W*X-e/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},lG.vertical),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+$/2+i/2,y:U.y+G*X-s/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},lG.vertical),{pickable:!V}),"rect")}this._showText&&this.renderText()}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let n,r;return this._isHorizontal?(n=[{x:e.x,y:e.y+s}],r=[{x:e.x+i,y:e.y+s}]):"left"===t?(n=[{x:e.x+i,y:e.y}],r=[{x:e.x+i,y:e.y+s}]):(n=[{x:e.x,y:e.y+s}],r=[{x:e.x,y:e.y}]),{basePointStart:n,basePointEnd:r}}simplifyPoints(t){var e;return t.length>1e4?function(t,e){if(t.length<=10)return t;const i=void 0!==e?e*e:1;return rG(t=function(t,e){let i,s,n=t[0].x,r=t[0].y;const a=[t[0]];for(let o=1,l=t.length;oe&&(n=t[o].x,r=t[o].y,a.push(t[o]));return t[t.length-1].x===n&&t[t.length-1].y===r||a.push(t[t.length-1]),a}(t,i),i)}(t,null!==(e=this.attribute.tolerance)&&void 0!==e?e:this._previewData.length/1e4):t}getPreviewLinePoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:s,end:n}=this.state,{position:r,width:a,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?r.x+s*a:r.x,y:this._isHorizontal?r.y:r.y+s*o,width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?r.x+s*a:r.x),y:-(this._isHorizontal?r.y:r.y+s*o),width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new PD(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:i,end:s}=this.attribute;M(t)&&M(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&s===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,s;const{middleHandlerStyle:n={}}=this.attribute,r=null!==(e=null===(t=n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,a=null!==(s=null===(i=n.icon)||void 0===i?void 0:i.size)&&void 0!==s?s:10;return Math.max(r,...Fa(a))}setPreviewPointsX(t){xs(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){xs(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){xs(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){xs(t)&&(this._previewPointsY1=t)}setStatePointToData(t){xs(t)&&(this._statePointToData=t)}}uG.defaultAttributes=oG;class pG extends nD{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Ll({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=y(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}class gG extends sG{constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=pG,this.specKey="dataZoom",this.layoutZIndex=Dy.DataZoom,this.layoutLevel=Py.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),D(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),D(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,c=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0}onLayoutEnd(t){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd(t)}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new Zb;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2];this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,this._computeWidth()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeHeight()-this._middleHandlerSize,0])):"left"===this.layoutOrient?(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeWidth()-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([0,this._computeWidth()-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:this._computeWidth(),height:this._computeHeight()},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[Ha(e),ja(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:h(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height-(this._startHandlerSize+this._endHandlerSize)/2}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(Qh(t.type)&&e[0]===Ya(e)||ed(t.type)&&1===(i=e,i&&y(i)?Array.from(new Set(Fa(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this.getLayoutRect().width,height:this.getLayoutRect().height},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:M(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new uG(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this._statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange){i&&this._component&&this._component.setStartAndEnd(t,e),this._start=t,this._end=e;const n=this._statePointToData(t),r=this._statePointToData(e);(xs(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(zd.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,d,c;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:m={},selectedBackgroundChart:_={}}=this._spec;return{backgroundStyle:WE(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:WE(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:WE(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:WE(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:WE(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:WE(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:WE(g.style)},selectedBackgroundStyle:WE(this._spec.selectedBackground.style),dragMaskStyle:WE(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Ll(WE(null===(l=m.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},WE(null===(h=m.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Ll(WE(null===(d=_.line)||void 0===d?void 0:d.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},WE(null===(c=_.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=XT(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}gG.type=r.dataZoom,gG.transformerConstructor=pG,gG.specKey="dataZoom";class mG extends sG{constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=Dy.DataZoom,this.layoutLevel=Py.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(t){var e,i;this._updateScaleRange(),null===(i=(e=this.effect).onZoomChange)||void 0===i||i.call(e),super.onLayoutEnd(t)}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return h(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new QV(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(t,e,i){super._handleChange(t,e,i);const s=md(this._start,t)&&md(this._end,e);if(this._shouldChange&&!s){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._statePointToData(t),n=this._statePointToData(e);(xs(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,s,n):this._handleStateChange(this._statePointToData(t),this._statePointToData(e)))&&this.event.emit(zd.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){}_initCommonEvent(){super._initCommonEvent(),this._component&&this._component.on("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])}))}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return D(i)||(s.padding=i),jm(null==t?void 0:t.style)||(s.railStyle=WE(t.style)),jm(null==e?void 0:e.style)||(s.sliderStyle=WE(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}mG.type=r.scrollBar,mG.specKey="scrollBar";const _G=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Fa(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},fG={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};p_(),cf(),ik();class vG extends Bk{constructor(){super(...arguments),this.name="indicator"}_renderText(t,e,i,s,n,r){if(!1!==e.visible){const a=E({},$d(fG,n),e.style,{visible:e.visible});a.lineHeight=M(a.lineHeight)?a.lineHeight:a.fontSize,e.formatMethod&&(a._originText=a.text,a.text=e.formatMethod(a.text,a));const o=sA(a);return o.name=r,t.appendChild(o),e.autoFit&&Zo(i)&&this._setLocalAutoFit(i,o,e),e.autoLimit&&Zo(s)&&o.setAttribute("maxLineWidth",i),o}}render(){var t,e;if(this.removeAllChild(!0),!0!==this.attribute.visible)return;const{title:i={},content:s,size:n,limitRatio:r=1/0}=this.attribute,a=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1,pickable:null===(t=this.attribute.pickable)||void 0===t||t},"group");if(M(i)&&(this._title=this._renderText(o,i,a,r,"title.style","indicator-title")),M(s)){const t=Fa(s),e=[];t.forEach(((t,i)=>{!1!==t.visible&&e.push(this._renderText(o,t,a,r,"content.style","indicator-content-"+i))})),this._content=e}this._setGlobalAutoFit(a),this._setYPosition();const l=null!==(e=null==o?void 0:o.AABBBounds.height())&&void 0!==e?e:0;o.setAttribute("y",n.height/2-l/2),o.setAttribute("x",n.width/2)}_setLocalAutoFit(t,e,i){var s,n,r,a,o,l,h,d,c;if("default"!==(null!==(s=i.fitStrategy)&&void 0!==s?s:"default"))return;const u=tA(null!==(r=null===(n=i.style)||void 0===n?void 0:n.text)&&void 0!==r?r:"",null!==(a=i.style)&&void 0!==a?a:{},null===(l=null===(o=this.stage)||void 0===o?void 0:o.getTheme())||void 0===l?void 0:l.text).width;if(u>0){const s=t*(null!==(h=i.fitPercent)&&void 0!==h?h:.5)/u,n=Math.floor((null!==(c=null===(d=i.style)||void 0===d?void 0:d.fontSize)&&void 0!==c?c:20)*s);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",M(i.style.lineHeight)?i.style.lineHeight:n)}}_setGlobalAutoFit(t){var e,i,s,n,r,a,o;const l=t/2,h=[];let d=0;const c=null!==(e=this.attribute.title)&&void 0!==e?e:{};c.autoFit&&"inscribed"===c.fitStrategy?(this._title.setAttribute("fontSize",12),h.push({text:this._title,spec:null!==(i=this.attribute.title)&&void 0!==i?i:{}})):d+=null!==(a=null===(r=null===(n=null===(s=this._title)||void 0===s?void 0:s.AABBBounds)||void 0===n?void 0:n.height)||void 0===r?void 0:r.call(n))&&void 0!==a?a:0;const u=null!==(o=c.space)&&void 0!==o?o:0;if(d+=u,Fa(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i,s,n,r;const a=this._content[e];t.autoFit&&"inscribed"===t.fitStrategy?(a.setAttribute("fontSize",12),h.push({text:a,spec:t})):d+=null!==(n=null===(s=null===(i=null==a?void 0:a.AABBBounds)||void 0===i?void 0:i.height)||void 0===s?void 0:s.call(i))&&void 0!==n?n:0;const o=null!==(r=t.space)&&void 0!==r?r:0;d+=o})),h.length<=0)return;const p=12/h.reduce(((t,e)=>Math.max(t,e.text.AABBBounds.width())),0)*h.length,g=d/2,m=p**2+1,_=2*g*p,f=g**2-l**2,v=2*(p*((-_+Math.sqrt(_**2-4*m*f))/(2*m))+g),y=(v-d)/h.length;Zo(v)&&h.forEach((t=>{var e;const i=null===(e=t.spec.style)||void 0===e?void 0:e.lineHeight;t.text.setAttribute("fontSize",y),t.text.setAttribute("lineHeight",M(i)?i:y)}))}_setYPosition(){var t,e,i,s,n,r;let a=0;const o=null!==(s=null===(i=null===(e=null===(t=this._title)||void 0===t?void 0:t.AABBBounds)||void 0===e?void 0:e.height)||void 0===i?void 0:i.call(e))&&void 0!==s?s:0,l=null!==(r=null===(n=this.attribute.title)||void 0===n?void 0:n.space)&&void 0!==r?r:0;Fa(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i;const s=this._content[e];s.setAttribute("y",o+l+a);const n=null!==(i=t.space)&&void 0!==i?i:0;a+=s.AABBBounds.height()+n}))}}class yG extends rD{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=Dy.Indicator,this.layoutLevel=Py.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>t&&!1!==t.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Fa(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Fa(this._spec.regionId),Fa(this._spec.regionIndex))}onRender(t){}changeRegions(t){}initEvent(){var t;if(this._option.disableTriggerEvent)return;if("none"===this._spec.trigger)return;const e=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();e&&("hover"===this._spec.trigger?(e.addEventListener("element-highlight:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-highlight:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))):(e.addEventListener("element-select:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-select:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){Cp(this._option.dataSet,"indicatorFilter",_G);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:()=>this._activeDatum}}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new gx(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:d}=r,c=function(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{const e=Ll({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},VE(aD(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?al(o,this._computeLayoutRadius()):0,dy:l?al(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==d.visible&&(!M(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},VE(aD(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:u},c)}_createOrUpdateIndicatorComponent(t){if(this._indicatorComponent)Im(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new vG(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}return this._cacheAttrs=t,this._indicatorComponent}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":xs(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>e.id===t))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}yG.type=r.indicator,yG.specKey="indicator";const bG=["sum","average","min","max","variance","standardDeviation","median"];function xG(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=Ha(s),r=ja(s);return er}function SG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.x)&&xG(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),d=el(t.x)?wG(t.x,n)+r.x:l.getXAxisHelper().dataToPosition([t.x])+r.x,d}function MG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.y)&&xG(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),d=el(t.y)?wG(t.y,n)+r.y:l.getYAxisHelper().dataToPosition([t.y])+r.y,d}function kG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.angle)&&xG(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),a.angleAxisHelper.dataToPosition([t.angle])}function AG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.radius)&&xG(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),a.radiusAxisHelper.dataToPosition([t.radius])}function wG(t,e){return Number(t.substring(0,t.length-1))*e/100}function TG(t){return bG.includes(t)}function LG(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),d=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),c={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return p.forEach((t=>{const e=M(t.x),i=M(t.y);if(e&&i){const e=SG(t,g,n,c,h,a),i=MG(t,m,n,c,d,a);u.push([{x:e,y:i}])}else if(e){const e=SG(t,g,n,c,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=MG(t,m,n,c,d,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function CG(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=M(t.angle),i=M(t.radius);if(e&&i){const e=kG(t,l,n,r),i=AG(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=kG(t,l,n,r);a.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=AG(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function EG(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function DG(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=y(s);return r.forEach(((t,r)=>{var o,l,d,c;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:m,height:_}=p.getLayoutRect();let f=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(f=el(e)?Number(e.substring(0,e.length-1))*m/100:e),i&&(v=el(i)?Number(i.substring(0,i.length-1))*_/100:i)}const y=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Fa(t.x),S=Fa(t.y);1===x.length&&h(x[0])&&xG(y,x[0],i)&&(null===(l=null===(o=u.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",x[0])),1===S.length&&h(S[0])&&xG(b,S[0],i)&&(null===(c=null===(d=u.getYAxisHelper())||void 0===d?void 0:d.setExtendDomain)||void 0===c||c.call(d,"marker_yAxis_extend",S[0])),n.push({x:u.getXAxisHelper().dataToPosition(x)+g.x+f,y:u.getYAxisHelper().dataToPosition(S)+g.y+v})})),n}function PG(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),u=Fa(t.angle),p=Fa(t.radius);1===u.length&&h(u[0])&&xG(d,u[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",u[0])),1===p.length&&h(p[0])&&xG(c,p[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",p[0])),s.push({angle:l.angleAxisHelper.dataToPosition(u),radius:l.radiusAxisHelper.dataToPosition(p)})})),s}function OG(t,e,i){let{x:s,y:n}=t;return el(s)&&(s=wG(s,e)),el(n)&&(n=wG(n,i)),{x:s,y:n}}function RG(t,e,i){let s;if(s=xs(t)?Fa(t(e.getData().getLatestData(),e)):Fa(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=OG(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>OG(t,n,r)))}function BG(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.xi&&(i=r.x+a.width),r.yn&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function IG(t,e){const{labelBackground:i={},style:s,shape:n}=t,r=function(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);nn&&(d=n-l),h>r&&(c=r-h),{dx:d,dy:c}}function UG(t,e){const{dx:i,dy:s}=GG(t,e),{dx:n=0,dy:r=0}=t.attribute;i&&t.setAttribute("dx",i+n),s&&t.setAttribute("dy",s+r)}class $G extends Bk{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=HD(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=zD(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=ND(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=bs(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:E({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:E({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:E({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}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:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(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:s}=this.attribute;let n;if(s){const s=aa.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=aa.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=aa.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(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}}function XG(t,e,i,s){var n,r,a,o,l;if(!t)return;null===(n=null==t?void 0:t.animates)||void 0===n||n.forEach((t=>t.stop("end")));const h=null!==(a=null===(r=t.attribute)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1,d=null!==(l=null===(o=t.attribute)||void 0===o?void 0:o.strokeOpacity)&&void 0!==l?l:1;t.setAttributes({fillOpacity:0,strokeOpacity:0}),t.animate().wait(e).to({fillOpacity:h,strokeOpacity:d},i,s)}function KG(t,e,i,s){t&&(XG(t.startSymbol,e,i,s),t.lines.forEach((t=>XG(t,e,i,s))),XG(t.line,e,i,s),XG(t.endSymbol,e,i,s))}function qG(t,e,i,s){t&&(XG(t.getTextShape(),e,i,s),XG(t.getBgRect(),e,i,s))}function ZG(t,e,i,s){var n,r,a,o;t&&(t.setAttributes({fillOpacity:null!==(r=null===(n=t.attribute)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(o=null===(a=t.attribute)||void 0===a?void 0:a.strokeOpacity)&&void 0!==o?o:1}),t.animate().wait(e).to({fillOpacity:0,strokeOpacity:0},i,s))}function JG(t,e,i,s){t&&(ZG(t.startSymbol,e,i,s),t.lines.forEach((t=>ZG(t,e,i,s))),ZG(t.line,e,i,s),ZG(t.endSymbol,e,i,s))}function QG(t,e,i,s){t&&(ZG(t.getTextShape(),e,i,s),ZG(t.getBgRect(),e,i,s))}function tU(t,e,i,s,n){const r=.1*i,a=.7*i,o=.1*i,l=.1*i;XG(t.startSymbol,s,r,n),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const o=a/t.lines.length;e.animate().wait(s+r+i*o).to({clipRange:1},o,n)})),XG(t.endSymbol,s+r+a,o,n),XG(e.getTextShape(),s+r+a+o,l,n),XG(e.getBgRect(),s+r+a+o,l,n)}function eU(t,e,i,s,n){KG(t,s,i,n),qG(e,s,i,n)}function iU(t,e,i,s,n){XG(t,s,i,n),qG(e,s,i,n)}function sU(t,e,i,s,n){XG(t,s,i,n),qG(e,s,i,n)}function nU(t,e,i,s,n,r){var a;KG(t,n,s,r),XG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?qG(i,n,s,r):XG(i,n,s,r)}function rU(t,e,i,s,n,r){var a;const o=.1*s,l=.65*s,h=.05*s,d=.1*s,c=.1*s;XG(t.startSymbol,n,o,r),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const s=l/t.lines.length;e.animate().wait(n+o+i*s).to({clipRange:1},s,r)})),XG(e,n+o+l,h,r),XG(t.endSymbol,n+o+l+h,d,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?(XG(i.getTextShape(),n+o+l+h+d,c,r),XG(i.getBgRect(),n+o+l+d,c,r)):XG(i,n+o+l+d,c,r)}function aU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"clipIn"===i?tU(t,e,s,r,a):"fadeIn"===i&&eU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"clipIn"===i?tU(t,e,s,n,a):"fadeIn"===i&&eU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){JG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function oU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&iU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&iU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){ZG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function lU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&sU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&sU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){ZG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function hU(t,e,i,s){const[n,r]=t,{enter:a,update:o,exit:l}=i;if("enter"===s){const{type:t,duration:i,delay:s,easing:o}=a;"fadeIn"===t?nU(n,r,e,i,s,o):"callIn"===t&&rU(n,r,e,i,s,o)}else if("update"===s){const{type:t,duration:i,delay:s,easing:a}=o;"fadeIn"===t?nU(n,r,e,i,s,a):"callIn"===t&&rU(n,r,e,i,s,a)}else if("exit"===s){const{duration:t,delay:i,easing:s}=l;!function(t,e,i,s,n,r){var a;JG(t,n,s,r),ZG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?QG(i,n,s,r):ZG(i,n,s,r)}(n,r,e,t,i,s)}}const dU={type:"clipIn",duration:500,easing:"linear",delay:0},cU={type:"fadeIn",duration:500,easing:"linear",delay:0},uU={type:"callIn",duration:500,easing:"linear",delay:0},pU={type:"fadeOut",duration:500,easing:"linear",delay:0};class gU extends $G{constructor(){super(...arguments),this.name="markCommonLine",this.defaultUpdateAnimation=dU,this.defaultExitAnimation=pU}getLine(){return this._line}getLabel(){return this._label}setLabelPos(){const{label:t={},limitRect:e}=this.attribute,{position:i,confine:s,autoRotate:n}=t,r=this.getPointAttrByPosition(i),a=i.toString().toLocaleLowerCase().includes("start")?this._line.getStartAngle()||0:this._line.getEndAngle()||0;if(this._label.setAttributes(Object.assign(Object.assign({},r.position),{angle:n?this.getRotateByAngle(r.angle):0,textStyle:Object.assign(Object.assign({},this.getTextStyle(i,a,n)),t.textStyle)})),e&&s){const{x:t,y:i,width:s,height:n}=e;UG(this._label,{x1:t,y1:i,x2:t+s,y2:i+n})}}initMarker(t){const{label:e,state:i}=this.attribute,s=this.createSegment();s.name="mark-common-line-line",this._line=s,t.add(s);const n=new PD(Object.assign(Object.assign({},e),{state:{panel:E({},Zk,null==i?void 0:i.labelBackground),text:E({},Zk,null==i?void 0:i.label)}}));n.name="mark-common-line-label",this._label=n,t.add(n),this.setLabelPos()}updateMarker(){const{label:t,state:e}=this.attribute;this.setLineAttributes(),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},t),{state:{panel:E({},Zk,null==e?void 0:e.labelBackground),text:E({},Zk,null==e?void 0:e.label)}})),this.setLabelPos())}}var mU,_U,fU,vU;!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"}(mU||(mU={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom"}(_U||(_U={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(fU||(fU={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(vU||(vU={}));const yU=.001,bU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:mU.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},xU={postiveXAxis:{start:{textAlign:"left",textBaseline:"middle"},startTop:{textAlign:"left",textBaseline:"bottom"},startBottom:{textAlign:"left",textBaseline:"top"},insideStart:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"right",textBaseline:"bottom"},insideStartBottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},endTop:{textAlign:"left",textBaseline:"bottom"},endBottom:{textAlign:"left",textBaseline:"top"},insideEnd:{textAlign:"right",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},negativeXAxis:{start:{textAlign:"right",textBaseline:"middle"},startTop:{textAlign:"right",textBaseline:"bottom"},startBottom:{textAlign:"right",textBaseline:"top"},insideStart:{textAlign:"left",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"right",textBaseline:"middle"},endTop:{textAlign:"right",textBaseline:"bottom"},endBottom:{textAlign:"right",textBaseline:"top"},insideEnd:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"left",textBaseline:"bottom"},insideEndBottom:{textAlign:"left",textBaseline:"top"}}},SU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:fU.arcOuterMiddle,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},MU={interactive:!0,label:{position:_U.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},kU={interactive:!0,label:{position:fU.arcOuterMiddle,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},AU={arcInnerStart:{textAlign:"center",textBaseline:"bottom"},arcInnerEnd:{textAlign:"center",textBaseline:"bottom"},arcInnerMiddle:{textAlign:"center",textBaseline:"bottom"},arcOuterStart:{textAlign:"center",textBaseline:"top"},arcOuterEnd:{textAlign:"center",textBaseline:"top"},arcOuterMiddle:{textAlign:"center",textBaseline:"top"},center:{textAlign:"center",textBaseline:"middle"}},wU={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},TU={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"}}};function LU(){CU._animate=aU}WG(),bD();class CU extends gU{markerAnimate(t){CU._animate&&this._animationConfig&&CU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},CU.defaultAttributes,t)),this.name="markLine"}getPointAttrByPosition(t){var e;const{label:i={}}=this.attribute,{refX:s=0,refY:n=0}=i,r=this._line.getMainSegmentPoints(),a=null!==(e=this._line.getEndAngle())&&void 0!==e?e:0,o=(Wk(a),a),l=s*Math.cos(o)+n*Math.cos(o-Math.PI/2),h=s*Math.sin(o)+n*Math.sin(o-Math.PI/2);return t.includes("start")||t.includes("Start")?{position:{x:r[0].x+l,y:r[0].y+h},angle:o}:t.includes("middle")||t.includes("Middle")?{position:{x:(r[0].x+r[r.length-1].x)/2+l,y:(r[0].y+r[r.length-1].y)/2+h},angle:o}:{position:{x:r[r.length-1].x+l,y:r[r.length-1].y+h},angle:o}}getRotateByAngle(t){var e;return(Wk(t)?t:t-Math.PI)+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}getTextStyle(t,e,i){return Gk(Math.abs(e),Math.PI/2,yU)||Gk(Math.abs(e),3*Math.PI/2,yU)?Uk(i,e,t):Wk(e)?xU.postiveXAxis[t]:xU.negativeXAxis[t]}createSegment(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;return new SD({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,pickable:!1,state:{line:E({},Zk,null==a?void 0:a.line),startSymbol:E({},Zk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},Zk,null==a?void 0:a.lineEndSymbol)}})}setLineAttributes(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:{line:E({},Zk,null==a?void 0:a.line),startSymbol:E({},Zk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},Zk,null==a?void 0:a.lineEndSymbol)}})}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach((t=>{if(t.length)t.forEach((t=>{Zo(t.x)&&Zo(t.y)||(e=!1)}));else if(!Zo(t.x)||!Zo(t.y))return void(e=!1)})),e}}CU.defaultAttributes=bU;function EU(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=function(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{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let d=i;M(r)&&(d=Fa(i)[r]),n&&Fa(i).includes(n)&&(d=n);let c=s;M(h)&&(c=Fa(s)[h]),o&&Fa(s).includes(o)&&(c=o),l=Object.assign({x:void 0,y:void 0},a),S(t[d])&&TG(t[d])?l.x={field:d,aggrType:t[d]}:l.x=Fa(d).map((e=>t[e])),S(t[c])&&TG(t[c])?l.y={field:c,aggrType:t[c]}:l.y=Fa(c).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;M(r)&&(o=Fa(s)[r]),n&&Fa(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),S(t[o])&&TG(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Fa(o).map((e=>t[e])),S(t[h])&&TG(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Fa(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){const s=e.x;y(s)?i.x=s.map((i=>PU(i,t,e))):i.x=PU(s,t,e)}if(M(e.y)){const s=e.y;y(s)?i.y=s.map((i=>PU(i,t,e))):i.y=PU(s,t,e)}if(M(e.angle)){const s=e.angle;y(s)?i.angle=s.map((i=>PU(i,t,e))):i.angle=PU(s,t,e)}if(M(e.radius)){const s=e.radius;y(s)?i.radius=s.map((i=>PU(i,t,e))):i.radius=PU(s,t,e)}if(M(e.areaName)){const s=e.areaName;i.areaName=PU(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const DU={min:(t,e)=>_d(t[0].latestData,e.field),max:(t,e)=>fd(t[0].latestData,e.field),sum:function(t,e){return vd(t[0].latestData,e.field)},average:function(t,e){return yd(t[0].latestData,e.field)},variance:function(t,e){return bd(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(bd(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return((t,e)=>{let i=t;return!0!==e&&(i=t.sort(pd)),function(t,e,i=gd){const s=t.length;if(!s)return;if(e<=0||s<2)return i(t[0],0,t);if(e>=1)return i(t[s-1],s-1,t);const n=(s-1)*e,r=Math.floor(n),a=i(t[r],r,t);return a+(i(t[r+1],r+1,t)-a)*(n-r)}(i,.5)})(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function PU(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(xs(t))return t(a,o,l,s,n,r);if(w(t)){const{aggrType:i,field:s}=t;return DU[i](e,{field:s})}return t}class OU extends rD{constructor(){super(...arguments),this.layoutType="none",this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType))}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){return S(e)&&TG(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Fa(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const i=new f;return i.registerParser("array",e),new R(i).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}onRender(t){}changeRegions(t){}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=TE(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e,i){D(this._spec.offsetX)||(this._layoutOffsetX=il(this._spec.offsetX,e.width,e)),D(this._spec.offsetY)||(this._layoutOffsetY=il(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e,i)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}}function RU(t,e){return function(t,e,i){const{predict:s}=function(t,e=t=>t.x,i=t=>t.y){let s=0,n=0,r=0,a=0,o=0;ad(t,e,i,((t,e)=>{++o,s+=(t-s)/o,n+=(e-n)/o,r+=(t*e-r)/o,a+=(t*t-a)/o}));const l=function(t,e,i,s){const n=s-t*t,r=Math.abs(n)<1e-24?0:(i-t*e)/n;return[e-r*t,r]}(s,n,r,a),h=t=>l[0]+l[1]*t;return{coef:l,predict:h,rSquared:od(t,e,i,n,h)}}(t,(t=>t[e]),(t=>t[i])),n=_d(t,e),r=fd(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}function BU(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class IU extends OU{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=Dy.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=zG(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v;const{label:y={},startSymbol:b={},endSymbol:x={}}=this._spec,S={zIndex:this.layoutZIndex,interactive:null===(t=this._spec.interactive)||void 0===t||t,hover:null===(e=this._spec.interactive)||void 0===e||e,select:null===(i=this._spec.interactive)||void 0===i||i,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:YG(WE(null===(s=this._spec.line)||void 0===s?void 0:s.style),this._markerData),clipInRange:null!==(n=this._spec.clip)&&void 0!==n&&n,label:IG(y,this._markerData),state:{line:FG(null!==(a=null===(r=this._spec.line)||void 0===r?void 0:r.state)&&void 0!==a?a:{},this._markerData),lineStartSymbol:FG(null!==(l=null===(o=this._spec.startSymbol)||void 0===o?void 0:o.state)&&void 0!==l?l:{},this._markerData),lineEndSymbol:FG(null!==(d=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==d?d:{},this._markerData),label:FG(null!==(p=null===(u=null===(c=this._spec)||void 0===c?void 0:c.label)||void 0===u?void 0:u.state)&&void 0!==p?p:{},this._markerData),labelBackground:FG(null!==(f=null===(_=null===(m=null===(g=this._spec)||void 0===g?void 0:g.label)||void 0===m?void 0:m.labelBackground)||void 0===_?void 0:_.state)&&void 0!==f?f:{},this._markerData)},animation:null!==(v=this._spec.animation)&&void 0!==v&&v,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return b.visible?S.startSymbol=Object.assign(Object.assign({},b),{visible:!0,style:WE(b.style)}):S.startSymbol={visible:!1},x.visible?S.endSymbol=Object.assign(Object.assign({},x),{visible:!0,style:WE(x.style)}):S.endSymbol={visible:!1},this._newMarkLineComponent(S)}_getUpdateMarkerAttrs(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=l.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=BG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}const p=null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{},g=Object.assign(Object.assign({},p.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=p.label)||void 0===s?void 0:s.text});return Object.assign(Object.assign({},h),{label:g,limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c}=zG(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||d||c||e))return;Cp(this._option.dataSet,"markerAggregation",EU),Cp(this._option.dataSet,"markerRegression",RU),Cp(this._option.dataSet,"markerFilter",BU);const{options:u,needAggr:p,needRegr:g,processData:m}=this._computeOptions(),_=new R(this._option.dataSet);_.parse([m],{type:"dataview"}),p&&_.transform({type:"markerAggregation",options:u}),g&&_.transform({type:"markerRegression",options:u}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(()=>{this._markerLayout()})),this._markerData=_}}IU.specKey="markLine";class FU extends IU{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new CU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=M(e.coordinates),o=M(e.process),l=o&&M(e.process.x),h=o&&M(e.process.y),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:p,doXYY1Process:g,doYXX1Process:m,doXYProcess:_,doCoordinatesProcess:f}=zG(e);let v=[];if(u||g||p||m||_||a&&l||a&&h){const t=LG(i,s,n,r,c);v=1===t.length?t[0]:t.map((t=>t[0]))}else f?v=DG(i,r,c,e.coordinatesOffset):d&&(v=RG(e.positions,r,e.regionRelative));return{points:v}}_markerLayout(){var t,e,i,s,n,r,a,o;const l=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const o=this._startRelativeSeries,h=this._endRelativeSeries,{multiSegment:d,mainSegmentIndex:c}=this._spec.line||{},{connectDirection:u,expandDistance:p=0}=this._spec;let g;if(el(p)){const t=o.getRegion(),e=t.getLayoutStartPoint(),i=h.getRegion(),s=i.getLayoutStartPoint();if("bottom"===u||"top"===u){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));g=Number(p.substring(0,p.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));g=Number(p.substring(0,p.length-1))*n/100}}else g=p;const{points:m,label:_,limitRect:f}=l,v=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(m[0],m[1],u,g);let y;y=d&&M(c)?{position:"middle",autoRotate:!1,refX:0,refY:0}:Object.assign(Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(m[0],m[1],u,g)),{refX:0,refY:0}),Zo(null===(t=this._spec.label)||void 0===t?void 0:t.refX)&&(y.refX+=this._spec.label.refX),Zo(null===(e=this._spec.label)||void 0===e?void 0:e.refY)&&(y.refY+=this._spec.label.refY),Zo(null===(i=this._spec.label)||void 0===i?void 0:i.dx)&&(y.dx=(y.dx||0)+this._spec.label.dx),Zo(null===(s=this._spec.label)||void 0===s?void 0:s.dy)&&(y.dy=(y.dy||0)+this._spec.label.dy);const b=null!==(r=null===(n=this._markerComponent)||void 0===n?void 0:n.attribute)&&void 0!==r?r:{};null===(a=this._markerComponent)||void 0===a||a.setAttributes({points:d?[[v[0],v[1]],[v[1],v[2]],[v[2],v[3]]]:v,label:Object.assign(Object.assign(Object.assign({},_),y),{textStyle:Object.assign(Object.assign({},b.label.textStyle),{textAlign:"center",textBaseline:"middle"})}),limitRect:f,multiSegment:d,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(o=this._markerComponent)||void 0===o||o.setAttributes(l)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:d,doCoordinatesProcess:c}=zG(n);if(d)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(c){if(t=this._processSpecCoo(n),i=!1,e=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&"x"in n.process&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&"y"in n.process&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&"xy"in n.process){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}FU.type=r.markLine,FU.coordinateType="cartesian",xD();class YU extends SD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},SD.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:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},d={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,d];const c=this._renderSymbol(t,this._mainSegmentPoints,"start"),u=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=c,this.endSymbol=u;const p=aa.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),jm(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}WG(),xD();class jU extends gU{markerAnimate(t){jU._animate&&this._animationConfig&&jU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},jU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcLine"}getPointAttrByPosition(t){const{center:e,radius:i,startAngle:s,endAngle:n,label:r}=this.attribute,{refX:a=0,refY:o=0}=r;let l;switch(t){case fU.arcInnerStart:l=s;case fU.arcOuterStart:l=s;break;case fU.arcInnerEnd:l=n;case fU.arcOuterEnd:l=n;break;case fU.center:case fU.arcInnerMiddle:case fU.arcOuterMiddle:default:l=(s+n)/2}return{position:{x:e.x+(i+o)*Math.cos(l)+a*Math.cos(l-Math.PI/2),y:e.y+(i+o)*Math.sin(l)+a*Math.sin(l-Math.PI/2)},angle:l}}getTextStyle(t){return AU[t]}getRotateByAngle(t){var e;return t-Math.PI/2+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}createSegment(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;return new YU({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},Zk,null==o?void 0:o.line),startSymbol:E({},Zk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},Zk,null==o?void 0:o.lineEndSymbol)}})}setLineAttributes(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;this._line&&this._line.setAttributes({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},Zk,null==o?void 0:o.line),startSymbol:E({},Zk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},Zk,null==o?void 0:o.lineEndSymbol)}})}isValidPoints(){return!0}}jU.defaultAttributes=SU;class HU extends IU{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=zG(this._spec);return e||i?new jU(t):new CU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c,doCoordinatesProcess:u}=zG(e);let p=[],g={};const m={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||d||c){const t=CG(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:m}:{points:p.map((t=>Tt(m,t.radius,t.angle)))}}else u&&(p=PG(i,r,a),g={points:p.map((t=>Tt(m,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=zG(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}HU.type=r.polarMarkLine,HU.coordinateType="polar",p_(),cf(),ik();class zU extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},zU.defaultAttributes,t)),this.name="title"}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f;const{textType:v,text:b,subtextType:x,textStyle:S={},subtext:k,subtextStyle:A={},width:w,height:T,minWidth:L,maxWidth:C,minHeight:E,maxHeight:D,align:P,verticalAlign:O,padding:R=0}=this.attribute,B=yD(R),I=this.createOrUpdateChild("title-container",{x:B[3],y:B[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==S.visible){const{width:o,height:l,maxHeight:h,maxWidth:d,x:c=0,y:u=0,ellipsis:p=!0,wordBreak:g="break-word",maxWidth:m,lineClamp:_}=S;if("rich"===v||M(S.character)){const s=Object.assign({x:c,y:u,width:null!==(t=null!=o?o:w)&&void 0!==t?t:0,height:null!==(e=null!=l?l:T)&&void 0!==e?e:0,ellipsis:null==p||p,wordBreak:null!=g?g:"break-word",maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:null!==(i=S.character)&&void 0!==i?i:b},S);this._mainTitle=I.createOrUpdateChild("mainTitle",s,"richtext")}else if("html"===v){const t=Object.assign({html:Object.assign(Object.assign({dom:b},Jk),S),x:c,y:u,width:null!==(s=null!=o?o:w)&&void 0!==s?s:0,height:null!==(n=null!=l?l:T)&&void 0!==n?n:0,ellipsis:p,wordBreak:g,maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:[]},S);this._mainTitle=I.createOrUpdateChild("mainTitle",t,"richtext")}else M(b)&&(this._mainTitle=I.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:y(b)?b:[b],whiteSpace:"normal"},S),{maxLineWidth:null!==(a=null!==(r=S.maxLineWidth)&&void 0!==r?r:o)&&void 0!==a?a:w,heightLimit:null!=l?l:D,lineClamp:_,ellipsis:p,x:c,y:u}),"text"))}const F=this._mainTitle?this._mainTitle.AABBBounds.height():0,Y=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==A.visible){const{width:t,height:e,maxWidth:i,maxHeight:s,x:n=0,y:r=0,ellipsis:a=!0,wordBreak:g="break-word",lineClamp:m}=A,_=Math.max(Number.MIN_VALUE,D-F);if("rich"===x||M(A.character)){const d=Object.assign({x:n,y:r,width:null!==(o=null!=t?t:w)&&void 0!==o?o:0,height:null!==(l=null!=e?e:T)&&void 0!==l?l:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:null!==(h=A.character)&&void 0!==h?h:k},A);this._subTitle=I.createOrUpdateChild("subTitle",d,"richtext")}else if("html"===x){const o=Object.assign({html:Object.assign(Object.assign({dom:k},Jk),A),x:n,y:r,width:null!==(d=null!=t?t:w)&&void 0!==d?d:0,height:null!==(c=null!=e?e:T)&&void 0!==c?c:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:[]},A);this._subTitle=I.createOrUpdateChild("subTitle",o,"richtext")}else M(k)&&(this._subTitle=I.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:y(k)?k:[k],whiteSpace:"normal"},A),{maxLineWidth:null!==(u=A.maxLineWidth)&&void 0!==u?u:w,heightLimit:null!==(p=A.heightLimit)&&void 0!==p?p:_,lineClamp:m,ellipsis:a,x:0,y:F}),"text"))}const j=this._subTitle?this._subTitle.AABBBounds.height():0,H=this._subTitle?this._subTitle.AABBBounds.width():0;let z=Math.max(Y,H),N=F+(null!==(g=A.height)&&void 0!==g?g:j);if(M(w)&&(z=w),M(T)&&(N=T),M(L)&&zC&&(z=C),M(E)&&ND&&(N=D),I.attribute.width=z,I.attribute.height=N,I.attribute.boundsPadding=B,this._mainTitle){if(M(P)||M(S.align)){const t=S.align?S.align:P,e=null!==(m=S.width)&&void 0!==m?m:Y;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(M(O)||M(S.verticalAlign)){const t=S.verticalAlign?S.verticalAlign:O,e=S.height?S.height:N;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(M(P)||M(A.align)){const t=A.align?A.align:P,e=null!==(_=A.width)&&void 0!==_?_:H;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(M(O)||M(S.verticalAlign)){const t=A.verticalAlign?A.verticalAlign:O,e=F,i=null!==(f=A.height)&&void 0!==f?f:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}zU.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};class NU extends rD{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=Dy.Title,this.layoutLevel=Py.Title,this._orient="top",this._orient=tl(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return KT(t,this.specKey,r.title,(t=>!1!==t.visible))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}update(t){}resize(t){}afterSetLayoutStartPoint(t){Zo(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),Zo(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:Zo(t.width())?t.width():0,height:this._spec.height?this._spec.height:Zo(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o,l;const h=Math.max(0,null!==(t=this._spec.width)&&void 0!==t?t:this.getLayoutRect().width);return!1===this._spec.visible?{visible:!1}:Object.assign(Object.assign({},aD(this._spec,["padding"])),{textType:null!==(e=this._spec.textType)&&void 0!==e?e:"text",text:null!==(i=this._spec.text)&&void 0!==i?i:"",subtextType:null!==(s=this._spec.subtextType)&&void 0!==s?s:"text",subtext:null!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,width:h,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:this._spec.maxWidth,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(l=this._spec.verticalAlign)&&void 0!==l?l:"top",textStyle:Object.assign({width:h},this._spec.textStyle),subtextStyle:Object.assign({width:h},this._spec.subtextStyle)})}_createOrUpdateTitleComponent(t){if(this._titleComponent)Im(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new zU(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}}function VU(){WU._animate=oU}NU.type=r.title,NU.specKey=r.title,WG(),yk();class WU extends $G{markerAnimate(t){WU._animate&&this._animationConfig&&WU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},WU.defaultAttributes,t)),this.name="markArea",this.defaultUpdateAnimation=cU,this.defaultExitAnimation=pU}getPointAttrByPosition(t){const{x1:e,x2:i,y1:s,y2:n}=this._area.AABBBounds;return t.includes("left")||t.includes("Left")?{x:e,y:(s+n)/2}:t.includes("right")||t.includes("Right")?{x:i,y:(s+n)/2}:t.includes("top")||t.includes("Top")?{x:(e+i)/2,y:s}:t.includes("bottom")||t.includes("Bottom")?{x:(e+i)/2,y:n}:{x:(e+i)/2,y:(s+n)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=null!==(t=e.position)&&void 0!==t?t:"middle",s=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},s),{textStyle:Object.assign(Object.assign({},wU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;UG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{points:e,label:i,areaStyle:s,state:n}=this.attribute,r=aa.polygon(Object.assign({points:e},s));r.states=E({},Zk,null==n?void 0:n.area),r.name="mark-area-polygon",this._area=r,t.add(r);const a=new PD(Object.assign(Object.assign({},i),{state:{panel:E({},Zk,null==n?void 0:n.labelBackground),text:E({},Zk,null==n?void 0:n.label)}}));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i,state:s}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({points:t},i)),this._area.states=E({},Zk,null==s?void 0:s.area)),this._label&&this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},e),{state:{panel:E({},Zk,null==s?void 0:s.labelBackground),text:E({},Zk,null==s?void 0:s.label)}})),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach((t=>{Zo(t.x)&&Zo(t.y)||(e=!1)})),e}}WU.defaultAttributes=MU;class GU extends OU{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=Dy.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=NG(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c;const u=null!==(t=this._spec.label)&&void 0!==t?t:{},p={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:YG(WE(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:IG(u,this._markerData),state:{area:FG(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData),label:FG(null===(o=this._spec.label)||void 0===o?void 0:o.state,this._markerData),labelBackground:FG(null===(d=null===(h=null===(l=this._spec)||void 0===l?void 0:l.label)||void 0===h?void 0:h.labelBackground)||void 0===d?void 0:d.state,this._markerData)},animation:null!==(c=this._spec.animation)&&void 0!==c&&c,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(p)}_markerLayout(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=this._getRelativeDataView().latestData,c=r?r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData:d;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=BG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}this._markerComponent&&this._markerComponent.setAttributes(Object.assign(Object.assign({},h),{label:Object.assign(Object.assign({},null===(e=this._markerComponent.attribute)||void 0===e?void 0:e.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=null===(i=this._markerComponent.attribute)||void 0===i?void 0:i.label)||void 0===s?void 0:s.text}),limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=NG(t);if(!(e||i||s||n||r||a||o))return null;const{options:l}=this._computeOptions(),h=this._getRelativeDataView();Cp(this._option.dataSet,"markerAggregation",EU),Cp(this._option.dataSet,"markerFilter",BU);const d=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});d.parse([h],{type:"dataview"}),d.transform({type:"markerAggregation",options:l}),d.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),d.target.on("change",(()=>{this._markerLayout()})),this._markerData=d}}GU.specKey="markArea";class UU extends GU{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new WU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=NG(e),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],p=[];if(l){p=LG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){p=LG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=DG(i,r,c,e.coordinatesOffset):d&&(u=RG(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=NG(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}UU.type=r.markArea,UU.coordinateType="cartesian",WG(),Gx();class $U extends $G{markerAnimate(t){$U._animate&&this._animationConfig&&$U._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},$U.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcArea",this.defaultUpdateAnimation=cU,this.defaultExitAnimation=pU}getPointAttrByPosition(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,label:a}=this.attribute,{refX:o=0,refY:l=0}=a;let h,d;switch(t){case fU.center:h=(i+s)/2,d=(n+r)/2;break;case fU.arcInnerStart:h=i,d=n;break;case fU.arcOuterStart:h=s,d=n;break;case fU.arcInnerEnd:h=i,d=r;break;case fU.arcOuterEnd:h=s,d=r;break;case fU.arcInnerMiddle:h=i,d=(n+r)/2;break;case fU.arcOuterMiddle:h=s,d=(n+r)/2;break;default:h=i,d=(n+r)/2}return{position:{x:e.x+(h+l)*Math.cos(d)+o*Math.cos(d-Math.PI/2),y:e.y+(h+l)*Math.sin(d)+o*Math.sin(d-Math.PI/2)},angle:d}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,{position:i="arcInnerMiddle",autoRotate:s}=e,n=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},n.position),{angle:s?n.angle-Math.PI/2+(null!==(t=e.refAngle)&&void 0!==t?t:0):0,textStyle:Object.assign(Object.assign({},AU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;UG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,areaStyle:a,label:o,state:l}=this.attribute,h=aa.arc(Object.assign({x:e.x,y:e.y,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r},a));h.states=E({},Zk,null==l?void 0:l.area),h.name="polar-mark-area-area",this._area=h,t.add(h);const d=new PD(Object.assign(Object.assign({},o),{state:{panel:E({},Zk,null==l?void 0:l.labelBackground),text:E({},Zk,null==l?void 0:l.label)}}));d.name="mark-area-label",this._label=d,t.add(d),this.setLabelPos()}updateMarker(){const{center:t,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n,areaStyle:r,label:a,state:o}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({x:t.x,y:t.y,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n},r)),this._area.states=E({},Zk,null==o?void 0:o.area)),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},a),{state:{panel:E({},Zk,null==o?void 0:o.labelBackground),text:E({},Zk,null==o?void 0:o.label)}})),this.setLabelPos())}isValidPoints(){return!0}}$U.defaultAttributes=kU;class XU extends GU{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=NG(this._spec);return i||e||s?new $U(t):new WU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=NG(e),d=null!==(t=e.autoRange)&&void 0!==t&&t;let c,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=CG(i,s,n,r,d);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(c=PG(i,r,d),u={points:c.map((t=>Tt(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=NG(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}XU.type=r.polarMarkArea,XU.coordinateType="polar";class KU extends Cv{constructor(t){super(t)}}var qU,ZU;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(qU||(qU={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(ZU||(ZU={}));class JU extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},JU.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},JU.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},JU.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},JU.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},JU.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(s=this._forwardAttr.style.symbolType)&&void 0!==s?s:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{D(this._playController)&&(this._playController=new KU(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{D(this._backwardController)&&(this._backwardController=new KU(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{D(this._forwardController)&&(this._forwardController=new KU(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent(qU.OnPlay)},this.pause=()=>{this._dispatchEvent(qU.OnPause)},this.forward=()=>{this._dispatchEvent(qU.OnForward)},this.backward=()=>{this._dispatchEvent(qU.OnBackward)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}JU.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},JU.defaultAttributes={[ZU.Start]:{},[ZU.Pause]:{},[ZU.Backward]:{},[ZU.Forward]:{}};const QU={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},t$=[200,10];var e$,i$;(i$=e$||(e$={})).Default="default",i$.Reverse="reverse";const s$=t=>"top"===t||"bottom"===t;class n$ extends Bk{getMinIndex(){return this._minIndex}getMaxIndex(){return this._maxIndex}getDataIndex(){return this._dataIndex}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},n$.defaultAttributes,t)),this._data=[],this._dataIndex=0,this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e;let i;Zo(this._handlerStyle.size)?i=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(i=ut(this._handlerStyle.size[0],this._handlerStyle.size[1]));const s={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:this._dataIndex,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:Zo(i)?i:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(s$(this._orient)){const e=Math.max(0,this._layoutInfo.slider.size),i=null!==(t=this._railStyle.height)&&void 0!==t?t:t$[1];s.layout="horizontal",s.railHeight=i,s.railWidth=e,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.width)&&void 0!==e?e:t$[1];s.layout="vertical",s.railWidth=i,s.railHeight=t,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}return s},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new uW(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return t.layout=s$(this._orient)?"horizontal":"vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new JU(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initDataIndex(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initDataIndex(){var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0}_initLayoutInfo(){var t,e,i;const s=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=s.filter((t=>"end"!==t.position)),r=s.filter((t=>"end"===t.position)),a=null!==(t=s$(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:t$[1],o=s.reduce(((t,e)=>{const i=e.style.size,s=h(i)?i:ut(i[0],i[1]);return t+e.space+s}),0),l=this._sliderVisible?(s$(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(i=this._size)||void 0===i?void 0:i.height)-o:0,d=l-this.attribute.slider.space,c=n.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:s$(this._orient)?t+s:(this._size.width-r)/2,y:s$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:d,x:s$(this._orient)?c+this.attribute.slider.space:(this._size.width-a)/2,y:s$(this._orient)?(this._size.height-a)/2:c+this.attribute.slider.space}),r.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:s$(this._orient)?t+s:(this._size.width-r)/2,y:s$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),c+l)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}var r$;function a$(){XV(),p_(),Uv()}n$.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},QU),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},QU),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},QU),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},QU),{key:"backward",position:"start"})}},function(t){t.change="change",t.play="play",t.pause="pause",t.backward="backward",t.forward="forward",t.end="end",t.OnChange="change",t.OnPlay="play",t.OnPause="pause",t.OnBackward="backward",t.OnForward="forward",t.OnEnd="end"}(r$||(r$={})),a$();class o$ extends n${constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i;super._initAttributes(),this._alternate=null!==(t=this.attribute.alternate)&&void 0!==t&&t,this._interval=null!==(e=this.attribute.interval)&&void 0!==e?e:1e3,this._direction=null!==(i=this.attribute.direction)&&void 0!==i?i:e$.Default},this._initDataIndex=()=>{var t;this._dataIndex=D(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(qU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(qU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(qU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(qU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{const e=Math.floor(t.detail.value)+.5;this._dataIndex=t.detail.value>=e?Math.ceil(t.detail.value):Math.floor(t.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(r$.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,((({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,maxIndex:e,dataIndex:i})=>t===e$.Default&&i===e)({direction:t,maxIndex:e,dataIndex:s})||(({direction:t,minIndex:e,dataIndex:i})=>t===e$.Reverse&&i===e)({direction:t,minIndex:i,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||(({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,minIndex:e,dataIndex:i})=>t===e$.Default&&i===e)({direction:t,minIndex:i,dataIndex:s})||(({direction:t,maxIndex:e,dataIndex:i})=>t===e$.Reverse&&i===e)({direction:t,maxIndex:e,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===e$.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(r$.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=No.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{const e=Date.now();if(this._isReachEnd&&e-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(r$.change),this._activeIndex=this._dataIndex):e-this._tickTime>=this._interval&&(this._tickTime=e,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(r$.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=No.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),No.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(r$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,No.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.pause))},this.backward=()=>{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex-1{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex+1>this._maxIndex?this._minIndex:this._dataIndex+1:Math.min(this._dataIndex+1,this._maxIndex),this._updateDataIndex(e),this.dispatchCustomEvent(r$.change),this.dispatchCustomEvent(r$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}a$();class l$ extends n${constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3;const e=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=e?e:1)):(this._totalDuration=this._interval*e,this._interval=this.attribute.interval)},this._initDataIndex=()=>{var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:this._minIndex},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(qU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(qU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(qU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(qU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{const e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(r$.change))},this.play=()=>{return t=this,e=void 0,s=function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(r$.play),this._rafId=No.getRequestAnimationFrame()(this._play.bind(this)))},new((i=void 0)||(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())}));var t,e,i,s},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=No.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,No.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,No.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.pause))},this.backward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed-e;i<=0?(this._elapsed=0,this._startTime=t):(this._elapsed=i,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(r$.backward)},this.forward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed+e;i>=this._totalDuration?(this._startTime=t-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-e,this._elapsed=i),this._updateSlider(),this.dispatchCustomEvent(r$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}const h$=t=>WE(Object.assign({},t)),d$=t=>Object.assign(Object.assign({},t),{style:Object.assign({},WE(t.style))}),c$=t=>{var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;const _=h$(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),f=h$(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),v=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},WE(Object.assign({},k))),y=d$(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=d$(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==d?d:{}),x=d$(null!==(u=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==u?u:{}),S=d$(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),M=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(m=t.orient)&&void 0!==m?m:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:_,railStyle:f,handlerStyle:v}),controller:Object.assign(Object.assign({},t.controller),{start:y,pause:b,backward:x,forward:S})});var k;return t.visible||(M.controller.visible=!1,M.slider.visible=!1),M},u$=t=>"left"===t||"right"===t,p$=t=>"top"===t||"bottom"===t;class g$ extends rD{constructor(){super(...arguments),this.layoutZIndex=Dy.Player,this.layoutLevel=Py.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},c$(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},c$(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?Im(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new o$(t):this._playerComponent=new l$(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Fa(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Fa(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Fa(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Fa(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=u$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=u$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,d=Math.max(...Fa(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Fa(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Fa(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Fa(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=d?h-d:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(zd.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&this._playerComponent.play()})),this._playerComponent.addEventListener(r$.end,(()=>{var t;this.event.emit(zd.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(r$.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(r$.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),Zo(t.x)){const e=u$(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(Zo(t.y)){const e=p$(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}changeRegions(t){}onRender(t){}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return h(this._spec.width)?Math.min(t.width,Number(this._spec.width)):u$(this._orient)?this._maxSize():t.width}_computeHeight(t){return h(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):p$(this._orient)?this._maxSize():t.height}_computeDx(t){return u$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return p$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];Fa(e.data).forEach((t=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.globalInstance)||void 0===i||i.updateData(t.id,t.values)})),this.event.emit(zd.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}}g$.specKey="player",g$.type=r.player;class m$ extends Bk{constructor(t,e){const{dataLabels:i}=t,s=function(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{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}m$.defaultAttributes={pickable:!1};class _$ extends i_{constructor(t,e){super(t,tc.label,e),this.spec.componentType=tc.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){const t=Fa(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t));this.detach(t)}if(this.spec.target=t,t){const e=Fa(t).map((t=>S(t)?this.view.getMarkById(t):t));this.attach(e)}return this.commit(),this}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=Fa(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t)),h=null===(r=null===(n=this.group)||void 0===n?void 0:n.getGroupGraphicItem)||void 0===r?void 0:r.call(n);let d=Up(this.spec.size,i);d||(d=h?{width:null!==(a=h.attribute.width)&&void 0!==a?a:h.AABBBounds.width(),height:null!==(o=h.attribute.height)&&void 0!==o?o:h.AABBBounds.height()}:{width:1/0,height:1/0});const c=this.spec.skipTheme?null:this.view.getCurrentTheme();return((t,e,i,s,n,r={})=>{var a;const o=null===(a=r.components)||void 0===a?void 0:a.dataLabel,l=t.map(((t,e)=>{var a,o,l,h,d;const c=Object.assign(Object.assign({},n),{labelIndex:e}),u=null!==(a=Up(s,c,t))&&void 0!==a?a:{},{components:p={}}=r;let g={};switch(t.markType){case Qd.line:case Qd.area:g="line"===u.type?p.lineLabel:"area"===u.type?p.areaLabel:p.lineDataLabel;break;case Qd.rect:case Qd.rect3d:case Qd.interval:g=p.rectLabel;break;case Qd.symbol:case Qd.circle:case Qd.cell:g=p.symbolLabel;break;case Qd.arc:case Qd.arc3d:g=p.arcLabel;break;case Qd.polygon:case Qd.path:default:g=p.pointLabel}const m=null!==(o=u.data)&&void 0!==o?o:[],_=null!==(h=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l[0])&&void 0!==h?h:{};if(m&&m.length>0)m.forEach(((e,s)=>{if(t.elements[s]){const n=Om(i,e,t.elements[s],c);E(e,_,n)}}));else{const e=(t,e)=>{const{data:i}=t,s=function(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{if("willRelease"!==s.getGraphicItem().releaseStatus)if(t.isCollectionMark())s.getDatum().forEach((t=>{const n=Om(i,t,s,c);m.push(e(n,_))}));else{const t=Om(i,s.getDatum(),s,c);m.push(e(t,_))}}))}const f=E({},g,{baseMarkGroupName:null===(d=t.graphicItem)||void 0===d?void 0:d.name,getBaseMarks:()=>t.elements.map((t=>t.getGraphicItem()))},null!=u?u:{});return f.data=null!=m?m:g.data,f})).filter((t=>!D(t))),h=E({},o,{size:e});return h.dataLabels=l,h})(l,d,s,this.spec.labelStyle,i,c)}}),e}),{});this._encoders=e}}_$.componentType=tc.label;const f$=()=>{fc.registerGraphicComponent(tc.label,(t=>new m$(t))),fc.registerComponent(tc.label,_$)};class v$ extends rD{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=Dy.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,Im(e,t)||(i.reMake=!0),i}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}}v$.type=r.label;class y$ extends TF{constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}}y$.type="text",y$.constructorType="label";const b$=()=>{Xl.registerMark(y$.constructorType,y$),UA()};class x$ extends nD{_initTheme(t,e){return{spec:t,theme:this._theme}}}class S$ extends v${constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=x$,this.layoutZIndex=Dy.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initTextMarkStyle()}initEvent(){this.event.on(zd.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.disableAnimation()})),this.event.on(hc.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.enableAnimation()})),this.event.off(hc.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),AE(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n{if(e.visible){const n=this._labelInfoMap.get(s),o=this._createMark({type:"label",name:`${r}-label-${i}`},{noSeparateStyle:!0,attributeContext:t.getMarkAttributeContext()});o.setTarget(a),n.push({labelMark:o,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){this._labelInfoMap.forEach(((t,e)=>{if("region"===this._layoutRule){const i=this._createMark({type:"component",name:`${e.getGroupMark().name}-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});i&&(i.setSkipBeforeLayouted(!0),t[0]&&M(t[0].labelSpec.zIndex)&&i.setZIndex(t[0].labelSpec.zIndex),this._marks.addMark(i),this._labelComponentMap.set(i,(()=>this._labelInfoMap.get(e))))}else t.forEach(((t,i)=>{const s=this._createMark({type:"component",name:`${t.labelMark.name}-component`},{componentType:"label",noSeparateStyle:!0,support3d:t.baseMark.getSupport3d()});s&&(M(t.labelSpec.zIndex)&&s.setZIndex(t.labelSpec.zIndex),s.setSkipBeforeLayouted(!0),this._marks.addMark(s),this._labelComponentMap.set(s,(()=>this._labelInfoMap.get(e)[i])),t.labelMark.setComponent(s))}))}))}_initTextMarkStyle(){this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n,void 0),xs(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",Oy.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();y(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e.getProduct(),t.map((({baseMark:t})=>t.getProduct())),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e.getProduct(),i.getProduct(),[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.target(e).configure({interactive:!1}).depend(s.map((t=>t.getMarks()[0].getProduct()))).labelStyle(((t,e)=>{var n,r;const a=i[e.labelIndex];if(a){const{labelSpec:t,labelMark:e,series:i}=a,o=e.getRule(),l=this._interactiveConfig(t),h=null!==(r=null===(n=this._spec)||void 0===n?void 0:n.centerOffset)&&void 0!==r?r:0;let d=Ll({textStyle:Object.assign({pickable:!0===t.interactive},t.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},function(t,e){var i;const{labelSpec:s}=e;s.overlap&&!bs(s.overlap)&&(s.overlap={});const n=null!==(i=Wz[t])&&void 0!==i?i:Wz.point;return e.series.type===fl.sankey?function(t){var e,i,s;const{series:n,labelSpec:r={}}=t,a=null!==(e=Uz(r.position))&&void 0!==e?e:"outside",o=n.direction;let l,h=a;return S(a)&&("vertical"===o?h="inside-start"===a?t=>"inside-left":"inside-middle"===a?t=>"center":"inside-end"===a?t=>"inside-right":t=>"bottom":"inside-start"===a?h=t=>"inside-left":"inside-middle"===a?h=t=>"center":"inside-end"===a?h=t=>"inside-right":"outside"===a&&(h=t=>"right")),l=!1!==r.overlap&&(!S(a)||!a.includes("inside"))&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:Qz(n)},{position:h,overlap:l,smartInvert:!1,offset:0,syncState:!0}}(e):n(e)}(o,a),Object.assign(Object.assign(Object.assign({},aD(t,["position","style","state","type","stackDataFilterType","getStyleHandler"])),l),{centerOffset:h}),t.stackDataFilterType?{dataFilter:"min"===t.stackDataFilterType?t=>t.filter((t=>t.data[OT])):t=>t.filter((t=>t.data[PT]))}:{});return i&&i.parseLabelStyle&&(d=i.parseLabelStyle(d,t,e)),"line"!==o&&"area"!==o||(d.type=o),d}})).encode(((t,e,s)=>{if(i[s.labelIndex]){const{labelSpec:e,labelMark:n}=i[s.labelIndex];return n.skipEncode?{data:t}:Gz(i[s.labelIndex],t,e.formatMethod,e.formatter)}})).size((()=>i[0].series.getRegion().getLayoutRect()))}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=y(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i,context:{model:this,labelInfo:e}})}))}getVRenderComponents(){const t=[];return this._labelComponentMap.forEach(((e,i)=>{const s=i.getProduct().getGroupGraphicItem();s&&t.push(s)})),t}}S$.type=r.label,S$.specKey="label",S$.transformerConstructor=x$;class M$ extends v${constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=Dy.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[ET]},"normal",Oy.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){const t=this._getSeries(),e=this._createMark({type:"component",name:`${t.name}-total-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});e&&this._marks.addMark(e)}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.getProduct().target(this._baseMark.getProduct()).configure({interactive:!1}).labelStyle((()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r}=this._spec,a=this._interactiveConfig(this._spec);return Ll({textStyle:{pickable:!0===this._spec.interactive},position:k$(t,this._baseMark.type),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>t.data[PT]))},a))}})).encode((e=>Gz({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod))).size((()=>this._regions[0].getLayoutRect()))}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getProduct().getGroupGraphicItem();i&&t.push(i)})),t}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function k$(t,e){var i,s;let n;const{direction:r}=t,a={vertical:["top","bottom"],horizontal:["right","left"]},o=("horizontal"===r?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?1:0;switch(e){case"rect":case"symbol":n=a[r][o];break;default:n="top"}return n}M$.type=r.totalLabel,M$.specKey="totalLabel";const A$=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function w$(){T$._animate=hU}WG(),bD(),xD(),Uv(),qS(),dM();class T$ extends $G{markerAnimate(t){T$._animate&&this._animationConfig&&T$._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},T$.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=uU,this.defaultExitAnimation=pU,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return Gk(Math.abs(s),Math.PI/2,yU)||Gk(Math.abs(s),3*Math.PI/2,yU)?Uk(t,s,n):Wk(s)?TU.postiveXAxis[n]:TU.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:d=0,textStyle:c={},richTextStyle:u={},imageStyle:p={},position:g=vU.middle}=e,{state:m}=this.attribute,_=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(_)+h*Math.cos(_-Math.PI/2),v=l*Math.sin(_)+h*Math.sin(_-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},c),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,_,null!==(a=e.position)&&void 0!==a?a:"end")),c.textStyle),state:{panel:E({},Zk,null==m?void 0:m.textBackground),text:E({},Zk,null==m?void 0:m.text)}}))}else"richText"===n?(t.setAttributes({dx:this.getItemDx(t,g,u)+(u.dx||0),dy:this.getItemDy(t,g,u)+(u.dy||0)}),t.states=E({},Zk,null==m?void 0:m.richText)):"image"===n&&(t.setAttributes({dx:this.getItemDx(t,g,p)+(p.dx||0),dy:this.getItemDy(t,g,p)+(p.dy||0)}),t.states=E({},Zk,null==m?void 0:m.image));const y=Wk(_)?_:_-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(v||0),angle:o&&y+d})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(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,i){const{state:s}=this.attribute,{type:n="text",symbolStyle:r,richTextStyle:a,imageStyle:o,renderCustomCallback:l}=t;let h;return"symbol"===n?(h=aa.symbol(Object.assign(Object.assign({},i),r)),h.states=E({},Zk,null==s?void 0:s.symbol)):"text"===n?h=new PD(Object.assign(Object.assign({},i),{state:{panel:E({},Zk,null==s?void 0:s.textBackground),text:E({},Zk,null==s?void 0:s.text)}})):"richText"===n?(h=aa.richtext(Object.assign(Object.assign({},i),a)),h.states=E({},Zk,null==s?void 0:s.richText)):"image"===n?(h=aa.image(Object.assign(Object.assign({},i),o)),h.states=E({},Zk,null==s?void 0:s.image)):"custom"===n&&l&&(h=l(),h.states=E({},Zk,null==s?void 0:s.customMark)),h.name=`mark-point-${n}`,this.setItemAttributes(h,t,e,i,n),h}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,d=i.x-e.x,c=i.y-e.y;if(this._isStraightLine=Gk(d,0,yU)||Gk(c,0,yU),this._isArcLine){const{x:t,y:s}=e,{x:l,y:d}=i,c=(t+l)/2,u=c+h*(d>s?-1:1)*c,p=(s===d?0:-(t-l)/(s-d))*(u-c)+(s+d)/2;a=A$(s-p,t-u),o=A$(d-p,l-u),n={x:u,y:p},h>0?o{this._markerLayout()})),this._markerData=r}}C$.specKey="markPoint";class E$ extends C${constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._relativeSeries,n="x"in e&&"y"in e,r="coordinate"in e,a="position"in e,o=null!==(t=null==e?void 0:e.autoRange)&&void 0!==t&&t;let l;return n?l=LG(i,s,s,s,o)[0][0]:r?l=DG(i,s,o,e.coordinatesOffset)[0]:a&&(l=RG(e.position,s,e.regionRelative)[0]),{point:l}}_computeOptions(){const t=this._spec,{doXYProcess:e}=VG(t),i=M(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}E$.type=r.markPoint,E$.coordinateType="cartesian";class D$ extends C${constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=CG(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:Tt({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}D$.type=r.polarMarkPoint,D$.coordinateType="polar";class P$ extends C${constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:EG(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}P$.type=r.geoMarkPoint,P$.coordinateType="geo";const O$=1e-8;function R$(t,e,i,s,n){for(let r=0,a=n[n.length-1];re&&r>s||rn?o:0}function F$(t,e){return Math.abs(t-e)0&&R$(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}var j$;!function(t){t.drawStart="drawStart",t.drawEnd="drawEnd",t.drawing="drawing",t.moving="moving",t.moveStart="moveStart",t.moveEnd="moveEnd",t.brushClear="brushClear"}(j$||(j$={}));const H$={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},z$=5,N$={debounce:Kd,throttle:qd};p_(),yk();class V$ extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},V$.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||((this._activeDrawState||this._activeMoveState)&&t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:N$[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{var e;if(!this._activeDrawState&&!this._activeMoveState)return;t.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?((null===(e=this._operatingMask)||void 0===e?void 0:e._AABBBounds.empty())&&this._dispatchEvent(j$.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={}):(this._activeDrawState&&this._dispatchEvent(j$.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._activeMoveState&&this._dispatchEvent(j$.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{trigger:t=H$.trigger,updateTrigger:e=H$.updateTrigger,endTrigger:i=H$.endTrigger,resetTrigger:s=H$.resetTrigger}=this.attribute;this.stage.addEventListener(t,this._onBrushStart),this.stage.addEventListener(e,this._onBrushingWithDelay),this.stage.addEventListener(i,this._onBrushEnd),this.stage.addEventListener(s,this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t({x:t.x+n,y:t.y+r}))),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_initDraw(t){const{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,"single"===e&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(j$.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(i=this._operatingMask.attribute.dy)&&void 0!==i?i:0;const{interactiveRange:s}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:a=-1/0,maxX:o=1/0}=s,{x1:l,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,u=a-l,p=o-h,g=n-d,m=r-c;this._operatingMaskMoveRangeX=[u,p],this._operatingMaskMoveRangeY=[g,m],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(j$.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;const s=this.eventPosToStagePos(t),{sizeThreshold:n=z$,brushType:r}=this.attribute,a=this._cacheDrawPoints.length;if(a>0){const t=null!==(e=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==e?e:{};if(s.x===t.x&&s.y===t.y)return}"polygon"===r||a<=1?this._cacheDrawPoints.push(s):this._cacheDrawPoints[a-1]=s;const o=this._computeMaskPoints();this._operatingMask.setAttribute("points",o);const{x1:l=0,x2:h=0,y1:d=0,y2:c=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds;this._isDrawedBeforeEnd=!this._operatingMask._AABBBounds.empty()&&!!(Math.abs(h-l)>n||Math.abs(d-c)>n),this._isDrawedBeforeEnd&&(this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(j$.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}))}_moving(t){const e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(null==e?void 0:e.x)&&i.y===(null==e?void 0:e.y))return;const s=i.x-e.x,n=i.y-e.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],s))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(j$.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute;let s=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return s="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:i[0]},{x:r.x,y:i[0]},{x:r.x,y:i[1]},{x:n.x,y:i[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:k(this._cacheDrawPoints),s}_addBrushMask(){var t;const{brushStyle:e,hasMask:i}=this.attribute,s=aa.polygon(Object.assign(Object.assign({points:k(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!==(t=e.opacity)&&void 0!==t?t:1:0}));s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:n=-1/0,maxX:r=1/0}=e,a=this.eventPosToStagePos(t);return a.x>r||a.xs||a.y{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",Oy.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",Oy.Series))}))}))}static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>!1!==t.visible))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_extendDataInBrush(t){const e=[];for(const i in t)for(const s in t[i])e.push(Object.assign({},t[i][s].data[0]));return e}_extendDatumOutOfBrush(t){var e;const i=[];for(const s in t)i.push(null===(e=t[s].data)||void 0===e?void 0:e[0]);return i}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_updateBrushComponent(t,e){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild(),this._needInitOutState=!0}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new V$(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:WE(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r);const{brushMode:a="single"}=this._spec;this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(j$.drawStart,(e=>{this._emitEvent(zd.brushStart,t)})),r.addEventListener(j$.moveStart,(e=>{this._emitEvent(zd.brushStart,t)})),r.addEventListener(j$.drawing,(i=>{this._needInitOutState&&"single"===a&&this._initMarkBrushState(e,"outOfBrush"),this._needInitOutState=!1,this._needDisablePickable=!0,this._handleBrushChange(zd.brushChange,t,i),this._emitEvent(zd.brushChange,t)})),r.addEventListener(j$.moving,(e=>{this._handleBrushChange(zd.brushChange,t,e),this._emitEvent(zd.brushChange,t)})),r.addEventListener(j$.brushClear,(i=>{this._initMarkBrushState(e,""),this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(zd.brushChange,t,i),this._handleBrushChange(zd.brushClear,t,i),this._emitEvent(zd.brushChange,t),this._emitEvent(zd.brushClear,t)})),r.addEventListener(j$.drawEnd,(e=>{this._needInitOutState=!0,this._needDisablePickable=!1;const{operateMask:i}=e.detail;this._handleBrushChange(zd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(zd.brushEnd,t)})),r.addEventListener(j$.moveEnd,(e=>{const{operateMask:i}=e.detail;this._handleBrushChange(zd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(zd.brushEnd,t)}))}_handleBrushChange(t,e,i){const{operateMask:s}=i.detail;this._reconfigItem(s,e),this._reconfigLinkedItem(s,e)}_emitEvent(t,e){this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord}})}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},WE(t)),e)}_reconfigItem(t,e){this._itemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,n,r;const a=i.getGraphicItem(),o=e.id+"_"+i.key;(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[o])&&this._isBrushContainItem(t,a)?(i.addState("inBrush"),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][o]=i,delete this._outOfBrushElementsMap[o]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[o])&&!this._isBrushContainItem(t,a)&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._outOfBrushElementsMap[o]=i,delete this._inBrushElementsMap[t.name][o]),a.setAttribute("pickable",!this._needDisablePickable)}))}))}_reconfigLinkedItem(t,e){const i=e.getLayoutStartPoint(),s=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{if(!s.includes(e.id)){const s=e.getRegion().getLayoutStartPoint(),n=s.x-i.x,r=s.y-i.y;this._linkedItemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,a,o;const l=i.getGraphicItem(),h=e.id+"_"+i.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[h])&&this._isBrushContainItem(t,l,{dx:n,dy:r})?(i.addState("inBrush"),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][h]=i,delete this._linkedOutOfBrushElementsMap[h]):(null===(o=null===(a=this._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[h])&&!this._isBrushContainItem(t,l,{dx:n,dy:r})&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._linkedOutOfBrushElementsMap[h]=i),l.setAttribute("pickable",!this._needDisablePickable)}))}))}}))}_isBrushContainItem(t,e,i){var s,n,r;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points))return!1;const a=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],{a:o,b:l,c:h,d,e:c,f:u}=t.globalTransMatrix,p=(null==i?void 0:i.dx)||0,g=(null==i?void 0:i.dy)||0,m=a.map((t=>({x:o*t.x+h*t.y+c+p,y:l*t.x+d*t.y+u+g})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+p,t.globalAABBBounds.y1+g,t.globalAABBBounds.x2+p,t.globalAABBBounds.y2+g);const _=e.globalTransMatrix.e,f=e.globalTransMatrix.f;let v=[];if("symbol"===e.type){const{size:t=0}=null==e?void 0:e.attribute,i=Fa(t)[0]/2;return v=[{x:_-i,y:f-i},{x:_+i,y:f-i},{x:_+i,y:f+i},{x:_-i,y:f+i}],Y$(m,v)}if("rect"===e.type){const{x1:t,x2:i,y1:s,y2:n}=null==e?void 0:e.AABBBounds,r=Math.abs(t-i),a=Math.abs(s-n);return v=[{x:_,y:f},{x:_+r,y:f},{x:_+r,y:f+a},{x:_,y:f+a}],Y$(m,v)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:d}=s,c=r?"x":"y",u=r?o:h,p=r?l:d;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[c]),r=s.getScale().invert(p-e.getLayoutStartPoint()[c]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),d=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,d),Math.max(h,d),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:d})}else{const i=t.getScale().range(),s=null!==(n=t.getScale().rangeFactor())&&void 0!==n?n:[0,1],r=Ya(i){this._releatedAxes.push(this._option.getComponentByUserId(t))})):M(this._spec.axisIndex)?Fa(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Fa(t).includes(n.userId.toString())||e&&Fa(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._option.getAllSeries().forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{const i=t.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{const s=t.id+"_"+i.key;i.removeState("inBrush"),i.removeState("outOfBrush"),i.addState(e),this._outOfBrushElementsMap[s]=i,this._linkedOutOfBrushElementsMap[s]=i}))}))}))}initEvent(){}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return this._brushComponents}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(t){var e;super.onLayoutEnd(t),this._option.disableTriggerEvent||(null===(e=this._spec.visible)||void 0===e||e)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach((e=>{e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}W$.type=r.brush,W$.specKey="brush";class G$ extends rD{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=Dy.CustomMark,this.layoutLevel=Py.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;const t=this._option&&this._option.getAllSeries(),e=!1!==this._option.animation,i=[];t&&t.length&&t.forEach((t=>{const e=t&&t.getMarksWithoutRoot();e&&e.length&&e.forEach((t=>{i.push(t)}))})),this._createExtensionMark(this._spec,null,`${nh}_series_${this.id}_extensionMark`,0,{depend:i,hasAnimation:e})}_createExtensionMark(t,e,i,s=0,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation&&t.animation){const e=HC({},zC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(n.depend&&n.depend.length&&a.setDepend(...n.depend),D(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}))),M(t.dataId)||Zo(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}onRender(t){}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Kt).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Kt;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.getBounds())})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}}let U$,$$,X$,K$;function q$(t){return U$=1/0,$$=1/0,X$=-1/0,K$=-1/0,t.forEach((t=>{U$>t.x&&(U$=t.x),X$t.y&&($$=t.y),K$({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function J$(t,e,i,s={}){const n=At(t[0]),r=At(t[1]),a=At(i),o=function(t,e){void 0===e&&(e="kilometers");var i=rp[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,s.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:wt(n+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:wt(l)}}function Q$(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 tX(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function eX(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:tX(t.rect),anchorCandidates:aX(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>Q$(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;tQ$(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function iX(t){return t>180?t-360:t}function sX(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function nX(t,e){for(let i=0;i{const{x:r,y:a}=rX(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}G$.type=r.customMark,G$.specKey="customMark";class oX extends rD{constructor(){super(...arguments),this.type=r.mapLabel,this.name=r.mapLabel,this.specKey="mapLabel",this.layoutType="none",this.layoutZIndex=Dy.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return KT(t,this.specKey,this.type,(t=>t.visible&&M(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;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===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,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===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.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 e=t.getViewData();if(e){const t=new R(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:zp.copyDataView},!1),this._data=new gx(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){var t;this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handleZoom(t),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const e=this._spec.trigger;if("none"===e)return;const i=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();i&&("hover"===e?(i.addEventListener("element-highlight:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("element-highlight:reset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(null)}))):"click"===e&&(i.addEventListener("element-select:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("elementSelectReset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(t){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?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 s=new T$({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{t.removeAllChild();const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;let g=0,m=0,_=0,f=0,v=0;const y=this._spec.position||"top",b=this._spec.offset,x=nl(null===(i=this._spec.background)||void 0===i?void 0:i.padding),S=this._spec.space||0;m+=((null==x?void 0:x.left)||0)+((null==x?void 0:x.right)||0),_+=((null==x?void 0:x.top)||0)+((null==x?void 0:x.bottom)||0);const k={},A=this.dataToPosition(t),w=ir({});if(w.name=`${this.name}_marker_itemContainer_${e}`,k.container=w,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=qv(WE(Object.assign({},this._spec.background.style)));t.setAttributes(A),k.labelBackground=t,w.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=Ev(WE(Object.assign({},this._spec.icon.style)));t.setAttributes(A),t.setAttribute("symbolType",null===(r=this._spec.icon.style)||void 0===r?void 0:r.shape);const e=t.AABBBounds,i=null!==(a=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==a?a:0,s=null!==(o=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==o?o:0;k.icon=t,w.appendChild(t),v=i,f+=s,g++}if(null===(l=this._spec.nameLabel)||void 0===l?void 0:l.visible){const e=f_(WE(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(h=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==h?h:0,n=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;k.nameLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}if((null===(c=this._spec.valueLabel)||void 0===c?void 0:c.visible)&&M(t[this.valueField])){const e=f_(WE(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(u=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==u?u:0,n=null!==(p=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==p?p:0;k.valueLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}const T=Object.values(k).find((t=>!!t&&"group"!==t.type)),L={x:null==T?void 0:T.getComputedAttribute("x"),y:null==T?void 0:T.getComputedAttribute("y")},C={x:L.x,y:L.y,width:0,height:0};C.width=m+f+(g-1)*S,C.height=_+v;const E={rect:C,point:L,index:e};if("outer"!==y){const t=["top","right","left","bottom"].filter((t=>t!==y));E.rect=rX(C,y,b),E.anchors=t,E.offset=b}else E.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:E,contentMarks:k}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:g}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=p)}})),null==h||h.setAttributes({x:0,y:0,width:c.width,height:c.height}),null==d||d.setAttributes({dx:-c.width/2,dy:-c.height/2});const _=this._data.getLatestData()[r],f=this.dataToPosition(_),v=this.getRegions()[0].getLayoutStartPoint(),y=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:v.x,y:v.y,position:f,visible:this._activeDatum.includes(_),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:c.x+c.width/2-f.x,offsetY:c.y+c.height/2-f.y},itemLine:{visible:y,type:"type-po",lineStyle:WE(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;tt.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=q$(s),l=i([(n+r)/2,(a+o)/2]);return l?eX(t.map((t=>{const s=t.rect,n=nX(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=J$(r,s,i);if(!nX(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],iX(sX(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=iX(sX(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=rX(t.rect,a,0),t}))):[]}(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):eX(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){return(null==t?void 0:t.id)===this._series.id}onRender(t){}changeRegions(){}_getNeedClearVRenderComponents(){return this._markerComponents}}oX.type=r.mapLabel,oX.specKey="mapLabel";class lX{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(Zo(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:xs(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;te.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>hX(t))),a=n.filter((t=>!hX(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>hX(t))),h=o.filter((t=>!hX(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);Zo(h.width)||(h.width=l.width),Zo(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function hX(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}lX.type="grid";class dX extends tb{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},r=e.filter((t=>"absolute"===t.layoutType)),a=r.filter((t=>"z"===t.layoutOrient));let o={width:0,height:0};a.length&&(o=a[0].getLayoutRect()),this.leftCurrent+=o.width/8,this.rightCurrent-=o.width/8,this.topCurrent+=o.height/8,this.bottomCurrent-=o.height/8;const{regionItems:l,relativeItems:h,relativeOverlapItems:d,allRelatives:c,overlapItems:u}=this._groupItems(e);this.layoutRegionItems(l,h,d,u),this._processAutoIndent(l,h,d,u,c,n);const p=r.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(p);const g=h.filter((t=>"axes"===t.model.specKey&&Ad(t.layoutOrient)))[0],m=h.filter((t=>"axes"===t.model.specKey&&wd(t.layoutOrient)))[0];if(g&&a.length){const t=g.getLayoutStartPoint(),e=g.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};a[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=g.getLayoutRect(),n=m.getLayoutRect(),r={length:a[0].getLayoutRect().width,width:s.width,height:n.height};g.model.setLayout3dBox&&g.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),a[0].model.setLayout3dBox&&a[0].model.setLayout3dBox(r),this.layoutZAxisItems(a,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{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,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}dX.type="layout3d";const cX=new qt;p_(),cf(),Uv(),fy();class uX extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},uX.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,s,n,r,a,o;const{titleStyle:l={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:p=0,maxWidth:g=1/0,padding:m=4,maxWidthPercent:_,visible:f,state:b,dx:x=0,dy:S=0}=this.attribute;let{title:k="",content:A=""}=this.attribute;k=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(k):k,A=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(A):A;const w=yD(m),T=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),L=g-w[1]-w[3],C=M(k)&&!1!==f,E=Object.assign(Object.assign({text:y(k)?k:[k],visible:C,wrap:!0},l),{x:w[3],y:w[0],maxLineWidth:L,textAlign:"left",textBaseline:"top"}),D=T.createOrUpdateChild("poptip-title",E,"text");jm(null==b?void 0:b.title)||(D.states=b.title);const P=D.AABBBounds,O=P.height(),R=P.width();let B=O+u;C||(B=0);const I=M(A)&&!1!==f,F=Object.assign(Object.assign({text:y(A)?A:[A],visible:I,wrap:!0},d),{x:w[3],y:w[0]+B,maxLineWidth:L,textAlign:"left",textBaseline:"top"}),Y=T.createOrUpdateChild("poptip-content",F,"text");jm(null==b?void 0:b.content)||(Y.states=b.content);const j=Y.AABBBounds,H=j.height(),z=j.width();I&&(B+=H);let N=ut(R+w[1]+w[3],z+w[1]+w[3]);N>g?N=g:NJ&&(J=n,Z=t)}}}}getAngleAndOffset(t,e,i,s){const n=s[1]/2;switch(t){case"tl":return{angle:rt/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-s[1]]};case"top":return{angle:rt/2*3,offset:[e/2,i+n],rectOffset:[0,-i-s[1]]};case"tr":return{angle:rt/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-s[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-s[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-s[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-s[1]]};case"bl":return{angle:rt/2,offset:[e/4,-n],rectOffset:[-e/4,-i-s[1]]};case"bottom":return{angle:rt/2,offset:[e/2,-n],rectOffset:[0,-i-s[1]]};case"br":return{angle:rt/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-s[1]]};case"lt":return{angle:rt,offset:[e+n,i/5],rectOffset:[-e/4,-i-s[1]]};case"left":return{angle:rt,offset:[e+n,i/2],rectOffset:[0,-i-s[1]]};case"lb":return{angle:rt,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-s[1]]}}}}uX.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};let pX=class{render(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const s={};E(s,uX.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(s):this.poptipComponent=new uX(s);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};E(e,c_.poptip,n),n=e,n.content=null!==(p=n.content)&&void 0!==p?p:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const a=h.stage.getLayer("_builtin_interactive");a&&a.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null===(g=this.poptipComponent.parent)||void 0===g||g.removeChild(this.poptipComponent),this.poptipComponent=null))}};pX=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}([V()],pX);var gX=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};class mX{constructor(){this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let _X=class extends mX{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};_X=gX([V()],_X);let fX=class extends mX{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);const{stage:e}=this.pluginService;e.addEventListener("pointerleave",this.pointerlave)}needHide(t){return"text"!==t.type||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip}needShow(t){return!0}deactivate(t){const{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};fX=gX([V()],fX);const vX=new I(((t,e,i,s)=>{i(pX)||(t(pX).toSelf().inSingletonScope(),t(uo).toService(pX)),i(_X)||(t(_X).toSelf(),t(la).toService(_X)),i(fX)||(t(fX).toSelf(),t(la).toService(fX))})),yX=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:e.height/t.offsetHeight):1,bX=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>eObject.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},y_||(y_=aa.CreateGraphic("richtext",{})),y_.setAttributes(a),y_.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}},xX="vchart-tooltip-container",SX={offsetX:10,offsetY:10,sanitize:function(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/\(/g,"(").replace(/ /g,"  ")}},MX=(t,e)=>{let i;if(M(t))if(h(t))i=t;else if(xs(t)){const s=t(e);h(s)&&(i=s)}return i},kX={left:[-2,0],right:[2,0],top:[0,-2],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bottom:[0,2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},AX=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=kX[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i},wX={fontFamily:Rh.fontFamily,spacing:10,wordBreak:"break-word"};function TX(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:wX),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const LX=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return M(a)&&(r.cornerRadius=[a,a,a,a]),r};class CX extends jE{constructor(){super(...arguments),this._visible=!0,this._attributes=null,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this._changeTooltip=(t,e,i)=>this._isReleased?1:t?this._changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this._changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:d}=t;if(!h)return 1;const c=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,c,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,d));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[c])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let m=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(m=!1),this._updateTooltip(m,Object.assign(Object.assign({},t),{changePositionOnly:d})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,d,c,u;const{tooltipSpec:p}=e,g={x:1/0,y:1/0};if(!p)return g;const m=e.event,{activeType:_,data:f}=t,v="dimension"===_?null===(n=null===(s=f[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==f?void 0:f[0],{offsetX:y,offsetY:b}=this._option,x=p[_],S=ZT(null==x?void 0:x.position,f,e),k=null!==(r=ZT(null==x?void 0:x.positionMode,f,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:A=0,height:w=0}=null!=i?i:{},T="canvas"===p.renderMode,L=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),C=null!==(o=null==L?void 0:L.width)&&void 0!==o?o:rh,E=null!==(l=null==L?void 0:L.height)&&void 0!==l?l:ah;let D=!1;const P={width:0,height:0};let O={x:0,y:0},R={x:0,y:0},B=1,I=1;if(cl(this._env)&&!p.confine){if(P.width=window.innerWidth,P.height=window.innerHeight,!T){const t=this._getParentElement(p);R=null!==(c=null===(d=null==t?void 0:t.getBoundingClientRect)||void 0===d?void 0:d.call(t))&&void 0!==c?c:g;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer,i=null==e?void 0:e.getBoundingClientRect();O={x:i.x-R.x,y:i.y-R.y},B=yX(e,i),I=yX(t,R)}}else P.width=C,P.height=E;const F=I/B,Y={},j={x:S,y:S},H={x:["left","right"],y:["top","bottom"]},z=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),d=null!=s?s:"x"===n?y:b;if("mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if("crosshair"===i&&"cartesian"===(null===(r=null==v?void 0:v.series)||void 0===r?void 0:r.coordinate)&&v.datum&&v.datum.length){D=!0;const t=((t,e)=>{var i;const s=new Map,n=new Map,{series:r,datum:a}=t,o="horizontal"===r.direction,l=(o?r.getYAxisHelper():r.getXAxisHelper()).getAxisId(),h=r.getChart().getComponentsByKey("axes").find((t=>t.id===l));if(!h)return;(o?n:s).set(h.getSpecIndex(),{value:null===(i=r.getDatumPositionValues(a[0],r.getDimensionField()))||void 0===i?void 0:i[0],axis:h});const d={visible:!!s.size,type:"rect"},c={visible:!!n.size,type:"rect"},{x:u,y:p,offsetWidth:g,offsetHeight:m,bandWidth:_,bandHeight:f}=VW(3,r,e,s,n,d,c);return u?UW(d,u,_,g):p?$W(c,p,f,m):void 0})(v,h);t&&(a=t.start[n],o=t.end[n])}else j[n]=t;if(D){const e=H[n][0],i="x"===n?A:w;switch(AX(t,n)){case-2:Y[e]=a-i*F-d;break;case 0:Y[e]=(a+o)/2-i*F/2;break;case-1:Y[e]=(a+o)/2-i*F-d;break;case 1:Y[e]=(a+o)/2+d;break;case 2:Y[e]=o+d}}},N=["x","y"];if(bs(S))if(bs(V=S)&&(M(V.left)||M(V.right)||M(V.top)||M(V.bottom))){const{left:t,right:e,top:i,bottom:s}=S;Y.left=MX(t,m),Y.top=MX(i,m),Y.right=MX(e,m),Y.bottom=MX(s,m)}else(t=>bs(t)&&(M(t.x)||M(t.y)))(S)&&N.forEach((t=>{const e=S[t];h(e)||xs(e)?Y[H[t][0]]=MX(e,m):z(e,t)}));else M(S)&&(z({orient:S,mode:k},"x"),z({orient:S,mode:k},"y"));var V;const W={x:null,y:null},G=cl(this._env);return N.forEach((t=>{const e="x"===t?A:w,i="x"===t?C:E,s="x"===t?y:b,n=AX(j[t],t);if(Zo(Y[H[t][0]]))W[t]=Y[H[t][0]];else if(Zo(Y[H[t][1]]))W[t]=i-e*F-Y[H[t][1]];else{const i="x"===t?m.canvasX:m.canvasY;W[t]=n>0?i+s:i-e*F/2+(n<0?-1:0)*s}W[t]*=B,G&&(W[t]+=O[t]),W[t]/=I;const r="x"===t?P.width:P.height,a=-R[t]/I,o=(r-R[t])/I-e;2!==n&&W[t]o&&(W[t]=o)):-2!==n&&W[t]>o&&(D?W[t]=o:(W[t]-=0===n?s+e/2:2*s+e,W[t]{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:d}=e,{panel:c={},titleLabel:u,shape:p,keyLabel:g,valueLabel:m,spaceRow:_,maxContentHeight:f,align:v}=l,y=yD(c.padding),b=nl(c.padding),x=TX(Object.assign({textAlign:"right"===v?"right":"left"},u),i),S=TX(Object.assign({textAlign:"right"===v?"right":"left"},g),i),k=TX(m,i),A={fill:!0,size:null!==(s=null==p?void 0:p.size)&&void 0!==s?s:8,spacing:null!==(n=null==p?void 0:p.spacing)&&void 0!==n?n:6},w={panel:LX(c),padding:y,title:{},content:[],titleStyle:{value:x,spaceRow:_},contentStyle:{shape:A,key:S,value:k,spaceRow:_},hasContentShape:!1,keyWidth:0,valueWidth:0,maxContentHeight:f,enterable:h,transitionDuration:d,align:v},{title:T={},content:L=[]}=t;let C=b.left+b.right,E=b.top+b.bottom,D=b.top+b.bottom,P=0;const O=!!L.length;let R=0,B=0,I=0,F=0;if(O){const t=[],e=[],i=[],s=[];let n=0;w.content=L.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:d="",shapeFill:c,shapeStroke:u,shapeLineWidth:p,shapeSize:g,value:m,isKeyAdaptive:f,spaceRow:v,keyStyle:y,valueStyle:b,shapeHollow:x}=r,w={height:0,spaceRow:null!=v?v:_};if(M(h)){const i=Ll({},S,TX(y,void 0,{})),{width:s,height:n,text:r}=bX(h,i);w.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),f?e.push(s):t.push(s),o=Math.max(o,n)}if(M(m)){const t=Ll({},k,TX(b,void 0,{})),{width:e,height:s,text:n}=bX(m,t);w.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:d};x?t.stroke=c:t.fill=c,t.stroke=null!=u?u:c,t.lineWidth=p,w.shape=t;const e=null!=g?g:A.size;o=Math.max(e,o),s.push(e)}else w.shape={visible:!1};return w.height=o,n+=o,aG.autoWidth&&!1!==G.multiLine;if(z){G=Ll({},x,TX(V,void 0,{})),U()&&(G.multiLine=null===(r=G.multiLine)||void 0===r||r,G.maxWidth=null!==(a=G.maxWidth)&&void 0!==a?a:O?Math.ceil(P):void 0);const{text:t,width:e,height:i}=bX(N,G);w.title.value=Object.assign(Object.assign({width:U()?Math.min(e,null!==(o=G.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},G),{text:t}),Y=w.title.value.width,j=w.title.value.height,H=j+(O?w.title.spaceRow:0)}return E+=H,D+=H,w.title.width=Y,w.title.height=j,U()?C+=P||Y:C+=Math.max(Y,P),O&&w.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=C-b.left-b.right-F-R-S.spacing-k.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=C,w.panel.height=E,w.panelDomHeight=D,w})(t,this._component.getSpec(),e)}const{panel:r,panelDomHeight:a}=null!==(n=this._attributes)&&void 0!==n?n:{},o="canvas"===this._component.getSpec().renderMode;return{width:(null==r?void 0:r.width)+(o?r.lineWidth:0),height:(null!=a?a:null==r?void 0:r.height)+(o?r.lineWidth:0)}}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption(),this.changeTooltip=this._throttle(this._changeTooltip),this.changeTooltipPosition=this._throttle(this._changeTooltipPosition)}reInit(){this._initFromSpec()}}CX.specKey="tooltip";const EX=(t,e)=>M(t)?y(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",DX=t=>{const e=t.split(" ").map((t=>Number.isNaN(t)?Number.parseFloat(t.substring(0,t.length-2)):Number.parseFloat(t)));return 1===e.length?e[0]:e};let PX;const OX=(t=document.body)=>{if(D(PX)){const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",t.appendChild(e);const i=document.createElement("div");e.appendChild(i),PX=e.offsetWidth-i.offsetWidth,e.parentNode.removeChild(e)}return PX};function RX(t,e){if(!t)return;const{fontFamily:i,fontSize:s,fill:n,textAlign:r,lineHeight:a,fontWeight:o,multiLine:l,wordBreak:h,maxWidth:d}=Ll({},e,t),c={};return c.fontFamily=i,c.fontSize=EX(s),c.color=n,c.textAlign=r,c.lineHeight=EX(_n(a,s)),c.fontWeight=o,c.whiteSpace=l?"initial":"nowrap",c.wordBreak=l?null!=h?h:"break-word":"normal",c.maxWidth=EX(d),c}class BX{static isInstance(t){return!!t&&t.type===BX.type}setOption(t){this._option=t,Object.values(this.children).forEach((e=>e.setOption(t)))}getParentEl(){return BX.isInstance(this.parent)?this.parent.product:this.parent}constructor(t,e,i){this.type=BX.type,this._renderContentCache=null,this.children={},this.parent=t,this._option=e,this.childIndex=null!=i?i:0}init(t,e){}initAll(){this.init(),Object.values(this.children).forEach((t=>t.initAll()))}setStyle(t){this.product&&t&&Object.keys(t).forEach((e=>{this.product.style[e]!==t[e]&&(this.product.style[e]=t[e])}))}setContent(t){}setVisibility(t){if(!this.product)return;const{style:e}=this.product;e.visibility=t?"visible":"hidden",Object.values(this.children).forEach((e=>e.setVisibility(t)))}getVisibility(){var t,e;return!!(null===(e=null===(t=this.product)||void 0===t?void 0:t.style)||void 0===e?void 0:e.visibility)&&"hidden"!==this.product.style.visibility}release(){var t;if(Object.values(this.children).forEach((t=>t.release())),this.children={},this.product){try{null===(t=this.getParentEl())||void 0===t||t.removeChild(this.product)}catch(t){}this.product=null}}createElement(t,e,i,s){const n=null==dl?void 0:dl.createElement(t),r=this.getParentEl();if(!n||!r)return;e&&n.classList.add(...e),i&&Object.keys(i).forEach((t=>{n.style[t]=i[t]})),s&&(n.id=s);let a=this.childIndex;if(BX.isInstance(this.parent)){let t=Number.MAX_VALUE;for(let e=0;et.product===r.children[e]));i.childIndex>this.childIndex&&i.childIndex=r.children.length?r.appendChild(n):r.insertBefore(n,r.children[a]),n}}BX.type="tooltipModel";const IX={fontSize:"13px",marginBottom:"0px",fontWeight:"normal"},FX={boxSizing:"border-box"},YX={display:"inline-block",verticalAlign:"top"},jX={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},HX={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},zX={paddingTop:"0px",paddingBottom:"0px",textAlign:"right",fontWeight:"normal"},NX={lineHeight:"normal",boxSizing:"border-box"};class VX extends BX{init(t,e,i){if(!this.product){const s=this.createElement(null!=i?i:"div",[...null!=t?t:[],"shape"],void 0,e);this.product=s}}setStyle(t,e){super.setStyle(t),this.setSvg(e)}setContent(t){this.setSvg(t)}setSvg(t){const e=function(t,e){var i,s,n,r,a,o;if(!(null==t?void 0:t.hasShape)||!t.symbolType)return"";const{symbolType:l,fill:h,stroke:d,hollow:c=!1}=t,u=t.size?e(t.size):"8px",p=t.lineWidth?e(t.lineWidth)+"px":"0px";let g="currentColor";const m=()=>d?e(d):g,_=DX(u),f=t=>new Cv({symbolType:t,size:_,fill:!0});let v=f(l);const y=v.getParsedPath();y.path||(v=f(y.pathStr));const b=v.getParsedPath().path,x=b.toString(),M=b.bounds;let k=`${M.x1} ${M.y1} ${M.width()} ${M.height()}`;if("0px"!==p){const[t,e,i,s]=k.split(" ").map((t=>Number(t))),n=Number(p.slice(0,-2));k=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!h||S(h)||c)return g=c?"none":h?e(h):"currentColor",`\n \n \n \n `;if(bs(h)){g=null!==(i="gradientColor"+t.index)&&void 0!==i?i:"";let l="";const d=(null!==(s=h.stops)&&void 0!==s?s:[]).map((t=>``)).join("");return"radial"===h.gradient?l=`\n ${d}\n `:"linear"===h.gradient&&(l=`\n ${d}\n `),`\n \n ${l}\n \n \n `}return""}(t,this._option.valueToHtml);this.product&&e!==this._svgHtmlCache&&(this._svgHtmlCache=e,this.product.innerHTML=e)}release(){super.release(),this._svgHtmlCache=""}}class WX extends BX{init(t,e,i){this.product||(this.product=this.createElement(null!=i?i:"span",t,void 0,e))}setContent(t,e){if(!this.product)return;let i=this._option.valueToHtml(t);e&&(i=i.replaceAll("\n","
")),i!==this.product.innerHTML&&(this.product.innerHTML=i)}}const GX={overflowWrap:"normal",wordWrap:"normal"};class UX extends BX{constructor(t,e,i,s){super(t,e,s),this.className=i}init(){var t,e;this.product||(this.product=this.createElement("div",[this.className]));const i=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];if("shape-box"!==this.className||i.some((t=>t.hasShape&&t.shapeType))){Object.keys(this.children).forEach((t=>{const e=gd(t);e>=i.length&&(this.children[e].release(),delete this.children[e])}));for(let t=0;t{const e=gd(t);this.children[e].release(),delete this.children[e]}))}setStyle(){var t,e,i,s;const n=this._option.getTooltipStyle();super.setStyle(Ll({},YX,n.content,this._getContentColumnStyle()));const r=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],a=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[],o=(t,e,i)=>{var s,r;const{key:a,isKeyAdaptive:o}=t,{height:l}=e,{keyColumn:d}=n,c=Ll({},o?HX:jX,Object.assign(Object.assign(Object.assign({height:EX(l)},GX),d.common),null===(s=d.items)||void 0===s?void 0:s[i]));return S(a)&&""!==(null===(r=null==a?void 0:a.trim)||void 0===r?void 0:r.call(a))||h(a)||c.visibility?c.visibility="visible":c.visibility="hidden",c};a.forEach(((t,e)=>{var i;const s=r[e];"key-box"===this.className?this.children[e].setStyle(o(s,t,e)):"value-box"===this.className?this.children[e].setStyle(((t,e,i)=>{var s;const{height:r}=e,{valueColumn:a}=n;return Ll({},zX,Object.assign(Object.assign(Object.assign({height:EX(r)},GX),a.common),null===(s=a.items)||void 0===s?void 0:s[i]))})(0,t,e)):"shape-box"===this.className&&(null===(i=this.children[e])||void 0===i||i.setStyle(((t,e,i)=>{var s,r,a,l;const{height:h}=e,{shapeColumn:d}=n,c=o(t,e,i),u=`calc((${null!==(r=null!==(s=c.lineHeight)&&void 0!==s?s:c.fontSize)&&void 0!==r?r:"18px"} - ${null!==(a=d.width)&&void 0!==a?a:"8px"}) / 2)`;return Ll({},NX,Object.assign(Object.assign({height:EX(h),paddingTop:u},d.common),null===(l=d.items)||void 0===l?void 0:l[i]))})(s,t,e),this._getShapeSvgOption(s,e)))}))}setContent(){var t,e,i,s;const n=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];(null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[]).forEach(((t,e)=>{var i,s,r,a,o,l,d;let c;const u=n[e];if("key-box"===this.className){const n=u.key;c=S(n)&&""!==(null===(i=null==n?void 0:n.trim)||void 0===i?void 0:i.call(n))||h(n)?n:"",null===(s=this.children[e])||void 0===s||s.setContent(c,null===(r=t.key)||void 0===r?void 0:r.multiLine)}else if("value-box"===this.className){const i=u.value;c=S(i)&&""!==(null===(a=null==i?void 0:i.trim)||void 0===a?void 0:a.call(i))||h(i)?i:"",null===(o=this.children[e])||void 0===o||o.setContent(c,null===(l=t.value)||void 0===l?void 0:l.multiLine)}else"shape-box"===this.className&&(c=this._getShapeSvgOption(u,e),null===(d=this.children[e])||void 0===d||d.setContent(c))}))}_getContentColumnStyle(){var t,e;const i=this._option.getTooltipStyle();switch(this.className){case"shape-box":const s=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];return Object.assign(Object.assign({},i.shapeColumn),"shape-box"!==this.className||s.some((t=>t.hasShape&&t.shapeType))?{}:{display:"none"});case"key-box":return i.keyColumn;case"value-box":return i.valueColumn}}_getShapeSvgOption(t,e){var i;const s=this._option.getTooltipStyle(),n=Object.assign(Object.assign({},s.shapeColumn),null===(i=s.shapeColumn.items)||void 0===i?void 0:i[e]);return{hasShape:t.hasShape,symbolType:t.shapeType,size:n.width,fill:t.shapeFill,stroke:t.shapeStroke,lineWidth:t.shapeLineWidth,hollow:t.shapeHollow,index:e}}}class $X extends BX{init(){this.product||(this.product=this.createElement("div",["container-box"]));const{align:t}=this._option.getTooltipAttributes();"right"===t?(this.valueBox||(this.valueBox=this._initBox("value-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.shapeBox||(this.shapeBox=this._initBox("shape-box",2))):(this.shapeBox||(this.shapeBox=this._initBox("shape-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.valueBox||(this.valueBox=this._initBox("value-box",2)))}_initBox(t,e){const i=new UX(this.product,this._option,t,e);return i.init(),this.children[i.childIndex]=i,i}setStyle(t){super.setStyle(Ll(this._getContentContainerStyle(),t)),Object.values(this.children).forEach((t=>{t.setStyle()}))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}_getContentContainerStyle(){const t={whiteSpace:"nowrap",lineHeight:"0px"},{panelDomHeight:e,panel:i,maxContentHeight:s}=this._option.getTooltipAttributes();if(M(s)&&et+DX(e)),0);return Object.assign(Object.assign({},t),{width:`${a+OX(this._option.getContainer())}px`,maxHeight:EX(s),overflow:"auto"})}return t}release(){super.release(),this.shapeBox=null,this.keyBox=null,this.valueBox=null}}class XX extends BX{init(){const t=this._option.getTooltipActual();this.product||(this.product=this.createElement("h2"));const{align:e}=this._option.getTooltipAttributes();"right"!==e||this.textSpan||this._initTextSpan(0);const{title:i}=t;(null==i?void 0:i.hasShape)&&(null==i?void 0:i.shapeType)?this.shape||this._initShape("right"===e?1:0):this.shape&&this._releaseShape(),"right"===e||this.textSpan||this._initTextSpan(1)}_initShape(t=0){const e=new VX(this.product,this._option,t);e.init(),this.shape=e,this.children[e.childIndex]=e}_releaseShape(){this.shape&&(this.shape.release(),delete this.children[this.shape.childIndex],this.shape=null)}_initTextSpan(t=1){const e=new WX(this.product,this._option,t);e.init(),this.textSpan=e,this.children[e.childIndex]=e}setStyle(t){var e,i,s,n;const r=this._option.getTooltipStyle(),a=this._option.getTooltipActual(),{title:o}=a;super.setStyle(Ll({},IX,r.title,t)),null===(e=this.shape)||void 0===e||e.setStyle({paddingRight:null===(i=r.shapeColumn.common)||void 0===i?void 0:i.marginRight},{hasShape:null==o?void 0:o.hasShape,symbolType:null==o?void 0:o.shapeType,size:null===(s=r.shapeColumn.common)||void 0===s?void 0:s.width,fill:null==o?void 0:o.shapeFill,hollow:null==o?void 0:o.shapeHollow}),null===(n=this.textSpan)||void 0===n||n.setStyle({color:"inherit"})}setContent(){var t,e,i,s,n,r;const a=this._option.getTooltipStyle(),o=this._option.getTooltipActual(),l=this._option.getTooltipAttributes(),{title:h}=o;this.init(),null===(t=this.shape)||void 0===t||t.setStyle(void 0,{hasShape:null==h?void 0:h.hasShape,symbolType:null==h?void 0:h.shapeType,size:null===(e=a.shapeColumn.common)||void 0===e?void 0:e.width,fill:null==h?void 0:h.shapeFill,hollow:null==h?void 0:h.shapeHollow}),null===(i=this.textSpan)||void 0===i||i.setStyle({color:"inherit"}),null===(s=this.textSpan)||void 0===s||s.setContent(null==h?void 0:h.value,null===(r=null===(n=l.title)||void 0===n?void 0:n.value)||void 0===r?void 0:r.multiLine)}release(){super.release(),this.shape=null,this.textSpan=null}}const KX="99999999999999";class qX extends BX{constructor(t,e,i){super(t.getContainer(),t,0),this.title=null,this.content=null,this._classList=e,this._id=i}setVisibility(t){if(super.setVisibility(t),!this.product)return;const{classList:e}=this.product;t?e.add("visible"):e.remove("visible")}init(){var t;const e=this._option.getTooltipActual();this.product||this._initPanel(this._classList,this._id);const{title:i}=e;!1!==(null==i?void 0:i.visible)&&M(null==i?void 0:i.value)?this.title||this._initTitle():this.title&&this._releaseTitle(),(null!==(t=e.content)&&void 0!==t?t:[]).length>0?this.content||this._initContent():this.content&&this._releaseContent()}_initPanel(t,e){const i=this.createElement("div",t,{left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:KX,fontFamily:"sans-serif",fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh"},e);this.product=i}_initTitle(){const t=new XX(this.product,this._option,0);t.init(),this.title=t,this.children[t.childIndex]=t}_releaseTitle(){this.title&&(this.title.release(),delete this.children[this.title.childIndex],this.title=null)}_initContent(){const t=new $X(this.product,this._option,1);t.init(),this.content=t,this.children[t.childIndex]=t}_releaseContent(){this.content&&(this.content.release(),delete this.children[this.content.childIndex],this.content=null)}setStyle(){const t=this._option.getTooltipStyle();super.setStyle(Ll({},FX,t.panel)),Object.values(this.children).forEach((t=>t.setStyle()))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}release(){super.release(),this.title=null,this.content=null}}const ZX=t=>{Xl.registerComponentPlugin(t.type,t)};class JX extends CX{getVisibility(){var t;return!!(null===(t=this.model)||void 0===t?void 0:t.getVisibility())}setVisibility(t){var e;t!==this.getVisibility()&&(null===(e=this.model)||void 0===e||e.setVisibility(t))}constructor(){super(JX.type),this.type=AW.dom,this._tooltipContainer=null==dl?void 0:dl.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec(),e=t.parentElement;if(dl&&e&&e.children&&e.children.length){for(let t=0;tthis._domStyle,getTooltipActual:()=>this._tooltipActual,getTooltipAttributes:()=>this._attributes,getContainer:()=>this._container},[t.className],this.name)}}_removeTooltip(){var t;null===(t=this.model)||void 0===t||t.release(),this._container=null}_updateTooltip(t,e){var i,s;if(t&&this.model){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r,this._initStyle(),this.model.initAll(),this.model.setStyle(),this.model.setContent()),this.setVisibility(t);const a=this.model.product;if(a){const{x:t=0,y:o=0}=null!==(i=r.position)&&void 0!==i?i:{};if(n.updateElement){this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:t,y:o}),n.updateElement(a,r,e);const i=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight});this._updatePosition(i),this._cacheCustomTooltipPosition=i}else this._updatePosition({x:t,y:o})}}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){this._domStyle=function(t){var e,i,s;const{panel:n={},title:r,content:a,titleStyle:o={},contentStyle:l={},padding:h,keyWidth:d,valueWidth:c,enterable:u,transitionDuration:p,panelDomHeight:g=0,align:m="left"}=null!=t?t:{},{fill:_,shadow:f,shadowBlur:v,shadowColor:y,shadowOffsetX:b,shadowOffsetY:x,shadowSpread:S,cornerRadius:M,stroke:k,lineWidth:A=0,width:w=0}=n,{value:T={}}=o,{shape:L={},key:C={},value:E={}}=l,D=function(t){if(!t)return;const{size:e}=Ll({},void 0,t),i={};return i.width=EX(e),i}(L),P=RX(C),O=RX(E),{bottom:R,left:B,right:I,top:F}=nl(h),Y="right"===m?"marginLeft":"marginRight";return{align:m,panel:{width:EX(w+2*A),minHeight:EX(g+2*A),paddingBottom:EX(R),paddingLeft:EX(B),paddingRight:EX(I),paddingTop:EX(F),borderColor:k,borderWidth:EX(A),borderRadius:EX(M),backgroundColor:_?`${_}`:"transparent",boxShadow:f?`${b}px ${x}px ${v}px ${S}px ${y}`:"initial",pointerEvents:u?"auto":"none",transitionDuration:p?`${p}ms`:"initial",transitionProperty:p?"transform":"initial",transitionTimingFunction:p?"ease-out":"initial"},title:Object.assign({marginTop:"0px",marginBottom:(null==a?void 0:a.length)?EX(null==r?void 0:r.spaceRow):"0px"},RX(Ll({},T,null==r?void 0:r.value))),content:{},shapeColumn:{common:D,items:null==a?void 0:a.map((({spaceRow:t},e)=>({marginTop:"0px",marginBottom:eObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:iObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:i{const i=[t.shape,...e.map((t=>null==t?void 0:t.shape))],s=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return E(t,...e,{shape:i.every(D)?void 0:E({},...i),key:s.every(D)?void 0:E({},...s),value:n.every(D)?void 0:E({},...n)})},tK=t=>{const{width:e,height:i,wordBreak:s="break-word",textAlign:n,textBaseline:r,text:a}=t;return Array.isArray(a)?{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:Fa(a).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:null==a?void 0:a.text}},eK={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Kk,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Kk,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Kk,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new qt).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},iK=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];p_(),fy(),Uv(),cf(),ik();class sK extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},sK.defaultAttributes,t),e),this.name="tooltip"}render(){var t;const{visible:e,content:i,panel:s,keyWidth:n,valueWidth:r,hasContentShape:a,autoCalculatePosition:o,autoMeasure:l,align:h}=this.attribute;if(!e)return void this.hideAll();l&&sK.measureTooltip(this.attribute),o&&sK.calculateTooltipPosition(this.attribute);const d=yD(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:d[3],y:d[0]},"group");const c=sK.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",E({symbolType:"circle"},c.shape,{visible:Vk(c)&&Vk(c.shape)}),"symbol"),"object"!=typeof c.value.text||null===c.value.text||"rich"!==c.value.text.type&&"html"!==c.value.text.type?c.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Vk(c)&&Vk(c.value)},tK(c.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!==(t=c.value.text)&&void 0!==t?t:"",visible:Vk(c)&&Vk(c.value)},c.value),"text"):"rich"===c.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Vk(c)&&Vk(c.value)},tK(c.value)),"richtext"):"html"===c.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:c.value.text.text},Jk),c.value),visible:Vk(c)&&Vk(c.value),width:c.value.width,height:c.value.height,wordBreak:c.value.wordBreak,textAlign:c.value.textAlign,textBaseline:c.value.textBaseline,singleLine:!1,textConfig:[]},c.value),"richtext"));const u=Vk(c.shape)?c.shape.size+c.shape.spacing:0,{textAlign:p,textBaseline:g}=c.value,m=s.width-d[3]-d[0]-u;"center"===p?this._tooltipTitle.setAttribute("x",u+m/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",u+m):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",c.height):"middle"===g?this._tooltipTitle.setAttribute("y",c.height/2):this._tooltipTitle.setAttribute("y",0);const _=Vk(c)?c.height+c.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+_);let t=0;i.forEach(((e,i)=>{const s=sK.getContentAttr(this.attribute,i);if(!Vk(s))return;const o=`tooltip-content-${i}`,l=this._tooltipContent.createOrUpdateChild(o,{visible:!0,x:0,y:t},"group"),d=s.shape.size+s.shape.spacing;let c="right"===h?(a?d:0)+(Vk(s.key)?n+s.key.spacing:0)+(Vk(s.value)?r:0):0;this._createShape("right"===h?c-s.shape.size/2:c+s.shape.size/2,s,l,o),a&&("right"===h?c-=d:c+=d);const u=this._createKey(s,l,o);u&&(nA(h,u,s.key.textAlign,c,n),u.setAttribute("y",0),"right"===h?c-=n+s.key.spacing:c+=n+s.key.spacing);const p=this._createValue(s,l,o);if(p){let t="right";M(s.value.textAlign)?t=s.value.textAlign:Vk(s.key)||"right"===h||(t="left"),p.setAttribute("textAlign",t),nA(h,p,t,c,r),p.setAttribute("y",0)}t+=s.height+s.spaceRow}))}}_createShape(t,e,i,s){var n;if(Vk(e.shape))return i.createOrUpdateChild(`${s}-shape`,Object.assign({visible:!0,x:t,y:e.shape.size/2+((null!==(n=_n(e.key.lineHeight,e.key.fontSize))&&void 0!==n?n:e.key.fontSize)-e.shape.size)/2},e.shape),"symbol")}_createKey(t,e,i){var s;if(Vk(t.key)){let n;return n=t.key.multiLine?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0},tK(t.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.key.text||null===t.key.text||"rich"!==t.key.text.type&&"html"!==t.key.text.type?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.key.text)&&void 0!==s?s:""},t.key),{textBaseline:"top"}),"text"):"rich"===t.key.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.key)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign(Object.assign({dom:t.key.text.text},Jk),t.key)},"richtext"),n}}_createValue(t,e,i){var s;if(Vk(t.value)){let n;return n=t.value.multiLine?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.value.text||null===t.value.text||"rich"!==t.value.text.type&&"html"!==t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.value.text)&&void 0!==s?s:""},t.value),{textBaseline:"top"}),"text"):"rich"===t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.value)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign({dom:t.value.text.text,container:"",width:30,height:30,style:{}},t.value)},"richtext"),n}}setAttributes(t,e){const i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every((t=>iK.includes(t)))?(this._mergeAttributes(t,i),D(this.attribute.panel.width)&&this.attribute.autoMeasure&&sK.measureTooltip(this.attribute),sK.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:n,pointerX:r,pointerY:a,positionX:o,positionY:l,parentBounds:h}=t;let d=r,c=a;return"left"===o?d-=e+s:"center"===o?d-=e/2:d+=s,"top"===l?c-=i+n:"middle"===l?c-=i/2:c+=n,d+e>h.x2&&(d-=e+s),c+i>h.y2&&(c-=i+n),d{const n=sK.getContentAttr(t,i);(e.key||e.value)&&Vk(n)&&s.push([e,n])})),s.length){let n=!1;const o=[],l=[],h=[];s.forEach((([t,e],r)=>{var d;const{key:c,value:u,shape:p,spaceRow:g}=e,m=Vk(p),_=null!==(d=null==p?void 0:p.symbolType)&&void 0!==d?d:"",f=Qk(c),v=Qk(u);let y=0;if(Vk(c)){const{width:t,height:e}=f.quickMeasure(c.text);l.push(t),y=Math.max(y,e)}if(Vk(u)){const{width:t,height:e}=v.quickMeasure(u.text);h.push(t),y=Math.max(y,e)}m&&pv[_]&&(n=!0,o.push(p.size),y=Math.max(p.size,y)),t.height=y,a+=y,r{t.width=r})),t.hasContentShape=n,t.keyWidth=c,t.valueWidth=u}}return t.panel.width=r+s[1]+s[3],t.panel.height=a,t}static getTitleAttr(t){return QX({},sK.defaultAttributes.titleStyle,sK.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return QX({},sK.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}sK.defaultAttributes=eK;class nK extends CX{constructor(){super(nK.type),this.type=AW.canvas}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new sK({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}function rK(t,e){const i=e?t.toExponential(e-1):t.toExponential(),s=i.indexOf("e");if(s<0)return null;const n=i.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+i.slice(s+1)]}let aK;function oK(t,e){const i=rK(t,e);if(!i)return t+"";const s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}nK.type=AW.canvas;class lK{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const hK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dK(t){let e;if(e=hK.exec(t))return new lK({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});g.getInstance().error("invalid format: "+t)}const cK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class uK{constructor(){var t,e,i;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(e=[...this.locale.grouping].map(Number),i=`${this.locale.thousands}`,function(t,s){let n=t.length;const r=[];let a=0,o=e[0],l=0;for(;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:(t=[...this.locale.numerals].map(String),function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return uK.instance||(uK.instance=new uK),uK.instance}newFormat(t){const e=dK(t);let i=e.fill,s=e.align;const n=e.sign,r=e.symbol;let a=e.zero;const o=e.width;let l=e.comma,h=e.precision,d=e.trim,c=e.type;"n"===c?(l=!0,c="g"):pK[c]||(void 0===h&&(h=12),d=!0,c="g"),(a||"0"===i&&"="===s)&&(a=!0,i="0",s="=");const u="$"===r?this.currencyPrefix:"#"===r&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",p="$"===r?this.currencySuffix:/[%p]/.test(c)?this.percent:"",g=pK[c],m=/[defgprstz%]/.test(c);h=void 0===h?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h));const{nan:_,minus:f,decimal:v,group:y,numerals:b}=this;function x(t){let e,r,x,S=u,M=p,k=t;if("c"===c)M=g(k)+M,k="";else{k=+k;let t=k<0||1/k<0;if(k=isNaN(k)?_:g(Math.abs(k),h),d&&(k=function(t){const e=t.length;let i,s=-1;t:for(let n=1;n0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(k)),t&&0==+k&&"+"!==n&&(t=!1),S=(t?"("===n?n:f:"-"===n||"("===n?"":n)+S,M=("s"===c?cK[8+aK/3]:"")+M+(t&&"("===n?")":""),m)for(e=-1,r=k.length;++ex||x>57){M=(46===x?v+k.slice(e+1):k.slice(e))+M,k=k.slice(0,e);break}}l&&!a&&(k=y(k,1/0));let A=S.length+k.length+M.length,w=A>1)+S+k+M+w.slice(A);break;default:k=w+S+k+M}return b(k)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const i=dK(t);i.type="f";const s=this.newFormat(i.toString()),n=3*Math.max(-8,Math.min(8,Math.floor(function(t){const e=rK(Math.abs(t));return e?e[1]:NaN}(e)/3))),r=Math.pow(10,-n),a=cK[8+n/3];return function(t){return s(r*t)+a}}}const pK={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>oK(100*t,e),r:oK,s:function(t,e){const i=rK(t,e);if(!i)return t+"";const s=i[0],n=i[1],r=n-(aK=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+rK(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)},gK=/\{([^}]+)\}/,mK=/\{([^}]+)\}/g,_K=/:/;class fK extends jE{constructor(){super(fK.type),this.type="formatterPlugin",this._timeModeFormat={utc:UT.getInstance().timeUTCFormat,local:UT.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=uK.getInstance().format,this._numericSpecifier=uK.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[fK.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;xs(r)?this._formatter=r:(this._formatter=this._format.bind(this),xs(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),Xl.registerFormatter(this._formatter)}_format(t,e,i){return y(t)?t.map(((t,s)=>{const n=y(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):y(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=gK.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(mK,((t,i)=>{if(!_K.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(hK.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}fK.pluginType="chart",fK.specKey="formatter",fK.type="formatterPlugin";class vK extends yx{constructor(){super(...arguments),this.type=vK.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}vK.type="image";class yK{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onRemove.unTap(this.key),Si.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let s;return s=e?"string"==typeof e?Si.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Si.global.createDom(Object.assign({tagName:"div",parent:s},i)),nativeContainer:s}}parseDefaultStyleFromGraphic(t){return function(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[ea(i)]=t[i])})),["fontSize","lineHeight"].forEach((s=>{const n=ea(s);D(t[s])||(e[n]=i(t[s]))})),M(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&S(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:ms(t).text)}getTransformOfText(t){const e=ms(t).text,{textAlign:i=e.textAlign,textBaseline:s=e.textBaseline}=t.attribute,n=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:r,scaleX:a,scaleY:o}=n,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[s]}) rotate(${r}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[i]} ${h[s]}`}}updateStyleOfWrapContainer(t,e,i,s,n){const{pointerEvents:r}=n;let a=this.parseDefaultStyleFromGraphic(t);a.display=!1!==t.attribute.visible?"block":"none",a.pointerEvents=!0===r?"all":r||"none",i.style.position||(i.style.position="absolute",s.style.position="relative");let o=0,l=0;const h=t.globalAABBBounds;let d=n.anchorType;if(D(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||h.empty()){const e=t.globalTransMatrix;o=e.e,l=e.f}else{const t=HA(h,d);o=t.x,l=t.y}const c=Si.global.getElementTopLeft(s,!1),u=e.window.getTopLeft(!1),p=e.viewBox,g=o+u.left-c.left+p.x1,m=l+u.top-c.top+p.y1;if(a.left=`${g}px`,a.top=`${m}px`,"text"===t.type&&"position"===d&&(a=Object.assign(Object.assign({},a),this.getTransformOfText(t))),xs(n.style)){const e=n.style({top:m,left:g,width:h.width(),height:h.height()},t,i);e&&(a=Object.assign(Object.assign({},a),e))}else bs(n.style)?a=Object.assign(Object.assign({},a),n.style):S(n.style)&&n.style&&(a=Object.assign(Object.assign({},a),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const i=t.split(":");if(2===i.length){const t=i[0].trim(),s=i[1].trim();t&&s&&(e[t]=s)}}})),e})(n.style)));Si.global.updateDom(i,{width:n.width,height:n.width,style:a})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===Si.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&Si.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const{dom:n,container:r}=i;if(!n)return;const a=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&r&&r!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof n?this.htmlMap[a].wrapContainer.innerHTML=n:n!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,s,o,l,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===Si.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class bK extends yK{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:s}=this.htmlMap[t];e?Si.global.getRequestAnimationFrame()((()=>{e.unmount()})):s&&s(),i&&Si.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const n=s.params.ReactDOM,{element:r,container:a}=i;if(!r||!n||!n.createRoot&&!n.render)return;const o=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])n.createRoot?this.htmlMap[o].root.render(r):n.render(r,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,a);if(t)if(this.htmlMap||(this.htmlMap={}),n.createRoot){const i=n.createRoot(t);i.render(r),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else n.render(r,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{n.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,s,l,h,i),this.htmlMap[o].renderId=this.renderId}}vT.useRegisters([()=>{SE(),ME(),aE(),hE(),RC(),DC(),XP(),lO(),Xl.registerSeries(hO.type,hO),Xl.registerChart(xO.type,xO)},()=>{SE(),ME(),aE(),MO(),hE(),Xl.registerAnimation("area",OC),RC(),DC(),XP(),lO(),Xl.registerSeries(TO.type,TO),Xl.registerChart(CO.type,CO)},()=>{WO(),Xl.registerChart(UO.type,UO)},()=>{hE(),Xl.registerAnimation("scatter",((t,e)=>Object.assign({appear:aR(0,e)},CC))),XP(),lO(),Xl.registerSeries(hR.type,hR),Xl.registerChart(cR.type,cR)},()=>{xI(),Xl.registerAnimation("pie",((t,e)=>({appear:vI(t,e),enter:mI(t),exit:_I(t),disappear:fI(t)}))),Xl.registerAnimation("emptyCircle",((t,e)=>({appear:vI(t,e)}))),Xl.registerSeries(LI.type,LI),Xl.registerChart(PI.type,PI)},()=>{Xl.registerSeries(iF.type,iF),xI(),Xl.registerAnimation("rose",((t,e)=>({appear:WI(t,e),enter:zI(t),exit:NI(t),disappear:VI(t)}))),QI(),eF(),Xl.registerChart(rF.type,rF)},()=>{Xl.registerSeries(pF.type,pF),ME(),MO(),aE(),hE(),Xl.registerAnimation("radar",((t,e)=>({appear:"clipIn"===e?void 0:hF(t,e,"in"),enter:hF(t,e,"in"),exit:hF(t,e,"out"),disappear:"clipIn"===e?void 0:hF(t,e,"out"),update:[{options:{excludeChannels:["points","defined","center"]}},{channel:["points","center"],custom:oF,customParameters:t,duration:LC.update.duration,easing:LC.update.easing}]}))),Xl.registerAnimation("radarSymbol",((t,e)=>({appear:"clipIn"===e?void 0:dF(t,e,"in"),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:"clipIn"===e?void 0:dF(t,e,"out"),update:[{options:{excludeChannels:["x","y","center"]}},{channel:["x","y","center"],custom:aF,customParameters:t,duration:LC.update.duration,easing:LC.update.easing}]}))),Xl.registerAnimation("radarGroup",((t,e)=>({appear:cF(t,"in"),disappear:cF(t,"out")}))),Gx(),QI(),eF(),Xl.registerChart(mF.type,mF)},()=>{WO(),Xl.registerChart(IF.type,IF)},()=>{fc.registerGrammar("projection",jB,"projections"),iI(),UB(),Xl.registerSeries(nI.type,nI),Xl.registerImplement("registerMap",Rp),Xl.registerImplement("unregisterMap",Bp),PC(),Xl.registerChart(aI.type,aI)},()=>{eY(),Xl.registerSeries(sY.type,sY),xI(),VF(),eF(),Xl.registerChart(rY.type,rY)},()=>{_j(),Xl.registerChart(vj.type,vj)},()=>{gj(),KY(),LF(),vY(),Xl.registerSeries(mj.type,mj),_j(),Xl.registerChart(vj.type,vj)},()=>{Yj(),LF(),bF(),Xl.registerSeries(Nj.type,Nj),Xl.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},EC))),Xl.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:bA,customParameters:(e,i)=>({animationType:"in",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:bA,customParameters:(e,i)=>({animationType:"out",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),PC(),Xl.registerChart(Wj.type,Wj)},()=>{bF(),FO(),Xl.registerAnimation("waterfall",((t,e)=>({appear:Yz(t,e),enter:DO(t,!1),exit:PO(t,!1),disappear:PO(t,!1)}))),PC(),XP(),lO(),Xl.registerSeries(tN.type,tN),Xl.registerChart(iN.type,iN)},()=>{Xl.registerMark(SN.type,SN),fc.registerGlyph("boxplot",{shaft:"rule",box:"rect",max:"rule",min:"rule",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","boxWidth","boxHeight","ruleWidth","ruleHeight"]).registerFunctionEncoder(mN).registerChannelEncoder("x",((t,e,i,s,n,r)=>r&&oN(r.direction)?null:{shaft:{x:e,x1:e}})).registerChannelEncoder("y",((t,e,i,s,n,r)=>r&&oN(r.direction)?{shaft:{y:e,y1:e}}:null)).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&oN(r.direction)?{box:{x:e}}:{box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&oN(r.direction)?{box:{x1:e}}:{box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&oN(r.direction)?{shaft:{x:e},min:{x:e,x1:e,visible:!0}}:{shaft:{y:e},min:{y:e,y1:e,visible:!0}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&oN(r.direction)?{shaft:{x1:e},max:{x:e,x1:e,visible:!0}}:{shaft:{y1:e},max:{y:e,y1:e,visible:!0}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&oN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=r&&oN(r.direction)?[(i.min+i.max)/2,i.y]:[i.x,(i.min+i.max)/2],l=null!==(a=i.anchor)&&void 0!==a?a:o;return{shaft:{angle:e,anchor:l},box:{angle:e,anchor:l},max:{angle:e,anchor:l},min:{angle:e,anchor:l},median:{angle:e,anchor:l}}})).registerDefaultEncoder((()=>({max:{visible:!1},min:{visible:!1},median:{visible:!1}}))),fc.registerAnimationType("boxplotScaleIn",_N),fc.registerAnimationType("boxplotScaleOut",fN),cN(),$A(),VA(),WA(),fc.registerGlyph("barBoxplot",{minMaxBox:"rect",q1q3Box:"rect",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","minMaxWidth","q1q3Width","minMaxHeight","q1q3Height"]).registerFunctionEncoder(yN).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&oN(r.direction)?{q1q3Box:{x:e}}:{q1q3Box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&oN(r.direction)?{q1q3Box:{x1:e}}:{q1q3Box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&oN(r.direction)?{minMaxBox:{x:e}}:{minMaxBox:{y:e}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&oN(r.direction)?{minMaxBox:{x1:e}}:{minMaxBox:{y1:e}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&oN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=null!==(a=i.anchor)&&void 0!==a?a:[i.x,(i.min+i.max)/2];return{minMaxBox:{angle:e,anchor:o},q1q3Box:{angle:e,anchor:o},median:{angle:e,anchor:o}}})).registerChannelEncoder("lineWidth",((t,e,i,s,n,r)=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}}))).registerChannelEncoder("minMaxFillOpacity",((t,e,i,s,n,r)=>({minMaxBox:{fillOpacity:e}}))).registerChannelEncoder("stroke",((t,e,i,s,n,r)=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}}))).registerDefaultEncoder((()=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0},median:{visible:!1}}))),fc.registerAnimationType("barBoxplotScaleIn",bN),fc.registerAnimationType("barBoxplotScaleOut",xN),cN(),$A(),VA(),WA(),hE(),DC(),XP(),lO(),Xl.registerSeries(kN.type,kN),Xl.registerChart(wN.type,wN)},()=>{Xl.registerSeries(GF.type,GF),xI(),VF(),PC(),QI(),eF(),Xl.registerChart(XF.type,XF)},()=>{FO(),Xl.registerAnimation("linearProgress",((t,e)=>({appear:Qj(t,e),enter:{type:"grow"},disappear:Zj(t)}))),PC(),Xl.registerSeries(iH.type,iH),Xl.registerChart(nH.type,nH)},()=>{FO(),LF(),Xl.registerAnimation("rangeColumn",((t,e)=>({appear:dH(t,e),enter:oH(t),exit:hH(t),disappear:hH(t)}))),PC(),XP(),lO(),Xl.registerSeries(gH.type,gH),Xl.registerChart(_H.type,_H)},()=>{MO(),XP(),lO(),Xl.registerSeries(rV.type,rV),Xl.registerChart(oV.type,oV)},()=>{Xl.registerSeries(UH.type,UH),xI(),LF(),PC(),Xl.registerAnimation("sunburst",((t,e)=>({appear:wH(0,e),enter:MH(t),exit:AH(t),disappear:AH(t)}))),Xl.registerChart(XH.type,XH)},()=>{Xl.registerSeries(_z.type,_z),xI(),LF(),DC(),Xl.registerAnimation("circlePacking",((t,e)=>({appear:gz(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),Xl.registerChart(vz.type,vz)},()=>{fc.registerTransform("filter",{transform:dE,markPhase:"beforeJoin"},!0),fc.registerTransform("map",{transform:cE,markPhase:"beforeJoin"},!0),FO(),LF(),Xl.registerAnimation("treemap",((t,e)=>({appear:wz(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),PC(),fc.registerTransform("treemap",{transform:Sz,markPhase:"beforeJoin"},!0),Xl.registerSeries(Lz.type,Lz),Xl.registerChart(Ez.type,Ez)},()=>{tV(),Xl.registerChart(iV.type,iV)},()=>{_V(),Xl.registerChart(vV.type,vV)},()=>{hE(),bF(),FO(),LF(),Xl.registerSeries(EF.type,EF),bF(),hE(),XP(),lO(),Xl.registerSeries(MF.type,MF),XP(),lO(),Xl.registerChart(PF.type,PF)},()=>{hE(),CV(),Xl.registerSeries(PV.type,PV),Xl.registerAnimation("correlation",((t,e)=>Object.assign({appear:EV(0,e)},CC))),Xl.registerChart(RV.type,RV)},()=>{Xl.registerChart(fF.type,fF)},()=>{QO(),qO(),Xl.registerChart(tR.type,tR)},()=>{QO(),Xl.registerAnimation("pie3d",((t,e)=>({appear:vI(t,e),enter:mI(t),exit:_I(t),disappear:fI(t)}))),RI(),Xl.registerSeries(II.type,II),Xl.registerChart(YI.type,YI)},()=>{QO(),qO(),Xl.registerChart(FF.type,FF)},()=>{QO(),Uj(),LF(),bF(),Xl.registerSeries(Xj.type,Xj),Xl.registerChart(Kj.type,Kj)},()=>{QO(),XO(),XP(),lO(),Xl.registerSeries(fH.type,fH),Xl.registerChart(yH.type,yH)},()=>{QO(),bj(),Xl.registerChart(Sj.type,Sj)},()=>{QO(),gj(),KY(),LF(),yY(),Xl.registerSeries(yj.type,yj),QO(),bj(),Xl.registerChart(Sj.type,Sj)},lO,XP,()=>{PP(),HP(),gD(),Xl.registerComponent(BV.type,BV)},()=>{PP(),HP(),gD(),Xl.registerComponent(HV.type,HV)},()=>{PP(),HP(),gD(),Xl.registerComponent(NV.type,NV)},QI,eF,()=>{Xl.registerComponent(aW.type,aW)},()=>{Xl.registerComponent(yW.type,yW)},()=>{Xl.registerComponent(BW.type,BW)},()=>{Xl.registerComponent(KW.type,KW)},()=>{Xl.registerComponent(tG.type,tG)},()=>{Xl.registerComponent(gG.type,gG)},()=>{Xl.registerComponent(mG.type,mG)},()=>{Xl.registerComponent(yG.type,yG)},iI,()=>{Xl.registerComponent(FU.type,FU),LU()},()=>{Xl.registerComponent(UU.type,UU),VU()},()=>{Xl.registerComponent(E$.type,E$),w$()},()=>{Xl.registerComponent(HU.type,HU),jU._animate=aU,LU()},()=>{Xl.registerComponent(XU.type,XU),$U._animate=lU,VU()},()=>{Xl.registerComponent(D$.type,D$),w$()},()=>{Xl.registerComponent(P$.type,P$),w$()},()=>{Xl.registerComponent(NU.type,NU)},()=>{Xl.registerComponent(g$.type,g$)},()=>{f$(),b$(),lD(),Xl.registerComponent(S$.type,S$,!0)},()=>{f$(),b$(),lD(),Xl.registerComponent(M$.type,M$,!0)},()=>{Xl.registerComponent(W$.type,W$)},()=>{Xl.registerComponent(G$.type,G$)},()=>{Xl.registerComponent(oX.type,oX)},()=>{Xi.load(vX)},()=>{Xl.registerLayout(lX.type,lX)},()=>{Xl.registerLayout(dX.type,dX)},()=>{KA(),aE(),hE(),bF(),LF(),MO(),FO(),UB(),xI(),Yj(),Xl.registerMark(vK.type,vK),Mx(),qS(),fc.registerGraphic(Qd.image,BS),CV(),lD(),RI(),XO(),Uj()},()=>{ZX(JX)},()=>{ZX(nK)},()=>{var t;t=fK,Xl.registerChartPlugin(t.type,t)},()=>{fc.registerInteraction(tT.type,tT)},()=>{fc.registerInteraction(pT.type,pT)},()=>{fc.registerInteraction(gT.type,gT)},()=>{fc.registerInteraction(mT.type,mT)},()=>{fc.registerInteraction(aT.type,aT)},()=>{fc.registerInteraction(rT.type,rT)},()=>{QA(r_,ew),QA(Gm,gw),r_.useRegisters([MC,kC,sC,nC,xC,SC,AC,wC,TC])},()=>{Cg.registerPlugin("ReactAttributePlugin",bK)},()=>{Cg.registerPlugin("HtmlAttributePlugin",yK)}]);const xK=vT,SK=t=>Fa(t).join(",");class MK extends iL{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>SK(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>SK(null==t?void 0:t[this.series.getDimensionField()[0]])}}const kK=Object.assign(Object.assign({},mL),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),AK=1e-10;function wK(t,e){const i=function(t){const e=[];for(let i=0;ie[i].radius+AK)return!1;return!0}(e,t)}));let n=0,r=0;const a=[];if(s.length>1){const e=EK(s);for(let t=0;t-1){const s=t[o.parentIndex[e]],n=Math.atan2(o.x-s.x,o.y-s.y),r=Math.atan2(i.x-s.x,i.y-s.y);let a=r-n;a<0&&(a+=2*Math.PI);const d=r-a/2;let c=xe.distancePP(l,{x:s.x+s.radius*Math.sin(d),y:s.y+s.radius*Math.cos(d)});c>2*s.radius&&(c=2*s.radius),(null===h||h.width>c)&&(h={circle:s,width:c,p1:o,p2:i})}null!==h&&(a.push(h),n+=TK(h.circle.radius,h.width),i=o)}}else{let e=t[0];for(let i=1;iMath.abs(e.radius-t[s].radius)){i=!0;break}i?n=r=0:(n=e.radius*e.radius*Math.PI,a.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-AK,y:e.y+e.radius},width:2*e.radius}))}return r/=2,e&&(e.area=n+r,e.arcArea=n,e.polygonArea=r,e.arcs=a,e.innerPoints=s,e.intersectionPoints=i),n+r}function TK(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function LK(t,e,i){if(i>=t+e)return 0;if(i<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(i*i-t*t+e*e)/(2*i);return TK(t,t-(i*i-e*e+t*t)/(2*i))+TK(e,s)}function CK(t,e){const i=xe.distancePP(t,e),s=t.radius,n=e.radius;if(i>=s+n||i<=Math.abs(s-n))return[];const r=(s*s-n*n+i*i)/(2*i),a=Math.sqrt(s*s-r*r),o=t.x+r*(e.x-t.x)/i,l=t.y+r*(e.y-t.y)/i,h=-(e.y-t.y)*(a/i),d=-(e.x-t.x)*(a/i);return[{x:o+h,y:l-d},{x:o-h,y:l+d}]}function EK(t){const e={x:0,y:0};for(let i=0;i{const e={},i=Object.values(t);if(!i.length)return[];wK(i,e);const s=e.arcs.map((({p1:t,p2:e,circle:i,width:s})=>({p1:t,p2:e,radius:i.radius,setId:i.setId,largeArcFlag:s>i.radius}))),n=[];let r=0,a=s[0];for(;rxe.distancePP(e.p1,t){if(!(null==t?void 0:t.length))return"";let e=0,i=t[0];const{p1:s}=i;let n=`M${s.x},${s.y}`;for(;i;){const{p2:s,radius:r,largeArcFlag:a}=i;n+=`A${r},${r} 0 ${a?1:0},0 ${s.x},${s.y}`,i=t[++e]}return n+=" Z",n},OK=t=>{var e;return null!==(e=null==t?void 0:t.map((t=>{const{p1:e,p2:i,radius:s,largeArcFlag:n,setId:r}=t,{x:a,y:o}=e,{x:l,y:h}=i,d=((l-a)**2+(h-o)**2)**.5,c=(a+l)/2,u=(o+h)/2,p=(s**2-(d/2)**2)**.5;let g=c+p*(h-o)/d,m=u-p*(l-a)/d;return(yt([l-a,h-o],[g-a,m-o])>0||n)&&(g=c-p*(h-o)/d,m=u+p*(l-a)/d),{x:g,y:m,radius:s,setId:r}})))&&void 0!==e?e:[]};class RK extends Cs{onBind(){this.fromCircles={},OK(this.from.arcs).forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},OK(this.to.arcs).forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=DK(s);i.arcs=n,i.path=PK(n)}}const BK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},IK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class FK extends XC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}function YK(t,e){let i=0;for(let s=0;s0)return g.getInstance().error("Initial bisect points must have opposite signs"),NaN;if(0===r)return e;if(0===a)return i;for(let i=0;i=0&&(e=i),Math.abs(o)o+r*n*l||h>=p)u=n;else{if(Math.abs(c)<=-a*l)return n;c*(u-d)>=0&&(u=d),d=n,p=h}return 0}n=n||1,r=r||1e-6,a=a||.1;for(let g=0;g<10;++g){if(VK(s.x,1,i.x,n,e),h=s.fx=t(s.x,s.fxprime),c=bt(s.fxprime,e),h>o+r*n*l||g&&h>=d)return p(u,n,d);if(Math.abs(c)<=-a*l)return n;if(c>=0)return p(n,u,h);d=h,u=n,n*=2}return n}function UK(t,e,i){let s={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let a,o=1;const l=(i=i||{}).maxIterations||20*e.length;s.fx=t(s.x,s.fxprime);const h=s.fxprime.slice();NK(h,s.fxprime,-1);for(let e=0;e=g[p-1].fx){let i=!1;if(v.fx>e.fx?(VK(y,1+d,f,-d,e),y.fx=t(y),y.fx=1)break;for(let e=1;e=Math.min(s[a].size,s[o].size)&&(r=0),n[a].push({set:o,size:i.size,weight:r}),n[o].push({set:a,size:i.size,weight:r})}const r=[];for(const t in n)if(n.hasOwnProperty(t)){let e=0;for(let i=0;i=8){const n=function(t,e){const i=(e=e||{}).restarts||10,s=[],n={};let r;for(r=0;r=Math.min(e[r].size,e[a].size)?l=1:t.size<=1e-10&&(l=-1),n[r][a]=n[a][r]=l})),{distances:s,constraints:n}}(t,s,n);let o=a.distances;const l=a.constraints,h=zK(o.map(zK))/o.length;o=o.map((t=>t.map((t=>t/h))));const d=function(t,e){return function(t,e,i,s){let n,r=0;for(n=0;n0&&g<=c||u<0&&g>=c||(r+=2*m*m,e[2*n]+=4*m*(a-h),e[2*n+1]+=4*m*(o-d),e[2*l]+=4*m*(h-a),e[2*l+1]+=4*m*(d-o))}}return r}(t,e,o,l)};let c,u;for(r=0;rkY(e)));u=UK(d,t,e),(!c||u.fx0){const e=t[0].x,i=t[0].y;for(s=0;s1){const i=Math.atan2(t[1].x,t[1].y)-e,n=Math.cos(i),r=Math.sin(i);let a,o;for(s=0;s2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(s=0;s=n&&(s=i[r],n=a)}const r=$K((function(i){return-1*JK({x:i[0],y:i[1]},t,e)}),[s.x,s.y],{maxIterations:500,minErrorDelta:1e-10}).x;let a={x:r[0],y:r[1]},o=!0;for(let e=0;et[e].radius){o=!1;break}for(let t=0;t{const{x0:i,x1:s,y0:n,y1:r,setField:a="sets",valueField:o="size",orientation:l=Math.PI/2,orientationOrder:h=null}=t;let d={},c={};if(e.length>0){const u=e.map((t=>({sets:Fa(t[a]),size:t[o]})));let p=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const i=e.initialLayout||XK,s=e.lossFunction||YK,n=i(t=function(t){t=t.slice();const e=[],i={};for(let s=0;se)}));for(let s=0;s0&&g.getInstance().error("Area "+r+" not represented on screen")}return i}(d,u)}return e.map((t=>{const e=Fa(t[a]),i=e.toString(),s=c[i],n=Object.assign(Object.assign({},t),{datum:t,sets:e,key:i,size:t[o],labelX:null==s?void 0:s.x,labelY:null==s?void 0:s.y}),r=d[i];if(r)return Object.assign(Object.assign({},n),{type:"circle",x:r.x,y:r.y,radius:r.radius});const l=DK(e.map((t=>d[t])));return Object.assign(Object.assign({},n),{type:"overlap",x:0,y:0,path:PK(l),arcs:l})}))},tq=(t,e)=>e.filter((e=>e.type===t.datumType));class eq extends KC{constructor(){super(...arguments),this.type=fl.venn,this.transformerConstructor=FK,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:bT)}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){const e=this._data.getProduct();e&&e.transform([{type:"venn",x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,setField:this._categoryField,valueField:this._valueField}]),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(eq.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(eq.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},Sy.STATE_NORMAL,Oy.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},Sy.STATE_NORMAL,Oy.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},Sy.STATE_HOVER,Oy.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>SK(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},Sy.STATE_NORMAL,Oy.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>SK(t.sets)},Sy.STATE_NORMAL,Oy.Series))}initTooltip(){this._tooltipHelper=new MK(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:SK(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return SK(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[SK(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Fa(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(SK(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),zC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(HC(null===(e=Xl.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),zC(t.name,this._spec,this._markAttributeContext)))}))}}eq.type=fl.venn,eq.mark=kK,eq.transformerConstructor=FK;class iq extends cO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,circle:t.circle,overlap:t.overlap,overlapLabel:t.overlapLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class sq extends fO{constructor(){super(...arguments),this.transformerConstructor=iq,this.type="venn",this.seriesType=fl.venn}}sq.type="venn",sq.seriesType=fl.venn,sq.transformerConstructor=iq;var nq=i(6311),rq=i.n(nq),aq=i(5072),oq=i.n(aq),lq=i(7825),hq=i.n(lq),dq=i(7659),cq=i.n(dq),uq=i(5056),pq=i.n(uq),gq=i(540),mq=i.n(gq),_q=i(1113),fq=i.n(_q),vq=i(8932),yq={};yq.styleTagTransform=fq(),yq.setAttributes=pq(),yq.insert=cq().bind(null,"head"),yq.domAPI=hq(),yq.insertStyleElement=mq(),oq()(vq.A,yq),vq.A&&vq.A.locals&&vq.A.locals;var bq=i(4353),xq=i(3826),Sq=i.n(xq),Mq=i(8569),kq=i.n(Mq);function Aq(t,e){if((i=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var i,s=t.slice(0,i);return[s.length>1?s[0]+s.slice(2):s,+t.slice(i+1)]}i(5662),i(2355),i(8361),i(3309),i(9865),i(5592),i(1289),i(539),i(4405),i(2338),i(1130),i(1532),i(9990),i(5944),i(1092),i(4608),i(2509),i(9294),i(2745),i(5530),i(5993),i(9751),i(4780),i(5681),i(2706),i(2878),i(3672),i(494),i(2187),i(4072),i(9881),i(1995),i(2026),i(7329),i(7690),i(912),i(5571),i(2673),i(2619),i(5826),i(3713),i(1219),i(4719),i(3532),i(2498),i(7317),i(4288),i(4007),i(292),i(9964),i(7674),i(6290),i(3433),i(813),i(9836),i(4061),i(8418),i(3562),i(8660),i(7409),i(2010),i(2830),i(5811),i(8809),i(8298),i(4309),i(7420),i(5513),i(9286),i(3900),i(952),i(7741),i(6481),i(1335),i(6101),i(6364),i(8003),i(6605),i(4457),i(8615),i(3860),i(4485),i(6467),i(623),i(2739),i(5877),i(5376),i(2698),i(6462),i(6400),i(9677),i(9464),i(6803),i(7205),i(880),i(465),i(9423),i(3225),i(2218),i(2369),i(4509),i(4334),i(2796),i(5414),i(3222),i(5285),i(5665),i(6847),i(9998),i(5977),i(7439),i(5616),i(2487),i(9160),i(1340),i(2979),i(7250),i(7406),i(8928),i(5012),i(7081),i(2544),i(8142),i(321),i(4895),i(3187),i(8804),i(5084),i(9911),i(4173),i(1750),i(950),i(4734),i(860),i(5760),i(7933),i(6033),i(122),i(1349),i(6007),i(9252),i(225),i(3473);var wq,Tq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lq(t){if(!(e=Tq.exec(t)))throw new Error("invalid format: "+t);var e;return new Cq({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Cq(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Eq(t,e){var i=Aq(t,e);if(!i)return t+"";var s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}Lq.prototype=Cq.prototype,Cq.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Dq={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Eq(100*t,e),r:Eq,s:function(t,e){var i=Aq(t,e);if(!i)return t+"";var s=i[0],n=i[1],r=n-(wq=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+Aq(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Pq(t){return t}var Oq,Rq,Bq=Array.prototype.map,Iq=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fq(t){var e,i,s=void 0===t.grouping||void 0===t.thousands?Pq:(e=Bq.call(t.grouping,Number),i=t.thousands+"",function(t,s){for(var n=t.length,r=[],a=0,o=e[0],l=0;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Pq:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Bq.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=Lq(t)).fill,i=t.align,c=t.sign,u=t.symbol,p=t.zero,g=t.width,m=t.comma,_=t.precision,f=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Dq[v]||(void 0===_&&(_=12),f=!0,v="g"),(p||"0"===e&&"="===i)&&(p=!0,e="0",i="=");var y="$"===u?n:"#"===u&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===u?r:/[%p]/.test(v)?l:"",x=Dq[v],S=/[defgprs%]/.test(v);function M(t){var n,r,l,u=y,M=b;if("c"===v)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?d:x(Math.abs(t),_),f&&(t=function(t){t:for(var e,i=t.length,s=1,n=-1;s0&&(n=0)}return n>0?t.slice(0,n)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==c&&(k=!1),u=(k?"("===c?c:h:"-"===c||"("===c?"":c)+u,M=("s"===v?Iq[8+wq/3]:"")+M+(k&&"("===c?")":""),S)for(n=-1,r=t.length;++n(l=t.charCodeAt(n))||l>57){M=(46===l?a+t.slice(n+1):t.slice(n))+M,t=t.slice(0,n);break}}m&&!p&&(t=s(t,1/0));var A=u.length+t.length+M.length,w=A>1)+u+t+M+w.slice(A);break;default:t=w+u+t+M}return o(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:c,formatPrefix:function(t,e){var i,s=c(((t=Lq(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor((i=e,((i=Aq(Math.abs(i)))?i[1]:NaN)/3)))),r=Math.pow(10,-n),a=Iq[8+n/3];return function(t){return s(r*t)+a}}}}Oq=Fq({thousands:",",grouping:[3],currency:["$",""]}),Rq=Oq.format,Oq.formatPrefix,xI(),UB(),Xl.registerAnimation("vennCircle",((t,e)=>({appear:BK(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),Xl.registerAnimation("vennOverlap",((t,e)=>({appear:IK(e),update:{custom:RK},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),PC(),fc.registerTransform("venn",{transform:QK,markPhase:"beforeJoin"},!0),fc.registerTransform("vennMark",{transform:tq,markPhase:"beforeJoin"},!0),Xl.registerSeries(eq.type,eq),Xl.registerChart(sq.type,sq),bq.extend(Sq()),bq.extend(kq()),HTMLWidgets.widget({name:"vchart",type:"output",factory:function(t,e,i){let s;return{renderValue:function(e){var i=document.getElementById(t.id);if(i.style.display="flex",i.style.flexDirection="column",e.hasOwnProperty("select")){const e=document.createElement("select");e.id=t.id+"_select",i.appendChild(e)}const n=document.createElement("div");if(n.style.flex="1 1 auto",i.appendChild(n),e.hasOwnProperty("map")&&xK.registerMap(e.map.name,e.map.topojson,{type:"topojson",object:"map"}),void 0===s?(s=new xK(e.specs,{dom:n}),s.renderAsync()):s.updateSpec(e.specs),e.hasOwnProperty("theme"),e.hasOwnProperty("events"))for(let t=0;t{console.log(t),console.log(e.select.data[t.value]),s.updateData(e.select.dataId,e.select.data[t[0].value])},new(rq())(r)}},resize:function(t,e){}}}})})();var n=window;for(var r in s)n[r]=s[r];s.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={8932:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var s=i(1601),n=i.n(s),r=i(6314),a=i.n(r)()(n());a.push([t.id,":root{--ss-primary-color: #5897fb;--ss-bg-color: #ffffff;--ss-font-color: #4d4d4d;--ss-font-placeholder-color: #8d8d8d;--ss-disabled-color: #dcdee2;--ss-border-color: #dcdee2;--ss-highlight-color: #fffb8c;--ss-success-color: #00b755;--ss-error-color: #dc3545;--ss-focus-color: #5897fb;--ss-main-height: 30px;--ss-content-height: 300px;--ss-spacing-l: 7px;--ss-spacing-m: 5px;--ss-spacing-s: 3px;--ss-animation-timing: 0.2s;--ss-border-radius: 4px}@keyframes ss-valueIn{0%{transform:scale(0);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes ss-valueOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.ss-hide{display:none !important}.ss-main{display:flex;flex-direction:row;position:relative;user-select:none;color:var(--ss-font-color);min-height:var(--ss-main-height);width:100%;padding:var(--ss-spacing-s);cursor:pointer;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;box-sizing:border-box;transition:background-color var(--ss-animation-timing);overflow:hidden}.ss-main:focus{box-shadow:0 0 5px var(--ss-focus-color)}.ss-main.ss-disabled{background-color:var(--ss-disabled-color);cursor:not-allowed}.ss-main.ss-disabled .ss-values .ss-disabled{color:var(--ss-font-color)}.ss-main.ss-disabled .ss-values .ss-value .ss-value-delete{cursor:not-allowed}.ss-main.ss-open-above{border-top-left-radius:0px;border-top-right-radius:0px}.ss-main.ss-open-below{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.ss-main .ss-values{display:inline-flex;flex-wrap:wrap;gap:var(--ss-spacing-m);flex:1 1 100%}.ss-main .ss-values .ss-placeholder{display:flex;padding:var(--ss-spacing-s) var(--ss-spacing-m) var(--ss-spacing-s) var(--ss-spacing-m);margin:auto 0px auto 0px;line-height:1em;align-items:center;width:100%;color:var(--ss-font-placeholder-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ss-main .ss-values .ss-max{display:flex;user-select:none;align-items:center;width:fit-content;font-size:12px;color:var(--ss-bg-color);line-height:1;padding:var(--ss-spacing-s) var(--ss-spacing-m);background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius)}.ss-main .ss-values .ss-single{display:flex;margin:auto 0px auto var(--ss-spacing-s)}.ss-main .ss-values .ss-value{display:flex;user-select:none;align-items:center;width:fit-content;background-color:var(--ss-primary-color);border-radius:var(--ss-border-radius);animation-name:ss-valueIn;animation-duration:var(--ss-animation-timing);animation-timing-function:ease-out;animation-fill-mode:both}.ss-main .ss-values .ss-value.ss-value-out{animation-name:ss-valueOut;animation-duration:var(--ss-animation-timing);animation-timing-function:ease-out}.ss-main .ss-values .ss-value .ss-value-text{font-size:12px;color:var(--ss-bg-color);line-height:1;padding:var(--ss-spacing-s) var(--ss-spacing-m)}.ss-main .ss-values .ss-value .ss-value-delete{display:flex;align-items:center;height:var(--ss-spacing-l);width:var(--ss-spacing-l);padding:var(--ss-spacing-s) var(--ss-spacing-m);cursor:pointer;border-left:solid 1px var(--ss-bg-color);box-sizing:content-box}.ss-main .ss-values .ss-value .ss-value-delete svg{height:var(--ss-spacing-l);width:var(--ss-spacing-l)}.ss-main .ss-values .ss-value .ss-value-delete svg path{fill:none;stroke:var(--ss-bg-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-deselect{flex:0 1 auto;display:flex;align-items:center;justify-content:center;width:fit-content;height:auto;padding:0 var(--ss-spacing-m) 0 var(--ss-spacing-m)}.ss-main .ss-deselect svg{width:8px;height:8px}.ss-main .ss-deselect svg path{fill:none;stroke:var(--ss-font-color);stroke-width:20;stroke-linecap:round;stroke-linejoin:round}.ss-main .ss-arrow{flex:0 1 auto;display:flex;align-items:center;justify-content:flex-end;width:12px;height:12px;margin:auto var(--ss-spacing-m) auto var(--ss-spacing-m)}.ss-main .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;transition-timing-function:ease-out;transition:var(--ss-animation-timing)}.ss-content{position:absolute;display:flex;height:auto;flex-direction:column;width:auto;max-height:var(--ss-content-height);box-sizing:border-box;border:solid 1px var(--ss-border-color);background-color:var(--ss-bg-color);transition:transform var(--ss-animation-timing),opacity var(--ss-animation-timing);opacity:0;transform:scaleY(0);transform-origin:center top;overflow:hidden;z-index:10000}.ss-content.ss-relative{position:relative;height:100%}.ss-content.ss-open-above{flex-direction:column-reverse;opacity:1;transform:scaleY(1);transform-origin:center bottom;border-top-left-radius:var(--ss-border-radius);border-top-right-radius:var(--ss-border-radius)}.ss-content.ss-open-below{opacity:1;transform:scaleY(1);transform-origin:center top;border-bottom-left-radius:var(--ss-border-radius);border-bottom-right-radius:var(--ss-border-radius)}.ss-content .ss-search{flex:0 1 auto;display:flex;flex-direction:row;padding:var(--ss-spacing-l) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l)}.ss-content .ss-search input{display:inline-flex;font-size:inherit;line-height:inherit;flex:1 1 auto;width:100%;min-width:0px;padding:var(--ss-spacing-m) var(--ss-spacing-l);margin:0;border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius);background-color:var(--ss-bg-color);outline:0;text-align:left;box-sizing:border-box}.ss-content .ss-search input::placeholder{color:var(--ss-font-placeholder-color);vertical-align:middle}.ss-content .ss-search input:focus{box-shadow:0 0 5px var(--ss-focus-color)}.ss-content .ss-search .ss-addable{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;flex:0 0 auto;height:auto;margin:0 0 0 var(--ss-spacing-m);border:1px solid var(--ss-border-color);border-radius:var(--ss-border-radius)}.ss-content .ss-search .ss-addable svg{display:flex;align-items:center;justify-content:flex-end;flex:0 1 auto;width:12px;height:12px;margin:auto var(--ss-spacing-m) auto var(--ss-spacing-m)}.ss-content .ss-search .ss-addable svg path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}.ss-content .ss-list{flex:1 1 auto;height:auto;overflow-x:hidden;overflow-y:auto}.ss-content .ss-list .ss-error{color:var(--ss-error-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-searching{color:var(--ss-font-color);padding:var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup.ss-close .ss-option{display:none !important}.ss-content .ss-list .ss-optgroup .ss-optgroup-label{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-label-text{flex:1 1 auto;font-weight:bold;color:var(--ss-font-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label:has(.ss-arrow){cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions{flex:0 1 auto;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ss-spacing-m)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall{flex:0 0 auto;display:flex;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall:hover{opacity:.5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall.ss-selected svg path{stroke:var(--ss-error-color)}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall span{flex:0 1 auto;display:flex;align-items:center;justify-content:center;font-size:60%;text-align:center;padding:0 var(--ss-spacing-s) 0 0}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg{flex:0 1 auto;width:13px;height:13px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg path{fill:none;stroke:var(--ss-success-color);stroke-linecap:round;stroke-linejoin:round}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:first-child{stroke-width:5}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-selectall svg:last-child{stroke-width:11}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable{flex:0 1 auto;display:flex;flex-direction:row;cursor:pointer}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow{flex:1 1 auto;width:10px;height:10px}.ss-content .ss-list .ss-optgroup .ss-optgroup-label .ss-optgroup-actions .ss-closable .ss-arrow path{fill:none;stroke:var(--ss-font-color);stroke-width:18;stroke-linecap:round;stroke-linejoin:round;transition-timing-function:ease-out;transition:var(--ss-animation-timing)}.ss-content .ss-list .ss-optgroup .ss-option{padding:var(--ss-spacing-s) var(--ss-spacing-s) var(--ss-spacing-s) calc(var(--ss-spacing-l)*3)}.ss-content .ss-list .ss-option{display:block;padding:var(--ss-spacing-m) var(--ss-spacing-l) var(--ss-spacing-m) var(--ss-spacing-l);white-space:normal;color:var(--ss-font-color);cursor:pointer;user-select:none}.ss-content .ss-list .ss-option:hover{color:var(--ss-bg-color);background-color:var(--ss-primary-color)}.ss-content .ss-list .ss-option.ss-highlighted,.ss-content .ss-list .ss-option:not(.ss-disabled).ss-selected{color:var(--ss-bg-color);background-color:var(--ss-primary-color)}.ss-content .ss-list .ss-option.ss-disabled{cursor:not-allowed;background-color:var(--ss-disabled-color)}.ss-content .ss-list .ss-option.ss-disabled:hover{color:var(--ss-font-color)}.ss-content .ss-list .ss-option .ss-search-highlight{display:inline-block;background-color:var(--ss-highlight-color)}\n",""]);const o=a},6314:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",s=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),s&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),s&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,s,n,r){"string"==typeof t&&(t=[[null,t,void 0]]);var a={};if(s)for(var o=0;o0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),n&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=n):d[4]="".concat(n)),e.push(d))}},e}},1601:t=>{"use strict";t.exports=function(t){return t[1]}},4353:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",s="second",n="minute",r="hour",a="day",o="week",l="month",h="quarter",d="year",c="date",u="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},_=function(t,e,i){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(i)+t},f={s:_,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),s=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+_(s,2,"0")+":"+_(n,2,"0")},m:function t(e,i){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,n=o}return!s&&n&&(v=n),n||!s&&v},M=function(t,e){if(x(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new A(i)},k=f;k.l=S,k.i=x,k.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function m(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var _=m.prototype;return _.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(p);if(s){var n=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(e)}(t),this.init()},_.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},_.$utils=function(){return k},_.isValid=function(){return!(this.$d.toString()===u)},_.isSame=function(t,e){var i=M(t);return this.startOf(e)<=i&&i<=this.endOf(e)},_.isAfter=function(t,e){return M(t)12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},3309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-iq",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},9865:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-kw",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},5592:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},meridiem:function(t){return t>12?"م":"ص"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},1289:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},539:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},4405:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},2338:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:i,monthsShort:i,weekStart:6,meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(r,null,!0),r}(i(4353))},1130:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},9990:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bg",weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekStart:1,ordinal:function(t){var e=t%100;if(e>10&&e<20)return t+"-ти";var i=t%10;return 1===i?t+"-ви":2===i?t+"-ри":7===i||8===i?t+"-ми":t+"-ти"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5944:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return e.default.locale(i,null,!0),i}(i(4353))},1092:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4608:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn-bd",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),weekStart:0,preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){var e=["ই","লা","রা","ঠা","শে"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY খ্রিস্টাব্দ",LL:"D MMMM YYYY খ্রিস্টাব্দ",LLL:"D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়",LLLL:"dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়"},meridiem:function(t){return t<4?"রাত":t<6?"ভোর":t<12?"সকাল":t<15?"দুপুর":t<18?"বিকাল":t<20?"সন্ধ্যা":"রাত"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},2509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){return t},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},9294:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔོན་ལ་",s:"ཏོག་ཙམ་",m:"སྐར་མ་གཅིག་",mm:"སྐར་མ་ %d",h:"ཆུ་ཚོད་གཅིག་",hh:"ཆུ་ཚོད་ %d",d:"ཉིན་གཅིག་",dd:"ཉིན་ %d",M:"ཟླ་བ་གཅིག་",MM:"ཟླ་བ་ %d",y:"ལོ་གཅིག་",yy:"ལོ་ %d"}};return e.default.locale(i,null,!0),i}(i(4353))},2745:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>9?i(t%10):t}function s(t,e,i){return t+" "+function(t,e){return 2===e?function(t){return{m:"v",b:"v",d:"z"}[t.charAt(0)]+t.substring(1)}(t):t}({mm:"munutenn",MM:"miz",dd:"devezh"}[i],t)}var n={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:s,h:"un eur",hh:"%d eur",d:"un devezh",dd:s,M:"ur miz",MM:s,y:"ur bloaz",yy:function(t){switch(i(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}},meridiem:function(t){return t<12?"a.m.":"g.m."}};return e.default.locale(n,null,!0),n}(i(4353))},5530:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5993:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(t){return t+(1===t||3===t?"r":2===t?"n":4===t?"t":"è")}};return e.default.locale(i,null,!0),i}(i(4353))},9751:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekund":"pár sekundami";case"m":return e?"minuta":n?"minutu":"minutou";case"mm":return e||n?r+(i(t)?"minuty":"minut"):r+"minutami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodin"):r+"hodinami";case"d":return e||n?"den":"dnem";case"dd":return e||n?r+(i(t)?"dny":"dní"):r+"dny";case"M":return e||n?"měsíc":"měsícem";case"MM":return e||n?r+(i(t)?"měsíce":"měsíců"):r+"měsíci";case"y":return e||n?"rok":"rokem";case"yy":return e||n?r+(i(t)?"roky":"let"):r+"lety"}}var n={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},4780:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5681:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return e.default.locale(i,null,!0),i}(i(4353))},2706:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2878:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},3672:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},494:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},2187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4072:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(t){return t},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},9881:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},1995:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2026:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},7329:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},7690:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},912:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5571:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2673:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-sg",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2619:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}}}()},3713:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return e.default.locale(i,null,!0),i}(i(4353))},1219:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},4719:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-mx",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},3532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},2498:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},7317:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},4288:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return e?(n[i][2]?n[i][2]:n[i][1]).replace("%d",t):(s?n[i][0]:n[i][1]).replace("%d",t)}var s={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:"%d päeva",M:i,MM:i,y:i,yy:i},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},4007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return e.default.locale(i,null,!0),i}(i(4353))},292:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fa",weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},9964:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},r={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},a=s&&!e?r:n,o=a[i];return t<10?o.replace("%d",a.numbers[t]):o.replace("%d",t)}var s={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"%s päästä",past:"%s sitten",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return e.default.locale(s,null,!0),s}(i(4353))},7674:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return e.default.locale(i,null,!0),i}(i(4353))},6290:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},3433:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},813:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return e.default.locale(i,null,!0),i}(i(4353))},9836:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return e.default.locale(i,null,!0),i}(i(4353))},4061:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return e.default.locale(i,null,!0),i}(i(4353))},8418:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return e.default.locale(i,null,!0),i}(i(4353))},3562:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},8660:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return e.default.locale(i,null,!0),i}(i(4353))},7409:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return e.default.locale(i,null,!0),i}(i(4353))},2010:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",hh2:"שעתיים",d:"יום",dd:"%d ימים",dd2:"יומיים",M:"חודש",MM:"%d חודשים",MM2:"חודשיים",y:"שנה",yy:"%d שנים",yy2:"שנתיים"};function s(t,e,s){return(i[s+(2===t?"2":"")]||i[s]).replace("%d",t)}var n={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinal:function(t){return t},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return e.default.locale(n,null,!0),n}(i(4353))},2830:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return e.default.locale(i,null,!0),i}(i(4353))},5811:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),s="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:r,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(t){return t+"."}};return e.default.locale(a,null,!0),a}(i(4353))},8809:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return e.default.locale(i,null,!0),i}(i(4353))},8298:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:function(t,e,i,s){return"néhány másodperc"+(s||e?"":"e")},m:function(t,e,i,s){return"egy perc"+(s||e?"":"e")},mm:function(t,e,i,s){return t+" perc"+(s||e?"":"e")},h:function(t,e,i,s){return"egy "+(s||e?"óra":"órája")},hh:function(t,e,i,s){return t+" "+(s||e?"óra":"órája")},d:function(t,e,i,s){return"egy "+(s||e?"nap":"napja")},dd:function(t,e,i,s){return t+" "+(s||e?"nap":"napja")},M:function(t,e,i,s){return"egy "+(s||e?"hónap":"hónapja")},MM:function(t,e,i,s){return t+" "+(s||e?"hónap":"hónapja")},y:function(t,e,i,s){return"egy "+(s||e?"év":"éve")},yy:function(t,e,i,s){return t+" "+(s||e?"év":"éve")}},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return e.default.locale(i,null,!0),i}(i(4353))},7420:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},5513:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:["nokkrar sekúndur","nokkrar sekúndur","nokkrum sekúndum"],m:["mínúta","mínútu","mínútu"],mm:["mínútur","mínútur","mínútum"],h:["klukkustund","klukkustund","klukkustund"],hh:["klukkustundir","klukkustundir","klukkustundum"],d:["dagur","dag","degi"],dd:["dagar","daga","dögum"],M:["mánuður","mánuð","mánuði"],MM:["mánuðir","mánuði","mánuðum"],y:["ár","ár","ári"],yy:["ár","ár","árum"]};function s(t,e,s,n){var r=function(t,e,s,n){var r=n?0:s?1:2,a=2===t.length&&e%10==1?t[0]:t,o=i[a][r];return 1===t.length?o:"%d "+o}(s,t,n,e);return r.replace("%d",t)}var n={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9286:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};return e.default.locale(i,null,!0),i}(i(4353))},3900:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},952:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t){return t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(t){return t<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return e.default.locale(i,null,!0),i}(i(4353))},7741:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return e.default.locale(i,null,!0),i}(i(4353))},6481:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1335:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},6101:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return e.default.locale(i,null,!0),i}(i(4353))},6364:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return e.default.locale(i,null,!0),i}(i(4353))},8003:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(t){return t+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(t){return t<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return e.default.locale(i,null,!0),i}(i(4353))},6605:function(t,e,i){!function(t,e){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(e),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],a={name:"ku",months:r,monthsShort:r,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(t){return t<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};i.default.locale(a,null,!0),t.default=a,t.englishToArabicNumbersMap=s,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(4353))},4457:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return e.default.locale(i,null,!0),i}(i(4353))},8615:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return e.default.locale(i,null,!0),i}(i(4353))},3860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return e.default.locale(i,null,!0),i}(i(4353))},4485:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),s="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),n=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:r,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"mėnesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return e.default.locale(a,null,!0),a}(i(4353))},6467:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return e.default.locale(i,null,!0),i}(i(4353))},623:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},2739:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return e.default.locale(i,null,!0),i}(i(4353))},5877:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5376:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return e.default.locale(i,null,!0),i}(i(4353))},2698:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return e.default.locale(i,null,!0),i}(i(4353))},6462:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return e.default.locale(i,null,!0),i}(i(4353))},6400:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return e.default.locale(i,null,!0),i}(i(4353))},9677:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},9464:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return e.default.locale(i,null,!0),i}(i(4353))},6803:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return e.default.locale(i,null,!0),i}(i(4353))},7205:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},880:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(t){return(""+t).replace(/\d/g,(function(t){return"०१२३४५६७८९"[t]}))},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return e.default.locale(i,null,!0),i}(i(4353))},465:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},9423:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(t){return"["+t+(1===t||8===t||t>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},3473:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},9252:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return e.default.locale(i,null,!0),i}(i(4353))},3225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function s(t,e,s){var n=t+" ";switch(s){case"m":return e?"minuta":"minutę";case"mm":return n+(i(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return n+(i(t)?"godziny":"godzin");case"MM":return n+(i(t)?"miesiące":"miesięcy");case"yy":return n+(i(t)?"lata":"lat")}}var n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),a=/D MMMM/,o=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};o.s=r,o.f=n;var l={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:o,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:s,y:"rok",yy:s},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(l,null,!0),l}(i(4353))},2218:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},2369:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},4509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rn",weekdays:"Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu".split("_"),weekdaysShort:"Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat".split("_"),weekdaysMin:"K7_K1_K2_K3_K4_K5_K6".split("_"),months:"Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama".split("_"),monthsShort:"Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4334:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},2796:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),n="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),r="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),a=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function o(t,e,i){var s,n;return"m"===i?e?"минута":"минуту":t+" "+(s=+t,n={mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var l=function(t,e){return a.test(e)?i[t.month()]:s[t.month()]};l.s=s,l.f=i;var h=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};h.s=r,h.f=n;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:l,monthsShort:h,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:o,mm:o,h:"час",hh:o,d:"день",dd:o,M:"месяц",MM:o,y:"год",yy:o},ordinal:function(t){return t},meridiem:function(t){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"}};return e.default.locale(d,null,!0),d}(i(4353))},5414:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},3222:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},5285:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return e.default.locale(i,null,!0),i}(i(4353))},5665:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),monthsShort:"දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),ordinal:function(t){return t},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"විනාඩිය",mm:"විනාඩි %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6847:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekúnd":"pár sekundami";case"m":return e?"minúta":n?"minútu":"minútou";case"mm":return e||n?r+(i(t)?"minúty":"minút"):r+"minútami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodín"):r+"hodinami";case"d":return e||n?"deň":"dňom";case"dd":return e||n?r+(i(t)?"dni":"dní"):r+"dňami";case"M":return e||n?"mesiac":"mesiacom";case"MM":return e||n?r+(i(t)?"mesiace":"mesiacov"):r+"mesiacmi";case"y":return e||n?"rok":"rokom";case"yy":return e||n?r+(i(t)?"roky":"rokov"):r+"rokmi"}}var n={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9998:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%100==2}function s(t){return t%100==3||t%100==4}function n(t,e,n,r){var a=t+" ";switch(n){case"s":return e||r?"nekaj sekund":"nekaj sekundami";case"m":return e?"ena minuta":"eno minuto";case"mm":return i(t)?a+(e||r?"minuti":"minutama"):s(t)?a+(e||r?"minute":"minutami"):a+(e||r?"minut":"minutami");case"h":return e?"ena ura":"eno uro";case"hh":return i(t)?a+(e||r?"uri":"urama"):s(t)?a+(e||r?"ure":"urami"):a+(e||r?"ur":"urami");case"d":return e||r?"en dan":"enim dnem";case"dd":return i(t)?a+(e||r?"dneva":"dnevoma"):a+(e||r?"dni":"dnevi");case"M":return e||r?"en mesec":"enim mesecem";case"MM":return i(t)?a+(e||r?"meseca":"mesecema"):s(t)?a+(e||r?"mesece":"meseci"):a+(e||r?"mesecev":"meseci");case"y":return e||r?"eno leto":"enim letom";case"yy":return i(t)?a+(e||r?"leti":"letoma"):s(t)?a+(e||r?"leta":"leti"):a+(e||r?"let":"leti")}}var r={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"čez %s",past:"pred %s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n}};return e.default.locale(r,null,!0),r}(i(4353))},5977:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return e.default.locale(i,null,!0),i}(i(4353))},7439:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["један минут","једног минута"],mm:["%d минут","%d минута","%d минута"],h:["један сат","једног сата"],hh:["%d сат","%d сата","%d сати"],d:["један дан","једног дана"],dd:["%d дан","%d дана","%d дана"],M:["један месец","једног месеца"],MM:["%d месец","%d месеца","%d месеци"],y:["једну годину","једне године"],yy:["%d годину","%d године","%d година"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"једна година":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d годину"===a?t+" година":a.replace("%d",t)}},s={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},5616:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["jedan minut","jednog minuta"],mm:["%d minut","%d minuta","%d minuta"],h:["jedan sat","jednog sata"],hh:["%d sat","%d sata","%d sati"],d:["jedan dan","jednog dana"],dd:["%d dan","%d dana","%d dana"],M:["jedan mesec","jednog meseca"],MM:["%d mesec","%d meseca","%d meseci"],y:["jednu godinu","jedne godine"],yy:["%d godinu","%d godine","%d godina"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"jedna godina":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d godinu"===a?t+" godina":a.replace("%d",t)}},s={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},2487:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return e.default.locale(i,null,!0),i}(i(4353))},9160:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv-fi",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY, [kl.] HH.mm",LLLL:"dddd, D. MMMM YYYY, [kl.] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [kl.] HH.mm",llll:"ddd, D. MMM YYYY, [kl.] HH.mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},1340:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2979:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},7250:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return e.default.locale(i,null,!0),i}(i(4353))},7406:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return e.default.locale(i,null,!0),i}(i(4353))},8928:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return e.default.locale(i,null,!0),i}(i(4353))},5012:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return e.default.locale(i,null,!0),i}(i(4353))},7081:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},2544:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},8142:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return e.default.locale(i,null,!0),i}(i(4353))},321:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4895:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},3187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return e.default.locale(i,null,!0),i}(i(4353))},8804:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return e.default.locale(i,null,!0),i}(i(4353))},5084:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return e.default.locale(i,null,!0),i}(i(4353))},9911:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return e.default.locale(i,null,!0),i}(i(4353))},4173:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),s="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function r(t,e,i){var s,n;return"m"===i?e?"хвилина":"хвилину":"h"===i?e?"година":"годину":t+" "+(s=+t,n={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var a=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};a.s=s,a.f=i;var o={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:a,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:r,mm:r,h:r,hh:r,d:"день",dd:r,M:"місяць",MM:r,y:"рік",yy:r},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return e.default.locale(o,null,!0),o}(i(4353))},1750:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},950:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return e.default.locale(i,null,!0),i}(i(4353))},4734:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"%s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return e.default.locale(i,null,!0),i}(i(4353))},860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return e.default.locale(i,null,!0),i}(i(4353))},5760:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return e.default.locale(i,null,!0),i}(i(4353))},7933:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6033:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},122:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},1349:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},6007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},8569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(i,s,n){var r,a=function(t,i,s){void 0===s&&(s={});var n=new Date(t),r=function(t,i){void 0===i&&(i={});var s=i.timeZoneName||"short",n=t+"|"+s,r=e[n];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),e[n]=r),r}(i,s);return r.formatToParts(n)},o=function(e,i){for(var s=a(e,i),r=[],o=0;o=0&&(r[c]=parseInt(d,10))}var u=r[3],p=24===u?0:u,g=r[0]+"-"+r[1]+"-"+r[2]+" "+p+":"+r[4]+":"+r[5]+":000",m=+e;return(n.utc(g).valueOf()-(m-=m%1e3))/6e4},l=s.prototype;l.tz=function(t,e){void 0===t&&(t=r);var i,s=this.utcOffset(),a=this.toDate(),o=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(o))/1e3/60),h=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(h)){if(i=n(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),e){var d=i.utcOffset();i=i.add(s-d,"minute")}}else i=this.utcOffset(0,e);return i.$x.$timezone=t,i},l.offsetName=function(t){var e=this.$x.$timezone||n.tz.guess(),i=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var h=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return h.call(this,t,e);var i=n(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(i,t,e).tz(this.$x.$timezone,!0)},n.tz=function(t,e,i){var s=i&&e,a=i||e||r,l=o(+n(),a);if("string"!=typeof t)return n(t).tz(a);var h=function(t,e,i){var s=t-60*e*1e3,n=o(s,i);if(e===n)return[s,e];var r=o(s-=60*(n-e)*1e3,i);return n===r?[s,n]:[t-60*Math.min(n,r)*1e3,Math.max(n,r)]}(n.utc(t,s).valueOf(),l,a),d=h[0],c=h[1],u=n(d).utcOffset(c);return u.$x.$timezone=a,u},n.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},n.tz.setDefault=function(t){r=t}}}()},3826:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,n,r){var a=n.prototype;r.utc=function(t){return new n({date:t,utc:!0,args:arguments})},a.utc=function(e){var i=r(this.toDate(),{locale:this.$L,utc:!0});return e?i.add(this.utcOffset(),t):i},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var h=a.utcOffset;a.utcOffset=function(s,n){var r=this.$utils().u;if(r(s))return this.$u?0:r(this.$offset)?h.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(e);if(!s)return null;var n=(""+s[0]).match(i)||["-",0,0],r=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===r?a:-a}(s),null===s))return this;var a=Math.abs(s)<=16?60*s:s,o=this;if(n)return o.$offset=a,o.$u=0===s,o;if(0!==s){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(a+l,t)).$offset=a,o.$x.$localOffset=l}else o=this.utc();return o};var d=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var c=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=a.diff;a.diff=function(t,e,i){if(t&&this.$u===t.$u)return u.call(this,t,e,i);var s=this.local(),n=r(t).local();return u.call(s,n,e,i)}}}()},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n{var s=i(833);function n(e,i){var s=e.geometry,n=s.type;if("LineString"===n)s.coordinates=t.exports.simplify(s.coordinates,i);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r{var s=i(1447),n=function(t,e){for(var i=0,r=0,a=1;a<=t.length-2;a++){var o=new s(t[0],t[t.length-1]).perpendicularDistance(t[a]);o>i&&(r=a,i=o)}if(i>e)var l=n(t.slice(0,r),e),h=n(t.slice(r,t.length),e),d=l.concat(h);else d=t.length>1?[t[0],t[t.length-1]]:[t[0]];return d};t.exports=n},1447:t=>{var e=function(t,e){this.p1=t,this.p2=e};e.prototype.rise=function(){return this.p2[1]-this.p1[1]},e.prototype.run=function(){return this.p2[0]-this.p1[0]},e.prototype.slope=function(){return this.rise()/this.run()},e.prototype.yIntercept=function(){return this.p1[1]-this.p1[0]*this.slope(this.p1,this.p2)},e.prototype.isVertical=function(){return!isFinite(this.slope())},e.prototype.isHorizontal=function(){return this.p1[1]==this.p2[1]},e.prototype._perpendicularDistanceHorizontal=function(t){return Math.abs(this.p1[1]-t[1])},e.prototype._perpendicularDistanceVertical=function(t){return Math.abs(this.p1[0]-t[0])},e.prototype._perpendicularDistanceHasSlope=function(t){var e=this.slope(),i=this.yIntercept();return Math.abs(e*t[0]-t[1]+i)/Math.sqrt(Math.pow(e,2)+1)},e.prototype.perpendicularDistance=function(t){return this.isVertical()?this._perpendicularDistanceVertical(t):this.isHorizontal()?this._perpendicularDistanceHorizontal(t):this._perpendicularDistanceHasSlope(t)},t.exports=e},6311:function(t){t.exports=function(){"use strict";class t{constructor(t){t||(t={}),this.main=t.main||"ss-main",this.placeholder=t.placeholder||"ss-placeholder",this.values=t.values||"ss-values",this.single=t.single||"ss-single",this.max=t.max||"ss-max",this.value=t.value||"ss-value",this.valueText=t.valueText||"ss-value-text",this.valueDelete=t.valueDelete||"ss-value-delete",this.valueOut=t.valueOut||"ss-value-out",this.deselect=t.deselect||"ss-deselect",this.deselectPath=t.deselectPath||"M10,10 L90,90 M10,90 L90,10",this.arrow=t.arrow||"ss-arrow",this.arrowClose=t.arrowClose||"M10,30 L50,70 L90,30",this.arrowOpen=t.arrowOpen||"M10,70 L50,30 L90,70",this.content=t.content||"ss-content",this.openAbove=t.openAbove||"ss-open-above",this.openBelow=t.openBelow||"ss-open-below",this.search=t.search||"ss-search",this.searchHighlighter=t.searchHighlighter||"ss-search-highlight",this.searching=t.searching||"ss-searching",this.addable=t.addable||"ss-addable",this.addablePath=t.addablePath||"M50,10 L50,90 M10,50 L90,50",this.list=t.list||"ss-list",this.optgroup=t.optgroup||"ss-optgroup",this.optgroupLabel=t.optgroupLabel||"ss-optgroup-label",this.optgroupLabelText=t.optgroupLabelText||"ss-optgroup-label-text",this.optgroupActions=t.optgroupActions||"ss-optgroup-actions",this.optgroupSelectAll=t.optgroupSelectAll||"ss-selectall",this.optgroupSelectAllBox=t.optgroupSelectAllBox||"M60,10 L10,10 L10,90 L90,90 L90,50",this.optgroupSelectAllCheck=t.optgroupSelectAllCheck||"M30,45 L50,70 L90,10",this.optgroupClosable=t.optgroupClosable||"ss-closable",this.option=t.option||"ss-option",this.optionDelete=t.optionDelete||"M10,10 L90,90 M10,90 L90,10",this.highlighted=t.highlighted||"ss-highlighted",this.open=t.open||"ss-open",this.close=t.close||"ss-close",this.selected=t.selected||"ss-selected",this.error=t.error||"ss-error",this.disabled=t.disabled||"ss-disabled",this.hide=t.hide||"ss-hide"}}function e(){return Math.random().toString(36).substring(2,10)}function i(t,e=50,i=!1){let s;return function(...n){const r=self,a=i&&!s;clearTimeout(s),s=setTimeout((()=>{s=null,i||t.apply(r,n)}),e),a&&t.apply(r,n)}}function s(t,e){return JSON.stringify(t)===JSON.stringify(e)}class n{constructor(t){if(this.id=t.id&&""!==t.id?t.id:e(),this.label=t.label||"",this.selectAll=void 0!==t.selectAll&&t.selectAll,this.selectAllText=t.selectAllText||"Select All",this.closable=t.closable||"off",this.options=[],t.options)for(const e of t.options)this.options.push(new r(e))}}class r{constructor(t){this.id=t.id&&""!==t.id?t.id:e(),this.value=void 0===t.value?t.text:t.value,this.text=t.text||"",this.html=t.html||"",this.selected=void 0!==t.selected&&t.selected,this.display=void 0===t.display||t.display,this.disabled=void 0!==t.disabled&&t.disabled,this.mandatory=void 0!==t.mandatory&&t.mandatory,this.placeholder=void 0!==t.placeholder&&t.placeholder,this.class=t.class||"",this.style=t.style||"",this.data=t.data||{}}}class a{constructor(t,e){this.selectType="single",this.data=[],this.selectedOrder=[],this.selectType=t,this.setData(e)}validateDataArray(t){if(!Array.isArray(t))return new Error("Data must be an array");for(let e of t)if(e instanceof n||"label"in e){if(!("label"in e))return new Error("Optgroup must have a label");if("options"in e&&e.options)for(let t of e.options){const e=this.validateOption(t);if(e)return e}}else{if(!(e instanceof r||"text"in e))return new Error("Data object must be a valid optgroup or option");{const t=this.validateOption(e);if(t)return t}}return null}validateOption(t){return"text"in t?null:new Error("Option must have a text")}partialToFullData(t){let e=[];return t.forEach((t=>{if(t instanceof n||"label"in t){let i=[];"options"in t&&t.options&&t.options.forEach((t=>{i.push(new r(t))})),i.length>0&&e.push(new n(t))}(t instanceof r||"text"in t)&&e.push(new r(t))})),e}setData(t){this.data=this.partialToFullData(t),"single"===this.selectType&&this.setSelectedBy("id",this.getSelected())}getData(){return this.filter(null,!0)}getDataOptions(){return this.filter(null,!1)}addOption(t,e=!1){if(e){let e=[new r(t)];this.setData(e.concat(this.getData()))}else this.setData(this.getData().concat(new r(t)))}setSelectedBy(t,e){let i=null,s=!1;const a=[];for(let o of this.data){if(o instanceof n)for(let n of o.options)i||(i=n),n.selected=!s&&e.includes(n[t]),n.selected&&(a.push(n),"single"===this.selectType&&(s=!0));o instanceof r&&(i||(i=o),o.selected=!s&&e.includes(o[t]),o.selected&&(a.push(o),"single"===this.selectType&&(s=!0)))}"single"===this.selectType&&i&&!s&&(i.selected=!0,a.push(i));const o=e.map((e=>{var i;return(null===(i=a.find((i=>i[t]===e)))||void 0===i?void 0:i.id)||""}));this.selectedOrder=o}getSelected(){return this.getSelectedOptions().map((t=>t.id))}getSelectedValues(){return this.getSelectedOptions().map((t=>t.value))}getSelectedOptions(){return this.filter((t=>t.selected),!1)}getOptgroupByID(t){for(let e of this.data)if(e instanceof n&&e.id===t)return e;return null}getOptionByID(t){let e=this.filter((e=>e.id===t),!1);return e.length?e[0]:null}getSelectType(){return this.selectType}getFirstOption(){let t=null;for(let e of this.data)if(e instanceof n?t=e.options[0]:e instanceof r&&(t=e),t)break;return t}search(t,e){return""===(t=t.trim())?this.getData():this.filter((i=>e(i,t)),!0)}filter(t,e){const i=[];return this.data.forEach((s=>{if(s instanceof n){let a=[];if(s.options.forEach((s=>{t&&!t(s)||(e?a.push(new r(s)):i.push(new r(s)))})),a.length>0){let t=new n(s);t.options=a,i.push(t)}}s instanceof r&&(t&&!t(s)||i.push(new r(s)))})),i}selectedOrderOptions(t){const e=[];return this.selectedOrder.forEach((i=>{const s=t.find((t=>t.id===i));s&&e.push(s)})),t.forEach((t=>{let i=!1;e.forEach((e=>{t.id!==e.id||(i=!0)})),i||e.push(t)})),e}}class o{constructor(t,e,i,s){this.store=i,this.settings=t,this.classes=e,this.callbacks=s,this.main=this.mainDiv(),this.content=this.contentDiv(),this.updateClassStyles(),this.updateAriaAttributes(),this.settings.contentLocation.appendChild(this.content.main)}enable(){this.main.main.classList.remove(this.classes.disabled),this.content.search.input.disabled=!1}disable(){this.main.main.classList.add(this.classes.disabled),this.content.search.input.disabled=!0}open(){this.main.arrow.path.setAttribute("d",this.classes.arrowOpen),this.main.main.classList.add("up"===this.settings.openPosition?this.classes.openAbove:this.classes.openBelow),this.main.main.setAttribute("aria-expanded","true"),this.moveContent();const t=this.store.getSelectedOptions();if(t.length){const e=t[t.length-1].id,i=this.content.list.querySelector('[data-id="'+e+'"]');i&&this.ensureElementInView(this.content.list,i)}}close(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.remove(this.classes.openBelow),this.main.main.setAttribute("aria-expanded","false"),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.main.arrow.path.setAttribute("d",this.classes.arrowClose)}updateClassStyles(){if(this.main.main.className="",this.main.main.removeAttribute("style"),this.content.main.className="",this.content.main.removeAttribute("style"),this.main.main.classList.add(this.classes.main),this.content.main.classList.add(this.classes.content),""!==this.settings.style&&(this.main.main.style.cssText=this.settings.style,this.content.main.style.cssText=this.settings.style),this.settings.class.length)for(const t of this.settings.class)""!==t.trim()&&(this.main.main.classList.add(t.trim()),this.content.main.classList.add(t.trim()));"relative"===this.settings.contentPosition&&this.content.main.classList.add("ss-"+this.settings.contentPosition)}updateAriaAttributes(){this.main.main.role="combobox",this.main.main.setAttribute("aria-haspopup","listbox"),this.main.main.setAttribute("aria-controls",this.content.main.id),this.main.main.setAttribute("aria-expanded","false"),this.content.main.setAttribute("role","listbox")}mainDiv(){var t;const e=document.createElement("div");e.dataset.id=this.settings.id,e.setAttribute("aria-label",this.settings.ariaLabel),e.tabIndex=0,e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return this.callbacks.open(),"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Enter":case" ":this.callbacks.open();const e=this.content.list.querySelector("."+this.classes.highlighted);return e&&e.click(),!1;case"Escape":return this.callbacks.close(),!1}return!0},e.onclick=t=>{this.settings.disabled||(this.settings.isOpen?this.callbacks.close():this.callbacks.open())};const i=document.createElement("div");i.classList.add(this.classes.values),e.appendChild(i);const s=document.createElement("div");s.classList.add(this.classes.deselect);const n=null===(t=this.store)||void 0===t?void 0:t.getSelectedOptions();!this.settings.allowDeselect||this.settings.isMultiple&&n&&n.length<=0?s.classList.add(this.classes.hide):s.classList.remove(this.classes.hide),s.onclick=t=>{if(t.stopPropagation(),this.settings.disabled)return;let e=!0;const i=this.store.getSelectedOptions();if(this.callbacks.beforeChange&&(e=!0===this.callbacks.beforeChange([],i)),e){if(this.settings.isMultiple)this.callbacks.setSelected([],!1),this.updateDeselectAll();else{const t=this.store.getFirstOption(),e=t?t.id:"";this.callbacks.setSelected(e,!1)}this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(this.store.getSelectedOptions())}};const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.deselectPath),r.appendChild(a),s.appendChild(r),e.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add(this.classes.arrow),o.setAttribute("viewBox","0 0 100 100");const l=document.createElementNS("http://www.w3.org/2000/svg","path");return l.setAttribute("d",this.classes.arrowClose),this.settings.alwaysOpen&&o.classList.add(this.classes.hide),o.appendChild(l),e.appendChild(o),{main:e,values:i,deselect:{main:s,svg:r,path:a},arrow:{main:o,path:l}}}mainFocus(t){"click"!==t&&this.main.main.focus({preventScroll:!0})}placeholder(){const t=this.store.filter((t=>t.placeholder),!1);let e=this.settings.placeholderText;t.length&&(""!==t[0].html?e=t[0].html:""!==t[0].text&&(e=t[0].text));const i=document.createElement("div");return i.classList.add(this.classes.placeholder),i.innerHTML=e,i}renderValues(){this.settings.isMultiple?(this.renderMultipleValues(),this.updateDeselectAll()):this.renderSingleValue()}renderSingleValue(){const t=this.store.filter((t=>t.selected&&!t.placeholder),!1),e=t.length>0?t[0]:null;if(e){const t=document.createElement("div");t.classList.add(this.classes.single),e.html?t.innerHTML=e.html:t.innerText=e.text,this.main.values.innerHTML=t.outerHTML}else this.main.values.innerHTML=this.placeholder().outerHTML;this.settings.allowDeselect&&t.length?this.main.deselect.main.classList.remove(this.classes.hide):this.main.deselect.main.classList.add(this.classes.hide)}renderMultipleValues(){let t=this.main.values.childNodes,e=this.store.filter((t=>t.selected&&t.display),!1);if(0===e.length)return void(this.main.values.innerHTML=this.placeholder().outerHTML);{const t=this.main.values.querySelector("."+this.classes.placeholder);t&&t.remove()}if(e.length>this.settings.maxValuesShown){const t=document.createElement("div");return t.classList.add(this.classes.max),t.textContent=this.settings.maxValuesMessage.replace("{number}",e.length.toString()),void(this.main.values.innerHTML=t.outerHTML)}{const t=this.main.values.querySelector("."+this.classes.max);t&&t.remove()}this.settings.keepOrder&&(e=this.store.selectedOrderOptions(e));let i=[];for(let s=0;st.id===r),!1).length||i.push(n))}for(const t of i)t.classList.add(this.classes.valueOut),setTimeout((()=>{this.main.values.hasChildNodes()&&this.main.values.contains(t)&&this.main.values.removeChild(t)}),100);t=this.main.values.childNodes;for(let i=0;i{if(e.preventDefault(),e.stopPropagation(),this.settings.disabled)return;let i=!0;const s=this.store.getSelectedOptions(),a=s.filter((e=>e.selected&&e.id!==t.id),!0);if(!(this.settings.minSelected&&a.length{this.callbacks.search(t.target.value)}),100),e.onkeydown=t=>{switch(t.key){case"ArrowUp":case"ArrowDown":return"ArrowDown"===t.key?this.highlight("down"):this.highlight("up"),!1;case"Tab":return this.callbacks.close(),!0;case"Escape":return this.callbacks.close(),!1;case" ":const e=this.content.list.querySelector("."+this.classes.highlighted);return!e||(e.click(),!1);case"Enter":if(this.callbacks.addable)return s.click(),!1;{const t=this.content.list.querySelector("."+this.classes.highlighted);if(t)return t.click(),!1}return!0}return!0},t.appendChild(e),this.callbacks.addable){s.classList.add(this.classes.addable);const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 100 100");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d",this.classes.addablePath),e.appendChild(i),s.appendChild(e),s.onclick=t=>{if(t.preventDefault(),t.stopPropagation(),!this.callbacks.addable)return;const e=this.content.search.input.value.trim();if(""===e)return void this.content.search.input.focus();const i=t=>{let e=new r(t);if(this.callbacks.addOption(e),this.settings.isMultiple){let t=this.store.getSelected();t.push(e.id),this.callbacks.setSelected(t,!0)}else this.callbacks.setSelected([e.id],!0);this.callbacks.search(""),this.settings.closeOnSelect&&setTimeout((()=>{this.callbacks.close()}),100)},s=this.callbacks.addable(e);!1!==s&&null!=s&&(s instanceof Promise?s.then((t=>{"string"==typeof t?i({text:t,value:t}):s instanceof Error?this.renderError(s.message):i(t)})):"string"==typeof s?i({text:s,value:s}):s instanceof Error?this.renderError(s.message):i(s))},t.appendChild(s),n.addable={main:s,svg:e,path:i}}return n}searchFocus(){this.content.search.input.focus()}getOptions(t=!1,e=!1,i=!1){let s="."+this.classes.option;return t&&(s+=":not(."+this.classes.placeholder+")"),e&&(s+=":not(."+this.classes.disabled+")"),i&&(s+=":not(."+this.classes.hide+")"),Array.from(this.content.list.querySelectorAll(s))}highlight(t){const e=this.getOptions(!0,!0,!0);if(0===e.length)return;if(1===e.length&&!e[0].classList.contains(this.classes.highlighted))return void e[0].classList.add(this.classes.highlighted);let i=!1;for(const t of e)t.classList.contains(this.classes.highlighted)&&(i=!0);if(!i)for(const t of e)if(t.classList.contains(this.classes.selected)){t.classList.add(this.classes.highlighted);break}for(let i=0;i=0?i-1:e.length-1];r.classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,r);const a=r.parentElement;if(a&&a.classList.contains(this.classes.close)){const t=a.querySelector("."+this.classes.optgroupLabel);t&&t.click()}return}e["down"===t?0:e.length-1].classList.add(this.classes.highlighted),this.ensureElementInView(this.content.list,e["down"===t?0:e.length-1])}listDiv(){const t=document.createElement("div");return t.classList.add(this.classes.list),t}renderError(t){this.content.list.innerHTML="";const e=document.createElement("div");e.classList.add(this.classes.error),e.textContent=t,this.content.list.appendChild(e)}renderSearching(){this.content.list.innerHTML="";const t=document.createElement("div");t.classList.add(this.classes.searching),t.textContent=this.settings.searchingText,this.content.list.appendChild(t)}renderOptions(t){if(this.content.list.innerHTML="",0===t.length){const t=document.createElement("div");return t.classList.add(this.classes.search),this.callbacks.addable?t.innerHTML=this.settings.addableText.replace("{value}",this.content.search.input.value):t.innerHTML=this.settings.searchText,void this.content.list.appendChild(t)}this.settings.allowDeselect&&!this.settings.isMultiple&&(this.store.filter((t=>t.placeholder),!1).length||this.store.addOption(new r({text:"",value:"",selected:!1,placeholder:!0}),!0));for(const e of t){if(e instanceof n){const t=document.createElement("div");t.classList.add(this.classes.optgroup);const i=document.createElement("div");i.classList.add(this.classes.optgroupLabel),t.appendChild(i);const s=document.createElement("div");s.classList.add(this.classes.optgroupLabelText),s.textContent=e.label,i.appendChild(s);const n=document.createElement("div");if(n.classList.add(this.classes.optgroupActions),i.appendChild(n),this.settings.isMultiple&&e.selectAll){const t=document.createElement("div");t.classList.add(this.classes.optgroupSelectAll);let i=!0;for(const t of e.options)if(!t.selected){i=!1;break}i&&t.classList.add(this.classes.selected);const s=document.createElement("span");s.textContent=e.selectAllText,t.appendChild(s);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100"),t.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d",this.classes.optgroupSelectAllBox),r.appendChild(a);const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d",this.classes.optgroupSelectAllCheck),r.appendChild(o),t.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation();const s=this.store.getSelected();if(i){const t=s.filter((t=>{for(const i of e.options)if(t===i.id)return!1;return!0}));this.callbacks.setSelected(t,!0)}else{const t=s.concat(e.options.map((t=>t.id)));for(const t of e.options)this.store.getOptionByID(t.id)||this.callbacks.addOption(t);this.callbacks.setSelected(t,!0)}})),n.appendChild(t)}if("off"!==e.closable){const s=document.createElement("div");s.classList.add(this.classes.optgroupClosable);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("viewBox","0 0 100 100"),r.classList.add(this.classes.arrow),s.appendChild(r);const a=document.createElementNS("http://www.w3.org/2000/svg","path");r.appendChild(a),e.options.some((t=>t.selected))||""!==this.content.search.input.value.trim()?(s.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"open"===e.closable?(t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):"close"===e.closable&&(t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose)),i.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation(),t.classList.contains(this.classes.close)?(t.classList.remove(this.classes.close),t.classList.add(this.classes.open),a.setAttribute("d",this.classes.arrowOpen)):(t.classList.remove(this.classes.open),t.classList.add(this.classes.close),a.setAttribute("d",this.classes.arrowClose))})),n.appendChild(s)}t.appendChild(i);for(const i of e.options)t.appendChild(this.option(i));this.content.list.appendChild(t)}e instanceof r&&this.content.list.appendChild(this.option(e))}}option(t){if(t.placeholder){const t=document.createElement("div");return t.classList.add(this.classes.option),t.classList.add(this.classes.hide),t}const e=document.createElement("div");return e.dataset.id=t.id,e.id=t.id,e.classList.add(this.classes.option),e.setAttribute("role","option"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.style&&(e.style.cssText=t.style),this.settings.searchHighlight&&""!==this.content.search.input.value.trim()?e.innerHTML=this.highlightText(""!==t.html?t.html:t.text,this.content.search.input.value,this.classes.searchHighlighter):""!==t.html?e.innerHTML=t.html:e.textContent=t.text,this.settings.showOptionTooltips&&e.textContent&&e.setAttribute("title",e.textContent),t.display||e.classList.add(this.classes.hide),t.disabled&&e.classList.add(this.classes.disabled),t.selected&&this.settings.hideSelected&&e.classList.add(this.classes.hide),t.selected?(e.classList.add(this.classes.selected),e.setAttribute("aria-selected","true"),this.main.main.setAttribute("aria-activedescendant",e.id)):(e.classList.remove(this.classes.selected),e.setAttribute("aria-selected","false")),e.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation();const i=this.store.getSelected(),s=e.currentTarget,n=String(s.dataset.id);if(t.disabled||t.selected&&!this.settings.allowDeselect)return;if(this.settings.isMultiple&&this.settings.maxSelected<=i.length&&!t.selected||this.settings.isMultiple&&this.settings.minSelected>=i.length&&t.selected)return;let r=!1;const a=this.store.getSelectedOptions();let o=[];this.settings.isMultiple&&(o=t.selected?a.filter((t=>t.id!==n)):a.concat(t)),this.settings.isMultiple||(o=t.selected?[]:[t]),this.callbacks.beforeChange||(r=!0),this.callbacks.beforeChange&&(r=!1!==this.callbacks.beforeChange(o,a)),r&&(this.store.getOptionByID(n)||this.callbacks.addOption(t),this.callbacks.setSelected(o.map((t=>t.id)),!1),this.settings.closeOnSelect&&this.callbacks.close(),this.callbacks.afterChange&&this.callbacks.afterChange(o))})),e}destroy(){this.main.main.remove(),this.content.main.remove()}highlightText(t,e,i){let s=t;const n=new RegExp("(?![^<]*>)("+e.trim()+")(?![^<]*>[^<>]*${o}`),s}moveContentAbove(){const t=this.main.main.offsetHeight,e=this.content.main.offsetHeight;this.main.main.classList.remove(this.classes.openBelow),this.main.main.classList.add(this.classes.openAbove),this.content.main.classList.remove(this.classes.openBelow),this.content.main.classList.add(this.classes.openAbove);const i=this.main.main.getBoundingClientRect();this.content.main.style.margin="-"+(t+e-1)+"px 0px 0px 0px",this.content.main.style.top=i.top+i.height+window.scrollY+"px",this.content.main.style.left=i.left+window.scrollX+"px",this.content.main.style.width=i.width+"px"}moveContentBelow(){this.main.main.classList.remove(this.classes.openAbove),this.main.main.classList.add(this.classes.openBelow),this.content.main.classList.remove(this.classes.openAbove),this.content.main.classList.add(this.classes.openBelow);const t=this.main.main.getBoundingClientRect();this.content.main.style.margin="-1px 0px 0px 0px","relative"!==this.settings.contentPosition&&(this.content.main.style.top=t.top+t.height+window.scrollY+"px",this.content.main.style.left=t.left+window.scrollX+"px",this.content.main.style.width=t.width+"px")}ensureElementInView(t,e){const i=t.scrollTop+t.offsetTop,s=i+t.clientHeight,n=e.offsetTop,r=n+e.clientHeight;ns&&(t.scrollTop+=r-s)}putContent(){const t=this.main.main.offsetHeight,e=this.main.main.getBoundingClientRect(),i=this.content.main.offsetHeight;return window.innerHeight-(e.top+t)<=i&&e.top>i?"up":"down"}updateDeselectAll(){if(!this.store||!this.settings)return;const t=this.store.getSelectedOptions(),e=t&&t.length>0,i=this.settings.isMultiple,s=this.settings.allowDeselect,n=this.main.deselect.main,r=this.classes.hide;!s||i&&!e?n.classList.add(r):n.classList.remove(r)}}class l{constructor(t){this.listen=!1,this.observer=null,this.select=t,this.valueChange=this.valueChange.bind(this),this.select.addEventListener("change",this.valueChange,{passive:!0}),this.observer=new MutationObserver(this.observeCall.bind(this)),this.changeListen(!0)}enable(){this.select.disabled=!1}disable(){this.select.disabled=!0}hideUI(){this.select.tabIndex=-1,this.select.style.display="none",this.select.setAttribute("aria-hidden","true")}showUI(){this.select.removeAttribute("tabindex"),this.select.style.display="",this.select.removeAttribute("aria-hidden")}changeListen(t){this.listen=t,t&&this.observer&&this.observer.observe(this.select,{subtree:!0,childList:!0,attributes:!0}),t||this.observer&&this.observer.disconnect()}valueChange(t){return this.listen&&this.onValueChange&&this.onValueChange(this.getSelectedOptions()),!0}observeCall(t){if(!this.listen)return;let e=!1,i=!1,s=!1;for(const n of t){if(n.target===this.select&&("disabled"===n.attributeName&&(i=!0),"class"===n.attributeName&&(e=!0),"childList"===n.type)){for(const t of n.addedNodes)if("OPTION"===t.nodeName&&t.value===this.select.value){this.select.dispatchEvent(new Event("change"));break}s=!0}"OPTGROUP"!==n.target.nodeName&&"OPTION"!==n.target.nodeName||(s=!0)}e&&this.onClassChange&&this.onClassChange(this.select.className.split(" ")),i&&this.onDisabledChange&&(this.changeListen(!1),this.onDisabledChange(this.select.disabled),this.changeListen(!0)),s&&this.onOptionsChange&&(this.changeListen(!1),this.onOptionsChange(this.getData()),this.changeListen(!0))}getData(){let t=[];const e=this.select.childNodes;for(const i of e)"OPTGROUP"===i.nodeName&&t.push(this.getDataFromOptgroup(i)),"OPTION"===i.nodeName&&t.push(this.getDataFromOption(i));return t}getDataFromOptgroup(t){let e={id:t.id,label:t.label,selectAll:!!t.dataset&&"true"===t.dataset.selectall,selectAllText:t.dataset?t.dataset.selectalltext:"Select all",closable:t.dataset?t.dataset.closable:"off",options:[]};const i=t.childNodes;for(const t of i)"OPTION"===t.nodeName&&e.options.push(this.getDataFromOption(t));return e}getDataFromOption(t){return{id:t.id,value:t.value,text:t.text,html:t.dataset&&t.dataset.html?t.dataset.html:"",selected:t.selected,display:"none"!==t.style.display,disabled:t.disabled,mandatory:!!t.dataset&&"true"===t.dataset.mandatory,placeholder:"true"===t.dataset.placeholder,class:t.className,style:t.style.cssText,data:t.dataset}}getSelectedOptions(){let t=[];const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(this.getDataFromOption(e))}}if("OPTION"===i.nodeName){const e=i;e.selected&&t.push(this.getDataFromOption(e))}}return t}getSelectedValues(){return this.getSelectedOptions().map((t=>t.value))}setSelected(t){this.changeListen(!1);const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.id)}}if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.id)}}this.changeListen(!0)}setSelectedByValue(t){this.changeListen(!1);const e=this.select.childNodes;for(const i of e){if("OPTGROUP"===i.nodeName){const e=i.childNodes;for(const i of e)if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}if("OPTION"===i.nodeName){const e=i;e.selected=t.includes(e.value)}}this.changeListen(!0)}updateSelect(t,e,i){this.changeListen(!1),t&&(this.select.dataset.id=t),e&&(this.select.style.cssText=e),i&&(this.select.className="",i.forEach((t=>{""!==t.trim()&&this.select.classList.add(t.trim())}))),this.changeListen(!0)}updateOptions(t){this.changeListen(!1),this.select.innerHTML="";for(const e of t)e instanceof n&&this.select.appendChild(this.createOptgroup(e)),e instanceof r&&this.select.appendChild(this.createOption(e));this.select.dispatchEvent(new Event("change",{bubbles:!0})),this.changeListen(!0)}createOptgroup(t){const e=document.createElement("optgroup");if(e.id=t.id,e.label=t.label,t.selectAll&&(e.dataset.selectAll="true"),"off"!==t.closable&&(e.dataset.closable=t.closable),t.options)for(const i of t.options)e.appendChild(this.createOption(i));return e}createOption(t){const e=document.createElement("option");return e.id=t.id,e.value=t.value,e.innerHTML=t.text,""!==t.html&&e.setAttribute("data-html",t.html),t.selected&&(e.selected=t.selected),t.disabled&&(e.disabled=!0),t.display||(e.style.display="none"),t.placeholder&&e.setAttribute("data-placeholder","true"),t.mandatory&&e.setAttribute("data-mandatory","true"),t.class&&t.class.split(" ").forEach((t=>{e.classList.add(t)})),t.data&&"object"==typeof t.data&&Object.keys(t.data).forEach((i=>{e.setAttribute("data-"+function(t){const e=t.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,(t=>"-"+t.toLowerCase()));return t[0]===t[0].toUpperCase()?e.substring(1):e}(i),t.data[i])})),e}destroy(){this.changeListen(!1),this.select.removeEventListener("change",this.valueChange),this.observer&&(this.observer.disconnect(),this.observer=null),delete this.select.dataset.id,this.showUI()}}class h{constructor(t){this.id="",this.style="",this.class=[],this.isMultiple=!1,this.isOpen=!1,this.isFullOpen=!1,this.intervalMove=null,t||(t={}),this.id="ss-"+e(),this.style=t.style||"",this.class=t.class||[],this.disabled=void 0!==t.disabled&&t.disabled,this.alwaysOpen=void 0!==t.alwaysOpen&&t.alwaysOpen,this.showSearch=void 0===t.showSearch||t.showSearch,this.focusSearch=void 0===t.focusSearch||t.focusSearch,this.ariaLabel=t.ariaLabel||"Combobox",this.searchPlaceholder=t.searchPlaceholder||"Search",this.searchText=t.searchText||"No Results",this.searchingText=t.searchingText||"Searching...",this.searchHighlight=void 0!==t.searchHighlight&&t.searchHighlight,this.closeOnSelect=void 0===t.closeOnSelect||t.closeOnSelect,this.contentLocation=t.contentLocation||document.body,this.contentPosition=t.contentPosition||"absolute",this.openPosition=t.openPosition||"auto",this.placeholderText=void 0!==t.placeholderText?t.placeholderText:"Select Value",this.allowDeselect=void 0!==t.allowDeselect&&t.allowDeselect,this.hideSelected=void 0!==t.hideSelected&&t.hideSelected,this.keepOrder=void 0!==t.keepOrder&&t.keepOrder,this.showOptionTooltips=void 0!==t.showOptionTooltips&&t.showOptionTooltips,this.minSelected=t.minSelected||0,this.maxSelected=t.maxSelected||1e3,this.timeoutDelay=t.timeoutDelay||200,this.maxValuesShown=t.maxValuesShown||20,this.maxValuesMessage=t.maxValuesMessage||"{number} selected",this.addableText=t.addableText||'Press "Enter" to add {value}'}}return class{constructor(e){var s;if(this.events={search:void 0,searchFilter:(t,e)=>-1!==t.text.toLowerCase().indexOf(e.toLowerCase()),addable:void 0,beforeChange:void 0,afterChange:void 0,beforeOpen:void 0,afterOpen:void 0,beforeClose:void 0,afterClose:void 0},this.windowResize=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.windowScroll=i((()=>{(this.settings.isOpen||this.settings.isFullOpen)&&this.render.moveContent()})),this.documentClick=t=>{this.settings.isOpen&&t.target&&!function(t,e){function i(t,i){return i&&t&&t.classList&&t.classList.contains(i)||i&&t&&t.dataset&&t.dataset.id&&t.dataset.id===e?t:null}return i(t,e)||function t(e,s){return e&&e!==document?i(e,s)?e:t(e.parentNode,s):null}(t,e)}(t.target,this.settings.id)&&this.close(t.type)},this.windowVisibilityChange=()=>{document.hidden&&this.close()},this.selectEl="string"==typeof e.select?document.querySelector(e.select):e.select,!this.selectEl)return void(e.events&&e.events.error&&e.events.error(new Error("Could not find select element")));if("SELECT"!==this.selectEl.tagName)return void(e.events&&e.events.error&&e.events.error(new Error("Element isnt of type select")));this.selectEl.dataset.ssid&&this.destroy(),this.settings=new h(e.settings),this.cssClasses=new t(e.cssClasses);const n=["afterChange","beforeOpen","afterOpen","beforeClose","afterClose"];for(const t in e.events)e.events.hasOwnProperty(t)&&(-1!==n.indexOf(t)?this.events[t]=i(e.events[t],100):this.events[t]=e.events[t]);this.settings.disabled=(null===(s=e.settings)||void 0===s?void 0:s.disabled)?e.settings.disabled:this.selectEl.disabled,this.settings.isMultiple=this.selectEl.multiple,this.settings.style=this.selectEl.style.cssText,this.settings.class=this.selectEl.className.split(" "),this.select=new l(this.selectEl),this.select.updateSelect(this.settings.id,this.settings.style,this.settings.class),this.select.hideUI(),this.select.onValueChange=t=>{this.setSelected(t.map((t=>t.id)))},this.select.onClassChange=t=>{this.settings.class=t,this.render.updateClassStyles()},this.select.onDisabledChange=t=>{t?this.disable():this.enable()},this.select.onOptionsChange=t=>{this.setData(t)},this.store=new a(this.settings.isMultiple?"multiple":"single",e.data?e.data:this.select.getData()),e.data&&this.select.updateOptions(this.store.getData());const r={open:this.open.bind(this),close:this.close.bind(this),addable:this.events.addable?this.events.addable:void 0,setSelected:this.setSelected.bind(this),addOption:this.addOption.bind(this),search:this.search.bind(this),beforeChange:this.events.beforeChange,afterChange:this.events.afterChange};this.render=new o(this.settings,this.cssClasses,this.store,r),this.render.renderValues(),this.render.renderOptions(this.store.getData());const d=this.selectEl.getAttribute("aria-label"),c=this.selectEl.getAttribute("aria-labelledby");d?this.render.main.main.setAttribute("aria-label",d):c&&this.render.main.main.setAttribute("aria-labelledby",c),this.selectEl.parentNode&&this.selectEl.parentNode.insertBefore(this.render.main.main,this.selectEl.nextSibling),window.addEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.addEventListener("scroll",this.windowScroll,!1),document.addEventListener("visibilitychange",this.windowVisibilityChange),this.settings.disabled&&this.disable(),this.settings.alwaysOpen&&this.open(),this.selectEl.slim=this}enable(){this.settings.disabled=!1,this.select.enable(),this.render.enable()}disable(){this.settings.disabled=!0,this.select.disable(),this.render.disable()}getData(){return this.store.getData()}setData(t){const e=this.store.getSelected(),i=this.store.validateDataArray(t);if(i)return void(this.events.error&&this.events.error(i));this.store.setData(t);const n=this.store.getData();this.select.updateOptions(n),this.render.renderValues(),this.render.renderOptions(n),this.events.afterChange&&!s(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}getSelected(){let t=this.store.getSelectedOptions();return this.settings.keepOrder&&(t=this.store.selectedOrderOptions(t)),t.map((t=>t.value))}setSelected(t,e=!0){const i=this.store.getSelected(),n=this.store.getDataOptions();t=Array.isArray(t)?t:[t];const r=[];for(const e of t)if(n.find((t=>t.id==e)))r.push(e);else for(const t of n.filter((t=>t.value==e)))r.push(t.id);this.store.setSelectedBy("id",r);const a=this.store.getData();this.select.updateOptions(a),this.render.renderValues(),""!==this.render.content.search.input.value?this.search(this.render.content.search.input.value):this.render.renderOptions(a),e&&this.events.afterChange&&!s(i,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}addOption(t){const e=this.store.getSelected();this.store.getDataOptions().some((e=>{var i;return e.value===(null!==(i=t.value)&&void 0!==i?i:t.text)}))||this.store.addOption(t);const i=this.store.getData();this.select.updateOptions(i),this.render.renderValues(),this.render.renderOptions(i),this.events.afterChange&&!s(e,this.store.getSelected())&&this.events.afterChange(this.store.getSelectedOptions())}open(){this.settings.disabled||this.settings.isOpen||(this.events.beforeOpen&&this.events.beforeOpen(),this.render.open(),this.settings.showSearch&&this.settings.focusSearch&&this.render.searchFocus(),this.settings.isOpen=!0,setTimeout((()=>{this.events.afterOpen&&this.events.afterOpen(),this.settings.isOpen&&(this.settings.isFullOpen=!0),document.addEventListener("click",this.documentClick)}),this.settings.timeoutDelay),"absolute"===this.settings.contentPosition&&(this.settings.intervalMove&&clearInterval(this.settings.intervalMove),this.settings.intervalMove=setInterval(this.render.moveContent.bind(this.render),500)))}close(t=null){this.settings.isOpen&&!this.settings.alwaysOpen&&(this.events.beforeClose&&this.events.beforeClose(),this.render.close(),""!==this.render.content.search.input.value&&this.search(""),this.render.mainFocus(t),this.settings.isOpen=!1,this.settings.isFullOpen=!1,setTimeout((()=>{this.events.afterClose&&this.events.afterClose(),document.removeEventListener("click",this.documentClick)}),this.settings.timeoutDelay),this.settings.intervalMove&&clearInterval(this.settings.intervalMove))}search(t){if(this.render.content.search.input.value!==t&&(this.render.content.search.input.value=t),!this.events.search)return void this.render.renderOptions(""===t?this.store.getData():this.store.search(t,this.events.searchFilter));this.render.renderSearching();const e=this.events.search(t,this.store.getSelectedOptions());e instanceof Promise?e.then((t=>{this.render.renderOptions(this.store.partialToFullData(t))})).catch((t=>{this.render.renderError("string"==typeof t?t:t.message)})):Array.isArray(e)?this.render.renderOptions(this.store.partialToFullData(e)):this.render.renderError("Search event must return a promise or an array of data")}destroy(){document.removeEventListener("click",this.documentClick),window.removeEventListener("resize",this.windowResize,!1),"auto"===this.settings.openPosition&&window.removeEventListener("scroll",this.windowScroll,!1),document.removeEventListener("visibilitychange",this.windowVisibilityChange),this.store.setData([]),this.render.destroy(),this.select.destroy()}}}()},5072:t=>{"use strict";var e=[];function i(t){for(var i=-1,s=0;s{"use strict";var e={};t.exports=function(t,i){var s=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(i)}},540:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},5056:(t,e,i)=>{"use strict";t.exports=function(t){var e=i.nc;e&&t.setAttribute("nonce",e)}},7825:t=>{"use strict";t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(i){!function(t,e,i){var s="";i.supports&&(s+="@supports (".concat(i.supports,") {")),i.media&&(s+="@media ".concat(i.media," {"));var n=void 0!==i.layer;n&&(s+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),s+=i.css,n&&(s+="}"),i.media&&(s+="}"),i.supports&&(s+="}");var r=i.sourceMap;r&&"undefined"!=typeof btoa&&(s+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(s,t,e.options)}(e,t,i)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},1113:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={id:s,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var s={};(()=>{"use strict";i.r(s),i.d(s,{d3_format:()=>Rq,d3_format_locale:()=>Fq,dayjs:()=>bq});var t={};i.r(t),i.d(t,{Zr:()=>Nb}),window.HTMLWidgets;const e=t=>t;var n,r;!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(n||(n={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(r||(r={}));var a=i(228),o=i.n(a);const l=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,h=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||l(t,"Number")},d="undefined"!=typeof console;function c(t,e,i){const s=[e].concat([].slice.call(i));d&&console[t].apply(console,s)}var u,p;(p=u||(u={}))[p.None=0]="None",p[p.Error=1]="Error",p[p.Warn=2]="Warn",p[p.Info=3]="Info",p[p.Debug=4]="Debug";class g{static getInstance(t,e){return g._instance&&h(t)?g._instance.level(t):g._instance||(g._instance=new g(t,e)),g._instance}static setInstance(t){return g._instance=t}static setInstanceLevel(t){g._instance?g._instance.level(t):g._instance=new g(t)}static clearInstance(){g._instance=null}constructor(t=u.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=u.Info}canLogDebug(){return this._level>=u.Debug}canLogError(){return this._level>=u.Error}canLogWarn(){return this._level>=u.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=u.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):c(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=u.Warn&&c(this._method||"warn","WARN",t),this}info(...t){return this._level>=u.Info&&c(this._method||"log","INFO",t),this}debug(...t){return this._level>=u.Debug&&c(this._method||"log","DEBUG",t),this}}g._instance=null;let m=0;function _(t="dataset"){return m>1e8&&(m=0),t+"_"+m++}class f{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(o()),i=(null==t?void 0:t.name)?t.name:_("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:g.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 s=this._callMap.get(i);s||(s=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,s)})),this._callMap.set(i,s)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const s=this._callMap.get(i);s&&t.forEach((t=>{t.target.removeListener(e,s)})),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()}}const v=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||l(t,"Boolean"),y=t=>Array.isArray?Array.isArray(t):l(t,"Array"),b=(t,e,i)=>{const s=!v(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!y(t))throw new TypeError("Invalid data: must be DataView array!");return y(i.rawData)&&i.rawData.forEach((t=>{t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),s&&t.forEach((t=>{t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t},x=t=>l(t,"Date"),S=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||l(t,"String")},M=t=>null!=t;function k(t,e,i){let s;if(!M(t)||"object"!=typeof t||e&&e(t))return t;const n=y(t),r=t.length;s=n?new Array(r):"object"==typeof t?{}:v(t)||h(t)||S(t)?t:x(t)?new Date(+t):void 0;const a=n?void 0:Object.keys(Object(t));let o=-1;if(s)for(;++o<(a||t).length;){const n=a?a[o]:o,r=t[n];i&&i.includes(n.toString())?s[n]=r:s[n]=k(r,e,i)}return s}const A=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},w=function(t){if(!(t=>"object"==typeof t&&null!==t)(t)||!l(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function T(t,e,i=!1,s=!1){if(e){if(t===e)return;if(M(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!M(n[a])||"object"!=typeof n[a]||s&&y(t[a])?C(t,a,n[a]):L(t,e,a,i,s)}}}}function L(t,e,i,s=!1,n=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(y(a)){if(s)o=[];else if(y(r))o=r;else if(A(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++tnull==t,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.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let s=0;s(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()})),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:_("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var 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,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t,e={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[P]=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[P]=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[P]"fields"===t.type));!D(this._fields)&&D(i)?(this.dataSet.registerTransform("fields",O),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class B{static GenAutoIncrementId(){return B.auto_increment_id++}}B.auto_increment_id=0;class I{constructor(t){this.id=B.GenAutoIncrementId(),this.registry=t}}const F="named",Y="inject",j="multi_inject",H="inversify:tagged",z="inversify:paramtypes",N=function(t){var e;return function(t){Object.prototype.hasOwnProperty;const e="function"==typeof Symbol,i=e&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=(e&&void 0!==Symbol.iterator&&Symbol.iterator,Object.create,Object.getPrototypeOf(Function)),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=(Set,new WeakMap);function a(t,e,i){let s=r.get(t);if(d(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(d(a)){if(!i)return;a=new n,s.set(e,a)}return a}function o(t,e,i){if(l(t,e,i))return!0;const s=m(e);return!c(s)&&o(t,s,i)}function l(t,e,i){const s=a(e,i,!1);return!d(s)&&!!s.has(t)}function h(t,e,i){if(l(t,e,i))return function(t,e,i){const s=a(e,i,!1);if(!d(s))return s.get(t)}(t,e,i);const s=m(e);return c(s)?void 0:h(t,s,i)}function d(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function p(t){const e=function(t,e){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===e?"string":5===e?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,i);if(void 0!==n){const e=n.call(t,s);if(u(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(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function m(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s)return e;if(e!==s)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);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(!u(i))throw new TypeError;return n=t,r=e,void a(i,s,!0).set(n,r);var n,r})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),l(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function V(){return function(t){return N.defineMetadata(z,null,t),t}}class W{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===F?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function G(t){return(e,i,s)=>{!function(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};N.hasOwnMetadata(t,e)&&(r=N.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,N.defineMetadata(t,r,e)}(H,t,i.toString(),s)}(e,0,s,t)}}function U(t){return e=>(i,s,n)=>G(new W(t,e))(i,s,n)}const $=U(Y);function X(t){return G(new W(F,t))}const K=Symbol("ContributionProvider");class q{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 Z(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).inSingletonScope().whenTargetNamed(e)}class J{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 Q extends J{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const tt=Symbol.for("EnvContribution"),et=Symbol.for("VGlobal");var it=function(t,e){return function(i,s){e(i,s,t)}};let st=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=B.GenAutoIncrementId(),this.hooks={onSetEnv:new Q(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const s=i.configure(this,t);s&&s.then&&e.push(s)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const s=this.bindContribution(e);if(s&&s.then)return s.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};st=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}([V(),it(0,$(K)),it(0,X(tt)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],st);const nt=1e-12,rt=Math.PI,at=rt/2,ot=2*rt,lt=2*Math.PI,ht=Math.abs,dt=Math.atan2,ct=Math.cos,ut=Math.max,pt=Math.min,gt=Math.sin,mt=Math.sqrt,_t=Math.pow;function ft(t){return t>=1?at:t<=-1?-at:Math.asin(t)}function vt(t,e,i,s,n){let r=i,a=s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof s&&(a=(1-n)*e+n*s),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function bt(t,e){let i=0;for(let s=0;s0?i:0}function Mt(t,e){return xt(t+e,10**Math.max(St(t),St(e)))}function kt(t,e){return xt(t-e,10**Math.max(St(t),St(e)))}function At(t){return t*(Math.PI/180)}function wt(t){return 180*t/Math.PI}function Tt(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Lt(t,e={x:0,y:0},i=0,s=2*Math.PI){const{x:n,y:r}=t,{x:a,y:o}=e;let l=n-a,h=r-o;const d=Math.sqrt(l*l+h*h);if(0===d)return{radius:0,angle:0};l/=d,h/=d;let c=Math.atan2(h,l);if(cs)for(;c>=s;)c-=2*Math.PI;return{radius:d,angle:c}}function Ct(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Et(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Dt(t){return(t=Et(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}class Ot{constructor(t=1,e=0,i=0,s=1,n=0,r=0){this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,r=this.f,a=new Ot,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,l=n*this.a+s*this.b,h=s*this.c-n*this.d,d=n*this.c+s*this.d,c=s*this.e-n*this.f+r,u=n*this.e+s*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=d,this.e=c,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,r){return this.multiply(t,e,i,s,n,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,l=this.c,h=this.d,d=a*t+l*e,c=o*t+h*e,u=a*i+l*s,p=o*i+h*s,g=a*n+l*r+this.e,m=o*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=p,this.e=g,this.f=m,this}interpolate(t,e){const i=new Ot;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:r,e:a,f:o}=this,l=i*r-s*n,h=r/l,d=-s/l,c=-n/l,u=i/l,p=(n*o-r*a)/l,g=-(i*o-s*a)/l,{x:m,y:_}=t;e.x=m*h+_*c+p,e.y=m*d+_*u+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Ot(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=wt(r.rotateDeg),r}}const Pt=ot-1e-8;class Rt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>Pt)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,d=1/0,c=-1/0,u=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),lc&&(c=l),hp&&(p=h)}if(g(s),g(n),n!==s)if((s%=ot)<0&&(s+=ot),(n%=ot)<0&&(n+=ot),nn;++o,a-=at)g(a);else for(a=s-s%at+at,o=0;o<4&&a=l||n<=o||r>=d||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,o),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(a,d)}}var Yt;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Yt||(Yt={}));const jt=(t,e,i)=>{let s=t.x1,n=t.x2,r=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),o>l&&([o,l]=[l,o]),h>d&&([h,d]=[d,h])),{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}};function Ht(t,e,i){if(!t||!e)return Yt.NONE;const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}=jt(t,e,i);return s>o&&nh&&as&&lr&&de.x2||t.x2e.y2||t.y2l||nd||a=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,n=e.x2,r=e.y1,a=e.y2;return s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),t.x>=s&&t.x<=n&&t.y>=r&&t.y<=a}function Vt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Wt({x:t,y:e},i,s={x:0,y:0}){return{x:(t-s.x)*Math.cos(i)-(e-s.y)*Math.sin(i)+s.x,y:(t-s.x)*Math.sin(i)+(e-s.y)*Math.cos(i)+s.y}}function Gt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ut(t,e){const i=e?At(t.angle):t.angle,s=Gt(t);return[Wt({x:t.x1,y:t.y1},i,s),Wt({x:t.x2,y:t.y1},i,s),Wt({x:t.x2,y:t.y2},i,s),Wt({x:t.x1,y:t.y2},i,s)]}function $t(t,e,i=!1,s){const n=Ut(t,i),r=Ut(e,i),a=(t,e)=>[e.x-t.x,e.y-t.y];s&&(s.save(),s.fillStyle="red",s.globalAlpha=.6,n.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore(),s.save(),s.fillStyle="green",s.globalAlpha=.6,r.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore());const o=Gt(t),l=Gt(e);s&&s.fillRect(o.x,o.y,2,2),s&&s.fillRect(l.x,l.y,2,2);const h=a(o,l),d=a(n[0],n[1]),c=a(n[1],n[2]),u=a(r[0],r[1]),p=a(r[1],r[2]),g=i?At(t.angle):t.angle;let m=i?At(90-t.angle):t.angle+at;const _=i?At(e.angle):e.angle;let f=i?At(90-e.angle):e.angle+at;m>lt&&(m-=lt),f>lt&&(f-=lt);const v=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Vt(n,i)+Vt(n,s))/2>Vt(n,h)};return v((t.x2-t.x1)/2,g,u,p)&&v((t.y2-t.y1)/2,m,u,p)&&v((e.x2-e.x1)/2,_,d,c)&&v((e.y2-e.y1)/2,f,d,c)}function Xt(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),e)}class Kt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Kt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,s=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=s,this}set(t=0,e=0,i=0,s=0){return ithis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return y(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(t=0,e=0,i=0,s=0){const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)}contains(t=0,e=0){return!(tthis.x2||ethis.y2)}containsPoint(t){return!(t.xthis.x2||t.ythis.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Xt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,d=i-e*l-i*o;return[o*s-l*n+h,l*s+o*n+d,o*s-l*a+h,l*s+o*a+d,o*r-l*n+h,l*r+o*n+d,o*r-l*a+h,l*r+o*a+d]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class qt extends Kt{}class Zt extends Kt{constructor(t,e=0){super(t),t&&(this.angle=e)}intersects(t){return $t(this,t)}setValue(t=0,e=0,i=0,s=0,n=0){return super.setValue(t,e,i,s),this.angle=n,this}}class Jt{constructor(){this.curves=[],this.bounds=new qt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Qt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,te={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};let ee,ie,se,ne,re,ae;var oe,le,he,de,ce,ue,pe,ge,me;function _e(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,d=-o*a,c=o*r,u=l*a,p=Math.cos(s),g=Math.sin(s),m=Math.cos(n),_=Math.sin(n),f=.5*(n-s),v=Math.sin(.5*f),y=8/3*v*v/Math.sin(f),b=e+p-y*g,x=i+g+y*p,S=e+m,M=i+_,k=S+y*_,A=M-y*m;return[h*b+d*x,c*b+u*x,h*k+d*A,c*k+u*A,h*S+d*M,c*S+u*M]}function fe(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=At(a),d=Math.sin(h),c=Math.cos(h),u=c*(o-t)*.5+d*(l-e)*.5,p=c*(l-e)*.5-d*(o-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const m=c/i,_=d/i,f=-d/s,v=c/s,y=m*o+_*l,b=f*o+v*l,x=m*t+_*e,S=f*t+v*e;let M=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;M<0&&(M=0);let k=Math.sqrt(M);r===n&&(k=-k);const A=.5*(y+x)-k*(S-b),w=.5*(b+S)+k*(x-y),T=Math.atan2(b-w,y-A);let L=Math.atan2(S-w,x-A)-T;L<0&&1===r?L+=ot:L>0&&0===r&&(L-=ot);const C=Math.ceil(Math.abs(L/(at+.001))),E=[];for(let t=0;te.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 ye(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;ot+e.getLength()),0)),this.length}}class Ee extends Ce{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 De(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function Oe(t,e,i){const s=null!=e?e:ht(i[i.length-1].x-i[0].x)>ht(i[i.length-1].y-i[0].y)?pe.ROW:pe.COLUMN;return"monotoneY"===t?new Ee(t,s):new Ce(t,s)}class Pe{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 Re(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Oe("linear",i,t);return function(t,e){De(t,e,1)}(new Pe(n,s),t),n}function Be(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 Ie{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&&Be(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:Be(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 Fe(t){return t<0?-1:1}function Ye(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(Fe(r)+Fe(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function je(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function He(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 ze{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:He(this,this._t0,je(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,He(this,je(this,e=Ye(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:He(this,this._t0,e=Ye(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 Ne extends ze{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}class Ve{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0=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;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 We(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ce("step",null!=s?s:ht(t[t.length-1].x-t[0].x)>ht(t[t.length-1].y-t[0].y)?pe.ROW:pe.COLUMN);return function(t,e){De(t,e,1)}(new Ve(r,e,n),t),r}class Ge extends Pe{lineEnd(){this.context.closePath()}}function Ue(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>nt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>nt){const s=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);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function $e(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Re(i,n);const o=Oe(t,r,i);return De(new e(o,s,a),i,2),o}}const Xe=$e("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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()}}),Ke=$e("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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 qe(t,e,i){var s,n;switch(e){case"linear":default:return Re(t,i);case"basis":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Oe("basis",i,t);return function(t,e){De(t,e,2)}(new Ie(n,s),t),n}(t,i);case"monotoneX":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Oe("monotoneX",i,t);return function(t,e){De(t,e,2)}(new ze(n,s),t),n}(t,i);case"monotoneY":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Re(t,e);const n=Oe("monotoneY",i,t);return function(t,e){De(t,e,2)}(new Ne(n,s),t),n}(t,i);case"step":return We(t,.5,i);case"stepBefore":return We(t,0,i);case"stepAfter":return We(t,1,i);case"catmullRom":return Xe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Ke(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Oe("linear",i,t);return function(t,e){De(t,e,1)}(new Ge(n,s),t),n}(t,i)}}class Ze extends Jt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Rt(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([6,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([5,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([7,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([2,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([1,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([4,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([8,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([0,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([3]),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[6]=t=>`M${t[1]} ${t[2]}`,t[5]=t=>`L${t[1]} ${t[2]}`,t[7]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[2]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[0]=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`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[3]=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;tae){let t,e=se;for(let s=1,r=i.length;s{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,e=0,i=0,s=1,n=1){let r,a,o,l,h,d=null,c=0,u=0,p=0,g=0;for(let m=0,_=t.length;m<_;++m){switch(r=t[m],1===s&&1===n||(r=Qe(r,s,n)),r[0]){case"l":c+=r[1],u+=r[2],this.lineTo(c+e,u+i);break;case"L":c=r[1],u=r[2],this.lineTo(c+e,u+i);break;case"h":c+=r[1],this.lineTo(c+e,u+i);break;case"H":c=r[1],this.lineTo(c+e,u+i);break;case"v":u+=r[1],this.lineTo(c+e,u+i);break;case"V":u=r[1],this.lineTo(c+e,u+i);break;case"m":c+=r[1],u+=r[2],this.moveTo(c+e,u+i);break;case"M":c=r[1],u=r[2],this.moveTo(c+e,u+i);break;case"c":a=c+r[5],o=u+r[6],p=c+r[3],g=u+r[4],this.bezierCurveTo(c+r[1]+e,u+r[2]+i,p+e,g+i,a+e,o+i),c=a,u=o;break;case"C":c=r[5],u=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,c+e,u+i);break;case"s":a=c+r[3],o=u+r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,c+r[1]+e,u+r[2]+i,a+e,o+i),p=c+r[1],g=u+r[2],c=a,u=o;break;case"S":a=r[3],o=r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"q":a=c+r[3],o=u+r[4],p=c+r[1],g=u+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"t":a=c+r[1],o=u+r[2],null===d[0].match(/[QqTt]/)?(p=c,g=u):"t"===d[0]?(p=2*c-l,g=2*u-h):"q"===d[0]&&(p=2*c-p,g=2*u-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o,p=c+r[1],g=u+r[2];break;case"T":a=r[1],o=r[2],p=2*c-p,g=2*u-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"a":fe(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+c+e,r[7]+u+i]),c+=r[6],u+=r[7];break;case"A":fe(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),c=r[6],u=r[7];break;case"z":case"Z":this.closePath()}d=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;rt.slice()))}_updateBounds(){this.bounds.clear(),ye(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===pe.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.y-e.p1.y)}if(this.direction===pe.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(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=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}}const Je=["l",0,0,0,0,0,0,0];function Qe(t,e,i){const s=Je[0]=t[0];if("a"===s||"A"===s)Je[1]=e*t[1],Je[2]=i*t[2],Je[3]=t[3],Je[4]=t[4],Je[5]=t[5],Je[6]=e*t[6],Je[7]=i*t[7];else if("h"===s||"H"===s)Je[1]=e*t[1];else if("v"===s||"V"===s)Je[1]=i*t[1];else for(let s=1,n=t.length;s{g.getInstance().warn("空函数")}}),mi=Object.assign(Object.assign({},oi),{points:[],cornerRadius:0,closePath:!0}),_i=Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),fi=(Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Object.assign(Object.assign({},oi),{symbolType:"circle",size:10,keepDirIn3d:!0})),vi=Object.assign(Object.assign(Object.assign({},oi),ni),{strokeBoundsBuffer:0,keepDirIn3d:!0}),yi=Object.assign(Object.assign(Object.assign({},oi),ni),{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}),bi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},oi),{fill:!0,cornerRadius:0}),xi=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}),Si=new class{},Mi={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"}},ki=(String.fromCharCode(160),/\w|\(|\)|-/),Ai=/[.?!,;:/,。?!、;:]/,wi=/\S/,Ti=(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||"sans-serif"})};function Li(t,e,i,s,n){if(!e||e<=0)return 0;const r=Si.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width);for(;l>e||d<=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),d=Math.floor(r.measureText(h,i).width)}return n&&(a=Ci(t,a)),a}function Ci(t,e,i=!1){let s=e;for(;ki.test(t[s-1])&&ki.test(t[s])||Ai.test(t[s]);)if(s--,s<=0)return i?Ei(t,e):e;return s}function Ei(t,e){let i=e;for(;ki.test(t[i-1])&&ki.test(t[i])||Ai.test(t[i]);)if(i++,i>=t.length)return i;return i}function Di(t,e){const i=Si.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(s.width=Math.floor(i.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(i.width),s.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),s.ascent=Math.floor(i.actualBoundingBoxAscent),s.descent=s.height-s.ascent),s}let Oi=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,{fontSize:e=vi.fontSize}){let i=0,s=0;for(let e=0;e{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let a=0,o=0;for(;o1){const n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(s&&n.str!==t[o].text){let i="",s=0;for(let e=0;ei)return{str:"",width:0};const a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&a.str!==t){let i=Ci(t,a.str.length,n);i!==a.str.length&&(i>a.str.length&&(a.wordBreaked=i,i=a.str.length),a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a}_clipText(t,e,i,s,n,r,a){let o;if("start"===r)o=this._clipTextStart(t,e,i,s,n),a&&(o.result=a+o.str);else if("middle"===r){const s=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:s.width,result:s.left+a+s.right}}else o=this._clipTextEnd(t,e,i,s,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,s,n){const r=Math.floor((s+n)/2),a=t.substring(0,r+1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(0,r);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextEnd(t,e,i,s,r)}if(o=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(0,r+2);return l=this.measureTextWidth(s,e),l>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,r,n)}return{str:a,width:o}}_clipTextStart(t,e,i,s,n){const r=Math.ceil((s+n)/2),a=t.substring(r-1,t.length-1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const s=t.substring(r,t.length-1);return l=this.measureTextWidth(s,e),l<=i?{str:s,width:l}:this._clipTextStart(t,e,i,r,t.length-1)}if(o=i?{str:a,width:o}:this._clipTextStart(t,e,i,s,r)}return{str:a,width:o}}_clipTextMiddle(t,e,i,s,n,r,a,o){const l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:s,right:n,width:r+a};const d=t.substring(t.length-o,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,d,h,c,o+1)}clipTextWithSuffixVertical(t,e,i,s,n,r){if(""===s)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,n);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(s,e);if(o>i)return a;let l;if(i-=o,"start"===r){const r=this.revertVerticalList(t);l=this.clipTextVertical(r,e,i,n);const a=this.revertVerticalList(l.verticalList);a.unshift({text:s,direction:1,width:o}),l.verticalList=a}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),a=this.revertVerticalList(t),h=this.clipTextVertical(a,e,i/2,n);r.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),l={verticalList:r.verticalList,width:r.width+h.width}}else l=this.clipTextVertical(t,e,i,n),l.verticalList.push({text:s,direction:1,width:o});return l.width+=o,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,s,n,r,a=!1){if(""===s)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const l=this.measureTextWidth(s,e);if(l>i)return{str:"",width:0};if(a&&o+l<=i)return{str:t+s,width:o+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,r,s);if(n&&h.str!==t){const i=Ci(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else a&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=l,h}};Oi=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}([V()],Oi);const Pi=Symbol.for("TextMeasureContribution");let Ri=class extends Oi{};Ri=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}([V()],Ri);const Bi=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,s=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,s=e<<10|i,s+=65536),12288===s||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":8361===s||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||172===s||175===s||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":161===s||164===s||167<=s&&s<=168||170===s||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||198===s||208===s||215<=s&&s<=216||222<=s&&s<=225||230===s||232<=s&&s<=234||236<=s&&s<=237||240===s||242<=s&&s<=243||247<=s&&s<=250||252===s||254===s||257===s||273===s||275===s||283===s||294<=s&&s<=295||299===s||305<=s&&s<=307||312===s||319<=s&&s<=322||324===s||328<=s&&s<=331||333===s||338<=s&&s<=339||358<=s&&s<=359||363===s||462===s||464===s||466===s||468===s||470===s||472===s||474===s||476===s||593===s||609===s||708===s||711===s||713<=s&&s<=715||717===s||720===s||728<=s&&s<=731||733===s||735===s||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||1025===s||1040<=s&&s<=1103||1105===s||8208===s||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||8240===s||8242<=s&&s<=8243||8245===s||8251===s||8254===s||8308===s||8319===s||8321<=s&&s<=8324||8364===s||8451===s||8453===s||8457===s||8467===s||8470===s||8481<=s&&s<=8482||8486===s||8491===s||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||8585===s||8592<=s&&s<=8601||8632<=s&&s<=8633||8658===s||8660===s||8679===s||8704===s||8706<=s&&s<=8707||8711<=s&&s<=8712||8715===s||8719===s||8721===s||8725===s||8730===s||8733<=s&&s<=8736||8739===s||8741===s||8743<=s&&s<=8748||8750===s||8756<=s&&s<=8759||8764<=s&&s<=8765||8776===s||8780===s||8786===s||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||8853===s||8857===s||8869===s||8895===s||8978===s||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||9675===s||9678<=s&&s<=9681||9698<=s&&s<=9701||9711===s||9733<=s&&s<=9734||9737===s||9742<=s&&s<=9743||9748<=s&&s<=9749||9756===s||9758===s||9792===s||9794===s||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||9839===s||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||9955===s||9960<=s&&s<=9983||10045===s||10071===s||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||65533===s||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"};function Ii(t,e={},i){i||(i=1);const{fontStyle:s=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(s?s+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Fi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),M(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=M(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(D(this._canvas)&&(M(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),D(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&M(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),D(this._context)&&M(this._canvas)){const t=this._canvas.getContext("2d");M(t)&&(t.save(),t.font=Ii(this.textSpec),this._contextSaved=!0,this._context=t)}return!D(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:s={}}=this._option,{fontStyle:n=s.fontStyle,fontVariant:r=s.fontVariant,fontWeight:a=(null!==(t=s.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=s.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=s.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(S(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:d,textBaseline:u,ellipsis:p,limit:g,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(D(t))return{width:0,height:0};if(D(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:a,limit:o,lineHeight:l}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:l});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:s,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:s}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;it.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=n)&&void 0!==i?i:s)+1)+1}}return e(t.toString())}_measureNumberChar(){if(D(this._numberCharSize)){const t=this._standardMethod(Fi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Fi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return D(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Fi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(D(this._letterCharSize)){const t=this._standardMethod(Fi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Fi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return M(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){M(this._canvas)&&(this._canvas=null),M(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Fi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Fi.NUMBERS_CHAR_SET="0123456789",Fi.FULL_SIZE_CHAR="字";const Yi="Singleton",ji="Transient",Hi="ConstantValue",zi="Instance";class Ni{constructor(t,e){this.id=B.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type="Invalid",this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Ni(this.serviceIdentifier,this.scope);return t.activated=t.scope===Yi&&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 Vi{getConstructorMetadata(t){return{compilerGeneratedMetadata:N.getMetadata(z,t),userGeneratedMetadata:N.getMetadata(H,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Wi=(Gi=F,t=>{const e=e=>{if(null==e)return!1;if(e.key===Gi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;ee.container.get(t)))}}const Xi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=B.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Vi}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,F,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Ni(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new $i(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[t.key]=t.value}));const r={inject:s[Y],multiInject:s[j]},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};n.push(l)}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Hi:case"Function":e=t.cache;break;case zi: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===Yi&&(t.cache=e,t.activated=!0)}},Ki=Symbol.for("CanvasFactory"),qi=Symbol.for("Context2dFactory");function Zi(t){return Xi.getNamed(Ki,Si.global.env)(t)}Math.sqrt(3);const Ji=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=Zi(Object.assign({nativeCanvas:Si.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=Zi(Object.assign({nativeCanvas:Si.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Qi=1e-10,ts=1e-10;function es(t,e,i=ts,s=Qi){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function is(t,e,i,s){return t>e&&!es(t,e,i,s)}function ss(t,e,i,s){return t{const t=this.global;t.env&&!this.actived&&(Xi.getNamed(rs,t.env).configure(this,t),this.actived=!0)},this._uid=B.GenAutoIncrementId(),this.global=Si.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const s=this._handler.getWH();this._width=s.width,this._height=s.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,s,n,r){this._handler.setViewBoxTransform(t,e,i,s,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),s={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},s),s.x-=i.x1,s.y-=i.y1,s}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&es(this.width,t.width())&&es(this.height,t.height()))}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};as=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],as);var os=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},ls=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hs=function(t,e){return function(i,s){e(i,s,t)}};let ds=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=Si.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=Ji.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(s=e.fontSize)&&void 0!==s?s:ni.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Fi(Object.assign({defaultFontParams:{fontFamily:ni.fontFamily,fontSize:ni.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Fi.ALPHABET_CHAR_SET+Fi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const s=Xi.get(ns),n=t.AABBBounds,r=n.width(),a=n.height(),o=-n.x1,l=-n.y1;s.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:r,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(s,[t],{transMatrix:s.getViewBoxTransform(),viewBox:s.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=s.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var cs;ds=os([V(),hs(0,$(K)),hs(0,X(Pi)),ls("design:paramtypes",[Object])],ds),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(cs||(cs={}));const us=new Ot;let ps=class{constructor(){this.matrix=new Ot}init(t){return this.mode=cs.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=cs.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const s=this.outSourceMatrix;if(us.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){const{x:s,y:n}=i;this.outTargetMatrix.translate(s,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(us.a,us.b,us.c,us.d,us.e,us.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(us.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:s}=e;this.outTargetMatrix.translate(i,s),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-s)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(us.a,us.b,us.c,us.d,us.e,us.f),this}scale(t,e,i){return this.mode===cs.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===cs.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return us.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(us.a,us.b,us.c,us.d,us.e,us.f),this}translate(t,e){return this.mode===cs.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===cs.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};ps=os([V(),ls("design:paramtypes",[])],ps);const gs={arc:li,area:hi,circle:di,line:pi,path:gi,symbol:fi,text:vi,rect:_i,polygon:mi,richtext:yi,richtextIcon:xi,image:bi,group:ci,glyph:ui},ms=Object.keys(gs);function _s(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const fs={arc:Object.assign({},gs.arc),area:Object.assign({},gs.area),circle:Object.assign({},gs.circle),line:Object.assign({},gs.line),path:Object.assign({},gs.path),symbol:Object.assign({},gs.symbol),text:Object.assign({},gs.text),rect:Object.assign({},gs.rect),polygon:Object.assign({},gs.polygon),richtext:Object.assign({},gs.richtext),richtextIcon:Object.assign({},gs.richtextIcon),image:Object.assign({},gs.image),group:Object.assign({},gs.group),glyph:Object.assign({},gs.glyph)};class vs{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ms.forEach((t=>{this._defaultTheme[t]=Object.create(fs[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,g.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ms.forEach((s=>{const n=Object.create(fs[s]);t&&t[s]&&_s(n,t[s]),i[s]&&_s(n,i[s]),e[s]&&_s(n,e[s]),this.combinedTheme[s]=n})),e.common&&ms.forEach((t=>{_s(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 ys=new vs;function bs(t,e){return t.glyphHost?bs(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)):ys.getTheme()}return null}(t)||t.attachedThemeGraphic&&bs(t.attachedThemeGraphic)||ys.getTheme()}const xs=Object.prototype.hasOwnProperty,Ss=(t,e)=>null!=t&&xs.call(t,e),Ms=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),ks=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),As=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},ws=t=>"function"==typeof t;class Ts extends(o()){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=B.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return i=this,s=void 0,r=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}}},new((n=void 0)||(n=Promise))((function(t,e){function a(t){try{l(r.next(t))}catch(t){e(t)}}function o(t){try{l(r.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,o)}l((r=r.apply(i,s||[])).next())}));var i,s,n,r}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&g.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t0&&(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,e=!1){let 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,e=!1){let 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,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i1&&(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-Ds.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Ds.bounceIn(2*t):.5*Ds.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*lt/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/lt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*lt/e)*.5+1}}}Ds.quadIn=Ds.getPowIn(2),Ds.quadOut=Ds.getPowOut(2),Ds.quadInOut=Ds.getPowInOut(2),Ds.cubicIn=Ds.getPowIn(3),Ds.cubicOut=Ds.getPowOut(3),Ds.cubicInOut=Ds.getPowInOut(3),Ds.quartIn=Ds.getPowIn(4),Ds.quartOut=Ds.getPowOut(4),Ds.quartInOut=Ds.getPowInOut(4),Ds.quintIn=Ds.getPowIn(5),Ds.quintOut=Ds.getPowOut(5),Ds.quintInOut=Ds.getPowInOut(5),Ds.backIn=Ds.getBackIn(1.7),Ds.backOut=Ds.getBackOut(1.7),Ds.backInOut=Ds.getBackInOut(1.7),Ds.elasticIn=Ds.getElasticIn(1,.3),Ds.elasticOut=Ds.getElasticOut(1,.3),Ds.elasticInOut=Ds.getElasticInOut(1,.3*1.5);class Os{constructor(){this.id=B.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===de.END?this.removeAnimate(e):e.status===de.RUNNING||e.status===de.INITIAL?(this.animateCount++,e.advance(t)):e.status===de.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const Ps=new Os;class Rs{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 Bs extends Rs{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Is{constructor(t=B.GenAutoIncrementId(),e=Ps,i){this.id=t,this.timeline=e,this.status=de.INITIAL,this.tailAnimate=new Fs(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=ut(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Is.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Is.mode){t&&e&ce.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:he.ANIMATE_PLAY})}runCb(t){const e=new Bs((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=Is.interpolateMap.get(t)||Is.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===de.RUNNING&&(this.status=de.PAUSED)}resume(){this.status===de.PAUSED&&(this.status=de.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 Fs(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._duringTimet()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===de.RUNNING&&(this.status=de.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=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=de.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()}}Is.mode=ce.NORMAL,Is.interpolateMap=new Map;class Fs{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 Ys(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?Ds[i]:i,n=this._addStep(e,null,s);return n.type=ue.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?Ds[i]:i,r=this._addStep(e,null,n);return r.type=ue.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=ue.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=ue.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 Ys(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=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 i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return g.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 Ys{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 js=function(t,e,i){return ti?i:t};function Hs(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),r=i-s/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=s,o=n,l=0):60<=t&&t<120?(a=n,o=s,l=0):120<=t&&t<180?(a=0,o=s,l=n):180<=t&&t<240?(a=0,o=n,l=s):240<=t&&t<300?(a=n,o=0,l=s):300<=t&&t<360&&(a=s,o=0,l=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function zs(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,l=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l}}const Ns=/^#([0-9a-f]{3,8})$/,Vs={transparent:4294967040},Ws={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Gs(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Us(t){return h(t)?new Zs(t>>16,t>>8&255,255&t,1):y(t)?new Zs(t[0],t[1],t[2]):new Zs(255,255,255)}function $s(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Xs(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ks=(t,e)=>{const i=Ns.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Zs((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Us(t):8===e?new Zs(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class qs{static Brighter(t,e=1){return 1===e?t:new qs(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new qs(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof qs?t:new qs(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(M(Vs[t]))return function(t){return h(t)?new Zs(t>>>24,t>>>16&255,t>>>8&255,255&t):y(t)?new Zs(t[0],t[1],t[2],t[3]):new Zs(255,255,255,1)}(Vs[t]);if(M(Ws[t]))return Us(Ws[t]);const e=`${t}`.trim().toLowerCase(),i=Ks(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Zs(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Hs(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Zs(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=qs.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Zs(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=zs(this.color.r,this.color.g,this.color.b),r=Hs(D(t)?n.h:js(t,0,360),D(e)?n.s:e>=0&&e<=1?100*e:e,D(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Zs(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!D(t)&&(this.color.r=t),!D(e)&&(this.color.g=e),!D(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Ks(e,!0);return null!=i?i:this}setColorName(t){const e=Ws[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new qs(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=$s(t.color.r),this.color.g=$s(t.color.g),this.color.b=$s(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Xs(t.color.r),this.color.g=Xs(t.color.g),this.color.b=Xs(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Zs{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),M(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${Gs(this.r)+Gs(this.g)+Gs(this.b)+(1===this.opacity?"":Gs(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=zs(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var Js;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Js||(Js={}));class Qs{static Get(t,e=Js.Color1,i=[0,0,0,1]){if(e===Js.Color1){const e=Qs.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=qs.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Qs.store1[t]=e,Qs.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=Qs.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=qs.parseColorString(t);return n&&(Qs.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],Qs.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===Js.Color1){if(Qs.store1[t])return;Qs.store1[t]=i,Qs.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Qs.store255[t])return;Qs.store255[t]=i,Qs.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function tn(t,e=!1){return Array.isArray(t)&&h(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 en(t,e,i,s,n){return Array.isArray(t)&&!h(t[0])||Array.isArray(e)&&!h(e[0])?new Array(4).fill(0).map(((n,r)=>sn(y(t)?t[r]:t,y(e)?e[r]:e,i,s))):sn(t,e,i,s,n)}function sn(t,e,i,s,n){if(!t||!e)return t&&tn(t)||e&&tn(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Qs.Get(t,Js.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Qs.Get(e,Js.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:tn(a)})))});return o?en(r,l,i,s,n):en(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:an(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:an(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:an(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),tn(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)}Qs.store255={},Qs.store1={};const nn=[0,0,0,0],rn=[0,0,0,0];function an(t,e,i){return Qs.Get(t,Js.Color255,nn),Qs.Get(e,Js.Color255,rn),`rgba(${Math.round(nn[0]+(rn[0]-nn[0])*i)},${Math.round(nn[1]+(rn[1]-nn[1])*i)},${Math.round(nn[2]+(rn[2]-nn[2])*i)},${nn[3]+(rn[3]-nn[3])*i})`}class on{static GetImage(t,e){var i;const s=on.cache.get(t);s?"fail"===s.loadState?Si.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):on.loadImage(t,e)}static GetSvg(t,e){var i;let s=on.cache.get(t);s?"fail"===s.loadState?Si.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"},on.cache.set(t,s),s.dataPromise=Si.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=on.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},on.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Si.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Si.global.loadBlob(t):"json"===e&&(i.dataPromise=Si.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!on.isLoading&&on.toLoadAueue.length){on.isLoading=!0;const t=on.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(on.cache.set(i,n),n.dataPromise=Si.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((()=>{on.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),on.loading()})).catch((t=>{console.error(t),on.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),on.loading()}))}}),0)}static loadImage(t,e){const i=ln(t,on.toLoadAueue);if(-1!==i)return on.toLoadAueue[i].marks.push(e),void on.loading();on.toLoadAueue.push({url:t,marks:[e]}),on.loading()}static improveImageLoading(t){const e=ln(t,on.toLoadAueue);if(-1!==e){const t=on.toLoadAueue.splice(e,1);on.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function ln(t,e){for(let i=0;it?y(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(cn[0]=t[0],cn[2]=t[0],cn[1]=t[1],cn[3]=t[1],cn):t:t:0,pn=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],gn=[1,2,3,0,1,2,3,0];function mn(t,e,i,s){for(;t>=lt;)t-=lt;for(;t<0;)t+=lt;for(;t>e;)e+=lt;pn[0].x=i,pn[1].y=i,pn[2].x=-i,pn[3].y=-i;const n=Math.ceil(t/at)%4,r=Math.ceil(e/at)%4;if(s.add(ct(t)*i,gt(t)*i),s.add(ct(e)*i,gt(e)*i),n!==r||e-t>rt){let t=!1;for(let e=0;ee.length){s=e.map((t=>{const e=new be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{const e=new be(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}yn.TimeOut=1e3/60;const bn=new yn,xn=(t,e)=>S(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,Sn=new Ot,Mn=new qt,kn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],An=["x","y"],wn=["scaleX","scaleY"],Tn=["angle"],Ln=new be,Cn={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 En extends Ts{static mixin(t){const e=Object.keys(t);for(let i=0;i{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Si.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)&&(!!D(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 d;i.forEach((e=>{l[e]?(d||(d={}),d[e]=t[e]):h[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:200,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:"cubicOut"),d&&this.setAttributes(d,!1,{type:he.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:he.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();Ss(s,t)&&(e=s[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|=oe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=oe.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=oe.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&oe.UPDATE_SHAPE_AND_BOUNDS)===oe.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=oe.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oe.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=oe.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=oe.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=oe.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=oe.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=oe.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&oe.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 Mn.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Mn),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=ti.x,y:e=ti.y,scaleX:i=ti.scaleX,scaleY:s=ti.scaleY,angle:n=ti.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,d=e.c,c=e.d,u=e.e,p=e.f,g=ct(a),m=gt(a);let _,f;o?(_=o[0],f=o[1]):(_=i,f=s);const v=_-i,y=f-s,b=l*g+d*m,x=h*g+c*m,S=d*g-l*m,M=c*g-h*m;t.a=n*b,t.b=n*x,t.c=r*S,t.d=r*M,t.e=u+l*_+d*f-b*v-S*y,t.f=p+h*_+c*f-x*v-M*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h),Si.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const d=this.getOffsetXY(ti);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,o){const t=Sn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Si.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:he.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:he.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 d=a[r],c=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==d||null==c||d===c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,l,n)||this._interpolate(r,n,c,d,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=en(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=en(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=en(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,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Si.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 S(t,!0)?this.pathProxy=(new Ze).fromString(t):this.pathProxy=new Ze,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",Si.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Cs(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)}}}En.mixin(Es);function Dn(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let On=0;function Pn(){return On++}var Rn;function Bn(t){const e=[];let i=0,s="";for(let n=0;nIn.set(t,!0)));const Fn=new Map;function Yn(t){if(In.has(t))return!0;if(Fn.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Fn.set(t,!0)));const jn=Pn(),Hn=Pn(),zn=Pn(),Nn=Pn(),Vn=Pn(),Wn=Pn(),Gn=Pn(),Un=Pn(),$n=Pn(),Xn=Pn(),Kn=Pn(),qn=Pn(),Zn=Pn(),Jn=Pn(),Qn=Pn(),tr=Pn(),er=Symbol.for("GraphicService"),ir=Symbol.for("GraphicCreator"),sr=(Object.keys({"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"}),{"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"}),nr=Object.keys(sr);var rr;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(rr||(rr={}));class ar extends En{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Wn,this._childUpdateTag=oe.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 vs),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new vs)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===le.GLOBAL){const i=new be(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&oe.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Si.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Si.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=ti.x,y:e=ti.y,dx:i=ti.dx,dy:s=ti.dy,scaleX:n=ti.scaleX,scaleY:r=ti.scaleY,angle:a=ti.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 bs(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip,display:l}=t;return 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)})),Si.graphicService.updateTempAABBBounds(i),Si.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&=oe.CLEAR_BOUNDS,this._childUpdateTag&=oe.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=oe.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&oe.UPDATE_BOUNDS||(this._childUpdateTag|=oe.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(),Si.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Si.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,Si.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{Si.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),Si.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&oe.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=Si.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new ar(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ar.NOWORK_ANIMATE_ATTR}}function or(t){return new ar(t)}ar.NOWORK_ANIMATE_ATTR=Cn;class lr extends ar{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,s){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=s.main,this.layerHandler=s.layerHandler,this.layerHandler.init(this,i,{main:s.main,canvasId:s.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=s.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new vs,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Si.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Si.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const hr=Symbol.for("TransformUtil"),dr=Symbol.for("GraphicUtil"),cr=Symbol.for("LayerService"),ur=Symbol.for("StaticLayerHandlerContribution"),pr=Symbol.for("DynamicLayerHandlerContribution"),gr=Symbol.for("VirtualLayerHandlerContribution");var mr;let _r=mr=class{static GenerateLayerId(){return`${mr.idprefix}_${mr.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Si.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Xi.get(ur):"dynamic"===t?Xi.get(pr):Xi.get(gr),e}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;const n=this.getLayerHandler(s),r=new lr(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:mr.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(r),this.layerMap.set(t,a),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};_r.idprefix="visactor_layer",_r.prefix_count=0,_r=mr=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],_r);const fr=new I((t=>{t(et).to(st).inSingletonScope(),t(ns).to(as),t(dr).to(ds).inSingletonScope(),t(hr).to(ps).inSingletonScope(),t(cr).to(_r).inSingletonScope()})),vr=Symbol.for("IncrementalDrawContribution"),yr=Symbol.for("ArcRender"),br=Symbol.for("Arc3dRender"),xr=Symbol.for("AreaRender"),Sr=Symbol.for("CircleRender"),Mr=Symbol.for("GraphicRender"),kr=Symbol.for("GroupRender"),Ar=Symbol.for("LineRender"),wr=Symbol.for("PathRender"),Tr=Symbol.for("PolygonRender"),Lr=Symbol.for("RectRender"),Cr=Symbol.for("Rect3DRender"),Er=Symbol.for("SymbolRender"),Dr=Symbol.for("TextRender"),Or=Symbol.for("RichTextRender"),Pr=Symbol.for("Pyramid3dRender"),Rr=Symbol.for("GlyphRender"),Br=Symbol.for("ImageRender"),Ir=(Symbol.for("RenderSelector"),Symbol.for("DrawContribution"));const Fr=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let Yr=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};var jr,Hr;Yr=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}([V(),(jr=0,Hr=$(Ir),function(t,e){Hr(t,e,jr)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yr);const zr=new I((t=>{t(Fr).to(Yr)})),Nr=(Symbol.for("GraphicPicker"),Symbol.for("PickerService")),Vr=(Symbol.for("BoundsPicker"),Symbol.for("GlobalPickerService"));function Wr(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 Gr(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,d,c,u,p,g,m,_,f;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],d=e[4],c=e[5],u=e[6],p=e[7],g=e[8],m=e[9],_=e[10],f=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=p,t[8]=g,t[9]=m,t[10]=_,t[11]=f,t[12]=a*s+d*n+g*r+e[12],t[13]=o*s+c*n+m*r+e[13],t[14]=l*s+u*n+_*r+e[14],t[15]=h*s+p*n+f*r+e[15]),t}function Ur(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function $r(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],d=e[7],c=e[8],u=e[9],p=e[10],g=e[11],m=e[12],_=e[13],f=e[14],v=e[15];let y=i[0],b=i[1],x=i[2],S=i[3];return t[0]=y*s+b*o+x*c+S*m,t[1]=y*n+b*l+x*u+S*_,t[2]=y*r+b*h+x*p+S*f,t[3]=y*a+b*d+x*g+S*v,y=i[4],b=i[5],x=i[6],S=i[7],t[4]=y*s+b*o+x*c+S*m,t[5]=y*n+b*l+x*u+S*_,t[6]=y*r+b*h+x*p+S*f,t[7]=y*a+b*d+x*g+S*v,y=i[8],b=i[9],x=i[10],S=i[11],t[8]=y*s+b*o+x*c+S*m,t[9]=y*n+b*l+x*u+S*_,t[10]=y*r+b*h+x*p+S*f,t[11]=y*a+b*d+x*g+S*v,y=i[12],b=i[13],x=i[14],S=i[15],t[12]=y*s+b*o+x*c+S*m,t[13]=y*n+b*l+x*u+S*_,t[14]=y*r+b*h+x*p+S*f,t[15]=y*a+b*d+x*g+S*v,t}function Xr(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");class Kr{constructor(){this.pools=[]}static identity(t){return Wr(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 Kr.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{let n,r=!1,a=!1;if(e.forEachChildren((t=>(r=t.numberType===Hn,!r))),e.forEachChildren((t=>(a=!!t.findFace,!a))),r){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,s,n,r;let a=(null!==(s=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==s?s:0)/2,o=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;a<0;)a+=lt;for(;o<0;)o+=lt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),s.hack_pieFace="outside",n=i(r,a),n&&n.graphic||(s.hack_pieFace="inside",n=i(r,a)),n&&n.graphic||(s.hack_pieFace="top",n=i(r,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const s=e.getChildren(),o=s.map((e=>({ave_z:e.findFace().vertices.map((i=>{var s;return t.view(i[0],i[1],null!==(s=i[2]+e.attribute.z)&&void 0!==s?s:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),n=i(r,a),e.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),e.update(),s.forEach((t=>{e.add(t)}))}else n=i(r,a);return n};var Qr=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};const ta=Symbol.for("PickItemInterceptor");let ea=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,n):null}beforePickItem(t,e,i,s,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,n):null}_pickItem(t,e,i,s,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:a}=n||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const l=null===(r=bs(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,d=t.shadowRoot,c=qr.allocateByObj(a),u=new be(c.a*i.x+c.c*i.y+c.e,c.b*i.x+c.d*i.y+c.f),p=e.pickGroup(d,u,c,s);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};ea=Qr([V()],ea);let ia=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){const r=t.baseGraphic;if(r&&r.parent){const t=new be(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(t,t);const o=r.isContainer?e.pickGroup(r,t.clone(),a,s):e.pickItem(r,t.clone(),a,s);return n.highPerformanceRestore(),o}return null}};ia=Qr([V()],ia);let sa=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){if(!t.in3dMode||s.in3dInterceptor)return null;const r=e.pickContext,a=t.stage;if(!r||!a)return null;if(s.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,t.isContainer){const a=Jr(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,s)),s);return r.camera=null,s.in3dInterceptor=!1,r.restore(),a}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};sa=Qr([V()],sa);const na=new I(((t,e,i)=>{i(Nr)||(t(Vr).toSelf(),t(Nr).toService(Vr)),t(sa).toSelf().inSingletonScope(),t(ta).toService(sa),t(ea).toSelf().inSingletonScope(),t(ta).toService(ea),t(ia).toSelf().inSingletonScope(),t(ta).toService(ia),Z(t,ta)}));function ra(t,e=0,i=0){if(!t)return{width:e,height:i};let s;try{s=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){s=()=>({})}const n=s(t);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){const s=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||t.clientWidth-1,r=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||t.clientHeight-1;return{width:s<=0?e:s,height:r<=0?i:r}}return{width:e,height:i}}const aa=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();function oa(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function la(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function ha(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:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:m=i.angle,anchor3d:_=e.attribute.anchor,anchor:f}=e.attribute,v=[0,0,0];if(_){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=_[1];v[2]=null!==(s=_[2])&&void 0!==s?s:0}if(Wr(t),Gr(t,t,[n+o,r+l,a+h]),Gr(t,t,[v[0],v[1],v[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],d=e[9],c=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+d*s,t[6]=o*n+c*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=d*n-a*s,t[10]=c*n-o*s,t[11]=u*n-l*s}(t,t,g),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],d=e[9],c=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-d*s,t[2]=o*n-c*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+d*n,t[10]=o*s+c*n,t[11]=l*s+u*n}(t,t,p),Gr(t,t,[-v[0],-v[1],v[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,[d,c,u]),m){const i=Zr.allocate(),s=[0,0];if(f){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=_[1]}Gr(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],d=e[5],c=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+d*s,t[2]=o*n+c*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=d*n-a*s,t[6]=c*n-o*s,t[7]=u*n-l*s}(i,i,m),Gr(i,i,[-s[0],-s[1],0]),$r(t,t,i)}}let da=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Q(["graphic"]),onSetStage:new Q(["graphic","stage"]),onRemove:new Q(["graphic"]),onRelease:new Q(["graphic"]),onAddIncremental:new Q(["graphic","group","stage"]),onClearIncremental:new Q(["graphic","group","stage"]),beforeUpdateAABBBounds:new Q(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Q(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new qt,this.tempAABBBounds2=new qt}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)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new Rt(t);return ye(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=h(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=la(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=h(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=oa(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l&&(Dn(c,(l+h)/Math.abs(n+r),s,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)),o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;Dn(c,o/Math.abs(n+r)*2,!1,d+1),c.translate(s,a),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Xt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot)return!0;if(!s.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(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}}};da=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ir)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],da);const ca=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}},ua=new I((t=>{t(er).to(da).inSingletonScope(),t(ir).toConstantValue(ca)})),pa=Symbol.for("AutoEnablePlugins"),ga=Symbol.for("PluginService");var ma=function(t,e){return function(i,s){e(i,s,t)}};let _a=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Xi.isBound(pa)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};_a=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}([V(),ma(0,$(K)),ma(0,X(pa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_a);const fa=new I((t=>{t(ga).to(_a),function(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).whenTargetNamed(e)}(t,pa)})),va=new I((t=>{Z(t,tt)})),ya=new I((t=>{t(Pi).to(Ri).inSingletonScope(),Z(t,Pi)}));let ba=class{constructor(){this.type="static",this.offscreen=!1,this.global=Si.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const s=e.getContext().getCanvas().nativeCanvas,n=Zi({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(s=e.background)&&void 0!==s?s:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var s;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(s=i.background)&&void 0!==s?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};ba=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ba);const xa=new I((t=>{t(ba).toSelf(),t(ur).toService(ba)})),Sa=U(j);function Ma(t,e,i){const s={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:s,zIdxArray:n}}function ka(t,e,i,s=!1,n=!1){let r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,s)=>{const{zIndex:n=e}=t.attribute;if(0===s)i=n;else if(i!==n)return r=!0,!0;return!1}),s)}if(r){const{childMap:r,zIdxArray:a}=Ma(t,e,s);let o=!1;for(let t=0;t{var i,n;return(s?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t{const{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return n=!0,!0;return!1}),s);let r=null,a=!1;if(n){const{childMap:n,zIdxArray:o}=Ma(t,i,s);let l=!1;for(let t=0;ta?(r=t,!0):(t._uid===e&&(a=!0),!1)),s);return r}const Ta=Symbol.for("DrawItemInterceptor"),La=new qt,Ca=new qt;class Ea{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,s,n),!1}beforeDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){La.copy(s.dirtyBounds),Ca.copy(s.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,qr.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(La),s.backupDirtyBounds.copy(Ca)),!0}}class Da{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(a.x1,a.y1,a.width(),a.height()),r.highPerformanceRestore(),!0}}let Oa=class{constructor(){this.order=1,this.interceptors=[new Ea,new Ra,new Pa,new Da]}afterDrawItem(t,e,i,s,n){for(let r=0;r=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Oa);class Pa{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,s,n):this.beforeSetInteractive(t,e,i,s,n))}beforeSetInteractive(t,e,i,s,n){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,s,n){const r=t.baseGraphic;let a=!!r.stage,o=r.parent;for(;a&&o&&o.stage!==o;)a=!!o.stage,o=o.parent;if(!a){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?s.renderGroup(r,i,r.parent.globalTransMatrix):s.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=ca.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Ra{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:a}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=a.camera;const o=r.currentMatrix;o.a/=r.dpr,o.b/=r.dpr,o.c/=r.dpr,o.d/=r.dpr,o.e/=r.dpr,o.f/=r.dpr;const l=Zr.allocate();Ur(l,o);const h=r.modelMatrix;if(h){if(l){const t=Zr.allocate();r.modelMatrix=$r(t,h,l)}}else r.modelMatrix=l;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?Jr(r,t,((e,n)=>s.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):s.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&Zr.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}const Ba=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 s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s){if(f(s)){f(t.startCall)||i("Missing (");const s=function(){const s=n();return s&&(f(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:u(p)}}();return f(t.endCall)||i("Missing )"),s}}(s)}function r(){return _("directional",t.sideOrCorner,1)||_("angular",t.angleValue,1)}function a(){return _("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,f(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=_("shape",/^(circle)/i,0);return t&&(t.style=m()||h()),t}()||function(){const t=_("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return _("extent-keyword",t.extentKeywords,1)}function d(){if(_("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let s=e();const n=[];if(s)for(n.push(s);f(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=_("hex",t.hexColor,1)||_("rgba",t.rgbaColor,1)||_("rgb",t.rgbColor,1)||_("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return _("%",t.percentageValue,1)||_("position-keyword",t.positionKeywords,1)||m()}function m(){return _("px",t.pixelValue,1)||_("em",t.emValue,1)}function _(t,e,i){const s=f(e);if(s)return{type:t,value:s[i]}}function f(t){const i=/^[\n\r\t\s]+/.exec(e);i&&v(i[0].length);const s=t.exec(e);return s&&v(s[0].length),s}function v(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Ia{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ia.IsGradientStr(t))try{const e=Ba(t)[0];if(e){if("linear"===e.type)return Ia.ParseLinear(e);if("radial"===e.type)return Ia.ParseRadial(e);if("conic"===e.type)return Ia.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2,n=parseFloat(e.value)/180*rt-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+lt,stops:i.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:i=[]}=t,s=rt/2;let n="angular"===e.type?parseFloat(e.value)/180*rt:0;for(;n<0;)n+=lt;for(;n>lt;)n-=lt;let r=0,a=0,o=0,l=0;return n({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Fa(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)}function Ya(t,e,i,s=0,n=0){if(!e||!0===e)return"black";let r,a;if(y(e))for(let t=0;t{d.addColorStop(t.offset,t.color)})),d}(t,a,h,d,o,l):"conical"===a.gradient?r=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(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(n+i,r+s,void 0)}(t,a,h,d,o,l):"radial"===a.gradient&&(r=function(t,e,i,s,n,r){var a,o,l,h,d,c;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(d=e.y1)&&void 0!==d?d:.5)*r,Math.max(n,r)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,a,h,d,o,l))}return r||"orange"}Symbol.for("BoundsAllocate");const ja=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new qt)}allocate(t,e,i,s){if(!this.pools.length)return(new qt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new qt(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(...t){this.pools=[]}};var Ha=function(t,e){return function(i,s){e(i,s,t)}};let za=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Kt,this.backupDirtyBounds=new Kt,this.global=Si.global,this.layerService=Si.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:s,viewBox:n,transMatrix:r}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(s.dirtyBounds&&!s.dirtyBounds.empty()){const t=Ft(a,s.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),s.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,qr.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=wa(e,i,oi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,s){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!zt(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=ja.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=qr.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;s?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):ka(t,oi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),ja.free(n),qr.free(r))}_increaseRender(t,e){const{layer:i,stage:s}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(s),zIndex:n.size,group:t},n.set(t._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||Xi.get(vr);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:t._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(s),zIndex:n.size},n.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let s=0;s=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}([V(),Ha(0,Sa(Mr)),Ha(1,$(K)),Ha(1,X(Ta)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],za);const Wa=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n0)&&(s=r)}return s},Ga=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;nt||void 0===t)):!!t,i&&e>0}function Qa(t,e,i){return i&&t*e>0}function to(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function eo(t,e){return t*e>0}function io(t,e,i,s){return t*e>0&&0!==i&&0!==s}function so(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),d=h*l,c=-h*o,u=t+d,p=e+c,g=i+d,m=s+c,_=(u+g)/2,f=(p+m)/2,v=g-u,y=m-p,b=v*v+y*y,x=n-r,S=u*m-g*p,M=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-v*M)/b,A=(-S*v-y*M)/b;const w=(S*y+v*M)/b,T=(-S*v+y*M)/b,L=k-_,C=A-f,E=w-_,D=T-f;return L*L+C*C>E*E+D*D&&(k=w,A=T),{cx:k,cy:A,x01:-d,y01:-c,x11:k*(n/x-1),y11:A*(n/x-1)}}function no(t,e,i,s,n){const r=ht(i-e),a=t.getParsedCornerRadius(),o=y(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:c,innerEndAngle:u,innerStartAngle:p}=t.getParsePadAngle(e,i),g=o?a[0]:a,m=o?a[1]:a,_=o?a[2]:a,f=o?a[3]:a,v=Math.max(m,g),b=Math.max(_,f);let x=v,S=b;const M=n*ct(d),k=n*gt(d),A=s*ct(u),w=s*gt(u);let T,L,C,E;if((b>nt||v>nt)&&(T=n*ct(c),L=n*gt(c),C=s*ct(p),E=s*gt(p),r1?0:D<-1?rt:Math.acos(D))/2),l=mt(t[0]*t[0]+t[1]*t[1]);S=pt(b,(s-l)/(o-1)),x=pt(v,(n-l)/(o+1))}}var D;return{outerDeltaAngle:l,xors:M,yors:k,xirs:C,yirs:E,xore:T,yore:L,xire:A,yire:w,limitedOcr:x,limitedIcr:S,outerCornerRadiusStart:g,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:b,outerStartAngle:d,outerEndAngle:c,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:p,innerCornerRadiusStart:f,innerCornerRadiusEnd:_}}function ro(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(n=lt-nt)e.moveTo(i+n*ct(o),s+n*gt(o)),e.arc(i,s,n,o,l,!d),r>nt&&(e.moveTo(i+r*ct(l),s+r*gt(l)),e.arc(i,s,r,l,o,d));else{const{outerDeltaAngle:h,xors:u,yors:p,xirs:g,yirs:m,limitedOcr:_,outerCornerRadiusStart:f,outerCornerRadiusEnd:v,maxOuterCornerRadius:y,xore:b,yore:x,xire:S,yire:M,outerStartAngle:k,outerEndAngle:A,limitedIcr:w,innerDeltaAngle:T,innerEndAngle:L,innerStartAngle:C,innerCornerRadiusStart:E,innerCornerRadiusEnd:D,maxInnerCornerRadius:O}=no(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+u,s+p),c=!0;else if(_>nt){const t=pt(f,_),r=pt(v,_),o=so(g,m,u,p,n,t,Number(d)),l=so(b,x,S,M,n,r,Number(d));_0&&e.arc(i+o.cx,s+o.cy,t,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,n,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),!d),r>0&&e.arc(i+l.cx,s+l.cy,r,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):r>0?e.moveTo(i+l.cx+r*ct(dt(l.y01,l.x01)),s+l.cy+r*gt(dt(l.y01,l.x01))):e.moveTo(i+b,s+n*gt(A))}else!a||a[0]?(e.moveTo(i+u,s+p),e.arc(i,s,n,k,A,!d)):e.moveTo(i+n*ct(A),s+n*gt(A));if(!(r>nt)||T<.001)!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),c=!0;else if(w>nt){const t=pt(E,w),n=pt(D,w),o=so(S,M,b,x,r,-n,Number(d)),l=so(u,p,g,m,r,-t,Number(d));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),w0&&e.arc(i+o.cx,s+o.cy,n,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,r,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),d),t>0&&e.arc(i+l.cx,s+l.cy,t,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):t>0?e.moveTo(i+l.cx+t*ct(dt(l.y01,l.x01)),s+l.cy+t*gt(dt(l.y01,l.x01))):e.moveTo(i+g,s+m)}else!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),!a||a[2]?e.arc(i,s,r,L,C,d):e.moveTo(i+r*ct(C),s+r*gt(C))}return a?a[3]&&e.lineTo(i+n*ct(o),s+n*gt(o)):e.closePath(),c}const ao=Symbol.for("ArcRenderContribution"),oo=Symbol.for("AreaRenderContribution"),lo=Symbol.for("CircleRenderContribution"),ho=Symbol.for("GroupRenderContribution"),co=Symbol.for("ImageRenderContribution"),uo=Symbol.for("PathRenderContribution"),po=Symbol.for("PolygonRenderContribution"),go=Symbol.for("RectRenderContribution"),mo=Symbol.for("SymbolRenderContribution"),_o=Symbol.for("TextRenderContribution"),fo=(Symbol.for("CommonRenderContribution"),Symbol.for("InteractiveSubRenderContribution"));var vo=function(t,e){return function(i,s){e(i,s,t)}};class yo{constructor(){this.time=me.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;const{background:g,backgroundOpacity:m=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:_=l.opacity,backgroundMode:f=l.backgroundMode,backgroundFit:v=l.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=bs(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=m*_,this.doDrawImage(e,n.data,r,f,v),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,e.fillStyle=g,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,d=Ji.allocate({width:o,height:l,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=d.nativeCanvas),Ji.free(d)}const h=t.dpr,d=t.createPattern(e,s);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}}const bo=new yo;let xo=class{constructor(t){this.subRenderContribitions=t,this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}};xo=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}([V(),vo(0,$(K)),vo(0,X(fo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],xo);const So=new class extends yo{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{background:u,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const s=t.AABBBounds;this.doDrawImage(e,i.data,s,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}};var Mo=function(t,e){return function(i,s){e(i,s,t)}};let ko=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Wn}drawShape(t,e,i,s,n,r,a,o){const l=bs(t,null==r?void 0:r.theme).group,{fill:h=l.fill,background:d,stroke:c=l.stroke,opacity:u=l.opacity,width:p=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:_=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,cornerRadius:v=l.cornerRadius,path:b=l.path,lineWidth:x=l.lineWidth,visible:S=l.visible,fillStrokeOrder:M=l.fillStrokeOrder,x:k=l.x,y:A=l.y}=t.attribute,w=to(u,_,p,g,h),T=io(u,f,p,g),L=Za(h,d),C=Ja(c,x);if(!t.valid||!S)return;if(!m){if(!L&&!C)return;if(!(w||T||a||o||d))return}if(b&&b.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,b.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===v||y(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(i,s,p,g)):(e.beginPath(),qa(e,i,s,p,g,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(So));const E={doFill:L,doStroke:C};this._groupRenderContribitions.forEach((r=>{r.time===me.beforeFillStroke&&r.drawShape(t,e,i,s,L,C,w,T,l,n,a,o,E)})),m&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const D=()=>{E.doFill&&(a?a(e,t.attribute,l):w&&(e.setCommonStyle(t,t.attribute,k-i,A-s,l),e.fill()))},O=()=>{E.doStroke&&(o?o(e,t.attribute,l):T&&(e.setStrokeStyle(t,t.attribute,k-i,A-s,l),e.stroke()))};M?(O(),D()):(D(),O()),this._groupRenderContribitions.forEach((r=>{r.time===me.afterFillStroke&&r.drawShape(t,e,i,s,L,C,w,T,l,n,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:a=1}=t.attribute;r?n.save():n.highPerformanceSave();const o=n.baseGlobalAlpha;n.baseGlobalAlpha*=a;const l=bs(t,null==s?void 0:s.theme).group,h=n.modelMatrix;if(n.camera){const e=Zr.allocate(),i=Zr.allocate();ha(i,t,l),$r(e,h||e,i),n.modelMatrix=e,Zr.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),s.skipDraw?this.drawShape(t,n,0,0,i,s,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:d=l.scrollX,scrollY:c=l.scrollY}=t.attribute;let u;(d||c)&&n.translate(d,c),s&&s.drawingCb&&(u=s.drawingCb()),n.modelMatrix!==h&&Zr.free(n.modelMatrix),n.modelMatrix=h,n.baseGlobalAlpha=o,u&&u.then?u.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};ko=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}([V(),Mo(0,$(K)),Mo(0,X(ho)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ko);const Ao={x:0,y:0,z:0,lastModelMatrix:null};class wo{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===me.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===me.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,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,d,c,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,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,d,c,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:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Qa(o,l,n),p=eo(o,d),g=Za(n,r),m=Ja(a,h);return!(!t.valid||!c)&&!(!g&&!m)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:m}}transform(t,e,i,s=!1){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:d}=t.attribute,c=i.modelMatrix,u=i.camera;Ao.x=n,Ao.y=r,Ao.z=a,Ao.lastModelMatrix=c;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){const s=Zr.allocate(),n=Zr.allocate();ha(n,t,e),$r(s,c||s,n),Ao.x=0,Ao.y=0,Ao.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Zr.free(n)}if(g&&!c){const s=t.getOffsetXY(e);Ao.x+=s.x,Ao.y+=s.y,Ao.z=a,i.setTransformForCurrent()}else if(p)Ao.x=0,Ao.y=0,Ao.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);Ao.x+=s.x,Ao.y+=s.y,this.transformWithoutTranslate(i,Ao.x,Ao.y,Ao.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Ao.x=0,Ao.y=0,Ao.z=0;return Ao}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},d={x:n,y:0},c={x:n,y:r};s.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+c.y*o.x+(d.y-c.y)*a.x)*u,g=(d.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-d.y)*a.y)*u,m=(h.x*(l.x-o.x)-d.x*l.x+c.x*o.x+(d.x-c.x)*a.x)*u,_=-(d.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-d.x)*a.y)*u,f=(h.x*(c.y*o.x-d.y*l.x)+h.y*(d.x*l.x-c.x*o.x)+(c.x*d.y-d.x*c.y)*a.x)*u,v=(h.x*(c.y*o.y-d.y*l.y)+h.y*(d.x*l.y-c.x*o.y)+(c.x*d.y-d.x*c.y)*a.y)*u;s.setTransform(p,g,m,_,f,v,!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:d,lastModelMatrix:c}=o;this.z=d,function(t,e,i,s,n,r){if(!t.pathProxy)return!1;const a=bs(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:o=a.fill,stroke:l=a.stroke,opacity:h=a.opacity,fillOpacity:d=a.fillOpacity,lineWidth:c=a.lineWidth,strokeOpacity:u=a.strokeOpacity,visible:p=a.visible,x:g=a.x,y:m=a.y}=t.attribute,_=Qa(h,d,o),f=eo(h,u),v=Za(o),y=Ja(l,c);return!p||!v&&!y||!(_||f)||(e.beginPath(),ye(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),y&&f&&(e.setStrokeStyle(t,t.attribute,i-g,s-m,a),e.stroke()),v&&_&&(e.setCommonStyle(t,t.attribute,i-g,s-m,a),e.fill()),!0)}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==c&&Zr.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}function To(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=Ae(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function Lo(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:i,originP2:d}=e;let c;if(i&&!1!==i.defined?c=l:i&&!1!==d.defined&&(c=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=c?c.x:e.p0.x,o=c?c.y:e.p0.y;t.moveTo(i+n,o+r,a)}else c&&(h=!s,t.lineTo(c.x+n,c.y+r,a))}return h}function Co(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let d=!0;const{curves:c}=e;if(i>=1){if(h){let e,i=!0;c.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Lo(t,s,e,i,r,a,o),e=s):e=s}))}else c.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+r,e.p0.y+a,o),To(t,e,1,n),d=!1):d=!0}));return}if(i<=0)return;let u;"x"===s?u=pe.ROW:"y"===s?u=pe.COLUMN:"auto"===s&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,m=!0,_=null;for(let e=0,i=c.length;et.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,a,o);const{x:S=0,x:M=0}=a;!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,a,S-d,M-c,o),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,a,S-d,M-c,o),t.stroke()));let{connectedType:k,connectedX:A,connectedY:w,connectedStyle:T}=a;if(y(o)?(k=null!==(_=null!=k?k:o[0].connectedType)&&void 0!==_?_:o[1].connectedType,A=null!==(f=null!=A?A:o[0].connectedX)&&void 0!==f?f:o[1].connectedX,w=null!==(v=null!=w?w:o[0].connectedY)&&void 0!==v?v:o[1].connectedY,T=null!==(b=null!=T?T:o[0].connectedStyle)&&void 0!==b?b:o[1].connectedStyle):(k=null!=k?k:o.connectedType,A=null!=A?A:o.connectedX,w=null!=w?w:o.connectedY,T=null!=T?T:o.connectedStyle),"connect"!==k&&"zero"!==k&&(k="none"),"none"!==k){t.beginPath(),Co(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:c,offsetZ:x,drawConnect:!0,mode:k,zeroX:A,zeroY:w});const m=[];y(o)?o.forEach((t=>m.push(t))):m.push(o),m.push(a),!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,T,S-d,M-c,m),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,T,S-d,M-c,m),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:m}=t.attribute,_=m[0];e.moveTo(_.x+a,_.y+o,g);for(let t=1;t!1===t.defined))&&"linear"===f)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,s,l,n,r,a,o);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=qe(t.points,f,{startPoint:e,curveTension:_});return s=n,n})).filter((t=>!!t)),"linearClosed"===f){let e;for(let i=0;it.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!d,c,u,n[g],[l,t.attribute],v,y,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,m=!1;t.cache.forEach(((r,_)=>{if(m)return;const f=r.getLength(),v=(p-g)/f;g+=f,v>0&&(m=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[_],[l,t.attribute],pt(v,1),y,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,l,v,y,i,s,t,a,o)}};Eo=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}([V()],Eo);let Do=class extends Eo{constructor(){super(...arguments),this.numberType=Un}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=bs(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:m=h.lineWidth,visible:_=h.visible}=t.attribute,f=Qa(u,p,d),v=eo(u,g),y=Za(d),b=Ja(c,m);if(!t.valid||!_)return;if(!y&&!b)return;if(!(f||v||a||o))return;const{context:x}=n;for(let n=e;n{!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())}};function Oo(t,e,i,s){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0,mode:o}=s||{};let l=e[0];t.moveTo(l.p0.x+n,l.p0.y+r,a),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+n,h.y+r,a),l=i[i.length-1],t.lineTo(l.p0.x+n,l.p0.y+r,a),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+n,h.y+r,a),t.closePath()}function Po(t,e,i,s){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+r,a),To(t,e,1,s),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+r,a),To(t,l,1,s),o=!1):o=!0}t.closePath()}Do=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}([V()],Do);class Ro{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Ji.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])),Ji.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,lt),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,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:m=l.textureSize,texturePadding:_=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,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 Bo=new Ro,Io=new class extends Ro{constructor(){super(...arguments),this.time=me.afterFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:f=t.attribute}=u||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:vn(l,"texture")),textureColor:y=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:vn(l,"textureColor")),textureSize:b=(null!==(m=t.attribute.textureSize)&&void 0!==m?m:vn(l,"textureSize")),texturePadding:x=(null!==(_=t.attribute.texturePadding)&&void 0!==_?_:vn(l,"texturePadding"))}=f;v&&this.drawTexture(v,t,e,i,s,l,y,b,x)}},Fo=bo;var Yo=function(t,e){return function(i,s){e(i,s,t)}};let jo=class extends wo{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=zn,this.builtinContributions=[Io,Fo],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m;const{points:_}=t.attribute;if(_.length<2)return;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,v=_[0];e.moveTo(v.x+a,v.y+o,f);for(let t=1;t<_.length;t++){const i=_[t];e.lineTo(i.x+a,i.y+o,f)}for(let t=_.length-1;t>=0;t--){const i=_[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(m=i.y1)&&void 0!==m?m:i.y)+o,f)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute});const{x:b=0,x=0}=t.attribute;!1!==i&&(c?c(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,b-a,x-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute}),(()=>{var i,n;if(s){const{stroke:s=l&&l.stroke}=t.attribute;if(y(s)&&(s[0]||s[2])&&!1===s[1])if(e.beginPath(),s[0]){e.moveTo(v.x+a,v.y+o,f);for(let t=1;t<_.length;t++){const i=_[t];e.lineTo(i.x+a,i.y+o,f)}}else if(s[2]){const t=_[_.length-1];e.moveTo(t.x+a,t.y+o,f);for(let t=_.length-2;t>=0;t--){const s=_[t];e.lineTo((null!==(i=s.x1)&&void 0!==i?i:s.x)+a,(null!==(n=s.y1)&&void 0!==n?n:s.y)+o,f)}}u?u(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,b-a,x-o,l),e.stroke())}})()}drawShape(t,e,i,s,n,r,a,o){var l,h,d,c,u,p;const g=bs(t,null==r?void 0:r.theme).area,{fill:m=g.fill,stroke:_=g.stroke,fillOpacity:f=g.fillOpacity,z:v=g.z,strokeOpacity:y=g.strokeOpacity,curveTension:b=g.curveTension}=t.attribute,x=this.valid(t,g,a,o);if(!x)return;const{doFill:S}=x,M=x.doStroke&&x.sVisible,{clipRange:k=g.clipRange,closePath:A,points:w,segments:T}=t.attribute;let{curveType:L=g.curveType}=t.attribute;if(A&&"linear"===L&&(L="linearClosed"),1===k&&!T&&!w.some((t=>!1===t.defined))&&"linear"===L)return this.drawLinearAreaHighPerformance(t,e,!!m,M,f,y,i,s,g,n,r,a,o);if(t.shouldUpdateShape()){if(T&&T.length){let e,i;const s=T.map(((t,s)=>{if(t.points.length<=1&&0===s)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===s?e={x:i.endX,y:i.endY}:s>1&&(e.x=i.endX,e.y=i.endY);const n=qe(t.points,L,{startPoint:e,curveTension:b});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=T.length-1;t>=0;t--){const e=T[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=T[t-1].points,s=e[e.length-1];s&&i.push({x:null!==(d=s.x1)&&void 0!==d?d:s.x,y:null!==(c=s.y1)&&void 0!==c?c:s.y})}i.length>1&&(n=qe(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!w||!w.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=w,i=[];for(let t=w.length-1;t>=0;t--)i.push({x:null!==(u=w[t].x1)&&void 0!==u?u:w[t].x,y:null!==(p=w[t].y1)&&void 0!==p?p:w[t].y});const s=qe(e,L,{curveTension:b}),n=qe(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b});t.cacheArea={top:s,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===k){let l=!1;t.cacheArea.forEach(((h,d)=>{l||(l=this.drawSegmentItem(e,h,S,f,M,y,r[d],[g,t.attribute],k,i,s,v,t,n,a,o))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=k*l;let d=0,c=!1;t.cacheArea.forEach(((l,u)=>{if(c)return;const p=l.top.getLength(),m=(h-d)/p;d+=p,m>0&&(c=this.drawSegmentItem(e,l,S,f,M,y,r[u],[g,t.attribute],pt(m,1),i,s,v,t,n,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,S,f,M,y,t.attribute,g,k,i,s,v,t,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).area;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m){let _=!1;return _=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!1,g,m),_=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!0,g,m),_}_drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f,v,b,x;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:S,connectedX:M,connectedY:k,connectedStyle:A}=a;const w=[];if(g&&(y(o)?(S=null!==(f=null!=S?S:o[0].connectedType)&&void 0!==f?f:o[1].connectedType,M=null!==(v=null!=M?M:o[0].connectedX)&&void 0!==v?v:o[1].connectedX,k=null!==(b=null!=k?k:o[0].connectedY)&&void 0!==b?b:o[1].connectedY,A=null!==(x=null!=A?A:o[0].connectedStyle)&&void 0!==x?x:o[1].connectedStyle):(S=null!=S?S:o.connectedType,M=null!=M?M:o.connectedX,k=null!=k?k:o.connectedY,A=null!=A?A:o.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),y(o)?o.forEach((t=>w.push(t))):w.push(o),w.push(a)),g&&"none"===S)return!1;t.beginPath();const{points:T,segments:L}=u.attribute;let C,E,D=pe.ROW;if(L){const t=L[L.length-1];E=L[0].points[0],C=t.points[t.points.length-1]}else E=T[0],C=T[T.length-1];const O=ht(C.x-E.x),P=ht(C.y-E.y);D=null==C.x1?pe.ROW:null==C.y1?pe.COLUMN:Number.isFinite(O+P)?O>P?pe.ROW:pe.COLUMN:pe.ROW,function(t,e,i,s){var n;const{drawConnect:r=!1,mode:a="none"}=s||{};if(r&&"none"===a)return;const{top:o,bottom:l}=e;if(o.curves.length!==l.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,a=!0;const h=o.curves.length;o.curves.forEach(((o,d)=>{const c=l.curves[h-d-1];let u=o,p=c;if(o.originP1===o.originP2)return n=o,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,p=r),o.defined)a||(e.push(u),i.push(p),Oo(t,e,i,s),e.length=0,i.length=0,a=!a);else{const{originP1:n,originP2:r}=o;let l,h;n&&!1!==n.defined?(l=u,h=p):n&&!1!==r.defined&&(l=o,h=c),a?(a=!a,e.push(l||o),i.push(h||c)):l&&(a=!a,e.push(l||o),i.push(h||c),Oo(t,e,i,s),e.length=0,i.length=0)}n=o})),Oo(t,e,i,s)}else{for(let r=0,a=o.curves.length;rp?pe.ROW:pe.COLUMN,Number.isFinite(u)||(h=pe.COLUMN),Number.isFinite(p)||(h=pe.ROW);const g=i*(h===pe.ROW?u:p);let m=0,_=!0;const f=[],v=[];let y,b,x=!0;for(let e=0,i=o.curves.length;e{if(!1!==n)if(_)_(t,a,o);else{const{stroke:i=o&&o[1]&&o[1].stroke}=a;y(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),Co(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,l,D===pe.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:g,mode:S,zeroX:M,zeroY:k})),t.setStrokeStyle(u,g?A:a,R-h,B-d,g?w:o),t.stroke()}})(),!1}};jo=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}([V(),Yo(0,$(K)),Yo(0,X(oo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],jo);let Ho=class extends jo{constructor(){super(...arguments),this.numberType=zn}drawShape(t,e,i,s,n,r,a){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:o}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(r>l.length)return;const h=bs(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:p=h.visible}=t.attribute,g=Qa(u,c,d),m=Za(d);if(!t.valid||!p)return;if(!m)return;if(!g&&!a)return;for(let n=r;n{var a,o,l,h;const d=e&&0===s?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const s=i[e];t.lineTo(null!==(a=s.x1)&&void 0!==a?a:s.x,null!==(o=s.y1)&&void 0!==o?o:s.y)}t.lineTo(null!==(l=d.x1)&&void 0!==l?l:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,a,o,r),e.fill())}};Ho=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}([V()],Ho);var zo,No=function(t,e){return function(i,s){e(i,s,t)}},Vo=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())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(zo||(zo={}));let Wo=class extends za{constructor(t,e,i,s){super(t,s),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=zo.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Q([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Vo(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:s,viewBox:n}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(n.x1,n.y1,!0),s.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{s.restore(),s.restore(),s.draw(),s.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Vo(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Vo(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Vo(this,void 0,void 0,(function*(){if(2!==t.count)yield Aa(t,oi.zIndex,((i,s)=>{if(this.status===zo.STOP)return!0;if(i.isContainer)return!1;if(s{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Vo(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Vo(this,void 0,void 0,(function*(){this.rendering&&(this.status=zo.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=zo.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Vo(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Vo(this,void 0,void 0,(function*(){yield Aa(t,oi.zIndex,(t=>Vo(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Wo=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}([V(),No(0,Sa(Mr)),No(1,$(Do)),No(2,$(Ho)),No(3,$(K)),No(3,X(Ta)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],Wo);const Go=new I((t=>{t(yo).toSelf().inSingletonScope(),t(Ro).toSelf().inSingletonScope(),t(Ir).to(za),t(vr).to(Wo),t(kr).to(ko).inSingletonScope(),t(Mr).toService(kr),Z(t,ho),t(xo).toSelf().inSingletonScope(),Z(t,fo),Z(t,Mr),t(Oa).toSelf().inSingletonScope(),t(Ta).toService(Oa),Z(t,Ta)}));function Uo(){var t;Uo.__loaded||(Uo.__loaded=!0,Xi.load(fr),Xi.load(ua),Xi.load(zr),Xi.load(na),Xi.load(fa),(t=Xi).load(va),t.load(ya),t.load(xa),function(t){t.load(Go)}(Xi))}Uo.__loaded=!1,Uo();const $o=Xi.get(et);Si.global=$o;const Xo=Xi.get(dr);Si.graphicUtil=Xo;const Ko=Xi.get(hr);Si.transformUtil=Ko;const qo=Xi.get(er);Si.graphicService=qo;const Zo=Xi.get(cr);function Jo(t,e={data:t=>t}){if(!t)return t;if(t.constructor===Object){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(e[s]){i[s]=e[s](t[s]);continue}i[s]=Jo(t[s],e)}return i}return y(t)?t.map((t=>Jo(t,e))):t}function Qo(t,e){if(!t)return t;if(w(t)){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(S(t[s])&&e.getFunction(t[s])){i[s]=e.getFunction(t[s]);continue}i[s]=Qo(t[s],e)}return i}return y(t)?t.map((t=>Qo(t,e))):t}Si.layerService=Zo;let tl=0;function el(){return tl>=9999999&&(tl=0),tl++}const il=t=>h(t)&&Number.isFinite(t);function sl(t){return null!=t&&""!==t&&(!!h(t)||+t==+t)}function nl(t){return!(!t||0===t.length)&&!D(t[0])&&!D(t[0].dataId)&&y(t[0].fields)}function rl(t){switch(t){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function al(t){return!!S(t)&&!!t.endsWith("%")&&sl(t.substring(0,t.length-1))}function ol(t,e,i,s=0){var n,r;return h(t)?t:al(t)?Number(t.substring(0,t.length-1))*e/100:ws(t)?t(i):As(t)?e*(null!==(n=t.percent)&&void 0!==n?n:0)+(null!==(r=t.offset)&&void 0!==r?r:0):s}function ll(t,e,i){var s,n,r,a;const o={top:0,bottom:0,left:0,right:0};return Object.values(t).every((t=>h(t)))?(o.top=null!==(s=t.top)&&void 0!==s?s:0,o.right=null!==(n=t.right)&&void 0!==n?n:0,o.bottom=null!==(r=t.bottom)&&void 0!==r?r:0,o.left=null!==(a=t.left)&&void 0!==a?a:0,o):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((e=>{e.orients.forEach((s=>{o[s]=ol(t[s],e.size,i)}))})),o)}function hl(t){let e={};return y(t)?(D(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),D(t[1])||(e.left=e.right=t[1]),D(t[2])||(e.bottom=t[2]),D(t[3])||(e.left=t[3]),e):h(t)||al(t)||ws(t)||As(i=t)&&("percent"in i||"offset"in i)?(e.top=e.left=e.bottom=e.right=t,e):As(t)?(e=Object.assign({},t),e):e;var i}function dl(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}const cl=(t,e)=>{const i=Number(t),s=t.toString();return isNaN(i)&&"%"===s[s.length-1]?e*(Number(s.slice(0,s.length-1))/100):i};let ul;function pl(){!function(){if(null==ul)try{const t=document.createElement("canvas"),e=t.getContext("2d");ul=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),ul&&(ul=!!document.createElement)}catch(t){ul=!1}}();const t=Si.global&&Si.global.env;return t?"browser"===t:ul}const gl=pl(),ml=gl&&globalThis?globalThis.document:void 0;function _l(t){return("desktop-browser"===t||"mobile-browser"===t)&&gl}function fl(t){return vl(t)||"mobile-browser"===t}function vl(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}const yl=(t,e)=>(ws(xl.warnHandler)&&xl.warnHandler.call(null,t,e),e?g.getInstance().warn(`[VChart warn]: ${t}`,e):g.getInstance().warn(`[VChart warn]: ${t}`)),bl=(t,e,i)=>{if(!xl.silent){if(!ws(xl.errorHandler))throw new Error(t);xl.errorHandler.call(null,t,e)}},xl={silent:!1,warnHandler:!1,errorHandler:!1};var Sl,Ml;function kl(t){var e,i;const{type:s}=t;return s===Sl.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(i=t.direction)&&void 0!==i?i:"vertical"}!function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn",t.mosaic="mosaic"}(Sl||(Sl={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.wordMask="wordMask",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquidGroup="liquidGroup",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(Ml||(Ml={}));const Al={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},wl={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function Tl(t,e){var i;if(!t)return[];const s=Ol(t,e);if(!s||y(s))return null!==(i=s)&&void 0!==i?i:[];if(As(s)){const{dataScheme:i}=s;return i?Dl(i)?i.map((i=>Object.assign(Object.assign({},i),{scheme:i.scheme.map((i=>El(i)?Cl(t,i,e):i)).filter(M)}))):i.map((i=>El(i)?Cl(t,i,e):i)).filter(M):[]}return[]}function Ll(t,e){var i,s;return Dl(t)?null!==(s=null===(i=t.find((t=>M(t.isAvailable)?ws(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!M(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength)))||void 0===i?void 0:i.scheme)&&void 0!==s?s:t[t.length-1].scheme:t}function Cl(t,e,i){var s;const n=Ol(t,i);if(!n)return;let r;const{palette:a}=n;if(As(a)&&(r=null!==(s=function(t,e){const i=Al[e];if(i&&t[i])return t[i];if(t[e])return t[e];const s=wl[e];return s?t[s]:void 0}(a,e.key))&&void 0!==s?s:e.default),!r)return;if(D(e.a)&&D(e.l)||!S(r))return r;let o=new qs(r);if(M(e.l)){const{r:t,g:i,b:s}=o.color,{h:n,s:r}=zs(t,i,s),a=Hs(n,r,e.l),l=new qs(`rgb(${a.r}, ${a.g}, ${a.b})`);l.setOpacity(o.color.opacity),o=l}return M(e.a)&&o.setOpacity(e.a),o.toRGBA()}function El(t){return t&&"palette"===t.type&&!!t.key}function Dl(t){return!(!y(t)||0===t.length)&&t.every((t=>M(t.scheme)))}function Ol(t,e){var i,s;const{type:n}=null!=e?e:{};let r;if(!e||D(n))r=null==t?void 0:t.default;else{const a=kl(e);r=null!==(s=null!==(i=null==t?void 0:t[`${n}_${a}`])&&void 0!==i?i:null==t?void 0:t[n])&&void 0!==s?s:null==t?void 0:t.default}return r}function Pl(t,...e){let i=-1;const s=e.length;for(;++i{if(As(e))e.type===n&&(y(t[n])?t[n].length>=e.index&&(t[n][e.index]=s?Pl({},t[n][e.index],i):i):t[n]=s?Pl({},t[n],i):i);else if(y(t[n])){const r=t[n].findIndex((t=>t.id===e));r>=0&&(t[n][r]=s?Pl({},t[n][r],i):i)}else t.id===e&&(t[n]=s?Pl({},t[n],i):i)}))}var Bl={},Il={};function Fl(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Yl(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var s in t)s in e||i.push(e[s]=s)})),i}function jl(t,e){var i=t+"",s=i.length;return s=r?l=!0:10===(s=t.charCodeAt(a++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(n+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+jl(s,6):jl(s,4))+"-"+jl(i.getUTCMonth()+1,2)+"-"+jl(i.getUTCDate(),2)+(o?"T"+jl(n,2)+":"+jl(r,2)+":"+jl(a,2)+"."+jl(o,3)+"Z":a?"T"+jl(n,2)+":"+jl(r,2)+":"+jl(a,2)+"Z":r||n?"T"+jl(n,2)+":"+jl(r,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var i,s,n,r,a,o}return{parse:function(t,e){var i,n,r=s(t,(function(t,s){if(i)return i(t,s-1);n=t,i=e?function(t,e){var i=Fl(t);return function(s,n){return e(i(s),n,t)}}(t,e):Fl(t)}));return r.columns=n||[],r},parseRows:s,format:function(e,i){return null==i&&(i=Yl(e)),[i.map(a).join(t)].concat(n(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=Yl(t)),n(t,e).join("\n")},formatRows:function(t){return t.map(r).join("\n")},formatRow:r,formatValue:a}}var zl,Nl=Hl(","),Vl=Nl.parse,Wl=(Nl.parseRows,Nl.format,Nl.formatBody,Nl.formatRows,Nl.formatRow,Nl.formatValue,Hl("\t")),Gl=Wl.parse;Wl.parseRows,Wl.format,Wl.formatBody,Wl.formatRows,Wl.formatRow,Wl.formatValue,function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(zl||(zl={}));const Ul=function(t,...e){return function(t,...e){t||(t={});let i=-1;const s=e.length;for(;++i{i.type=zl.DSV;const s=Ul(Kl,e),{delimiter:n}=s;if(!S(n))throw new TypeError("Invalid delimiter: must be a string!");return Hl(n).parse(t)},Zl=(t,e={},i)=>(i.type=zl.DSV,Vl(t)),Jl=(t,e={},i)=>(i.type=zl.DSV,Gl(t));class Ql{static registerChart(t,e){Ql._charts[t]=e}static registerSeries(t,e){Ql._series[t]=e}static registerComponent(t,e,i){Ql._components[t]={cmp:e,alwaysCheck:i}}static registerMark(t,e){Ql._marks[t]=e}static registerRegion(t,e){Ql._regions[t]=e}static registerTransform(t,e){Ql.transforms[t]=e}static registerLayout(t,e){Ql._layout[t]=e}static registerAnimation(t,e){Ql._animations[t]=e}static registerImplement(t,e){Ql._implements[t]=e}static registerChartPlugin(t,e){Ql._chartPlugin[t]=e}static registerComponentPlugin(t,e){Ql._componentPlugin[t]=e}static createChart(t,e,i){return Ql._charts[t]?new(0,Ql._charts[t])(e,i):null}static createChartSpecTransformer(t,e){if(!Ql._charts[t])return null;const i=Ql._charts[t];return new(0,i.transformerConstructor)(Object.assign({seriesType:i.seriesType},e))}static createRegion(t,e,i){return Ql._regions[t]?new(0,Ql._regions[t])(e,i):null}static createRegionSpecTransformer(t,e){return Ql._regions[t]?new(0,Ql._regions[t].transformerConstructor)(e):null}static createSeries(t,e,i){return Ql._series[t]?new(0,Ql._series[t])(e,i):null}static createSeriesSpecTransformer(t,e){return Ql._series[t]?new(0,Ql._series[t].transformerConstructor)(e):null}static createMark(t,e,i){if(!Ql._marks[t])return null;const s=new(0,Ql._marks[t])(e,i);return"group"===s.type&&s.setMarkConfig({interactive:!1}),s}static getComponents(){return Object.values(Ql._components)}static getComponentInKey(t){return Ql._components[t].cmp}static getLayout(){return Object.values(Ql._layout)}static getLayoutInKey(t){return Ql._layout[t]}static getSeries(){return Object.values(Ql._series)}static getSeriesInType(t){return Ql._series[t]}static getRegionInType(t){return Ql._regions[t]}static getAnimationInKey(t){return Ql._animations[t]}static getImplementInKey(t){return Ql._implements[t]}static getSeriesMarkMap(t){return Ql._series[t]?Ql._series[t].mark:{}}static getChartPlugins(){return Object.values(Ql._chartPlugin)}static getComponentPlugins(){return Object.values(Ql._componentPlugin)}static getComponentPluginInType(t){return Ql._componentPlugin[t]}static registerFormatter(t){this._formatter=t}static getFormatter(){return this._formatter}}function th(t,...e){return Pl(eh(t),...e.map(eh))}function eh(t){var e;if(!t)return t;const i=function(t){return t&&(t=Object.keys(t).reduce(((e,i)=>{const s=t[i];return e[i]=function(t){return y(t)?{dataScheme:t}:t}(s),e}),{})),t}(t.colorScheme);return Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series)})}Ql._charts={},Ql._series={},Ql._components={},Ql._marks={},Ql._regions={},Ql._animations={},Ql._implements={},Ql._chartPlugin={},Ql._componentPlugin={},Ql.transforms={fields:O,filter:(t,e)=>{const{callback:i}=e;return i&&(t=t.filter(i)),t},fold:(t,e)=>{const{fields:i,key:s,value:n,retains:r}=e,a=[];for(let e=0;e{const l={};if(l[s]=o,l[n]=t[e][o],r)r.forEach((i=>{l[i]=t[e][i]}));else for(const s in t[e])-1===i.indexOf(s)&&(l[s]=t[e][s]);a.push(l)}));return a}},Ql.dataParser={csv:Zl,dsv:ql,tsv:Jl},Ql._layout={};const ih=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],sh={default:{dataScheme:ih,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)",emptyCircleColor:"#e3e5e8",linearProgressTrackColor:"#E7EBED"}}},nh=t=>{const e={label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}};return e[t?"transform3d":"transform"]={style:{fill:{type:"palette",key:"axisGridColor"}}},e},rh=nh(),ah=nh(!0),oh="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",lh={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:oh,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:oh,fill:"#ddd"}}},hh="__VCHART",dh=500,ch=500,uh=`${hh}_ARC_TRANSFORM_VALUE`,ph=`${hh}_ARC_RATIO`,gh=`${hh}_ARC_START_ANGLE`,mh=`${hh}_ARC_END_ANGLE`,_h=`${hh}_ARC_K`,fh=`${hh}_ARC_MIDDLE_ANGLE`,vh=`${hh}_ARC_QUADRANT`,yh=`${hh}_ARC_RADIAN`,bh=-Math.PI/2,xh=3*Math.PI/2,Sh=.6,Mh={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:rh,funnel3d:ah,linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:{type:"palette",key:"linearProgressTrackColor"},fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:lh,treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},kh={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},Ah=Object.assign(Object.assign({},kh),{label:{space:0}}),wh=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),Th={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:wh(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:wh(!0)},Lh=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),Ch={title:{visible:!0,autoLimit:!1,autoFit:!1,style:Lh("l1FontSize","primaryFontColor")},content:{visible:!0,style:Lh("l2FontSize","tertiaryFontColor")}},Eh={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},Dh=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},Eh),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},Oh={horizontal:Dh(!0),vertical:Dh(!1)},Ph=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},Eh),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},Rh={horizontal:Ph(!0),vertical:Ph(!1)},Bh={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Ih=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),Fh={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:Ih(!1),endSymbol:Ih(!0),label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Yh={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}},jh={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:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},Hh={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:sh,token:jh,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontWeight:null,fontSize:null}},fillingWord:{style:{fontWeight:null,fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:Mh,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:Oh,sizeLegend:Rh,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:kh,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:Ah,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:Fh,markArea:Bh,markPoint:Yh,polarMarkLine:Fh,polarMarkArea:Bh,polarMarkPoint:Yh,geoMarkPoint:Yh,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:Th,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:Ch,title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},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:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},zh=["animationThreshold","colorScheme","name","padding"];function Nh(t,e,i,s){if(!t)return t;e||(e=t.colorScheme),i||(i=t.token);const n={};return Object.keys(t).forEach((r=>{const a=t[r];zh.includes(r)?n[r]=a:w(a)?El(a)?n[r]=((t,e,i)=>{if(e&&El(t)){const s=Cl(e,t,i);if(s)return s}return t})(a,e,s):function(t){return t&&"token"===t.type&&!!t.key}(a)?n[r]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(i,a):n[r]=Nh(a,e,i,s):n[r]=a})),n}const Vh={[Hh.name]:Hh},Wh=Hh.name,Gh=new Map(Object.keys(Vh).map((t=>[t,Vh[t]]))),Uh=new Map(Object.keys(Vh).map((t=>[t,Nh(Vh[t])]))),$h=new Map(Object.keys(Vh).map((t=>[t,t===Wh]))),Xh=(t,e)=>{if(!t)return;const i=qh(e);Gh.set(t,i),Uh.set(t,Nh(i)),$h.set(t,!0)},Kh=(t=Wh,e=!1)=>($h.has(t)&&!$h.get(t)&&Xh(t,Gh.get(t)),e?Uh.get(t):Gh.get(t)),qh=t=>{var e;const i=null!==(e=t.type)&&void 0!==e?e:Wh;return th({},Kh(i),t)};class Zh{static registerInstance(t){Zh.instances.set(t.id,t)}static unregisterInstance(t){Zh.instances.delete(t.id)}static getInstance(t){return Zh.instances.get(t)}static instanceExist(t){return Zh.instances.has(t)}static forEach(t,e=[],i){const s=Na(e);return Zh.instances.forEach(((e,i,n)=>{s.includes(i)||t(e,i,n)}),i)}}Zh.instances=new Map;class Jh{static registerTheme(t,e){Xh(t,e)}static getTheme(t,e=!1){return Kh(t,e)}static removeTheme(t){return(t=>Gh.delete(t)&&Uh.delete(t)&&$h.delete(t))(t)}static themeExist(t){return(t=>!!S(t)&&Gh.has(t))(t)}static getDefaultTheme(){return Jh.themes.get(Wh)}static setCurrentTheme(t){Jh.themeExist(t)&&(Jh._currentThemeName=t,Zh.forEach((e=>null==e?void 0:e.setCurrentTheme(t))))}static getCurrentTheme(t=!1){return Jh.getTheme(Jh._currentThemeName,t)}static getCurrentThemeName(){return Jh._currentThemeName}}function Qh(t,e){return S(t)?Jh.themeExist(t)?Jh.getTheme(t,e):{}:As(t)?t:{}}var td,ed,id;Jh.themes=Gh,Jh._currentThemeName=Wh,function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(td||(td={})),(id=ed||(ed={})).Identity="identity",id.Linear="linear",id.Log="log",id.Pow="pow",id.Sqrt="sqrt",id.Symlog="symlog",id.Time="time",id.Quantile="quantile",id.Quantize="quantize",id.Threshold="threshold",id.Ordinal="ordinal",id.Point="point",id.Band="band";const sd={};function nd(t){switch(t){case ed.Linear:case ed.Log:case ed.Pow:case ed.Sqrt:case ed.Symlog:case ed.Time:return!0;default:return!1}}function rd(t){return!!sd[t]}function ad(t){switch(t){case ed.Ordinal:case ed.Point:case ed.Band:return!0;default:return!1}}Object.values(ed).forEach((t=>{sd[t]=!0}));const od=(t,e)=>{var i,s;return t===e||!D(t)&&!D(e)&&t.value===e.value&&(null===(i=t.axis)||void 0===i?void 0:i.id)===(null===(s=e.axis)||void 0===s?void 0:s.id)},ld=(t,e,i,s)=>{var n;const r=ad(e.getScale().type),a=[],o=e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes);for(const l of o)if(l.coordinate===i){const i=Na(s(l)),o=null===(n=l.getViewData())||void 0===n?void 0:n.latestData;if(i&&o)if(r){const e=[],s=[];o.forEach(((n,r)=>{var a;(null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())&&(e.push(n),s.push(r))})),a.push({series:l,datum:e,key:hd(l,s)})}else if(M(i[1])){const e=[],s=[];o.forEach(((n,r)=>{var a;((null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())||M(n[i[0]])&&M(n[i[1]])&&t>=n[i[0]]&&t{if(M(e[i[0]])){const a=e[i[0]]-t;a>=n[0]&&a<=n[1]&&(r.push(e),h.push(s))}}));else{let e=1/0,s=0;o.forEach(((n,a)=>{if(M(n[i[0]])){const o=Math.abs(n[i[0]]-t),l=Math.sign(n[i[0]]-t);o`${t.id}_${e.join("_")}`,dd=(t,e,i)=>{const s=t.getAllComponents().filter((s=>"axes"===s.specKey&&e(s)&&((t,e,i)=>{const s=t.getRegionsInIds(Na(e.layout.layoutBindRegionID));return null==s?void 0:s.some((t=>{const e=t.getLayoutRect(),s=t.getLayoutStartPoint();return((t,e,i)=>t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y)(i,{x:s.x,y:s.y},{x:e.width+s.x,y:e.height+s.y})}))})(t,s,i)));return s.length?s:null};function cd(t,e,i,s){let n,r,a=-1;t.forEach((t=>{n=e(t),r=i(t),!D(n)&&(n=+n)>=n&&!D(r)&&(r=+r)>=r&&s(n,r,++a)}))}function ud(t,e,i,s,n){let r=0,a=0;return cd(t,e,i,((t,e)=>{const i=e-n(t),o=e-s;r+=i*i,a+=o*o})),1-r/a}function pd(t,e){return te?1:t>=e?0:NaN}function gd(t){return Number(t)}const md=es;function _d(t,e){const i=[];return t.forEach((t=>{const s=+t[e];il(s)&&i.push(s)})),0===i.length?null:Ga(i)}function fd(t,e){const i=[];return t.forEach((t=>{const s=+t[e];il(s)&&i.push(s)})),0===i.length?null:Wa(i)}function vd(t,e){return t.reduce(((t,i)=>{const s=e?+i[e]:+i;return il(s)&&(t+=s),t}),0)}function yd(t,e){let i=0,s=0;return t.forEach((t=>{const n=e?+t[e]:+t;il(n)&&(i+=n,s++)})),i/s}function bd(t,e){const i=yd(t,e);return t.length<=1?0:t.reduce(((t,s)=>t+(e?+s[e]:+s-i)**2),0)/(t.length-1)}function xd(t,e){const i=Sd(t),s=Sd(e),n=Math.asin((t.x*e.y-e.x*t.y)/i/s),r=Math.acos((t.x*e.x+t.y*e.y)/i/s);return n<0?-r:r}function Sd(t,e={x:0,y:0}){return xe.distancePP(t,e)}function Md(t){return il(t.x)&&il(t.y)}const kd=(t,e)=>{if(!t)return null;const i=dd(t,(t=>"angle"===t.getOrient()),e),s=dd(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&ad(i.type)){const l=i.domain(),h=i.range(),d=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-d.x,y:o-t.getLayoutStartPoint().y-d.y};let u=xd({x:1,y:0},c);u=((t,e)=>{const i=2*Math.PI,s=Ga(e),n=Wa(e);return tn&&(t-=Math.ceil((t-n)/i)*i),t})(u,h);const p=Sd(c),g=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==g?void 0:g.range();if((u-(null==h?void 0:h[0]))*(u-(null==h?void 0:h[1]))>0||(p-(null==m?void 0:m[0]))*(p-(null==m?void 0:m[1]))>0)return;const _=t.invert(u);if(D(_))return;let f=l.findIndex((t=>(null==t?void 0:t.toString())===_.toString()));f<0&&(f=void 0);const v=ld(_,t,"polar",r);n.push({index:f,value:_,position:i.scale(_),axis:t,data:v})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&ad(s.type)){const h=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let c=xd({x:1,y:0},d);c<-Math.PI/2&&(c=2*Math.PI+c);const u=Sd(d),p=null===(e=i[0])||void 0===e?void 0:e.getScale(),g=null==p?void 0:p.range();if((c-(null==g?void 0:g[0]))*(c-(null==g?void 0:g[1]))>0||(u-(null==l?void 0:l[0]))*(u-(null==l?void 0:l[1]))>0)return;const m=s.invert(u);if(D(m))return;let _=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));_<0&&(_=void 0);const f=ld(m,t,"polar",r);n.push({index:_,value:m,position:s.scale(m),axis:t,data:f})}})),n.length?n:null};function Ad(t){return"bottom"===t||"top"===t}function wd(t){return"left"===t||"right"===t}function Td(t){return"z"===t}function Ld(t,e){return rl(t.orient)||e&&e.includes(t.orient)?t.orient:"left"}function Cd(t){return"top"===t||"bottom"===t?"horizontal":"vertical"}function Ed(t,e){var i;const s=null!==(i=t.type)&&void 0!==i?i:function(t,e){return e?Ad(t)?"linear":"band":Ad(t)?"band":"linear"}(t.orient,e);return{axisType:s,componentName:`${r.cartesianAxis}-${s}`}}const Dd=t=>t.fieldX[0],Od=t=>t.fieldY[0],Pd=t=>{var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},Rd=t=>{var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},Bd=(t,e)=>t?e?Dd:Pd:e?Od:Rd,Id=(t,e,i)=>{var s,n;if(!t)return null;const{x:r,y:a}=e,o=null!==(s=dd(t,(t=>Ad(t.getOrient())),e))&&void 0!==s?s:[],l=null!==(n=dd(t,(t=>wd(t.getOrient())),e))&&void 0!==n?n:[];if(!o.length&&!l.length)return null;const h=new Set,d=new Set,c=new Set;[o,l].forEach((t=>t.forEach((t=>{ad(t.getScale().type)?h.add(t):d.add(t),i&&t.getSpec().hasDimensionTooltip&&c.add(t)}))));const u=[],p=t=>{const e="x"===t,i=e?r:a;(e?o:l).forEach((t=>{if(c.size>0){if(c.has(t)){const s=Fd(t,i,Bd(e,ad(t.getScale().type)));s&&u.push(s)}}else{const s=h.size>0;if((s?h:d).has(t)){const n=Fd(t,i,Bd(e,s));n&&u.push(n)}}}))};return"horizontal"===t.getSpec().direction?(p("y"),0===u.length&&p("x")):(p("x"),0===u.length&&p("y")),u.length?u:null},Fd=(t,e,i)=>{const s=t.positionToData(e,!0);return D(s)?null:Yd(t,s,i)},Yd=(t,e,i)=>{const s=t.getScale();if(D(e))return null;let n=s.domain().findIndex((t=>(null==t?void 0:t.toString())===e.toString()));n<0&&(n=void 0);const r=ld(e,t,"cartesian",null!=i?i:Ad(t.getOrient())?Dd:Od);return{index:n,value:e,position:s.scale(e),axis:t,data:r}};class jd{constructor(t,e){this._eventDispatcher=t,this._mode=e}get chart(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}register(t,e){var i,s;(null!==(s=null===(i=this.chart)||void 0===i?void 0:i.getOption().onError)&&void 0!==s?s:bl)("Method not implemented.")}unregister(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:bl)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,s;const n=null!==(i=Id(this.chart,{x:t,y:e}))&&void 0!==i?i:[],r=null!==(s=kd(this.chart,{x:t,y:e}))&&void 0!==s?s:[],a=[].concat(n,r);return 0===a.length?null:a}dispatch(t,e){var i;const s=null===(i=this.chart)||void 0===i?void 0:i.getAllComponents().filter((t=>"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t)))),n=s.filter((t=>ad(t.getScale().type))),r=n.length?n:s.filter((t=>{const e=t.getOrient();return Ad(e)||"angle"===e})),a=[];return r.forEach((e=>{const i=Yd(e,t);i&&a.push(i)})),this._callback.call(null,{action:"enter",dimensionInfo:a}),a}}const Hd=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];var zd,Nd,Vd;!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(zd||(zd={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(Nd||(Nd={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(Vd||(Vd={}));const Wd={[td.dimensionHover]:class extends jd{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);null===s&&null!==this._cacheDimensionInfo?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=s):null===s||null!==this._cacheDimensionInfo&&s.length===this._cacheDimensionInfo.length&&!s.some(((t,e)=>!od(t,this._cacheDimensionInfo[e])))?null!==s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:s.slice()})):(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:s.slice()})),this._cacheDimensionInfo=s)},this.onMouseOut=t=>{t&&(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo?this._cacheDimensionInfo.slice():[]})),this._cacheDimensionInfo=null)}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:Nd.canvas}),callback:this.onMouseOut}),fl(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),fl(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}},[td.dimensionClick]:class extends jd{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"click",dimensionInfo:s.slice()}))}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:Nd.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}};class Gd{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){const s="function"==typeof e?{query:null,callback:e}:{query:e,callback:i};if(Wd[t]){const e=new Wd[t](this._eventDispatcher,this._mode);e.register(t,s),this._composedEventMap.set(i,{eventType:t,event:e})}else this._eventDispatcher.register(t,s);return this}off(t,e,i){var s,n;const r=null!=i?i:e;if(Wd[t])if(r)null===(s=this._composedEventMap.get(r))||void 0===s||s.event.unregister(),this._composedEventMap.delete(r);else for(const e of this._composedEventMap.entries())e[1].eventType===t&&(null===(n=this._composedEventMap.get(e[0]))||void 0===n||n.event.unregister(),this._composedEventMap.delete(e[0]));else if(r){const i={callback:r,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,i)}else this._eventDispatcher.unregister(t);return this}emit(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}prevent(t,e){return this._eventDispatcher.prevent(t,e),this}allow(t){return this._eventDispatcher.allow(t),this}release(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}class Ud{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(Vd.vchart,[]),this._levelNodes.set(Vd.chart,[]),this._levelNodes.set(Vd.model,[]),this._levelNodes.set(Vd.mark,[])}addHandler(t,e){var i;const s={level:e,handler:t};return null===(i=this._levelNodes.get(e))||void 0===i||i.push(s),this._map.set(t.callback,s),this}removeHandler(t){const e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);const i=this._levelNodes.get(e.level),s=null==i?void 0:i.findIndex((e=>e.handler.callback===t.callback));return void 0!==s&&s>=0&&(null==i||i.splice(s,1)),this}preventHandler(t){return t&&(t.prevented=!0),this}allowHandler(t){return t&&(t.prevented=!1),this}getHandlers(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((t=>t.handler)))||[]}getAllHandlers(){return Array.from(this._map.values()).map((t=>t.handler))||[]}getCount(){return this._map.size}release(){this._map.clear(),this._levelNodes.clear()}}const $d=(t,e,i)=>{const s=S(e)?e.split("."):e;for(let e=0;e=e||i<0||c&&t-h>=r}function f(){const t=Date.now();if(_(t))return v(t);o=m(f,function(t){const i=t-h,s=e-(t-l);return c?Math.min(s,r-i):s}(t))}function v(t){return o=void 0,u&&s?g(t):(s=n=void 0,a)}function y(...t){const i=Date.now(),r=_(i);if(s=t,n=this,l=i,r){if(void 0===o)return function(t){return h=t,o=m(f,e),d?g(t):a}(l);if(c)return o=m(f,e),g(l)}return void 0===o&&(o=m(f,e)),a}return e=+e||0,As(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(il(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,s=l=n=o=void 0},y.flush=function(){return void 0===o?a:v(Date.now())},y.pending=function(){return void 0!==o},y},qd=function(t,e,i){let s=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return As(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),Kd(t,e,{leading:s,trailing:n,maxWait:e})};var Zd,Jd,Qd,tc,ec,ic,sc,nc,rc,ac,oc,lc,hc,dc,cc,uc,pc,gc,mc;!function(t){t.enter="enter",t.update="update",t.exit="exit",t.group="group",t.connectNulls="connectNulls"}(Zd||(Zd={})),function(t){t.enter="enter",t.update="update",t.exit="exit",t.unChange="unChange"}(Jd||(Jd={})),(mc=Qd||(Qd={})).arc="arc",mc.arc3d="arc3d",mc.area="area",mc.image="image",mc.line="line",mc.path="path",mc.rect="rect",mc.rect3d="rect3d",mc.rule="rule",mc.shape="shape",mc.symbol="symbol",mc.text="text",mc.richtext="richtext",mc.polygon="polygon",mc.pyramid3d="pyramid3d",mc.circle="circle",mc.cell="cell",mc.interval="interval",mc.group="group",mc.glyph="glyph",mc.component="component",mc.largeRects="largeRects",mc.largeSymbols="largeSymbols",(gc=tc||(tc={})).axis="axis",gc.grid="grid",gc.legend="legend",gc.slider="slider",gc.label="label",gc.datazoom="datazoom",gc.player="player",gc.title="title",gc.scrollbar="scrollbar",function(t){t[t.player=1]="player",t[t.rollUp=2]="rollUp",t[t.drillDown=3]="drillDown",t[t.slider=4]="slider",t[t.datazoom=5]="datazoom",t[t.legend=6]="legend",t[t.scrollbar=7]="scrollbar",t[t.brush=8]="brush",t[t.normal=9]="normal"}(ec||(ec={})),(pc=ic||(ic={})).lineAxis="lineAxis",pc.circleAxis="circleAxis",(uc=sc||(sc={})).lineAxisGrid="lineAxisGrid",uc.circleAxisGrid="circleAxisGrid",function(t){t.discreteLegend="discreteLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend"}(nc||(nc={})),function(t){t.lineCrosshair="lineCrosshair",t.rectCrosshair="rectCrosshair",t.sectorCrosshair="sectorCrosshair",t.circleCrosshair="circleCrosshair",t.polygonCrosshair="polygonCrosshair",t.ringCrosshair="ringCrosshair"}(rc||(rc={})),function(t){t.symbolLabel="symbolLabel",t.rectLabel="rectLabel",t.lineLabel="lineLabel",t.dataLabel="dataLabel"}(ac||(ac={})),function(t){t.continuousPlayer="continuousPlayer",t.discretePlayer="discretePlayer"}(oc||(oc={})),function(t){t.before="before",t.layouting="layouting",t.reevaluate="reevaluate",t.after="after"}(lc||(lc={})),function(t){t.BEFORE_EVALUATE_DATA="beforeEvaluateData",t.AFTER_EVALUATE_DATA="afterEvaluateData",t.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",t.AFTER_EVALUATE_SCALE="afterEvaluateScale",t.BEFORE_PARSE_VIEW="beforeParseView",t.AFTER_PARSE_VIEW="afterParseView",t.BEFORE_TRANSFORM="beforeTransform",t.AFTER_TRANSFORM="afterTransform",t.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",t.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",t.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",t.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",t.BEFORE_STAGE_RESIZE="beforeStageResize",t.AFTER_STAGE_RESIZE="afterStageResize",t.BEFORE_VRENDER_DRAW="beforeVRenderDraw",t.AFTER_VRENDER_DRAW="afterVRenderDraw",t.BEFORE_MARK_JOIN="beforeMarkJoin",t.AFTER_MARK_JOIN="afterMarkJoin",t.BEFORE_MARK_UPDATE="beforeMarkUpdate",t.AFTER_MARK_UPDATE="afterMarkUpdate",t.BEFORE_MARK_STATE="beforeMarkState",t.AFTER_MARK_STATE="afterMarkState",t.BEFORE_MARK_ENCODE="beforeMarkEncode",t.AFTER_MARK_ENCODE="afterMarkEncode",t.BEFORE_DO_LAYOUT="beforeDoLayout",t.AFTER_DO_LAYOUT="afterDoLayout",t.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",t.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",t.BEFORE_DO_RENDER="beforeDoRender",t.AFTER_DO_RENDER="afterDoRender",t.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",t.AFTER_MARK_RENDER_END="afterMarkRenderEnd",t.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",t.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",t.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",t.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",t.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",t.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",t.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",t.BEFORE_ELEMENT_STATE="beforeElementState",t.AFTER_ELEMENT_STATE="afterElementState",t.BEFORE_ELEMENT_ENCODE="beforeElementEncode",t.AFTER_ELEMENT_ENCODE="afterElementEncode",t.ANIMATION_START="animationStart",t.ANIMATION_END="animationEnd",t.ELEMENT_ANIMATION_START="elementAnimationStart",t.ELEMENT_ANIMATION_END="elementAnimationEnd",t.ALL_ANIMATION_START="allAnimationStart",t.ALL_ANIMATION_END="allAnimationEnd"}(hc||(hc={})),function(t){t.signal="signal",t.data="data",t.scale="scale",t.coordinate="coordinate",t.mark="mark"}(dc||(dc={})),function(t){t.active="active",t.selected="selected",t.highlight="highlight",t.blur="blur"}(cc||(cc={}));class _c{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 S(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=Na(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class fc{static registerPlotMarks(t,e){fc._plotMarks[t]=e}static createPlotMark(t,e){return fc._plotMarks[t]?new(0,fc._plotMarks[t])(e):null}static registerMark(t,e){fc._marks[t]=e}static createMark(t,e,i){return fc._marks[t]?new(0,fc._marks[t])(e,t,i):null}static hasMark(t){return!!fc._marks[t]}static getMark(t){return fc._marks[t]}static registerComponent(t,e){fc._components[t]=e}static createComponent(t,e,i,s){const n=fc._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!fc._components[t]}static registerGraphicComponent(t,e){fc._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=fc._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){fc._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return fc._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(fc._transforms).forEach((t=>{fc._transforms[t]&&!fc._transforms[t].isBuiltIn&&(fc._transforms[t]=null)}))}static registerGrammar(t,e,i){fc._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=fc._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 fc._glyphs[t]}static createInteraction(t,e,i){const s=fc._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!fc._interactions[t]}}fc._plotMarks={},fc._marks={},fc._components={},fc._graphicComponents={},fc._transforms={},fc._grammars={},fc._glyphs={},fc._animations={},fc._interactions={},fc._graphics={},fc._stageEventPlugins={},fc.registerGlyph=(t,e,i,s,n)=>(fc._glyphs[t]=new _c(e,i,s,n),fc._glyphs[t]),fc.registerAnimationType=(t,e)=>{fc._animations[t]=e},fc.getAnimationType=t=>fc._animations[t],fc.registerInteraction=(t,e)=>{fc._interactions[t]=e},fc.registerGraphic=(t,e)=>{fc._graphics[t]=e},fc.getGraphicType=t=>fc._graphics[t],fc.createGraphic=(t,e)=>{const i=fc._graphics[t];return i?i(e):null},fc.registerDefaultLayout=t=>{fc.defaultLayout=t},fc.getDefaultLayout=()=>fc.defaultLayout,fc.registerStageEventPlugin=(t,e)=>{fc._stageEventPlugins[t]=e},fc.getStageEventPlugin=t=>fc._stageEventPlugins[t];const vc={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend"};class yc{constructor(t,e){this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=t=>{var e;const i=this.globalInstance.getChart(),s=M(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,n=M(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,r=new Map;let a=null===(e=t.item)||void 0===e?void 0:e.mark;for(a&&M(a.id())&&r.set(a.id(),t.item);null==a?void 0:a.elements;){const t=a.id();M(t)&&!r.has(t)&&r.set(t,a.elements[0]),a=a.group}const o={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:r,chart:i,model:s,mark:null!=n?n:void 0,node:$d(t.event,"target")};this.dispatch(t.type,o)},this._onDelegateInteractionEvent=t=>{const e=this.globalInstance.getChart(),i=t.event;let s=null;i.elements&&(s=i.elements);const n={event:t.event,chart:e,items:s,datums:s&&s.map((t=>t.getDatum()))};this.dispatch(t.type,n)},this.globalInstance=t,this._compiler=e}register(t,e){var i,s,n,r,a;this._parseQuery(e);const o=this.getEventBubble((null===(i=e.filter)||void 0===i?void 0:i.source)||Nd.chart),l=this.getEventListeners((null===(s=e.filter)||void 0===s?void 0:s.source)||Nd.chart);if(o.get(t)||o.set(t,new Ud),o.get(t).addHandler(e,null===(n=e.filter)||void 0===n?void 0:n.level),this._isValidEvent(t)&&!l.has(t)){const i=this._onDelegate.bind(this);this._compiler.addEventListener(null===(r=e.filter)||void 0===r?void 0:r.source,t,i),l.set(t,i)}else if(this._isInteractionEvent(t)&&!l.has(t)){const i=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,i),l.set(t,i)}return this}unregister(t,e){var i,s,n,r;let a=!1;const o=this.getEventBubble((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||Nd.chart),l=this.getEventListeners((null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.source)||Nd.chart);if(e){const i=o.get(t);null==i||i.removeHandler(e),0===(null==i?void 0:i.getCount())&&(null==i||i.release(),o.delete(t),a=!0),(null===(n=null==e?void 0:e.wrappedCallback)||void 0===n?void 0:n.cancel)&&e.wrappedCallback.cancel()}else{const e=o.get(t);null==e||e.release(),o.delete(t),a=!0}if(a&&this._isValidEvent(t)){const i=l.get(t);this._compiler.removeEventListener((null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.source)||Nd.chart,t,i),l.delete(t)}return this}dispatch(t,e,i){const s=this.getEventBubble(e.source||Nd.chart).get(t);if(!s)return this;let n=!1;if(i){const r=s.getHandlers(i);n=this._invoke(r,t,e)}else{const i=[Vd.mark,Vd.model,Vd.chart,Vd.vchart];let r=0;for(;!n&&r{const s=this.getEventBubble(i).get(t);s&&s.getAllHandlers().forEach((t=>{e&&t.callback===e||s.preventHandler(t)}))})),this}allow(t){return["canvas","chart","window"].forEach((e=>{const i=this.getEventBubble(e).get(t);i&&i.getAllHandlers().forEach((t=>i.allowHandler(t)))})),this}clear(){[Nd.chart,Nd.window,Nd.canvas].forEach((t=>{const e=this.getEventListeners(t);for(const i of e.entries())this._compiler.removeEventListener(t,i[0],i[1]);e.clear()})),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach((t=>{for(const e of t.values())e.release();t.clear()}))}release(){this.clear(),this.globalInstance=null,this._compiler=null}_filter(t,e,i){var s,n,r;if(ws(t.filter)&&!t.filter(i))return!1;if(t.nodeName&&$d(i,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.name)!==t.markName)return!1;let a=null===(n=i.model)||void 0===n?void 0:n.type;return vc[a]&&(a=vc[a]),!(t.type&&a!==t.type||"mark"===t.level&&!t.type&&!(null==i?void 0:i.mark)||"model"===t.level&&!t.type&&!(null==i?void 0:i.model)||M(t.userId)&&(null===(r=i.model)||void 0===r?void 0:r.userId)!==t.userId)}_prepareParams(t,e){if(t.markName&&e.mark&&e.itemMap){const t=e.mark.getProductId(),i=e.itemMap.get(t),s=null==i?void 0:i.getDatum();return Object.assign(Object.assign({},e),{item:i,datum:s})}return Object.assign({},e)}_invoke(t,e,i){return t.map((t=>{var s,n,r;const a=t.filter;if(!t.prevented&&(!t.query||this._filter(a,e,i))){const e=(t.wrappedCallback||t.callback).call(null,this._prepareParams(a,i)),o=null!=e?e:null===(s=t.query)||void 0===s?void 0:s.consume;return o&&(null===(n=i.event)||void 0===n||n.stopPropagation(),null===(r=i.event)||void 0===r||r.preventDefault()),!!o}})).some((t=>!0===t))}_getQueryLevel(t){return t?t.level?t.level:M(t.id)?Vd.model:Vd.vchart:Vd.vchart}_parseQuery(t){var e;const i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=qd(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=Kd(t.callback,i.debounce));let s=this._getQueryLevel(i),n=null,r=Nd.chart,a=null,o=null,l=null;return(null==i?void 0:i.nodeName)&&(a=i.nodeName),(null==i?void 0:i.markName)&&(o=i.markName),!(null==i?void 0:i.type)||s!==Vd.model&&s!==Vd.mark||(n=i.type),(null==i?void 0:i.source)&&(r=i.source),M(null==i?void 0:i.id)&&(l=null==i?void 0:i.id,s=Vd.model),t.filter={level:s,markName:o,type:n,source:r,nodeName:a,userId:l,filter:null!==(e=null==i?void 0:i.filter)&&void 0!==e?e:null},t}getEventBubble(t){switch(t){case Nd.chart:return this._viewBubbles;case Nd.window:return this._windowBubbles;case Nd.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case Nd.chart:return this._viewListeners;case Nd.window:return this._windowListeners;case Nd.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return Hd.includes(t)||Object.values(hc).includes(t)}_isInteractionEvent(t){let e;return t&&(e=t.split(":")[0],e)&&fc.hasInteraction(e)}}function bc(t){return t}function xc(t,e){t&&Mc.hasOwnProperty(t.type)&&Mc[t.type](t,e)}var Sc={Feature:function(t,e){xc(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,s=-1,n=i.length;++s0?1:t<0?-1:0},$c=Math.sqrt,Xc=Math.tan;function Kc(t){return t>1?0:t<-1?Oc:Math.acos(t)}function qc(t){return t>1?Pc:t<-1?-Pc:Math.asin(t)}function Zc(){}var Jc,Qc,tu,eu,iu=Tc(),su=Tc(),nu={point:Zc,lineStart:Zc,lineEnd:Zc,polygonStart:function(){nu.lineStart=ru,nu.lineEnd=lu},polygonEnd:function(){nu.lineStart=nu.lineEnd=nu.point=Zc,iu.add(Yc(su)),su.reset()},result:function(){var t=iu/2;return iu.reset(),t}};function ru(){nu.point=au}function au(t,e){nu.point=ou,Jc=tu=t,Qc=eu=e}function ou(t,e){su.add(eu*t-tu*e),tu=t,eu=e}function lu(){ou(Jc,Qc)}const hu=nu;var du=1/0,cu=du,uu=-du,pu=uu,gu={point:function(t,e){tuu&&(uu=t),epu&&(pu=e)},lineStart:Zc,lineEnd:Zc,polygonStart:Zc,polygonEnd:Zc,result:function(){var t=[[du,cu],[uu,pu]];return uu=pu=-(cu=du=1/0),t}};const mu=gu;var _u,fu,vu,yu,bu=0,xu=0,Su=0,Mu=0,ku=0,Au=0,wu=0,Tu=0,Lu=0,Cu={point:Eu,lineStart:Du,lineEnd:Ru,polygonStart:function(){Cu.lineStart=Bu,Cu.lineEnd=Iu},polygonEnd:function(){Cu.point=Eu,Cu.lineStart=Du,Cu.lineEnd=Ru},result:function(){var t=Lu?[wu/Lu,Tu/Lu]:Au?[Mu/Au,ku/Au]:Su?[bu/Su,xu/Su]:[NaN,NaN];return bu=xu=Su=Mu=ku=Au=wu=Tu=Lu=0,t}};function Eu(t,e){bu+=t,xu+=e,++Su}function Du(){Cu.point=Ou}function Ou(t,e){Cu.point=Pu,Eu(vu=t,yu=e)}function Pu(t,e){var i=t-vu,s=e-yu,n=$c(i*i+s*s);Mu+=n*(vu+t)/2,ku+=n*(yu+e)/2,Au+=n,Eu(vu=t,yu=e)}function Ru(){Cu.point=Eu}function Bu(){Cu.point=Fu}function Iu(){Yu(_u,fu)}function Fu(t,e){Cu.point=Yu,Eu(_u=vu=t,fu=yu=e)}function Yu(t,e){var i=t-vu,s=e-yu,n=$c(i*i+s*s);Mu+=n*(vu+t)/2,ku+=n*(yu+e)/2,Au+=n,wu+=(n=yu*t-vu*e)*(vu+t),Tu+=n*(yu+e),Lu+=3*n,Eu(vu=t,yu=e)}const ju=Cu;function Hu(t){this._context=t}Hu.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Bc)}},result:Zc};var zu,Nu,Vu,Wu,Gu,Uu=Tc(),$u={point:Zc,lineStart:function(){$u.point=Xu},lineEnd:function(){zu&&Ku(Nu,Vu),$u.point=Zc},polygonStart:function(){zu=!0},polygonEnd:function(){zu=null},result:function(){var t=+Uu;return Uu.reset(),t}};function Xu(t,e){$u.point=Ku,Nu=Wu=t,Vu=Gu=e}function Ku(t,e){Wu-=t,Gu-=e,Uu.add($c(Wu*Wu+Gu*Gu)),Wu=t,Gu=e}const qu=$u;function Zu(){this._string=[]}function Ju(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qu(t,e){var i,s,n=4.5;function r(t){return t&&("function"==typeof n&&s.pointRadius(+n.apply(this,arguments)),wc(t,i(s))),s.result()}return r.area=function(t){return wc(t,i(hu)),hu.result()},r.measure=function(t){return wc(t,i(qu)),qu.result()},r.bounds=function(t){return wc(t,i(mu)),mu.result()},r.centroid=function(t){return wc(t,i(ju)),ju.result()},r.projection=function(e){return arguments.length?(i=null==e?(t=null,bc):(t=e).stream,r):t},r.context=function(t){return arguments.length?(s=null==t?(e=null,new Zu):new Hu(e=t),"function"!=typeof n&&s.pointRadius(n),r):e},r.pointRadius=function(t){return arguments.length?(n="function"==typeof t?t:(s.pointRadius(+t),+t),r):n},r.projection(t).context(e)}function tp(t){var e={type:"Feature"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}})),e.properties=ep(t.properties),e.geometry=ip(t.geometry),e}function ep(t){var e={};return t?(Object.keys(t).forEach((function(i){var s=t[i];"object"==typeof s?null===s?e[i]=null:Array.isArray(s)?e[i]=s.map((function(t){return t})):e[i]=ep(s):e[i]=s})),e):e}function ip(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return ip(t)})),e):(e.coordinates=sp(t.coordinates),e)}function sp(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return sp(t)}))}Zu.prototype={_radius:4.5,_circle:Ju(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Ju(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var np=6371008.8,rp={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*np,kilometers:6371.0088,kilometres:6371.0088,meters:np,metres:np,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:np/1852,radians:1,yards:6967335.223679999};function ap(t,e,i){void 0===i&&(i={});var s={type:"Feature"};return(0===i.id||i.id)&&(s.id=i.id),i.bbox&&(s.bbox=i.bbox),s.properties=e||{},s.geometry=t,s}function op(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function lp(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function hp(t){for(var e,i,s=lp(t),n=0,r=1;r0}function dp(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i is required");if("boolean"!=typeof s)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return tp(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}})),e.features=t.features.map((function(t){return tp(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ip(t);default:throw new Error("unknown GeoJSON type")}}(t));var r=[];switch(t.type){case"GeometryCollection":return cp(t,(function(t){up(t,s)})),t;case"FeatureCollection":return dp(t,(function(t){dp(up(t,s),(function(t){r.push(t)}))})),op(r)}return up(t,s)},_p=function(t){if(!t)throw new Error("geojson is required");var e=[];return function(t,e){cp(t,(function(t,i,s,n,r){var a,o=null===t?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==e(ap(t,s,{bbox:n,id:r}),i,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l{if(t.geometry.type.startsWith("Multi")){const e=_p(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},bp=(t,e={},i)=>{i.type=zl.GEO;const s=Ul(vp,e),{centroid:n,name:r,bbox:a,rewind:o}=s;if(Array.isArray(t))return(t=>{const e=[];return t.forEach((t=>{"FeatureCollection"===t.type?t.features.forEach((t=>{e.push(yp(t))})):e.push(yp(t))})),e})(t);let l=t.features;return o&&(l=mp(t,{reverse:!As(o)||o.reverse}).features),l.forEach((t=>{if(n){const e=fp.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){const e=fp.bounds(t);t.bbox=e}})),t.features=l,t};function xp(t){return t}function Sp(t,e){var i=e.id,s=e.bbox,n=null==e.properties?{}:e.properties,r=function(t,e){var i=function(t){if(null==t)return xp;var e,i,s=t.scale[0],n=t.scale[1],r=t.translate[0],a=t.translate[1];return function(t,o){o||(e=i=0);var l=2,h=t.length,d=new Array(h);for(d[0]=(e+=t[0])*s+r,d[1]=(i+=t[1])*n+a;l{i.type=zl.GEO;const s=Ul(vp,Mp,e),{object:n}=s;if(!S(n))throw new TypeError("Invalid object: must be a string!");const r=(a=t,"string"==typeof(o=t.objects[n])&&(o=a.objects[o]),"GeometryCollection"===o.type?{type:"FeatureCollection",features:o.geometries.map((function(t){return Sp(a,t)}))}:Sp(a,o));var a,o;return bp(r,s,i)};var Ap=i(4028),wp=i.n(Ap);const Tp={tolerance:.01},Lp=(t,e)=>{const i=Ul(Tp,e),{tolerance:s}=i;return wp()(t,s)};function Cp(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function Ep(t,e,i){t.getParser(e)||t.registerParser(e,i)}const Dp=new Map;let Op;function Pp(){Op||(Op=new f,Ep(Op,"geojson",bp),Ep(Op,"topojson",kp),Cp(Op,"simplify",Lp))}function Rp(t,e,i={type:"geojson",centroid:!0}){Dp.has(t)&&yl(`map type of '${t}' already exists, will be overwritten.`),Pp();const s=new R(Op),n=E({},{centroid:!0,simplify:!1},i);"topojson"===i.type?s.parse(e,{type:"topojson",options:n}):s.parse(e,{type:"geojson",options:n});const{simplify:r}=i;!0===r?s.transform({type:"simplify"}):As(r)&&s.transform({type:"simplify",options:r}),Dp.set(t,s)}function Bp(t){Dp.has(t)?Dp.delete(t):yl(`map type of '${t}' does not exists.`)}function Ip(t,e=!1){let i=e;return t.latestData instanceof R&&(i=!1),i?k(t.latestData):t.latestData&&t.latestData.slice()}const Fp=(t,e)=>0===t.length?[]:1===t.length?Ip(t[0],null==e?void 0:e.deep):t.map((t=>Ip(t,null==e?void 0:e.deep)));function Yp(t,e,i){Cp(e=e instanceof f?e:t.dataSet,"copyDataView",Fp);const s=new R(e,i);return s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView",level:zp.copyDataView}),s}function jp(t,e,i=[]){var s;if(t instanceof R)return t;const{id:n,values:r=[],fromDataIndex:a,fromDataId:o,transforms:l=[]}=t,h=t.parser?k(t.parser):{clone:!0},d=k(t.fields);let c;h.clone=!(!1===h.clone);const u=i.find((t=>t.name===n));if(u)c=u;else{const t={name:n};if(d&&(t.fields=d),c=new R(e,t),"string"==typeof o){const t=i.find((t=>t.name===o));if(!t)return yl(`no data matches fromDataId ${o}`),null;c.parse([t],{type:"dataview"}),c.transform({type:"copyDataView"})}else if("number"==typeof a){const t=i[a];if(!t)return yl(`no data matches fromDataIndex ${a}`),null;c.parse([t],{type:"dataview"}),c.transform({type:"copyDataView"})}else Array.isArray(r)?c.parse(r,h):!S(r)||h&&!["csv","dsv","tsv"].includes(h.type)?(c.parse([]),yl("values should be array")):c.parse(r,null!==(s=h)&&void 0!==s?s:{type:"csv"});l&&l.length&&l.forEach((t=>{e.getTransform(t.type)&&c.transform(t)}))}return c}function Hp(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}var zp,Np;function Vp(t,e){return Na(t).reduce(((t,i)=>{const s=S(i)?e.getGrammarById(i):i;return s&&t.push(s),t}),[])}function Wp(t,e){if(D(t))return[];if(!ws(i=t)&&(null==i?void 0:i.signal)){const i=t.signal;if(S(i))return Na(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}else if(function(t){return!ws(t)&&!!(null==t?void 0:t.callback)}(t))return Vp(t.dependency,e);var i;return[]}function Gp(t){return ws(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function Up(t,e,i,s){if(D(t))return t;if(ws(t))return s?t.call(null,i,s,e):t.call(null,i,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?s?t.callback.call(null,i,s,e):t.callback.call(null,i,e):t}function $p(t,e){return Xp(t)?t.output():e[t]}!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(zp||(zp={})),function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(Np||(Np={}));const Xp=t=>t&&!D(t.grammarType),Kp=t=>ws(t)?t:e=>e[t],qp=(t,e)=>Xp(t)?t.output():t&&As(t)?ws(t.callback)?i=>t.callback(i,e):ws(t.value)?t.value(e):t:t,Zp=(t,e)=>t?As(t)?Object.keys(t).reduce(((i,s)=>{const n=t[s];return i[s]=qp(n,e),i}),{}):t.map((t=>qp(t,e))):t;let Jp=-1;class Qp extends(o()){constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++Jp}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){const t=Na(this.spec.dependency).map((t=>S(t)?this.view.getGrammarById(t):t));this.detach(t)}this.spec.dependency=t;const i=Na(t).map((t=>S(t)?this.view.getGrammarById(t):t));return this.attach(i),this.commit(),this}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,s;return null===(s=null===(i=this.view)||void 0===i?void 0:i.emit)||void 0===s||s.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){if(!t||!t.length)return e;let s=e,n=0;const r=t.length;for(;n!D(t))).forEach((i=>{var s;D(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,(null!==(s=this.references.get(i))&&void 0!==s?s:0)+e))})),this}detach(t,e=1){return Na(t).filter((t=>!D(t))).forEach((t=>{const i=this.references.get(t)-e;i>0?this.references.set(t,i-1):(this.references.delete(t),t.targets.includes(this)&&(t.targets=t.targets.filter((t=>t!==this))))})),this}detachAll(){this.references.forEach(((t,e)=>{this.detach(e,t)}))}link(t){this.grammarSource=t}run(){var t;const e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return D(this.spec[e])||this.detach(Wp(this.spec[e],this.view)),this.spec[e]=t,this.attach(Wp(t,this.view)),this.commit(),this}}const tg=(t,e,i)=>{var s,n;if("callback"===t&&ws(e))return{references:[],value:{callback:e,dependency:[]}};if(!D(e.data)){const t=i.getDataById(e.data);return{references:[t],value:t}}if(!D(e.customized)){const t=i.getCustomizedById(e.customized);return{references:[t],value:t}}if(!D(e.scale)){const t=i.getScaleById(e.scale);return{references:[t],value:t}}if((n=e)&&(n.signal||n.callback)){const t=Wp(e,i);return{references:t,value:e.callback?{value:e.callback,dependency:t}:null!==(s=null==t?void 0:t[0])&&void 0!==s?s:e}}return{value:e}},eg=(t,e)=>{if(null==t?void 0:t.length){const i=[];let s=[];return t.forEach((t=>{var n;const r=((t,e)=>{const i=fc.getTransform(t.type);if(!i)return;const s={};let n=[];return Object.keys(t).forEach((i=>{var r;if("type"===i)return;const a=t[i];if("dependency"===i)return void((null==a?void 0:a.length)&&(n=n.concat(Vp(a,e))));const o=((t,e,i)=>{if(D(e))return{value:e};if(y(e)){const s=e.map((e=>tg(t,e,i)));return{references:s.reduce(((t,e)=>(e.references&&t.concat(e.references),t)),[]),value:s.map((t=>t.value))}}return tg(t,e,i)})(i,a,e);o&&((null===(r=o.references)||void 0===r?void 0:r.length)&&(n=n.concat(o.references)),s[i]=o.value)})),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:s,references:n}})(t,e);r&&((null===(n=r.references)||void 0===n?void 0:n.length)&&(s=s.concat(r.references)),i.push(r))})),{transforms:i,refs:s}}return null},ig={csv:Zl,dsv:ql,tsv:Jl,json:(t,e={},i)=>{if(!S(t))return Na(t);try{return Na(JSON.parse(t))}catch(t){return[]}}};class sg extends Qp{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=t=>{const e=function(t,e){if(D(t))return t;if(ws(t))return t.call(null,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,this.parameters());return this._input=((t,e)=>{if(!e||!ig[e.type])return Na(t);const i="dsv"===e.type?{delimiter:e.delimiter}:{};return ig[e.type](t,i,new R(new f))})(t.values,e),this._input},this.load=t=>{if(t.values)return this.ingest(t)},this.relay=t=>t[0],this._loadTasks=[],D(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){const e=[],i=[],s=t.format?Wp(t.format,this.view)[0]:null;if(s&&e.push(s),t.values){const s=Wp(t.values,this.view)[0];s&&e.push(s),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){const n=Wp(t.url,this.view)[0];n&&e.push(n),i.push({type:"load",transform:this.load,options:{url:null!=n?n:t.url,format:null!=s?s:t.format}})}else if(t.source){const s=[];Na(t.source).forEach((t=>{const i=Xp(t)?t:this.view.getDataById(t);i&&(e.push(i),s.push(i))})),s.length&&(i.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:i,refs:e}}evaluate(t,e){this.view.emit(hc.BEFORE_EVALUATE_DATA);const i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);const s=this.evaluateTransform(i,this._input,e),n=this._evaluateFilter(s,e);return this.setValues(n),this._isLoaded=!0,this.view.emit(hc.AFTER_EVALUATE_DATA),this}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){const s=Object.assign({},this.spec,{values:t,format:e});return D(t)||(s.url=void 0,s.source=void 0),i?this.parseLoad(s):this}url(t,e,i=!0){const s=Object.assign({},this.spec,{url:t,format:e});return D(t)||(s.values=void 0,s.source=void 0),i?this.parseLoad(s):this}source(t,e,i=!0){const s=Object.assign({},this.spec,{source:t,format:e});return D(t)||(s.values=void 0,s.url=void 0),i?this.parseLoad(s):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;const e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=Na(t).map(((t,e)=>{const i=t===Object(t)?t:{data:t};return i[this._dataIDKey]=e,i}))}field(t){return this._values.map((e=>e[t]))}transform(t){const e=eg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;const i=eg(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(Na(t)),this._postFilters.sort(((t,e)=>{var i,s;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(s=e.rank)&&void 0!==s?s:0)})),this}removeDataFilter(t){const e=Na(t);return this._postFilters=this._postFilters.filter((t=>!e.includes(t))),this}_evaluateFilter(t,e){return this._postFilters.reduce(((t,i)=>i.filter(t,e)),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}function ng(t,e,i,s){let n,r;const a=t[e];for(;e>i&&(r=Math.floor((e-1)/2),n=t[r],a&&n&&s(a,n)<0);)t[e]=n,e=r;return t[e]=a}function rg(t,e,i,s){const n=e,r=null!=i?i:t.length,a=t[e];let o,l=2*e+1;for(;l=0&&(l=o),t[e]=t[l],l=2*(e=l)+1;return t[e]=a,ng(t,e,n,s)}class ag{constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){const e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);return ng(this.nodes,e,0,this.compare),rg(this.nodes,e,null,this.compare)}return this.nodes.push(t),ng(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),ng(this.nodes,e,0,this.compare),rg(this.nodes,e,null,this.compare)}}pop(){const t=this.nodes.pop();let e;return this.nodes.length?(e=this.nodes[0],this.nodes[0]=t,rg(this.nodes,0,null,this.compare)):e=t,e}clear(){this.nodes=[]}}const og=t=>t,lg=t=>0;class hg{constructor(t){this.list=[],this.ids={},this.idFunc=t||og}add(t){const e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){const e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((e=>e!==t))),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}class dg{constructor(){this.grammars=[],this.logger=g.getInstance(),this._curRank=0,this._committed=new hg((t=>t.uid)),this._heap=new ag(((t,e)=>(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank))),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((e=>e!==t)))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){const e=[t];for(;e.length;){const i=e.pop();this._setRankOfGrammar(i);const s=i.targets;s&&s.forEach((i=>{e.push(i),i===t&&this.logger.error("Cycle detected in dataflow graph.")}))}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){const e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce(((t,e,i)=>D(e.value)?t:`${t}${i?" , ":""}${e.key}: ${e.value}`),"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach((t=>{t.targets.some((e=>(null==e?void 0:e.rank)<(null==t?void 0:t.rank)))&&this._reRank(t)})),this._committed.forEach((t=>this._enqueue(t))),this._committed=new hg((t=>t.uid))}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((t=>this._enqueue(t)))}evaluate(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)t=this._heap.pop(),t&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}const cg=(t,e,i,s,n)=>{const r=t=>{if(n||!t||s&&!s(t)||i.call(null,t),t.markType===Qd.group){const i=t[e];i&&i.forEach((t=>{r(t)}))}n&&(!t||s&&!s(t)||i.call(null,t))};r(t)},ug=t=>void 0===t;class pg extends Ls{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g){throw new Error("Method not implemented.")}}class gg extends pg{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const s=new gg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}class mg extends pg{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const s=new mg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}mg.DOM_DELTA_PIXEL=0,mg.DOM_DELTA_LINE=1,mg.DOM_DELTA_PAGE=2;const _g="object"==typeof performance&&performance.now?performance:Date;function fg(t){return"mouse"===t||"pen"===t}class vg{constructor(t,e){this.dispatch=new(o()),this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(fg(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,s;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=fg(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let s=null==o?void 0:o.parent;for(;s&&s!==this.rootTarget.parent&&s!==n.target;)s=s.parent;if(!s||s===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let s=o;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(s=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),a=fg(r.pointerType);this.dispatchEvent(r,"pointerover"),a&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(s=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=fg(t.pointerType),s=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",s||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=_g.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(fg(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(fg(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});const a=r.clicksByButton[t.button];a.target===e.target&&s-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=s,e.detail=a.clickCount,fg(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):fg(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof mg))return void g.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,s,n,r,a,o;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(s=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===s?void 0:s.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(o=null==h?void 0:h.stage.renderCount)&&void 0!==o?o:-1})),l)for(let e=0,i=l.length;e=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=_g.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let s=0,n=i.length;s{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:n,autoPreventDefault:r=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new vg(s,{clickInterval:a}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new gg,this.rootWheelEvent=new mg,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:s}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?s.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(s.style,n):i&&S(t)&&!Ss(this.cursorStyles,t)&&(s.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const s=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class xg{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,Si.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),Si.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),Si.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));Si.graphicService.hooks.onAttributeUpdate.taps=e(Si.graphicService.hooks.onAttributeUpdate.taps),Si.graphicService.hooks.onSetStage.taps=e(Si.graphicService.hooks.onSetStage.taps),Si.graphicService.hooks.onRemove.taps=e(Si.graphicService.hooks.onRemove.taps)}}class Sg{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,Si.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,s)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),Si.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){Si.graphicService.hooks.onAddIncremental.taps=Si.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onClearIncremental.taps=Si.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Si.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const s=e.layer.subLayers.get(e._uid);s&&s.drawContribution&&s.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:s.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const Mg=new qt;class kg{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),Si.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,s)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Mg.setValue(s.x1,s.y1,s.x2,s.y2),e.dirty(Mg,t.parent&&t.parent.globalTransMatrix)))})),Si.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,s,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(s.globalAABBBounds))})),Si.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){Si.graphicService.hooks.beforeUpdateAABBBounds.taps=Si.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.afterUpdateAABBBounds.taps=Si.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onRemove.taps=Si.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}var Ag;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Ag||(Ag={}));class wg{static Avaliable(){return!!Si.global.getRequestAnimationFrame()}avaliable(){return wg.Avaliable()}tick(t,e){Si.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Tg{static Avaliable(){return!0}avaliable(){return Tg.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}const Lg=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Ag.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Ag.INITIAL,Si.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),Si.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:wg},{mode:"timeout",cons:Tg}];for(let e=0;e{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Ag.INITIAL&&(this.status=Ag.PAUSE,!0)}resume(){return this.status!==Ag.INITIAL&&(this.status=Ag.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Ag.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ag.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Ag.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Ag.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};Lg.addTimeline(Ps),Lg.setFPS(60);class Cg{static registerPlugin(t,e){Cg._pluginClasses[t]=e}static getPlugin(t){return Cg._pluginClasses[t]}}Cg._pluginClasses={};const Eg="white";class Dg extends ar{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:Eg}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new vs,this.hooks={beforeRender:new Q(["stage"]),afterRender:new Q(["stage"])},this.global=Si.global,!this.global.env&&pl()&&this.global.setEnv("browser"),this.window=Xi.get(ns),this.renderService=Xi.get(Fr),this.pluginService=Xi.get(ga),this.layerService=Xi.get(cr),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:Eg,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Lg,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Os,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&S(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(t=-1){this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new bg(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:s=0,beta:n=0,camera:r,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:s,beta:n,camera:r,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,s,n,r,a;this.option3d=t;const o=this.get3dOptions(t),{light:l,center:h,camera:d,alpha:c,beta:u,fieldRatio:p,fieldDepth:g}=o,{dir:m=[1,1,-1],color:_="white",ambient:f}=l,v=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),y=(null!==(s=h.y)&&void 0!==s?s:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),b=[v,y,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(a=h.dz)&&void 0!==a?a:0)];let x=0,S=0,M=0;d||(x=Math.sin(c)+v,S=Math.sin(u)+y,M=Math.cos(c)*Math.cos(u)*1);const k=Cg.getPlugin("DirectionalLight");k&&(this.light=new k(m,_,f));const A={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:g,viewParams:{pos:[x,S,M],center:b,up:[0,1,0]}};if(this.camera)this.camera.params=A;else{const t=Cg.getPlugin("OrthoCamera");t&&(this.camera=new t(A))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=Cg.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new xg))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Sg))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Kt;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new kg,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=Cg.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=Cg.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=Cg.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e,i=!0){"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,s,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+s),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new be(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(t=!0,e){if("released"===this.releaseStatus)return;const i=Xi.get(ns),s=e?-e.x1:0,n=e?-e.y1:0,r=e?e.x2:this.viewWidth,a=e?e.y2:this.viewHeight,o=e?e.width():this.viewWidth,l=e?e.height():this.viewHeight;return i.create({viewBox:{x1:s,y1:n,x2:r,y2:a},width:o,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=Xi.get(Nr)),this.pickerService}}class Og{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(hc.AFTER_VRENDER_DRAW),this._view.emit(hc.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,s){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=s,this.initStage(),this}stage(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}gestureController(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&function(t){return e=this,i=void 0,n=function*(){const e=[],i=t.getChildren();yield new Promise((t=>{Si.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)},new((s=void 0)||(s=Promise))((function(t,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(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(a,o)}l((n=n.apply(e,i||[])).next())}));var e,i,s,n}(this._stage).then((()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()})),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,s;return null===(s=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===s||s.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(hc.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(hc.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}render(t=!1){return this._view.emit(hc.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(hc.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree((t=>{t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,s,n;this._view.emit(hc.BEFORE_CREATE_VRENDER_STAGE);const r=this._viewOptions,a=null!==(t=r.stage)&&void 0!==t?t:(o={width:this._width,height:this._height,renderStyle:r.renderStyle,viewBox:r.viewBox,dpr:r.dpr,canvas:r.renderCanvas,canvasControled:r.canvasControled,container:r.container,title:r.rendererTitle,beforeRender:r.beforeRender,afterRender:r.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:r.pluginList,enableHtmlAttribute:r.enableHtmlAttribute,optimize:r.optimize,ticker:r.ticker,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,ReactDOM:r.ReactDOM},new Dg(o));var o;(null===(e=r.options3d)||void 0===e?void 0:e.enable)&&a.set3dOptions(r.options3d),a.enableIncrementalAutoRender(),this._viewBox=r.viewBox,this._view.emit(hc.AFTER_CREATE_VRENDER_STAGE),this._view.emit(hc.BEFORE_CREATE_VRENDER_LAYER);const l=null!==(i=r.layer)&&void 0!==i?i:a.defaultLayer;if(this._view.emit(hc.AFTER_CREATE_VRENDER_LAYER),(null===(s=this._eventConfig)||void 0===s?void 0:s.drag)&&fc.getStageEventPlugin("drag")&&(this._dragController=new(fc.getStageEventPlugin("drag"))(a)),(null===(n=this._eventConfig)||void 0===n?void 0:n.gesture)&&fc.getStageEventPlugin("gesture")){const t=As(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new(fc.getStageEventPlugin("gesture"))(a,t)}return{stage:a,layer:l}}initStage(){if(!this._stage){const{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;const i=this._view.background();this.background(i)}}}function Pg(t){return D(t.offsetX)?D(t.x)?t.changedTouches&&t.changedTouches.length?function(t){const e=t.changedTouches[0];return{canvasX:e.x,canvasY:e.y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function Rg(t,e,i=!0){const s=["canvasX","canvasY"];return i&&(s.push("clientX"),s.push("clientY")),s.forEach((i=>{il(e[i])&&Object.defineProperty(t,i,{value:e[i],writable:!0})})),[e.canvasX,e.canvasY]}const Bg="window",Ig="view",Fg="width",Yg="height",jg="viewWidth",Hg="viewHeight",zg="padding",Ng="viewBox",Vg="autoFit",Wg="__vgrammar_scene_item__",Gg=[Qd.line,Qd.area],Ug=[Qd.arc3d,Qd.rect3d,Qd.pyramid3d],$g="key",Xg=[{}],Kg=["key"],qg=!0,Zg=!0,Jg=!1,Qg=!0,tm="VGRAMMAR_IMMEDIATE_ANIMATION",em=0,im=1e3,sm=0,nm=0,rm=!1,am=!1,om="quintInOut",lm={stopWhenStateChange:!1,immediatelyApply:!0},hm="VGRAMMAR_ANIMATION_PARAMETERS",dm="_mo_hide_";function cm(t,e,i,s){var n,r;s===Bg&&function(t){["touches","changedTouches","targetTouches"].forEach((e=>{t[e]&&t[e].length&&Array.from(t[e]).forEach((t=>{Rg(t,Pg(t),!1)}))}));const e=Pg(t);Rg(t,e)}(e.changedTouches?e.changedTouches[0]:e);let a=null===(n=e.target)||void 0===n?void 0:n[Wg];if(!a&&s===Ig){let i=e.target;const s=null===(r=t.rootMark)||void 0===r?void 0:r.graphicItem;for(;(null==i?void 0:i.parent)&&i.parent!==s;)if(i=i.parent,i[Wg]){a=i[Wg];break}}return e.element=a,e}class um extends Qp{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?Up(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if(y(t)&&y(this.value)&&t.length===this.value.length){for(let e=0;e{var e,i,s,n;return h(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(s=null==t?void 0:t.left)&&void 0!==s?s:0,right:null!==(n=null==t?void 0:t.right)&&void 0!==n?n:0}};function _m(t,e){switch(e){case"line":return t.some((t=>["x","y","defined"].includes(t)));case"area":return t.some((t=>["x","y","x1","y1","defined"].includes(t)));case"largeRects":return t.some((t=>["x","y","width","y1"].includes(t)));case"largeSymbols":return t.some((t=>["x","y"].includes(t)))}return!1}const fm=["fillOpacity"],vm=(t,e,i)=>{var s;return"fillOpacity"===e?(t.fillOpacity=null!==(s=i.fillOpacity)&&void 0!==s?s:1,["fillOpacity"]):[]},ym={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;il(e.width)||!il(e.x1)&&il(i.width)?(t.x=Math.min(null!==(s=i.x)&&void 0!==s?s:0,null!==(n=i.x1)&&void 0!==n?n:1/0),t.width=i.width):il(e.x1)||!il(e.width)&&il(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(r=i.x)&&void 0!==r?r:0,null!==(a=i.x1)&&void 0!==a?a:1/0),t.width=i.width),il(e.height)||!il(e.y1)&&il(i.height)?(t.y=Math.min(null!==(o=i.y)&&void 0!==o?o:0,null!==(l=i.y1)&&void 0!==l?l:1/0),t.height=i.height):il(e.y1)||!il(e.height)&&il(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(h=i.y)&&void 0!==h?h:0,null!==(d=i.y1)&&void 0!==d?d:1/0),t.height=i.height),il(e.length)||!il(e.z1)&&il(i.length)?(t.z=Math.min(null!==(c=i.z)&&void 0!==c?c:0,null!==(u=i.z1)&&void 0!==u?u:1/0),t.length=i.length):il(e.z1)||!il(e.length)&&il(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(p=i.z)&&void 0!==p?p:0,null!==(g=i.z1)&&void 0!==g?g:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}],[Qd.text]:[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:(t,e,i)=>{var s,n;const r=null!==(s=i.limit)&&void 0!==s?s:1/0,a=null!==(n=i.autoLimit)&&void 0!==n?n:1/0,o=Math.min(r,a),l=w(i.text)&&!D(i.text.text),h=l?i.text.text:i.text;Array.isArray(h),t.maxLineWidth=o===1/0?i.maxLineWidth:o,!l&&!i.textType||"rich"!==i.text.type&&"rich"!==i.textType?t.text=h:t.textConfig=h},storedAttrs:"limitAttrs"}],[Qd.rule]:[{channels:["x","y","x1","y1"],transform:(t,e,i)=>{const s=function(t){const{x:e,y:i,x1:s,y1:n}=t;return il(e)&&il(i)&&il(s)&&il(n)?[{x:e,y:i},{x:s,y:n}]:[]}(i);t.points=s,t.x=0,t.y=0},storedAttrs:"pointAttrs"}],[Qd.symbol]:[{channels:["shape","symbolType"],transform:(t,e,i)=>{var s;t.symbolType=null!==(s=e.shape)&&void 0!==s?s:e.symbolType}},{channels:["image","fill","background"],transform:(t,e,i)=>{e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]},bm=(t,e,i,s)=>{const n={},r=e?Object.keys(e):[],a=S(t)?ym[t]:t;if(a&&a.length){const t=[];r.forEach((r=>{let o=!1;a.forEach(((a,l)=>{if(a.channels.includes(r)){if(!t[l])if(a.storedAttrs){const t=function(t,e,i,s,n,r){const a=n.getGraphicAttribute(t,!1,r);if(a)return e.forEach((t=>{t in s&&(a[t]=s[t])})),a;const o={};return e.forEach((t=>{o[t]=s[t]})),i[t]=o,o}(a.storedAttrs,a.channels,n,e,i,s);a.transform(n,e,t)}else a.transform(n,e,null);t[l]=!0,o=!0}})),o||(fm.includes(r)?vm(n,r,e):n[r]=e[r])}))}else r.forEach((t=>{fm.includes(t)?vm(n,t,e):n[t]=e[t]}));return n};function xm(t,e,i={}){var s;const n=fc.getGraphicType(e)?fc.createGraphic(e,i):fc.createGraphicComponent(e,i,{skipDefault:null===(s=null==t?void 0:t.spec)||void 0===s?void 0:s.skipTheme});return n||g.getInstance().error(`create ${e} graphic failed!`),n}const Sm=t=>{t&&(t[Wg]=null,t.release(),t.parent&&t.parent.removeChild(t))};function Mm(t,e,i){const s=new Map;if(!t||0===t.length)return{keys:[],data:s};if(!e)return s.set($g,i?t.slice().sort(i):t.slice()),{keys:Kg,data:s};const n=Kp(e);if(1===t.length){const e=n(t[0]);return s.set(e,[t[0]]),{keys:[e],data:s}}const r=new Set;return t.forEach((t=>{var e;const i=n(t),a=null!==(e=s.get(i))&&void 0!==e?e:[];a.push(t),s.set(i,a),r.add(i)})),i&&r.forEach((t=>{s.get(t).sort(i)})),{keys:Array.from(r),data:s}}class km{constructor(t,e,i){this.prevData=(null==t?void 0:t.length)?Mm(t,null!=e?e:null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback)if(this.currentData&&this.prevData){const t=new Map(this.prevData.data);this.currentData.keys.forEach((e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)})),this.prevData.keys.forEach((e=>{t.has(e)&&this.callback(e,null,t.get(e))}))}else this.currentData?this.currentData.keys.forEach((t=>{this.callback(t,this.currentData.data.get(t),null)})):this.prevData&&this.prevData.keys.forEach((t=>{this.callback(t,null,this.prevData.data.get(t))}))}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}function Am(t){return!!(null==t?void 0:t.scale)}function wm(t){return!!(null==t?void 0:t.field)}function Tm(t,e){if(!t)return[];let i=[];return t.scale&&(i=Xp(t.scale)?[t.scale]:Na(e.getScaleById(t.scale))),i.concat(Wp(t,e))}const Lm=t=>e=>$d(e,t),Cm=t=>{g.getInstance().error(t)},Em=(t,e,i={})=>{if(ws(t))return t;const s=(t=>{const e=[],i=t.length;let s,n,r,a=null,o=0,l="";t+="";const h=()=>{e.push(l+t.substring(s,n)),l="",s=n+1};for(s=0,n=0;ns&&h(),s=n+1,o=s):"]"===r&&(o||Cm("Access path missing open bracket: "+t),o>0&&h(),o=0,s=n+1):n>s?h():s=n+1}return o&&Cm("Access path missing closing bracket: "+t),a&&Cm("Access path missing closing quote: "+t),n>s&&(n+=1,h()),e})(t),n=1===s.length?s[0]:t;return((t,e,i)=>(t.fields=e||[],t.fname=i,t))((i&&i.get||Lm)(s),[n],e||n)},Dm=(t,e,i={})=>{if(y(t)){const s=t.map((t=>Em(t,e,i)));return t=>s.map((e=>e(t)))}return Em(t,e,i)};function Om(t,e,i,s,n){i&&(Gp(i)?e.forEach((e=>{const n=Up(i,s,e.datum,t);Object.assign(e.nextAttrs,n)})):Object.keys(i).forEach((r=>{var a,o;const l=i[r],d=n&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case Qd.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case Qd.group:case Qd.rect:case Qd.image:return["width","height","y1"].includes(e);case Qd.path:case Qd.shape:return["path","customPath"].includes(e);case Qd.line:return"defined"===e;case Qd.area:return["x1","y1","defined"].includes(e);case Qd.rule:return["x1","y1"].includes(e);case Qd.symbol:return"size"===e;case Qd.polygon:return"points"===e;case Qd.text:return"text"===e}return!1}(t.mark.markType,r)?[e[0]]:e;if(Am(l)){const t=$p(l.scale,s),e=null!==(a=null==l?void 0:l.offset)&&void 0!==a?a:0,i=!D(l.band)&&t.bandwidth?t.bandwidth()*l.band:null,n=S(null==l?void 0:l.field),c=n?Dm(l.field):null;let u=n?null:D(null==l?void 0:l.value)?0:null===(o=t.scale)||void 0===o?void 0:o.call(t,l.value);d.forEach((s=>{var a;n&&(u=null===(a=t.scale)||void 0===a?void 0:a.call(t,c(s.datum))),s.nextAttrs[r]=h(u)||h(i)?u+e+i:u}))}else if(wm(l)){const t=Dm(l.field);d.forEach((e=>{e.nextAttrs[r]=t(e.datum)}))}else d.forEach((e=>{e.nextAttrs[r]=Up(l,s,e.datum,t)}))})))}function Pm(t,e,i,s){if(!t)return null;if(Gp(t))return Up(t,s,e,i);const n={};return Object.keys(t).forEach((r=>{var a,o,l;const d=t[r];if(Am(d)){const t=$p(d.scale,s),i=null!==(a=null==d?void 0:d.offset)&&void 0!==a?a:0,c=!D(d.band)&&t.bandwidth?t.bandwidth()*d.band:null,u=S(null==d?void 0:d.field),p=u?Dm(d.field):null,g=u?null===(o=t.scale)||void 0===o?void 0:o.call(t,p(e)):D(null==d?void 0:d.value)?0:null===(l=t.scale)||void 0===l?void 0:l.call(t,d.value);n[r]=h(g)||h(c)?g+i+c:g}else if(wm(d)){const t=Dm(d.field);n[r]=t(e)}else n[r]=Up(d,s,e,i)})),n}function Rm(t){return Object.prototype.toString.call(t)}function Bm(t){return Object.keys(t)}function Im(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Rm(t)!==Rm(e))return!1;if(ws(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(y(t)){if(t.length!==e.length)return!1;for(let s=t.length-1;s>=0;s--)if(!Im(t[s],e[s],i))return!1;return!0}if(!w(t))return!1;const s=Bm(t),n=Bm(e);if(s.length!==n.length)return!1;s.sort(),n.sort();for(let t=s.length-1;t>=0;t--)if(s[t]!=n[t])return!1;for(let n=s.length-1;n>=0;n--){const r=s[n];if(!Im(t[r],e[r],i))return!1}return!0}const Fm=Object.prototype,Ym=Object.prototype.hasOwnProperty,jm=function(t){if(D(t))return!0;if(A(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Fm)}(t))return!Object.keys(t).length;for(const e in t)if(Ym.call(t,e))return!1;return!0},Hm=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],zm=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(Hm);function Nm(t,e,i){var s;if(!t||t.length<=1)return null;const n="area"===(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.markType)?zm:Hm,r=[];let a=null;return t.forEach(((t,e)=>{a&&n.every((e=>((t,e,i)=>!(!D(t)||!D(e))||!D(t)&&!D(e)&&("lineDash"===i?((t,e)=>t.length===e.length&&t.join("-")===e.join("-"))(t,e):"stroke"===i||"fill"===i?((t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(S(t))return!1;if(t.gradient!==e.gradient)return!1;const i=Object.keys(t),s=Object.keys(e);return i.length===s.length&&i.every((i=>"stops"===i?((t,e)=>{var i,s;if(t===e)return!0;const n=null!==(i=t&&t.length)&&void 0!==i?i:0;return n===(null!==(s=e&&e.length)&&void 0!==s?s:0)&&0!==n&&t.every(((t,i)=>!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset))})(t[i],e[i]):t[i]===e[i]))})(t,e):t===e))(a[e],t[e],e)))||(r.length&&(r[r.length-1].endIndex=e),a=t,r.push({attrs:a,startIndex:e}))})),r.length>=2?r.map((t=>{const i=Vm(t.attrs);return i.points=e.slice(t.startIndex,D(t.endIndex)?e.length:t.endIndex),i})):null}function Vm(t){const e={};if(!t)return e;const i=["x","y","x1","y1","defined","size","width","height","context"];return Object.keys(t).forEach((s=>{i.includes(s)||(e[s]=t[s])})),e}class Wm{constructor(t){this.data=null,this.states=[],this.diffState=Jd.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t];if(!o)return{};if(ws(o))return o(this.getDatum(),this,t,e);if(!a&&(null===(r=this.graphicItem.states)||void 0===r?void 0:r[t]))return this.graphicItem.states[t];const l=this.items.map((t=>Object.assign({},t,{nextAttrs:{}})));Om(this,l,o,this.mark.parameters());const h=this.transformElementItems(l,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[t]||(this.graphicItem.states[t]=h):this.graphicItem.states={[t]:h},h},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;const e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?bm(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[Wg]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=t=>this.mark?bm(e,t,this):t),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(Object.assign({},t)),this.setFinalGraphicAttributes(Object.assign({},t))))}updateGraphicItem(){var t;if(!this.graphicItem)return;this.diffState===Jd.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");e&&0!==e.length&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(t=>t.stop()))),this.graphicItem&&(Sm(this.graphicItem),this.graphicItem[Wg]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var s;this.mark.emit(hc.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;const n=Kp(i);return this.items=e.map((t=>({datum:t,key:n(t),view:this.mark.view,nextAttrs:{}}))),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(s=this.items)||void 0===s?void 0:s[0].key,this.mark.emit(hc.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;const s=this.mark.isCollectionMark(),n=this.states,r=Na(Up(t,e,this.getDatum(),this)),a=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;a&&r.length&&r.sort(a);const o=r.length!==n.length||r.some(((t,e)=>t!==n[e]));this.states=r,!s&&o&&this.diffState===Jd.unChange&&(this.diffState=Jd.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);const e=this.transformElementItems(this.items,this.mark.markType);t&&Object.assign(e,t),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,dm in this.graphicItem.attribute&&"visible"in e&&delete this.graphicItem.attribute[dm],this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==Jd.enter&&this.diffState!==Jd.update||!this.states.length||this.useStates(this.states),this.mark.markType===Qd.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((t=>{t.nextAttrs={}})),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;const e=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=t=>e(this.data,t,new Ze))}encodeItems(t,e,i=!1,s){const n=this.mark.isCollectionMark(),r=e[Zd.update],a=e[Zd.enter],o=e[Zd.exit],l=this.mark.isLargeMode()||n&&!this.mark.getSpec().enableSegments;this.diffState===Jd.enter?(a&&Om(this,t,a,s,l),r&&Om(this,t,r,s,l)):this.diffState===Jd.update?((n&&a||i)&&Om(this,t,a,s,l),r&&Om(this,t,r,s,l)):this.diffState===Jd.exit&&o&&(i&&Om(this,t,a,s,l),Om(this,t,o,s,l))}coordinateTransformEncode(t){if(!this.mark.coord||"arc"===this.mark.markType||!0===this.mark.disableCoordinateTransform)return;const e=this.mark.coord.output();t.forEach((t=>{const i=t.nextAttrs,s=e.convert(i);Object.assign(i,s)}))}hasStateAnimation(){var t;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");return e&&e.length>0}clearStates(t){const e=v(t)?t:this.hasStateAnimation();this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}updateStates(t){if(!this.graphicItem)return!1;let e=this.states.slice();const i=this.mark.getSpec().encode;let s=!1,n=!1;return Object.keys(t).forEach((r=>{var a;if(!r)return;const o=t[r];if(As(o)&&!Im(o,null===(a=this.runtimeStatesEncoder)||void 0===a?void 0:a[r]))e.includes(r)?s=!0:e.push(r),this._updateRuntimeStates(r,o),n=!0;else if(o)!e.includes(r)&&(null==i?void 0:i[r])&&(e.push(r),n=!0);else if(e.length){const t=e.filter((t=>t!==r));t.length!==e.length&&(n=!0,e=t),this.runtimeStatesEncoder&&this.runtimeStatesEncoder[r]&&(this.runtimeStatesEncoder[r]=null)}})),s&&this.graphicItem.clearStates(),!!n&&(this.useStates(e),!0)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&S(t)&&!Im(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){const i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}const s=this.mark.getSpec().encode,n=Na(t).reduce(((t,e)=>(e&&!t.includes(e)&&(null==s?void 0:s[e])&&t.push(e),t)),this.states.slice());return n.length!==this.states.length&&(this.useStates(n),!0)}removeState(t){if(!this.graphicItem)return!1;const e=Na(t);if(!e.length)return!1;const i=this.states.filter((t=>!e.includes(t)));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach((t=>{this.runtimeStatesEncoder[t]=null})),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(hc.BEFORE_ELEMENT_STATE,{states:t},this);const s=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;s&&t.sort(s),this.states=t;const n=v(e)?e:this.hasStateAnimation();return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(hc.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){const e={},i=this.getFinalGraphicAttributes();for(const s in t)Ss(i,s)&&Im(i[s],t[s])||(e[s]=t[s]);return e}transformElementItems(t,e,i){var s,n,r,a,o;const l=t[0];if(!l.nextAttrs||0===Object.keys(l.nextAttrs).length)return{};let h=l.nextAttrs;if(function(t){return[Qd.line,Qd.area,Qd.largeRects,Qd.largeSymbols].includes(t)}(e)&&t&&t.length&&D(null===(s=l.nextAttrs)||void 0===s?void 0:s.points)&&(!0===i||_m(Object.keys(l.nextAttrs),this.mark.markType))){const i=this.mark.getSpec(),s=this.getGraphicAttribute("points",!1),l=this.getGraphicAttribute("segments",!1),d=i.enableSegments,c=null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[Zd.connectNulls],u=t.map((t=>t.nextAttrs)),p=this.mark.isProgressive();if(h=Vm(h),e===Qd.line||e===Qd.area){const i=function(t,e,i,s){return t&&t.length&&(t.length,1)?t.some((t=>_m(Object.keys(t.nextAttrs),"line")))?t.map(((t,e)=>{var n;const r=t.nextAttrs,{x:a,y:o,x1:l,y1:h,defined:d}=null!==(n=null==i?void 0:i[e])&&void 0!==n?n:{};return D(r.x)&&(r.x=a),D(r.y)&&(r.y=o),D(r.defined)&&!1===d&&(r.defined=!1),r.context=t.key,s&&(D(r.x1)&&(r.x1=l),D(r.y1)&&(r.y1=h)),r})):null!=i?i:[]:[]}(t,0,s,e===Qd.area);if(p)h.segments=(null!==(o=null===(a=null===(r=this.graphicItem)||void 0===r?void 0:r.attribute)||void 0===a?void 0:a.segments)&&void 0!==o?o:[]).concat([{points:i}]);else if(c){if(h.segments=function(t,e,i){if(!t||t.length<=1)return null;const s=!!i&&i.mark.getSpec().enableSegments;let n,r,a=[],o=null;if(t.forEach(((t,i)=>{o=e[i],o&&!1!==o.defined?(n||(r={items:[],points:[]},a.push(r)),r.points.push(o),r.items.push(t),!1===n&&(r.isConnect=!0,r={items:[],points:[]},a.push(r)),n=!0):n=!1})),a=a.filter((t=>t.points.length>0)),a.length>=2){const t=[];return a.forEach((e=>{if(e.isConnect)return void t.push({points:e.points,isConnect:!0});if(s){const s=Nm(e.items,e.points,i);if(s)return void s.forEach((e=>{t.push(e)}))}const n=Vm(e.items[0]);n.points=e.points,t.push(n)})),t}return s?Nm(t,e,i):null}(u,i,this),h.segments&&h.segments.some((t=>t.isConnect))){const t=Pm(c,this.getDatum(),this,this.mark.parameters());t&&h.segments.forEach((e=>{e.isConnect&&Object.assign(e,t)}))}h.points=i}else if(d){const t=i&&0!==i.length?i:function(t){return t?t.reduce(((t,e)=>t.concat(e.points)),[]):null}(l),e=Nm(u,t,this);e?(h.segments=e,h.points=null):(h.segments=null,h.points=t),h=function(t,e){var i;if(!t||!t.segments||!t.segments.length)return t;const s="area"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.markType)?["fillOpacity","strokeOpacity"]:["strokeOpacity"],n={};return Object.keys(t).forEach((e=>{s.includes(e)||(n[e]=t[e])})),n}(h,this)}else h.points=i,h.segments=null}else e===Qd.largeRects?h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(4*t.length);return t.forEach(((t,e)=>{var n,r,a,o;const l=t.nextAttrs,h=null!==(n=l.x)&&void 0!==n?n:i[4*e],d=null!==(r=l.y)&&void 0!==r?r:i[4*e+1],c=null!==(a=l.width)&&void 0!==a?a:i[4*e+2],u=null!==(o=l.y1)&&void 0!==o?o:i[4*e+3];s[4*e]=h,s[4*e+1]=d,s[4*e+2]=c,s[4*e+3]=u-d})),s}(t,!0,s):e===Qd.largeSymbols&&(h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(2*t.length);return t.forEach(((t,e)=>{var n,r;const a=t.nextAttrs,o=null!==(n=a.x)&&void 0!==n?n:i[2*e],l=null!==(r=a.y)&&void 0!==r?r:i[2*e+1];s[2*e]=o,s[2*e+1]=l})),s}(t,!0,s))}return h}applyGraphicAttributes(t){var e,i,s;if(!jm(t))if(this.mark.needAnimate()){const n=this.diffAttributes(t),r=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},a=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(n).forEach((t=>{r[t]=this.getGraphicAttribute(t),a[t]=n[t]})),this.setNextGraphicAttributes(n),this.setPrevGraphicAttributes(r),this.setFinalGraphicAttributes(a);const o=null===(s=this.mark.animate)||void 0===s?void 0:s.getElementAnimators(this).filter((t=>{var e;return!(null===(e=t.animationOptions.timeline.controlOptions)||void 0===e?void 0:e.ignoreLoopFinalAttributes)||!t.animationOptions.timeline.loop})),l=(o||[]).reduce(((t,e)=>Object.assign(t,e.getEndAttributes())),{}),h=Object.assign({},l,a);this.graphicItem.setAttributes(h)}else this.graphicItem.setAttributes(t)}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let e;const i=this.getPrevGraphicAttributes();if(!D(e=$d(i,t)))return e}const s=this.mark.getAttributeTransforms();let n=[t];if(s&&s.length){const e=s.find((e=>e.storedAttrs&&e.channels.includes(t)));e&&(n=[e.storedAttrs,t])}return $d(null===(i=this.graphicItem)||void 0===i?void 0:i.attribute,n)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;const s=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();i&&s&&(s[t]=e),n&&!Ss(n,t)&&(n[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;const i=this.getFinalGraphicAttributes(),s=this.getPrevGraphicAttributes();Object.keys(t).forEach((n=>{i&&e&&(i[n]=t[n]),s&&!Ss(s,n)&&(s[n]=this.graphicItem.attribute[n])})),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}getFinalAnimationAttribute(t){var e,i;return null!==(i=null===(e=this.getFinalGraphicAttributes())||void 0===e?void 0:e[t])&&void 0!==i?i:this.getGraphicAttribute(t)}getFinalAnimationAttributes(){var t;return null!==(t=this.getFinalGraphicAttributes())&&void 0!==t?t:this.graphicItem.attribute}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(Sm(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?D(t)?this.items.map((t=>t.nextAttrs)):this.items.map((e=>{var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]})):D(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}setItemAttributes(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?y(t)&&this.items.forEach(((e,i)=>{Object.assign(e.nextAttrs,t[i])})):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}getDatum(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}class Gm extends Qp{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.differ=new km([]),this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,s;if(super.parse(t),this.spec.group){const t=S(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(t)}const n=S(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(n),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach((t=>{this.encodeState(t,{},!0)})),Object.keys(null!==(s=t.encode)&&void 0!==s?s:{}).forEach((e=>{this.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:super.parameters()}parseAddition(t){return this}reuse(t){var e;if(t.grammarType!==this.grammarType)return this;const i=t;return this.markType=i.markType,this.coord=i.coord,this.elementMap=i.elementMap,this.elements=i.elements,this.elementMap.forEach((t=>t.mark=this)),this.differ=i.differ,null===(e=this.reuseAnimate)||void 0===e||e.call(this,i),this._context=i._context,this.graphicItem=i.graphicItem,this.graphicIndex=i.graphicIndex,this.graphicParent=i.graphicParent,this.needClear=i.needClear,this.isUpdated=i.isUpdated,this}needLayout(){return!D(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((t=>{t.diffState===Jd.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i,s;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===lc.before)return this;const n=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(n,e);const r=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:Xg,e),a=null==r?void 0:r.progressive;if(a?this.renderContext={large:!1}:(this.evaluateGroup(r),this.renderContext=this.parseRenderContext(r,e)),null===(s=this.renderContext)||void 0===s?void 0:s.progressive)this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive();else{let t=null;if(a){if(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=r.progressive,t=r.progressive.output(),r.progressive.canAnimate&&r.progressive.unfinished())return this.update(this.spec),this}else t=r;this.emit(hc.BEFORE_MARK_JOIN),this.evaluateJoin(t),this.emit(hc.AFTER_MARK_JOIN),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(hc.AFTER_MARK_ENCODE)}return this.update(this.spec),this}evaluateGroup(t){if(this.markType===Qd.group)return;const e=Mm(null!=t?t:Xg,this.spec.groupBy,this.spec.groupSort);this._groupEncodeResult=null,this._groupedData=e}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter((t=>"afterEncodeItems"===t.markPhase))}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter((t=>D(t.markPhase)||"afterEncode"===t.markPhase))}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter((t=>"beforeJoin"===t.markPhase)):[]}evaluate(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}output(){return this}join(t,e,i,s,n){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,D(t)||(S(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=s,this.spec.groupSort=n,this.commit(),this}coordinate(t){return S(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(Jd.update,t,e,i)}encodeState(t,e,i,s){if(t===Jd.enter&&(this._isReentered=!0),this.spec.encode[t]){const n=this.spec.encode[t];if(Gp(n))this.detach(Tm(n,this.view));else{const r=S(e);r&&s||!r&&i?(Object.keys(n).forEach((t=>{this.detach(Tm(n[t],this.view))})),this.spec.encode[t]={}):r?this.detach(Tm(n[e],this.view)):Object.keys(e).forEach((t=>{this.detach(Tm(n[t],this.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),S(e)?(this.spec.encode[t][e]=i,this.attach(Tm(i,this.view))):Gp(e)?(this.spec.encode[t]=e,this.attach(Tm(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((t=>{this.attach(Tm(t,this.view))})))),this.commit(),this}_getEncoders(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){const e=eg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);const i=eg(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){const e=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(e.forEach((t=>{D(this.spec[t])||(this.spec[t]=void 0)})),this):(e.forEach((e=>{D(t[e])||(this.spec[e]=t[e])})),this)}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return Gg.includes(this.markType)}needAnimate(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!D(this.spec.animation)}getAllElements(){const t=this.elements.slice();return this.elementMap.forEach((e=>{e.diffState!==Jd.exit||t.includes(e)||t.push(e)})),this.spec.sort&&t.sort(((t,e)=>this.spec.sort(t.getDatum(),e.getDatum()))),t}getScales(){const t={};return this.references.forEach(((e,i)=>{i.grammarType===dc.scale&&(t[i.id()]=i.output())})),t}getScalesByChannel(){const t=this.spec.encode;if(!t)return{};const e={},i=this.parameters();return Object.keys(t).forEach((s=>{const n=t[s];n&&!Gp(n)&&Object.keys(n).forEach((t=>{Am(n[t])&&(e[t]=$p(n[t].scale,i))}))})),e}getFieldsByChannel(){const t=this.spec.encode;if(!t)return{};const e={};return Object.keys(t).forEach((i=>{const s=t[i];Gp(s)||Object.keys(s).forEach((t=>{wm(s[t])&&(e[t]=s[t].field)}))})),e}init(t,e){var i,s,n,r,a;if(this._delegateEvent||(this._delegateEvent=(t,e)=>{const i=cm(this.view,t,0,Ig),s=t.element;(null==s?void 0:s.mark)===this&&this.emitGrammarEvent(e,i,s)},this.initEvent()),null===(i=this.initAnimate)||void 0===i||i.call(this,this.spec),!this.group){const t=$p(this.spec.group,e);this.group=t,t&&t.appendChild(this)}const o=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=null!==(r=null===(n=null===(s=this.group)||void 0===s?void 0:s.children)||void 0===n?void 0:n.indexOf(this))&&void 0!==r?r:0;if(this.markType!==Qd.group){if(!this.graphicItem){const t=xm(this,Qd.group,{pickable:!1,zIndex:null!==(a=this.spec.zIndex)&&void 0!==a?a:0});(this.spec.support3d||Ug.includes(this.markType))&&t.setMode("3d"),t.name=`${this.id()||this.markType}`,this.graphicItem=t}this.graphicParent=this.graphicItem,!o||this.graphicIndex===l&&this.graphicItem.parent===o||o.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=o;this.graphicIndex=l}update(t){var e;if(this.emit(hc.BEFORE_MARK_UPDATE),this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||null===(e=this.updateAnimate)||void 0===e||e.call(this,t),this.markType!==Qd.group){if(D(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),D(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!D(t.clipPath)){const e=y(t.clipPath)?t.clipPath:t.clipPath(this.elements);e&&e.length?this.graphicItem.setAttribute("path",e):this.graphicItem.setAttributes({path:e,clip:!1})}this.elementMap.forEach((t=>{t.updateGraphicItem()}))}else this.elementMap.forEach((t=>{t.updateGraphicItem()}));this.emit(hc.AFTER_MARK_UPDATE)}createElement(){return new Wm(this)}evaluateJoin(t){var e,i,s,n;this.needClear=!0;const r=Kp(null!==(s=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==s?s:()=>$g),a=Kp(null!==(n=this.spec.groupBy)&&void 0!==n?n:()=>$g),o=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter((t=>t.diffState===Jd.enter))),d=[];this.differ.setCallback(((t,e,i)=>{var s;const n=t;let o;if(D(e))o=this.elementMap.get(n),o&&(o.diffState=Jd.exit);else if(D(i)){if(o=this.elementMap.has(n)?this.elementMap.get(n):this.createElement(),o.diffState===Jd.exit){o.diffState=Jd.enter;const t=null===(s=this.animate)||void 0===s?void 0:s.getElementAnimators(o,Jd.exit);t&&t.forEach((t=>t.stop("start")))}o.diffState=Jd.enter;const i=l?t:a(e[0]);o.updateData(i,e,r),this.elementMap.set(n,o),d.push(o)}else if(o=this.elementMap.get(n),o){o.diffState=Jd.update;const i=l?t:a(e[0]);o.updateData(i,e,r),d.push(o)}h.delete(o)}));const c=null!=t?t:Xg;l?this.differ.setCurrentData(this._groupedData):this.differ.setCurrentData(Mm(c,(t=>`${a(t)}-${r(t)}`),void 0)),this.differ.doDiff(),h.forEach((t=>{this.elementMap.delete(l?t.groupKey:`${t.groupKey}-${t.key}`),t.remove(),t.release()})),this.elements=d,o&&this.elements.length>=2&&this.elements.sort(((t,e)=>o(t.getDatum(),e.getDatum())))}evaluateState(t,e,i){e&&t.forEach((t=>{t.state(e,i)}))}evaluateGroupEncode(t,e,i){if(!this._groupedData||!e)return;const s={};return this._groupedData.keys.forEach((n=>{const r=t.find((t=>t.groupKey===n));r&&(s[n]=Pm(e,r.items&&r.items[0]&&r.items[0].datum,r,i))})),this._groupEncodeResult=s,s}getChannelsFromConfig(t){const e=this.spec;return D(e.interactive)?null:{pickable:e.interactive}}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(hc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[Zd.group],i);t.forEach((t=>{this.markType===Qd.glyph&&this._groupEncodeResult?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,this._groupEncodeResult[t.groupKey])})):(null==r?void 0:r[t.groupKey])&&!this.isCollectionMark()?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,r[t.groupKey])})):n&&t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n)})),t.encodeItems(t.items,e,this._isReentered,i),this.isCollectionMark()&&(null==r?void 0:r[t.groupKey])&&M(r[t.groupKey].defined)&&(t.items.forEach((e=>{e.nextAttrs.defined=r[t.groupKey].defined})),delete r[t.groupKey].defined)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic(this.isCollectionMark()?null==r?void 0:r[t.groupKey]:null)})),this.emit(hc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){var s;const n=null!=i?i:xm(this,this.markType,t);if(n){if(null===(s=this.renderContext)||void 0===s?void 0:s.progressive){let t;if(this._groupedData){const i=this._groupedData.keys.indexOf(e);i>=0&&(t=this.graphicParent.getChildAt(i))}else t=this.graphicParent.at(0);this.isCollectionMark()?(n.incremental=1,t.appendChild(n)):t.incrementalAppendChild(n)}else this.graphicParent.appendChild(n);return n}}parseRenderContext(t,e){const i=this.markType!==Qd.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep0&&t.length>=this.spec.largeThreshold;if(i){const i=this._groupedData;return i&&i.keys&&i.keys.some((t=>i.data.get(t).length>this.spec.progressiveThreshold))?{large:s,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:i.keys.reduce(((t,e)=>Math.max(Math.ceil(i.data.get(e).length/this.spec.progressiveStep),t)),1),groupedData:i.data}}:{large:s}}return{large:s}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}canAnimateAfterProgressive(){return this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.canAnimate()}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex{t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;const s=this.renderContext.progressive.currentIndex,n=Kp(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:()=>$g),r=[];if(this.isCollectionMark())return this._groupedData.keys.forEach(((t,e)=>{const i=this.renderContext.progressive.groupedData.get(t),a=this.renderContext.progressive.step,o=i.slice(s*a,(s+1)*a);if(0===s){const e=this.createElement();e.diffState=Jd.enter,e.updateData(t,o,n),r.push(e)}else{const i=this.elements[e];i.updateData(t,o,n),r.push(i)}})),r;const a={};return this._groupedData.keys.forEach((t=>{const e=this.renderContext.progressive.groupedData.get(t),i=this.renderContext.progressive.step,o=e.slice(s*i,(s+1)*i),l=[];o.forEach((e=>{const i=this.createElement();i.diffState=Jd.enter,i.updateData(t,[e],n),l.push(i),r.push(i)})),a[t]=l})),{groupElements:a,elements:r}}evaluateEncodeProgressive(t,e,i){const s=this.renderContext.progressive.currentIndex;if(0===s){if(this.evaluateEncode(t,e,i),0===s&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==Qd.glyph){const e=t[0],i=e.getGraphicItem(),s=null==i?void 0:i.parent;s&&this._groupEncodeResult[e.groupKey]&&s.setTheme({common:this._groupEncodeResult[e.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}evaluateProgressive(){var t,e,i;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){const t=this.renderContext.beforeTransformProgressive;t.progressiveRun();const e=t.output();if(t.canAnimate){if(t.unfinished())return;this.evaluateGroup(e)}return this.emit(hc.BEFORE_MARK_JOIN),this.evaluateJoin(e),this.emit(hc.AFTER_MARK_JOIN),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(hc.AFTER_MARK_ENCODE)}if(!(null===(e=this.renderContext)||void 0===e?void 0:e.progressive))return;const s=this.renderContext.parameters;this.emit(hc.BEFORE_MARK_JOIN);const n=this.evaluateJoinProgressive(),r=Array.isArray(n)?n:n.elements;if(this.emit(hc.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupedData.keys.forEach((t=>{const e=xm(this,Qd.group,{pickable:!1,zIndex:this.spec.zIndex});e.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(e)})),this.elements=r):this.elements=this.elements.concat(r),this.emit(hc.BEFORE_MARK_STATE),this.evaluateState(r,this.spec.state,s),this.emit(hc.AFTER_MARK_STATE),this.emit(hc.BEFORE_MARK_ENCODE),Array.isArray(n))this.evaluateEncodeProgressive(r,this._getEncoders(),s);else{const t=n.groupElements;Object.keys(t).forEach((e=>{this.evaluateEncodeProgressive(t[e],this._getEncoders(),s)}))}this.emit(hc.AFTER_MARK_ENCODE);const a=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter((t=>!0===t.canProgressive));(null==a?void 0:a.length)&&this.evaluateTransform(a,this.elements,s),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach(((t,e)=>{t.diffState!==Jd.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())}))}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:ym[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;let i=this.group;for(;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}initEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}releaseEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,super.clear()}prepareRelease(){var t;this.differ.setCurrentData(null),null===(t=this.animate)||void 0===t||t.stop(),this.elementMap.forEach((t=>t.diffState=Jd.exit)),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach((t=>t.release())),this.differ=null,this.elements=[],this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&Sm(this.graphicItem),this.detachAll(),super.release()}}class Um extends Gm{constructor(t,e){super(t,Qd.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter((e=>e!==t)),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some((e=>e.markType===Qd.group&&e.includesChild(t,!0)))}updateLayoutChildren(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((t=>t.needLayout())),this):this}getAttributeTransforms(){return ym.rect}evaluateJoin(t){if(!this.elements.length){const t=this.createElement();t.updateData($g,Xg,(()=>"")),this.elements=[t],this.elementMap.set($g,t)}}getChannelsFromConfig(t){const e=this.spec,i={};if(D(e.clip)||(i.clip=e.clip),D(e.zIndex)||(i.zIndex=e.zIndex),!D(e.clipPath)){const s=ws(e.clipPath)?e.clipPath([t]):e.clipPath;s&&s.length?i.path=s:(i.path=null,i.clip=!1)}return D(e.interactive)||(i.pickable=e.interactive),i}evaluateGroupEncode(t,e,i){var s;const n=this.elements[0],r={};return Om(n,[Object.assign({},null===(s=n.items)||void 0===s?void 0:s[0],{nextAttrs:r})],e,i),this._groupEncodeResult=r,r}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(hc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[Zd.group],i);t.forEach((t=>{t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n,r)})),t.encodeItems(t.items,e,this._isReentered,i)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic()})),this.emit(hc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){const s=null!=i?i:xm(this,this.markType,t);if(s)return this.emit(hc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),s.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(s,this.graphicIndex),this.emit(hc.AFTER_ADD_VRENDER_MARK,{graphicItem:s}),s}}class $m{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=S(t)?e=>e[t]:t,this._warning=e}record(t){var e,i;const s=t.grammarType,n=this._mapKey(t);return this._grammarMap[s]?(this._grammars[s].push(t),D(n)||(this._grammarMap[s][n]?null===(e=this._warning)||void 0===e||e.call(this,n,t):this._grammarMap[s][n]=t)):(this._grammars.customized.push(t),D(n)||(this._grammarMap.customized[n]?null===(i=this._warning)||void 0===i||i.call(this,n,t):this._grammarMap.customized[n]=t)),this._size+=1,this}unrecord(t){const e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((e=>e!==t)),D(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter((e=>e!==t)),D(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}getData(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}getScale(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}getCoordinate(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}getMark(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}getCustomized(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((e=>(null!=e?e:[]).forEach((e=>{t.call(null,e)}))))}find(t){let e=null;return this.traverse((i=>!0===t.call(null,i)&&(e=i,!0))),e}filter(t){const e=[];return this.traverse((i=>{!0===t.call(null,i)&&e.push(i)})),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class Xm extends $m{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),"mark"===t.grammarType){const e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach((t=>{const s=t.mark;s.markType===Qd.group&&s.includesChild(e,!1)?(t.children.push(i),i.parent=t):e.markType===Qd.group&&e.includesChild(s,!1)&&(i.children.push(t),t.parent=i)})),this._markNodes.push(i)}return this}unrecord(t){if(super.unrecord(t),"mark"===t.grammarType){const e=t,i=this._markNodes.find((t=>t.mark===e));this._markNodes.forEach((t=>{t.mark.markType===Qd.group&&t.children.includes(i)?(t.children=t.children.filter((t=>t!==i)),i.parent=null):e.markType===Qd.group&&i.children.includes(t)&&(i.children=i.children.filter((e=>e!==t)),t.parent=null)})),this._markNodes=this._markNodes.filter((t=>t!==i))}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class Km extends Gm{addGraphicItem(t,e){const i=t&&t.limitAttrs,s=xm(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?Qd.richtext:Qd.text,t);return super.addGraphicItem(t,e,s)}release(){super.release()}}Km.markType=Qd.text;const qm={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},Zm={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},Jm=Object.assign({},qm);Jm.axis=Object.assign({},Jm.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Jm.circleAxis=Object.assign({},Jm.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Jm.grid=Object.assign({},Jm.grid,{style:{stroke:"#404349"}}),Jm.circleGrid=Object.assign({},Jm.circleGrid,{style:{stroke:"#404349"}}),Jm.rectLabel=Object.assign({},Jm.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.lineLabel=Object.assign({},Jm.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.symbolLabel=Object.assign({},Jm.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Jm.title=Object.assign({},Jm.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});const Qm={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:Zm,components:Jm},t_={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:Zm,components:qm};class e_{static registerTheme(t,e){t&&e_._themes.set(t,e)}static unregisterTheme(t){e_._themes.delete(t)}static getTheme(t){return e_._themes.get(t)}static getDefaultTheme(){return e_.getTheme("default")}}e_._themes=new Map,e_.registerTheme("default",t_),e_.registerTheme("dark",Qm);class i_ extends Gm{constructor(t,e,i,s){super(t,Qd.component,i),this._componentDatum={[$g]:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=s,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){const s=null!=i?i:fc.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return s&&(this.emit(hc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),this.graphicParent.appendChild(s),this.emit(hc.AFTER_ADD_VRENDER_MARK,{graphicItem:s})),s}join(t){return super.join(t,$g)}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum[$g]+=1}evaluateJoin(t){return this.spec.key=$g,t?(t[$g]=this._componentDatum[$g],this._componentDatum=t):this._componentDatum={[$g]:this._componentDatum[$g]},super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}const s_=Symbol.for("key");class n_{diffGrammar(t,e){return function(t,e,i){const s={enter:[],exit:[],update:[]},n=new km(t,i);return n.setCallback(((t,e,i)=>{D(e)?s.exit.push({prev:i[0]}):D(i)?s.enter.push({next:e[0]}):s.update.push({next:e[0],prev:i[0]})})),n.setCurrentData(Mm(e,i)),n.doDiff(),s}(t,e,(t=>{var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}diffMark(t,e,i){const s={enter:[],exit:[],update:[]};let n=[],r=[];t.forEach((t=>{t.markType!==Qd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?n.push(t):s.exit.push({prev:[t]})})),e.forEach((t=>{t.markType!==Qd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(t):s.enter.push({next:[t]})}));const a=this.diffUpdateByGroup(n,r,(t=>t.getMorphConfig().morphKey),(t=>t.getMorphConfig().morphKey));n=a.prev,r=a.next,s.update=s.update.concat(a.update);const o=this.diffUpdateByGroup(n,r,(t=>t.id()),(t=>t.id()));n=o.prev,r=o.next,s.update=s.update.concat(o.update);const l=Mm(n,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)})),h=Mm(r,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}));return Object.keys(h).forEach((t=>{const e=l.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t!e.includes(t))),r=r.filter((t=>!i.includes(t)))}})),n.forEach((t=>s.exit.push({prev:[t]}))),r.forEach((t=>s.enter.push({next:[t]}))),s}diffUpdateByGroup(t,e,i,s){const n=Mm(t,(t=>{var e;return null!==(e=i(t))&&void 0!==e?e:s_})),r=Mm(e,(t=>{var e;return null!==(e=s(t))&&void 0!==e?e:s_}));let a=t,o=e;const l=[];return r.keys.forEach((t=>{if(t!==s_){const e=n.data.get(t),i=r.data.get(t);e&&i&&(l.push({prev:e,next:i}),a=a.filter((t=>!e.includes(t))),o=o.filter((t=>!i.includes(t))))}})),{prev:a,next:o,update:l}}}class r_ extends(o()){static useRegisters(t){t.forEach((t=>{t()}))}constructor(t={},e={}){super(),this._observer=null,this._onResize=Kd(((...t)=>{const e=this._getContainerSize();e&&this.resize(e.width,e.height)}),100),this.delegateEvent=(t,e)=>{const i=cm(this,t,0,Ig);this.emit(e,i,t.element)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach((t=>{t.isDoingProgressive()&&t.evaluateProgressive()})),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:"browser"},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter((e=>e.name()===t))}getGrammarsByType(t){return this.grammars.filter((e=>e.grammarType===t))}getMarksByType(t){return this.grammars.getAllMarks().filter((e=>e.markType===t))}getMarksByName(t){return this.grammars.getAllMarks().filter((e=>e.name()===t))}getMarksBySelector(t){if(!t)return null;const e=Na(t),i=[];return e.forEach((t=>{if(Xp(t))return void i.push(t);if("#"===t[0]){const e=this.getMarkById(t.slice(1));return void(e&&i.push(e))}const e="@"===t[0]?this.getMarksByName(t.slice(1)):Qd[t]?this.getMarksByType(t):null;e&&e.length&&e.forEach((t=>{i.push(t)}))})),i}updateSignal(t,e){S(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){const i=new um(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){const e=new sg(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){const e=fc.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){const e=fc.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){const s=S(e)?this.getMarkById(e):e;let n;switch(t){case Qd.group:n=new Um(this,s);break;case Qd.glyph:const e=fc.getMark(Qd.glyph);e&&(n=new e(this,null==i?void 0:i.glyphType,s));break;case Qd.component:n=fc.hasComponent(null==i?void 0:i.componentType)?fc.createComponent(null==i?void 0:i.componentType,this,s,null==i?void 0:i.mode):new i_(this,null==i?void 0:i.componentType,s,null==i?void 0:i.mode);break;case Qd.text:n=new Km(this,t,s);break;default:n=fc.hasMark(t)?fc.createMark(t,this,s):new Gm(this,t,s)}return this.grammars.record(n),this._dataflow.add(n),n}group(t){return this.mark(Qd.group,t)}glyph(t,e){return this.mark(Qd.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(Qd.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(Qd.component,t,{componentType:tc.axis,mode:e})}grid(t,e="2d"){return this.mark(Qd.component,t,{componentType:tc.grid,mode:e})}legend(t){return this.mark(Qd.component,t,{componentType:tc.legend})}slider(t){return this.mark(Qd.component,t,{componentType:tc.slider})}label(t){return this.mark(Qd.component,t,{componentType:tc.label})}datazoom(t){return this.mark(Qd.component,t,{componentType:tc.datazoom})}player(t){return this.mark(Qd.component,t,{componentType:tc.player})}title(t){return this.mark(Qd.component,t,{componentType:tc.title})}scrollbar(t){return this.mark(Qd.component,t,{componentType:tc.scrollbar})}customized(t,e){const i=fc.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find((e=>e.uid===t.uid))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){const e=S(t)?this.getGrammarById(t):t;return e&&this.grammars.find((t=>t.uid===e.uid))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}removeAllGrammars(){return this.grammars.traverse((t=>{"signal"===t.grammarType&&gm.includes(t.id())||"mark"===t.grammarType&&"root"===t.id()||this.removeGrammar(t)})),this}removeAllGraphicItems(){return this.traverseMarkTree((t=>{t.graphicItem&&(Sm(t.graphicItem),t.elementMap.forEach((t=>{t.resetGraphicItem()})),t.graphicItem=null)})),this}parseSpec(t){var e,i,s,n,r,a,o,l;if(this.emit(hc.BEFORE_PARSE_VIEW),this._spec=t,(t=>{var e;const i=(t,e)=>{var s,n;t.group=e;const r=null!==(s=t.id)&&void 0!==s?s:"VGRAMMAR_MARK_"+ ++pm;t.id=r,(null!==(n=t.marks)&&void 0!==n?n:[]).forEach((t=>i(t,r)))};(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((t=>i(t,"root")))})(t),t.theme?this.theme(t.theme):this.theme(e_.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){const t=this._getContainerSize();t&&(this.updateSignal(Fg,t.width),this.updateSignal(Yg,t.height))}(null===(s=t.signals)||void 0===s?void 0:s.length)&&t.signals.forEach((t=>{this.signal().parse(t)})),(null===(n=t.data)||void 0===n?void 0:n.length)&&t.data.forEach((t=>{this.data(null).parse(t)})),(null===(r=t.coordinates)||void 0===r?void 0:r.length)&&t.coordinates.forEach((t=>{var e;null===(e=this.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(a=t.scales)||void 0===a?void 0:a.length)&&t.scales.forEach((t=>{var e;null===(e=this.scale(t.type))||void 0===e||e.parse(t)}));const h=fc.getGrammars();return Object.keys(h).forEach((e=>{const{specKey:i}=h[e];t[i]&&t[i].length&&t[i].forEach((t=>{this.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((t=>{this.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((t=>{var e;null===(e=this.event)||void 0===e||e.call(this,t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((t=>{this.interaction(t.type,t)})),!1===t.animation?null===(o=this.animate)||void 0===o||o.disable():null===(l=this.animate)||void 0===l||l.enable(),this.emit(hc.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=lc.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){((t,e,i)=>{var s,n,r,a,o;return[{id:Fg,value:null!==(s=t[Fg])&&void 0!==s?s:0},{id:Yg,value:null!==(n=t[Yg])&&void 0!==n?n:0},{id:zg,value:mm(null!==(a=null!==(r=t[zg])&&void 0!==r?r:e[zg])&&void 0!==a?a:null==i?void 0:i.padding)},{id:jg,update:{callback:(t,e)=>{const i=mm(e[zg]);return e[Fg]-i.left-i.right},dependency:[Fg,zg]}},{id:Hg,update:{callback:(t,e)=>{const i=mm(e[zg]);return e[Yg]-i.top-i.bottom},dependency:[Yg,zg]}},{id:Ng,update:{callback:(t,e)=>{const i=mm(e[zg]);return(t||new Kt).setValue(i.left,i.top,i.left+e[jg],i.top+e[Hg])},dependency:[jg,Hg,zg]}},{id:Vg,value:null!==(o=t[Vg])&&void 0!==o?o:e[Vg]}]})(this._options,this._config,this.getCurrentTheme()).forEach((t=>{const e=this.signal().parse(t);t.value&&e.set(t.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;const i=t.type===Qd.glyph?{glyphType:t.glyphType}:t.type===Qd.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach((t=>{this.parseMarkSpec(t)}))}theme(t){var e,i,s,n,r,a;S(t)?this._theme=null!==(e=e_.getTheme(t))&&void 0!==e?e:e_.getDefaultTheme():this._theme=t;const{background:o,padding:l}=null!==(i=this._spec)&&void 0!==i?i:{};return this._theme?(this.background(null!==(s=null!=o?o:this._options.background)&&void 0!==s?s:this._theme.background),this.padding(null!==(n=null!=l?l:this._options.padding)&&void 0!==n?n:this._theme.padding),null===(a=null===(r=this.renderer.stage())||void 0===r?void 0:r.setTheme)||void 0===a||a.call(r,Object.assign({},this._theme.marks))):(this.background(null!=o?o:this._options.background),this.padding(null!=l?l:this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return this.theme(t),this.grammars.getAllMarks().forEach((t=>{t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){const e=this.getSignalById(Fg);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){const e=this.getSignalById(Yg);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){const e=this.getSignalById(jg);if(arguments.length){const e=this.padding();return this.width(t+e.left+e.right),t}return e.output()}viewHeight(t){const e=this.getSignalById(Hg);if(arguments.length){const e=this.padding();return this.height(t+e.top+e.bottom),t}return e.output()}padding(t){const e=this.getSignalById(zg);if(arguments.length){const i=mm(t);return this.updateSignal(e,i),i}return mm(e.output())}autoFit(t){const e=this.getSignalById(Vg);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){const t=this.getSignalById(Ng);return null==t?void 0:t.output()}updateLayoutTag(){return this._layoutState=lc.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){const t={},e=[];this.traverseMarkTree((i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===Qd.group&&i.updateLayoutChildren()}),(t=>t.needLayout())),this._layoutMarks=e}doLayout(){var t;const e=this._options.doLayout||fc.getDefaultLayout();e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(hc.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(hc.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(hc.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((t=>{cg(t,"layoutChildren",(t=>{t.handleLayoutEnd()}),(e=>e!==t))})),this.emit(hc.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(hc.BEFORE_MARK_RENDER_END),cg(this.rootMark,"children",(t=>{t.handleRenderEnd()})),this.emit(hc.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}doRender(t){this.emit(hc.BEFORE_DO_RENDER),this.renderer&&(!this._progressiveMarks&&this.animate?this.animate.animate():this.traverseMarkTree((t=>{t.cleanExitElements()}),null,!0),this.renderer.render(t),this.handleRenderEnd()),this.emit(hc.AFTER_DO_RENDER)}evaluate(t){var e,i;const s=(t=>{var e,i,s,n,r;const{reuse:a=qg,morph:o=Zg,morphAll:l=Jg,animation:h={},enableExitAnimation:d=Qg}=null!=t?t:{};return{reuse:a,morph:o,morphAll:l,animation:{easing:null!==(e=h.easing)&&void 0!==e?e:om,delay:null!==(i=h.delay)&&void 0!==i?i:sm,duration:null!==(s=h.duration)&&void 0!==s?s:im,oneByOne:null!==(n=h.oneByOne)&&void 0!==n?n:am,splitPath:null!==(r=h.splitPath)&&void 0!==r?r:null},enableExitAnimation:d}})(t),n=this._cachedGrammars.size()>0;n&&(this.reuseCachedGrammars(s),this.detachCachedGrammar());const r=this._resizeRenderer(),a=this._dataflow.hasCommitted();return n||a||this._layoutState||r?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=lc.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=lc.reevaluate,this._dataflow.evaluate()),this._layoutState=lc.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this.morph)||void 0===i||i.call(this,s),this.releaseCachedGrammars(s),this.doRender(!0),this.doPreProgressive(),this):this}reuseCachedGrammars(t){if(t.reuse){const t=t=>{t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),this._cachedGrammars.unrecord(t.prev)};this._differ.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((t=>!gm.includes(t.id())))).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(t)}this._differ.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((t=>"root"!==t.id())),t).update.forEach((e=>{var i;const s=1===e.prev.length&&1===e.next.length&&e.prev[0].markType===e.next[0].markType,n=e.prev.every((t=>t.getMorphConfig().morph))&&e.next.every((t=>t.getMorphConfig().morph));this.morph&&(t.morph&&n||t.morphAll)?null===(i=this.addMorphMarks)||void 0===i||i.call(this,{prev:e.prev,next:e.next}):s&&t.reuse&&(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0]))}))}detachCachedGrammar(){this._cachedGrammars.traverse((t=>{var e,i;if(t.detachAll(),"mark"===t.grammarType){const s=t;null===(i=null===(e=s.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,s)}}))}releaseCachedGrammars(t){this._cachedGrammars.traverse((t=>{"mark"!==t.grammarType&&t.release()}));const e=this._cachedGrammars.getAllMarkNodes();e.forEach((e=>{var i;null===(i=e.mark.animate)||void 0===i||i.stop(),t.enableExitAnimation&&this.animate&&this.animate.animateAddition(e.mark)}));const i=t=>{if(t.mark.view&&(!t.mark.animate||0===t.mark.animate.getAnimatorCount())&&(!t.children||0===t.children.length)){t.mark.release();const e=t.parent;e&&(t.parent.children=t.parent.children.filter((e=>e!==t)),t.parent=null,i(e))}};e.forEach((t=>{const e=t.mark;e.animate&&0!==e.animate.getAnimatorCount()?e.addEventListener("animationEnd",(()=>{e.animate&&0===e.animate.getAnimatorCount()&&i(t)})):i(t)})),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter((()=>{t.call(null,this)})),this}runBefore(t){return this._dataflow.runBefore((()=>{t.call(null,this)})),this}getImageBuffer(){var t,e;if("node"!==this._options.mode)return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));const i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return cg(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,s,n,r;if(this.autoFit()){const a=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(a){const t=window.ResizeObserver;this._observer=new t(this._onResize),null===(r=this._observer)||void 0===r||r.observe(a)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,s,n,r,a,o,l,h,d;const c=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(c){const{width:t,height:e}=ra(c);return{width:null!==(o=null!==(a=null===(r=this._spec)||void 0===r?void 0:r.width)&&void 0!==a?a:this._options.width)&&void 0!==o?o:t,height:null!==(d=null!==(h=null===(l=this._spec)||void 0===l?void 0:l.height)&&void 0!==h?h:this._options.height)&&void 0!==d?d:e}}return null}resize(t,e,i=!0){let s=!1;return t!==this.width()&&(s=!0,this.updateSignal(Fg,t)),e!==this.height()&&(s=!0,this.updateSignal(Yg,e)),s&&(i?this.evaluate({morph:!1}):this._dataflow.evaluate()),this}_resizeRenderer(){const t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}interaction(t,e){const i=fc.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){const i=this._boundInteractions.filter((i=>{var s;return D(e)?S(t)?i.type===t:t?i===t:void 0:(null===(s=i.options)||void 0===s?void 0:s.id)===e}));i.length&&i.forEach((t=>{t.unbind()}))}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach((t=>{t.unbind()})),this._boundInteractions=null),this}initializeEventConfig(t){const e=Object.assign({defaults:{}},t),i=(t,e)=>{e.forEach((e=>{y(t[e])&&(t[e]=t[e].reduce(((t,e)=>(t[e]=!0,t)),{}))}))};return i(e.defaults,["prevent","allow"]),i(e,[Ig,Bg]),e}initEvent(){const t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}releaseStageEvent(){const t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){const t=this._options.width,e=this._options.height;this.renderer=new Og(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t,e;this.grammars=new $m((t=>t.id()),((t,e)=>this.logger.warn(`Grammar id '${t}' has been occupied`,e))),this._cachedGrammars=new Xm((t=>t.id())),this._options.logger&&g.setInstance(this._options.logger),this.logger=g.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new dg,this.animate=null===(e=this.initAnimate)||void 0===e?void 0:e.call(this,this),this._differ=new n_,this._options.hooks&&(Object.keys(this._options.hooks).forEach((t=>{this.on(t,this._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=this.initializeEventConfig(this._options.eventConfig),this._theme=this._options.disableTheme?null:e_.getDefaultTheme(),this.parseBuiltIn(),function(t){t.mode&&$o.setEnv(t.mode,t.modeParams||{})}(this._options),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=lc.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){const t=[];return this.traverseMarkTree((e=>{t.push(e)}),(t=>t.markType!==Qd.group&&t.isProgressive())),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some((t=>t.isDoingProgressive()))){const t=$o.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}else this._progressiveMarks&&this.animate&&this._progressiveMarks.every((t=>t.canAnimateAfterProgressive()))?this.animate.animate():this._progressiveMarks&&(this._progressiveMarks=null)}clearProgressive(){this._progressiveRafId&&$o.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((t=>{t.clearProgressive()})),this._progressiveMarks=null)}release(){var t,e,i,s;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),fc.unregisterRuntimeTransforms(),g.setInstance(null),null===(t=this.animate)||void 0===t||t.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(i=null===(e=this.renderer)||void 0===e?void 0:e.release)||void 0===i||i.call(e),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(s=this._eventListeners)||void 0===s||s.forEach((t=>{t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}var a_;function o_(t){switch(t){case n["desktop-browser"]:case n["mobile-browser"]:return"browser";case n.node:case n.worker:return"node";case n.miniApp:case n["desktop-miniApp"]:return"feishu";case n.lynx:return"lynx";case n.wx:return"wx";case n.tt:return"tt";case n.harmony:return"harmony"}return"browser"}!function(t){t.data="data",t.signal="signal",t.mark="mark"}(a_||(a_={}));class l_{getVGrammarView(){return this._view}getModel(){return this._model}constructor(t,e){this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._model={[a_.signal]:{},[a_.data]:{},[a_.mark]:{}},this._compileChart=null,this.handleStageRender=()=>{var t,e;null===(e=null===(t=this._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(zd.afterRender,{chart:this._compileChart})},this._container=t,this._option=e}getRenderer(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}getCanvas(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}getStage(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}initView(){var t,e,i,s;if(this._released)return;if(this.isInited=!0,this._view)return;const n=new g(null!==(t=this._option.logLevel)&&void 0!==t?t:u.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&n.addErrorHandler(((...t)=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.onError)||void 0===i||i.call(e,...t)})),this._view=new r_(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(i=this._container.dom)&&void 0!==i?i:null,renderCanvas:null!==(s=this._container.canvas)&&void 0!==s?s:null,hooks:this._option.performanceHook},this._option),{mode:o_(this._option.mode),autoFit:!1,eventConfig:{gesture:fl(this._option.mode),disable:!1===this._option.interactive},doLayout:()=>{var t;null===(t=this._compileChart)||void 0===t||t.onLayout(this._view)},logger:n,logLevel:n.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((t=>{var e;null===(e=this._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}_setCanvasStyle(){if(this._view&&this._container.dom&&!S(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";const t=this.getCanvas();t&&(t.style.display="block")}}compileInteractions(){var t;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){const t={};this._interactions.forEach((e=>{var i;if(e.regionId){const s=`${e.regionId}-${e.type}-${null!==(i=e.id)&&void 0!==i?i:""}`,n=t[s];t[s]=n?Object.assign(Object.assign(Object.assign({},n),e),{selector:[...n.selector,...e.selector]}):e}else this._view.interaction(e.type,e)})),Object.keys(t).forEach((e=>{const i=this._view.interaction(t[e].type,t[e]);if(this._compileChart){const s=this._compileChart.getRegionsInIds([t[e].regionId])[0];s&&s.interaction.addVgrammarInteraction(i.getStartState(),i)}}))}}compile(t,e){if(this._released)return;const{chart:i}=t;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend(),this.compileInteractions())}clearNextRender(){return!!this._nextRafId&&($o.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,!0)}clear(t,e=!1){const{chart:i}=t;this.clearNextRender(),i.clear(),this.releaseGrammar(e)}renderNextTick(t){this._released||this._nextRafId||(this._nextRafId=$o.getRequestAnimationFrame()((()=>{this._nextRafId=null,this.render(t)})))}render(t){var e,i;this._released||(this.initView(),this._view&&(null===(e=this._view)||void 0===e||e.run(t),this.clearNextRender()&&(null===(i=this._view)||void 0===i||i.run(t))))}updateViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}resize(t,e,i=!0){this._view&&(this._width=t,this._height=e,this._view.resize(t,e),i&&this.render({morph:!1}))}setBackground(t){var e;null===(e=this._view)||void 0===e||e.background(t)}setSize(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}setViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}addEventListener(t,e,i){var s,n;if(!1!==this._option.interactive)if(t===Nd.chart){const n=function(s,n){var r,a,o;const l=null!==(a=null===(r=null==n?void 0:n.mark)||void 0===r?void 0:r.getContext())&&void 0!==a?a:{},h=M(l.modelId)?l.modelId:null,d=M(l.markId)?l.markId:null,c=M(l.modelUserId)?l.modelUserId:null,u=M(l.markUserId)?l.markUserId:null,p={event:s,type:e,source:t,item:n,datum:(null===(o=null==n?void 0:n.getDatum)||void 0===o?void 0:o.call(n))||null,markId:d,modelId:h,markUserId:u,modelUserId:c};i.call(null,p)}.bind(this);this._viewListeners.set(i,{type:e,callback:n}),null===(s=this._view)||void 0===s||s.addEventListener(e,n)}else if(t===Nd.window){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._windowListeners.set(i,{type:e,callback:s});const n=this._getGlobalThis();null==n||n.addEventListener(e,s)}else if(t===Nd.canvas){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._canvasListeners.set(i,{type:e,callback:s});const r=null===(n=this.getStage())||void 0===n?void 0:n.window;null==r||r.addEventListener(e,s)}}removeEventListener(t,e,i){var s,n,r,a,o;if(!1!==this._option.interactive)if(t===Nd.chart){const t=null===(s=this._viewListeners.get(i))||void 0===s?void 0:s.callback;t&&(null===(n=this._view)||void 0===n||n.removeEventListener(e,t)),this._viewListeners.delete(i)}else if(t===Nd.window){const t=this._getGlobalThis(),s=null===(r=this._windowListeners.get(i))||void 0===r?void 0:r.callback;s&&(null==t||t.removeEventListener(e,s)),this._windowListeners.delete(i)}else if(t===Nd.canvas){const t=null===(a=this.getStage())||void 0===a?void 0:a.window,s=null===(o=this._canvasListeners.get(i))||void 0===o?void 0:o.callback;t&&s&&(null==t||t.removeEventListener(e,s)),this._canvasListeners.delete(i)}}releaseEvent(){const t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}release(){var t;this.clearNextRender(),this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}releaseGrammar(t=!1){var e,i;this._releaseModel(),t&&(null===(e=this._view)||void 0===e||e.removeAllGraphicItems()),null===(i=this._view)||void 0===i||i.removeAllGrammars()}_releaseModel(){Object.keys(this._model).forEach((t=>{Object.values(this._model[t]).forEach((t=>{Object.values(t).forEach((t=>{t.removeProduct(!0)}))})),this._model[t]={}}))}addGrammarItem(t){const e=t.getProduct();if(D(e))return;const i=e.id(),s=t.grammarType;D(this._model[s][i])&&(this._model[s][i]={}),this._model[s][i][t.id]=t}removeGrammarItem(t,e){var i;const s=t.getProduct();if(D(s))return;const n=s.id(),r=t.grammarType,a=this._model[r][n];M(a)&&(delete a[t.id],0===Object.keys(a).length&&delete this._model[r][n]),e||null===(i=this._view)||void 0===i||i.removeGrammar(s)}addInteraction(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}removeInteraction(t){this._interactions&&(this._interactions=this._interactions.filter((e=>e.seriesId!==t)))}updateDepend(t){return M(t)&&t.length>0?t.every((t=>t.updateDepend())):(Object.values(this._model).forEach((t=>{Object.values(t).forEach((t=>{const e=Object.values(t),i=e[0].getProduct(),s=e.reduce(((t,e)=>e.getDepend().length>0?t.concat(e.getDepend()):t),[]).filter((t=>!!t)).map((t=>t.getProduct()));i.depend(s)}))})),!0)}_getGlobalThis(){var t;return _l(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}function h_(t,e){var i,s,n,r,a;return s=this,n=void 0,a=function*(){if(!t)return"";try{if(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)return function(t){return new Promise((e=>{t.convertToBlob().then((t=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>{e(i.result)}}))}))}(t)}catch(t){(null!==(i=null==e?void 0:e.onError)&&void 0!==i?i:bl)(`getCanvasDataURL error : ${t.toString()}`)}return t.toDataURL()},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function o(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(t){t(s)}))).then(i,o)}l((a=a.apply(s,n||[])).next())}))}const d_={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},c_={poptip:E({},d_)};function u_(){u_.__loaded||(u_.__loaded=!0,ca.RegisterGraphicCreator("group",or))}u_.__loaded=!1;const p_=u_;class g_{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,s,n,r,a,o,l){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===s||"start"===s||("center"===s?c[0]=d[0]/-2:"right"!==s&&"end"!==s||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,s,n,r)}GetLayoutByLines(t,e,i,s,n="",r,a,o="end"){t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,s=t.length;iMath.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,l,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{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(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=tr,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return y(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return bs(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new __({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:n,y:r}=e,a={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},o=Wt(a,i,{x:n,y:r});return this._OBBBounds.copy(s),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=Si.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;return o&&(Dn(n,o/Math.abs(r+a),!0,l),i.union(n)),Si.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Si.graphicService.updateHTMLTextAABBBounds(t,e,i),Xt(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:m=r.fontWeight,ignoreBuf:_=r.ignoreBuf,suffixPosition:f=r.suffixPosition,heightLimit:v=0,lineClamp:b}=this.attribute,x=null!==(e=xn(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,S=_?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.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 M=Si.graphicUtil.textMeasure,k=new g_(a,{fontSize:h,fontWeight:m,fontFamily:a},M),A=y(t)?t.map((t=>t.toString())):[t.toString()],w=[],T=[0,0];let L=1/0;if(v>0&&(L=Math.max(Math.floor(v/x),1)),b&&(L=Math.min(L,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let s=0,n=A.length;s{const e=t.direction===Rn.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:p,fontFamily:g});a+=e,t.width=e})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const M=oa(b,a),k=la(x,y,u);return this._AABBBounds.set(k,M,k+y,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,fontWeight:d=s.fontWeight,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:p=s.stroke,lineWidth:g=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:_=s.suffixPosition}=r,f=null!==(e=xn(r.lineHeight,r.fontSize||s.fontSize))&&void 0!==e?e:r.fontSize||s.fontSize;if("normal"===m)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const v=Si.graphicUtil.textMeasure,y=new g_(a,{fontSize:h,fontWeight:d,fontFamily:a},v).GetLayoutByLines(t,o,l,f,!0===c?s.ellipsis:c||void 0,!1,u,_),{bbox:b}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),r=Si.graphicUtil.textMeasure;let a;const o=this.attribute,{ignoreBuf:l=n.ignoreBuf}=o,h=l?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:p=n.fontSize,fontWeight:g=n.fontWeight,stroke:m=n.stroke,lineWidth:_=n.lineWidth,verticalMode:f=n.verticalMode,suffixPosition:v=n.suffixPosition}=o,y=null!==(e=xn(o.lineHeight,o.fontSize||n.fontSize))&&void 0!==e?e:(o.fontSize||n.fontSize)+h;let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!f){const t=b;b=null!==(i=__.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(s=__.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=ut(e,a)}));const t=oa(b,a),e=this.cache.verticalList.length*y,i=la(x,e,p);return this._AABBBounds.set(i,t,i+e,t+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}const S=t.map((t=>Bn(t.toString())));S.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,s=r.clipTextWithSuffixVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,i,!1,v);S[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,!1);S[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Rn.HORIZONTAL?p:r.measureTextWidth(t.text,{fontSize:p,fontWeight:g,fontFamily:u});a+=e,t.width=e}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const M=oa(b,a),k=this.cache.verticalList.length*y,A=la(x,k,p);return this._AABBBounds.set(A,M,A+k,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}needUpdateTags(t,e=m_){return super.needUpdateTags(t,e)}needUpdateTag(t,e=m_){return super.needUpdateTag(t,e)}clone(){return new __(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return __.NOWORK_ANIMATE_ATTR}}function f_(t){return new __(t)}let v_,y_;function b_(t){return v_||(v_=ca.CreateGraphic("text",{})),v_.initAttributes(t),v_.AABBBounds}__.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Cn),__.baselineMapAlign={top:"left",bottom:"right",middle:"center"},__.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const x_=new class extends yo{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){var u,p,g,m,_,f,v,y,b,x;const{backgroundMode:S=l.backgroundMode,backgroundFit:M=l.backgroundFit}=t.attribute;let k,{background:A}=t.attribute;if(!A)return;const w=()=>{"richtext"===t.type&&(e.restore(),e.save(),k&&e.setTransformFromMatrix(k,!0,1))};let T;"richtext"===t.type&&(k=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const L=As(A)&&A.background,C=t.transMatrix.onlyTranslate();if(L){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(p=A.dx)&&void 0!==p?p:0),s=(null!==(g=A.y)&&void 0!==g?g:e.y1)+(null!==(m=A.dy)&&void 0!==m?m:0),n=null!==(_=A.width)&&void 0!==_?_:e.width(),r=null!==(f=A.height)&&void 0!==f?f:e.height();if(T=ja.allocate(i,s,i+n,s+r),A=A.background,!C){const t=T.width(),e=T.height();T.set((null!==(v=A.x)&&void 0!==v?v:0)+(null!==(y=A.dx)&&void 0!==y?y:0),(null!==(b=A.y)&&void 0!==b?b:0)+(null!==(x=A.dy)&&void 0!==x?x:0),t,e)}}else T=t.AABBBounds,C||(T=b_(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 n=t.resources.get(A);if("success"!==n.state||!n.data)return void w();e.highPerformanceSave(),C&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,T,S,M),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=A,n?(qa(e,T.x1,T.y1,T.width(),T.height(),n),e.fill()):e.fillRect(T.x1,T.y1,T.width(),T.height()),e.highPerformanceRestore()}L&&ja.free(T),w()}};var S_=function(t,e){return function(i,s){e(i,s,t)}};let M_=class extends wo{constructor(t){super(),this.textRenderContribitions=t,this.numberType=tr,this.builtinContributions=[x_],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=bs(t,null==r?void 0:r.theme).text,{text:u,underline:p=c.underline,lineThrough:g=c.lineThrough,keepDirIn3d:m=c.keepDirIn3d,direction:_=c.direction,fontSize:f=c.fontSize,verticalMode:v=c.verticalMode,x:y=c.x,y:b=c.y}=t.attribute;let{textAlign:x=c.textAlign,textBaseline:S=c.textBaseline}=t.attribute;if(!v&&"vertical"===_){const e=x;x=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const M=null!==(d=xn(t.attribute.lineHeight,f))&&void 0!==d?d:f,k=this.valid(t,c,a,o);if(!k)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:L}=k,C=!m,E=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,T,L,A,w,c,n,a,o),C&&this.transformUseContext2d(t,c,E,e);const D=(n,r,l,h)=>{let d=i+r;const u=s+l;if(h){e.highPerformanceSave(),d+=f;const t=qr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),qr.free(t)}L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),e.strokeText(n,d,u,E))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),e.fillText(n,d,u,E),this.drawUnderLine(p,g,t,d,u,E,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,E),"horizontal"===_){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,E)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((n=>{var a;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,E),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s-(a=f,"top"=="bottom"?Math.ceil(.79*a):Math.round(-.21*a))-.05*f,E,c,e,{width:n.width})}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:s}=i;e.textAlign="left",e.textBaseline="top";const n=M*s.length;let r=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=ut(e,r)}));let a=0,o=0;"bottom"===S?o=-n:"middle"===S&&(o=-n/2),"center"===x?a-=r/2:"right"===x&&(a-=r),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=r-i;let l=a;"center"===x?l+=s/2:"right"===x&&(l+=s),t.forEach((t=>{const{text:i,width:s,direction:r}=t;D(i,n-(e+1)*M+o,l,r),l+=s}))}))}else if("horizontal"===_){e.setTextStyle(t.attribute,c,E);const i=t.clipedText;let s=0;M!==f&&("top"===S?s=(M-f)/2:"middle"===S||"bottom"===S&&(s=-(M-f)/2)),D(i,0,s,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,E);const{verticalList:s}=i;let n=0;const r=s[0].reduce(((t,e)=>t+(e.width||0)),0);let a=0;"bottom"===S?a=-M:"middle"===S&&(a=-M/2),"center"===x?n-=r/2:"right"===x&&(n-=r),e.textAlign="left",e.textBaseline="top",s[0].forEach((t=>{const{text:e,width:i,direction:s}=t;D(e,a,n,s),n+=i}))}}C&&this.restoreTransformUseContext2d(t,c,E,e),this.afterRenderStep(t,e,i,s,T,L,A,w,c,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:d=a.textBaseline,fontSize:c=a.fontSize,fill:u=a.fill,opacity:p=a.opacity,underlineOffset:g=a.underlineOffset,underlineDash:m=a.underlineDash,fillOpacity:_=a.fillOpacity}=i.attribute,f=!D(l),v=f?l.width:i.clipedWidth,y=f?0:oa(h,v),b=la(f?"alphabetic":d,c,c),x={lineWidth:0,stroke:u,opacity:p,strokeOpacity:_};let S=f?-3:0;if(t){x.lineWidth=t,o.setStrokeStyle(i,x,s,n,a),m&&o.setLineDash(m),o.beginPath();const e=n+b+c+g+S;o.moveTo(s+y,e,r),o.lineTo(s+y+v,e,r),o.stroke()}if(f&&(S=-1),e){x.lineWidth=e,o.setStrokeStyle(i,x,s,n,a),o.beginPath();const t=n+b+c/2+S;o.moveTo(s+y,t,r),o.lineTo(s+y+v,t,r),o.stroke()}}};M_=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}([V(),S_(0,$(K)),S_(0,X(_o)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],M_);let k_=!1;const A_=new I((t=>{k_||(k_=!0,t(Dr).to(M_).inSingletonScope(),t(Mr).toService(Dr),t(_o).toService(xo),Z(t,_o))})),w_=pl(),T_=Symbol.for("MathPickerContribution"),L_=Symbol.for("MathArcPicker"),C_=Symbol.for("MathAreaPicker"),E_=Symbol.for("MathCirclePicker"),D_=Symbol.for("MathImagePicker"),O_=Symbol.for("MathLinePicker"),P_=Symbol.for("MathPathPicker"),R_=Symbol.for("MathRectPicker"),B_=Symbol.for("MathSymbolPicker"),I_=Symbol.for("MathTextPicker"),F_=Symbol.for("MathPolygonPicker"),Y_=Symbol.for("MathGlyphPicker"),j_=Symbol.for("CanvasArcPicker"),H_=Symbol.for("CanvasArc3dPicker"),z_=Symbol.for("CanvasAreaPicker"),N_=Symbol.for("CanvasCirclePicker"),V_=Symbol.for("CanvasImagePicker"),W_=Symbol.for("CanvasLinePicker"),G_=Symbol.for("CanvasPathPicker"),U_=Symbol.for("CanvasRectPicker"),$_=Symbol.for("CanvasRect3dPicker"),X_=Symbol.for("CanvasSymbolPicker"),K_=Symbol.for("CanvasTextPicker"),q_=Symbol.for("CanvasPolygonPicker"),Z_=Symbol.for("CanvasPyramid3dPicker"),J_=Symbol.for("CanvasRichTextPicker"),Q_=Symbol.for("CanvasGlyphPicker"),tf=Symbol.for("CanvasGroupPicker"),ef=Symbol.for("CanvasPickerContribution");class sf extends wo{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 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=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zr.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let nf=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=tr}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:d,z:c,lastModelMatrix:u}=l;this.canvasRenderer.z=c;let p=e;if(s.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,s,h,d,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),m=l.width(),_=la(a,u,n),f=oa(o,m);return e.rect(f+h,_+d,m,u,c),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==u&&Zr.free(s.modelMatrix),s.modelMatrix=u,s.highPerformanceRestore(),g}};nf=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Dr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],nf);let rf=!1;const af=new I(((t,e,i,s)=>{rf||(rf=!0,t(K_).to(nf).inSingletonScope(),t(ef).toService(K_))}));let of=class{constructor(){this.type="text",this.numberType=tr}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};of=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}([V()],of);let lf=!1;const hf=new I(((t,e,i,s)=>{lf||(lf=!0,t(I_).to(of).inSingletonScope(),t(T_).toService(I_))}));function df(){df.__loaded||(df.__loaded=!0,ca.RegisterGraphicCreator("text",f_),Xi.load(A_),Xi.load(w_?af:hf))}df.__loaded=!1;const cf=df;class uf{bounds(t,e){if(h(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}}function pf(t,e,i,s,n){return n?t.arc(i,s,e,0,ot,!1,n):t.arc(i,s,e,0,ot),!1}const gf=new class extends uf{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 pf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return pf(t,e/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=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`}},mf=new class extends uf{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,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,e/6,i,s,n,r)}};function _f(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}const ff=new class extends uf{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 _f(t,e/2,i,s,n)}drawFitDir(t,e,i,s,n){return _f(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return _f(t,e/2+n,i,s,r)}};function vf(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}const yf=new class extends uf{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return vf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return vf(t,e/2+n,i,s)}};function bf(t,e,i,s,n=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 xf extends uf{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 bf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return bf(t,e/2,i,s,n)}}const Sf=new xf,Mf=new class extends xf{constructor(){super(...arguments),this.type="triangle"}},kf=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Af=Math.sin(ot/10)*kf,wf=-Math.cos(ot/10)*kf;function Tf(t,e,i,s){const n=Af*e,r=wf*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=ot*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}const Lf=new class extends uf{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 Tf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Tf(t,e/2+n,i,s)}},Cf=mt(3);function Ef(t,e,i,s){const n=e,r=n/Cf,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}const Df=new class extends uf{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 Ef(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Ef(t,e/2+n,i,s)}};function Of(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}const Pf=new class extends uf{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Of(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Of(t,e/2+n,i,s)}};function Rf(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}const Bf=new class extends uf{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Rf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Rf(t,e/2+n,i,s)}},If=-.5,Ff=mt(3)/2,Yf=1/mt(12);function jf(t,e,i,s){const n=e/2,r=e*Yf,a=n,o=e*Yf+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(If*n-Ff*r+i,Ff*n+If*r+s),t.lineTo(If*a-Ff*o+i,Ff*a+If*o+s),t.lineTo(If*l-Ff*h+i,Ff*l+If*h+s),t.lineTo(If*n+Ff*r+i,If*r-Ff*n+s),t.lineTo(If*a+Ff*o+i,If*o-Ff*a+s),t.lineTo(If*l+Ff*h+i,If*h-Ff*l+s),t.closePath(),!1}const Hf=new class extends uf{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 jf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return jf(t,e/2+n,i,s)}};function zf(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}const Nf=new class extends uf{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 zf(t,e/2,i,s,0)}drawOffset(t,e,i,s,n){return zf(t,e/2,i,s,n)}};function Vf(t,e,i,s,n=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}const Wf=new class extends uf{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 Vf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Vf(t,e/2,i,s,n)}};function Gf(t,e,i,s,n=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}const Uf=new class extends uf{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 Gf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Gf(t,e/2,i,s,n)}},$f=mt(3);function Xf(t,e,i,s){const n=e*$f;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}const Kf=new class extends uf{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Xf(t,e/2/$f,i,s)}drawOffset(t,e,i,s,n){return Xf(t,e/2/$f+n,i,s)}};function qf(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}const Zf=new class extends uf{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 qf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return qf(t,e/4+n,i,s)}};function Jf(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}const Qf=new class extends uf{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 Jf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Jf(t,e/4+n,i,s)}};function tv(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}const ev=new class extends uf{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 tv(t,e/4,i,s)}drawOffset(t,e,i,s,n){return tv(t,e/4+n,i,s)}};function iv(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}const sv=new class extends uf{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 iv(t,e/4,i,s)}drawOffset(t,e,i,s,n){return iv(t,e/4+n,i,s)}};function nv(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}const rv=new class extends uf{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return nv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return nv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function av(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}const ov=new class extends uf{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return av(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return av(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function lv(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}const hv=new class extends uf{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 lv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return lv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function dv(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function cv(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}const uv=new class extends uf{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return h(e)?cv(t,e,i,s):dv(t,e,i,s)}drawOffset(t,e,i,s,n){return h(e)?cv(t,e+2*n,i,s):dv(t,[e[0]+2*n,e[1]+2*n],i,s)}},pv={};[gf,mf,ff,yf,Kf,Mf,Lf,Df,Pf,Bf,Hf,Nf,Wf,Sf,Uf,Zf,Qf,ev,sv,uv,rv,ov,hv].forEach((t=>{pv[t.type]=t}));const gv={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"},mv=new qt;class _v{constructor(t,e,i=!1){this.pathStr="",this.type=t,y(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),ye(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(ye(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return this.drawOffset(t,e,i,s,0,n,r)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{mv.x1=i.bounds.x1*t,mv.y1=i.bounds.y1*t,mv.x2=i.bounds.x2*t,mv.y2=i.bounds.y2*t,e.union(mv)}))}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)}}class fv{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 vv(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function yv(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r",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=yv(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=vv(t,"--\x3e",r+4,"Comment is not closed.");else{const a=yv(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,d=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 fv(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 fv(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=d}else s+=t[r];return e.child}}function Sv(t,e){return Mv(t)}function Mv(t,e){const i={};for(let n=0;n{const e=(new Ze).fromString(t.d),i={};nr.forEach((e=>{t[e]&&(i[sr[e]]=t[e])})),n.push({path:e,attribute:i}),Tv.union(e.bounds)}));const r=Tv.width(),a=Tv.height(),o=1/ut(r,a);return n.forEach((t=>t.path.transform(0,0,o,o))),this._parsedPath=new _v(e,n,!0),Cv.userSymbolMap[e]=this._parsedPath,this._parsedPath}var s;const n=(new Ze).fromString(e),r=n.bounds.width(),a=n.bounds.height(),o=1/ut(r,a);return n.transform(0,0,o,o),this._parsedPath=new _v(e,n),Cv.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return bs(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}=Si.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;Dn(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 Si.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(y(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Lv)}needUpdateTag(t){return super.needUpdateTag(t,Lv)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=y(e)?e:[e,e];return t.path?(new Ze).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ze).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new Cv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cv.NOWORK_ANIMATE_ATTR}}function Ev(t){return new Cv(t)}Cv.userSymbolMap={},Cv.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Cn);const Dv=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,m=p&&!1!==p.visible,_=g&&!1!==g.visible;if(!m&&!_)return;const{size:f=l.size,opacity:v=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY}=t.attribute,M=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Fa(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,f,i,s,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(y-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};m&&M(p,"outerBorder"),_&&M(g,"innerBorder")}},Ov=Bo,Pv=bo;var Rv=function(t,e){return function(i,s){e(i,s,t)}};let Bv=class extends wo{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Qn,this.builtinContributions=[Dv,Pv,Ov],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=bs(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY,fillStrokeOrder:m=h.fillStrokeOrder}=t.attribute,_=this.valid(t,h,a,o);if(!_)return;const{fVisible:f,sVisible:v,doFill:b,doStroke:x}=_,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:M=h.keepDirIn3d}=t.attribute,k=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const A=(n,r)=>{var l,d,_;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(_=r.stroke)&&void 0!==_?_:t.attribute.stroke,r=e}const f=()=>{r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-s,h),e.fill()))},v=()=>{r.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/p,(u-s)/g,h),e.stroke()))};m?(v(),f()):(f(),v())};if(M&&e.camera&&e.project){const t=e.project(i,s,k),n=e.camera;e.camera=null,!1===S.draw(e,y(d)?[d[0]*p,d[1]*g]:d*p,t.x,t.y,void 0,A)&&e.closePath(),e.camera=n}else!1===S.draw(e,d,i,s,k,A)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,b,x,f,v,h,n,a,o);const w=()=>{b&&!S.isSvg&&(a?a(e,t.attribute,h):f&&(e.setCommonStyle(t,t.attribute,c-i,u-s,h),e.fill()))},T=()=>{x&&!S.isSvg&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,(c-i)/p,(u-s)/g,h),e.stroke()))};m?(T(),w()):(w(),T()),this.afterRenderStep(t,e,i,s,b,x,f,v,h,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Bv=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}([V(),Rv(0,$(K)),Rv(0,X(mo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Bv);let Iv=!1;const Fv=new I((t=>{Iv||(Iv=!0,t(Bv).toSelf().inSingletonScope(),t(Er).to(Bv).inSingletonScope(),t(Mr).toService(Er),t(mo).toService(xo),Z(t,mo))}));let Yv=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Qn}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:d}=a;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=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Fa(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==d&&Zr.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),u}};Yv=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Er)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yv);let jv=!1;const Hv=new I(((t,e,i,s)=>{jv||(jv=!0,t(X_).to(Yv).inSingletonScope(),t(ef).toService(X_))}));class zv{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;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;return s.lineWidth=Fa(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}let Nv=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Qn}};Nv=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Er)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Nv);let Vv=!1;const Wv=new I(((t,e,i,s)=>{Vv||(Vv=!0,t(B_).to(Nv).inSingletonScope(),t(T_).toService(B_))}));function Gv(){Gv.__loaded||(Gv.__loaded=!0,ca.RegisterGraphicCreator("symbol",Ev),Xi.load(Fv),Xi.load(w_?Hv:Wv))}Gv.__loaded=!1;const Uv=Gv,$v=(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)}return i},Xv=["width","x1","y1","height","cornerRadius",...kn];class Kv extends En{constructor(t){super(t),this.type="rect",this.numberType=qn}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return bs(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Xv)}needUpdateTag(t){return super.needUpdateTag(t,Xv)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=D(t.width)?t.x1-t.x:t.width,i=D(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),r=new Ze;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Kv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kv.NOWORK_ANIMATE_ATTR}}function qv(t){return new Kv(t)}Kv.NOWORK_ANIMATE_ATTR=Cn;var Zv=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};class Jv{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{cornerRadius:_=l.cornerRadius,opacity:f=l.opacity,x:v=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY,x1:M,y1:k}=t.attribute;let{width:A,height:w}=t.attribute;A=(null!=A?A:M-i)||0,w=(null!=w?w:k-s)||0;const T=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,d=Fa(e,h,e.dpr),u=i+o*d,p=s+o*d,g=2*d;if(0===_||y(_)&&_.every((t=>0===t))?(e.beginPath(),e.rect(u,p,A-o*g,w-o*g)):(e.beginPath(),qa(e,u,p,A-o*g,w-o*g,_)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=f,e.setStrokeStyle(t,n,(v-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder")}}let Qv=class{constructor(){this.time=me.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Qv=Zv([V()],Qv);let ty=class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{x1:u,y1:p,x:g=l.x,y:m=l.y,stroke:_=l.stroke,cornerRadius:f=l.cornerRadius}=t.attribute;let{width:v,height:b}=t.attribute;if(v=(null!=v?v:u-g)||0,b=(null!=b?b:p-m)||0,Array.isArray(_)&&_.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===f||y(f)&&f.every((t=>0===t)))){let n,r=0;return qa(e,i,s,v,b,f,new Array(4).fill(0).map(((a,o)=>(a,h,d,c)=>{_[o]&&(r===o-1&&_[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:_[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=_[o]),r=o,e.lineTo(d,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),_[0]?e.lineTo(i+v,s):e.moveTo(i+v,s),_[1]?e.lineTo(i+v,s+b):e.moveTo(i+v,s+b),_[2]?e.lineTo(i,s+b):e.moveTo(i,s+b),_[3]){const t=_[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};ty=Zv([V()],ty);const ey=new Jv,iy=Bo,sy=bo;var ny=function(t,e){return function(i,s){e(i,s,t)}};let ry=class extends wo{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=qn,this.builtinContributions=[ey,sy,iy],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:bs(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:_=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:v=h.visible,x1:b,y1:x,x:S=h.x,y:M=h.y,fillStrokeOrder:k=h.fillStrokeOrder}=t.attribute;let{width:A,height:w}=t.attribute;A=(null!=A?A:b-S)||0,w=(null!=w?w:x-M)||0;const T=to(g,m,A,w,d),L=io(g,f,A,w),C=Za(d,c),E=Ja(u,_);if(!t.valid||!v)return;if(!C&&!E)return;if(!(T||L||a||o||c))return;0===p||y(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,s,A,w)):(e.beginPath(),qa(e,i,s,A,w,p));const D={doFill:C,doStroke:E};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,C,E,T,L,h,n,a,o,D);const O=()=>{D.doFill&&(a?a(e,t.attribute,h):T&&(e.setCommonStyle(t,t.attribute,S-i,M-s,h),e.fill()))},P=()=>{D.doStroke&&(o?o(e,t.attribute,h):L&&(e.setStrokeStyle(t,t.attribute,S-i,M-s,h),e.stroke()))};k?(P(),O()):(O(),P()),this.afterRenderStep(t,e,i,s,C,E,T,L,h,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};ry=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}([V(),ny(0,$(K)),ny(0,X(go)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ry);let ay=!1;const oy=new I((t=>{ay||(ay=!0,t(ry).toSelf().inSingletonScope(),t(Lr).to(ry).inSingletonScope(),t(Mr).toService(Lr),t(ty).toSelf(),t(Qv).toSelf(),t(go).toService(ty),t(go).toService(Qv),t(go).toService(xo),Z(t,go))})),ly=new qt;class hy{constructor(){this.type="rect",this.numberType=qn}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;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let d=!0;if(!l||t.shadowRoot||h(r,!0)&&0!==r||y(r)&&r.some((t=>0!==t)))d=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!d||(d=t.isPointInPath(e.x,e.y),d)),((t,i,n)=>{if(d)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=Fa(s,r+a,s.dpr),d=t.isPointInStroke(e.x,e.y),d}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)d=!0;else if(s){const i=t.AABBBounds;ly.setValue(i.x1,i.y1,i.x2,i.y2),ly.expand(-r/2),d=!ly.containsPoint(e)}}return s.highPerformanceRestore(),d}}let dy=class extends hy{constructor(t){super(),this.canvasRenderer=t}};dy=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Lr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],dy);let cy=!1;const uy=new I(((t,e,i,s)=>{cy||(cy=!0,t(U_).to(dy).inSingletonScope(),t(ef).toService(U_))}));let py=class extends hy{constructor(t){super(),this.canvasRenderer=t}};py=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Lr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],py);let gy=!1;const my=new I(((t,e,i,s)=>{gy||(gy=!0,t(R_).to(py).inSingletonScope(),t(T_).toService(R_))}));function _y(){_y.__loaded||(_y.__loaded=!0,ca.RegisterGraphicCreator("rect",qv),Xi.load(oy),Xi.load(w_?uy:my))}_y.__loaded=!1;const fy=_y;function vy(t){t.crosshair=Na(t.crosshair||{}).map((e=>Pl({["horizontal"===t.direction?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},e)))}function yy(t,e,i){var s;const{width:n,height:r}=t;if(M(n)&&M(r))return{width:n,height:r};let a=i.width,o=i.height;const l=e.container,h=e.canvas;if(l){const{width:t,height:e}=ra(l,i.width,i.height);a=t,o=e}else if(h&&_l(e.mode)){let t;t=S(h)?$o.getElementById(h):h;const{width:e,height:s}=ra(t,i.width,i.height);a=e,o=s}else if(vl(e.mode)&&(null===(s=e.modeParams)||void 0===s?void 0:s.domref)){const t=e.modeParams.domref;a=t.width,o=t.height}return a=null!=n?n:a,o=null!=r?r:o,{width:a,height:o}}function by(t,...e){const i=i=>e.reduce(((t,e)=>t||(null==e?void 0:e[i])),t[i]);return Object.assign(t,{change:i("change"),reCompile:i("reCompile"),reMake:i("reMake"),reRender:i("reRender"),reSize:i("reSize"),reTransformSpec:i("reTransformSpec"),changeTheme:i("changeTheme"),changeBackground:i("changeBackground")}),t}function xy(t,e){return"line"===t||"area"===t||"common"===t&&e.series.every((t=>"area"===t.type||"line"===t.type))?{paddingInner:1,paddingOuter:0}:{paddingOuter:0}}var Sy,My,ky;(ky=Sy||(Sy={})).STATE_NORMAL="normal",ky.STATE_HOVER="hover",ky.STATE_HOVER_REVERSE="hover_reverse",ky.STATE_DIMENSION_HOVER="dimension_hover",ky.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",ky.STATE_SELECTED="selected",ky.STATE_SELECTED_REVERSE="selected_reverse",ky.STATE_SANKEY_EMPHASIS="selected",ky.STATE_SANKEY_EMPHASIS_REVERSE="blur",function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(My||(My={}));class Ay{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){D(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,E({},Ay.defaultMarkInfo,e)))}removeMark(t){const e=this._children.findIndex((e=>e.name===t));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}clear(){this._children=[],this._markNameMap={},this._infoMap.clear()}forEach(t){this._children.forEach(t)}includes(t,e){return this._children.includes(t,e)}get(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}getMarks(){return this._children.slice()}getMarksInType(t){const e=Na(t);return this._children.filter((t=>e.includes(t.type)))}getMarkInId(t){return this._children.find((e=>e.id===t))}getMarkWithInfo(t){return this._children.find((e=>Object.keys(t).every((i=>t[i]===this._infoMap.get(e)[i]))))}}Ay.defaultMarkInfo={};class wy{get hover(){return this._hover}get select(){return this._select}constructor(t){this._marks=new Ay,this._markReverse=new Ay,this.onHover=t=>{switch(t.action){case"enter":this.interaction.getEventElement(Sy.STATE_DIMENSION_HOVER).forEach((t=>this.interaction.addEventElement(Sy.STATE_DIMENSION_HOVER_REVERSE,t))),this.interaction.clearEventElement(Sy.STATE_DIMENSION_HOVER,!1),this.getEventElement(t).forEach((t=>this.interaction.addEventElement(Sy.STATE_DIMENSION_HOVER,t))),this.interaction.reverseEventElement(Sy.STATE_DIMENSION_HOVER);break;case"leave":this.interaction.clearEventElement(Sy.STATE_DIMENSION_HOVER,!0),t=null}},this._option=t,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=t.interaction,this.initConfig(t.mode)}setStateKeys(t){}registerMark(t){jm(t.stateStyle[Sy.STATE_DIMENSION_HOVER])||this._marks.addMark(t),jm(t.stateStyle[Sy.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}init(){this.initEvent()}release(){this.releaseEvent()}initEvent(){this.event.on(td.dimensionHover,this.onHover)}releaseEvent(){this.event.release()}initConfig(t){}getEventElement(t,e=!1){const i=[];return t.dimensionInfo.forEach((t=>{t.data.forEach((t=>{(e?this._markReverse:this._marks).getMarks().filter((e=>e.model===t.series&&e.getVisible())).forEach((s=>{const n=s.getProduct();if(!n||!n.elements)return;const r=n.elements.filter((i=>{const s=i.getDatum();let n;return n=y(s)?s.every(((e,i)=>e===t.datum[i])):t.datum.some((t=>t===s)),e?!n:n}));i.push(...r)}))}))})),i}}const Ty={};Object.values(Sy).forEach((t=>{Ty[t]=!0}));const Ly={[Sy.STATE_HOVER]:Sy.STATE_HOVER_REVERSE,[Sy.STATE_SELECTED]:Sy.STATE_SELECTED_REVERSE,[Sy.STATE_DIMENSION_HOVER]:Sy.STATE_DIMENSION_HOVER_REVERSE};function Cy(t){return Ly[t]}class Ey{constructor(){this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}addVgrammarInteraction(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}static markStateEnable(t,e){return!jm(t.stateStyle[e])}setDisableActiveEffect(t){this._disableTriggerEvent=t}registerMark(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(i=this._stateMarks.get(t))||void 0===i||i.push(e)}getStateMark(t){return this._stateMarks.get(t)}filterEventMark(t,e){var i;return!(!t.mark||!(null===(i=this._stateMarks.get(e))||void 0===i?void 0:i.includes(t.mark)))}getEventElement(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}getEventElementData(t){return this.getEventElement(t).map((t=>t.getDatum()))}exchangeEventElement(t,e){var i;if(this._disableTriggerEvent)return;const s=Cy(t);null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t),s&&this.addEventElement(s,e)})),e.getStates().includes(t)||(e.addState(t),s&&e.removeState(s)),this._stateElements.set(t,[e])}removeEventElement(t,e){var i,s;if(this._disableTriggerEvent)return;e.removeState(t);const n=null!==(s=null===(i=this._stateElements.get(t))||void 0===i?void 0:i.filter((t=>t!==e)))&&void 0!==s?s:[];this._stateElements.set(t,n);const r=Cy(t);r&&(0===n.length?this.clearEventElement(r,!1):this.addEventElement(r,e))}addEventElement(t,e){var i;if(this._disableTriggerEvent)return;e.getStates().includes(t)||e.addState(t);const s=null!==(i=this._stateElements.get(t))&&void 0!==i?i:[];s.push(e),this._stateElements.set(t,s)}clearEventElement(t,e){var i;if(!this._disableTriggerEvent&&(null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t)})),this._stateElements.set(t,[]),e)){const e=Cy(t);e&&this.clearEventElement(e,!1)}}clearAllEventElement(){if(!this._disableTriggerEvent)for(const[t,e]of this._stateElements)e.forEach((t=>{t.clearStates()})),this._stateElements.set(t,[])}reverseEventElement(t){if(this._disableTriggerEvent)return;const e=Cy(t);if(!e)return;const i=this.getStateMark(e);if(!i)return;const s=this.getEventElement(t);s.length&&(this.getEventElement(e).length||(1===s.length?i.forEach((t=>{t.getProduct().elements.filter((t=>t!==s[0])).forEach((t=>{this.addEventElement(e,t)}))})):i.forEach((t=>{t.getProduct().elements.filter((t=>!s.includes(t))).forEach((t=>{this.addEventElement(e,t)}))}))))}startInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.start(e)}))}resetInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.reset(e)}))}resetAllInteraction(){for(const[t,e]of this._vgrammarInteractions)e&&e.forEach((t=>{t.reset(null)}))}}var Dy,Oy,Py;!function(t){t[t.SeriesGroup=0]="SeriesGroup",t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(Dy||(Dy={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(Oy||(Oy={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.User_SeriesStyle=9]="User_SeriesStyle",t[t.Built_In=99]="Built_In"}(Py||(Py={}));class Ry{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getVGrammarView(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}release(){this._option=null,this.getCompiler=null}}class By extends Ry{constructor(){super(...arguments),this.id=el(),this._compiledProductId=null,this._depend=[]}getProduct(){if(M(this._product))return this._product;const t=this.getVGrammarView(),e=this.getProductId();return M(e)&&M(t)&&(this._product=this._lookupGrammar(e)),this._product}getProductId(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}getDepend(){return this._depend}setDepend(...t){this._depend=t}compile(t){this._compileProduct(t),this._afterCompile(t)}_afterCompile(t){var e;M(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}updateDepend(){if(M(this._product)){const t=this.getDepend().map((t=>t.getProduct())).filter(M);return this._product.depend(t),t.length===this.getDepend().length}return!1}release(){this.removeProduct(),super.release(),this._depend=[]}removeProduct(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}class Iy extends By{getValue(){return this._value}getUpdateFunc(){return this._updateFunc}constructor(t,e,i,s){super(t),this.grammarType=a_.signal,this.name=e,this._value=i,this._updateFunc=s}updateSignal(t,e){this._value=t,this._updateFunc=e,this.compile()}_compileProduct(){const t=this.getVGrammarView();if(t){if(!this.getProduct()){const e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}M(this._value)&&this._product.value(this._value),M(this._updateFunc)&&this._product.update(this._updateFunc)}}generateProductId(){return this.name}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}class Fy extends Ry{constructor(){super(...arguments),this._signalMap={}}getSignalMap(){return this._signalMap}getSignal(t){return this._signalMap[t]}updateSignal(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new Iy(this._option,t,e,i),this._signalMap[t].compile())}compile(){Object.values(this._signalMap).forEach((t=>{t.compile()}))}release(){super.release(),Object.values(this._signalMap).forEach((t=>{t.release()})),this._signalMap={}}}class Yy extends Fy{getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),t.stateKeyToSignalName?this.stateKeyToSignalName=t.stateKeyToSignalName:this.stateKeyToSignalName=()=>"state_signal",this.initStateMap()}initStateMap(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}compile(t){const e=null!=t?t:this._stateMap;Object.keys(e).forEach((t=>{const i=this.stateKeyToSignalName(t),s=e[t];this.updateSignal(i,s)}))}updateState(t,e){if(t&&(E(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}class jy extends Yy{constructor(){super(...arguments),this.id=el(),this.stateKeyToSignalName=t=>`${hh}_animate_${this.id}_${t}`}getAnimationStateSignalName(){return this.stateKeyToSignalName("animationState")}updateAnimateState(t,e){t===Np.update?this.updateState({animationState:{callback:(t,e)=>e.diffState}},e):t===Np.appear?this.updateState({animationState:{callback:(t,e)=>"exit"===e.diffState?Np.none:Np.appear}},e):this.updateState({animationState:{callback:(e,i)=>t}},e)}_getDefaultStateMap(){return{animationState:{callback:(t,e)=>"exit"===e.diffState?Np.exit:"update"===e.diffState?Np.update:Np.appear}}}}class Hy{constructor(t){this._option=t,this.type=t.type}_initTheme(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}getTheme(t,e){}transformSpec(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);const s=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(s.spec,e,i),s}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>Pl({},i,s,t);return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}const zy=(t,e,i)=>{if(D(e))return t;const s=e[0];return D(s)?t:1===e.length?(t[s]=i,t):(D(t[s])&&("number"==typeof e[1]?t[s]=[]:t[s]={}),zy(t[s],e.slice(1),i))};class Ny extends Ry{getSpec(){return this._spec||{}}getSpecPath(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}getSpecInfoPath(){var t,e,i;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(i=this._option)||void 0===i?void 0:i.specPath}getData(){return this._data}get layout(){return this._layout}getOption(){return this._option}getMarks(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}getMarkNameMap(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}getMarkSet(){return this._marks}getChart(){return this._option.getChart()}get _theme(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}constructor(t,e){var i;super(e),this.transformerConstructor=Hy,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this.specKey="",this._marks=new Ay,this._lastLayoutRect=null,this.id=el(),this.userId=t.id,this._spec=t,this.effect={},this.event=new Gd(e.eventDispatcher,e.mode),null===(i=e.map)||void 0===i||i.set(this.id,this)}_releaseEvent(){this.event.release()}created(){this.setAttrFromSpec()}init(t){}afterInit(){}getVisible(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}onLayoutStart(t,e,i){var s;null===(s=this._layout)||void 0===s||s.onLayoutStart(t,e,i)}onLayoutEnd(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((t=>t.updateLayoutState(!0,!0)))}onEvaluateEnd(t){}onDataUpdate(){}beforeRelease(){}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((t=>t.release())),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),super.release()}updateSpec(t){const e=this._compareSpec(t,this._spec);return this._spec=t,e}_compareSpec(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}reInit(t){t&&(this._spec=t),this.setAttrFromSpec()}updateLayoutAttribute(){}setAttrFromSpec(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,s){M(t)&&M(e)&&t.setStyle(this._convertMarkStyle(e),i,s)}initMarkStyleWithSpec(t,e,i){if(!M(t)||!M(e))return;const{style:s,state:n}=e,r=Object.assign({},e);s&&(r.style=this._convertMarkStyle(s)),n&&(r.state={},Object.keys(n).forEach((t=>{r.state[t]=this._convertMarkStyle(n[t])}))),t.initStyleWithSpec(r,i)}stateKeyToSignalName(t,e){let i=`${hh}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;null===(t=this._data)||void 0===t||t.compile()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t})}))}_createMark(t,e={},i){const{type:s,name:n}=t,r=Ql.createMark(s,n,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return r&&(r.created(),i&&r.setMarkConfig(i)),r}_getDataIdKey(){}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}getSpecInfo(){var t,e,i;return((t,e)=>{if(!D(e))return $d(t,e,void 0)})(null!==(i=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==i?i:{},this.getSpecInfoPath())}getSpecIndex(){const t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;const e=Number(t[t.length-1]);return isNaN(e)?0:e}}class Vy{getSpec(){return this._spec||{}}getLayoutStartPoint(){return this._layoutStartPoint}get layoutRectLevelMap(){return this._layoutRectLevelMap}get minWidth(){return this._minWidth}set minWidth(t){this._minWidth=t}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth=t}get minHeight(){return this._minHeight}set minHeight(t){this._minHeight=t}get maxHeight(){return this._maxHeight}set maxHeight(t){this._maxHeight=t}getLastComputeOutBounds(){return this._lastComputeOutBounds}get layoutOrient(){return this._layoutOrient}set layoutOrient(t){this._layoutOrient=t}get model(){return this._model}get type(){return this._model.type}constructor(t,e){var i;this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=()=>this._layoutRect,this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=Oy.Region,this._model=t,this._option=e,this.layoutLevel=e.layoutLevel,this.layoutType=e.layoutType,e.layoutOrient&&(this.layoutOrient=e.layoutOrient),this._spec=null===(i=null==t?void 0:t.getSpec)||void 0===i?void 0:i.call(t)}_setLayoutAttributeFromSpec(t,e){var i,s,n,r;if(this._spec&&!1!==this._spec.visible){const a=ll(hl(t.padding),e,e);this.layoutPaddingLeft=a.left,this.layoutPaddingRight=a.right,this.layoutPaddingTop=a.top,this.layoutPaddingBottom=a.bottom,this._minHeight=D(t.minHeight)?null!==(i=this._minHeight)&&void 0!==i?i:null:ol(t.minHeight,e.height,e),this._maxHeight=D(t.maxHeight)?null!==(s=this._maxHeight)&&void 0!==s?s:null:ol(t.maxHeight,e.height,e),this._minWidth=D(t.minWidth)?null!==(n=this._minWidth)&&void 0!==n?n:null:ol(t.minWidth,e.width,e),this._maxWidth=D(t.maxWidth)?null!==(r=this._maxWidth)&&void 0!==r?r:null:ol(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:ol(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:ol(t.height,e.height,e)},{height:9}),D(t.offsetX)||(this.layoutOffsetX=ol(t.offsetX,e.width,e)),D(t.offsetY)||(this.layoutOffsetY=ol(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,s,n,r;this._spec=t,this.layoutType=null!==(i=t.layoutType)&&void 0!==i?i:this.layoutType,this.layoutLevel=null!==(s=t.layoutLevel)&&void 0!==s?s:this.layoutLevel,this.layoutOrient=null!==(n=t.orient)&&void 0!==n?n:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(r=t.clip)&&void 0!==r?r:this.layoutClip}onLayoutStart(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(t){}_getAbsoluteSpecValue(t){const e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((i=>{D(this._spec[i])||(e[i]=ol(this._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))})),e}absoluteLayoutInRect(t){const{top:e,bottom:i,left:s,right:n}=this._getAbsoluteSpecValue(t),r={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};D(s)||(r.width-=s),D(n)||(r.width-=n),D(e)||(r.height-=e),D(i)||(r.height-=i),this.setLayoutRect(r);const{width:a,height:o}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:a,height:o});const l={x:t.x,y:t.y};!0===this._spec.center?(l.x=t.x+.5*t.width-.5*a,l.y=t.y+.5*t.height-.5*o):(D(s)?D(n)||(l.x=t.x+t.width-this.layoutPaddingRight-n-a):l.x=t.x+s+this.layoutPaddingLeft,D(e)?D(i)||(l.y=t.y+t.height-this.layoutPaddingBottom-i-o):l.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(l)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),il(t.x)&&(this._layoutStartPoint.x=t.x),il(t.y)&&(this._layoutStartPoint.y=t.y),null===(i=(e=this._model).afterSetLayoutStartPoint)||void 0===i||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var s,n,r,a;il(t)&&(null!==(s=null==i?void 0:i.width)&&void 0!==s?s:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0),il(e)&&(null!==(r=null==i?void 0:i.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=null!==(a=null==i?void 0:i.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}getLayout(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}mergeLayoutRect({width:t,height:e}){const i={width:t,height:e};return this._layoutRectLevelMap.width>0&&(i.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(i.height=this._layoutRect.height),i}getOrientPosAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}getOrientSizeAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}changeBoundsBySetting(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}setRectInSpec(t){const e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(D(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),D(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(D(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),D(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}computeBoundsInRect(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;const e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));let i=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}}class Wy extends Ny{constructor(){super(...arguments),this.layoutType="normal",this.layoutLevel=0,this.layoutZIndex=0,this._forceLayoutTag=!1,this._layout=null,this._orient=null,this._layoutRect={width:0,height:0},this._layoutStartPos={x:0,y:0},this._isLayout=!0,this.getGraphicBounds=()=>this._layout?{x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0},this._transformLayoutRect=null,this._transformLayoutPosition=null}get layoutOrient(){return this._orient}set layoutOrient(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}initLayout(){"none"!==this.layoutType&&(this._layout=new Vy(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e,i){this._isLayout=!0,super.onLayoutStart(t,e,i)}onLayoutEnd(t){super.onLayoutEnd(t),this.updateLayoutAttribute();const e=this.getLayoutRect();!this._forceLayoutTag&&Im(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=E(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=E(this._layoutRect,t)}getLastComputeOutBounds(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(i=this._spec.layoutType)&&void 0!==i?i:this.layoutType,this._orient=null!==(s=this._spec.orient)&&void 0!==s?s:this._orient,this.layoutLevel=null!==(n=this._spec.layoutLevel)&&void 0!==n?n:this.layoutLevel}}class Gy extends Hy{_initTheme(t,e){return{spec:t,theme:this._theme}}}class Uy extends Wy{getMaxWidth(){return this._layout.maxWidth}setMaxWidth(t){this._layout.maxWidth=t}getMaxHeight(){return this._layout.maxHeight}setMaxHeight(t){this._layout.maxHeight=t}getGroupMark(){return this._groupMark}getInteractionMark(){return this._interactionMark}getStackInverse(){return!0===this._spec.stackInverse}getStackSort(){return!0===this._spec.stackSort}constructor(t,e){var i;super(t,e),this.transformerConstructor=Gy,this.modelType="region",this.specKey="region",this.type=Uy.type,this._series=[],this.layoutType="region",this.layoutZIndex=Dy.Region,this.interaction=new Ey,this.seriesDataFilterOver=()=>{this.event.emit(zd.regionSeriesDataFilterOver,{model:this,chart:this.getChart()}),this._series.forEach((t=>{t.getViewDataFilter()&&t.reTransformViewData()}))},this.getBoundsInRect=()=>({x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}),this.userId=t.id,this.coordinate=null!==(i=t.coordinate)&&void 0!==i?i:"cartesian",this._option.animation&&(this.animate=new jy({getCompiler:e.getCompiler})),this.interaction.setDisableActiveEffect(this._option.disableTriggerEvent)}_getClipDefaultValue(){var t,e,i,s;const n=this._option.getChart().getSpec(),r=null===(e=null===(t=n.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),a=null===(s=null===(i=n.scrollBar)||void 0===i?void 0:i.some)||void 0===s?void 0:s.call(i,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!r&&!a)||this._layout.layoutClip}created(){var t,e;this.initLayout(),super.created();const i=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",(null!==(e=this.userId)&&void 0!==e?e:this.type)+"_interaction",Dy.Interaction),jm(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),i&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((t=>{t&&(t.created(),this.setMarkStyle(t,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",Py.Built_In),this._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setMarkConfig({zIndex:Dy.SeriesGroup-1}),this._foregroundMark&&this._foregroundMark.setMarkConfig({zIndex:Dy.Mark+1})),this.createTrigger()}_createGroupMark(t,e,i){var s,n;const r=this._createMark({type:"group",name:t});r.setUserId(e),r.setMarkConfig({zIndex:i});const a=null!==(s=this._spec.clip)&&void 0!==s?s:this._getClipDefaultValue();return this.setMarkStyle(r,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:a},"normal",Py.Built_In),this.setMarkStyle(r,{cornerRadius:null===(n=this._spec.style)||void 0===n?void 0:n.cornerRadius},"normal",Py.User_Mark),this._marks.addMark(r),r}init(t){super.init(t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",Py.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",Py.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",Py.User_Mark)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(null==e?void 0:e.style,null==t?void 0:t.style)||(i.reMake=!0),i}reInit(t){super.reInit(t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}addSeries(t){t&&(this._series.includes(t)||this._series.push(t))}removeSeries(t){if(!t)return;const e=this._series.findIndex((e=>e===t));e>=0&&this._series.splice(e,1)}getSeries(t={}){return this._series.filter((e=>{var i,s;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||Na(t.userId).includes(e.userId))&&(!M(t.specIndex)||Na(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(s=null===(i=e.getRawData)||void 0===i?void 0:i.call(e))||void 0===s?void 0:s.name)===t.dataName)}))}getSeriesInName(t){return this.getSeries({name:t})[0]}getSeriesInUserId(t){return this.getSeries({userId:t})[0]}getSeriesInId(t){return this.getSeries({id:t})[0]}getSeriesInType(t){return this.getSeries({type:t})}getSeriesInCoordinateType(t){return this.getSeries({coordinateType:t})}getSeriesInDataName(t){return this.getSeries({dataName:t})}onRender(t){}initSeriesDataflow(){const t=this._series.map((t=>{var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((t=>!!t));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}createTrigger(){const t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new wy(t)}initTrigger(){this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{this._trigger.registerMark(t)}))})),this._trigger.init()}initInteraction(){this._option.disableTriggerEvent||this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{for(const e in My)jm(t.stateStyle[My[e]])||this.interaction.registerMark(My[e],t)}))}))}compileMarks(t){this.getMarks().forEach((e=>{var i;e.compile({group:t,context:{model:this}}),null===(i=e.getProduct())||void 0===i||i.layout(((t,e,i,s)=>{}))}))}compile(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}onLayoutEnd(t){this._series.forEach((e=>e.onLayoutEnd(t))),super.onLayoutEnd(t)}}function $y(t){const e=[],i=[],s=[];return t.forEach((t=>{D(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?i.push(t):"end"===t.getSpec().position&&s.push(t)})),{startItems:e,endItems:s,middleItems:i}}function Xy(t,e,i){e?t.forEach((t=>{const e=Va(t),s=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+n})}))})):t.forEach((t=>{const e=Va(t),s=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+n,y:t.getLayoutStartPoint().y})}))}))}function Ky(t,e,i,s){let n;t.forEach(((t,r)=>{t.length>1&&(n=i[r],t.forEach((t=>{if(!t.alignSelf||"start"===t.alignSelf)return;const i=t.getLayoutStartPoint(),r="middle"===t.alignSelf?.5:1,a=e?n-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):n-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+s*a*r,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+s*a*r})})))}))}function qy(t,e,i,s,n){if(t.length){let r=0;const a="right"===n,o=a?-1:1;let l=a?e.rightCurrent:e.leftCurrent,h=e.topCurrent;const d=[];let c=[];const u=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=a?-n.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:h+t.layoutOffsetY+t.layoutPaddingTop}),h+=p,h>i&&c.length?(u.push(r),l+=o*r,r=g,h=e.topCurrent+p,t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),d.push(c),c=[t]):(r=Math.max(r,g),c.push(t))})),u.push(r),d.push(c),Ky(d,!0,u,o),s&&Xy(d,!0,i),a?e.rightCurrent=l+o*r:e.leftCurrent=l+o*r}}function Zy(t,e,i,s){if(t.length){let i=0;const n="right"===s,r=n?-1:1;let a=n?e.rightCurrent:e.leftCurrent,o=e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),c=t.computeBoundsInRect(s);t.setLayoutRect(c);const u=c.height+t.layoutPaddingTop+t.layoutPaddingBottom,p=c.width+t.layoutPaddingLeft+t.layoutPaddingRight,g=n?-c.width-t.layoutPaddingRight:t.layoutPaddingLeft;o{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=r?t.layoutPaddingTop:-n.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:l+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),l+=g,l>i&&c.length?(u.push(o),l=e.leftCurrent+g,h+=a*o,o=p,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),d.push(c),c=[t]):(o=Math.max(o,p),c.push(t))})),u.push(o),d.push(c),Ky(d,!1,u,a),s&&Xy(d,!1,i),r?e.topCurrent=h+a*o:e.bottomCurrent=h+a*o}}function Qy(t,e,i,s){if(t.length){const i="top"===s,n=i?1:-1;let r=0,a=e.rightCurrent,o=i?e.topCurrent:e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),d=t.computeBoundsInRect(s);t.setLayoutRect(d);const c=d.height+t.layoutPaddingTop+t.layoutPaddingBottom,u=d.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=i?t.layoutPaddingTop:-d.height-t.layoutPaddingBottom;ae.layoutLevel-t.layoutLevel))}_layoutNormalItems(t){this.layoutNormalInlineItems(t.filter((t=>"normal-inline"===t.layoutType))),this.layoutNormalItems(t.filter((t=>"normal"===t.layoutType)))}_groupItems(t){const e=t.filter((t=>"region"===t.layoutType)),i=t.filter((t=>"region-relative"===t.layoutType)),s=t.filter((t=>"region-relative-overlap"===t.layoutType)),n=i.concat(s),r={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return s.forEach((t=>{r[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:i,relativeOverlapItems:s,allRelatives:n,overlapItems:r}}layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:r,relativeItems:a,relativeOverlapItems:o,allRelatives:l,overlapItems:h}=this._groupItems(e);this.layoutRegionItems(r,a,o,h),this._processAutoIndent(r,a,o,h,l,n),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType)))}_processAutoIndent(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},n,r){if(n.some((t=>t.autoIndent))){const{top:a,bottom:o,left:l,right:h}=this._checkAutoIndent(n,r);(a||o||l||h)&&(this.topCurrent=r.top+a,this.bottomCurrent=r.bottom-o,this.leftCurrent=r.left+l,this.rightCurrent=r.right-h,this.layoutRegionItems(t,e,i,s))}}layoutNormalItems(t){t.forEach((t=>{const e=this.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(e);t.setLayoutRect(i),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:this.bottomCurrent+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}layoutNormalInlineItems(t){const e=t.filter((t=>"left"===t.layoutOrient)),i=t.filter((t=>"right"===t.layoutOrient)),s=t.filter((t=>"top"===t.layoutOrient)),n=t.filter((t=>"bottom"===t.layoutOrient)),r=this._chartLayoutRect.width+this._chartLayoutRect.x,a=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&qy(s,e,i,!1,"left"),n.length&&qy(n,e,i,!0,"left"),r.length&&Zy(r,e,0,"left")}(e,this,a),s.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&Jy(s,e,i,!1,"top"),n.length&&Jy(n,e,i,!0,"top"),r.length&&Qy(r,e,0,"top")}(s,this,r),i.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&qy(s,e,i,!1,"right"),n.length&&qy(n,e,i,!0,"right"),r.length&&Zy(r,e,0,"right")}(i,this,a),n.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=$y(t);s.length&&Jy(s,e,i,!1,"bottom"),n.length&&Jy(n,e,i,!0,"bottom"),r.length&&Qy(r,e,0,"bottom")}(n,this,r)}_layoutRelativeOverlap(t,e){e.items.forEach((t=>{const i=this.getItemComputeLayoutRect(t),s=t.computeBoundsInRect(i);e.rect.width=Math.max(s.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(s.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((i=>{i.setLayoutRect(e.rect),"left"===t?i.setLayoutStartPosition({x:this.leftCurrent+i.layoutOffsetX}):"right"===t?i.setLayoutStartPosition({x:this.rightCurrent-e.rect.width+i.layoutOffsetX}):"top"===t?i.setLayoutStartPosition({x:this.topCurrent+i.layoutOffsetY}):i.setLayoutStartPosition({x:this.bottomCurrent-e.rect.height+i.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}_layoutRelativeItem(t,e){const i=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}_layoutRegionItem(t,e,i){const s=Math.max(Math.min(e,...t.map((t=>{var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))),0),n=Math.max(Math.min(i,...t.map((t=>{var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))),0);return t.forEach((t=>{const e=s-t.layoutPaddingLeft-t.layoutPaddingRight,i=n-t.layoutPaddingTop-t.layoutPaddingBottom;t.setLayoutRect({width:e,height:i}),t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:n,regionWidth:s}}layoutRegionItems(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}}){let n=this.rightCurrent-this.leftCurrent,r=this.bottomCurrent-this.topCurrent;e.filter((t=>"left"===t.layoutOrient||"right"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",s.left),this._layoutRelativeOverlap("right",s.right),n=this.rightCurrent-this.leftCurrent,e.filter((t=>"top"===t.layoutOrient||"bottom"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",s.top),this._layoutRelativeOverlap("bottom",s.bottom),r=this.bottomCurrent-this.topCurrent;const{regionWidth:a,regionHeight:o}=this._layoutRegionItem(t,n,r);e.concat(i).forEach((e=>{if(["left","right"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:i.getLayoutRect().height}),e.setLayoutStartPosition({y:i.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+a-n})}else if(["top","bottom"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:i.getLayoutRect().width}),e.setLayoutStartPosition({x:i.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+o-r})}}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}filterRegionsWithID(t,e){var i;const s=t.find((t=>t.getModelId()===e));return s||(null!==(i=this._onError)&&void 0!==i?i:bl)("can not find target region item, invalid id"),s}getItemComputeLayoutRect(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}_checkAutoIndent(t,e){const i={top:0,left:0,bottom:0,right:0};return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,n=t.getLastComputeOutBounds(),r=this._getOutInLayout(n,t,e);s?(i.top=Math.max(i.top,r.top),i.bottom=Math.max(i.bottom,r.bottom)):(i.left=Math.max(i.left,r.left),i.right=Math.max(i.right,r.right))})),i}_getOutInLayout(t,e,i){const{x:s,y:n}=e.getLayoutStartPoint(),{width:r,height:a}=e.getLayoutRect();return{left:i.left-(s-t.x1),right:s+r+t.x2-i.right,top:i.top-(n-t.y1),bottom:n+a+t.y2-i.bottom}}}function eb(t,e,i){M(e)||(e=t,t=0),M(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s{let e=null,i=null;return(...s)=>(e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i)};function sb(t,e,i=0,s){for(D(s)&&(s=t.length);i>>1;pd(t[n],e)>0?s=n:i=n+1}return i}const nb=(t,e)=>rb(0,t.length,(i=>e(t[i]))),rb=(t,e,i)=>{let s=t,n=e;for(;s=0?n=t:s=t+1}return s};function ab(t){return t}const ob=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),lb=t=>t<0?-t*t:t*t,hb=t=>-Math.log(-t),db=t=>-Math.exp(-t),cb=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,ub=t=>10===t?cb:t===Math.E?Math.exp:e=>Math.pow(t,e),pb=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),gb=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),mb=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function _b(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 fb(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return nl(o(t))}function vb(t,e,i){let s;return s=1===t?t+2*i:t-e+2*i,t?s>0?s:1:0}function yb(t,e,i,s){return 1===i&&(i=0),vb(t,i,s)*(e/(1-i))}function bb(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}function xb(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]{const i=Math.floor(Math.log10(t)),s=t/Math.pow(10,i);let n;return n=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,n*Math.pow(10,i)},Mb=Math.sqrt(50),kb=Math.sqrt(10),Ab=Math.sqrt(2),wb=[1,2,5,10],Tb=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=Db(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),eb(0,e).map((t=>n+t*s))):t>0?Cb(0,-(e-1)/s,s):Cb((e-1)/s,0,s)},Lb=ib(((t,e,i,s)=>{let n,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((n=e0){let i=Math.round(t/o),s=Math.round(e/o);for(i*oe&&--s,a=new Array(r=s-i+1);++le&&--s,a=new Array(r=s-i+1);++l{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*ie&&--o,n=new Array(s=o-a+1);++re&&--o,n=new Array(s=o-a+1);++r{let n,r,a;if(i=+i,(t=+t)==(e=+e))return Tb(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return Tb(t,i,null==s?void 0:s.noDecimals);(n=e0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=Cb(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=Cb(t,e,l);return n&&r.reverse(),r})),Db=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=wb[0];return i>=Mb?s=wb[3]:i>=kb?s=wb[2]:i>=Ab&&(s=wb[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function Ob(t,e,i){const s=(e-t)/Math.max(0,i);return Db(s)}function Pb(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e0;){if(s=Ob(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}function Ib(t,e){const i=h(e.forceMin),s=h(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:h(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:h(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),h(r[0])&&h(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=h(r[0])||h(r[1])?h(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}const Fb=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),Yb=ib(((t,e,i,s,n,r,a)=>{let o=t,l=e;const h=l0){for(;u<=p;++u)for(d=1;dl)break;g.push(c)}}else for(;u<=p;++u)for(d=s-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(cl)break;g.push(c)}2*g.length0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),jb=ib(((t,e,i,s,n,r)=>{const a=[],o={},l=n(t),h=n(e);let d=[];if(Number.isInteger(s))d=Eb(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e{const n=r(i),l=Number.isInteger(s)?Fb(t,e,n):Fb(t,e,Sb(n)),h=Fb(t,e,((t,e)=>{let i,s;return e[0]1&&(o[h]=1,a.push(h))})),a})),Hb=ib(((t,e,i,s,n)=>Pb(s(t),s(e),i).map((t=>Sb(n(t))))));ib(((t,e,i,s,n)=>Rb(s(t),s(e),i).map((t=>Sb(n(t))))));class zb{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=bb(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){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):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):M(this._rangeFactorStart)&&M(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return D(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return D(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),l=Math.max(r,a),h=js(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=D(s)?(l-o)*i:s;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*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}}function Nb(t,e){const i=t.r,s=e.r,n=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+s*t),d=Math.round(n*(1-t)+r*t),c=Math.round(a*(1-t)+o*t);return new Zs(e,d,c,l*(1-t)+h*t)}}function Vb(t,e){return i=>t*(1-i)+e*i}function Wb(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const Gb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ub=new RegExp(Gb.source,"g"),{Zr:$b}=t;function Xb(t,e){const i=typeof e;let s;if(D(e)||"boolean"===i)return()=>e;if("number"===i)return Vb(t,e);if("string"===i){if(s=qs.parseColorString(e)){const e=$b(qs.parseColorString(t),s);return t=>e(t).formatRgb()}return Vb(Number(t),Number(e))}return e instanceof Zs?$b(t,e):e instanceof qs?$b(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):Vb(Number(t),Number(e))}function Kb(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}class qb extends zb{constructor(t=ab,e=ab){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ab,this._piecewise=fb,this._interpolate=Xb}calculateVisibleDomain(t){var e;return M(this._rangeFactorStart)&&M(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),Vb)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,gd);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 i=Array.from(t);return this._range=i,this._interpolate=Wb,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=Kb(i[0],i[r-1])),this._piecewise=r>2?xb:fb,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:ab),this.rescale(i)):this._clamp!==ab}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=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 D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class Zb extends qb{constructor(){super(...arguments),this.type=ed.Linear}clone(){return(new Zb).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return Lb(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(ws(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let o=Eb(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==r||o[o.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==r?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.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]);o=o.filter((t=>t>=e&&t<=i))}}return o}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Pb(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Rb(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=Ib(n,e);if(r=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=Bb(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Bb(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Bb(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}const Jb=Symbol("implicit");class Qb extends zb{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=ed.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Jb}clone(){const t=(new Qb).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==Jb)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}const n=this._ordinalRange[(s-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;ei&&a>1;)a-=1,r=Math.floor((e-t)/a);return tx(t,e,r,n)}class ix extends Qb{constructor(t){super(),this.type=ed.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),s=super.domain().length,n=i[1]this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=yb(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),s=Math.min((t[1]-t[0])/i,1);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)){if(i>0){const e=t[0]-i*this._rangeFactorStart,s=e+i;this._wholeRange=[e,s]}else{const e=t[1]+i*(1-this._rangeFactorEnd),s=e-i;this._wholeRange=[s,e]}const n=this._rangeFactorStart+s<=1,r=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&n?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&r?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?n?this._rangeFactorEnd=this._rangeFactorStart+s:r?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):r?this._rangeFactorStart=this._rangeFactorEnd-s:n?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),s=this._getInvertIndex(t[1]);return e.slice(Math.min(i,s),Math.max(i,s)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[gd(t[0]),gd(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[gd(t[0]),gd(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return-1===t?e:ex(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return ex(0,e.length-1,t,!0).filter((t=>te[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s;if(i=Kb(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),s=ee[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,s=this.bandwidth()/2,n=this._domain.length,r=this.range(),a=r[0]>r[r.length-1];for(e=0;e=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&h(this._userBandwidth)}clone(){var t,e,i;return new ix(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}class sx{constructor(){this.type=ed.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!D(t)&&il(+t)?this._range[sb(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new sx).domain(this._domain).range(this._range).unknown(this._unknown)}}class nx extends Qb{range(t){return t?(this._range=t,this._resetRange(),this):super.range()}domain(t){return t?(super.domain(t),this._resetRange(),this):super.domain()}_resetRange(){if(!Dl(this._range))return void super.range(this._range);const t=Ll(this._range,this._domain);super.range(t)}}const rx={linear:Zb,band:ix,point:class extends ix{constructor(t){super(!1),this.type=ed.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},ordinal:Qb,threshold:sx,colorOrdinal:nx};function ax(t){const e=rx[t];return e?new e:null}function ox(t,e){if(!e)return t;const i=e.range(),s=Math.min(i[0],i[i.length-1]),n=Math.max(i[0],i[i.length-1]);return Math.min(Math.max(s,t),n)}function lx(t){return M(null==t?void 0:t.field)&&M(null==t?void 0:t.scale)}const hx=["linear","radial","conical"],dx={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},cx=["line","area","trail"];function ux(t){return cx.includes(t)}class px extends Yy{getStateInfoList(){return this._stateInfoList}constructor(t,e){super(t),this._stateInfoList=[],this._mark=e}_getDefaultStateMap(){return{markUpdateRank:1}}getStateInfo(t){return this._stateInfoList.find((e=>e.stateValue===t))}addStateInfo(t){if(this.getStateInfo(t.stateValue))return;t.level=t.level||0;let e=!0;for(let i=0;it.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}_clearStateBeforeSet(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}changeStateInfo(t){const e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else{e.fields=e.fields||{};for(const i in t.fields){const s=t.fields[i];e.fields[i]=e.fields[i]||{};const n=e.fields[i];M(s.domain)&&(n.domain=s.domain),M(s.type)&&(n.type=s.type)}}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}clearStateInfo(t){t.forEach((t=>{this.getStateInfo(t)&&this.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}checkOneState(t,e,i,s){var n;s=v(ux)?s:!t.mark||ux(t.mark.markType);let r=!1,a=!1;if(M(i.datums)&&i.datums.length>0)r=this.checkDatumState(i,e,s),a=!0;else if(i.items)r=null!==(n=this.checkItemsState(i,t))&&void 0!==n&&n,a=!0;else if(i.fields)r=this.checkFieldsState(i,e,t,s),a=!0;else if(!r&&i.filter){const s={mark:this._mark,renderNode:t,type:t.mark.markType};r=i.filter(e,s),a=!0}return a?r?"in":"out":"skip"}checkState(t,e){const i=t.getStates().filter((t=>!!Ty[t])).map((t=>[t,10])),s=!t.mark||ux(t.mark.markType);for(let n=0;nt[0]))}checkDatumState(t,e,i){let s=!1;const n=i?e[0]:e;if(y(t.datums)){const e=t.datumKeys||Object.keys(t.datums[0]).filter((t=>!t.startsWith(hh)));s=t.datums.some((t=>i&&y(null==t?void 0:t.items)?e.every((e=>{var i,s;return(null===(s=null===(i=null==t?void 0:t.items)||void 0===i?void 0:i[0])||void 0===s?void 0:s[e])===(null==n?void 0:n[e])})):e.every((e=>(null==t?void 0:t[e])===(null==n?void 0:n[e])))))}else s=As(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((t=>!t.startsWith(hh)))).every((e=>{var s,r;return i?(null===(s=t.datums.items)||void 0===s?void 0:s[0][e])===n[e]:(null===(r=t.datums)||void 0===r?void 0:r[e])===n[e]})):e===t.datums;return s}checkItemsState(t,e){var i;return null===(i=t.items)||void 0===i?void 0:i.includes(e)}checkFieldsState(t,e,i,s){var n;let r=!0;for(const a in t.fields){const o=t.fields[a],l=o.type,h=o.domain,d=s?null===(n=e[0])||void 0===n?void 0:n[a]:e[a];if(nd(l)&&h.length>1){if(this.checkLinearFieldState(h,a,e,i,s)){r=!1;break}r=!0}else{if(!h.some((t=>t===d))){r=!1;break}r=!0}}return r}checkLinearFieldState(t,e,i,s,n){var r;const a=n?null===(r=i[0])||void 0===r?void 0:r[e]:i[e];return at[t.length-1]}updateLayoutState(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}compileState(t,e){t.state({callback:(t,e)=>this.checkState(e,t)},e)}}class gx extends By{getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}constructor(t,e){super(t),this.grammarType=a_.data,this._data=null,this._data=e}release(){super.release(),this._data=null}updateData(t){const e=this.getProduct(),i=this.getLatestData();if(e&&i&&(e.values(i),!t))return this.getCompiler().renderNextTick()}_compileProduct(){const t=this.getLatestData();D(t)||(D(this.getProduct())?this._initProduct(t):this._product.values(t))}_initProduct(t){var e,i;const s=this.getVGrammarView();if(!s||!t)return;const n=this.getProductId();this._product=null===(i=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e.call(s,t))||void 0===i?void 0:i.id(n),this._compiledProductId=n}generateProductId(){var t;return`${null===(t=this.getDataView())||void 0===t?void 0:t.name}`}_lookupGrammar(t){var e,i;return null===(i=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===i?void 0:i.call(e,t)}}class mx extends gx{constructor(t){super(t),this._mark=t.mark}setCompiledProductId(t){this._compiledProductId=t}generateProductId(){const t=super.generateProductId();return M(t)?t:`${hh}_markData_${this._mark.id}`}_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct(e)}}var _x=function(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{this._markConfig[e]=t[e]}))}getVisible(){return this._visible}setVisible(t){this._visible=t}getUserId(){return this._userId}setUserId(t){M(t)&&(this._userId=t)}getDataView(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}setDataView(t,e){D(this._data)&&this.initMarkData(Object.assign(Object.assign({},this._option),{mark:this})),M(e)&&this._data.setCompiledProductId(e),this._data.setDataView(t)}getData(){return this._data}setData(t){this._data=t}hasState(t){return t in this.state.getStateMap()}getState(t){return this.state.getStateMap()[t]}getAnimationConfig(){return this._animationConfig}setAnimationConfig(t){this._animationConfig=t}setSkipBeforeLayouted(t){this._skipBeforeLayouted=t}getSkipBeforeLayouted(){return this._skipBeforeLayouted}getGroupKey(){return this._groupKey}setGroupKey(t){this._groupKey=t}setStateSortCallback(t){this._stateSort=t}constructor(t,e,i){super(t),this.grammarType=a_.mark,this.type=void 0,this.name="mark",this._markConfig={zIndex:Dy.Mark,morph:!1},this._visible=!0,this.stateStyle={},this._unCompileChannel={},this._skipBeforeLayouted=!1,this.name=e,this.model=i,this.key=t.key,this.state=new px(Object.assign(Object.assign({},t),{stateKeyToSignalName:this.stateKeyToSignalName.bind(this)}),this),this._event=new Gd(i.getOption().eventDispatcher,i.getOption().mode)}setTransform(t){this._transform=t}initMarkData(t){this._data=new mx(t)}stateKeyToSignalName(t){return`${hh}_${this.type}_${this.id}_${t}`}getAttribute(t,e,i,s){}_compileProduct(t){const e=this.getProduct();this.getVisible()?M(e)||this.getCompiler().isInited&&(this._initProduct(null==t?void 0:t.group),D(this._product)||(this.compileSignal(),this.compileData(),this.compileState(),this.compileEncode(),this.compileAnimation(),this.compileContext(null==t?void 0:t.context),this.compileTransform())):M(e)&&this.removeProduct()}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(this.type,null!=t?t:e.rootMark).id(i),this._compiledProductId=i}generateProductId(){return this._userId?`${this._userId}`:`${this.name}_${this.id}`}compileData(){if(D(this._data))return;this._data.compile();const t=this._data.getProduct();M(this._product)&&M(t)&&this._product.join(t,this.key,void 0,this.getGroupKey())}updateStaticEncode(){if(!this._product)return;const{enterStyles:t,updateStyles:e}=this._separateStyle();this._product.encodeState("group",t,!0),this._product.encode(e,!0)}_separateStyle(){const t=this.stateStyle,e=Sy.STATE_NORMAL,i=t[e],s=(_x(t,["symbol"==typeof e?e:e+""]),this._option.noSeparateStyle?null:{}),n={};return Object.keys(i).forEach((t=>{this._unCompileChannel[t]||(this._option.noSeparateStyle||function(t,e,i){var s;const n=null===(s=e[t])||void 0===s?void 0:s.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,n)||!!ws(n)||!(!(null==n?void 0:n.scale)||n.field===i)}(t,i,this.getGroupKey())?n[t]={callback:this.compileCommonAttributeCallback(t,"normal"),dependency:[this.stateKeyToSignalName("markUpdateRank")]}:s[t]=this.compileCommonAttributeCallback(t,"normal"))})),{enterStyles:s,updateStyles:n}}compileEncode(){const t=this.stateStyle,e=Sy.STATE_NORMAL,i=(t[e],_x(t,["symbol"==typeof e?e:e+""])),{enterStyles:s,updateStyles:n}=this._separateStyle();this._product.encode(n,!0),this._product.encodeState("group",s,!0),Object.keys(i).forEach((t=>{const e={};Object.keys(i[t]).forEach((i=>{this._unCompileChannel[i]||(e[i]={callback:this.compileCommonAttributeCallback(i,t),dependency:[this.stateKeyToSignalName("markUpdateRank")]})})),this._product.encodeState(t,e,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}compileState(){this.state.compileState(this._product,this._stateSort)}compileAnimation(){var t,e,i,s;if(this._animationConfig){let n;if("component"===this.type)n=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{const t=null===(i=(e=this.model).getRegion)||void 0===i?void 0:i.call(e);n=null===(s=null==t?void 0:t.animate)||void 0===s?void 0:s.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:(t,e,i)=>{var s;return null===(s=i[n])||void 0===s?void 0:s.callback(t,e)},dependency:n}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(hc.ANIMATION_END,(({event:t})=>{t.mark===this.getProduct()&&t.animationState===Np.appear&&this.runAnimationByState(Np.normal)})):this._event.on(hc.AFTER_DO_RENDER,(()=>{this.runAnimationByState(Np.normal)})))}}compileContext(t){const e=Object.assign(Object.assign({},this._markConfig),{context:Object.assign({markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},t)});this._product.configure(e)}compileSignal(){this.state.compile()}_computeAttribute(t,e){return(t,e)=>{}}compileCommonAttributeCallback(t,e){const i=this._computeAttribute(t,e),s={mark:null,parent:null,element:null};return(t,e)=>(s.mark=e.mark,s.parent=e.mark.group,s.element=e,i(t,s))}compileTransform(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}updateState(t,e){return this.state.updateState(t,e)}updateLayoutState(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((t=>t.state.updateLayoutState(!0))),this.state.updateLayoutState(t)}updateMarkState(t){if(!this._product)return;const e=this.state.getStateInfo(t);this._product.elements.forEach((i=>{"in"===this.state.checkOneState(i,i.getDatum(),e)?i.addState(t):i.removeState(t)}))}getMarks(){return[]}runAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.runAnimationByState(t)}stopAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.stopAnimationByState(t)}pauseAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.pauseAnimationByState(t)}resumeAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.resumeAnimationByState(t)}getProductElements(){const t=this.getProduct();if(t)return t.elements}release(){super.release(),this.state.release()}}var vx=function(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);ne(t(...i)):e(t)}convertAngleToRadian(t){return this._transformStyleValue(t,At)}isUserLevel(t){return[Py.User_Mark,Py.User_Series,Py.User_Chart,Py.User_SeriesStyle].includes(t)}setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this.isUserLevel(i);Object.keys(t).forEach((r=>{let a=t[r];D(a)||(a=this._filterAttribute(r,a,e,i,n,s),this.setAttribute(r,a,e,i,s))}))}getStyle(t,e="normal"){var i;return null===(i=this.stateStyle[e][t])||void 0===i?void 0:i.style}_filterAttribute(t,e,i,s,n,r=this.stateStyle){let a=this._styleConvert(e);if(n)switch(t){case"angle":a=this.convertAngleToRadian(a);break;case"innerPadding":case"outerPadding":a=this._transformStyleValue(a,(t=>-t));break;case"curveType":a=this._transformStyleValue(a,(t=>{return e=t,i=this._option.model.direction,"monotone"===e?"horizontal"===i?"monotoneY":"monotoneX":e;var e,i}))}return a}setReferer(t,e,i,s=this.stateStyle){var n;if(t)if(e&&i){const r=null!==(n=s[i])&&void 0!==n?n:{[e]:{}};s[i][e]=Object.assign(Object.assign({},r[e]),{referer:t})}else Object.entries(s).forEach((([e,i])=>{Object.entries(i).forEach((([i,n])=>{s[e][i].referer=t}))}))}setPostProcess(t,e,i="normal"){var s;(null===(s=this.stateStyle[i])||void 0===s?void 0:s[t])&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal",s){return this._computeAttribute(t,i)(e,s)}setAttribute(t,e,i="normal",s=0,n=this.stateStyle){var r;void 0===n[i]&&(n[i]={}),void 0===n[i][t]&&(n[i][t]={level:s,style:e,referer:void 0});const a=null===(r=n[i][t])||void 0===r?void 0:r.level;M(a)&&a<=s&&Pl(n[i][t],{style:e,level:s}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach((t=>{void 0===n[i][t]&&(n[i][t]=n.normal[t])}))}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(rd(t.type)||t.scale){const e=function(t,e){if("scale"in t&&t.scale)return S(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;const i=ax(t.type);return i&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(i,t),i}(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}_computeAttribute(t,e){var i;let s=null===(i=this.stateStyle[e])||void 0===i?void 0:i[t];s||(s=this.stateStyle.normal[t]);const n=this._computeStateAttribute(s,t,e),r=ws(null==s?void 0:s.postProcess),a=t in this._computeExChannel;if(r&&a){const i=this._computeExChannel[t];return(r,a)=>{let o=n(r,a);return o=s.postProcess(o,r,this._attributeContext,a,this.getDataView()),i(t,r,e,a,o)}}if(r)return(t,e)=>s.postProcess(n(t,e),t,this._attributeContext,e,this.getDataView());if(a){const i=this._computeExChannel[t];return(s,r)=>i(t,s,e,r,n(s,r))}return n}_computeStateAttribute(t,e,i){var s;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?(e,i)=>t.style(e,this._attributeContext,i,this.getDataView()):hx.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):rd(null===(s=t.style.scale)||void 0===s?void 0:s.type)?(e,i)=>{let s=e;return"series"===this.model.modelType&&this.model.getMarkData&&(s=this.model.getMarkData(e)),t.style.scale.scale(s[t.style.field])}:(e,i)=>t.style:(e,i)=>t.style:(t,e)=>{}}_initStyle(){const t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t,e,i){t.style&&this.setStyle(t.style,"normal",Py.User_Mark,e);const s=t.state;s&&Object.keys(s).forEach((t=>{const i=s[t];if("style"in i){const s=i.style;let n={stateValue:t};"level"in i&&(n.level=i.level),"filter"in i&&(n=ws(i.filter)?Object.assign({filter:i.filter},n):Object.assign(Object.assign({},i.filter),n)),this.state.addStateInfo(n),this.setStyle(s,t,Py.User_Mark,e)}else this.setStyle(i,t,Py.User_Mark,e)}))}_computeGradientAttr(t){var e,i;const{gradient:s,scale:n,field:r}=t,a=vx(t,["gradient","scale","field"]);let o=n,l=r;if(!(n&&r||"series"!==this.model.modelType)){const{scale:t,field:e}=this.model.getColorAttribute();n||(o=t),l||(l=e)}const h=Ll(Tl(this.model.getColorScheme(),"series"===this.model.modelType?null===(i=(e=this.model).getSpec)||void 0===i?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),d=Object.assign(Object.assign({},dx[s]),a);return(t,e)=>{const i={},n=this.getDataView();return Object.keys(d).forEach((s=>{const r=d[s];"stops"===s?i.stops=r.map((i=>{const{opacity:s,color:r,offset:a}=i;let d=null!=r?r:null==o?void 0:o.scale(t[l]);return ws(r)&&(d=r(t,this._attributeContext,e,n)),M(s)&&(d=qs.SetOpacity(d,s)),{offset:ws(a)?a(t,this._attributeContext,e,n):a,color:d||h[0]}})):ws(r)?i[s]=r(t,this._attributeContext,e,n):i[s]=r})),i.gradient=s,i}}_computeBorderAttr(t){const{scale:e,field:i}=t,s=vx(t,["scale","field"]);return(t,n)=>{var r,a,o;const l={};if(Object.keys(s).forEach((e=>{const i=s[e];ws(i)?l[e]=i(t,this._attributeContext,n,this.getDataView()):l[e]=i})),"stroke"in l)hx.includes(null===(o=s.stroke)||void 0===o?void 0:o.gradient)&&(l.stroke=this._computeGradientAttr(s.stroke)(t,n));else{const s=Ll(Tl(this.model.getColorScheme(),"series"===this.model.modelType?null===(a=(r=this.model).getSpec)||void 0===a?void 0:a.call(r):void 0),this.model.getDefaultColorDomain());let n=e,o=i;if(!(e&&i||"series"!==this.model.modelType)){const{scale:i,field:r}=this.model.getColorAttribute();e||(n=i),o||(o=r),l.stroke=(null==n?void 0:n.scale(t[o]))||s[0]}}return l}}}class bx extends ar{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(t=!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 xx(t){return new bx(t)}function Sx(){Sx.__loaded||(Sx.__loaded=!0,ca.RegisterGraphicCreator("shadowRoot",xx))}Sx.__loaded=!1;const Mx=Sx,kx=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...kn];class Ax extends En{constructor(t){super(t),this.type="arc",this.numberType=jn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(h(t,!0)?t:a*parseFloat(t)/100,a/2);if(y(e)){const t=e.map((t=>o(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 o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=((t=0)=>{if(t<0)for(;t<-ot;)t+=ot;else if(t>0)for(;t>ot;)t-=ot;return t})(e),i=e+r,s&&ht(r)nt&&o>nt)return{startAngle:e-n*u*r,endAngle:i+n*u*a,sc:n*u*r,ec:n*u*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=mt(a*a+o*o)}=this.attribute,h=ht(e-t);let d=t,c=e,u=t,p=e;const g=r/2;let m=h,_=h;if(g>nt&&l>nt){const i=e>t?1:-1;let s=ft(Number(l)/o*gt(g)),n=ft(Number(l)/a*gt(g));return(m-=2*s)>nt?(s*=i,u+=s,p-=s):(m=0,u=p=(t+e)/2),(_-=2*n)>nt?(n*=i,d+=n,c-=n):(_=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}getGraphicTheme(){return bs(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Si.graphicService.updateTempAABBBounds(i);$v(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return Si.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,so){const t=l;l=o,o=t}return s<=nt?i.set(0,0,0,0):Math.abs(o-l)>lt-nt?i.set(-s,-s,s,s):(mn(l,o,s,i),mn(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,kx)}needUpdateTag(t){return super.needUpdateTag(t,kx)}toCustomPath(){var t,e,i,s;const n=this.attribute,{startAngle:r,endAngle:a}=this.getParsedAngle();let o=(null!==(t=n.innerRadius)&&void 0!==t?t:0)-(null!==(e=n.innerPadding)&&void 0!==e?e:0),l=(null!==(i=n.outerRadius)&&void 0!==i?i:0)-(null!==(s=n.outerPadding)&&void 0!==s?s:0);const h=ht(a-r),d=a>r;if(l=lt-nt)c.moveTo(0+l*ct(r),0+l*gt(r)),c.arc(0,0,l,r,a,!d),o>nt&&(c.moveTo(0+o*ct(a),0+o*gt(a)),c.arc(0,0,o,a,r,d));else{const t=l*ct(r),e=l*gt(r),i=o*ct(a),s=o*gt(a);c.moveTo(0+t,0+e),c.arc(0,0,l,r,a,!d),c.lineTo(0+i,0+s),c.arc(0,0,o,a,r,d),c.closePath()}return c}clone(){return new Ax(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ax.NOWORK_ANIMATE_ATTR}}function wx(t){return new Ax(t)}Ax.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Cn);class Tx{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:s=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size{r++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length=n)););if(is;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:s=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>s&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();t.forEach((t=>{for(;s-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();for(;s-t.timestamp[0]>i;)t.timestamp.shift()}}class Lx{static GetCanvas(){try{return Lx.canvas||(Lx.canvas=Si.global.createCanvas({})),Lx.canvas}catch(t){return null}}static GetCtx(){if(!Lx.ctx){const t=Lx.GetCanvas();Lx.ctx=t.getContext("2d")}return Lx.ctx}}class Cx extends Tx{static getInstance(){return Cx._instance||(Cx._instance=new Cx),Cx._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Lx.GetCanvas(),s=Lx.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");const n=s.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),s.fillStyle=n,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,s,n=[],r=100){let a=`${t}${e}${i}${s}`;n.forEach((t=>a+=t.join())),a+=r;let o=this.dataMap.get(a);return o||(o={data:new Cx(n,r),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class Ex{static GetSize(t){for(let e=0;e=t)return Ex.ImageSize[e];return t}static Get(t,e,i,s,n,r,a){const o=Ex.GenKey(t,e,i,s,n),l=Ex.cache[o];if(!l||0===l.length)return null;for(let t=0;t=r&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,s,n,r,a,o){const l=Ex.GenKey(t,e,i,s,n);Ex.cache[l]?Ex.cache[l].push({width:a,height:o,pattern:r}):Ex.cache[l]=[{width:a,height:o,pattern:r}]}static GenKey(t,e,i,s,n){return`${e},${i},${s},${n},${t.join()}`}}Ex.cache={},Ex.ImageSize=[20,40,80,160,320,640,1280,2560];const Dx=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{innerPadding:_=l.innerPadding,outerPadding:f=l.outerPadding,startAngle:v=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x=l.x,y:S=l.y,scaleX:M=l.scaleX,scaleY:k=l.scaleY}=t.attribute;let{innerRadius:A=l.innerRadius,outerRadius:w=l.outerRadius}=t.attribute;w+=f,A-=_;const T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Fa(e,o,e.dpr),d=o/w,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:w+u*h,innerRadius:A-u*h,startAngle:v-u*d,endAngle:y+u*d}),e.beginPath(),ro(t,e,i,s,w+u*h,A-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/M,(S-s)/k,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder"),t.setAttributes({outerRadius:w,innerRadius:A,startAngle:v,endAngle:y})}},Ox=Bo,Px=bo;var Rx=function(t,e){return function(i,s){e(i,s,t)}};let Bx=class extends wo{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=jn,this.builtinContributions=[Dx,Px,Ox],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=o,ht(c-d);const u=c>d;let p=!1;if(nnt){const t=pt(b,y),r=pt(x,y),a=so(f,v,m,_,n,t,Number(u)),o=so(M,k,A,w,n,r,Number(u));if(y0&&e.arc(i+o.cx,s+o.cy,r,dt(o.y11,o.x11),dt(o.y01,o.x01),!u)}}else e.moveTo(i+m,s+_);if(!(r>nt)||L<.001)e.lineTo(i+A,s+w),p=!0;else if(T>nt){const t=pt(E,T),n=pt(D,T),a=so(A,w,M,k,r,-n,Number(u)),o=so(m,_,f,v,r,-t,Number(u));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),T0&&e.arc(i+a.cx,s+a.cy,n,dt(a.y01,a.x01),dt(a.y11,a.x11),!u);const t=dt(a.cy+a.y11,a.cx+a.x11),o=c-l-.03;e.arc(i,s,r,t,o,u)}}else e.lineTo(i+r*ct(C),s+r*gt(C));return p}drawShape(t,e,i,s,n,r,a,o){const l=bs(t,null==r?void 0:r.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:c=l.x,y:u=l.y,fillStrokeOrder:p=l.fillStrokeOrder}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;const{fVisible:m,sVisible:_,doFill:f,doStroke:y}=g,{outerPadding:b=l.outerPadding,innerPadding:x=l.innerPadding,cap:S=l.cap,forceShowCap:M=l.forceShowCap}=t.attribute;let{outerRadius:k=l.outerRadius,innerRadius:A=l.innerRadius}=t.attribute;k+=b,A-=x;let w=0;const T=(v(S)&&S||S[0])&&"conical"===h.gradient;if(T){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ht(s-i){var e;let i=!0;if(v(t,!0)){for(let s=0;s<4;s++)dn[s]=t,i&&(i=!(null!==(e=dn[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)dn[e]=!!t[e],i&&(i=!!dn[e]);else dn[0]=!1,dn[1]=!1,dn[2]=!1,dn[3]=!1;return{isFullStroke:i,stroke:dn}})(d);if(f||C){e.beginPath(),ro(t,e,i,s,k,A),L=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,y,m,_,l,n,a,o);const r=()=>{f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill()))},h=()=>{y&&C&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke()))};p?(h(),r()):(r(),h())}if(!C&&y&&(e.beginPath(),ro(t,e,i,s,k,A,E),L||this.beforeRenderStep(t,e,i,s,f,y,m,_,l,n,a,o),o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),(v(S)&&S||S[1])&&M){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(ht(h-r)>=lt-nt){e.beginPath();const r=Math.abs(k-A)/2/k,{endAngle:h=l.endAngle,fill:d=l.fill}=t.attribute,c=h;this.drawArcTailCapPath(t,e,i,s,k,A,c,c+r),L||this.beforeRenderStep(t,e,i,s,f,y,m,_,l,n,a,o);const u=()=>{if(f){const n=d;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=lt;for(;i>lt;)i-=lt;if(ia)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),en(o.color,l.color,h,!1)}(0,0,h,n);a||Qa&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=r,e.fill())}}},p=()=>{y&&(o||_&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke()))};u(),p()}}this.afterRenderStep(t,e,i,s,f,y,m,_,l,n,a,o),T&&(h.startAngle+=w,h.endAngle+=w)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Bx=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}([V(),Rx(0,$(K)),Rx(0,X(ao)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Bx);let Ix=!1;const Fx=new I((t=>{Ix||(Ix=!0,t(Bx).toSelf().inSingletonScope(),t(yr).to(Bx).inSingletonScope(),t(Mr).toService(yr),t(ao).toService(xo),Z(t,ao))}));let Yx=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=jn}};Yx=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(yr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yx);let jx=!1;const Hx=new I(((t,e,i,s)=>{jx||(jx=!0,t(j_).to(Yx).inSingletonScope(),t(ef).toService(j_))}));let zx=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=jn}};zx=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(yr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],zx);let Nx=!1;const Vx=new I(((t,e,i,s)=>{Nx||(Nx=!0,t(L_).to(zx).inSingletonScope(),t(T_).toService(L_))}));function Wx(){Wx.__loaded||(Wx.__loaded=!0,ca.RegisterGraphicCreator("arc",wx),Xi.load(Fx),Xi.load(w_?Hx:Vx))}Wx.__loaded=!1;const Gx=Wx;class Ux extends Ax{constructor(t){super(t),this.type="arc3d",this.numberType=Hn}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),Si.graphicService.updateTempAABBBounds(i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Ux.NOWORK_ANIMATE_ATTR}}function $x(t){return new Ux(t)}Ux.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Cn);class Xx{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Qs.Get(e,Js.Color1),this.ambient=i;const s=mt(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 i=this.formatedDir,s=pt(ut((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=S(e)?Qs.Get(e,Js.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const Kx=()=>{Cg.registerPlugin("DirectionalLight",Xx)};class qx{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=Zr.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Zr.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,d,c,u,p;const g=e[0],m=e[1],_=e[2],f=s[0],v=s[1],y=s[2],b=i[0],x=i[1],S=i[2];Math.abs(g-b){Cg.registerPlugin("OrthoCamera",qx)};let Jx=class extends wo{constructor(){super(...arguments),this.numberType=Hn}drawShape(t,e,i,s,n,r,a,o){var l;const h=bs(t,null==r?void 0:r.theme).arc,{fill:d=h.fill}=t.attribute,c=this.valid(t,h,a,o);if(!c)return;const{fVisible:u,sVisible:p,doFill:g,doStroke:m}=c,_=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:f=h.outerPadding,innerPadding:v=h.innerPadding,height:y=10}=t.attribute;let{outerRadius:b=h.outerRadius,innerRadius:x=h.innerRadius}=t.attribute;b+=f,x-=v;const S=Qs.Get(d,Js.Color255),{light:M}=n.stage||{},k=n.hack_pieFace,A={top:_,bottom:_+y},w={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===k||"top"===k?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(r=lt-nt)e.moveTo(i+r*ct(o),s+r*gt(o),n),e.arc(i,s,r,o,l,!d,n),a>nt&&(e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,o,d,n));else{const{outerDeltaAngle:h,innerDeltaAngle:u,outerStartAngle:p,outerEndAngle:g,innerEndAngle:m,innerStartAngle:_}=t.getParsePadAngle(o,l),f=r*ct(p),v=r*gt(p),y=a*ct(m),b=a*gt(m);h<.001?c=!0:(e.moveTo(i+f,s+v,n),e.arc(i,s,r,p,g,!d,n)),!(a>nt)||u<.001?(e.lineTo(i+y,s+b,n),c=!0):(e.lineTo(i+y,s+b,n),e.arc(i,s,a,m,_,d,n))}e.closePath()}(t,e,i,s,A[k],b,x),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==k&&"inside"!==k||("inside"===k&&(e.save(),e.beginPath(),e.arc(i,s,x,0,lt,!0,A.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),d=ht(h-l),c=h>l;let u=!1;if(a<=nt)e.moveTo(i,s,n);else if(d>=lt-nt)e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,h,!c,n),e.lineTo(i+a*ct(h),s+a*gt(h),r),e.arc(i,s,a,h,l,c,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:p}=o(l,h),g=a*ct(d),m=a*gt(d),_=a*ct(p),f=a*gt(p);t<.001?u=!0:(e.moveTo(i+g,s+m,n),e.arc(i,s,a,d,p,!c,n),e.lineTo(i+_,s+f,r),e.arc(i,s,a,p,d,c,r))}e.closePath()}(t,e,i,s,A.top,A.bottom,"outside"===k?b:x,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===k?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===k&&e.restore())}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Jx=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}([V()],Jx);let Qx=!1;const tS=new I((t=>{Qx||(Qx=!0,t(br).to(Jx).inSingletonScope(),t(Mr).toService(br))}));let eS=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Hn,this.themeType="arc"}};eS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(br)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],eS);let iS=!1;const sS=new I(((t,e,i,s)=>{iS||(iS=!0,t(H_).to(eS).inSingletonScope(),t(ef).toService(H_))}));function nS(){nS.__loaded||(nS.__loaded=!0,ca.RegisterGraphicCreator("arc3d",$x),Kx(),Zx(),Xi.load(tS),Xi.load(sS))}nS.__loaded=!1;const rS=nS,aS=["points","cornerRadius",...kn];class oS extends En{constructor(t){super(t),this.type="polygon",this.numberType=Xn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return bs(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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=fn(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,aS)}needUpdateTag(t){return super.needUpdateTag(t,aS)}toCustomPath(){const t=this.attribute.points,e=new Ze;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 oS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return oS.NOWORK_ANIMATE_ATTR}}function lS(t){return new oS(t)}oS.NOWORK_ANIMATE_ATTR=Cn;class hS extends oS{constructor(t){super(t),this.type="pyramid3d",this.numberType=Kn}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),Si.graphicService.updateTempAABBBounds(i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.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]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return hS.NOWORK_ANIMATE_ATTR}}function dS(t){return new hS(t)}hS.NOWORK_ANIMATE_ATTR=Cn;class cS extends wo{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,d){const c=Qs.Get(r,Js.Color255),u=s.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=u[n[0]],m=u[n[1]],_=u[n[2]],f=u[n[3]],v={x:t+g[0],y:e+g[1],z:i+g[2]},y={x:t+m[0],y:e+m[1],z:i+m[2]},b={x:t+_[0],y:e+_[1],z:i+_[2]},x={x:t+f[0],y:e+f[1],z:i+f[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.closePath(),d?d(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,c):r,a.fill())}))}}let uS=class extends cS{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Kn}drawShape(t,e,i,s,n,r,a,o){var l;const h=bs(t,null==r?void 0:r.theme).polygon,{fill:d=h.fill,stroke:c=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}=n.stage||{},m=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,s,h);let n=d;"string"!=typeof n&&(n="black"),this.fill(i,s,p,m,u,n,e,g,t,h,a)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,m,e))}draw(t,e,i){const s=bs(t).polygon;this._draw(t,s,!1,i)}};uS=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}([V()],uS);let pS=!1;const gS=new I((t=>{pS||(pS=!0,t(Pr).to(uS).inSingletonScope(),t(Mr).toService(Pr))}));let mS=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Kn,this.themeType="polygon"}};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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Pr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mS);let _S=!1;const fS=new I(((t,e,i,s)=>{_S||(_S=!0,t(Z_).to(mS).inSingletonScope(),t(ef).toService(Z_))}));function vS(){vS.__loaded||(vS.__loaded=!0,ca.RegisterGraphicCreator("pyramid3d",dS),Kx(),Zx(),Xi.load(gS),Xi.load(fS))}vS.__loaded=!1;const yS=vS,bS=["segments","points","curveType","curveTension",...kn];class xS extends En{constructor(t){super(t),this.type="area",this.numberType=zn}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 bs(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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=fn(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,bS)}needUpdateTag(t){return super.needUpdateTag(t,bS)}toCustomPath(){const t=new Ze,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 xS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return xS.NOWORK_ANIMATE_ATTR}}function SS(t){return new xS(t)}xS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Cn);let MS=!1;const kS=new I((t=>{MS||(MS=!0,t(jo).toSelf().inSingletonScope(),t(xr).to(jo).inSingletonScope(),t(Mr).toService(xr),t(oo).toService(xo),Z(t,oo),t(Ho).toSelf().inSingletonScope())}));let AS=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=zn}};AS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AS);let wS=!1;const TS=new I(((t,e,i,s)=>{wS||(wS=!0,t(z_).to(AS).inSingletonScope(),t(ef).toService(z_))}));let LS=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=zn}};LS=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],LS);let CS=!1;const ES=new I(((t,e,i,s)=>{CS||(CS=!0,t(C_).to(LS).inSingletonScope(),t(T_).toService(C_))}));function DS(){DS.__loaded||(DS.__loaded=!0,ca.RegisterGraphicCreator("area",SS),Xi.load(kS),Xi.load(w_?TS:ES))}DS.__loaded=!1;const OS=DS,PS=["width","height","image",...kn];class RS extends En{constructor(t){super(t),this.type="image",this.numberType=Gn,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}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:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}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()}))}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,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return bs(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:s=e.width,height:n=e.height}=t;i.set(0,0,s,n)}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return bi[t]}needUpdateTags(t){return super.needUpdateTags(t,PS)}needUpdateTag(t){return super.needUpdateTag(t,PS)}clone(){return new RS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return RS.NOWORK_ANIMATE_ATTR}}function BS(t){return new RS(t)}RS.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Cn);const IS=new class extends Jv{constructor(){super(...arguments),this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){return super.drawShape(t,e,i,s,n,r,a,o,l,h,d,c)}},FS=new class extends yo{constructor(){super(...arguments),this.time=me.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,d,c,u){const{background:p,backgroundMode:g=l.backgroundMode,backgroundFit:m=l.backgroundFit}=t.attribute;if(p)if(t.backgroundImg){const i=t.resources.get(p);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=bs(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}const s=t.AABBBounds;this.doDrawImage(e,i.data,s,g,m),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(As(p)){const{stroke:i,fill:s,lineWidth:n=1,cornerRadius:r=0,expandX:a=0,expandY:o=0}=p;if(!i&&!s)return;e.beginPath();const{x:l,y:d,width:c,height:u}=function(t){const e=un(t.attribute.boundsPadding),i=t.AABBBounds;let s=i.x1,n=i.y1,r=i.width(),a=i.height();return h(e)?(s+=e,n+=e,r-=2*e,a-=2*e):(s+=e[3],n+=e[0],r-=e[1]+e[3],a-=e[0]+e[2]),{x:s,y:n,width:r,height:a}}(t);r?qa(e,l-a,d-o,c+2*a,u+2*o,r):e.rect(l-a,d-o,c+2*a,u+2*o),e.globalAlpha=1,s&&(e.fillStyle=s,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,s,n.width(),n.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}};var YS=function(t,e){return function(i,s){e(i,s,t)}};const jS=["","repeat-x","repeat-y","repeat"];let HS=class extends wo{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Gn,this.builtinContributions=[IS,FS],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=bs(t).image,{width:h=l.width,height:d=l.height,repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:p=l.x,y:g=l.y,cornerRadius:m=l.cornerRadius,fillStrokeOrder:_=l.fillStrokeOrder,image:f}=t.attribute,v=this.valid(t,l,a);if(!v)return;const{fVisible:b,sVisible:x,doFill:S,doStroke:M}=v;e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,s,S,!1,b,!1,l,n,a);const k=()=>{if(S)if(a)a(e,t.attribute,l);else if(b){if(!f||!t.resources)return;const n=t.resources.get(f);if("success"!==n.state)return;let r=!1;0===m||y(m)&&m.every((t=>0===t))||(e.beginPath(),qa(e,i,s,h,d,m),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,s,l);let a=0;if("repeat"===c&&(a|=1),"repeat"===u&&(a|=2),a){const t=e.createPattern(n.data,jS[a]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,h,d),e.translate(-i,-s,!0)}else e.drawImage(n.data,i,s,h,d);r&&e.restore()}},A=()=>{M&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,p-i,g-s,l),e.stroke()))};_?(A(),k()):(k(),A()),this.afterRenderStep(t,e,i,s,S,!1,b,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&S(s))return void on.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=bs(t).image;this._draw(t,a,!1,i)}};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}([V(),YS(0,$(K)),YS(0,X(co)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],HS);let zS=!1;const NS=new I((t=>{zS||(zS=!0,t(Br).to(HS).inSingletonScope(),t(Mr).toService(Br),t(co).toService(xo),Z(t,co))}));let VS=class{constructor(){this.type="image",this.numberType=Gn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};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}([V()],VS);let WS=!1;const GS=new I(((t,e,i,s)=>{WS||(WS=!0,t(V_).to(VS).inSingletonScope(),t(ef).toService(V_))}));let US=class{constructor(){this.type="image",this.numberType=Gn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};US=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}([V()],US);let $S=!1;const XS=new I(((t,e,i,s)=>{$S||($S=!0,t(D_).to(US).inSingletonScope(),t(US).toService(D_))}));function KS(){KS.__loaded||(KS.__loaded=!0,ca.RegisterGraphicCreator("image",BS),Xi.load(NS),Xi.load(w_?GS:XS))}KS.__loaded=!1;const qS=KS,ZS=["segments","points","curveType","curveTension",...kn];class JS extends En{constructor(t={}){super(t),this.type="line",this.numberType=Un}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=fn(i,s,e))}getGraphicTheme(){return bs(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Si.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return Si.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&&"zero"!==r&&"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&&"zero"!==r&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,ZS)}needUpdateTag(t){return super.needUpdateTag(t,ZS)}toCustomPath(){const t=this.attribute,e=new Ze,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 JS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return JS.NOWORK_ANIMATE_ATTR}}function QS(t){return new JS(t)}JS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Cn);let tM=!1;const eM=new I((t=>{tM||(tM=!0,t(Eo).toSelf().inSingletonScope(),t(Do).toSelf().inSingletonScope(),t(Ar).to(Eo).inSingletonScope(),t(Mr).toService(Ar))}));class iM extends wo{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 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=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Fa(s,n+r,s.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zr.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let sM=class extends iM{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Un}};sM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],sM);let nM=!1;const rM=new I(((t,e,i,s)=>{nM||(nM=!0,t(W_).to(sM).inSingletonScope(),t(ef).toService(W_))}));let aM=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Un}};aM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],aM);let oM=!1;const lM=new I(((t,e,i,s)=>{oM||(oM=!0,t(O_).to(aM).inSingletonScope(),t(T_).toService(O_))}));function hM(){hM.__loaded||(hM.__loaded=!0,ca.RegisterGraphicCreator("line",QS),Xi.load(eM),Xi.load(w_?rM:lM))}hM.__loaded=!1;const dM=hM,cM=["path","customPath",...kn];class uM extends En{constructor(t){super(t),this.type="path",this.numberType=$n}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 Ze?e.path:(D(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ze?this.cache:t.path)}getGraphicTheme(){return bs(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=Si.graphicService.updateTempAABBBounds(i);$v(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return Si.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;S(t.path,!0)?this.cache=(new Ze).fromString(t.path):t.customPath&&(this.cache=new Ze,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,cM)}needUpdateTag(t){return super.needUpdateTag(t,cM)}toCustomPath(){return(new Ze).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new uM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return uM.NOWORK_ANIMATE_ATTR}}function pM(t){return new uM(t)}uM.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Cn);const gM=Bo,mM=bo;var _M=function(t,e){return function(i,s){e(i,s,t)}};let fM=class extends wo{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=$n,this.builtinContributions=[mM,gM],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=null!==(l=this.tempTheme)&&void 0!==l?l:bs(t,null==r?void 0:r.theme).path,{x:u=c.x,y:p=c.y,fillStrokeOrder:g=c.fillStrokeOrder}=t.attribute,m=null!==(h=this.z)&&void 0!==h?h:0,_=this.valid(t,c,a,o);if(!_)return;const{fVisible:f,sVisible:v,doFill:y,doStroke:b}=_;e.beginPath(),t.pathShape?ye(t.pathShape.commandList,e,i,s,1,1,m):ye((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,s,1,1,m),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,y,b,f,v,c,n,a,o);const x=()=>{b&&(o?o(e,t.attribute,c):v&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,c),e.stroke()))},S=()=>{y&&(a?a(e,t.attribute,c):f&&(e.setCommonStyle(t,t.attribute,u-i,p-s,c),e.fill()))};g?(x(),S()):(S(),x()),this.afterRenderStep(t,e,i,s,y,b,f,v,c,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};fM=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}([V(),_M(0,$(K)),_M(0,X(uo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fM);let vM=!1;const yM=new I((t=>{vM||(vM=!0,t(fM).toSelf().inSingletonScope(),t(wr).to(fM).inSingletonScope(),t(Mr).toService(wr),t(uo).toService(xo),Z(t,uo))}));let bM=class extends iM{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=$n}};bM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(wr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bM);let xM=!1;const SM=new I(((t,e,i,s)=>{xM||(xM=!0,t(G_).to(bM).inSingletonScope(),t(ef).toService(G_))}));let MM=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=$n}};MM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(wr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],MM);let kM=!1;const AM=new I(((t,e,i,s)=>{kM||(kM=!0,t(P_).to(MM).inSingletonScope(),t(T_).toService(P_))}));function wM(){wM.__loaded||(wM.__loaded=!0,ca.RegisterGraphicCreator("path",pM),Xi.load(yM),Xi.load(w_?SM:AM))}wM.__loaded=!1;const TM=wM,LM=[[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 CM extends Kv{constructor(t){super(t),this.type="rect3d",this.numberType=Zn}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=pt(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e=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}([V()],DM);let OM=!1;const PM=new I((t=>{OM||(OM=!0,t(Cr).to(DM).inSingletonScope(),t(Mr).toService(Cr))}));let RM=class extends sf{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Zn,this.themeType="rect"}};RM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Cr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],RM);let BM=!1;const IM=new I(((t,e,i,s)=>{BM||(BM=!0,t($_).to(RM).inSingletonScope(),t(ef).toService($_))}));function FM(){FM.__loaded||(FM.__loaded=!0,ca.RegisterGraphicCreator("rect3d",EM),Xi.load(PM),Xi.load(IM))}FM.__loaded=!1;const YM=FM;class jM{constructor(t,e,i,s,n,r,a,o,l,h,d,c,u,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Mi[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);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=-n:"center"===this.globalAlign&&(o=-n/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;ithis[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;ithis[this.directionKey.top]+l||rthis[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,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;it&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width;let n=this.height||s||0;n=Math.min(n,s);let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;ithis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+n>this[this.directionKey.top]+r||at&&(t=n),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;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+nthis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),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}}}class HM{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const s=xn(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof s?s>this.fontSize?s:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:a,width:o}=Di(t,i);let l=0,h=0,d=0;this.height>r&&(l=(this.height-r)/2,h=Math.ceil(l),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=r-l):"bottom"===this.textBaseline?(this.ascent=r-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=a+d),this.length=t.length,this.width=o||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,"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}=Di(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,s,n){let r=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Li(r,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=Di(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||false;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Ti(t,e)}(t,this.character),t.strokeText(r,a,e)),function(t,e){const i=e&&e.fill||true;if(!i)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.fillStyle=i,Ti(t,e)}(t,this.character),this.character.fill&&t.fillText(r,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&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=Li(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=Di(this.text.slice(t),this.character);return i+this.ellipsisWidth-s}return i}}class zM extends RS{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,i)=>{if(y(i)&&-1!==i.indexOf("margin")||"margin"===i)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:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class NM{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof zM?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Mi[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof HM){const e=wi.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,s=this.height;let n=this.left,r=0;this.actualWidtht.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=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 zM)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=Di(r,i.character),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}this.paragraphs.map(((e,n)=>{if(e instanceof zM)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);e.draw(t,s+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof zM)break;const{width:n}=Di(t,s.character),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof zM?t.width:t.getWidthWithEllips(this.direction)})),i}}class VM{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=Mi[this.direction]}store(t){if(t instanceof zM){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 NM(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,e=!1){t instanceof zM?"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&&("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,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Li(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new HM(i,t.newLine,t.character),new HM(s,!0,t.character)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const WM=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...kn];class GM extends En{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Jn,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:yi.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:yi.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:yi.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:yi.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:yi.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:yi.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:yi.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:yi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return bs(this).richtext}updateAABBBounds(t,e,i){const{width:s=e.width,height:n=e.height,maxWidth:r=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(s>0&&n>0)i.set(0,0,s,n);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=s||e||0,h=n||o||0;h="number"==typeof a&&h>a?a:h||0,l="number"==typeof r&&l>r?r:l||0,i.set(0,0,l,h)}let h=0;switch(l){case"top":h=0;break;case"middle":h=-i.height()/2;break;case"bottom":h=-i.height()}let d=0;switch(o){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}return i.translate(d,h),Si.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Si.graphicService.updateHTMLTextAABBBounds(t,e,i),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,WM)}needUpdateTag(t){return super.needUpdateTag(t,WM)}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{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,_.push(t)}}else{const e=this.combinedStyleToCharacter(f[t]);if(h(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i0,y="number"==typeof n&&Number.isFinite(n)&&n>0,b="number"==typeof r&&Number.isFinite(r)&&r>0&&(!v||r<=s),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=n),S=new jM(0,0,(b?r:v?s:0)||0,(x?a:y?n:0)||0,o,l,d,c,u,p||"horizontal",!b&&v,!x&&y,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),M=new VM(S);if(m){let t=0,e=!1;for(let i=0;i<_.length;i++){const s=_[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&S.lines[S.lines.length-1].paragraphs.push(s)):M.deal(s,!0),S.lines.length!==t&&(t=S.lines.length,M.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,S.lines[S.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,M.lineWidth=0),M.send()}}else for(let t=0;t<_.length;t++)M.deal(_[t]);if(M.send(),!("horizontal"===S.layoutDirection?b:x)){const t=S.getActualSizeWidthEllipsis();let e="horizontal"===S.layoutDirection?t.width:t.height;("horizontal"===S.layoutDirection?v:y)&&(e=Math.min(e,"horizontal"===S.layoutDirection?s:n)),S.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=S}clone(){return new GM(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,s,n,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===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;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-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return GM.NOWORK_ANIMATE_ATTR}}function UM(t){return new GM(t)}GM.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Cn);let $M=class extends wo{constructor(){super(),this.numberType=Jn,this.builtinContributions=[x_],this.init()}drawShape(t,e,i,s,n){const r=bs(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 d=Qa(o,l,!0),c=Qa(o,a,!0);d&&(e.translate(i,s),this.beforeRenderStep(t,e,i,s,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,d,c,d,c,r,n))}drawIcon(t,e,i,s,n){var r;const a=bs(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:m=a.backgroundRadius,margin:_}=t.attribute,{backgroundWidth:f=o,backgroundHeight:v=l}=t.attribute;if(_&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(f-o)/2,n=(v-l)/2;0===m?(e.beginPath(),e.rect(i-t,s-n,f,v)):(e.beginPath(),qa(e,i-t,s-n,f,v,m)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const y=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,s,o,l))}draw(t,e,i){const s=bs(t).richtext;this._draw(t,s,!1,i)}};$M=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],$M);let XM=!1;const KM=new I((t=>{XM||(XM=!0,t(Or).to($M).inSingletonScope(),t(Mr).toService(Or))}));let qM=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Jn}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};qM=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],qM);let ZM=!1;const JM=new I(((t,e,i,s)=>{ZM||(ZM=!0,t(J_).to(qM).inSingletonScope(),t(ef).toService(J_))}));let QM=!1;const tk=new I(((t,e,i,s)=>{QM||(QM=!0,t(D_).to(US).inSingletonScope(),t(US).toService(D_))}));function ek(){ek.__loaded||(ek.__loaded=!0,ca.RegisterGraphicCreator("richtext",UM),Xi.load(KM),Xi.load(w_?JM:tk))}ek.__loaded=!1;const ik=ek;function sk(t,e,i,s){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n0===t))?sk(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void sk(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],d=e[(r+1)%e.length],c=h.x-o.x,u=h.y-o.y,p=h.x-d.x,g=h.y-d.y,m=(Math.atan2(u,c)-Math.atan2(g,p))/2,_=Math.abs(Math.tan(m));let f=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,v=f/_;const y=nk(c,u),b=nk(p,g),x=Math.min(y,b);v>x&&(v=x,f=x*_);const S=rk(h,v,y,c,u),M=rk(h,v,b,p,g),k=2*h.x-S.x-M.x,A=2*h.y-S.y-M.y,w=nk(k,A),T=rk(h,nk(v,f),w,k,A);let L=Math.atan2(S.y-T.y,S.x-T.x);const C=Math.atan2(M.y-T.y,M.x-T.x);let E=C-L;E<0&&(L=C,E=-E),E>Math.PI&&(E-=Math.PI),0===r?t.moveTo(S.x+i,S.y+s):t.lineTo(S.x+i,S.y+s),E&&t.arcTo(h.x+i,h.y+s,M.x+i,M.y+s,f),t.lineTo(M.x+i,M.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,d,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,v,b,_,f,l,n,a,o);const x=()=>{v&&(a?a(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill()))},S=()=>{b&&(o?o(e,t.attribute,l):f&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke()))};g?(S(),x()):(x(),S()),this.afterRenderStep(t,e,i,s,v,b,_,f,l,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};hk=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}([V(),lk(0,$(K)),lk(0,X(po)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],hk);let dk=!1;const ck=new I((t=>{dk||(dk=!0,t(Tr).to(hk).inSingletonScope(),t(Mr).toService(Tr),t(po).toService(xo),Z(t,po))}));let uk=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Xn}};uk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],uk);let pk=!1;const gk=new I(((t,e,i,s)=>{pk||(pk=!0,t(q_).to(uk).inSingletonScope(),t(ef).toService(q_))}));let mk=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Xn}};mk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mk);let _k=!1;const fk=new I(((t,e,i,s)=>{_k||(_k=!0,t(F_).to(mk).inSingletonScope(),t(T_).toService(F_))}));function vk(){vk.__loaded||(vk.__loaded=!0,ca.RegisterGraphicCreator("polygon",lS),Xi.load(ck),Xi.load(w_?gk:fk))}vk.__loaded=!1;const yk=vk;class bk extends En{constructor(t){super(t),this.type="glyph",this.numberType=Vn,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,s){super.setAttribute(t,e,i,s),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return bs(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}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;this.stopStateAnimates();const s={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(s,r.attributes),(null===(i=r.subAttributes)||void 0===i?void 0:i.length)&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,s)=>{i.updateNormalAttrs(n[s]),i.applyStateAttrs(n[s],t,e)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new bk(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return bk.NOWORK_ANIMATE_ATTR}}function xk(t){return new bk(t)}bk.NOWORK_ANIMATE_ATTR=Cn;let Sk=class{constructor(){this.numberType=Vn}drawShape(t,e,i,s,n,r,a,o){n.drawContribution&&t.getSubGraphic().forEach((t=>{const l=n.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,s,n,r,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;if(n.highPerformanceSave(),!i.drawContribution)return;const r=bs(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:r})})),n.highPerformanceRestore()}};Sk=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}([V()],Sk);let Mk=!1;const kk=new I((t=>{Mk||(Mk=!0,t(Rr).to(Sk).inSingletonScope(),t(Mr).toService(Rr))}));class Ak{constructor(){this.type="glyph",this.numberType=Vn}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;const n=null==i?void 0:i.pickerService;if(n){let s=!1;return t.getSubGraphic().forEach((t=>{if(s)return;const r=n.pickItem(t,e,null,i);s=!(!r||!r.graphic)})),s}return!1}}let wk=class extends Ak{constructor(t){super(),this.canvasRenderer=t}};wk=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Rr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],wk);let Tk=!1;const Lk=new I(((t,e,i,s)=>{Tk||(Tk=!0,t(Q_).to(wk).inSingletonScope(),t(ef).toService(Q_))}));let Ck=class extends Ak{constructor(t){super(),this.canvasRenderer=t}};Ck=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Rr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ck);let Ek=!1;const Dk=new I(((t,e,i,s)=>{Ek||(Ek=!0,t(Y_).to(Ck).inSingletonScope(),t(Ck).toService(Y_))}));function Ok(){Ok.__loaded||(Ok.__loaded=!0,ca.RegisterGraphicCreator("glyph",xk),Xi.load(kk),Xi.load(w_?Lk:Dk))}Ok.__loaded=!1;const Pk=Ok,Rk=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Bk extends ar{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,i){w(this.attribute[t])&&w(e)&&!ws(this.attribute[t])&&!ws(e)?E(this.attribute[t],e):this.attribute[t]=e,Rk.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>Rk.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){D(e)&&(e=Object.keys(t));for(let i=0;i=.5:i<.5}return s?jk(t,e)>s:"largeText"===i?jk(t,e)>3:jk(t,e)>4.5}function jk(t,e){const i=Hk(t),s=Hk(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function Hk(t){const e=function(t){let e="",i="",s="";const n="#"===t[0]?1:0;for(let r=n;r{const i=e(t);t.isContainer&&!i&&Nk(t,e)}))}const Vk=t=>!D(t)&&!1!==t.visible;function Wk(t){return t>=0&&t3*Math.PI/2&&t<=2*Math.PI}function Gk(t,e,i){return Math.abs(t-e)Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":eMath.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:eMath.PI&&!i.includes("inside")?"bottom":"top"}}const $k=-.5*Math.PI,Xk=1.5*Math.PI,Kk="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";var qk;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(qk||(qk={}));const Zk={[qk.selectedReverse]:{},[qk.selected]:{},[qk.hover]:{},[qk.hoverReverse]:{}},Jk={container:"",width:30,height:30,style:{}},Qk=(t,e,i,s)=>new Fi(Object.assign({defaultFontParams:Object.assign({fontFamily:Kk,fontSize:14},s),getTextBounds:i?void 0:b_,specialCharSet:"-/: .,@%'\"~"+Fi.ALPHABET_CHAR_SET+Fi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function tA(t,e,i={}){if(!t)return{width:0,height:0};const s=b_({text:t,fontFamily:e.fontFamily||i.fontFamily||Kk,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:s.width(),height:s.height()}}function eA(t,e="type"){var i,s;return As(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}function iA(t){var e,i;return M(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}function sA(t,e="type"){const i=eA(t,e);return"rich"===i?ca.richtext(iA(t)):("html"===i?t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.html=s,t.text=i,t.renderable=!1,t}(t):"react"===i&&(t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.react=s,t.text=i,t.renderable=!1,t}(t)),ca.text(t))}function nA(t,e,i,s,n){"right"===t?"center"===i?e.setAttribute("x",s-n/2):"right"===i||"end"===i?e.setAttribute("x",s):e.setAttribute("x",s-n):"center"===i?e.setAttribute("x",s+n/2):"right"===i||"end"===i?e.setAttribute("x",s+n):e.setAttribute("x",s)}const rA=new Uint32Array(33),aA=new Uint32Array(33);aA[0]=0,rA[0]=~aA[0];for(let t=1;t<=32;++t)aA[t]=aA[t-1]<<1|1,rA[t]=~aA[t];function oA(t,e,i={top:0,left:0,right:0,bottom:0}){const{top:s=0,left:n=0,right:r=0,bottom:a=0}=i,o=Math.max(1,Math.sqrt(t*e/1e6)),l=~~((t+n+r+o)/o),h=~~((e+s+a+o)/o),d=t=>~~(t/o);return d.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+32)/32));function s(t,e){i[t]|=e}function n(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const n=s*t+e;return i[n>>>5]&1<<(31&n)},set:(e,i)=>{const n=i*t+e;s(n>>>5,1<<(31&n))},clear:(e,i)=>{const s=i*t+e;n(s>>>5,~(1<<(31&s)))},getRange:({x1:s,y1:n,x2:r,y2:a})=>{if(r<0||a<0||s>t||n>e)return!0;let o,l,h,d,c=a;for(;c>=n;--c)if(o=c*t+s,l=c*t+r,h=o>>>5,d=l>>>5,h===d){if(i[h]&rA[31&o]&aA[1+(31&l)])return!0}else{if(i[h]&rA[31&o])return!0;if(i[d]&aA[1+(31&l)])return!0;for(let t=h+1;t{if(r<0||a<0||i>t||n>e)return;let o,l,h,d,c;for(;n<=a;++n)if(o=n*t+i,l=n*t+r,h=o>>>5,d=l>>>5,h===d)s(h,rA[31&o]&aA[1+(31&l)]);else for(s(h,rA[31&o]),s(d,aA[1+(31&l)]),c=h+1;c{let a,o,l,h,d;for(;i<=r;++i)if(a=i*t+e,o=i*t+s,l=a>>>5,h=o>>>5,l===h)n(l,aA[31&a]|rA[1+(31&o)]);else for(n(l,aA[31&a]),n(h,rA[1+(31&o)]),d=l+1;di<0||s<0||r>=e||n>=t,toImageData:s=>{const n=s.createImageData(t,e),r=n.data;for(let s=0;s>>5]&1<<(31&n);r[a+0]=255*o,r[a+1]=255*o,r[a+2]=255*o,r[a+3]=31}return n}}}(l,h),d.x=t=>~~((t+n)/o),d.y=t=>~~((t+s)/o),d.ratio=o,d.padding=i,d.width=t,d.height=e,d}function lA(t,e){const{x1:i,x2:s,y1:n,y2:r}=e,a=js(i,0,t.width),o=js(s,0,t.width),l=js(n,0,t.height),h=js(r,0,t.height);return{x1:t.x(a),x2:t.x(o),y1:t.y(l),y2:t.y(h)}}function hA(t,e,i=!1){return i?lA(t,e):{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}function dA(t,e,i,s=!0,n=0){let r=i;n>0&&(r={x1:i.x1-n,x2:i.x2+n,y1:i.y1-n,y2:i.y2+n}),r=hA(t,r);const a=e.outOfBounds(r);return!(s&&a||(a&&(r=lA(t,r)),e.getRange(r)))}function cA(t,e,i,s=[],n=!0,r=0){const a=s.filter((t=>M(t)));for(let s=0;sa(n.AABBBounds,r,t,s.offset)));return cA(t,e,n,o,h,d)}return!1}var c;if("moveY"===i.type){const s=(i.offset?ws(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return cA(t,e,n,s,h,d)}if("moveX"===i.type){const s=(i.offset?ws(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return cA(t,e,n,s,h,d)}return!1}const pA=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],gA=["top","inside-top","inside"];function mA(t,e,i){const{x1:s,x2:n,y1:r,y2:a}=t.AABBBounds,o=Math.min(s,n),l=Math.max(s,n),h=Math.min(r,a),d=Math.max(r,a);let c=0,u=0;return o<0&&l-o<=e?c=-o:l>e&&o-(l-e)>=0&&(c=e-l),h<0&&d-h<=i?u=-h:d>i&&h-(d-i)>=0&&(u=i-d),{dx:c,dy:u}}class _A extends Rs{constructor(t,e,i,s,n){super(t,e,i,s,n)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,s,n,r,a,o;this.fromNumber=h(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=h(null===(s=this.to)||void 0===s?void 0:s.text)?null===(n=this.to)||void 0===n?void 0:n.text:Number.parseFloat(null===(r=this.to)||void 0===r?void 0:r.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(St(this.fromNumber),St(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}var fA;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(fA||(fA={}));class vA extends Rs{constructor(t,e,i,s,n){var r,a;super(t,e,i,s,n),this.newPointAnimateType=null!==(r=null==n?void 0:n.newPointAnimateType)&&void 0!==r?r:"grow",this.clipRangeByDimension=null!==(a=null==n?void 0:n.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t,e=!1){if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var s,n;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(n=null===(s=t.points)||void 0===s?void 0:s.length)&&void 0!==n?n:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let s,n,r=1/0,a=-1/0;for(let t=0;t=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,n=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],il(this.clipRange)?this.clipRange=js(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const l=i.get(t.context);return l?(o=l,[l,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:ea&&n?[n,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],s=new be(e.x,e.y,e.x1,e.y1);return s.defined=i.defined,s.context=i.context,s}))}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const s=_n(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const s=t+this.segmentsCache[i],n=this.points.slice(t,s);return t=s,Object.assign(Object.assign({},e),{points:n})}))}else i.points=this.points}}class yA extends Rs{constructor(t,e,i,s,n){super(null,null,i,s,n),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==n?void 0:n.group,this._clipGraphic=null==n?void 0:n.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:he.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:he.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;const s={};Object.keys(this.clipFromAttribute).forEach((t=>{s[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*e})),this._clipGraphic.setAttributes(s,!1,{type:he.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class bA extends yA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p,g,m,_;const f=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},v=null!==(o=f.width)&&void 0!==o?o:0,y=null!==(l=f.height)&&void 0!==l?l:0,b=null!==(h=null==n?void 0:n.animationType)&&void 0!==h?h:"in",x=null!==(d=null==n?void 0:n.startAngle)&&void 0!==d?d:0,S=null!==(c=null==n?void 0:n.orient)&&void 0!==c?c:"clockwise";let M=0,k=0;"anticlockwise"===S?(k="in"===b?x+2*Math.PI:x,k=x+2*Math.PI):(M=x,k="out"===b?x+2*Math.PI:x);const A=Si.graphicService.creator.arc({x:null!==(p=null===(u=null==n?void 0:n.center)||void 0===u?void 0:u.x)&&void 0!==p?p:v/2,y:null!==(m=null===(g=null==n?void 0:n.center)||void 0===g?void 0:g.y)&&void 0!==m?m:y/2,outerRadius:null!==(_=null==n?void 0:n.radius)&&void 0!==_?_:(v+y)/2,innerRadius:0,startAngle:M,endAngle:k,fill:!0});let w,T;"anticlockwise"===S?(w={startAngle:x+2*Math.PI},T={startAngle:x}):(w={endAngle:x},T={endAngle:x+2*Math.PI}),super("in"===b?w:T,"in"===b?T:w,i,s,{group:null==n?void 0:n.group,clipGraphic:A})}}class xA extends yA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p;const g=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},m=null!==(l=null!==(o=null==n?void 0:n.width)&&void 0!==o?o:g.width)&&void 0!==l?l:0,_=null!==(d=null!==(h=null==n?void 0:n.height)&&void 0!==h?h:g.height)&&void 0!==d?d:0,f=null!==(c=null==n?void 0:n.animationType)&&void 0!==c?c:"in",v=null!==(u=null==n?void 0:n.direction)&&void 0!==u?u:"x",y=null!==(p=null==n?void 0:n.orient)&&void 0!==p?p:"positive",b=Si.graphicService.creator.rect({x:0,y:0,width:"in"===f&&"x"===v?0:m,height:"in"===f&&"y"===v?0:_,fill:!0});let x={},S={};"y"===v?"negative"===y?(x={y:_,height:0},S={y:0,height:_}):(x={height:0},S={height:_}):"negative"===y?(x={x:m,width:0},S={x:0,width:m}):(x={width:0},S={width:m}),super("in"===f?x:S,"in"===f?S:x,i,s,{group:null==n?void 0:n.group,clipGraphic:b})}}class SA extends Rs{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),n=this.target.getComputedAttribute("z"),r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=lt-a),this.theta=a,this.phi=r}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:s,r:n,cb:r}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,l=this.phi,h=n*Math.sin(l)*Math.cos(o)+s.x,d=n*Math.cos(l)+s.y,c=n*Math.sin(l)*Math.sin(o)+s.z;for(i.x=h,i.y=d,i.z=c,i.alpha=o+rt/2;i.alpha>lt;)i.alpha-=lt;i.alpha=lt-i.alpha,i.zIndex=-1e4*i.z,r&&r(i)}}class MA extends Rs{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((s=>{const n=s.easing,r="string"==typeof n?Ds[n]:n;e=r(e),s.onUpdate(t,e,i)})),this.updating=!1)}}const kA={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function AA(t,e){var i,s;return null!==(s=null===(i=kA[e])||void 0===i?void 0:i.call(kA,t))&&void 0!==s?s:{from:{},to:{}}}function wA(t,e,i,s){t.attribute.text!==e.attribute.text&&il(Number(t.attribute.text)*Number(e.attribute.text))&&t.animate().play(new _A({text:t.attribute.text},{text:e.attribute.text},i,s))}const TA={mode:"same-time",duration:300,easing:"linear"};function LA(t){return 3===t||4===t}function CA(t,e){const{x1:i,y1:s,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=e;return!(i<=a&&n<=a||i>=l&&n>=l||s<=o&&r<=o||s>=h&&r>=h)}const EA=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function DA(t,e,i,s,n,r){return Math.abs(e/t)0?n:-n),y:s+e*n/Math.abs(t)}:{x:i+t*r/Math.abs(e),y:s+(e>0?r:-r)}}p_(),cf(),ik(),dM();class OA extends Bk{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){const{data:i}=t,s=function(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{const e=t.target;e===this._lastHover||jm(e.states)||(e.addState(qk.hover,!0),Nk(this,(t=>{t===e||jm(t.states)||t.addState(qk.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(Nk(this,(t=>{jm(t.states)||(t.removeState(qk.hoverReverse),t.removeState(qk.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void Nk(this,(t=>{jm(t.states)||(t.removeState(qk.selectedReverse),t.removeState(qk.selected))}));jm(e.states)||(e.addState(qk.selected,!0),Nk(this,(t=>{t===e||jm(t.states)||t.addState(qk.selectedReverse,!0)})),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,s,n,r;if((null===(e=t.detail)||void 0===e?void 0:e.type)===he.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===he.ANIMATE_UPDATE&&(null===(s=t.detail.animationState)||void 0===s?void 0:s.isFirstFrameOfStep)){const e=null!==(r=null===(n=t.target)||void 0===n?void 0:n.currentStates)&&void 0!==r?r:[],i=this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)];this.updateStatesOfLabels(i,e)}}}labeling(t,e,i,s){}_getLabelLinePoints(t,e){return function(t,e){if(!t||!e)return;if(zt(t,e,!0))return;const i=Math.min(t.x1,t.x2),s=Math.min(t.y1,t.y2),n=Math.min(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.abs(t.x2-i)/2,o=Math.abs(t.y2-s)/2,l=Math.abs(e.x2-n)/2,h=Math.abs(e.y2-r)/2,d=i+a,c=s+o,u=n+l,p=r+h,g=u-d,m=p-c;return[DA(g,m,d,c,a,o),DA(-g,-m,u,p,l,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds)}_createLabelLine(t,e){const i=this._getLabelLinePoints(t,e);if(i){const s=ca.line({points:i}),{line:n={}}=t.attribute;if(n.customShape){const i=n.customShape;s.pathProxy=s=>i({text:t,baseMark:e},s,new Ze)}return e&&e.attribute.fill&&s.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!jm(this.attribute.line.style)&&s.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(s),s}}render(){if(this._prepare(),D(this._idToGraphic)||this._isCollectionBase&&D(this._idToPoint))return;const{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:s,customOverlapFunc:n}=this.attribute;let r=this.attribute.data;ws(i)&&(r=i(r));let a=this._initText(r);a=ws(s)?s(r,a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(a),ws(n)?a=n(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(a=this._overlapping(a)),ws(this.attribute.onAfterOverlapping)&&this.attribute.onAfterOverlapping(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null),a&&a.length&&a.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!1!==e&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const e=this.attribute.state;e&&!jm(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;const e=this.attribute.labelLineState;e&&!jm(e)&&(t.states=e)}_createLabelText(t){var e,i;return sA(Object.assign(Object.assign({},null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),t),"textType")}_prepare(){var t,e;const i=[];let s;if(s=ws(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),s.forEach((t=>{"willRelease"!==t.releaseStatus&&i.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(e=this._idToPoint)||void 0===e||e.clear(),this._baseMarks=i,this._isCollectionBase="line-data"===this.attribute.type,!i||0===i.length)return;const{data:n}=this.attribute;if(n&&0!==n.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e!!t&&!0!==t)):r.attribute.stroke:r.attribute.fill},e),n),o=this._createLabelText(a);i.push(o)}return i}_layout(t){const{position:e,offset:i}=this.attribute;for(let s=0;sl(e.attribute.data)-l(t.attribute.data)))),"shiftY"===(null==o?void 0:o.type)?this._overlapGlobal(t,n,h,d):this._overlapByStrategy(t,n,h,d)}_overlapGlobal(t,e,i,s){let n=t.filter((t=>t.attribute.visible&&0!==t.attribute.opacity));const{clampForce:r=!0,hideOnHit:a=!0,overlapPadding:o,strategy:l}=e;if(r)for(let e=0;es>t&&e>i,l=new Map,h=t=>l.get(t).y0,d=t=>l.get(t).y,c=t=>l.get(t).height,u=t=>l.get(t).x1,p=t=>l.get(t).x2,g=(t,e)=>{l.get(t).y=e};for(const e of t){const{y1:t,y2:i,x1:s,x2:n}=e.AABBBounds;l.set(e,{y0:t,y:t,height:i-t,x1:s,x2:n})}for(let e=0;ed(t)-d(e)));let e=0;for(let i=0;ir?g(s,t-(n-l)):t-i<0?g(a,o+(n-l)):(g(s,t-i),g(a,o+i))}}}if(e"bound"===t.type));r&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&s.setRange(hA(i,t.AABBBounds,!0))}))),h.length>0&&h.forEach((t=>{S(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&s.setRange(hA(i,t.AABBBounds,!0))})):t.AABBBounds&&s.setRange(hA(i,t.AABBBounds,!0))}));for(let e=0;ee.name===t),!0)}getGraphicBounds(t,e={}){if(t){if(!1!==t.attribute.visible)return t.AABBBounds;const{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}const{x:i,y:s}=e;return{x1:i,x2:i,y1:s,y2:s}}_renderLabels(t){var e;const{syncState:i}=this.attribute,s=new Map,n=this._graphicToText||new Map,r=[],a=[],{visible:o}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t&&t.forEach(((t,e)=>{var l;const h=this.getRelatedGraphic(t.attribute),d=this._isCollectionBase?t.attribute.id:h,c=(null==n?void 0:n.get(d))?"update":"enter";let u;if(o&&(u=this._createLabelLine(t,h)),i&&this.updateStatesOfLabels([u?{text:t,labelLine:u}:{text:t}],null!==(l=h.currentStates)&&void 0!==l?l:[]),"enter"===c)r.push(t),s.set(d,u?{text:t,labelLine:u}:{text:t}),this._addLabel({text:t,labelLine:u},r,a,e);else if("update"===c){const e=n.get(d);n.delete(d),s.set(d,e),this._updateLabel(e,{text:t,labelLine:u})}})),this._removeLabel(n),this._graphicToText=s}_addLabel(t,e,i,s){const{text:n,labelLine:r}=t,a=this.getRelatedGraphic(n.attribute);if(this._syncStateWithRelatedGraphic(a),!1!==this._enableAnimation&&!1!==this._animationConfig.enter){if(a){const{from:t,to:o}=AA(n.attribute,"fadeIn");n&&this.add(n),r&&(i.push(r),this.add(r)),this._animationConfig.enter.duration>0&&a.once("animate-bind",(l=>{n.setAttributes(t),r&&r.setAttributes(t);const h=this._afterRelatedGraphicAttributeUpdate(n,e,r,i,s,a,o,this._animationConfig.enter);a.on("afterAttributeUpdate",h)}))}}else n&&this.add(n),r&&this.add(r)}_updateLabel(t,e){const{text:i,labelLine:s}=t,{text:n,labelLine:r}=e;if(!1!==this._enableAnimation&&!1!==this._animationConfig.update){const{duration:e,easing:a}=this._animationConfig.update;(function(t,e,i){if(!y(i)){const{duration:s,easing:n,increaseEffect:r=!0}=i;return t.animate().to(e.attribute,s,n),void(r&&"text"===t.type&&"text"===e.type&&wA(t,e,s,n))}i.forEach((i=>{const{duration:s,easing:n,increaseEffect:r=!0,channel:a}=i,{to:o}=((t,e,i,s)=>{const n=Object.assign({},t.attribute),r=Object.assign({},e.attribute);return Na(null==s?void 0:s.excludeChannels).forEach((t=>{delete r[t]})),Object.keys(r).forEach((t=>{i&&!i.includes(t)&&delete r[t]})),{from:n,to:r}})(t,e,a,i.options);jm(o)||t.animate().to(o,s,n),r&&"text"===t.type&&"text"===e.type&&wA(t,e,s,n)}))})(i,n,this._animationConfig.update),s&&r&&t.labelLine.animate().to(r.attribute,e,a)}else t.text.setAttributes(n.attribute),s&&r&&t.labelLine.setAttributes(r.attribute)}_removeLabel(t){const e=t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)};if(!1!==this._enableAnimation&&!1!==this._animationConfig.exit){const{duration:i,easing:s}=this._animationConfig.exit;t.forEach((t=>{var n;null===(n=t.text)||void 0===n||n.animate().to(AA(t.text.attribute,"fadeOut").to,i,s).onEnd((()=>{e(t)}))}))}else t.forEach((t=>{e(t)}))}updateStatesOfLabels(t,e){t.forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,s,n,r,a,{mode:o,duration:l,easing:h,delay:d}){const c=u=>{var p,g,m;const{detail:_}=u;if(!_)return{};const f=null===(p=_.animationState)||void 0===p?void 0:p.step;if(_.type!==he.ANIMATE_UPDATE||!f||"wait"===f.type&&null==(null===(g=f.prev)||void 0===g?void 0:g.type))return{};if(_.type===he.ANIMATE_END)return t.setAttributes(a),void(i&&i.setAttributes(a));const v=()=>{r&&(r.onAnimateBind=void 0,r.removeEventListener("afterAttributeUpdate",c))};switch(o){case"after":_.animationState.end&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h));break;case"after-all":n===e.length-1&&_.animationState.end&&(e.forEach((t=>{t.animate({onStart:v}).wait(d).to(a,l,h)})),s.forEach((t=>{t.animate().wait(d).to(a,l,h)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!r.containsPoint(e.x,e.y,le.LOCAL,null===(m=this.stage)||void 0===m?void 0:m.getPickerService())||(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}else _.animationState.isFirstFrameOfStep&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}};return c}_smartInvert(t){var e,i,s,n,r;const a=As(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:o,contrastRatiosThreshold:l,alternativeColors:h,mode:d,interactInvertType:c}=a,u=null!==(e=a.fillStrategy)&&void 0!==e?e:"invertBase",p=null!==(i=a.strokeStrategy)&&void 0!==i?i:"base",g=null!==(s=a.brightColor)&&void 0!==s?s:"#ffffff",m=null!==(n=a.darkColor)&&void 0!==n?n:"#000000",_=null!==(r=a.outsideEnable)&&void 0!==r&&r;if("null"!==u||"null"!==p)for(let e=0;e{PA[t]=e};class BA{constructor(t,e,i,s,n,r,a,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=n,this.middleAngle=r,this.innerRadius=a,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class IA extends OA{constructor(t,e){const{data:i}=t,s=function(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);nthis.getGraphicBounds(t))),a=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"});let o=1/0;if(!1!==a.ellipsis){const t=this._createLabelText(a),e=this.getGraphicBounds(t);o=e.x2-e.x1}const l=n.map((t=>t.attribute)),h=Array.from(this._idToGraphic.values());this._line2MinLength=ws(this.attribute.line.line2MinLength)?this.attribute.line.line2MinLength(t,h,this.attribute):this.attribute.line.line2MinLength,this._alignOffset=null!==(e=ws(this.attribute.layout.alignOffset)?this.attribute.layout.alignOffset(t,h,this.attribute):this.attribute.layout.alignOffset)&&void 0!==e?e:0;const d=this.layoutArcLabels(this.attribute.position,this.attribute,h,l,r,o);for(let t=0;t{var i;return(null===(i=t.refDatum)||void 0===i?void 0:i.id)===e.id}));if(r){const e={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,points:r.pointA&&r.pointB&&r.pointC?[r.pointA,r.pointB,r.pointC]:void 0,line:r.labelLine};"richtext"===n[t].type?e.width=null!==(i=r.labelLimit)&&void 0!==i?i:n[t].attribute.width:e.maxLineWidth=null!==(s=r.labelLimit)&&void 0!==s?s:n[t].attribute.maxLineWidth,n[t].setAttributes(e)}}return n}layoutArcLabels(t,e,i,s,n,r){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=r;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)})),s.forEach(((t,i)=>{var r,o;const l=this._idToGraphic.get(t.id).attribute,h={x:null!==(r=null==l?void 0:l.x)&&void 0!==r?r:0,y:null!==(o=null==l?void 0:l.y)&&void 0!==o?o:0};if(!D(s[i])&&!D(n[i])){const t=s[i]?s[i]:null,r=n[i]?n[i]:{x1:0,x2:0,y1:0,y2:0},o=(l.startAngle+l.endAngle)/2,c=l.endAngle-l.startAngle,u=Dt(l.endAngle-c/2),p=Tt(h,l.outerRadius,o),g=Tt(h,a+e.line.line1MinLength,o),m=new BA(t,p,g,u,c,o,l.innerRadius,l.outerRadius,h);m.pointA=Tt(h,this.computeDatumRadius(2*h.x,2*h.y,l.outerRadius),m.middleAngle),m.labelSize={width:r.x2-r.x1,height:r.y2-r.y1},1===(d=m.quadrant)||2===d?this._arcRight.set(m.refDatum,m):LA(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}var d}));const o=Array.from(this._arcLeft.values()),l=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":case"inside-center":h.push(...this._layoutInsideLabels(l,e,i)),h.push(...this._layoutInsideLabels(o,e,i));break;default:h.push(...this._layoutOutsideLabels(l,e,i)),h.push(...this._layoutOutsideLabels(o,e,i))}return h}_layoutInsideLabels(t,e,i){var s,n;const r=e,a=r.spaceWidth,o=null!==(s=r.position)&&void 0!==s?s:"inside",l=null!==(n=r.offsetRadius)&&void 0!==n?n:-a;return t.forEach((t=>{var i,s,n;const{labelSize:h,radian:d}=t,c=t.innerRadius,u=t.outerRadius;let p;if(d<(g=u,(m=h.height)>2*g?NaN:2*Math.asin(m/2/g)))p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=u-t-a}var g,m;!0!==r.rotate&&(p=u-a);const _=this._getFormatLabelText(t.refDatum,p);t.labelText=_;const f=Math.min(p,t.labelSize.width),v=this._computeAlign(t,e);let y,b=0;if("inside"===o&&(b="left"===v?f:"right"===v?0:f/2),y="inside-inner"===o?c-l+b:"inside-center"===o?c+(u-c)/2:u+l-b,t.labelPosition=Tt(t.circleCenter,y,t.middleAngle),t.labelLimit=f,is(f,0)||(t.labelVisible=!1),!1!==r.rotate){t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:t.middleAngle;let a=null!==(n=r.offsetAngle)&&void 0!==n?n:0;["inside-inner","inside-outer"].includes(o)&&(a+=Math.PI/2),t.angle+=a}})),t}_layoutOutsideLabels(t,e,i){var s,n,r;const a=null!==(s=i[0].attribute.x)&&void 0!==s?s:0,o=2*(null!==(n=i[0].attribute.y)&&void 0!==n?n:0),l=e.layout,h=e.spaceWidth;if(t.forEach((t=>{const e=LA(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+this._line2MinLength+h),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===l.strategy){for(const s of t){const{labelPosition:t,labelSize:n}=s;s.labelLimit=n.width,s.pointB=LA(s.quadrant)?{x:t.x+n.width/2+this._line2MinLength+h,y:t.y}:{x:t.x-n.width/2-this._line2MinLength-h,y:t.y},this._computeX(s,e,i)}!1===e.coverEnable&&"none"===l.strategy&&this._coverLabels(t)}else{const s=o/((null===(r=e.textStyle)||void 0===r?void 0:r.fontSize)||16);this._adjustY(t,s,e,i);const{minY:n,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(o,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),l=Math.max(Math.abs(o/2-n),Math.abs(a-o/2)),h=this._computeLayoutRadius(l,e,i);for(const s of t)this._computePointB(s,h,e,i),this._computeX(s,e,i)}const d=2*a;return t.forEach((t=>{var i,s;t.labelVisible&&(ss(t.pointB.x,this._line2MinLength+h)||is(t.pointB.x,d-this._line2MinLength-h))&&(t.labelVisible=!1),t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:0,e.offsetAngle&&(t.angle+=e.offsetAngle),t.labelLine=Object.assign(Object.assign({},e.line),{visible:t.labelVisible})})),t}_computeX(t,e,i){var s;const n=t.circleCenter,r=this.attribute.width;this.attribute.height;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,h=null===(s=e.layout)||void 0===s?void 0:s.align,d=e.spaceWidth,{labelPosition:c,quadrant:u,pointB:p}=t;il(p.x*p.y)||(t.pointC={x:NaN,y:NaN},c.x=NaN,t.labelLimit=0);const g=this.computeRadius(o,e.width,e.height),m=LA(u)?-1:1;let _=0,f=(m>0?r-p.x:p.x-0)+this._alignOffset-this._line2MinLength-d;"labelLine"===h&&(_=(g+l+this._line2MinLength)*m+n.x,f=(m>0?r-_:_-0)-d);const v=this._getFormatLabelText(t.refDatum,f);t.labelText=v;let y=Math.min(f,t.labelSize.width);switch(h){case"labelLine":break;case"edge":_=m>0?r-y-d:0+y+d;break;default:_=p.x+m*this._line2MinLength}y=Math.max(this._ellipsisWidth,y);const b=y0?r:0)-m*x+m*this._alignOffset,t.pointC.x+=m*this._alignOffset):c.x=_+m*(this._alignOffset+d+x)}_computeAlign(t,e){var i,s,n,r,a,o;const l=e,h=null!==(s=null===(i=l.textStyle)||void 0===i?void 0:i.textAlign)&&void 0!==s?s:null===(n=l.textStyle)||void 0===n?void 0:n.align,d=null!==(a=null===(r=l.layout)||void 0===r?void 0:r.textAlign)&&void 0!==a?a:null===(o=l.layout)||void 0===o?void 0:o.align;return"inside"!==l.position?D(h)||"auto"===h?"edge"===d?LA(t.quadrant)?"left":"right":LA(t.quadrant)?"right":"left":h:D(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,e,i,s){var n;s[0].attribute.x;const r=2*(null!==(n=s[0].attribute.y)&&void 0!==n?n:0),a=i.layout;if("vertical"===a.strategy){let e,i=0;const s=t.length;if(s<=0)return;for(let n=0;n=0&&t[e].getLabelBounds().y2>r;e--)t[e].labelVisible=!1}else if("none"!==a.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let o=1/0,l=-1/0;for(let h=0;hi?e.labelPosition.y=i-g.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,g,u)}else if(-1!==c&&-1===u){const i=p.labelPosition.y;ds?(e.labelPosition.y=s-g.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,p,e,n[h].originIndex)):d=0&&e0&&so)return r}r=e}return i}_findNextVisibleIndex(t,e,i,s){const n=(i-e)*s;for(let i=1;i<=n;i++){const n=e+i*s;if(t[n].labelVisible)return n}return-1}_computePointB(t,e,i,s){const n=i;let r=0;s.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,i.width,i.height),o=n.line.line1MinLength;if("none"===n.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const s=t.circleCenter,n=this.computeRadius(a,i.width,i.height),{labelPosition:r,quadrant:l}=t,h=e-Math.max(n+o,t.outerRadius),d=Math.sqrt(e**2-Math.abs(s.y-r.y)**2)-h;il(d)?t.pointB={x:s.x+d*(LA(l)?-1:1),y:r.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){const s=t.circleCenter,n={width:2*s.x,height:2*s.y};let r=0;i.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,e.width,e.height),o=e.line.line1MinLength,{width:l,height:h}=n,d=this.computeRadius(a,e.width,e.height),c=this._computeLayoutRadius(h/2,e,i),u=Math.abs(t.center.x-l/2),p=t.center.y-h/2;let g,m,_;if(es(l/2,u))g=0,m=1,_=-p;else if(es(h/2,p))g=1,m=0,_=-u;else{const t=-1/(p/u);g=t,m=-1,_=p-t*u}const f=function(t,e,i,s,n,r){if(0===t&&0===e||r<=0)return[];if(0===t){const t=-i/e,n=r**2-(t-0)**2;return n<0?[]:0===n?[{x:s,y:t}]:[{x:Math.sqrt(n)+s,y:t},{x:-Math.sqrt(n)+s,y:t}]}if(0===e){const e=-i/t,n=r**2-(e-s)**2;return n<0?[]:0===n?[{x:e,y:0}]:[{x:e,y:Math.sqrt(n)+0},{x:e,y:0-Math.sqrt(n)}]}const a=(e/t)**2+1,o=2*((i/t+s)*(e/t)-0),l=o**2-4*a*((i/t+s)**2+0-r**2);if(l<0)return[];const h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),c=-(e*h+i)/t;return 0===l?[{x:c,y:h}]:[{x:c,y:h},{x:-(e*d+i)/t,y:d}]}(g,m,_,o+d-c,0,c);if(f.length<2)return;let v,y;f[0].x>f[1].x&&f.reverse(),f[0].x<0?es(f[0].y,f[1].y)?is(t.middleAngle,-Math.PI)&&ss(t.middleAngle,0)||is(t.middleAngle,Math.PI)&&ss(t.middleAngle,2*Math.PI)?(v=0,y=f[1].y+h/2):(v=f[1].y+h/2,y=h):f[0].y{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+r,h=l-n;return Math.max((h**2+t**2)/(2*h),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,n=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[])),s&&0!==s.length||(s=[e]);const r="start"===i?0:s.length-1;return s[r]?{x1:s[r].x,x2:s[r].x,y1:s[r].y,y2:s[r].y}:void 0}labeling(t,e,i="end",s=0){return function(t,e,i="end",s=0){if(!t||!e)return{x:1/0,y:1/0};const{x1:n,x2:r}=t,a=Math.abs(r-n),o=e.x1;let l=o;return"end"===i?l=o+a/2+s:"start"===i&&(l=o-a/2-s),{x:l,y:e.y1}}(t,e,i,s)}}FA.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};const YA=()=>{RA("line",FA),RA("area",FA)};class jA extends OA{constructor(t,e){const{data:i}=t,s=function(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{if(!t)return;const{x1:n,y1:r,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-r),d=(e.x1+e.x2)/2,c=(e.y1+e.y2)/2;let u=0,p=0,g=0,m=0;e&&(g=Math.abs(e.x1-e.x2)/2,m=Math.abs(e.y1-e.y2)/2);const _={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":u=-1;break;case"right":u=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":u=Math.sin(_[i]*(Math.PI/180)),p=Math.cos(_[i]*(Math.PI/180));break;case"center":u=0,p=0}return{x:d+u*(s+g)+Math.sign(u)*(l/2),y:c+p*(s+m)+Math.sign(p)*(h/2)}})(t,e,i,s)}}jA.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};const HA=()=>{RA("symbol",jA),RA("line-data",jA)},zA=(t,e)=>{const{x1:i,x2:s,y1:n,y2:r}=t,a=Math.abs(s-i),o=Math.abs(r-n);let l=(i+s)/2,h=(n+r)/2,d=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":d=-.5;break;case"right":case"inside-right":d=.5;break;case"top-right":d=.5,c=-.5;break;case"top-left":d=-.5,c=-.5;break;case"bottom-right":d=.5,c=.5;break;case"bottom-left":d=-.5,c=.5}return l+=d*a,h+=c*o,{x:l,y:h}};class NA extends OA{constructor(t,e){const{data:i}=t,s=function(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{Mx(),TM(),fc.registerGraphic(Qd.path,pM)},WA=()=>{Mx(),fy(),RA("rect",NA),fc.registerGraphic(Qd.rect,qv)},GA=()=>{Mx(),dM(),fc.registerGraphic(Qd.rule,QS)},UA=()=>{Mx(),Uv(),HA(),fc.registerGraphic(Qd.symbol,Ev)},$A=()=>{Mx(),cf(),ik(),fc.registerGraphic(Qd.text,f_)},XA=()=>{Mx(),Pk(),fc.registerGraphic(Qd.glyph,xk)};class KA extends yx{constructor(){super(...arguments),this.type=KA.type,this._marks=[]}getMarks(){return this._marks}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}isMarkExist(t){return void 0!==this._marks.find((e=>e.id===t.id||e.name===t.name))}addMark(t){return this.isMarkExist(t)?(yl("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){const e=this._marks.findIndex((e=>e.id===t.id||e.name===t.name));return-1===e?(yl("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}getMarkInType(t){return this._marks.filter((e=>e.type===t))}getMarkInId(t){return this._marks.find((e=>e.id===t))}getMarkInName(t){return this._marks.find((e=>e.name===t))}_compileProduct(t){super._compileProduct(t),this._product.configure({zIndex:this._markConfig.zIndex}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((t=>{t.getProduct()&&t.removeProduct(),t.compile({group:this._product})}))}}KA.type="group";const qA=()=>{Mx(),p_(),fc.registerGraphic(Qd.group,or),Ql.registerMark(KA.type,KA)},ZA=(t,e)=>{const i=e.x-t.x,s=e.y-t.y;return Math.abs(i)>Math.abs(s)?i>0?"right":"left":s>0?"down":"up"},JA=(t,e)=>{const i=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);return Math.sqrt(i*i+s*s)};class QA extends(o()){constructor(t,e={}){var i,s,n,r,a,o,l,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=_g.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,s=0,n=0;for(;n{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const s=t.clone(),{x:n,y:r,pointerId:a}=s;for(let t=0,e=i.length;t({x:t.x,y:t.y}))),h=_g.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=o,1===e.length){const t=e[0],i=n-t.x,a=r-t.y,h=this.direction||ZA(t,o);this.direction=h;const d=this.getEventType(o);return s.direction=h,s.deltaX=i,s.deltaY=a,s.points=l,this.triggerStartEvent(d,s),void this.triggerEvent(d,s)}const{startDistance:d}=this,c=JA(l[0],l[1]);s.scale=c/d,s.center=this.center,s.points=l,this.triggerStartEvent("pinch",s),this.triggerEvent("pinch",s)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:s}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=_g.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||s[0],n=this.lastMovePoint||s[0],r=JA(i,n),a=r/t;a>this.config.swipe.velocity&&r>this.config.swipe.threshold&&(e.velocity=a,e.direction=ZA(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(s=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==s?s:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:s}=this;if(e)return e;let n;return n=_g.now()-i>this.config.press.time&&JA(s[0],t){for(let t=0,e=s.length;t{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let s=0,n=i.length;s{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(hc.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),this._animations=this._animations.filter((e=>e.config!==t.animationConfig||e.mark!==t.mark)),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(hc.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(hc.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(hc.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this}resume(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).enable)||void 0===i||i.call(e))})),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).disable)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).enableAnimationState)||void 0===s||s.call(i,t))})),this}disableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).disableAnimationState)||void 0===s||s.call(i,t))})),this}isAnimating(){return 0!==this._animations.length||this._additionalAnimateMarks.some((t=>{var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1}))}animate(){return this.isEnabled?(this._view.traverseMarkTree((t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1}),null,!0),this):this}animateAddition(t){var e;const i=null===(e=t.animate)||void 0===e?void 0:e.animate();return i&&i.isAnimating()&&this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(hc.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(hc.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}class iw{initAnimate(t){return this.animate=new ew(t),this.animate}}const sw=(t,e)=>{if(!t)return null;if(t.from){const i=t.from,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=_m(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.from=e.transformElementItems(s,e.mark.markType,n)}}if(t.to){const i=t.to,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=_m(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.to=e.transformElementItems(s,e.mark.markType,n)}}return t},nw=(t,e,i,s,n)=>ws(i)?i(t.getDatum(),t,n):i;class rw extends Rs{constructor(t,e,i,s,n){super(t,e,i,s,n),this._interpolator=null==n?void 0:n.interpolator,this._element=null==n?void 0:n.element}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class aw extends Rs{getEndProps(){return this.to}onBind(){var t;const e=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:Cn,i=Object.keys(e).filter((t=>0!==e[t]));this.subAnimate.animate.preventAttrs(i);const s=Object.assign({},this.from),n=Object.assign({},this.to),r=[];Object.keys(n).forEach((t=>{i.includes(t)?(s[t]=n[t],this.from[t]=n[t]):D(s[t])?s[t]=this.target.getComputedAttribute(t):r.push(t)})),this.target.animates.forEach((t=>{t!==this.subAnimate.animate&&t.preventAttrs(r)})),this._fromAttribute=s,this._toAttribute=n}onStart(){if(this._fromAttribute){const t={};Object.keys(this._fromAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._fromAttribute[e])})),this.target.setAttributes(t,!1,{type:he.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}})}}onEnd(){if(this._toAttribute){const t={};Object.keys(this._toAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._toAttribute[e])})),this.target.setAttributes(t,!1,{type:he.ANIMATE_END})}}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;const s=this.step.getLastProps();Object.keys(s).forEach((t=>{this.subAnimate.animate.validAttr(t)&&(i[t]=s[t])})),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}Is.mode|=ce.SET_ATTR_IMMEDIATELY;let ow=0;const lw=t=>{var e;if(D(t)||D(t.prototype))return!1;const i=null!==(e=t.prototype)&&void 0!==e?e:{};return i instanceof Rs||"onBind"in i&&"onStart"in i&&"onEnd"in i&&"onUpdate"in i};class hw{constructor(t,e,i){this.id=ow++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach((e=>e.stop(t))),this.animationEnd(e),this}pause(){return this.runnings.forEach((t=>t.pause())),this}resume(){return this.runnings.forEach((t=>t.resume())),this}startAt(t){return this.runnings.forEach((e=>{const i=this.unit.initialDelay;e.startAt(i+t)})),this}getTotalAnimationTime(){var t;const e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}getEndAttributes(){return this.runnings.reduce(((t,e)=>Object.assign(t,e.getEndProps())),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&(null===(e=this.callbackFunction)||void 0===e||e.call(null))}animateElement(t,e){const i=this.element.getGraphicItem();if(!i)return;const s=i.animate();this.runnings.push(s),s.startAt(this.unit.initialDelay),s.wait(this.unit.loopDelay),this.unit.timeSlices.forEach((i=>{this.animateTimeSlice(s,i,t,e)})),s.wait(this.unit.loopDelayAfter),s.loop(this.unit.loopCount-1),il(this.unit.totalTime)&&setTimeout((()=>{s&&s.stop("end")}),this.unit.totalTime),s.onEnd((()=>{this.runnings=this.runnings.filter((t=>t!==s)),0===this.runnings.length&&this.animationEnd()}))}animateTimeSlice(t,e,i,s){const n=e.delay,r=e.delayAfter,a=e.duration,o=e.effects;if(n>0&&t.wait(n),o.length<0)t.wait(a);else{const e=o.map(((t,e)=>{var n;const r=null!==(n=t.type?function(t,e,i,s){const n=ws(e.options)?e.options.call(null,t.getDatum(),t,s):e.options;if(!e.type||!fc.getAnimationType(e.type))return null;const r=fc.getAnimationType(e.type)(t,n,i);return sw(r,t)}(this.element,t,i,s):t.channel?function(t,e,i,s){const n=e.channel;let r=null;return y(n)?r=n.reduce(((e,i)=>(e.from[i]=t.getGraphicAttribute(i,!0),e.to[i]=t.getGraphicAttribute(i,!1),e)),{from:{},to:{}}):As(n)&&(r=Object.keys(n).reduce(((e,i)=>{var r,a;const o=!D(null===(r=n[i])||void 0===r?void 0:r.from),l=!D(null===(a=n[i])||void 0===a?void 0:a.to);return(o||l)&&(e.from[i]=o?nw(t,0,n[i].from,0,s):void 0,e.to[i]=l?nw(t,0,n[i].to,0,s):t.getGraphicAttribute(i,!1)),e}),{from:{},to:{}})),sw(r,t)}(this.element,t,0,s):void 0)&&void 0!==n?n:{},o=r.custom||(null==t?void 0:t.custom),l=(null==r?void 0:r.customParameters)||(null==t?void 0:t.customParameters);r.from&&Object.keys(r.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==this.element.mark.markType&&this.element.getGraphicItem().setAttributes(r.from);const h=lw(o);return D(o)||lw(o)?h?new o(r.from,r.to,a,t.easing,l):r.to?new aw(r.from,r.to,a,t.easing):void 0:new rw(r.from,r.to,a,t.easing,{interpolator:o,element:this.element,parameters:l})})).filter((t=>!D(t)));1===e.length?t.play(e[0]):e.length>1&&t.play(new MA(a,e))}r>0&&t.wait(r)}}function dw(t){let e=[];return Object.keys(t).forEach((i=>{e=e.concat(cw(i,t[i]))})),e}function cw(t,e,i=0){const s=[];let n=i;return Na(e).forEach((e=>{var i;const r=function(t){var e,i,s,n,r,a,o,l,h,d,c,u;if(D(t.timeSlices)){const h=t;return{startTime:null!==(e=h.startTime)&&void 0!==e?e:em,totalTime:h.totalTime,oneByOne:null!==(i=h.oneByOne)&&void 0!==i?i:am,loop:null!==(s=h.loop)&&void 0!==s?s:rm,controlOptions:E({},lm,null!==(n=h.controlOptions)&&void 0!==n?n:{}),timeSlices:[{duration:null!==(r=h.duration)&&void 0!==r?r:im,delay:null!==(a=h.delay)&&void 0!==a?a:sm,delayAfter:null!==(o=h.delayAfter)&&void 0!==o?o:nm,effects:[{type:h.type,channel:h.channel,custom:h.custom,easing:null!==(l=h.easing)&&void 0!==l?l:om,customParameters:h.customParameters,options:h.options}]}]}}const p=Na(t.timeSlices).filter((t=>t.effects&&Na(t.effects).filter((t=>t.channel||t.type)).length));if(p.length)return{startTime:null!==(h=t.startTime)&&void 0!==h?h:em,totalTime:t.totalTime,oneByOne:null!==(d=t.oneByOne)&&void 0!==d?d:am,loop:null!==(c=t.loop)&&void 0!==c?c:rm,controlOptions:E({},lm,null!==(u=t.controlOptions)&&void 0!==u?u:{}),timeSlices:p.map((t=>{var e,i;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:sm,delayAfter:null!==(i=t.delayAfter)&&void 0!==i?i:nm,effects:Na(t.effects).filter((t=>t.channel||t.type)).map((t=>{var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:om,customParameters:t.customParameters,options:t.options}}))}})),partitioner:t.partitioner,sort:t.sort}}(e);r&&(s.push({state:t,id:null!==(i=r.id)&&void 0!==i?i:`${t}-${n}`,timeline:r,originConfig:e}),n+=1)})),s}function uw(t,e,i){return ws(t)?t.call(null,e.getDatum(),e,i):t}class pw{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter((t=>!D(t))),this.totalTime=this.animators.reduce(((t,e)=>Math.max(t,e.getTotalAnimationTime())),0)}parallel(t){const e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach((t=>{t.parallelArrangers=e})),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){const t=this.parallelArrangers.reduce(((t,e)=>Math.max(t,e.totalTime)),this.totalTime),e=this.parallelArrangers.reduce(((t,e)=>{var i,s;return Math.max(t,null!==(s=null===(i=e.afterArranger)||void 0===i?void 0:i.endTime)&&void 0!==s?s:0)}),0);this.parallelArrangers.forEach((i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach((t=>{t.startAt(e)}))}))}}class gw{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=dw(null!=e?e:{})}getAnimationConfigs(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter((e=>e.state===t)):[]}updateConfig(t){this.configs=dw(null!=t?t:{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;const t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach((t=>{var e;t.isReserved&&t.diffState!==Jd.exit&&(t.isReserved=!1);const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.prevState;this.configs.some((e=>i!==t.diffState&&e.state===i&&e.timeline.controlOptions.stopWhenStateChange))&&this.clearElementAnimation(t,!1)})),this.configs.forEach((i=>{this.animateByTimeline(i,t,e)})),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;const e=this.configs.filter((e=>e.state===t)),i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new pw(n)}stopAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.stop())),this}pauseAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.pause())),this}resumeAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.resume())),this}run(t){if(!this.isEnabled)return;const e=cw(tm,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);const i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new pw(n)}stop(){return this.animators.forEach((t=>{t.forEach((t=>t.stop()))})),this}pause(){return this.animators.forEach((t=>t.forEach((t=>t.pause())))),this}resume(){return this.animators.forEach((t=>t.forEach((t=>t.resume())))),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach((e=>{t=t||e.some((t=>t.isAnimating))})),t}isElementAnimating(t){var e;const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return D(i)||Object.values(i).every((t=>0===t))}getAnimatorCount(){let t=0;return this.animators.forEach((e=>t+=e.length)),t}getAllAnimators(){const t=[];return this.animators.forEach((e=>{t.push(...e)})),t}getElementAnimators(t,e){var i;const s=Na(t);let n=[];return e?n=null!==(i=this.animators.get(e))&&void 0!==i?i:[]:this.animators.forEach((t=>{n=n.concat(t)})),n.filter((t=>s.includes(t.element)))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){const e=Na(t);return this.disabledStates=this.disabledStates.filter((t=>!e.includes(t))),this}disableAnimationState(t){const e=Na(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,s=!1){var n;const r=[],a=e.filter((e=>{const n=!(e.isReserved&&e.diffState===Jd.exit),r=this.getAnimationState(e),a=!this.disabledStates.includes(r),o=s||r===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,i);return n&&a&&o&&l}));if(a.length){D(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&a.sort(((e,s)=>t.timeline.sort(e.getDatum(),s.getDatum(),e,s,i)));const e={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(n=this.mark.group)&&void 0!==n?n:null,mark:this.mark,view:this.mark.view,elementCount:a.length,elementIndex:0};a.forEach(((s,n)=>{e.elementIndex=n;const o=Object.assign({[hm]:e},i),l=this.getAnimationUnit(t.timeline,s,n,a.length,o);r.push(this.animateElement(t,l,s,e,o))}))}return r}animateElement(t,e,i,s,n){var r,a;const o=new hw(i,e,t);if(o.animate(s,n),!o.isAnimating)return;i.diffState===Jd.exit&&(i.isReserved=!0);const l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;const h=null!==(r=this.elementRecorder.get(i))&&void 0!==r?r:{prevState:t.state,count:{}};h.prevState=t.state,h.count[t.state]=(null!==(a=h.count[t.state])&&void 0!==a?a:0)+1,this.elementRecorder.set(i,h);const d=this.animators.get(t.state);d?d.push(o):this.animators.set(t.state,[o]),o.callback((()=>{this.handleAnimatorEnd(o)}));const c={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(hc.ANIMATION_START,c),this.mark.emit(hc.ELEMENT_ANIMATION_START,c,i),o}getAnimationState(t){const e=Up(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}getAnimationUnit(t,e,i,s,n){const r=[],a=uw(t.startTime,e,n),o=uw(t.totalTime,e,n),l=uw(t.oneByOne,e,n),d=uw(t.loop,e,n);let c=0;t.timeSlices.forEach((t=>{var i;const a=uw(t.delay,e,n),l=uw(t.delayAfter,e,n),h=null!==(i=uw(t.duration,e,n))&&void 0!==i?i:o/s,d=Na(t.effects).map((t=>Object.assign({},t,{customParameters:uw(t.customParameters,e,n)})));r.push({effects:d,duration:h,delay:a,delayAfter:l}),c+=a+h+l}));const u=h(l)?l:!0===l?c:0;return{initialDelay:a,loopCount:h(d)?d:!0===d?1/0:1,loopDelay:u*i,loopDelayAfter:u*(s-i-1),loopAnimateDuration:c,loopDuration:c+u*(s-1),totalTime:o,timeSlices:r}}clearElementAnimation(t,e=!0){this.animators.forEach((i=>{i.forEach((i=>{i.element===t&&(i.animationOptions.state===Jd.exit?i.stop("start",!1):i.stop("end",!1),this.handleAnimatorEnd(i,e))}))})),this.elementRecorder.delete(t)}clearAllElements(){const t=this.mark.getAllElements();t&&t.forEach(((e,i)=>{this.clearElement(e,i===t.length-1)}))}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===Jd.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){const i=t.element,s=t.animationOptions,n=s.state,r=n===tm,a=this.elementRecorder.get(i).count;a[n]-=1,this.animators.set(n,this.animators.get(n).filter((e=>e!==t))),0===this.animators.get(n).length&&this.animators.delete(n),this.timelineCount[s.id]-=1;const o=0===this.timelineCount[s.id],l=r?this.immediateConfigs.find((t=>t.id===s.id)).originConfig:this.configs.find((t=>t.id===s.id)).originConfig;o&&(delete this.timelineCount[s.id],r&&(this.immediateConfigs=this.immediateConfigs.filter((t=>t.id!==s.id)))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():n===Jd.exit&&0===a[Jd.exit]&&this.clearElement(i));const h={mark:this.mark,animationState:n,animationConfig:l};o&&this.mark.emit(hc.ANIMATION_END,h),this.mark.emit(hc.ELEMENT_ANIMATION_END,h,i)}}class mw{constructor(){this.animate=new gw(this,{})}initAnimate(t){this.animate||(this.animate=new gw(this,t.animation),this.needAnimate()&&this.animate.updateState(t.animationState))}reuseAnimate(t){this.animate=t.animate,this.animate.mark=this}updateAnimate(t){t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)}}const _w={measureText:(t,e,i,s)=>((t,e,i)=>Qk(t,e,i,{fontFamily:jh.fontFamily,fontSize:jh.fontSize}))(e,i,s).measure(t)};class fw{static instance(){return fw.instance_||(fw.instance_=new fw),fw.instance_}constructor(){this.functions={}}registerFunction(t,e){t&&e&&(this.functions[t]=e)}unregisterFunction(t){t&&delete this.functions[t]}getFunction(t){return this.functions[t]||null}getFunctionNameList(){return Object.keys(this.functions)}}const vw={WIDTH:500,HEIGHT:500,DPR:1};class yw{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:s=vw.WIDTH,height:n=vw.HEIGHT,dpr:r=vw.DPR,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=s*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}yw.env="browser";const bw=[0,0,0];let xw=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},ei),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},si),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},ni),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Ot(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Ot(1,0,0,1,0,0),this._clearMatrix=new Ot(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&g.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Ot(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return qr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(qr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(qr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=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(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,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,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,s,n,r,a){if(a=a||0,this.camera){const o=[];((t,e,i,s,n,r,a,o)=>{if(o)for(;i>e;)i-=lt;else for(;ie?1:-1);let h=e,d=h;for(;d!==i;){d=l>0?Math.min(d+l,i):Math.max(d+l,i);const e=Math.abs(d-h),o=4*Math.tan(e/4)/3,c=da);t++){const e=v.getColor(t);c.beginPath(),c.rotate(f),c.moveTo(0,0),c.lineTo(m,-2*y),c.lineTo(m,0),c.fillStyle=e,c.closePath(),c.fill()}const b=c.getImageData(0,0,u,p);return d.width=b.width,d.height=b.height,c.putImageData(b,0,0),g=t.createPattern(d,"no-repeat"),g&&Ex.Set(e,i,s,r,a,g,u,p),g}(a,this.stops,t,e,h,i,s,o,l),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,s){this.nativeContext.fillRect(t,e,i,s)}clearRect(t,e,i,s){this.nativeContext.clearRect(t,e,i,s)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Xr(bw,[t,e,i],this.modelMatrix),t=bw[0],e=bw[1],i=bw[2]);const s=this.camera.vp(t,e,i);t=s.x,e=s.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Xr(bw,[t,e,i],this.modelMatrix),t=bw[0],e=bw[1],i=bw[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Xr(bw,[e,i,s],this.modelMatrix),e=bw[0],i=bw[1],s=bw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,s){return this.nativeContext.getImageData(t,e,i,s)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=Si.global.measureTextMethod){var i,s;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Si.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:ni.fontFamily,r=null!==(s=this.fontSize)&&void 0!==s?s:ni.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,s){this.nativeContext.strokeRect(t,e,i,s)}strokeText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Xr(bw,[e,i,s],this.modelMatrix),e=bw[0],i=bw[1],s=bw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,s,r)}return this._setCommonStyle(t,e,i,s,n)}_setCommonStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=e;r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(r.fillStyle=Ya(this,l,t,i,s))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const s=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setShadowBlendStyle(t,e,s)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const s=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||o||l?(s.shadowBlur=r*this.dpr,s.shadowColor=a,s.shadowOffsetX=o*this.dpr,s.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0),h?(s.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(s.filter="blur(0px)",this._clearFilterStyle=!1),d?(s.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(s.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,s,r)}return this._setStrokeStyle(t,e,i,s,n)}_setStrokeStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=e;if(r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=n.lineWidth,stroke:o=n.stroke,lineJoin:l=n.lineJoin,lineDash:h=n.lineDash,lineCap:d=n.lineCap,miterLimit:c=n.miterLimit}=e;r.lineWidth=Fa(this,a,this.dpr),r.strokeStyle=Ya(this,o,t,i,s),r.lineJoin=l,h&&r.setLineDash(h),r.lineCap=d,r.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){const s=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?s.font=t.font:s.font=Ii(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=r,this.fontSize=a,s.textAlign="left",s.textBaseline="alphabetic"}setTextStyle(t,e,i){var s,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Ii(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,r.textAlign=null!==(s=t.textAlign)&&void 0!==s?s:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>qr.free(t))),this.stack.length=0}};xw.env="browser",xw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],xw);let Sw=class extends yw{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=Si.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new xw(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:s=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:a}=this;a.width=e*s,a.height=i*s,!a.style||this.setCanvasStyle(a,n,r,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,s,n){this.controled&&(t.style.width=`${s}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Mw(t,e){return new I((i=>{i(Ki).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(qi).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}Sw.env="browser",Sw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sw);const kw=Mw(Sw,xw);var Aw=function(t,e){return function(i,s){e(i,s,t)}};let ww=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=Si.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let s={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new qt).setValue(0,0,n,r).containsPoint(e))return s;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new Ot(1,0,0,1,0,0);let o;for(let n=t.length-1;n>=0&&(s=t[n].isContainer?this.pickGroup(t[n],e,a,i):this.pickItem(t[n],e,a,i),!s.graphic);n--)o||(o=s.group);if(s.graphic||(s.group=o),this.pickContext&&(this.pickContext.inuse=!1),s.graphic){let t=s.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(s.params={shadowTarget:s.graphic},s.graphic=t.shadowHost)}return s}containsPoint(t,e,i){var s;return!!(null===(s=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===s?void 0:s.graphic)}pickGroup(t,e,i,s){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=s.pickContext,a=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=Zr.allocate();if(Ur(i,e),a){if(i){const t=Zr.allocate();r.modelMatrix=$r(t,a,i),Zr.free(i)}}else Ur(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n{if(r.isContainer){const i=new be(e.x,e.y),a=bs(t).group,{scrollX:o=a.scrollX,scrollY:h=a.scrollY}=t.attribute;i.x-=o,i.y-=h,n=this.pickGroup(r,i,l,s)}else{const a=new be(e.x,e.y);l.transformPoint(a,a);const o=bs(t).group,{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;a.x-=h,a.y-=d;const c=this.pickItem(r,a,i,s);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==a&&Zr.free(r.modelMatrix),r.modelMatrix=a,n.graphic||n.group||!u||t.stage.camera||(n.group=t),qr.free(l),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};ww=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}([V(),Aw(0,$(K)),Aw(0,X(ta)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ww);var Tw=function(t,e){return function(i,s){e(i,s,t)}};let Lw=class extends ww{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=Ji.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,s){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n=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}([V(),Tw(0,$(K)),Tw(0,X(ef)),Tw(1,$(Ir)),Tw(2,$(K)),Tw(2,X(ta)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object])],Lw);let Cw=class{constructor(){this.type="group",this.numberType=Wn}contains(t,e,i){return!1}};Cw=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}([V()],Cw);const Ew=new I(((t,e,i,s)=>{Ew.__vloaded||(Ew.__vloaded=!0,t(tf).to(Cw).inSingletonScope(),t(ef).toService(tf),Z(t,ef))}));Ew.__vloaded=!1;const Dw=Ew,Ow=new I(((t,e,i,s)=>{i(Lw)||t(Lw).toSelf().inSingletonScope(),i(Nr)?s(Nr).toService(Lw):t(Nr).toService(Lw)}));let Pw=class{constructor(){this._uid=B.GenAutoIncrementId(),this.viewBox=new qt,this.modelMatrix=new Ot(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,s,n,r){this.modelMatrix.setValue(t,e,i,s,n,r)}getViewBoxTransform(){return this.modelMatrix}};Pw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Pw);var Rw;let Bw=Rw=class extends Pw{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Rw.idprefix}_${Rw.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=Si.global,this.viewBox=new qt,this.modelMatrix=new Ot(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>s)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const s={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Rw.GenerateCanvasId(),canvasControled:!0};this.canvas=new Sw(s)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let s=t.width,n=t.height;if(null==s||null==n||!t.canvasControled){const t=i.getBoundingClientRect();s=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/s),this.canvas=new Sw({width:s,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),s=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(s,0,0,s,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Bw.env="browser",Bw.idprefix="visactor_window",Bw.prefix_count=0,Bw=Rw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Bw);const Iw=new I((t=>{t(Bw).toSelf(),t(rs).toDynamicValue((t=>t.container.get(Bw))).whenTargetNamed(Bw.env)}));let Fw=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new qt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};Fw=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}([V()],Fw);class Yw{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function jw(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let Hw=class extends Fw{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,s;let n=0,r=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,a=n,o=r}else n=t.clientX||0,r=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=n,i=r,a=e.getBoundingClientRect(),o=null===(s=e.getNativeHandler)||void 0===s?void 0:s.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(il(l)?l:1),y:(i-a.top)/(il(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Yw(t)}return new qt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:s,style:n}=e;return n&&(S(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=s&&(t.style.height=`${s}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,s=document.createElement(e);if(this.updateDom(s,t),i){const t=S(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(s)}return s}loadImage(t){return jw(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return jw(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const s=document.createElement("canvas");t.id&&(s.id=null!==(e=t.id)&&void 0!==e?e:B.GenAutoIncrementId().toString());const n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(s.style.width=`${t.width}px`,s.style.height=`${t.height}px`,s.width=t.width*n,s.height=t.height*n),s}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let i=t.offsetTop,s=t.offsetParent;for(;null!==s;)i+=s.offsetTop,s=s.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,s=t.offsetParent;for(;null!==s;)i+=s.offsetLeft,s=s.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,s=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent;return{top:i,left:s}}};Hw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Hw);const zw=new I((t=>{zw.isBrowserBound||(zw.isBrowserBound=!0,t(Hw).toSelf().inSingletonScope(),t(tt).toService(Hw))}));function Nw(t,e=!0){Nw.__loaded||(Nw.__loaded=!0,t.load(zw),t.load(kw),t.load(Iw),e&&function(t){t.load(Dw),t.load(Ow)}(t))}zw.isBrowserBound=!1,Nw.__loaded=!1;let Vw=class extends xw{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Ot(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};Vw.env="node",Vw=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],Vw);let Ww=class extends yw{constructor(t){super(t)}init(){this._context=new Vw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...t){this._nativeCanvas.release&&ws(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Ww.env="node",Ww=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}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ww);const Gw=Mw(Ww,Vw);let Uw=class extends Pw{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:B.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Ww(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,s=t.height;null!=i&&null!=s&&t.canvasControled||(i=e.width,s=e.height),this.canvas=new Ww({width:i,height:s,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Uw.env="node",Uw=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(et)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Uw);const $w=new I((t=>{t(Uw).toSelf(),t(rs).toDynamicValue((t=>t.container.get(Uw))).whenTargetNamed(Uw.env)}));let Xw=class extends Fw{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return bn.call(t)}}getCancelAnimationFrame(){return t=>{bn.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};Xw=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}([V()],Xw);const Kw=new I((t=>{Kw.isNodeBound||(Kw.isNodeBound=!0,t(Xw).toSelf().inSingletonScope(),t(tt).toService(Xw))}));function qw(t,e=!0){qw.__loaded||(qw.__loaded=!0,t.load(Kw),t.load(Gw),t.load($w))}Kw.isNodeBound=!1,qw.__loaded=!1;const Zw={name:"dark",colorScheme:{default:{dataScheme:ih,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F",emptyCircleColor:"#bbbdc3",linearProgressTrackColor:"#404349"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};class Jw{constructor(){this.id=el(),this._plugins=[]}add(t){if(!t||0===t.length)return null;const e=[];return t.forEach((t=>{this._plugins.find((e=>e.id===t.id))?yl("不要重复添加相同的plugin"):(this._plugins.push(t),e.push(t),t.onAdd&&t.onAdd(this))})),e}load(t){const e=this.add(t);e&&e.length&&this.activate(t)}activate(t){t.length&&t.forEach((t=>{t.init&&t.init()}))}get(t){return this._plugins.find((e=>e.id===t))}getAll(){return this._plugins.slice()}release(t){const e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((t=>t!==e)))}releaseAll(){this._plugins.forEach((t=>{t.release(this)})),this._plugins=[]}clear(t){const e=this.get(t);e&&e.clear(this)}clearAll(){this._plugins.forEach((t=>{var e;null===(e=t.clear)||void 0===e||e.call(t,this)}))}}class Qw extends Jw{constructor(t){super(),this.globalInstance=t}onInit(t){this._plugins.forEach((e=>{e.onInit&&e.onInit(this,t)}))}onBeforeResize(t,e){this._plugins.forEach((i=>{i.onBeforeResize&&i.onBeforeResize(this,t,e)}))}onAfterChartSpecTransform(t,e){this._plugins.forEach((i=>{i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(this,t,e)}))}onAfterModelSpecTransform(t,e,i){this._plugins.forEach((s=>{s.onAfterModelSpecTransform&&s.onAfterModelSpecTransform(this,t,e,i)}))}onBeforeInitChart(t,e){this._plugins.forEach((i=>{i.onBeforeInitChart&&i.onBeforeInitChart(this,t,e)}))}releaseAll(){super.releaseAll(),this.globalInstance=null}}class tT{constructor(t,e){this.references=new Map,this.view=t,this.depend(null==e?void 0:e.dependency)}getStartState(){return null}depend(t){this.references.clear(),Na(t).map((t=>S(t)?this.view.getGrammarById(t):t)).filter((t=>!D(t))).forEach((t=>{var e;this.references.set(t,(null!==(e=this.references.get(t))&&void 0!==e?e:0)+1)}))}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}bind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.addEventListener(e,t.handler)})):"none"!==t.type&&this.view.addEventListener(t.type,t.handler))}))}unbind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.removeEventListener(e,t.handler)})):"none"!==t.type&&this.view.removeEventListener(t.type,t.handler))}))}start(t){}reset(t){}dispatchEvent(t,e){this.view.emit(`${this.type}:${t}`,e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}class eT extends tT{constructor(t,e){super(t,e),this.type=eT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},eT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){t&&this._marks&&this._marks.includes(t.mark)&&t.addState(this.options.state)}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&t.removeState(this.options.state)}}eT.type="element-active",eT.defaultOptions={state:cc.active,trigger:"pointerover",triggerOff:"pointerout"};const iT=t=>t.filterField?e=>{var i;return null===(i=e.getDatum())||void 0===i?void 0:i[t.filterField]}:e=>e[t.filterType],sT=(t,e)=>{if(!e||!t)return null;const i={};return t.forEach((t=>{const s=t&&t.getSpec(),n=s&&s.encode;n&&e.forEach((e=>{e&&n[e]&&(i[e]||(i[e]=[]),i[e].push(t))}))})),i};class nT extends tT{constructor(t,e){super(t,e),this.type=nT.type,this._resetType=[],this.clearPrevElements=()=>{const{state:t,reverseState:e}=this.options;this._statedElements&&this._statedElements.length&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:this._statedElements,options:this.options}),this._statedElements=[])},this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},nT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=sT(this._marks,[this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getEvents(){const t=this.options.triggerOff,e=this.options.trigger,i=[{type:e,handler:this.handleStart}],{eventNames:s,resetType:n}=(t=>{const e=Na(t),i=[],s=[];return e.forEach((t=>{"empty"===t?i.push("view"):S(t)&&"none"!==t?t.includes("view:")?(s.push(t.replace("view:","")),i.push("view")):(s.push(t),i.push("self")):h(t)&&i.push("timeout")})),{eventNames:s,resetType:i}})(t);return s.forEach((t=>{t&&(y(e)?!e.includes(t):t!==e)&&i.push({type:t,handler:this.handleReset})})),this._resetType=n,i}start(t){const{state:e,reverseState:i,isMultiple:s}=this.options;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(e)){if(this._resetType.includes("self")){const s=this._statedElements&&this._statedElements.filter((e=>e!==t));s&&s.length?this._statedElements=this.updateStates(s,this._statedElements,e,i):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(e),this._statedElements=this.updateStates(s&&this._statedElements?[...this._statedElements,t]:[t],this._statedElements,e,i),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((()=>{this.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}nT.type="element-select",nT.defaultOptions={state:cc.selected,trigger:"click"};class rT extends tT{constructor(t,e){super(t,e),this.type=rT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},rT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=sT(this._marks,[this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getEvents(){const t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}];let i=t;return S(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}clearPrevElements(){const{highlightState:t,blurState:e}=this.options;this._lastElement&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const{highlightState:e,blurState:i}=this.options;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,e,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}rT.type="element-highlight",rT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};class aT extends tT{constructor(t,e){super(t,e),this.type=aT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{t.element&&this._marks&&this._marks.includes(t.element.mark)&&this.clearPrevElements()},this.options=Object.assign({},aT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}}aT.type="element-highlight-by-key",aT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};class oT extends tT{constructor(t,e){super(t,e),this.type=oT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},oT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.groupKey;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.groupKey===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&this.clearPrevElements()}}oT.type="element-highlight-by-group",oT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,trigger:"pointerover",triggerOff:"pointerout"};const lT=16,hT=8,dT=12;var cT,uT,pT;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(cT||(cT={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(uT||(uT={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(pT||(pT={}));class gT extends tT{constructor(t,e){super(t,e),this.type=gT.type,this.handleStart=t=>{var e,i;this.start(null===(i=null===(e=t.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},gT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:uT.legendItemHover,handler:this.handleStart},{type:uT.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){const e=t;if(D(e))return;const i=iT(this.options);this._marks.forEach((t=>{t.elements.forEach((t=>{i(t)===e?t.addState(this.options.state):t.removeState(this.options.state)}))}))}reset(){this._marks.forEach((t=>{t.elements.forEach((t=>{t.removeState(this.options.state)}))}))}}gT.type="element-active-by-legend",gT.defaultOptions={state:cc.active,filterType:"groupKey"};class mT extends tT{constructor(t,e){super(t,e),this.type=mT.type,this.handleStart=(t,e)=>{var i,s;this.start(null===(s=null===(i=t.detail)||void 0===i?void 0:i.data)||void 0===s?void 0:s.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},mT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:uT.legendItemHover,handler:this.handleStart},{type:uT.legendItemUnHover,handler:this.handleReset}]}start(t){if(D(t))return;const e=iT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}mT.type="element-highlight-by-legend",mT.defaultOptions={highlightState:cc.highlight,blurState:cc.blur,filterType:"groupKey"};class _T extends tT{constructor(t,e){super(t,e),this.type=_T.type,this.handleStart=(t,e)=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const i=this._parseTargetKey(t,e);this.start(i)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.reset()},this.options=Object.assign({},_T.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Na(this.options.graphicName);return(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.name)&&i.includes(t.target.name)}_parseTargetKey(t,e){return this.options.parseData?this.options.parseData(t):"text"===t.target.type?t.target.attribute.text:null}start(t){if(D(t))return;const e=iT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}_T.type="element-highlight-by-name",_T.defaultOptions={trigger:"pointerover",triggerOff:"pointerout",highlightState:cc.highlight,blurState:cc.blur,filterType:"groupKey"};class fT{updateStates(t,e,i,s){return t&&t.length?(i&&s?e&&e.length?(this.toggleReverseStateOfElements(t,e,s),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,s):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}toggleReverseStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)}))}toggleStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)}))}addBothStateOfElements(t,e,i){this._marks.forEach((s=>{var n;const r=i&&this._stateMarks[i]&&this._stateMarks[i].includes(s),a=e&&this._stateMarks[e]&&this._stateMarks[e].includes(s);(r||a)&&(null===(n=s.elements)||void 0===n||n.forEach((s=>{t&&t.includes(s)?a&&s.addState(e):r&&s.addState(i)})))}))}addStateOfElements(t,e){this._marks.forEach((i=>{var s;const n=e&&this._stateMarks[e]&&this._stateMarks[e].includes(i);n&&(null===(s=i.elements)||void 0===s||s.forEach((i=>{t&&t.includes(i)&&n&&i.addState(e)})))}))}clearAllStates(t,e){this._statedElements&&this._statedElements.length&&this._marks.forEach((i=>{i&&i.elements&&(e&&this._stateMarks[e]&&this._stateMarks[e].includes(i)&&i.elements.forEach((t=>{t.removeState(e)})),t&&this._stateMarks[t]&&this._stateMarks[t].includes(i)&&i.elements.forEach((e=>{this._statedElements.includes(e)&&e.removeState(t)})))}))}}var vT=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 yT{static useRegisters(t){t.forEach((t=>{"function"==typeof t?t():console.error("Invalid function:",t)}))}static useChart(t){t.forEach((t=>Ql.registerChart(t.type,t)))}static useSeries(t){t.forEach((t=>Ql.registerSeries(t.type,t)))}static useComponent(t){t.forEach((t=>Ql.registerComponent(t.type,t)))}static useMark(t){t.forEach((t=>{var e;return Ql.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}static useLayout(t){t.forEach((t=>Ql.registerLayout(t.type,t)))}static registerDataSetTransform(t,e){Ql.registerTransform(t,e)}static registerFunction(t,e){t&&e&&fw.instance().registerFunction(t,e)}static unregisterFunction(t){t&&fw.instance().unregisterFunction(t)}static getFunction(t){return t?fw.instance().getFunction(t):null}static getFunctionList(){return fw.instance().getFunctionNameList()}static registerMap(t,e,i){const s=Ql.getImplementInKey("registerMap");s&&s(t,e,i)}static unregisterMap(t){const e=Ql.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return e=t,Dp.get(e);var e}static hideTooltip(t=[]){Zh.forEach((t=>{var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}static getLogger(){return g.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}getDataSet(){return this._dataSet}constructor(t,e){var i,s,r,a,o,l,h,d;this.id=el(),this._userEvents=[],this._autoSize=!0,this._option={mode:n["desktop-browser"],onError:t=>{throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._doResize=()=>{const{width:t,height:e}=this.getCurrentSize();this._currentSize.width===t&&this._currentSize.height===e||(this._currentSize={width:t,height:e},this.resizeSync(t,e))},this._renderSync=(t={})=>{var e;return this._beforeRender(t)?(null===(e=this._compiler)||void 0===e||e.render(t.morphConfig),this._afterRender(),this):this},this._updateSpec=(t,e=!1,i)=>{var s,n;const r=this._spec,a={changeBackground:!1,reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(!this._setNewSpec(t,e))return;Im(r.theme,this._spec.theme)?Im(this._spec.background,r.background)||(a.reMake=!0,a.changeBackground=!0):a.changeTheme=!0;const o=this._shouldChartResize(r);if(a.reSize=o,null===(n=null===(s=this._compiler)||void 0===s?void 0:s.getVGrammarView())||void 0===n||n.updateLayoutTag(),this._spec.type!==r.type)return a.reMake=!0,a.reTransformSpec=!0,a.change=!0,a.changeTheme=!0,a;this._initChartSpec(this._spec,"updateSpec");const l=by(this._chart.updateSpec(this._spec),a);return i?Object.assign(Object.assign({},l),i):l},this._option=E(this._option,{animation:!1!==t.animation},e),this._onError=null===(i=this._option)||void 0===i?void 0:i.onError;const c=this._option,{dom:u,renderCanvas:p,mode:g,stage:m,poptip:_}=c,f=function(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{this._event.emit(zd.animationFinished,{chart:this._chart,vchart:this})})),this._compiler.getVGrammarView().addEventListener(hc.AFTER_VRENDER_NEXT_RENDER,(()=>{this._event.emit(zd.renderFinished,{chart:this._chart,vchart:this})})))}_bindResizeEvent(){var t,e;if(this._autoSize){if(this._onResize=qd(this._doResize,null!==(t=this._option.resizeDelay)&&void 0!==t?t:100),this._container){const t=window.ResizeObserver;t&&(this._observer=new t(this._onResize),null===(e=this._observer)||void 0===e||e.observe(this._container))}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}getCurrentSize(){var t,e,i,s;return yy(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:dh,height:null!==(s=null===(i=this._currentSize)||void 0===i?void 0:i.height)&&void 0!==s?s:ch})}_initDataSet(t){this._dataSet=t instanceof f?t:new f,Ep(this._dataSet,"dataview",b),Ep(this._dataSet,"array",e),Cp(this._dataSet,"copyDataView",Fp);for(const t in Ql.transforms)Cp(this._dataSet,t,Ql.transforms[t]);for(const t in Ql.dataParser)Ep(this._dataSet,t,Ql.dataParser[t])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return ws(t)&&(t=t()),t.reAnimate&&(this.stopAnimation(),this._updateAnimateState(!0)),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}_updateCustomConfigAndRecompile(t,e={}){return!!t&&(this._reCompile(t),this._beforeRender(e))}_reCompile(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(i=this._chart)||void 0===i||i.release(),this._chart=null,t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(s=this._currentTheme)||void 0===s?void 0:s.fontFamily)):t.changeBackground&&(null===(n=this._compiler)||void 0===n||n.setBackground(this._getBackground())),null===(r=this._compiler)||void 0===r||r.releaseGrammar(!1===(null===(a=this._option)||void 0===a?void 0:a.animation)||!1===(null===(o=this._spec)||void 0===o?void 0:o.animation)),this._userEvents.forEach((t=>{var e;return null===(e=this._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(l=this._currentTheme)||void 0===l?void 0:l.fontFamily)):t.changeBackground&&(null===(h=this._compiler)||void 0===h||h.setBackground(this._getBackground())),t.reCompile&&(null===(d=this._compiler)||void 0===d||d.clear({chart:this._chart,vChart:this},!1===(null===(c=this._option)||void 0===c?void 0:c.animation)||!1===(null===(u=this._spec)||void 0===u?void 0:u.animation)),null===(p=this._compiler)||void 0===p||p.compile({chart:this._chart,vChart:this},{})),t.reSize){const{width:t,height:e}=this.getCurrentSize();this._chart.onResize(t,e,!1),this._compiler.resize(t,e,!1)}}_beforeRender(t={}){var e,i,s,n,r,a,o,l;if(this._isReleased)return!1;if(this._chart)return!0;const{transformSpec:h,actionSource:d}=t;return h&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,d),null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeInitializeChart)||void 0===i||i.call(e,this),this._initChart(this._spec),null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterInitializeChart)||void 0===n||n.call(s,this),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(l=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===l||l.call(o),0))}_afterRender(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(zd.rendered,{chart:this._chart,vchart:this}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return vT(this,void 0,void 0,(function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})}))}_renderAsync(t={}){return vT(this,void 0,void 0,(function*(){return this._renderSync(t)}))}_updateAnimateState(t){var e,i;if(this._option.animation){const s=t?Np.appear:Np.update;null===(e=this._chart)||void 0===e||e.getAllRegions().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)})),null===(i=this._chart)||void 0===i||i.getAllComponents().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)}))}}release(){var t,e,i,s;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(i=this._eventDispatcher)||void 0===i||i.release(),null===(s=this._compiler)||void 0===s||s.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,Zh.unregisterInstance(this)}updateData(t,e,i,s){return vT(this,void 0,void 0,(function*(){return this.updateDataSync(t,e,i,s)}))}_updateDataById(t,e,i){const s=this._spec.data.find((e=>e.name===t||e.id===t));s?s.id===t?s.values=e:s.name===t&&s.parse(e,i):y(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}updateDataInBatches(t){return vT(this,void 0,void 0,(function*(){return this._chart?(this._chart.updateFullData(t.map((({id:t,data:e,options:i})=>({id:t,values:e,parser:i})))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=Na(this._spec.data),t.forEach((({id:t,data:e,options:i})=>{this._updateDataById(t,e,i)})),this)}))}updateDataSync(t,e,i,s){return D(this._dataSet)?this:this._chart?((null==s?void 0:s.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateData(t,e,!0,i),this._compiler.render(),this):(this._spec.data=Na(this._spec.data),this._updateDataById(t,e,i),this)}updateFullDataSync(t,e=!0,i){if(this._chart)return(null==i?void 0:i.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateFullData(t),e&&this._compiler.render(),this;const s=Na(this._spec.data);return Na(t).forEach((t=>{const{id:e,values:i,parser:n,fields:r}=t,a=s.find((t=>t.name===e));if(a)a instanceof R?(a.setFields(k(r)),a.parse(i,k(n))):(a.values=i,M(n)&&(a.parser=n),M(r)&&(a.fields=r));else{const e=jp(t,this._dataSet,s);y(this._spec.data)&&this._spec.data.push(e)}})),this}updateFullData(t,e=!0){return vT(this,void 0,void 0,(function*(){return this.updateFullDataSync(t,e)}))}updateSpec(t,e=!1,i,s){return vT(this,void 0,void 0,(function*(){const n=this._updateSpec(t,e,s);return n?(yield this.updateCustomConfigAndRerender(n,!1,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}))}updateSpecSync(t,e=!1,i,s){const n=this._updateSpec(t,e,s);return n?(this.updateCustomConfigAndRerender(n,!0,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}updateSpecAndRecompile(t,e=!1,i={}){const s=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(s,Object.assign({actionSource:"updateSpecAndRecompile"},i))}updateModelSpec(t,e,i=!1,s){return vT(this,void 0,void 0,(function*(){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),ws(t)||Rl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!1,i,s)}return this}))}updateModelSpecSync(t,e,i=!1,s){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),ws(t)||Rl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!0,i,s)}return this}_updateModelSpec(t,e,i=!1,s=!1,n){s&&(e=Pl({},t.getSpec(),e));const r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,i,{morphConfig:n,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){return vT(this,void 0,void 0,(function*(){return this.resizeSync(t,e)}))}resizeSync(t,e){var i,s;return this._beforeResize(t,e)?(null===(s=(i=this._compiler).resize)||void 0===s||s.call(i,t,e),this._afterResize()):this}_beforeResize(t,e){var i,s,n,r;if(!this._chart||!this._compiler)return!1;const a=this._chart.getCanvasRect();return!(a&&a.width===t&&a.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.beforeResizeWithUpdate)||void 0===s||s.call(i),this._chart.onResize(t,e,!1),null===(r=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterResizeWithUpdate)||void 0===r||r.call(n),0))}_afterResize(){return this._isReleased||this._event.emit(zd.afterResize,{chart:this._chart}),this}updateViewBox(t,e=!0,i=!0){return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}on(t,e,i){var s;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:i}),null===(s=this._event)||void 0===s||s.on(t,e,i))}off(t,e){var i;if(this._userEvents&&0!==this._userEvents.length)if(e){const s=this._userEvents.findIndex((i=>i.eType===t&&i.handler===e));s>=0&&(this._userEvents.splice(s,1),null===(i=this._event)||void 0===i||i.off(t,e))}else this._userEvents.forEach((e=>{var i;e.eType===t&&(null===(i=this._event)||void 0===i||i.off(t,e.handler))})),this._userEvents=this._userEvents.filter((e=>e.eType!==t))}updateState(t,e){this._chart&&this._chart.updateState(t,e)}setSelected(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}setHovered(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}clearState(t){this._chart&&this._chart.clearState(t)}clearAllStates(){this._chart&&this._chart.clearAllStates()}clearSelected(){this._chart&&this._chart.clearSelected()}clearHovered(){this._chart&&this._chart.clearHovered()}_updateCurrentTheme(t){var e,i,s;const n=this._option.theme,r=null===(e=this._spec)||void 0===e?void 0:e.theme,a=null===(i=this._spec)||void 0===i?void 0:i.type;t&&(this._currentThemeName=t);const o=(t,e)=>{var i;return(null===(i=e.chart)||void 0===i?void 0:i[t])&&(e=th({},e,e.chart[t])),e};let l;if(jm(n)&&jm(r))l=Qh(this._currentThemeName,!0),this._currentTheme=o(a,l);else if(S(n)&&(!r||S(r))||S(r)&&(!n||S(n))){const t=th({},Qh(this._currentThemeName,!0),Qh(n,!0),Qh(r,!0));this._currentTheme=o(a,t)}else{const t=th({},Qh(this._currentThemeName),Qh(n),Qh(r));this._currentTheme=Nh(o(a,t))}var h;h=$d(this._currentTheme,"component.poptip"),E(c_.poptip,d_,h),null===(s=this._compiler)||void 0===s||s.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let s=!1;D(this._spec.width)?!D(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(s=!0),D(this._spec.height)?!D(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(s=!0);const n=this._autoSize;return this._autoSize=!!_l(this._option.mode)&&(null===(i=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===i||i),this._autoSize!==n&&(s=!0),s}_getBackground(){return("string"==typeof this._spec.background||As(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this._currentTheme.background||this._option.background}getCurrentTheme(){return Qh(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){var e;return vT(this,void 0,void 0,(function*(){if(!Jh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),yield this.updateCustomConfigAndRerender(i,!1,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}))}setCurrentThemeSync(t){var e;if(!Jh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),this.updateCustomConfigAndRerender(i,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}_setFontFamilyTheme(t){var e;t&&(null===(e=this.getStage())||void 0===e||e.setTheme({text:{fontFamily:t}}))}_getTooltipComponent(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(r.tooltip)[0]}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;const s=this._getTooltipComponent();s&&(null===(i=null===(e=s.tooltipHandler)||void 0===e?void 0:e.release)||void 0===i||i.call(e),s.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}getTooltipHandler(){const t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;const s=this._getTooltipComponent();return null!==(i=M(t)&&"none"!==(null==s?void 0:s.showTooltip(t,e)))&&void 0!==i&&i}hideTooltip(){var t;const e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}getLegendDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.discreteLegend);s&&s[t]&&s[t].setSelectedData(e)}getDataURL(){var t;return vT(this,void 0,void 0,(function*(){const e=this.getStage();if(this._chart&&e){e.render();const t=this._chart.getCanvas();return yield h_(t,{onError:this._onError})}return null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null}))}exportImg(t){var e,i;return vT(this,void 0,void 0,(function*(){if(!_l(this._option.mode))return void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img")));const s=yield this.getDataURL();s?function(t="vchart",e){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("target","_blank"),i.setAttribute("download",`${t}.png`),i.dispatchEvent(new MouseEvent("click"))}(t,s):null===(i=this._option)||void 0===i||i.onError(new ReferenceError("render is not defined"))}))}exportCanvas(){var t;const e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if("node"!==this._option.mode)return void(null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment.")));const i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}reLayout(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}getContainer(){var t;if(M(this._container))return this._container;let e;return e=S(this._canvas)?$o.getElementById(this._canvas):this._canvas,M(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement}getComponents(){return this._chart.getAllComponents()}getScale(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==i?void 0:i.getScale(t)}setDimensionIndex(t,e={}){var i;return null===(i=this._chart)||void 0===i?void 0:i.setDimensionIndex(t,e)}stopAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.stop()}pauseAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.pause()}resumeAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.resume()}convertDatumToPosition(t,e={},i=!1,s){var n;if(!this._chart)return null;if(jm(t))return null;const{seriesId:r,seriesIndex:a=0}=e;let o;if(M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o){const e=Object.keys(t),n=o.getViewData().latestData.find((i=>e.every((e=>i[e]==t[e])))),r=o.getRegion().getLayoutStartPoint();let a;return a=n?o.dataToPosition(n,s):o.dataToPosition(t,s),a?dl(a,r,i):null}return null}convertValueToPosition(t,e,i=!1){var s,n;if(!this._chart||D(t)||jm(e))return null;if(!y(t)){const{axisId:n,axisIndex:r}=e;let a;if(M(n)?a=this._chart.getComponentsByKey("axes").find((t=>t.userId===n)):M(r)&&(a=null===(s=this._chart.getComponentsByKey("axes"))||void 0===s?void 0:s[r]),!a)return yl("Please check whether the `axisId` or `axisIndex` is set!"),null;const o=null==a?void 0:a.valueToPosition(t);if(i){const t=a.getLayoutStartPoint(),e=a.getOrient();return o+("bottom"===e||"top"===e?t.x:t.y)}return o}const{seriesId:r,seriesIndex:a}=e;let o;return M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o?dl(o.valueToPosition(t[0],t[1]),o.getRegion().getLayoutStartPoint(),i):(yl("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return fw.instance().getFunction(t)}registerFunction(t,e){t&&e&&fw.instance().registerFunction(t,e)}unregisterFunction(t){t&&fw.instance().unregisterFunction(t)}getFunctionList(){return fw.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}updateIndicatorDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.updateDatum(e)}updateIndicatorDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.indicator);s&&s[t]&&s[t].updateDatum(e)}geoZoomByIndex(t=0,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionIndex:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}geoZoomById(t,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionId:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}_initChartPlugin(){const t=Ql.getChartPlugins();t.length>0&&(this._chartPlugin=new Qw(this),this._chartPlugin.load(t.map((t=>new t))),this._chartPluginApply("onInit",this._spec))}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}_getMode(){return this._option.mode||n["desktop-browser"]}_getChartOption(t){return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:()=>this._compiler,performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:()=>{var t;return null!==(t=this._currentTheme)&&void 0!==t?t:{}},getSpecInfo:()=>{var t;return null!==(t=this._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}yT.InstanceManager=Zh,yT.ThemeManager=Jh,yT.globalConfig={uniqueTooltip:!0},yT.Utils=_w,yT.vglobal=$o,Ql.registerRegion("region",Uy),Ql.registerLayout("base",tb),qA(),r_.useRegisters([()=>{fc.registerStageEventPlugin("gesture",QA)}]),tw(rT,fT),fc.registerInteraction(rT.type,rT),tw(nT,fT),fc.registerInteraction(nT.type,nT),Xh(Zw.name,Zw),g.getInstance(u.Error);const bT=`${hh}_DEFAULT_DATA_INDEX`,xT=`${hh}_DEFAULT_DATA_KEY`,ST=`${hh}_DEFAULT_DATA_SERIES_FIELD`,MT=`${hh}_DEFAULT_SERIES_STYLE_NAME`,kT=`${hh}_STACK_KEY`,AT=`${hh}_STACK_START`,wT=`${hh}_STACK_END`,TT=`${hh}_STACK_START_PERCENT`,LT=`${hh}_STACK_END_PERCENT`,CT=`${hh}_STACK_START_OffsetSilhouette`,ET=`${hh}_STACK_END_OffsetSilhouette`,DT=`${hh}_STACK_TOTAL`,OT=`${hh}_STACK_TOTAL_PERCENT`,PT=`${hh}_STACK_TOTAL_TOP`,RT=`${hh}_STACK_TOTAL_BOTTOM`,BT=`${hh}_SEGMENT_START`,IT=`${hh}_SEGMENT_END`;function FT(t,e){for(let i=0;it.key===e))}function jT(t,e){var i;if(!t)return null!=e?e:null;const s=t.getFields();return s&&s[e]?null!==(i=s[e].alias)&&void 0!==i?i:e:null!=e?e:null}function HT(t,e,i){const s=t.getStackSort(),n={};let r=null;return s&&(r={},t.getSeries().forEach((t=>{const e=t.getSeriesField();if(e){const i=t.getRawDataStatisticsByField(e);i.values&&(r[e]||(r[e]={lastIndex:0,sort:{}}),i.values.forEach(((t,i)=>{t in r[e].sort||(r[e].sort[t]=r[e].lastIndex,r[e].lastIndex++)})))}}))),t.getSeries().forEach((t=>{var s;const a=t.getStackData(),o=t.getStackValue(),l=t.getStackValueField(),h=!i||i(t);a&&l&&h&&(n[o]=null!==(s=n[o])&&void 0!==s?s:{groupField:a.groupField,nodes:{}},GT(t,a,n[o],l,e,r))})),s?zT(n,r):n}function zT(t,e){var i;for(const s in t)(null===(i=t[s].sortDatums)||void 0===i?void 0:i.length)?(t[s].sortDatums.sort(((t,e)=>t.index-e.index)),t[s].values=t[s].sortDatums.map((t=>t.datum))):zT(t[s].nodes,e);return t}function NT(t,e){if("values"in t&&t.values.length){const i=vd(t.values,e),s=fd(t.values,LT);t.values.forEach((t=>{t[DT]=i,t[OT]=s}))}else for(const i in t.nodes)NT(t.nodes[i],e)}function VT(t){if(!t.values.length)return;const e=t.values[t.values.length-1][wT]/2;for(let i=0;i0){let s=0,o=0,l=1,h=0,d=null,c=null;const u=t.values.length;for(let i=0;i=0?(l[n.start]=s,s+=l[n.end],l[n.end]=s):(l[n.start]=o,o+=l[n.end],l[n.end]=o),l[n.key]=t.key,a&&(delete l[n.max],(!c||l[n.end]>c[n.end])&&(c=l)),r&&(delete l[n.min],(!d||l[n.start]=0?s:o;l=h>=0?1:-1,r[n.startPercent]=0===a?0:Math.min(1,r[n.start]/a)*l,r[n.endPercent]=0===a?0:Math.min(1,r[n.end]/a)*l}}for(const r in t.nodes)WT(t.nodes[r],e,i,s,n)}function GT(t,e,i,s,n,r,a){var o;if("values"in e)if(n&&e.values.forEach((t=>t[wT]=function(t){if(il(t))return t;const e=+t;return il(e)?e:0}(t[s]))),i.series.push({s:t,values:e.values}),r){const s=t.getSeriesField();e.values.forEach((e=>{i.sortDatums.push({series:t,datum:e,index:s?r[s].sort[e[s]]:0})}))}else i.values.push(...e.values);else for(const l in e.nodes){const h=a?`${a}_${l}`:l;i.nodes[l]||(i.nodes[l]={values:[],series:[],nodes:{},sortDatums:[],key:h},M(null===(o=e.nodes[l])||void 0===o?void 0:o.groupField)&&(i.nodes[l].groupField=e.nodes[l].groupField)),GT(t,e.nodes[l],i.nodes[l],s,n,r,h)}}const UT=(t,e)=>{const i=e.beforeCall();return t&&t.forEach(((t,s)=>e.call(t,s,i))),i.keyMap&&(i.keyMap.clear(),i.keyMap=null),t};class $T{static getInstance(){return $T.instance||($T.instance=new $T),$T.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,i)=>{const s=this.shortWeekdayRe.exec(e.slice(i));return s?(t.w=this.shortWeekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseWeekday=(t,e,i)=>{const s=this.weekdayRe.exec(e.slice(i));return s?(t.w=this.weekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseShortMonth=(t,e,i)=>{const s=this.shortMonthRe.exec(e.slice(i));return s?(t.m=this.shortMonthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseMonth=(t,e,i)=>{const s=this.monthRe.exec(e.slice(i));return s?(t.m=this.monthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseDayOfMonth=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.d=+s[0],i+s[0].length):-1},this.parseHour24=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.H=+s[0],i+s[0].length):-1},this.parseMilliseconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+3));return s?(t.L=+s[0],i+s[0].length):-1},this.parseMonthNumber=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.m=s-1,i+s[0].length):-1},this.parseMinutes=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.M=+s[0],i+s[0].length):-1},this.parsePeriod=(t,e,i)=>{const s=this.periodRe.exec(e.slice(i));return s?(t.p=this.periodLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseSeconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.S=+s[0],i+s[0].length):-1},this.parseFullYear=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+4));return s?(t.y=+s[0],i+s[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,i){return{y:t,m:e,d:i,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,i){const s=t<0?"-":"",n=(s?-t:t)+"",r=n.length;return s+(r=a)return-1;if(o=e.charCodeAt(n++),37===o){if(o=e.charAt(n++),l=this.parses[o in this.pads?e.charAt(n++):o],!l||(s=l(t,i,s))<0)return-1}else if(o!==i.charCodeAt(s++))return-1}return s}newParse(t,e){const i=this;return function(s){const n=i.newDate(1900,void 0,1);return i.parseSpecifier(n,t,s+="",0)!==s.length?null:"Q"in n?new Date(n.Q):"s"in n?new Date(1e3*n.s+("L"in n?n.L:0)):(e&&!("Z"in n)&&(n.Z=0),"p"in n&&(n.H=n.H%12+12*n.p),void 0===n.m&&(n.m="q"in n?n.q:0),"Z"in n?(n.H+=n.Z/100|0,n.M+=n.Z%100,i.utcDate(n)):i.localDate(n))}}newFormat(t,e){const i=this;return function(s){const n=[];let r=-1,a=0;const o=t.length;let l,h,d;for(s instanceof Date||(s=new Date(+s));++r{if(D(t[e]))return;const n=y(t[e]),r=n?t[e]:[t[e]],a=[];return r.forEach(((t,r)=>{!t||s&&!s(t)||a.push({spec:t,specPath:n?[e,r]:[e],specInfoPath:["component",e,r],type:i})})),a},ZT=(t,e,i,s)=>{let n;if(n=ws(t)?t(e,i):t,s){const{formatFunc:i,args:r}=KT(void 0,s,t,e);i&&r&&(n=i(...r))}return n},JT=(t,e,i)=>D(t)?t:ws(t)?t(e,i):t,QT=(t,e)=>!(e&&(!1===e.visible||e[t]&&!1===e[t].visible||e.activeType&&!(y(e.activeType)?e.activeType.includes(t):e.activeType===t)));function tL(t,e,i,s,n,r){const a=e=>{if(e){const a={datum:n},o=D(e.key)&&D(e.value)&&!jm(e)?Object.assign(Object.assign(Object.assign({},s),i),e):Object.assign(Object.assign({},s),e);Object.keys(o).forEach((t=>{"key"===t?a.key=iL(ZT(o.key,n,r,o.keyFormatter),o.keyTimeFormat,o.keyTimeFormatMode):"value"===t?a.value=iL(ZT(o.value,n,r,o.valueFormatter),o.valueTimeFormat,o.valueTimeFormatMode):a[t]=ZT(o[t],n,r)})),!1!==a.visible&&(M(a.key)||M(a.value))&&t.push(a)}};y(e)?e.forEach((t=>{a(t)})):a(e)}function eL(t,e,i,s,n,r,a){ws(e)?tL(t,e(n,a),i,s,r,a):e&&tL(t,e,i,s,r,a)}const iL=(t,e,i)=>{if(!e&&!i)return"object"!=typeof t?null==t?void 0:t.toString():t;const s=$T.getInstance();return e=e||"%Y%m%d",("local"===(i=i||"local")?s.timeFormat:s.timeUTCFormat)(e,t)};class sL{constructor(t){this.activeTriggerSet={mark:new Set,group:new Set},this.ignoreTriggerSet={mark:new Set},this._getSeriesCacheInfo=()=>{var t,e,i;const{series:s}=this,n=s.getSeriesField();return{seriesFields:M(n)?Na(n):null!==(t=s.getSeriesKeys())&&void 0!==t?t:[],dimensionFields:null!==(e=s.getDimensionField())&&void 0!==e?e:[],measureFields:null!==(i=s.getMeasureField())&&void 0!==i?i:[],type:s.type}},this._getDimensionData=t=>{const{dimensionFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getMeasureData=t=>{const{measureFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getSeriesFieldData=t=>{const{dimensionFields:e,seriesFields:i}=this._seriesCacheInfo;if(M(i[0])&&(null==t?void 0:t[i[0]]))return null==t?void 0:t[i[0]];const s=e[e.length-1];return e.length>1&&(0===i.length||this.series.getSeriesKeys().length),null==t?void 0:t[s]},this._getSeriesStyle=(t,e,i)=>{var s;for(const i of Na(e)){const e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(M(e))return e}return i},this.markTooltipKeyCallback=(t,e)=>this._getSeriesFieldData(t),this.markTooltipValueCallback=(t,e)=>this._getMeasureData(t),this.shapeTypeCallback=(t,e)=>{var i;return null!==(i=this._getSeriesStyle(t,"shape",null))&&void 0!==i?i:this._getSeriesStyle(t,"symbolType",this.series.getDefaultShapeType())},this.shapeColorCallback=(t,e)=>this._getSeriesStyle(t,["fill","stroke"]),this.shapeStrokeCallback=(t,e)=>this._getSeriesStyle(t,["stroke","fill"]),this.dimensionTooltipTitleCallback=(t,e)=>this._getDimensionData(t),this.groupTooltipTitleCallback=(t,e)=>this._getSeriesFieldData(t),this.groupTooltipKeyCallback=(t,e)=>{const{seriesFields:i}=this._seriesCacheInfo;let s=this._seriesCacheInfo.dimensionFields;return i[0]&&(s=s.filter((t=>t!==i[0]))),s.map((e=>null==t?void 0:t[e])).join("-")},this.getHasShape=t=>!!t,this.series=t,this.updateTooltipSpec()}updateTooltipSpec(){var t;const e=null===(t=this.series.getSpec())||void 0===t?void 0:t.tooltip;this.spec=e,this._seriesCacheInfo=this._getSeriesCacheInfo()}getShapeAttrs(t,e,i){var s,n,r,a,o,l,h,d,c,u,p,g;const m=e?"content":"title",_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.shape),null==i?void 0:i[t]),null===(n=null==i?void 0:i[t])||void 0===n?void 0:n[m]),null===(r=this.spec)||void 0===r?void 0:r[t]),null===(o=null===(a=this.spec)||void 0===a?void 0:a[t])||void 0===o?void 0:o[m]);return{shapeType:null!==(l=_.shapeType)&&void 0!==l?l:this.shapeTypeCallback,shapeFill:null!==(d=null!==(h=_.shapeFill)&&void 0!==h?h:_.shapeColor)&&void 0!==d?d:this.shapeColorCallback,shapeStroke:null!==(c=_.shapeStroke)&&void 0!==c?c:this.shapeStrokeCallback,shapeHollow:null!==(u=_.shapeHollow)&&void 0!==u&&u,shapeLineWidth:_.shapeLineWidth,shapeSize:null!==(p=_.shapeSize)&&void 0!==p?p:_.size,hasShape:null!==(g=_.hasShape)&&void 0!==g?g:this.getHasShape(e)}}enableByType(t){return!0}getDefaultContentList(t){return[this.getDefaultContentPattern(t)]}getContentList(t,e,i,s,n,r){var a;return function(t,e,i,s,n,r){if(n&&n.length){const a=[];return n.forEach((n=>{y(t)?t.forEach((t=>{eL(a,t,e,i,s,n,r)})):ws(t)?eL(a,t,e,i,s,n,r):t&&tL(a,t,e,i,n,r)})),a}return null}(null!==(a=null==e?void 0:e.content)&&void 0!==a?a:this.getDefaultContentList(t),this.getDefaultContentPattern(t),i,s,n,r)}getTitleResult(t,e,i,s,n){let r=ws(e)?e(s,n):e;if(r?D(r.value)&&(r=Object.assign(Object.assign({},this.getDefaultTitlePattern(t)),r)):r=this.getDefaultTitlePattern(t),r&&!1!==r.visible){const t=function(t){var e;const i=(null===(e=t[0])||void 0===e?void 0:e.series)?[{data:t,value:""}]:t;for(const{data:t}of i)for(const{datum:e}of t)for(const t of null!=e?e:[])if(t)return t}(s),e={visible:ZT(r.visible,t,n),value:iL(ZT(r.value,t,n,r.valueFormatter),r.valueTimeFormat,r.valueTimeFormatMode),valueStyle:ZT(r.valueStyle,t,n),hasShape:r.hasShape};return Object.keys(i).forEach((s=>{e[s]=ZT(i[s],t,n)})),e}return{hasShape:!1,visible:!1}}getTooltipData(t,e,i,s,n){var r,a;if(!(this.enableByType(t)&&QT(t,this.spec)&&("dimension"!==t||s&&s.length)))return null;const o=null!==(a=null===(r=this.spec)||void 0===r?void 0:r[t])&&void 0!==a?a:null==e?void 0:e[t],l=this.getShapeAttrs(t,!0,e),h=this.getShapeAttrs(t,!1,e);let d;return"dimension"===t?(d=[],this.getContentList(t,o,l,i,s,n).forEach((t=>{d.push(t)}))):d=this.getContentList(t,o,l,i,s,n),{visible:!0,activeType:t,data:i,title:this.getTitleResult(t,null==o?void 0:o.title,h,i,n),content:d}}getDefaultTitlePattern(t){return{key:void 0,value:"group"===t?this.groupTooltipTitleCallback:this.dimensionTooltipTitleCallback}}getDefaultContentPattern(t){return{seriesId:this.series.id,key:"group"===t?this.groupTooltipKeyCallback:this.markTooltipKeyCallback,value:this.markTooltipValueCallback}}}const nL={min:t=>t.length?Ga(t.map((t=>1*t))):0,max:t=>t.length?Wa(t.map((t=>1*t))):0,"array-min":t=>t.length?Ga(t.map((t=>1*t))):0,"array-max":t=>t.length?Wa(t.map((t=>1*t))):0,values:t=>{const e={},i=[];for(const s of t)e[s]||(i.push(s),e[s]=1);return i}},rL=(t,e)=>{var i,s;let n=e.fields;if(ws(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return{};n=FT([],n);const r="parser"===e.target?"parserData":"latestData",a=t[0][r]?t[0][r]:t||[],o=null===(s=(i=t[0]).getFields)||void 0===s?void 0:s.call(i);return aL(a,n,o)},aL=(t,e,i)=>{const s={};let n=[],r=[];return e.forEach((e=>{const a=e.key;s[a]={};const o=null==i?void 0:i[a],l=e.operations,h=l.some((t=>"min"===t||"max"===t||"allValid"===t));let d=!0;n.length=0,t&&t.forEach((t=>{t&&n.push(t[a])}));const c=n.length;if(h){r.length=0,n.forEach(((t,e)=>{sl(t)&&r.push(t)}));const t=n;n=r,r=t,d=n.length===c}else n=l.some((t=>"array-min"===t||"array-max"===t))?n.reduce(((t,e)=>(e&&e.forEach((e=>{sl(e)&&t.push(e)})),t)),[]):n.filter((t=>void 0!==t));e.filter&&(n=n.filter(e.filter)),l.forEach((t=>{if(e.customize)s[a][t]=e.customize;else{if(o&&o.lockStatisticsByDomain&&!D(o.domain)){if("values"===t)return void(s[a][t]=o.domain.slice())}else if("allValid"===t)return;s[a][t]=nL[t](n),"array-max"===t&&(s[a].max=s[a][t]),"array-min"===t&&(s[a].min=s[a][t])}})),h&&(s[a].allValid=d)})),s},oL=(t,e)=>{const{config:i}=e;if(!i)return t;const{invalidType:s,checkField:n}=i();return"zero"!==s||n&&n.length&&t.forEach((t=>{n.forEach((e=>{sl(t[e])||(t[e]=0)}))})),t};class lL extends gx{_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct([])}generateProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.name}}const hL=`${hh}_HIERARCHY_DEPTH`,dL=`${hh}_HIERARCHY_ROOT`,cL=`${hh}_HIERARCHY_ROOT_INDEX`;function uL(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function pL(t,e,i){t&&(i.needDefaultSeriesField&&(t[ST]=i.defaultSeriesField),t[bT]=e,t[xT]=i.getKey(t,e,i))}function gL(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function mL(t,e,i,s=0,n,r){void 0===r&&(r=e),pL(t,e,i),t[hL]=s,t[dL]=n||t[i.categoryField],t[cL]=r,t.children&&t.children.length&&t.children.forEach(((e,s)=>mL(e,s,i,t[hL]+1,t[dL],r)))}const _L={label:{name:"label",type:"text"}},fL=`${hh}_rect_x`,vL=`${hh}_rect_x1`,yL=`${hh}_rect_y`,bL=`${hh}_rect_y1`,xL={data:!0},SL={invalidType:!0,animation:!0,animationAppear:!0,animationEnter:!0,animationUpdate:!0,animationExit:!0,animationNormal:!0},ML={type:"fadeIn"};function kL(t,e){switch(e){case"grow":return(t=>({type:"horizontal"===t.direction?"growPointsXIn":"growPointsYIn",options:{orient:"horizontal"===t.direction?"positive":"negative"}}))(t);case"fadeIn":return ML;default:return(t=>({type:"clipIn",options:{clipDimension:"horizontal"===t.direction?"y":"x"}}))(t)}}const AL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!1),r=null!==(s=t.getGraphicAttribute("clipRange",!1))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:0,clipRangeByDimension:e.clipDimension},to:{clipRange:r,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:r}}},wL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!0),r=null!==(s=t.getGraphicAttribute("clipRange",!0))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:r,clipRangeByDimension:e.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:r},to:{clipRange:0}}},TL=(t,e,i)=>{var s,n,r,a;const o=null!==(s=t.getFinalAnimationAttributes())&&void 0!==s?s:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(n=o.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(a=o.strokeOpacity)&&void 0!==a?a:1}}},LL=(t,e,i)=>{var s,n,r;return{from:{opacity:null!==(s=t.getGraphicAttribute("opacity",!0))&&void 0!==s?s:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==n?n:1,strokeOpacity:null!==(r=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==r?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},CL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{from:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0},to:{x:e,x1:i,width:s}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{from:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0},to:{y:e,y1:i,height:s}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width"),n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height"),o={};return M(s)?(o.x=e+s/2,o.width=0,o.x1=void 0):(o.x=(e+i)/2,o.x1=(e+i)/2,o.width=void 0),M(a)?(o.y=n+a/2,o.height=0,o.y1=void 0):(o.y=(n+r)/2,o.y1=(n+r)/2,o.height=void 0),{from:o,to:{x:e,y:n,x1:i,y1:r,width:s,height:a}}}}},EL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{to:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{to:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("width"),a=t.getFinalAnimationAttribute("height"),o={};return M(r)?(o.x=e+r/2,o.width=0,o.x1=void 0):(o.x=(e+s)/2,o.x1=(e+s)/2,o.width=void 0),M(a)?(o.y=i+a/2,o.height=0,o.y1=void 0):(o.y=(i+n)/2,o.y1=(i+n)/2,o.height=void 0),{to:o}}}},DL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x"),r=t.getFinalAnimationAttribute("x1"),a=t.getFinalAnimationAttribute("width");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=o):o=i.width:o=h(null==e?void 0:e.overall)?null==e?void 0:e.overall:0,{from:{x:o,x1:D(r)?void 0:o,width:D(a)?void 0:0},to:{x:n,x1:r,width:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}(t,e)},OL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x1"),r=t.getFinalAnimationAttribute("width");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=a):a=i.width:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{x:a,x1:D(n)?void 0:a,width:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0}}}(t,e)},PL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=o):o=i.height:o=h(null==e?void 0:e.overall)?e.overall:0,{from:{y:o,y1:D(r)?void 0:o,height:D(a)?void 0:0},to:{y:n,y1:r,height:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}(t,e)},RL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("height");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=a):a=i.height:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{y:a,y1:D(n)?void 0:a,height:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0}}}(t,e)},BL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes();if(e&&"anticlockwise"===e.orient){const t=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t,endAngle:t},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}}const s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:s,endAngle:s},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:null==i?void 0:i.endAngle},to:{startAngle:null==i?void 0:i.startAngle}}:{from:{endAngle:null==i?void 0:i.startAngle},to:{endAngle:null==i?void 0:i.endAngle}}})(t,e)},IL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{if(e&&"anticlockwise"===e.orient){const i=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}}const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("startAngle",!0)},to:{startAngle:null==i?void 0:i.endAngle}}:{from:{endAngle:t.getGraphicAttribute("endAngle",!0)},to:{endAngle:null==i?void 0:i.startAngle}}})(t,e)},FL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes(),s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:s,outerRadius:s},to:{innerRadius:null==i?void 0:i.innerRadius,outerRadius:null==i?void 0:i.outerRadius}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:null==i?void 0:i.outerRadius},to:{innerRadius:null==i?void 0:i.innerRadius}}:{from:{outerRadius:null==i?void 0:i.innerRadius},to:{outerRadius:null==i?void 0:i.outerRadius}}})(t,e)},YL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0),outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:i,outerRadius:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:null==i?void 0:i.outerRadius}}:{from:{outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:null==i?void 0:i.innerRadius}}})(t,e)},jL=(t,e,i)=>{const s=t.getGraphicAttribute("points",!1),n={x:0,y:0};return s.forEach((t=>{n.x+=t.x,n.y+=t.y})),n.x/=s.length,n.y/=s.length,e&&e.center&&(il(e.center.x)&&(n.x=e.center.x),il(e.center.y)&&(n.y=e.center.y)),"area"===t.mark.markType&&(n.x1=n.x,n.y1=n.y),s.map((t=>Object.assign({},t,n)))},HL=(t,e,i)=>({from:{points:jL(t,e)},to:{points:t.getGraphicAttribute("points",!1)}}),zL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:jL(t,e)}}),NL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.width;return i.group&&(e=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=e),Object.assign(Object.assign({},t),{x:e,y:t.y,x1:e,y1:t.y1,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:0,y:t.y,x1:0,y1:t.y1,defined:!1!==t.defined})})),VL=(t,e,i)=>({from:{points:NL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),WL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:NL(t,e,i)}}),GL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.height;return i.group&&(e=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=e),Object.assign(Object.assign({},t),{x:t.x,y:e,x1:t.x1,y1:e,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:t.x,y:0,x1:t.x1,y1:0,defined:!1!==t.defined})})),UL=(t,e,i)=>({from:{points:GL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),$L=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:GL(t,e,i)}}),XL=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l,excludeChannels:h=[]}=null!=e?e:{};let d=0,c=0;"negative"===a&&(i.group?(d=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),c=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupWidth=d,i.groupHeight=c):(d=i.width,c=i.height)),d+=r,c+=r;const u=ws(l)?l.call(null,t.getDatum(),t,i):l,p=u&&il(u.x)?u.x:d,g=u&&il(u.y)?u.y:c,m=h.includes("x")?t.getGraphicAttribute("x"):t.getFinalAnimationAttribute("x"),_=h.includes("y")?t.getGraphicAttribute("y"):t.getFinalAnimationAttribute("y");switch(o){case"x":return{from:{x:p},to:{x:m}};case"y":return{from:{y:g},to:{y:_}};default:return{from:{x:p,y:g},to:{x:m,y:_}}}},KL=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l}=null!=e?e:{},h=i.group?i.group.getBounds():null,d=null!==(s=null==h?void 0:h.width())&&void 0!==s?s:i.width,c=null!==(n=null==h?void 0:h.height())&&void 0!==n?n:i.height,u=("negative"===a?d:0)+r,p=("negative"===a?c:0)+r,g=ws(l)?l.call(null,t.getDatum(),t,i):l,m=g&&il(g.x)?g.x:u,_=g&&il(g.y)?g.y:p;switch(o){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:m}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:_}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:m,y:_}}}},qL=(t,e,i)=>{var s,n,r,a;const o=t.getFinalAnimationAttributes();switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(s=null==o?void 0:o.scaleX)&&void 0!==s?s:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(n=null==o?void 0:o.scaleY)&&void 0!==n?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(r=null==o?void 0:o.scaleX)&&void 0!==r?r:1,scaleY:null!==(a=null==o?void 0:o.scaleY)&&void 0!==a?a:1}}}},ZL=(t,e,i)=>{var s,n,r,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!0))&&void 0!==s?s:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!0))&&void 0!==n?n:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!0))&&void 0!==r?r:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!0))&&void 0!==a?a:1},to:{scaleX:0,scaleY:0}}}},JL={symbol:["_mo_hide_","visible"]},QL=(t,e,i)=>{const s=Object.assign({},t.getPrevGraphicAttributes()),n=Object.assign({},t.getNextGraphicAttributes());let r;e&&Na(e.excludeChannels).forEach((t=>{delete s[t],delete n[t]})),t.mark&&t.mark.markType&&(r=JL[t.mark.markType])&&r.forEach((t=>{delete s[t],delete n[t]})),Object.keys(n).forEach((t=>{Im(s[t],n[t])&&(delete s[t],delete n[t])}));const a=t.getFinalGraphicAttributes();return Object.keys(s).forEach((t=>{D(n[t])&&(D(a[t])||Im(s[t],a[t])?delete s[t]:n[t]=a[t])})),{from:s,to:n}},tC=(t,e,i)=>{var s;const n=null!==(s=t.getFinalAnimationAttribute("angle"))&&void 0!==s?s:0;let r=0;return r=es(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:il(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:r},to:{angle:n}}},eC=(t,e,i)=>{var s;const n=null!==(s=t.getGraphicAttribute("angle",!0))&&void 0!==s?s:0;let r=0;return r=es(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:il(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:r}}},iC=()=>{fc.registerAnimationType("clipIn",AL)},sC=()=>{fc.registerAnimationType("clipOut",wL)},nC=()=>{fc.registerAnimationType("fadeIn",TL)},rC=()=>{fc.registerAnimationType("fadeOut",LL)},aC=()=>{fc.registerAnimationType("growCenterIn",CL)},oC=()=>{fc.registerAnimationType("growCenterOut",EL)},lC=()=>{fc.registerAnimationType("growHeightIn",PL)},hC=()=>{fc.registerAnimationType("growHeightOut",RL)},dC=()=>{fc.registerAnimationType("growWidthIn",DL)},cC=()=>{fc.registerAnimationType("growWidthOut",OL)},uC=()=>{fc.registerAnimationType("growPointsIn",HL)},pC=()=>{fc.registerAnimationType("growPointsOut",zL)},gC=()=>{fc.registerAnimationType("growPointsXIn",VL)},mC=()=>{fc.registerAnimationType("growPointsXOut",WL)},_C=()=>{fc.registerAnimationType("growPointsYIn",UL)},fC=()=>{fc.registerAnimationType("growPointsYOut",$L)},vC=()=>{fc.registerAnimationType("growAngleIn",BL)},yC=()=>{fc.registerAnimationType("growAngleOut",IL)},bC=()=>{fc.registerAnimationType("growRadiusIn",FL)},xC=()=>{fc.registerAnimationType("growRadiusOut",YL)},SC=()=>{fc.registerAnimationType("moveIn",XL)},MC=()=>{fc.registerAnimationType("moveOut",KL)},kC=()=>{fc.registerAnimationType("scaleIn",qL)},AC=()=>{fc.registerAnimationType("scaleOut",ZL)},wC=()=>{fc.registerAnimationType("rotateIn",tC)},TC=()=>{fc.registerAnimationType("rotateOut",eC)},LC=()=>{fc.registerAnimationType("update",QL)},CC={appear:{duration:1e3,easing:"cubicOut"},update:{type:"update",duration:300,easing:"linear"},enter:{duration:300,easing:"linear"},exit:{duration:300,easing:"linear"},disappear:{duration:500,easing:"cubicIn"},state:{duration:300,easing:"linear"}},EC={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:{type:"scaleOut"}},DC={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}},OC=()=>{Ql.registerAnimation("scaleInOut",(()=>EC))},PC=()=>{Ql.registerAnimation("fadeInOut",(()=>DC))},RC=(t,e)=>({appear:kL(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined","segments"]}},{channel:["points","segments"],custom:vA,duration:CC.update.duration,easing:CC.update.easing,customParameters:{clipRangeByDimension:"horizontal"===t.direction?"y":"x"}}],disappear:{type:"clipOut"}}),BC=()=>{Ql.registerAnimation("line",RC)},IC=()=>{r_.useRegisters([lC,hC,dC,cC,aC,oC])},FC=()=>{r_.useRegisters([bC,xC,vC,yC])},YC=()=>{r_.useRegisters([uC,pC,gC,mC,_C,fC,iC,sC])},jC=()=>{r_.useRegisters([uC,pC])},HC=[...Object.keys(CC),"normal"];function zC(t={},e,i){const s={};for(let n=0;n{t.controlOptions={stopWhenStateChange:!0}})),a?(l=y(a)?a.map(((t,e)=>{var s;let n=t;return UC(n)&&delete n.type,n.oneByOne&&(n=VC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:WC,null==i?void 0:i.dataCount)),n})):o.map(((t,e)=>{var s;let n=Pl({},o[e],a);return UC(n)&&delete n.type,n.oneByOne&&(n=VC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:WC,null==i?void 0:i.dataCount)),n})),s[r]=l):s[r]=o}return s}function NC(t,e,i){var s,n,r,a,o,l;const h={};return M(e.animationAppear)&&(h.appear=null!==(s=e.animationAppear[t])&&void 0!==s?s:e.animationAppear),M(e.animationDisappear)&&(h.disappear=null!==(n=e.animationDisappear[t])&&void 0!==n?n:e.animationDisappear),M(e.animationEnter)&&(h.enter=null!==(r=e.animationEnter[t])&&void 0!==r?r:e.animationEnter),M(e.animationExit)&&(h.exit=null!==(a=e.animationExit[t])&&void 0!==a?a:e.animationExit),M(e.animationUpdate)&&(h.update=null!==(o=e.animationUpdate[t])&&void 0!==o?o:e.animationUpdate),M(e.animationState)&&(h.state=null!==(l=e.animationState[t])&&void 0!==l?l:e.animationState),e.animationNormal&&e.animationNormal[t]&&(h.normal=e.animationNormal[t]),function(t,e){return t?($C(t=k(t),(t=>{var i;return ws(t)&&(null===(i=t.prototype)||void 0===i?void 0:i.constructor)!==t?(...i)=>t(...i,e):t})),t):t}(h,i)}function VC(t,e,i){const{oneByOne:s,duration:n,delay:r,delayAfter:a}=t;return t.delay=(t,i,a)=>{const o=e(t,a),l=ws(n)?n(t,i,a):il(n)?n:0,h=ws(r)?r(t,i,a):il(r)?r:0;let d=ws(s)?s(t,i,a):s;return!1===d?h:(d=!0===d?0:d,h+o*(l+d))},t.delayAfter=(t,r,o)=>{const l=e(t,o),h=ws(n)?n(t,r,o):il(n)?n:0,d=ws(a)?a(t,r,o):il(a)?a:0;let c=ws(s)?s(t,r,o):s;return!1===c?d:(c=!0===c?0:c,d+((i?i():r.mark.elements.length)-l)*(h+c))},delete t.oneByOne,t}function WC(t,e){var i,s;return null!==(i=null==t?void 0:t[bT])&&void 0!==i?i:null===(s=null==e?void 0:e.VGRAMMAR_ANIMATION_PARAMETERS)||void 0===s?void 0:s.elementIndex}function GC(t,e){var i,s,n,r,a;if(!1===t.animation)return!1;if(!1===(null===(i=t.morph)||void 0===i?void 0:i.enable))return!1;const o=!1!==(null!==(n=null===(s=t.animationAppear)||void 0===s?void 0:s[e])&&void 0!==n?n:t.animationAppear),l=!1!==(null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r[e])&&void 0!==a?a:t.animationUpdate);return!(!o||!l)}function UC(t){return!function(t){return M(t.timeSlices)}(t)&&M(t.channel)}function $C(t,e){if(y(t))t.forEach(((i,s)=>{t[s]=e(t[s],s),$C(t[s],e)}));else if(As(t))for(const i in t)t[i]=e(t[i],i),$C(t[i],e)}function XC(t){var e,i,s,n;const r=t.getSpec();if(!1===r.animation)return!1;if(!M(t.getRegion().animate))return!1;let a=null!==(e=r.animationThreshold)&&void 0!==e?e:Number.MAX_SAFE_INTEGER;return null===(i=t.getMarks())||void 0===i||i.forEach((t=>{const e=t.getMarkConfig();e&&(e.large&&e.largeThreshold&&(a=Math.min(a,e.largeThreshold)),e.progressiveThreshold&&(a=Math.min(a,e.progressiveThreshold)))})),!((null===(n=null===(s=t.getRawData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)>=a)}class KC extends Hy{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=Na(e)}addLabelSpec(t,e,i=!1){this.markLabelSpec[t]||(this.markLabelSpec[t]=[]),i?this.markLabelSpec[t].unshift(e):this.markLabelSpec[t].push(e)}getTheme(t,e){var i,s,n;const r=kl(t),a=null===(i=this._option)||void 0===i?void 0:i.getTheme(),{markByName:o,mark:l}=a,h=this._option.type,d=Ql.getSeriesMarkMap(h)?function(t,e,i,s){const n=Ql.getSeriesMarkMap(e);if(!n)return t;const r={};return Object.values(n).forEach((({type:e,name:n})=>{r[n]=Pl({},null==i?void 0:i[Na(e)[0]],null==s?void 0:s[n],null==t?void 0:t[n])})),Object.assign(Object.assign({},t),r)}($d(a,`series.${h}`),h,l,o):{},c=$d(a,`series.${h}_${r}`);return Pl({},d,c,(null!==(n=null!==(s=this.stack)&&void 0!==s?s:null==c?void 0:c.stack)&&void 0!==n?n:null==d?void 0:d.stack)?$d(a,`series.${h}_stack`):void 0)}transformSpec(t,e,i){this._transformStack(t);const s=super.transformSpec(t,e,i);return this._transformLabelSpec(s.spec),Object.assign(Object.assign({},s),{markLabelSpec:this.markLabelSpec,stack:this.stack})}_transformLabelSpec(t){}_transformStack(t){v(t.stack)&&(this.stack=t.stack),v(t.percent)&&(this.stack=t.percent||this.stack),D(this.stack)&&this._supportStack&&t.seriesField&&(this.stack=!0)}_addMarkLabelSpec(t,e,i="label",s="initLabelMarkStyle",n=!0,r){t&&Na(t[i]).forEach((i=>{var a,o,l;if(i&&i.visible){const{animation:h=!0,animationUpdate:d=!0,animationEnter:c=!0,animationExit:u=!0}=i,{animationUpdate:p=!0,animationEnter:g=!0,animationExit:m=!0}=t,_=!!(null!==(l=null!==(o=null===(a=this._option)||void 0===a?void 0:a.animation)&&void 0!==o?o:t.animation)&&void 0!==l?l:i.animation)&&!!n;this.addLabelSpec(e,Object.assign(Object.assign({},i),{animation:!!_&&h,animationUpdate:!!(_&&p&&d)&&p,animationEnter:!!(_&&g&&c)&&g,animationExit:!!(_&&g&&u)&&m,getStyleHandler:t=>{var e;return null===(e=t[s])||void 0===e?void 0:e.bind(t)}}),r)}}))}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{outerRadius:s,innerRadius:n,direction:r}=t;return M(s)&&(i.outerRadius=s),M(n)&&(i.innerRadius=n),M(r)&&(i.direction=r),Object.keys(i).length>0?i:void 0}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>{const e=Pl({},i,s,t),n=i.label;return n&&As(n)&&y(e.label)&&(e.label=e.label.map((t=>Pl({},n,t)))),e};return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}}class qC extends Ny{getRegion(){return this._region}getLayoutStartPoint(){return this._region.getLayoutStartPoint()}getRootMark(){return this._rootMark}getSeriesMark(){return this._seriesMark}getRawData(){return this._rawData}getViewDataFilter(){return this._viewDataFilter}getViewData(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}getViewDataProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getGroups(){return this._groups}getStack(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.stack}getStackValue(){var t;return null!==(t=this._spec.stackValue)&&void 0!==t?t:`${hh}_series_${this.type}`}getPercent(){return this._spec.percent}getStackOffsetSilhouette(){return this._spec.stackOffsetSilhouette}get tooltipHelper(){return this._tooltipHelper||this.initTooltip(),this._tooltipHelper}getInvalidType(){return this._invalidType}setInvalidType(t){var e;this._invalidType=t,null===(e=this.getViewData())||void 0===e||e.reRunAllTransform()}getMarkAttributeContext(){return this._markAttributeContext}constructor(t,e){var i;super(t,e),this.specKey="series",this.type="series",this.layoutType="absolute",this.modelType="series",this.name=void 0,this.transformerConstructor=KC,this.coordinate="none",this._region=null,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:null,height:null},this.getLayoutRect=()=>{var t,e;return{width:null!==(t=this._layoutRect.width)&&void 0!==t?t:this._region.getLayoutRect().width,height:null!==(e=this._layoutRect.height)&&void 0!==e?e:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this.layoutZIndex=Dy.SeriesGroup,this._invalidType="break",this._region=e.region,this._dataSet=e.dataSet,(null===(i=this._spec)||void 0===i?void 0:i.name)&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(zd.afterInitData,{model:this}),this.initRootMark(),this.initMark();const t=XC(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this._option.disableTriggerEvent||this.initInteraction(),this.afterInitMark(),this.initEvent(),this.event.emit(zd.afterInitEvent,{model:this})}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},seriesColor:t=>{var e;return D(t)&&(t=this.getSeriesKeys()[0]),null===(e=this._option.globalScale.getScale("color"))||void 0===e?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),M(this._spec.invalidType)&&(this._invalidType=this._spec.invalidType)}getInvalidCheckFields(){return[this.getStackValueField()]}initInvalidDataTransform(){var t,e;"zero"===this._invalidType&&(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"invalidTravel",oL),null===(e=this._rawData)||void 0===e||e.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getInvalidCheckFields()})}},!1))}initData(){var t,e,i;const s=null!==(t=this._spec.data)&&void 0!==t?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(s&&(this._rawData=jp(s,this._dataSet,this._option.sourceDataList)),null===(i=null===(e=this._rawData)||void 0===e?void 0:e.target)||void 0===i||i.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this.getStack()&&(this._viewDataFilter=Yp(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));const t=Yp(this.getStack()?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new lL(this._option,t),this.getStack()&&this._viewDataFilter.target.removeListener("change",t.reRunAllTransform)}this.initInvalidDataTransform()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,s,n;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]||e&&(D(this._rawStatisticsCache[t].min)||D(this._rawStatisticsCache[t].max))||!e&&D(this._rawStatisticsCache[t].values))if(this._viewDataStatistics&&(!this._viewDataFilter||this._viewDataFilter.transformsArr.length<=1)&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){const i=null===(s=this._rawData.getFields())||void 0===s?void 0:s[t];if(i&&i.lockStatisticsByDomain&&i.domain)this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=Ga(i.domain),this._rawStatisticsCache[t].max=Wa(i.domain)):this._rawStatisticsCache[t].values=i.domain;else{const i=aL(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t];this._rawStatisticsCache[t]=E(null!==(n=this._rawStatisticsCache[t])&&void 0!==n?n:{},i)}}return this._rawStatisticsCache[t]}_statisticViewData(){Cp(this._dataSet,"dimensionStatistics",rL);const t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new R(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&FT(t,[{key:this._seriesField,operations:["values"]}]),t},target:"latest"}},!1),this._data.getDataView().target.removeListener("change",this._viewDataStatistics.reRunAllTransform),this.getStack()&&this.createdStackData()}createStatisticalData(t,e,i){Cp(this._dataSet,"dimensionStatistics",rL);const s=new R(this._dataSet,{name:t});return s.parse([e],{type:"dataview"}),s.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var t;const s=FT(this.getStatisticFields(),null!==(t=null==i?void 0:i(e.name))&&void 0!==t?t:[]);return this._seriesField&&FT(s,[{key:this._seriesField,operations:["values"]}]),s},target:"latest"}},!1),s}createdStackData(){const t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new R(this._dataSet,{name:t}),this._viewStackData.parse([this._viewDataFilter],{type:"dataview"}),this._viewStackData.transform({type:"stackSplit",options:{fields:this.getStackGroupFields()}},!1)}_noAnimationDataKey(t,e){return e}generateDefaultDataKey(t){var e;return D(t)?(t,e,i)=>{if(!1===this._spec.animation){const i=this._noAnimationDataKey(t,e);if(void 0!==i)return i}const{keyMap:s}=i,n=this._getSeriesDataKey(t);return void 0===s.get(n)?(s.set(n,0),n):(s.set(n,s.get(n)+1),`${n}_${s.get(n)}`)}:S(t)?e=>e[t]:y(t)&&t.every((t=>S(t)))?e=>t.map((t=>e[t])).join("-"):ws(t)?(e,i)=>t(e,i):(null===(e=this._option)||void 0===e||e.onError(`invalid dataKey: ${t}`),(t,e)=>{})}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"addVChartProperty",UT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:uL.bind(this),call:pL}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;null===(e=this._rawDataStatistics)||void 0===e||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(zd.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(zd.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(zd.viewDataUpdate,{model:this}),null===(e=this._data)||void 0===e||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(zd.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||D(e)?null:t[e]}getDatumPositionValues(t,e){return!t||D(e)?[]:S(e)?[t[e]]:e.map((e=>t[e]))}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:null===(e=(t=this._region).getGroupMark)||void 0===e?void 0:e.call(t),dataView:!1}),this._rootMark.setMarkConfig({zIndex:this.layoutZIndex})}_getExtensionMarkNamePrefix(){return`${this.type}_${this.id}_extensionMark`}_initExtensionMark(t){var e;if(!this._spec.extensionMark)return;const i=this.getMarksWithoutRoot();t.depend=i,null===(e=this._spec.extensionMark)||void 0===e||e.forEach(((e,i)=>{this._createExtensionMark(e,null,this._getExtensionMarkNamePrefix(),i,t)}))}_createExtensionMark(t,e,i,s,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,componentType:t.componentType,depend:n.depend,key:t.dataKey},{setCustomizedShape:null==t?void 0:t.customShape});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation){const e=zC({},NC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if("group"===t.type)i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}));else if(!(e||D(t.dataId)&&D(t.dataIndex))){const e=this._option.getSeriesData(t.dataId,t.dataIndex);e===this._rawData?a.setDataView(this.getViewData(),this.getViewDataProductId()):(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}_updateExtensionMarkSpec(){var t;null===(t=this._spec.extensionMark)||void 0===t||t.forEach(((t,e)=>{const i=this._marks.getMarkWithInfo({name:`${this._getExtensionMarkNamePrefix()}_${e}`});i&&(this.initMarkStyleWithSpec(i,t),i.updateStaticEncode(),i.updateLayoutState())}))}getStackData(){var t;return null===(t=this._viewStackData)||void 0===t?void 0:t.latestData}_parseSelectorOfInteraction(t,e){if(!e||!e.length)return[];const i=[];return t.markIds?e.filter((e=>{t.markIds.includes(e.getProductId())&&i.push(`#${e.getProductId()}`)})):t.markNames?e.forEach((e=>{t.markNames.includes(e.name)&&i.push(`#${e.getProductId()}`)})):e.forEach((t=>{i.push(`#${t.getProductId()}`)})),i}_parseDefaultInteractionConfig(t){if(!(null==t?void 0:t.length))return[];const e=(i=this._option.mode)===n["desktop-browser"]||i===n["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"pointertap"}}:fl(i)||vl(i)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"tap"}}:null;var i;let s=Object.assign({},null==e?void 0:e.hover),r=Object.assign({},null==e?void 0:e.select);const a=this._spec.hover;v(a)?s.enable=a:As(a)&&(s.enable=!0,s=Pl(s,a));const o=this._spec.select;v(o)?r.enable=o:As(o)&&(r.enable=!0,r=Pl(r,o));const l=[];if(s.enable){const e=this._parseSelectorOfInteraction(s,t);e.length&&l.push({seriesId:this.id,regionId:this._region.id,selector:e,type:"element-highlight",trigger:s.trigger,triggerOff:s.triggerOff,blurState:Sy.STATE_HOVER_REVERSE,highlightState:Sy.STATE_HOVER})}if(r.enable){const e=this._parseSelectorOfInteraction(r,t),i="multiple"===r.mode,s=M(r.triggerOff)?r.triggerOff:i?["empty"]:["empty",r.trigger];e.length&&l.push({type:"element-select",seriesId:this.id,regionId:this._region.id,selector:e,trigger:r.trigger,triggerOff:s,reverseState:Sy.STATE_SELECTED_REVERSE,state:Sy.STATE_SELECTED,isMultiple:i})}return l}_parseInteractionConfig(t){const e=this.getCompiler();if(!e)return;const{interactions:i}=this._spec,s=this._parseDefaultInteractionConfig(t);s&&s.length&&s.forEach((t=>{e.addInteraction(t)})),i&&i.length&&i.forEach((t=>{const i=this._parseSelectorOfInteraction(t,this.getMarks());i.length&&e.addInteraction(Object.assign(Object.assign({},t),{selector:i,seriesId:this.id,regionId:this._region.id}))}))}initInteraction(){const t=this.getMarksWithoutRoot();this._parseInteractionConfig(t)}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;const e=this._spec.seriesStyle;if(!e||!e.length)return;const i=null!==(t=this._seriesField)&&void 0!==t?t:ST;this.getMarksWithoutRoot().forEach((t=>{const s={},n={},r={};e.forEach((e=>{var i;const a=null===(i=e[t.name])||void 0===i?void 0:i.style;a&&(s[e.name]=!0,r[e.name]=r[e.name]||{},Object.keys(a).forEach((t=>{n[t]=!0,r[e.name][t]=a[t]})))})),t.state.addStateInfo({stateValue:MT,level:-1,filter:t=>Array.isArray(t)?0!==t.length&&!0===s[t[0][i]]:!0===s[t[i]]});const a={};Object.keys(n).forEach((e=>{a[e]=s=>{var n,a;let o;if(Array.isArray(s)){if(0===s.length)return;o=null===(n=r[s[0][i]])||void 0===n?void 0:n[e]}return o=null===(a=r[s[i]])||void 0===a?void 0:a[e],M(o)?o:t.getAttribute(e,s)}})),this.setMarkStyle(t,a,MT,Py.User_SeriesStyle)}))}afterInitMark(){this.event.emit(zd.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField),this.getMarks().forEach((t=>{var e,i;(null===(i=null===(e=t.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&t.setAttribute("stroke",this.getColorAttribute(),"normal",Py.Base_Series)}))}getMarksWithoutRoot(){return this.getMarks().filter((t=>!t.name.includes("seriesGroup")))}getMarksInType(t){return this._marks.getMarksInType(t)}getMarkInName(t){return this._marks.get(t)}getMarkInId(t){return this.getMarks().find((e=>e.id===t))}initEvent(){var t,e,i;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.target.addListener("change",this.viewDataUpdate.bind(this)),null===(i=this._viewDataStatistics)||void 0===i||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent(),this.getCompiler().removeInteraction(this.id)}initTooltip(){this._tooltipHelper=new sL(this)}_compareExtensionMarksSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.type!==t[i].type||e.id!==t[i].id))?i.reMake=!0:e.some(((e,i)=>e.visible!==t[i].visible))&&(i.reCompile=!0)}_compareLabelSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.labelLayout!==t[i].labelLayout||e.visible!==t[i].visible))?i.reMake=!0:!i.reCompile&&e.some(((e,i)=>!Im(e,t[i])))&&(i.reCompile=!0)}_compareSpec(t,e,i){const s=super._compareSpec(t,e),n=Object.keys(e||{}).sort();if(!Im(n,Object.keys(t||{}).sort()))return s.reMake=!0,s;const r=Object.assign(Object.assign(Object.assign(Object.assign({},xL),SL),i),{extensionMark:!0,label:!0,totalLabel:!0});return this._compareExtensionMarksSpec(Na(t.extensionMark),Na(e.extensionMark),s),!s.reMake&&this._compareLabelSpec(Na(t.label),Na(e.label),s),!s.reMake&&this._compareLabelSpec(Na(t.totalLabel),Na(e.totalLabel),s),s.reMake?s:(!s.reCompile&&this._marks.getMarks().some((i=>{var s,n;return r[i.name]=!0,(null===(s=e[i.name])||void 0===s?void 0:s.visible)!==(null===(n=t[i.name])||void 0===n?void 0:n.visible)}))&&(s.reCompile=!0),!s.reCompile&&n.some((i=>SL[i]&&!Im(t[i],e[i])))&&(s.reCompile=!0),n.some((i=>!r[i]&&!Im(t[i],e[i])))?(s.reMake=!0,s):s)}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof R||Hp(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);const e=this.getMarksWithoutRoot();e.forEach((t=>{this._spec[t.name]&&this.initMarkStyleWithSpec(t,this._spec[t.name])})),this.initMarkStyle(),e.forEach((t=>{t.updateStaticEncode(),t.updateLayoutState(!0)})),this._updateExtensionMarkSpec(),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec(),XC(this)&&this.initAnimation()}onEvaluateEnd(t){this._data.updateData()}onRender(t){}release(){var t,e,i;super.release(),this._viewDataMap.clear();const s=null===(e=null===(t=this._rawData)||void 0===t?void 0:t.transformsArr)||void 0===e?void 0:e.findIndex((t=>"addVChartProperty"===t.type));s>=0&&this._rawData.transformsArr.splice(s,1),null===(i=this._data)||void 0===i||i.release(),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){il(t.x)&&(this._layoutStartPoint.x=t.x),il(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){il(t)&&(this._layoutRect.width=t),il(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}getSeriesStyle(t){return e=>{var i,s;return null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0}}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesInfoInField(t){var e,i;return this._getSeriesInfo(t,null!==(i=null===(e=this.getRawDataStatisticsByField(t))||void 0===e?void 0:e.values)&&void 0!==i?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo(null!==(t=this._seriesField)&&void 0!==t?t:ST,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;const i=this.getDefaultColorDomain(),s=this._getDataScheme();return null===(e=(t=(new nx).domain(i)).range)||void 0===e?void 0:e.call(t,s)}_getDataScheme(){return Tl(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?null===(e=null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesField])||void 0===e?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(e=this._seriesField)&&void 0!==e?e:ST}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={},i={}){var s,n,r,a,o,l;const{key:h,groupKey:d,skipBeforeLayouted:c,themeSpec:u={},markSpec:p,dataView:g,dataProductId:m,parent:_,isSeriesMark:f,depend:y,stateSort:b,noSeparateStyle:x=!1}=e,S=super._createMark(t,{key:null!=h?h:this._getDataIdKey(),seriesId:this.id,attributeContext:this._markAttributeContext,componentType:e.componentType,noSeparateStyle:x});if(M(S)){const e=this.getSpec()||{};this._marks.addMark(S,{name:t.name}),f&&(this._seriesMark=S),D(_)?null===(s=this._rootMark)||void 0===s||s.addMark(S):!1!==_&&_.addMark(S),D(g)?(S.setDataView(this.getViewData(),this.getViewDataProductId()),S.setSkipBeforeLayouted(!0)):!1!==g&&S.setDataView(g,m),v(c)&&S.setSkipBeforeLayouted(c),M(y)&&S.setDepend(...Na(y)),D(d)||S.setGroupKey(d),b&&S.setStateSortCallback(b);const h=Object.assign(Object.assign({},i),{morph:null!==(n=i.morph)&&void 0!==n&&n,support3d:null!==(r=i.support3d)&&void 0!==r?r:e.support3d||!!e.zField,morphKey:(null===(a=e.morph)||void 0===a?void 0:a.morphKey)||`${this.getSpecIndex()}_${this.getMarks().length}`,morphElementKey:null!==(l=null===(o=e.morph)||void 0===o?void 0:o.morphElementKey)&&void 0!==l?l:i.morphElementKey});S.setMarkConfig(h),this.initMarkStyleWithSpec(S,Pl({},u,p||e[S.name]))}return S}_getDataIdKey(){var t;return null!==(t=super._getDataIdKey())&&void 0!==t?t:xT}_getSeriesDataKey(t){let e="";if(!t)return e;const i=this.getDimensionField();e=i.map((e=>t[e])).join("_");const s=this.getSeriesField();return s&&!i.includes(s)&&(e+=`_${t[s]}`),e}addViewDataFilter(t){var e,i;null===(i=null!==(e=this._viewDataFilter)&&void 0!==e?e:this.getViewData())||void 0===i||i.transform(t,!1)}reFilterViewData(){var t,e;null===(e=null!==(t=this._viewDataFilter)&&void 0!==t?t:this.getViewData())||void 0===e||e.reRunAllTransform()}reTransformViewData(){var t,e;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}fillData(){var t;null===(t=this.getRawData())||void 0===t||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==wT&&t!==LT&&t!==AT&&t!==TT||(t=this.getStackValueField()),null!==(e=jT(this.getRawData(),t))&&void 0!==e?e:t}_getInvalidConnectType(){return"zero"===this._invalidType?"zero":"link"===this._invalidType?"connect":"none"}_getInvalidDefined(t){const e=this.getInvalidCheckFields();return!e.length||e.every((e=>sl(t[e])))}_getRelatedComponentSpecInfo(t){var e;const i=this.getSpecIndex(),s=null===(e=this._option.getSpecInfo().component[t])||void 0===e?void 0:e.filter((t=>t.seriesIndexes.includes(i)));return null!=s?s:[]}_forEachStackGroup(t,e){var i,s;(e=null!=e?e:null===(i=this._viewStackData)||void 0===i?void 0:i.latestData)&&((null===(s=e.values)||void 0===s?void 0:s.length)?t(e):e.nodes&&Object.values(e.nodes).forEach((e=>{this._forEachStackGroup(t,e)})))}isDatumInViewData(t){if(!t)return!1;const e=this.getViewData().latestData;return!!e&&(!!e.includes(t)||e.some((e=>Object.keys(t).every((i=>t[i]===e[i])))))}getSeriesFieldValue(t,e){var i;return t[null!==(i=null!=e?e:this.getSeriesField())&&void 0!==i?i:ST]}}function ZC(t,e,i){const s=t.getScale(0),n="isInverse"in t&&t.isInverse();nd(s.type)?i.sort(((t,i)=>(t[e]-i[e])*(n?-1:1))):i.sort(((t,i)=>(s.index(t[e])-s.index(i[e]))*(n?-1:1)))}function JC(t){return{dataIndex:e=>{var i,s;const n="horizontal"===t.direction?t.fieldY[0]:t.fieldX[0],r=null==e?void 0:e[n],a="horizontal"===t.direction?t.scaleY:t.scaleX;return(null!==(s=null===(i=null==a?void 0:a.domain)||void 0===i?void 0:i.call(a))&&void 0!==s?s:[]).indexOf(r)||0},dataCount:()=>{var e,i,s;const n="horizontal"===t.direction?t.scaleY:t.scaleX;return null!==(s=(null!==(i=null===(e=null==n?void 0:n.domain)||void 0===e?void 0:e.call(n))&&void 0!==i?i:[]).length)&&void 0!==s?s:0}}}qC.mark=_L,qC.transformerConstructor=KC;class QC extends qC{constructor(){super(...arguments),this.coordinate="cartesian",this._bandPosition=.5,this._scaleConfig={bandPosition:this._bandPosition},this._direction="vertical",this._sortDataByAxis=!1,this._getPositionXEncoder=()=>{var t;return null===(t=this._positionXEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionXEncoder=t=>{this._positionXEncoder=t.bind(this)},this._getPositionYEncoder=()=>{var t;return null===(t=this._positionYEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionYEncoder=t=>{this._positionYEncoder=t.bind(this)}}_buildScaleConfig(){this._scaleConfig={bandPosition:this._bandPosition}}get fieldX(){return this._fieldX}setFieldX(t){this._fieldX=Na(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=Na(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&Na(t)}get fieldX2(){return this._fieldX2}setFieldX2(t){this._fieldX2=t}get fieldY2(){return this._fieldY2}setFieldY2(t){this._fieldY2=t}get direction(){return this._direction}get scaleX(){return this._scaleX}setScaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}setScaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}setScaleZ(t){this._scaleZ=t}getXAxisHelper(){return this._xAxisHelper}setXAxisHelper(t){this._xAxisHelper=t,this.onXAxisHelperUpdate()}getYAxisHelper(){return this._yAxisHelper}setYAxisHelper(t){this._yAxisHelper=t,this.onYAxisHelperUpdate()}getZAxisHelper(){return this._zAxisHelper}setZAxisHelper(t){this._zAxisHelper=t,this.onYAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}getStatisticFields(){const t=[];return[{axisHelper:this.getXAxisHelper(),fields:this._fieldX2?[...this._fieldX,this._fieldX2]:this._fieldX},{axisHelper:this.getYAxisHelper(),fields:this._fieldY2?[...this._fieldY,this._fieldY2]:this._fieldY},{axisHelper:this.getZAxisHelper(),fields:this._fieldZ}].forEach((e=>{e.axisHelper&&e.axisHelper.getScale&&e.fields&&e.fields.forEach((i=>{const s={key:i,operations:[]},n=e.axisHelper.getScale(0);nd(n.type)?(s.operations=["max","min"],"log"===n.type&&(s.filter=t=>t>0)):s.operations=["values"],t.push(s)}))})),this.getStack()&&t.push({key:this.getStackValueField(),operations:["allValid"]}),t}getGroupFields(){return"vertical"===this.direction?this._fieldX:this._fieldY}getStackGroupFields(){return this.getGroupFields()}getStackValue(){var t,e;const i=null===(t="horizontal"===this.direction?this.getXAxisHelper():this.getYAxisHelper())||void 0===t?void 0:t.getAxisId();return null!==(e=this._spec.stackValue)&&void 0!==e?e:`${hh}_series_${this.type}_${i}`}getStackValueField(){return"horizontal"===this.direction?Na(this._spec.xField)[0]:Na(this._spec.yField)[0]}setValueFieldToStack(){"horizontal"===this.direction?(this.setFieldX(wT),this.setFieldX2(AT)):(this.setFieldY(wT),this.setFieldY2(AT))}setValueFieldToPercent(){"horizontal"===this.direction?(this.setFieldX(LT),this.setFieldX2(TT)):(this.setFieldY(LT),this.setFieldY2(TT))}setValueFieldToStackOffsetSilhouette(){"horizontal"===this.direction?(this.setFieldX(ET),this.setFieldX2(CT)):(this.setFieldY(ET),this.setFieldY2(CT))}onXAxisHelperUpdate(){this.onMarkPositionUpdate()}onYAxisHelperUpdate(){this.onMarkPositionUpdate()}onZAxisHelperUpdate(){this.onMarkPositionUpdate()}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setFieldX(this._spec.xField),this.setFieldY(this._spec.yField),this.setFieldZ(this._spec.zField),this._specXField=Na(this._spec.xField),this._specYField=Na(this._spec.yField),M(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2(null===(t=this._spec)||void 0===t?void 0:t.x2Field),this.setFieldY2(null===(e=this._spec)||void 0===e?void 0:e.y2Field),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent(),this.getStackOffsetSilhouette()&&this.setValueFieldToStackOffsetSilhouette(),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}dataToPosition(t,e){return t?e&&!this.isDatumInViewData(t)?null:{x:this.dataToPositionX(t),y:this.dataToPositionY(t)}:null}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToX=this.valueToPositionX.bind(this),this._markAttributeContext.valueToY=this.valueToPositionY.bind(this),this._markAttributeContext.xBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getXAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getYAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t,e){return{x:this.valueToPositionX(t),y:this.valueToPositionY(e)}}_axisPosition(t,e,i){return this._scaleConfig.datum=i,t.isContinuous?t.valueToPosition(e,this._scaleConfig):t.dataToPosition(Na(e),this._scaleConfig)}valueToPositionX(t,e){return this._axisPosition(this._xAxisHelper,t,e)}valueToPositionY(t,e){return this._axisPosition(this._yAxisHelper,t,e)}_dataToPosition(t,e,i,s,n,r){const a=n();if(a)return a(t);if(!e)return r((t=>Number.NaN)),Number.NaN;const o=(e.getFields?e.getFields():i).slice(0,s);return o&&0!==o.length?(e.isContinuous?r((t=>(this._scaleConfig.datum=t,e.valueToPosition(this.getDatumPositionValue(t,o[0]),this._scaleConfig)))):r((t=>(this._scaleConfig.datum=t,e.dataToPosition(Na(this.getDatumPositionValues(t,o)),this._scaleConfig)))),n()(t)):(r((t=>null)),null)}dataToPositionX(t){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,void 0,this._getPositionXEncoder,this._setPositionXEncoder)}dataToPositionY(t){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,void 0,this._getPositionYEncoder,this._setPositionYEncoder)}dataToPositionZ(t){if(!this._zAxisHelper)return Number.NaN;const{dataToPosition:e}=this._zAxisHelper;return e(this.getDatumPositionValues(t,this._fieldZ),{bandPosition:this._bandPosition})}dataToPositionX1(t){return this._xAxisHelper?this._fieldX2&&this._fieldX2 in t?this.valueToPositionX(this.getDatumPositionValues(t,this._fieldX2)):this.valueToPositionX(0):Number.NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):Number.NaN}positionToData(t){return t?{x:this.positionToDataX(t.x),y:this.positionToDataY(t.y)}:null}positionToDataX(t){return this._scaleX?this._scaleX.invert(t):null}positionToDataY(t){return this._scaleY?this._scaleY.invert(t):null}getRegionRectLeft(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[1]}afterInitMark(){super.afterInitMark(),this.setFieldX(this._fieldX),this.setFieldY(this._fieldY),this._buildScaleConfig()}getDimensionField(){return"horizontal"===this._direction?this._specYField:this._specXField}getDimensionContinuousField(){return"horizontal"===this._direction?[this.fieldY[0],this.fieldY2]:[this.fieldX[0],this.fieldX2]}getMeasureField(){return"horizontal"===this._direction?this._specXField:this._specYField}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(zd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e,i;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&(ZC("horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,"horizontal"===this._direction?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),null===(i=this._data)||void 0===i||i.updateData(!0))}getInvalidCheckFields(){const t=[];return this._xAxisHelper&&this._xAxisHelper.isContinuous&&this._xAxisHelper.getAxisType()!==r.geoCoordinate&&(this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._specXField).forEach((e=>{t.push(e)})),this._yAxisHelper&&this._yAxisHelper.isContinuous&&this._yAxisHelper.getAxisType()!==r.geoCoordinate&&(this._yAxisHelper.getFields?this._yAxisHelper.getFields():this._specYField).forEach((e=>{t.push(e)})),t}reInit(t){this._positionXEncoder&&(this._positionXEncoder=null),this._positionYEncoder&&(this._positionYEncoder=null),super.reInit(t)}}const tE="monotone",eE="linear",iE={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}};class sE{addSamplingCompile(){if(this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}addOverlapCompile(){var t;if(this._spec.markOverlap){const e=[];e.push({type:"markoverlap",direction:"horizontal"===this._direction&&"cartesian"===this.coordinate?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),null===(t=this._symbolMark)||void 0===t||t.getProduct().transform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t,e){var i,s;return this._lineMark=this._createMark(iE.line,{groupKey:this._seriesField,isSeriesMark:null==e||e,stateSort:null===(i=this._spec.line)||void 0===i?void 0:i.stateSort},Object.assign(Object.assign({},t),{setCustomizedShape:null===(s=this._spec.line)||void 0===s?void 0:s.customShape,morphElementKey:this.getDimensionField()[0]})),this._lineMark}initLineMarkStyle(t,e){var i,s;const n=this._lineMark;if(n){if(this.setMarkStyle(n,{stroke:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(n,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(n,"defined")})),"polar"===this.coordinate)this.setMarkStyle(n,{lineJoin:"bevel",curveType:eE,closePath:!0},"normal",Py.Series);else{const r=null!=e?e:null===(s=null===(i=this.getSpec().line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.curveType,a=r===tE?"horizontal"===t?"monotoneY":"monotoneX":r;this.setMarkStyle(n,{curveType:a},"normal",Py.Built_In)}this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series)}return n}_getEventElement(t,e=!1){let i=[];return t.dimensionInfo.some((t=>(t.data.some((t=>t.series===this&&(i=t.datum,!0))),!i.length))),i}_dimensionTrigger(t){const e=this._getEventElement(t);switch(t.action){case"enter":this._symbolActiveMark.getDataView().parse(e),this._symbolActiveMark.getData().updateData(!1);break;case"leave":this._symbolActiveMark.getDataView().parse([]),this._symbolActiveMark.getData().updateData(!1)}}initSymbolMark(t,e){const i=this._spec.point||{};if(!1!==i.visible&&(this._symbolMark=this._createMark(iE.point,{groupKey:this._seriesField,isSeriesMark:!!e,stateSort:i.stateSort},Object.assign(Object.assign({},t),{setCustomizedShape:i.customShape,morph:GC(this._spec,iE.point.name),morphElementKey:this.getDimensionField()[0]}))),!0===this._spec.activePoint){const t=new R(this._option.dataSet,{name:`${hh}_series_${this.id}_active_point`});t.parse([]),this._symbolActiveMark=this._createMark({name:`active_point_${this.id}`,type:"symbol"},{groupKey:this._seriesField,isSeriesMark:!1,dataView:t,parent:this._region.getInteractionMark(),stateSort:i.stateSort},{setCustomizedShape:i.customShape,morph:!1}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){const t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){this._symbolActiveMark.setVisible(!0),this.event.on(td.dimensionHover,this._dimensionTrigger.bind(this));for(const e in this._symbolMark.stateStyle){this._symbolActiveMark.stateStyle[e]={};for(const i in this._symbolMark.stateStyle[e])"visible"!==i&&(this._symbolActiveMark.stateStyle[e][i]={style:null,level:Py.Series,referer:t})}this._symbolActiveMark.state.changeStateInfo({stateValue:Sy.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series))}_initSymbolActiveMarkAlone(){var t,e;const i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(null===(e=null===(t=this._spec[iE.point.name])||void 0===t?void 0:t.state)||void 0===e?void 0:e.dimension_hover)&&(i.setVisible(!0),this.event.on(td.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,Pl({},this._spec[iE.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:Sy.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&("symbol"!==(null===(e=t.getTarget())||void 0===e?void 0:e.type)&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getSeriesField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,s,n,r;if(!t)return;const a=this._isFieldAllValid();if("zero"===this._invalidType||a){if(!0===(null===(s=null===(i=t.stateStyle.normal)||void 0===i?void 0:i[e])||void 0===s?void 0:s.style))return;this.setMarkStyle(t,{[e]:!0},"normal",Py.Series)}else{if(!0!==(null===(r=null===(n=t.stateStyle.normal)||void 0===n?void 0:n[e])||void 0===r?void 0:r.style))return;this.setMarkStyle(t,{[e]:this._getInvalidDefined.bind(this)},"normal",Py.Series)}t.getProduct()&&t.compileEncode()}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.getStackValueField();return!!(t&&t.latestData&&e)&&t.latestData[e]&&t.latestData[e].allValid}}const nE=Object.assign(Object.assign({},_L),iE);class rE extends yx{setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this._getIgnoreAttributes(),r=["strokeWidth","lineWidth","lineDash","strokeDash","lineJoin","stroke","strokeOpacity","opacity","fill","fillOpacity","texture","texturePadding","textureSize","textureColor"],a=this.isUserLevel(i);let o=!1;Object.keys(t).forEach((l=>{const h=t[l];if(D(h)||n.includes(l))return;a&&r.includes(l)&&(rd(null==h?void 0:h.type)||(null==h?void 0:h.scale)||ws(h))&&(o=!0);const d=this._filterAttribute(l,h,e,i,a,s);this.setAttribute(l,d,e,i,s)})),o&&this.setMarkConfig({enableSegments:!0})}}class aE extends rE{constructor(){super(...arguments),this.type=aE.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return(null===(t=this.model)||void 0===t?void 0:t.type)===Sl.radar&&"polar"===(null===(e=this.model)||void 0===e?void 0:e.coordinate)?[]:["fill","fillOpacity"]}}aE.type="line";const oE=()=>{Ql.registerMark(aE.type,aE),Mx(),dM(),YA(),HA(),fc.registerGraphic(Qd.line,QS),YC()};class lE extends yx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}}class hE extends lE{constructor(){super(...arguments),this.type=hE.type}}hE.type="symbol";const dE=()=>{Ql.registerMark(hE.type,hE),UA()},cE=(t,e,i)=>e.filter((e=>t.callback(e,i))),uE=(t,e,i)=>{const s=t.callback,n=t.as;if(!t.all)return e.forEach((t=>{const e=s(t,i);if(!D(n)){if(D(t))return;t[n]=e}return e})),e;const r=s(e,i);return D(n)||D(e)?r:(e[n]=r,e)};function pE(t){return t.reduce(((t,e)=>t+e),0)}const gE={min:Ga,max:Wa,average:function(t){return 0===t.length?0:pE(t)/t.length},sum:pE};function mE(t,e,i,s){const n=Math.floor(e.length/t),r=[],a=e.length;let o,l,h,d=0,c=0;r[c++]=d;for(let t=1;to&&(o=l,h=t))}r[c++]=h,d=h}return r[c-1]!==a-1&&(r[c++]=a-1),r.map((t=>i?e[t].i:t))}function _E(t,e,i,s,n){let r=Math.floor(e.length/t);const a=[],o=e.length;let l=0,h=[];a.push(l),e[l][n]=e[l][n];for(let t=1;to-t&&(r=o-t,h.length=r),h=[];for(let i=0;ii?e[t].i:t))}function fE(t,e,i,s){return _E(t,e,i,"min",s)}function vE(t,e,i,s){return _E(t,e,i,"max",s)}function yE(t,e,i,s){return _E(t,e,i,"average",s)}function bE(t,e,i,s){return _E(t,e,i,"sum",s)}const xE=(t,e)=>{let i=t.size;const s=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),i*=s,i<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);const{mode:n,yfield:r,groupBy:a}=t,o=null!=r?r:"y";let l=mE;if("min"===n?l=fE:"max"===n?l=vE:"average"===n?l=yE:"sum"===n&&(l=bE),e.length){const t={};if(a){for(let i=0,s=e.length;i{const r=t[n];if(r.length<=i){const t=r.map((t=>t.i));s=s.concat(t)}else{const t=l(i,r,!0,o);s=s.concat(t),r.forEach((t=>e[t.i][o]=t[o]))}})),s.sort(((t,e)=>t-e)),s.map((t=>e[t]))}return l(i,e,!1,o).map((t=>e[t]))}return[]},SE=(t,e)=>{if(!e||0===e.length)return;let{radius:i}=t;D(i)&&"symbol"===e[0].mark.markType&&(i=!0);const{direction:s,delta:n,deltaMul:r=1,groupBy:a}=t,o=e=>{!function(t){t.forEach((t=>{t.getGraphicAttribute(dm)&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute(dm,!1))}))}(e);const a=t.sort?e.slice().sort(((t,e)=>t.getGraphicAttribute("x")-e.getGraphicAttribute("x"))):e;0===s?function(t,e,i,s){if(s){const s=-1/0;let n=-1/0,r=0,a=0;const o=D(e);let l=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,h=t.getGraphicAttribute("x"),d=t.getGraphicAttribute("y");o&&(l=(e+r)*i),a=(s-h)**2+(n-d)**2,a<(l+r+e)**2?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(dm,!0),t.setGraphicAttribute("visible",!1)):n=d,r=e}))}}(a,n,r,i):1===s?function(t,e,i,s){if(s){let s=-1/0,n=0;const r=D(e);let a=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("x");r&&(a=(e+n)*i),Math.abs(o-s){if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("y");r&&(a=(e+n)*i),Math.abs(o-s){const i=e.getDatum()[a];return t[i]?t[i].push(e):t[i]=[e],t}),{});Object.keys(t).forEach((e=>{o(t[e])}))}else o(e);return e},ME=()=>{fc.registerTransform("sampling",{transform:xE,markPhase:"afterEncode"},!0)},kE=()=>{fc.registerTransform("markoverlap",{transform:SE,markPhase:"afterEncode"},!0)};class AE extends KC{_transformLabelSpec(t){var e,i,s;!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}function wE(t,e,i){let s=!1;if(e&&ws(e))for(const n of t)for(const t of n.getSeries(i))if(s=!!e.call(null,t),s)return s;return s}function TE(t,e){const i=[];for(const s of t)for(const t of s.getSeries(e))i.push(t);return i}const LE=(t,e)=>{for(let i=0;i=t[0]}function EE(t,e){const i=Va(e)-e[0],s=Va(e)*e[0]<0;let n=e[0]<=0?0-e[0]:0,r=Va(e)>0?Va(e)-0:0;0===i?e[0]<0?(n=1,r=0):e[0]>0&&(n=0,r=1):(n/=i,r/=i);const a=t.getDomainSpec();return{total:i,negative:n,positive:r,includeZero:s,domain:e,extendable_min:!il(a.min),extendable_max:!il(a.max)}}function DE(t,e){const{positive:i,negative:s,extendable_min:n,extendable_max:r,domain:a}=t,{positive:o,negative:l,extendable_min:h,extendable_max:d,domain:c}=e;if(o>0){if(!h)return!1;let t=s/i;r&&(t=s/Math.max(i,o),a[1]=-a[0]/t),c[0]=-c[1]*t}else if(l>0){if(!d)return!1;let t=i/s;n&&(t=i/Math.max(s,s),a[0]=-a[1]/t),c[1]=-c[0]*t}return!0}function OE(t,e){const{extendable_min:i,extendable_max:s,domain:n}=t,{positive:r,negative:a,domain:o}=e;return!(0===r&&0===a||r>0&&!s||a>0&&!i||(n[0]=o[0],n[1]=o[1],0))}function PE(t,e){const{positive:i,negative:s,extendable_max:n,domain:r}=t,{positive:a,negative:o,extendable_min:l,domain:h}=e;if(n&&l){const t=Math.max(s,o)/Math.max(i,a);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(l){const t=s/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=o/a;r[1]=-r[0]/t}}return!0}function RE(t,e){const{extendable_min:i,domain:s}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(s[0]=-s[1],r[1]=-r[0],0))}const BE=t=>t.map(((t,e)=>({index:e,value:t}))),IE=(t,e,i=0)=>{const s=new qt(t).expand(i/2),n=new qt(e).expand(i/2);return s.intersects(n)},FE=(t,e,i,s)=>it?Math.min(t-e/2,i-e):i{var s;const{labelStyle:n,axisOrientType:r,labelFlush:a,labelFormatter:o,startAngle:l=0}=i;let h=null!==(s=n.angle)&&void 0!==s?s:0;"vertical"===n.direction&&(h+=At(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,p=0;d||(c?(u=0,p=1):l&&(u=Math.cos(l),p=-Math.sin(l)));const g=Qk(n),m=t.range(),_=e.map(((i,s)=>{var r,l;const _=o?o(i):`${i}`,{width:f,height:v}=g.quickMeasure(_),y=Math.max(f,12),b=Math.max(v,12),x=t.scale(i),S=u*x,M=p*x;let k,A,w=S,T=M;a&&d&&0===s?w=FE(S,y,m[0],m[m.length-1]):a&&d&&s===e.length-1?w=FE(S,y,m[m.length-1],m[0]):k=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===k?w-=y:"center"===k&&(w-=y/2),a&&c&&0===s?T=FE(M,b,m[0],m[m.length-1]):a&&c&&s===e.length-1?T=FE(M,b,m[m.length-1],m[0]):A=null!==(l=n.textBaseline)&&void 0!==l?l:"middle","bottom"===A?T-=b:"middle"===A&&(T-=b/2);const L=(new qt).set(w,T,w+y,T+b);return h&&L.rotate(h,S,M),L}));return _},jE=(t,e)=>{var i,s,n,r,a;if(!t)return t;const o=null===(i=null==e?void 0:e.targetAxis)||void 0===i?void 0:i.call(e);if(!o)return t;const l=null===(s=null==e?void 0:e.currentAxis)||void 0===s?void 0:s.call(e);if(!l)return t;const h=null===(n=l.getTickData())||void 0===n?void 0:n.getDataView();if(!h)return t;if(!h.transformsArr.find((t=>t.type.includes("ticks"))))return t;const d=l.getScale();if(!d)return t;const c=null===(a=null===(r=o.getTickData())||void 0===r?void 0:r.getDataView())||void 0===a?void 0:a.latestData;if(!(null==c?void 0:c.length))return t;const u=o.getScale();if(!u)return t;const p=u.domain(),g=Va(p)-p[0];if(0===g)return t;const m=d.domain(),_=Va(m)-m[0];if(0===g)return t;const f=c.map((t=>{const e=(t.value-p[0])/g;return _*e+m[0]}));return BE(f)};class HE{constructor(t){this.id=el(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}release(){this.service=null}}class zE extends HE{constructor(){super(zE.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!nd(t.getScale().type))return!1;const e=t.getSpec().sync;return!!(null==e?void 0:e.axisId)&&e}_getTargetAxis(t,e){const i=t.getOption().getChart().getComponentByUserId(e.axisId);return(null==i?void 0:i.type.startsWith("cartesianAxis"))?i:null}onInit(t,e){const i=this._checkEnableSync(e);if(!i)return;if(!i.zeroAlign)return;const s=this._getTargetAxis(e,i);s&&e.event.on(zd.scaleDomainUpdate,{filter:({model:t})=>t.id===e.id||t.id===s.id},(()=>{((t,e)=>{var i,s,n,r,a,o;const l=t.getScale(),h=e.getScale();if(!l||!h)return;const d=null!==(n=null===(s=(i=t).getDomainAfterSpec)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[0,1],c=null!==(o=null===(a=(r=e).getDomainAfterSpec)||void 0===a?void 0:a.call(r))&&void 0!==o?o:[0,1];if(!(d&&c&&CE(d)&&CE(c)))return;const u=EE(t,d),p=EE(e,c),{positive:g,negative:m,extendable_min:_,extendable_max:f,includeZero:v}=u,{positive:y,negative:b,extendable_min:x,extendable_max:S,includeZero:M}=p;if(0===g&&0===m){if(!OE(u,p))return}else if(0===y&&0===b){if(!OE(p,u))return}else if(v||M)if(v&&!M){if(!DE(u,p))return}else if(M&&!v){if(!DE(p,u))return}else{if(m===b)return;if(m>b){if(!PE(u,p))return}else if(!PE(p,u))return}else{if(0===m&&0===y){if(!RE(u,p))return}else if(0===b&&0===g&&!RE(p,u))return;if(0===m&&0===b)if(0===d[0]&&c[0]>0){if(!x)return;c[0]=0}else{if(!(0===c[0]&&d[0]>0))return;if(!_)return;d[0]=0}if(0===g&&0===y)if(0===d[1]&&c[1]>0){if(!S)return;c[1]=0}else{if(!(0===c[1]&&d[1]>0))return;if(!f)return;d[1]=0}}l.domain(d),h.domain(c)})(s,e)}))}onDidCompile(t,e){const i=this._checkEnableSync(e);if(!i)return;const s=this._getTargetAxis(e,i);if(s&&i.tickAlign){Cp(e.getOption().dataSet,"tickAlign",jE);const t={targetAxis:()=>s,currentAxis:()=>e};e.addTransformToTickData({type:"tickAlign",options:t,level:Number.MAX_SAFE_INTEGER},!1)}}}function NE(t={}){const e=Object.assign({},t);if(ws(t.style)?e.style=(e,i,s,n)=>GE(t.style(e,i,s,n)):jm(t.style)||(e.style=GE(t.style)),!jm(t.state)){const i={};Object.keys(t.state).forEach((e=>{ws(t.state[e])?i[e]=(i,s,n,r)=>GE(t.state[e](i,s,n,r)):jm(t.state[e])||(i[e]=GE(t.state[e]))})),e.state=i}return e}function VE(t){if(jm(t))return null;const e={};return Object.keys(t).forEach((i=>{ws(t[i])?e[i]=(e,s,n,r)=>GE(t[i](e,s,n,r)):jm(t[i])||(e[i]=GE(t[i]))})),e}function WE(t,e){if(jm(t))return null;const i={};return Object.keys(t).forEach((s=>{ws(t[s])?i[s]=t[s](e):i[s]=t[s]})),GE(i)}function GE(t){return(null==t?void 0:t.angle)&&(t.angle=At(t.angle)),t}zE.pluginType="component",zE.type="AxisSyncPlugin";const UE={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function $E(t){let e=0;return $d(t,"tick.visible")&&(e+=$d(t,"tick.tickSize")),$d(t,"label.visible")&&(e+=$d(t,"label.space")),e}function XE(t,e){var i,s,n,r,a,o;return{min:null!==(n=null!==(i=t.min)&&void 0!==i?i:null===(s=t.range)||void 0===s?void 0:s.min)&&void 0!==n?n:null==e?void 0:e.min,max:null!==(o=null!==(r=t.max)&&void 0!==r?r:null===(a=t.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null==e?void 0:e.max}}function KE(t){const e=null==t?void 0:t.orient;return"top"===e||"bottom"===e||"left"===e||"right"===e||"z"===e}const qE=(t,e,i)=>{var s;const n=null!==(s="band"===e?XT("axisBand",i):["linear","log","symlog"].includes(e)?XT("axisLinear",i):{})&&void 0!==s?s:{},r=Ad(t)?XT("axisX",i):wd(t)?XT("axisY",i):XT("axisZ",i);return Pl({},XT("axis",i),n,r)},ZE=(t,e,i)=>{var s;const n=null!==(s="band"===e?XT("axisBand",i):"linear"===e?XT("axisLinear",i):{})&&void 0!==s?s:{},r=XT("angle"===t?"axisAngle":"axisRadius",i);return Pl({},XT("axis",i),n,r)},JE=t=>"band"===t||"ordinal"===t||"point"===t;function QE(t,e){return{id:t,label:t,value:e,rawValue:t}}function tD(t,e,i){return i||!t||t.getAxisId()===e.getAxisId()}class eD extends Jw{constructor(t){super(),this.component=t}releaseAll(){super.releaseAll(),this.component=null}}function iD(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:d=0,dy:c=0}=t.attribute;let u=0,p=0;an&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+d),p&&t.setAttribute("dy",p+c)}function sD(t,e,i,s){for(let n=0,r=t.length;n=e)return r}}return null}const nD=(t,e)=>{var i;const s=Pl({},e,e[Cd(null!==(i=t.orient)&&void 0!==i?i:e.orient)]);return delete s.horizontal,delete s.vertical,s};class rD extends Hy{getTheme(t,e){return function(t,e,i,s){switch(t){case r.cartesianBandAxis:return qE(Ld(i,["z"]),"band",e);case r.cartesianLinearAxis:return qE(Ld(i,["z"]),"linear",e);case r.cartesianLogAxis:return qE(Ld(i,["z"]),"log",e);case r.cartesianSymlogAxis:return qE(Ld(i,["z"]),"symlog",e);case r.cartesianAxis:case r.cartesianTimeAxis:return qE(Ld(i),void 0,e);case r.polarBandAxis:return ZE(i.orient,"band",e);case r.polarLinearAxis:return ZE(i.orient,"linear",e);case r.polarAxis:return ZE(i.orient,void 0,e);case r.cartesianCrosshair:return((t,e)=>{var i,s;const n=Na(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,xField:l,yField:h}=null!==(s=XT(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>Ad(t.orient)));let c;c=M(d)?Pl({},JE(d.type)?a:o,l):l;const u=n.find((t=>wd(t.orient)));let p;return p=M(u)?Pl({},ad(u.type)?a:o,h):h,{xField:c,yField:p}})(e,s);case r.polarCrosshair:return((t,e)=>{var i,s;const n=Na(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,categoryField:l,valueField:h}=null!==(s=XT(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>"angle"===t.orient));let c;c=M(d)?Pl({},JE(d.type)?a:o,l):l;const u=n.find((t=>"radius"===t.orient));let p;return p=M(u)?Pl({},ad(u.type)?a:o,h):h,{categoryField:c,valueField:p}})(e,s);case r.colorLegend:case r.sizeLegend:case r.discreteLegend:case r.dataZoom:case r.scrollBar:return nD(i,XT(t,e));default:return XT(t,e)}}(this.type,this._option.getTheme(),t,e)}_mergeThemeToSpec(t,e){const{spec:i,theme:s}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:s}}_adjustPadding(t){const{padding:e,noOuterPadding:i=!0,orient:s}=t;i&&e&&s&&(t.padding=Object.assign(Object.assign({},hl(e)),{[s]:0}))}}class aD extends Wy{static createComponent(t,e){const{spec:i}=t,s=function(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{var r,a;e instanceof Cs||this.event.emit(i,{model:this,node:t,event:e,item:s,datum:n,source:Nd.chart,chart:null===(a=null===(r=this._option)||void 0===r?void 0:r.globalInstance)||void 0===a?void 0:a.getChart()},"model")},this._option.animation&&(this.animate=new jy({getCompiler:e.getCompiler}))}initLayout(){var t;super.initLayout(),this._regions=null!==(t=this._regions)&&void 0!==t?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map((t=>null==t?void 0:t.id)))}changeRegions(t){throw new Error("Method not implemented.")}_getNeedClearVRenderComponents(){throw new Error("Method not implemented.")}onRender(t){throw new Error("Method not implemented.")}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEach((e=>t(e)))}getContainer(){var t;return this._container||(this._container=null===(t=this._option)||void 0===t?void 0:t.globalInstance.getStage().find((t=>"root"===t.name),!0)),this._container}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some((i=>!Im(null==e?void 0:e[i],t[i])))),(null==e?void 0:e.visible)!==t.visible&&(i.reCompile=!0),i}release(){var t;super.release(),this.clear(),null===(t=this.pluginService)||void 0===t||t.releaseAll(),this.pluginService=null}clear(){var t;const e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach((t=>{var e;t&&(null===(e=this.getContainer())||void 0===e||e.removeChild(t),t=null)})),this._container=null,null===(t=this.pluginService)||void 0===t||t.clearAll()}compile(){this.compileMarks(),this.reAppendComponents()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t,context:{model:this}})}))}reAppendComponents(){const t=this._getNeedClearVRenderComponents();t&&t.length&&t.forEach((t=>{var e;t&&!t.stage&&(null===(e=this.getContainer())||void 0===e||e.appendChild(t))}))}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}}function oD(t,e){if(!t||!w(t))return t;const i={};return Object.keys(t).forEach((s=>{const n=t[s];let r=!1;e.forEach((t=>{(S(t)&&t===s||t instanceof RegExp&&s.match(t))&&(r=!0)})),r||(i[s]=n)})),i}aD.transformerConstructor=rD;class lD extends yx{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(Qd.component,null!=t?t:e.rootMark,{componentType:this._componentType,mode:this._mode}).id(i),this._compiledProductId=i}}lD.type="component";const hD=()=>{Ql.registerMark(lD.type,lD)};class dD extends Rs{constructor(){super(...arguments),this.mode=ce.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._newElementAttrMap={},Nk(t,(t=>{var i,s,n,r,a,o;if("group"!==t.type&&t.id){const l=e[t.id];if(l){if(!Im(t.attribute,l.attribute)){const e=k(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},e),{opacity:null!==(i=e.opacity)&&void 0!==i?i:1,fillOpacity:null!==(s=e.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(n=e.strokeOpacity)&&void 0!==n?n:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(r=t.attribute.opacity)&&void 0!==r?r:1,fillOpacity:null!==(a=t.attribute.fillOpacity)&&void 0!==a?a:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;this._newElementAttrMap&&Object.keys(this._newElementAttrMap).forEach((i=>{var s;const{node:n,attrs:r,state:a}=this._newElementAttrMap[i];if("enter"===a){const{enter:i={}}=null!==(s=this.params)&&void 0!==s?s:{};t=il(i.duration)?i.duration:t,e=i.easing?i.easing:e}"path"===n.type?n.animate({interpolate:(t,e,i,s,n)=>"path"===t&&(n.path=function(t,e){let i,s,n,r=Gb.lastIndex=Ub.lastIndex=0,a=-1;const o=[],l=[];for(t+="",e+="";(i=Gb.exec(t))&&(s=Ub.exec(e));)(n=s.index)>r&&(n=e.slice(r,n),o[a]?o[a]+=n:o[++a]=n),(i=i[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:Vb(i,s)})),r=Ub.lastIndex;return rt;class gD extends aD{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(t=0){return this._tickData[t]}get visible(){return this._visible}getInverse(){return this._inverse}getCoordinateType(){return this._coordinateType}constructor(t,e){var i;super(t,e),this.specKey="axes",this._scales=[],this._tickData=[],this._visible=!0,this._tick=void 0,this._visible=null===(i=t.visible)||void 0===i||i,this._coordinateType="none"}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){var t,e,i,s;return[null===(e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct())||void 0===e?void 0:e.getGroupGraphicItem(),null===(s=null===(i=this._gridMark)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.getGroupGraphicItem()].filter(M)}created(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this._shouldComputeTickData()&&this._initData(),this._visible){const v=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:"angle"===this.getOrient()?"circleAxis":"axis",mode:this._spec.mode,noSeparateStyle:!0},{skipTheme:!0});if(this._axisMark=v,v.setMarkConfig({zIndex:this.layoutZIndex}),M(this._spec.id)&&v.setUserId(this._spec.id),v.setMarkConfig({interactive:null!==(t=this._spec.interactive)&&void 0!==t?t:this.getDefaultInteractive()}),this._marks.addMark(v),null===(e=this._spec.grid)||void 0===e?void 0:e.visible){const t=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:"angle"===this.getOrient()?sc.circleAxisGrid:sc.lineAxisGrid,mode:this._spec.mode,noSeparateStyle:!0},{skipTheme:!0});t.setMarkConfig({zIndex:null!==(a=null!==(n=null===(s=null===(i=this._spec.grid)||void 0===i?void 0:i.style)||void 0===s?void 0:s.zIndex)&&void 0!==n?n:null===(r=this._spec.grid)||void 0===r?void 0:r.zIndex)&&void 0!==a?a:Dy.Axis_Grid,interactive:!1}),this._marks.addMark(t),this._gridMark=t}if(!1!==this._option.animation&&!1!==$d(this._option.getChart().getSpec(),"animation")&&!0===this._spec.animation){const t=zC(null===(o=Ql.getAnimationInKey("axis"))||void 0===o?void 0:o(),{appear:null!==(h=null!==(l=this._spec.animationAppear)&&void 0!==l?l:$d(this._option.getChart().getSpec(),"animationAppear.axis"))&&void 0!==h?h:$d(this._option.getChart().getSpec(),"animationAppear"),disappear:null!==(c=null!==(d=this._spec.animationDisappear)&&void 0!==d?d:$d(this._option.getChart().getSpec(),"animationDisappear.axis"))&&void 0!==c?c:$d(this._option.getChart().getSpec(),"animationDisappear"),enter:null!==(p=null!==(u=this._spec.animationEnter)&&void 0!==u?u:$d(this._option.getChart().getSpec(),"animationEnter.axis"))&&void 0!==p?p:$d(this._option.getChart().getSpec(),"animationEnter"),exit:null!==(m=null!==(g=this._spec.animationExit)&&void 0!==g?g:$d(this._option.getChart().getSpec(),"animationExit.axis"))&&void 0!==m?m:$d(this._option.getChart().getSpec(),"animationExit"),update:null!==(f=null!==(_=this._spec.animationUpdate)&&void 0!==_?_:$d(this._option.getChart().getSpec(),"animationUpdate.axis"))&&void 0!==f?f:$d(this._option.getChart().getSpec(),"animationUpdate")});t.enter&&(t.update[0].customParameters={enter:t.enter[0]}),this._marks.forEach((e=>e.setAnimationConfig(t)))}}}_shouldComputeTickData(){return this.getVisible()||this._spec.forceInitTick}_initData(){const t=this._initTickDataSet(this._tickTransformOption());t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=[new gx(this._option,t)]}collectData(t,e){const i=[];return wE(this._regions,(s=>{var n;let a=this.collectSeriesField(t,s);if(a=y(a)?nd(this._scale.type)?a:[a[0]]:[a],t||(this._dataFieldText=s.getFieldAlias(a[0])),a){const t=s.getViewData();if(e)a.forEach((t=>{i.push(s.getRawDataStatisticsByField(t,!1))}));else if(t&&t.latestData&&t.latestData.length){const e=null===(n=s.getViewDataStatistics)||void 0===n?void 0:n.call(s),o=this.type===r.cartesianLinearAxis&&this._spec.breaks&&this._spec.breaks.length;a.forEach((s=>{var n;(null===(n=null==e?void 0:e.latestData)||void 0===n?void 0:n[s])&&(o?i.push(Object.assign(Object.assign({},e.latestData[s]),{values:t.latestData.map((t=>t[s]))})):i.push(e.latestData[s]))}))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}isSeriesDataEnable(){let t=!0;return wE(this._regions,(e=>{var i;y(null===(i=e.getViewDataStatistics())||void 0===i?void 0:i.latestData)&&(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){const{seriesId:t,seriesIndex:e,regionId:i,regionIndex:s}=this._spec;M(t)&&(this._seriesUserId=Na(t)),M(i)&&(this._regionUserId=Na(i)),M(e)&&(this._seriesIndex=Na(e)),M(s)&&(this._regionIndex=Na(s)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionIndex),this.layout.layoutBindRegionID=this._regions.map((t=>t.id))}getBindSeriesFilter(){return{userId:this._seriesUserId,specIndex:this._seriesIndex}}initEvent(){this.event.on(zd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const t=TE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}).map((t=>t.getViewDataStatistics())).filter((t=>!!t));t.length>1?this._option.dataSet.multipleDataViewAddListener(t,"change",(()=>{this.updateScaleDomain()})):1===t.length&&t[0].target.addListener("change",(()=>{this.updateScaleDomain()})),wE(this._regions,(t=>{t.event.on(zd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._clearRawDomain()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_clearRawDomain(){}onLayoutEnd(t){this.updateScaleRange(),this.event.emit(zd.scaleUpdate,{model:this,value:"range"}),super.onLayoutEnd(t)}computeData(t){"force"!==t||this._tickData&&this._tickData.length?!this._tickData||!this._tickData.length||"force"!==t&&Im(this._scale.range(),[0,1])||this._tickData.forEach((t=>{t.getDataView().reRunAllTransform(),t.updateData()})):wE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.reRunAllTransform()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}initScales(){this._scales=[this._scale];const t=[];if(wE(this._regions,(e=>{const i=e.getGroups();i&&t.push(i)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),0!==t.length){const e=Wa(t.map((t=>t.fields.length)));for(let t=1;t{var s,n;return(null===(s=null==e?void 0:e[i])||void 0===s?void 0:s.visible)!==(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.visible)})),i))}_getAxisAttributes(){const t=this._spec,e={orient:this.getOrient(),select:!0!==this._option.disableTriggerEvent&&t.select,hover:!0!==this._option.disableTriggerEvent&&t.hover};if(t.domainLine&&t.domainLine.visible?e.line=((i=NE(i=t.domainLine)).startSymbol=NE(i.startSymbol),i.endSymbol=NE(i.endSymbol),i):e.line={visible:!1},t.label&&t.label.visible){const i=oD(t.label,["style","formatMethod","state"]);e.label=i,t.label.style&&(e.label.style=ws(t.label.style)?(e,i,s,n)=>{var r;const a=t.label.style(e.rawValue,i,e,s,n);return GE(Pl({},null===(r=this._theme.label)||void 0===r?void 0:r.style,a))}:GE(t.label.style)),(t.label.formatMethod||t.label.formatter)&&(e.label.formatMethod=this._getLabelFormatMethod()),t.label.state&&(e.label.state=function(t){if(jm(t))return null;const e={};return Object.keys(t).forEach((i=>{ws(t[i])?e[i]=(e,s,n,r)=>GE(t[i](e.rawValue,s,e,n,r)):jm(t[i])||(e[i]=GE(t[i]))})),e}(t.label.state))}else e.label={visible:!1};var i;if(t.tick&&t.tick.visible?(e.tick={visible:t.tick.visible,length:t.tick.tickSize,inside:t.tick.inside,alignWithLabel:t.tick.alignWithLabel,dataFilter:t.tick.dataFilter},t.tick.style&&(e.tick.style=ws(t.tick.style)?(e,i,s,n)=>{var r;const a=t.tick.style(e,i,s,n);return GE(Pl({},null===(r=this._theme.tick)||void 0===r?void 0:r.style,a))}:GE(t.tick.style)),t.tick.state&&(e.tick.state=VE(t.tick.state))):e.tick={visible:!1},t.subTick&&t.subTick.visible?(e.subTick={visible:t.subTick.visible,length:t.subTick.tickSize,inside:t.subTick.inside,count:t.subTick.tickCount},t.subTick.style&&(e.subTick.style=ws(t.subTick.style)?(e,i,s,n)=>{var r;const a=t.subTick.style(e,i,s,n);return GE(Pl({},null===(r=this._theme.subTick)||void 0===r?void 0:r.style,a))}:GE(t.subTick.style)),t.subTick.state&&(e.subTick.state=VE(t.subTick.state))):e.subTick={visible:!1},t.title&&t.title.visible){const i=t.title,{autoRotate:s,angle:n,style:r={},background:a,state:o,shape:l}=i,h=function(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(e,i)=>{var s,n;const r=t.grid.style(null===(s=e.datum)||void 0===s?void 0:s.rawValue,i,e.datum);return GE(Pl({},null===(n=this._theme.grid)||void 0===n?void 0:n.style,r))}:GE(t.grid.style),subGrid:!1===t.subGrid.visible?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:t.subGrid.alternateColor,style:GE(t.subGrid.style)}}}_getLabelFormatMethod(){const{formatMethod:t,formatter:e}=this._spec.label,{formatFunc:i}=KT(t,e);return i?(t,s,n)=>i(s.rawValue,s,e):null}_initTickDataSet(t,e=0){Ep(this._option.dataSet,"scale",pD);const i=this.registerTicksTransform();return new R(this._option.dataSet,{name:`${this.type}_${this.id}_ticks_${e}`}).parse(this._scales[e],{type:"scale"}).transform({type:i,options:t},!1)}_tickTransformOption(){const t=this._tick||{},e=this._spec.label||{},{tickCount:i,forceTickCount:s,tickStep:n,tickMode:r}=t,{style:a,formatMethod:o,minGap:l}=e;return{sampling:!1!==this._spec.sampling,tickCount:i,forceTickCount:s,tickStep:n,tickMode:r,axisOrientType:this._orient,coordinateType:this._coordinateType,labelStyle:a,labelFormatter:o,labelGap:l}}addTransformToTickData(t,e){this._tickData.forEach((i=>{var s;null===(s=null==i?void 0:i.getDataView())||void 0===s||s.transform(t,e)}))}dataToPosition(t){return this._scale.scale(t)}}gD.specKey="axes";const mD=()=>{hD(),Ql.registerAnimation("axis",(()=>({appear:{custom:cD},update:{custom:dD},exit:{custom:uD}})))};var _D=function(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{this.computeData(null==t?void 0:t.value),wE(this._regions,(t=>{const e=this.getOrient();Ad(e)?tD(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):wd(e)?tD(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper()):Td(e)&&tD(t.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setZAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{let{x:e,y:i}=t;return il(e)&&(e+=Number("left"===this._orient)*this.getLayoutRect().width),il(i)&&(i+=Number("top"===this._orient)*this.getLayoutRect().height),{x:e,y:i}},this._transformLayoutRect=t=>{if(!this._visible)return t;const e=this._latestBounds.clone().translate(-this.getLayoutStartPoint().x,-this.getLayoutStartPoint().y);switch(this._layout.layoutOrient){case"left":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x1<0?-e.x1:0);break;case"right":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x2>0?e.x2:0);break;case"top":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y1<0?-e.y1:0);break;case"bottom":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y2>0?e.y2:0)}return t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),this._layout.setRectInSpec(this._layoutCacheProcessing(t))},this._updateAxisLayout=()=>{const t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,s=_D(e,["grid"]),n=this._axisMark.getProduct(),r=Pl({x:t.x,y:t.y},this._axisStyle,s);n.encode(r),this._gridMark&&this._gridMark.getProduct().encode(Pl({x:t.x,y:t.y},this._getGridAttributes(),i))},this._fixAxisOnZero=()=>{const{onZero:t,visible:e}=this._spec.domainLine;if(this.visible&&t&&!1!==e){const{onZeroAxisId:t,onZeroAxisIndex:e}=this._spec.domainLine,i=this._option.getComponentsByKey("axes"),s=Ad(this.getOrient()),n=t=>{var e;return(s?!Ad(t.getOrient()):Ad(t.getOrient()))&&nd(t.getScale().type)&&(t.getTickData()?null===(e=t.getTickData().getLatestData())||void 0===e?void 0:e.find((t=>0===t.value)):t.getScale().domain()[0]<=0&&Va(t.getScale().domain())>=0)},r=i.filter((t=>n(t)));if(r.length){let a;if(M(t))a=r.find((e=>e.id===t));else if(M(e)){const t=i[e];n(t)&&(a=t)}else a=r[0];if(a){const t=this._axisMark.getProduct(),e=a.valueToPosition(0);s?t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dy:"bottom"===this._orient?-((a.getInverse()?a.getScale().range()[1]:a.getScale().range()[0])-e):e})}):t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dx:"left"===this._orient?e:-((a.getInverse()?a.getScale().range()[0]:a.getScale().range()[1])-e)})})}}}},this._orient=Ld(t,["z"]),Td(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet,this._coordinateType="cartesian"}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;const i="horizontal"===t.direction;if(!y(e)){if(!KE(e))return null;const{axisType:t,componentName:s}=Ed(e,i);return e.type=t,[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:s}]}let s=!0;if(e.filter((t=>"z"===t.orient))[0]){const t=e.filter((t=>"bottom"===t.orient))[0],i=e.filter((t=>wd(t.orient)))[0];s=3===e.length&&t&&i}let n=e.map(((t,e)=>({spec:t,index:e})));s||(n=n.filter((({spec:t})=>"z"!==t.orient)));const r=[];return n.forEach((({spec:t,index:e})=>{if(!KE(t))return;const{axisType:s,componentName:n}=Ed(t,i);t.type=s,r.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:n})})),r}static createComponent(t,e){const{spec:i}=t,s=_D(t,["spec"]),n=Ql.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}initLayout(){super.initLayout(),this._layout.autoIndent=!1!==this._spec.autoIndent,this._layout.layoutOrient=this._orient}setLayout3dBox(t){this.layout3dBox=t}getNewScaleRange(){const{width:t,height:e}=this.getLayoutRect(),{left:i,right:s,top:n,bottom:r}=this._innerOffset;let a=[];return Ad(this.getOrient())?il(t)&&(a=this._inverse?[t-s,i]:[i,t-s]):Td(this.getOrient())?il(t)&&(a=this._inverse?[t-s,i]:[i,t-s],this._scale.range(a)):il(e)&&(a=this._inverse?[n,e-r]:[e-r,n]),a}updateScaleRange(){let t=!1;const e=this.getNewScaleRange(),i=this._scale.range();return e.length===i.length&&e.every(((t,e)=>t===i[e]))?t=!1:(t=!0,this._scale.range(e)),t}init(t){var e;super.init(t),null===(e=this.pluginService)||void 0===e||e.load(fD.map((t=>new t))),this.callPlugin((t=>{this.pluginService&&t.onInit&&t.onInit(this.pluginService,this)}))}setAttrFromSpec(){var t;if(super.setAttrFromSpec(),this.visible){Ad(this.getOrient())?ug(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):ug(this._spec.maxWidth)&&(this._spec.maxWidth="30%");const t=this._getAxisAttributes();t.label.formatMethod=this._getLabelFormatMethod(),t.verticalFactor="top"===this.getOrient()||"right"===this.getOrient()?-1:1,this._axisStyle=t}this._tick=this._spec.tick;const e=null===(t=this._option.getChart())||void 0===t?void 0:t.getSpec();this._inverse=function(t,e){let i=t.inverse;return e&&!Ad(t.orient)&&(i=!M(t.inverse)||!t.inverse),i}(this._spec,"horizontal"===(null==e?void 0:e.direction))}onLayoutStart(t,e,i){if(super.onLayoutStart(t,e,i),!Td(this.getOrient())&&this._spec.innerOffset){const t=this._spec;wd(this.getOrient())?["top","bottom"].forEach((i=>{this._innerOffset[i]=ol(t.innerOffset[i],e.height,e)})):["left","right"].forEach((i=>{this._innerOffset[i]=ol(t.innerOffset[i],e.width,e)}))}}getSeriesStatisticsField(t){let e;return e=Ad(this.getOrient())?t.fieldX:Td(this.getOrient())?t.fieldZ:t.fieldY,nd(this._scale.type)?e:[e[0]]}_tickTransformOption(){var t,e,i,s;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimals:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,labelLastVisible:null===(e=this._spec.label)||void 0===e?void 0:e.lastVisible,labelFirstVisible:null===(i=this._spec.label)||void 0===i?void 0:i.firstVisible,labelFlush:null===(s=this._spec.label)||void 0===s?void 0:s.flush})}axisHelper(){return{isContinuous:nd(this._scale.type),dataToPosition:this.dataToPosition.bind(this),getScale:(t=0)=>this._scales[t],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!0===this._inverse,getSpec:()=>this._spec}}afterCompile(){var t;const e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct();e&&e.addEventListener(hc.AFTER_ELEMENT_ENCODE,(()=>{if(!1===this._isLayout&&(Ad(this.getOrient())?this.callPlugin((t=>{this.pluginService&&t.onDidLayoutHorizontal&&t.onDidLayoutHorizontal(this.pluginService,this)})):this.callPlugin((t=>{this.pluginService&&t.onDidLayoutVertical&&t.onDidLayoutVertical(this.pluginService,this)})),this._unitText)){const{x:t,y:e}=this.getLayoutStartPoint(),i=Ad(this._orient)?{x:Wa(this._scale.range())+t,y:e}:{x:t,y:Ga(this._scale.range())+e};this._unitText.setAttributes(i)}})),this.callPlugin((t=>{this.pluginService&&t.onDidCompile&&t.onDidCompile(this.pluginService,this)}))}onRender(t){}changeRegions(t){}update(t){}resize(t){}collectScale(){const t=[];return wE(this._regions,(e=>{t.push("left"===this.getOrient()||"right"===this.getOrient()?e.scaleY:e.scaleX)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:Ad(this.getOrient())?e.getSpec().x2Field?[...e.fieldX,e.fieldX2]:e.fieldX:Td(this.getOrient())?e.fieldZ:e.getSpec().y2Field?[...e.fieldY,e.fieldY2]:e.fieldY,n}updateSeriesScale(){const t=this.getOrient();wE(this._regions,(e=>{Ad(t)?tD(e.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):wd(t)?tD(e.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):Td(t)&&tD(e.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleZ(this._scale),e.setZAxisHelper(this.axisHelper()))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getBoundsInRect(t){var e;let i={x1:0,y1:0,x2:0,y2:0};if(!this._visible)return i;this._verticalLimitSize=Ad(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&y(null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData())||this.computeData("range");const s={skipLayout:!1},n=Ad(this.getOrient());this.pluginService&&(n?this.callPlugin((t=>{t.onWillLayoutHorizontal&&t.onWillLayoutHorizontal(this.pluginService,s,this)})):this.callPlugin((t=>{t.onWillLayoutVertical&&t.onWillLayoutVertical(this.pluginService,s,this)})));const r=this._axisMark.getProduct();let a=!1;if(!s.skipLayout){const t=this._getUpdateAttribute(!0),e=r.getGroupGraphicItem(),s=Pl(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,t,{line:{visible:!1}});let o=e.getBoundsWithoutRender(s);o.empty()&&(o=(new Kt).set(s.x,s.y,s.x,s.y)),a=!0,this._latestBounds=o,i=this._appendAxisUnit(o,n)}return a||(this._latestBounds=r.getBounds()),i}positionToData(t,e){const i=Ad(this.getOrient());e&&(t-=i?this.getLayoutStartPoint().x:this.getLayoutStartPoint().y),this._innerOffset&&(t=i?js(t,this._innerOffset.left,this.getLayoutRect().width-this._innerOffset.right):js(t,this._innerOffset.top,this.getLayoutRect().height-this._innerOffset.bottom));const s=this._scale.range();return(t-s[0])*(t-Va(s))>0?null:this._scale.invert(t)}_getTitleLimit(t){var e,i,s,n,r;if(this._spec.title.visible&&D(null===(e=this._spec.title.style)||void 0===e?void 0:e.maxLineWidth)){const e=null!==(r=null!==(s=null===(i=this._axisStyle.title)||void 0===i?void 0:i.angle)&&void 0!==s?s:null===(n=this._spec.title.style)||void 0===n?void 0:n.angle)&&void 0!==r?r:0;if(t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(e));return i<1e-6?1/0:t/i}const a=this.getLayoutRect().height,o=Math.abs(Math.sin(e));return o<1e-6?1/0:a/o}return null}_getUpdateAttribute(t){var e;let i=0,s=0;if(!t){const t=this.getRegions();let{x:e,y:n}=t[0].getLayoutStartPoint(),r=e+t[0].getLayoutRect().width,a=n+t[0].getLayoutRect().height;for(let i=1;i{const i=this._getNormalizedValue([e.value],t);return QE(e.value,i)})).filter((t=>{const{value:e,rawValue:i}=t,s=this._scale.domain();return"log"===this.getSpec().type?e>=0&&e<=1:nd(this._scale.type)?i>=s[0]&&i<=Va(s):s.includes(i)}))]:[]}initEvent(){super.initEvent(),this.visible&&(this.event.on(zd.layoutEnd,this._updateAxisLayout),this.event.on(zd.layoutEnd,this._fixAxisOnZero),this.event.on(zd.layoutRectUpdate,(()=>{this._clearLayoutCache()})))}_getNormalizedValue(t,e){return 0===e?0:this.dataToPosition(t)/e}_layoutCacheProcessing(t){return["width","height"].forEach((e=>{t[e]{this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]})):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach((t=>{this.layout.getLastComputeOutBounds()[t]t.x2?h.x2-t.x2:0,t.y2+=h.y2>t.y2?h.y2-t.y2:0):(t.x1+=h.x1{const i=t.getOrient();return("left"===i||"right"===i)&&t.getRegions().some((t=>e.includes(t)))}));let s=0,n=0;const r=this.getLayoutStartPoint().x,a=r+this.getLayoutRect().width;return i.forEach((t=>{const e=t.getLayoutStartPoint().x;if("left"===t.getOrient()&&e===r){const e=t.getLayoutRect().width;s=Math.max(s,e)}else if(e===a){const e=t.getLayoutRect().width;n=Math.max(n,e)}})),{left:s,right:n}}}}vD.type=r.cartesianAxis,vD.specKey="axes";class yD{constructor(){this._rawDomainIndex=[]}_initData(){var t;if(this._spec.showAllGroupLayers&&this._scales.length>1)for(let e=0;e{i>0&&(e.range([0,t.bandwidth()]),t=e)}))}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const s=Math.min(t.length,this._scales.length);for(let i=0;ithis._rawDomainIndex[t][e]-this._rawDomainIndex[t][i])))}this.transformScaleDomain(),this.event.emit(zd.scaleDomainUpdate,{model:this}),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}getLabelItems(t){const e=[];let i=[];return this._scales.forEach(((s,n)=>{var r;const a=this._tickDataMap[n],o=null===(r=null==a?void 0:a.getLatestData())||void 0===r?void 0:r.length,l=o?a.getLatestData().map((t=>t.value)):s.domain();if(l&&l.length)if(i&&i.length){const s=[],n=[];i.forEach((e=>{l.forEach((i=>{const r=Na(e).concat(i);if(n.push(r),o){const e=QE(i,this._getNormalizedValue(r,t));s.push(e)}}))})),o&&e.push(s.filter((t=>t.value>=0&&t.value<=1))),i=n}else l.forEach((t=>{i.push(t)})),o&&e.push(a.getLatestData().map((e=>QE(e.value,this._getNormalizedValue([e.value],t)))).filter((t=>t.value>=0&&t.value<=1)))})),e.reverse()}_updateRawDomain(){this._rawDomainIndex=[];const t=this._spec.domain;for(let e=0;ethis._rawDomainIndex[e][t]=i))}}_clearRawDomain(){this._rawDomainIndex=[]}}function bD(t){if(il(t))return[t,t,t,t];if(y(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(As(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}function xD(){p_(),dM(),yk(),Uv()}function SD(){p_(),dM(),Gx(),Uv()}xD();class MD extends Bk{getStartAngle(){return Et(this._startAngle)}getEndAngle(){return Et(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},MD.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(il(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(Xa(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 n,r;const a=ca.line(Object.assign(Object.assign({points:t},y(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),jm(null==s?void 0:s.line)||(a.states=y(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=ca.line;Na(i)[0].cornerRadius&&(t=ca.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Na(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),jm(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,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:p,symbolType:g,size:m=12}=t;let _,f;"start"===i?(_={x:l.x+(il(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:l.y+(il(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},f=this._computeStartRotate(this._startAngle)):(_={x:h.x+(il(a)?d*Math.cos(a)+c*Math.cos(a-Math.PI/2):0),y:h.y+(il(a)?d*Math.sin(a)+c*Math.sin(a-Math.PI/2):0)},f=this._computeEndRotate(this._endAngle)),n=ca.symbol(Object.assign(Object.assign(Object.assign({},_),{symbolType:g,size:m,angle:s?f+u:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),jm(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?jm(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):jm(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?il(i)?t[i]:Xa(t):t,this._mainSegmentPoints=s,s}_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}}function kD(t,e){return[t[0]*e,t[1]*e]}function AD(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}var wD,TD;MD.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}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background",t.axisBreak="axis-break",t.axisBreakSymbol="axis-break-symbol"}(wD||(wD={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(TD||(TD={}));const LD={[TD.selectedReverse]:{},[TD.selected]:{},[TD.hover]:{},[TD.hoverReverse]:{}},CD={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},ED={size:8,stroke:"#000",lineWidth:1,zIndex:1};function DD(){p_(),fy(),Uv(),ik(),cf()}var OD=function(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);nd&&(k=d,E.setAttribute("maxLineWidth",d-f[1]-f[2]))),x=0,S=0;let P=0;"left"===C||"start"===C?P=1:"right"===C||"end"===C?P=-1:"center"===C&&(P=0),P?P<0?(x-=k,b&&b.setAttribute("x",(b.attribute.x||0)-c),y.setAttribute("x",-f[1]-T)):P>0&&y.setAttribute("x",f[3]):(x-=k/2,b&&b.setAttribute("x",(b.attribute.x||0)-c/2),y.setAttribute("x",-T/2));const R="right"===_||"end"===_,B="left"===_||"start"===_;if((_?"center"===_:m)&&P){const t=k-f[1]-f[3],e=c+T,i=1===P?(t-e)/2+T+c/2:f[0]+T-(k/2+e/2-T)+c/2;if(E.setAttributes({x:i,textAlign:"center"}),b){const t=i-c/2-T+L/2;b.setAttributes({x:t})}}if(B&&1!==P){const t=k-f[1]-f[3],e=0===P?-t/2+T/2:-k+f[3]+f[1]+T,i=e+T;if(E.setAttributes({x:i,textAlign:"left"}),b){const t=e+L/2;b.setAttributes({x:t})}}if(R&&-1!==P){const t=k-f[1]-f[3],e=0===P?t/2+T/2:t;if(E.setAttributes({x:e,textAlign:"right"}),b){const t=e-c-T+L/2;b.setAttributes({x:t})}}"middle"===O?(S-=A/2,b&&b.setAttribute("y",0)):"bottom"===O?(S-=A,b&&b.setAttribute("y",-g/2),y.setAttribute("y",-f[2])):"top"===O&&(y.setAttribute("y",f[0]),b&&b.setAttribute("y",g/2))}const{visible:O}=a,P=OD(a,["visible"]);if(u&&v(O)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},P),{visible:O&&!!s,width:k,height:A,x,y:S}),"rect");if(jm(null==p?void 0:p.panel)||(t.states=p.panel),P.customShape){const e=P.customShape;t.pathProxy=t=>e(this,t,new Ze)}this._bgRect=t}this._textShape=E,this._symbol=b,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:E({},PD.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,s,n,r,a,o,l,h,d,c,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],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!==(d=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==d?d:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.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 RD(t){const e={};return Nk(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}function BD(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function ID(t,e,i,s=!1,n=!1){const r=[e.x-i.x,e.y-i.y];return kD(r,(s?-1:1)*(n?-1:1)*t/AD(r))}function FD(t,e,i,s,n){const r=[],a=n-s;for(let n=0;n{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function jD(t,e,i){let s=t.OBBBounds,n=e.OBBBounds;return s&&n&&!s.empty()&&!n.empty()?s.intersects(n):(s=t.AABBBounds,n=e.AABBBounds,i>Math.max(n.x1-s.x2,s.x1-n.x2,n.y1-s.y2,s.y1-n.y2))}function HD(t,e){for(let i,s=1,n=t.length,r=t[0];s{const s=t.target;return s!==i&&s.name&&!jm(s.states)?(s.addState(qk.hover,!0),Nk(e,(t=>{t!==s&&t.name&&!jm(t.states)&&t.addState(qk.hoverReverse,!0)})),s):i},ND=(t,e,i)=>i?(Nk(e,(t=>{t.name&&!jm(t.states)&&(t.removeState(qk.hoverReverse),t.removeState(qk.hover))})),null):i,VD=(t,e,i)=>{const s=t.target;return i===s&&s.hasState(qk.selected)?(Nk(e,(t=>{t.name&&!jm(t.states)&&(t.removeState(qk.selectedReverse),t.removeState(qk.selected))})),null):s.name&&!jm(s.states)?(s.addState(qk.selected,!0),Nk(e,(t=>{t!==s&&t.name&&!jm(t.states)&&t.addState(qk.selectedReverse,!0)})),s):i};class WD extends Bk{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=zD(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=ND(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=VD(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=k(this.attribute);E(this.attribute,t);const i=ca.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&RD(this._innerView),this.removeAllChild(!0),this._innerView=ca.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:s,line:n,items:r}=this.attribute,a=ca.group({x:0,y:0,zIndex:1,pickable:!1});if(a.name=wD.axisContainer,a.id=this._getNodeId("container"),a.setMode(this.mode),this.axisContainer=a,t.add(a),n&&n.visible&&this.renderLine(a),r&&r.length&&(this.data=this._transformItems(r[0]),s&&s.visible&&this.renderTicks(a),i&&i.visible)){const t=ca.group({x:0,y:0,pickable:!1});t.name=wD.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,a.add(t),r.forEach(((e,i)=>{const s=this.renderLabels(t,e,i),n=s.getChildren();this.beforeLabelsOverlap(n,e,s,i,r.length),this.handleLabelsOverlap(n,e,s,i,r.length),this.afterLabelsOverlap(n,e,s,i,r.length);let a=0,o=0,l="center",h="middle",d=0;n.forEach(((t,e)=>{var i;const s=t.attribute,n=null!==(i=s.angle)&&void 0!==i?i:0,r=t.AABBBounds;let c=r.width(),u=r.height();n&&(c=Math.abs(c*Math.cos(n)),u=Math.abs(u*Math.sin(n))),a=Math.max(a,c),o=Math.max(o,u),l=s.textAlign,h=s.textBaseline,0===e&&(d=s.x)})),this.axisLabelLayerSize[i]={width:a,height:o,labelPos:d,textAlign:l,textBaseline:h}}))}e&&e.visible&&this.renderTitle(a)}renderTicks(t){const e=this.getTickLineItems(),i=ca.group({x:0,y:0,pickable:!1});i.name=wD.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,s)=>{var n;const r=ca.line(Object.assign({},this._getTickLineAttribute("tick",t,s,e)));if(r.name=wD.tick,r.id=this._getNodeId(t.id),jm(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=Zk;else{const t=this.data[s],e=E({},Zk,this.attribute.tick.state);Object.keys(e).forEach((i=>{ws(e[i])&&(e[i]=e[i](t.rawValue,s,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:s}=this.attribute;if(s&&s.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=ca.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=wD.subTick,r.id=this._getNodeId(`${n}`),jm(s.state))r.states=Zk;else{const i=E({},Zk,s.state);Object.keys(i).forEach((s=>{ws(i[s])&&(i[s]=i[s](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:s}=this.attribute.label;s&&ws(s)&&(e=s(e,i));const n=this._transformItems(e),r=ca.group({x:0,y:0,pickable:!1});return r.name=`${wD.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var s;const a=sA(this._getLabelAttribute(t,e,n,i));if(a.name=wD.label,a.id=this._getNodeId(`layer${i}-label-${t.id}`),jm(null===(s=this.attribute.label)||void 0===s?void 0:s.state))a.states=Zk;else{const s=E({},Zk,this.attribute.label.state);Object.keys(s).forEach((r=>{ws(s[r])&&(s[r]=s[r](t,e,n,i))})),a.states=s}r.add(a)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new PD(Object.assign({},e));i.name=wD.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return BD(t,this.getVerticalVector(e,i,t))}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:s,inside:n=!1,length:r,dataFilter:a}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(a&&ws(a)?a(e):e).forEach((t=>{let e=t.point,a=t.value;if(!s){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),a=i}const l=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const s=this.getVerticalVector(r,n,e);let o=0,h=0;ht(s[0])>ht(s[1])?o=rt/2*(l.x>e.x?1:-1):h=rt/2*(l.y>e.y?-1:1),i.push({start:e,end:l,value:a,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else i.push({start:e,end:l,value:a,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:n=2}=t,r=this.tickLineItems,a=r.length;if(a>=2)for(let t=0;t0&&(0===p[1]?c+=(this.axisLabelLayerSize[s-1].height+$d(this.attribute,"label.space",4))*s:c+=(this.axisLabelLayerSize[s-1].width+$d(this.attribute,"label.space",4))*s);const g=this.getVerticalCoord(t.point,c,o),m=this.getVerticalVector(c||1,o,g),_=l?l(`${t.label}`,t,e,i,s):t.label;let{style:f}=this.attribute.label;return f=ws(f)?E({},CD.label.style,f(t,e,i,s)):f,f=E(this.getLabelAlign(m,o,f.angle),f),ws(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:s})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,m,_,f)),{text:null!=d?d:_,_originText:t.label,lineHeight:null==f?void 0:f.fontSize,type:h}),f)}getLabelPosition(t,e,i,s){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}const GD={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&jD(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function UD(t){let e;return e=t.OBBBounds.empty()?t.AABBBounds:t.OBBBounds,e.width()>1&&e.height()>1}function $D(t,e,i,s,n=!1){if(i&&!t.attribute.opacity){const i=e.length;if(i>1){t.setAttribute("opacity",1);for(let t=0;tt.setAttribute("opacity",1))),t}(i);const{method:n="parity",separation:r=0}=e,a=ws(n)?n:GD[n]||GD.parity;if(s.length>=3&&HD(s,r)){do{s=a(s,r)}while(s.length>=3&&HD(s,r));const t=(t,e,i=!0)=>i&&t<3||e,n=t(s.length,e.firstVisible,!1);let o=t(s.length,e.lastVisible);const l=i[0],h=Va(i);jD(l,h,r)&&n&&o&&(h.setAttribute("opacity",0),o=!1),$D(l,s,n,(t=>jD(t,l,r))),$D(h,s,o,(t=>jD(t,h,r)||!(!n||t===l)&&jD(t,l,r)),!0)}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}const KD=Math.sin(Math.PI/10);function qD(t){const e=!D(t)&&0!==t,i=e?Math.cos(t):1;return e&&Math.abs(i)<=KD}function ZD(t){const e=!D(t)&&0!==t,i=e?Math.sin(t):0;return!e||Math.abs(i)<=KD}function JD(t){for(let r=1;r{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},eO(t,e.attribute.angle)),{angle:tO(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},iO(t,e.attribute.angle)),{angle:tO(e.attribute.angle)}))}))}(t,e),function(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=Wt({x:t.attribute.x,y:t.attribute.y},e.angle,{x:e.centerX,y:e.centerY}),s=i.x-e.centerX,n=i.y-e.centerY;e.x1+=s,e.x2+=s,e.y1+=n,e.y2+=n,e.centerX+=s,e.centerY+=n,t.rotatedBounds=e}))}(e)}function tO(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function eO(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=tO(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}function iO(t,e=0){let i=["right","right","center","left","left","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","left","center","right","right","right","center","left","left"],s=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const n=(e=tO(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}function sO(t,e,i){let s;return il(e)&&(s=Math.abs(e-t)),il(i)&&(s=il(s)?Math.min(Math.abs(t-i),s):Math.abs(t-i)),s}class nO{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:s=1}=this.attribute,n=function(t){let e=AD(t);return e>0&&(e=1/e),[t[0]*e,t[1]*e]}(this.getRelativeVector());return kD([n[1],-1*n[0]],t*(e?1:-1)*s)}}const rO=["radius","startAngle","endAngle",...kn];class aO extends En{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=Nn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return bs(this).circle}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=Si.graphicService.updateTempAABBBounds(i);return $v(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),Si.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:s=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-s>lt-nt?i.set(-r,-r,r,r):mn(s,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,rO)}needUpdateTag(t){return super.needUpdateTag(t,rO)}toCustomPath(){var t,e,i;const s=this.attribute,n=null!==(t=s.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=s.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=s.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new Ze;return o.arc(0,0,n,r,a),o}clone(){return new aO(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return aO.NOWORK_ANIMATE_ATTR}}function oO(t){return new aO(t)}aO.NOWORK_ANIMATE_ATTR=Cn;const lO=new class{constructor(){this.time=me.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{radius:_=l.radius,startAngle:f=l.startAngle,endAngle:v=l.endAngle,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:M=l.scaleY}=t.attribute,k=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Fa(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,s,_+d*h,f,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=y,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/M,l[r]),l[r].opacity=a,e.stroke()}};g&&k(u,"outerBorder"),m&&k(p,"innerBorder")}},hO=Bo,dO=bo;var cO=function(t,e){return function(i,s){e(i,s,t)}};let uO=class extends wo{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Nn,this.builtinContributions=[lO,dO,hO],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=bs(t,null==r?void 0:r.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:c=l.endAngle,x:u=l.x,y:p=l.y,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:y}=m;e.beginPath(),e.arc(i,s,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,v,y,_,f,l,n,a,o);const b=()=>{v&&(a?a(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,u-i,p-s,l),e.fill()))},x=()=>{y&&(o?o(e,t.attribute,l):f&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,l),e.stroke()))};g?(x(),b()):(b(),x()),this.afterRenderStep(t,e,i,s,v,y,_,f,l,n,a,o)}draw(t,e,i,s){const n=bs(t,null==s?void 0:s.theme).circle;this._draw(t,n,!1,i,s)}};uO=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}([V(),cO(0,$(K)),cO(0,X(lo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],uO);let pO=!1;const gO=new I((t=>{pO||(pO=!0,t(uO).toSelf().inSingletonScope(),t(Sr).to(uO).inSingletonScope(),t(Mr).toService(Sr),t(lo).toService(xo),Z(t,lo))}));let mO=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Nn}};mO=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Sr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mO);let _O=!1;const fO=new I(((t,e,i,s)=>{_O||(_O=!0,t(N_).to(mO).inSingletonScope(),t(ef).toService(N_))}));let vO=class extends zv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Nn}};vO=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}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Sr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vO);let yO=!1;const bO=new I(((t,e,i,s)=>{yO||(yO=!0,t(E_).to(vO).inSingletonScope(),t(T_).toService(E_))}));function xO(){xO.__loaded||(xO.__loaded=!0,ca.RegisterGraphicCreator("circle",oO),Xi.load(gO),Xi.load(w_?fO:bO))}xO.__loaded=!1;const SO=xO;function MO(){p_(),dM(),ik(),cf()}var kO=function(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{const{startPoint:s,endPoint:n,breakSymbol:r,rawRange:a}=e;if(!1!==(null==r?void 0:r.visible)){const e=ca.group({zIndex:999});e.name=wD.axisBreak,e.id=this._getNodeId(`${wD.axisBreak}-${i}`),e.data=a;const o=function(t={}){var e,i;const{style:s={},angle:n=.5*Math.PI}=t,r=E({},ED,s),a=null!==(e=r.size)&&void 0!==e?e:ED.size;return Object.assign(Object.assign({},r),{symbolType:null!==(i=r.symbolType)&&void 0!==i?i:`M ${-a/2} ${a*Math.sin(n)} L ${a/2} ${-a*Math.sin(n)}`,symbolSize:a})}(r),l=ca.symbol(Object.assign({x:s.x,y:s.y},o));l.name=wD.axisBreakSymbol;const h=ca.symbol(Object.assign({x:n.x,y:n.y},o));h.name=wD.axisBreakSymbol,e.add(l),e.add(h),t.add(e)}}));const{panel:i}=this.attribute;if(i&&i.visible){const t=this.axisContainer,s=t.AABBBounds,n=ca.rect(Object.assign({x:s.x1,y:s.y1,width:s.width(),height:s.height()},i.style));n.name=wD.background,n.id=this._getNodeId("background"),n.states=E({},LD,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){const{start:e,end:i,line:s}=this.attribute,n=s,{startSymbol:r,endSymbol:a,style:o,state:l}=n,h=kO(n,["startSymbol","endSymbol","style","state"]),d=Object.assign({startSymbol:r,endSymbol:a,lineStyle:o},h);if(this._breaks&&this._breaks.length){const t=[];let s=e;this._breaks.forEach((e=>{const{startPoint:i,endPoint:n}=e;t.push([s,i]),s=n})),t.push([s,i]),d.points=t,d.multiSegment=!0}else d.points=[e,i];jm(l)||(d.state={line:E({},LD,l),symbol:E({},LD,l)});const c=new MD(d);c.name=wD.line,c.id=this._getNodeId("line"),t.add(c)}getTextAlign(t){let e="center";return es(t[0],0)?es(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTitleAttribute(){var t,e,i;const s=this.attribute.title,{position:n="middle",space:r=4,textStyle:a={},autoRotate:o=!0,shape:l,background:h,state:d={},maxWidth:c}=s,u=kO(s,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let p=.5;"start"===n?p=0:"end"===n&&(p=1);const{verticalFactor:g=1}=this.attribute,m=-1*g,_=this.getTickCoord(p),f=this.getRelativeVector();let v=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+$d(this.attribute,"label.space",4);v+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===f[1]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?v+=i+(e-1)*t:v=0}else if(0===f[0])if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){const i=this.axisLabelLayerSize[0].labelPos,s=this.axisLabelsContainer.AABBBounds;v+=(1===m?s.x2>i?Math.min(s.x2-i,s.width()):0:s.x1{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)}))}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));const b=y+v+r,x=this.getVerticalCoord(_,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0});let M,k,{angle:A}=u;if(M="start"===n?"start":"end"===n?"end":"center",D(A)&&o){A=function(t,e,i){const s=function(t,e){const[i,s]=t,[n,r]=e,a=Math.sqrt((i*i+s*s)*(n*n+r*r)),o=a&&(i*n+s*r)/a;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),n=yt(t,e)>=0;return i?n?2*Math.PI-s:s:n?s:2*Math.PI-s}(f,[1,0],!0);const{verticalFactor:t=1}=this.attribute;k=1==-1*t?"bottom":"top"}else M=this.getTextAlign(S),k=this.getTextBaseline(S,!1);let w=c;if(D(w)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,s=Math.min(t||1/0,e||1/0);if(il(s))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));w=t<1e-6?1/0:this.attribute.end.x/t}else w=s-b;else if(A&&0!==A){const t=Math.abs(Math.sin(A));w=t<1e-6?1/0:this.attribute.end.y/t}else w=s-b}const T=Object.assign(Object.assign(Object.assign({},x),u),{maxWidth:w,textStyle:Object.assign({textAlign:M,textBaseline:k},a),state:{text:E({},LD,d.text),shape:E({},LD,d.shape),panel:E({},LD,d.background)}});return T.angle=A,l&&l.visible&&(T.shape=Object.assign({visible:!0},l.style),l.space&&(T.space=l.space)),h&&h.visible&&(T.panel=Object.assign({visible:!0},h.style)),T}getTextBaseline(t,e){let i="middle";const{verticalFactor:s=1}=this.attribute,n=(e?1:-1)*s;return es(t[1],0)?i=!es(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const s=this.attribute.orient;if(["top","bottom","right","left"].includes(s)||0===t[0]&&0===t[1]){if("top"===s||"bottom"===s)return eO(e?"bottom"===s?"top":"bottom":s,i);if("left"===s||"right"===s)return iO(e?"left"===s?"right":"left":s,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,s,n){var r,a,o,l;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:s}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=Va(t),c=n?h.attribute.x>d.attribute.x:h.attribute.yo&&(e.attribute.angle?e.setAttributes({dx:(null!==(a=e.attribute.dx)&&void 0!==a?a:0)+o-u}):e.setAttributes({x:o,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,a=i.y,u=s.y;ru&&(t.attribute.angle?t.setAttributes({dy:(null!==(l=t.attribute.dy)&&void 0!==l?l:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,s,n){if(jm(t))return;const{verticalLimitSize:r,label:a,orient:o}=this.attribute,l=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:p,autoHide:g,autoHideMethod:m,autoHideSeparation:_,lastVisible:f,firstVisible:v,autoWrap:y,overflowLimitLength:b}=a;if(ws(h))h(t,e,s,this);else{if(d?function(t,e){if(jm(t))return;const{orient:i,labelRotateAngle:s=[0,45,90]}=e;if(0===s.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(s&&s.length>0&&(r=s.length);n{t.attribute.angle=At(e)})),QD(i,t),!JD(t))break}}(t,{labelRotateAngle:c,orient:o}):y&&function(t,e){const{limitLength:i,axisLength:s,ellipsis:n="...",orient:r}=e;if(jm(t)||!il(i))return;const a=t[0].attribute.angle,o=ZD(a),l=qD(a),h="top"===r||"bottom"===r;let d=s/t.length;t.forEach(((e,s)=>{var r,a,c,u,p;if(h){if(l&&Math.floor(e.AABBBounds.height())<=i)return;if(o){const i=sO(e.attribute.x,null===(r=t[s+1])||void 0===r?void 0:r.attribute.x,null===(a=t[s-1])||void 0===a?void 0:a.attribute.x);il(i)&&(d=pt(d,i))}}else{if(l){const i=sO(e.attribute.y,null===(c=t[s+1])||void 0===c?void 0:c.attribute.y,null===(u=t[s-1])||void 0===u?void 0:u.attribute.y);il(i)&&(d=pt(d,i))}if(o&&Math.floor(e.AABBBounds.width())<=i)return}let g=null,m=null;h?l?(g=i,m=d):(g=d,m=i):l?(g=d,m=i):(g=i,m=d),e.setAttributes({maxLineWidth:g,ellipsis:null!==(p=e.attribute.ellipsis)&&void 0!==p?p:n,whiteSpace:"normal",heightLimit:m})}))}(t,{orient:o,limitLength:l,axisLength:"left"===o||"right"===o?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),ellipsis:p}),!y&&u&&il(l)&&l>0){const e="left"===o||"right"===o,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){const{limitLength:i,verticalLimitLength:s,ellipsis:n="...",orient:r,axisLength:a}=e;if(jm(t)||!il(i))return;const o=function(t){return il(t)?{left:t,right:t}:As(t)?{left:t.left||0,right:t.right||0}:{left:0,right:0}}(e.overflowLimitLength),l=t[0],h=l.attribute.angle,d=!D(h),c=d?Math.cos(h):1,u=d?Math.sin(h):0,p=ZD(h),g=qD(h),m="top"===r||"bottom"===r,_=l.attribute.direction,f=!p&&!g&&m&&(t.length<2||t.some((t=>Math.abs(t.AABBBounds.width()-l.AABBBounds.width())>=2)))&&l.AABBBounds.width()>Math.abs(i/u);t.forEach((t=>{var e;if(m){if(g&&Math.floor(t.AABBBounds.height())<=i)return;if(p&&Math.floor(t.AABBBounds.width())<=s)return}if(!m){if("vertical"===_&&Math.floor(t.AABBBounds.height())<=s)return;if("vertical"!==_){if(p&&Math.floor(t.AABBBounds.width())<=i)return;if(g&&Math.floor(t.AABBBounds.height())<=s)return}}let r=null;if(p||g)r=m?p?s:i:"vertical"===_||g?s:i;else if(m){const{x1:e,x2:s}=t.AABBBounds,n=u/c,l=Math.abs(i/u);if(f&&n>0&&e<=a+o.right&&i/n+e>a+o.right){const t=(a-e+o.right)/Math.abs(c);r=Math.min(t,l)}else if(f&&n<0&&s>=-o.left&&i/n+s<-o.left){const t=(s+o.left)/Math.abs(c);r=Math.min(t,l)}else r=l}else r=Math.abs(i/c);il(t.attribute.maxLineWidth)&&(r=il(r)?Math.min(t.attribute.maxLineWidth,r):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:r,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}(t,{limitLength:l,verticalLimitLength:e?i/t.length:g||d?1/0:i/t.length,ellipsis:p,orient:o,axisLength:i,overflowLimitLength:b})}g&&XD(t,{orient:o,method:m,separation:_,lastVisible:f,firstVisible:v})}}afterLabelsOverlap(t,e,i,s,n){const{verticalLimitSize:r,orient:a}=this.attribute,o="bottom"===a||"top"===a,l=i.AABBBounds;let h=o?l.height():l.width();const{verticalMinSize:d}=this.attribute;if(il(d)&&(!il(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,s;h=Math.max(h,t),"left"===a?(e=l.x2-h,s=l.y1):"right"===a?(e=l.x1,s=l.y1):"top"===a?(e=l.x1,s=l.y2-h):"bottom"===a&&(e=l.x1,s=l.y1);const r=ca.rect({x:e,y:s,width:o?l.width():h,height:o?h:l.height(),pickable:!1});r.name=wD.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(M(this.attribute.label.containerAlign)){let e;"left"===a?e=l.x2-h:"right"===a?e=l.x1:"top"===a?e=l.y2-h:"bottom"===a&&(e=l.y1),function(t,e,i,s,n){"left"===s||"right"===s?"left"===n?t.forEach((t=>{var i;t.setAttributes({dx:(null!==(i=t.attribute.dx)&&void 0!==i?i:0)+e-t.AABBBounds.x1})})):"right"===n?t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i-t.AABBBounds.x2})})):"center"===n&&t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})})):"bottom"!==s&&"top"!==s||("top"===n?t.forEach((t=>{var i;t.setAttributes({dy:(null!==(i=t.attribute.dy)&&void 0!==i?i:0)+e-t.AABBBounds.y1})})):"bottom"===n?t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i-t.AABBBounds.y2})})):"middle"===n&&t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})})))}(t,e,h,a,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,s,n,r,a;const{label:o,title:l,line:h,tick:d}=this.attribute,c=null!==(i=o.space)&&void 0!==i?i:4;let u=t,p=0,g=0;const m=h&&h.visible?null!==(s=h.style.lineWidth)&&void 0!==s?s:1:0,_=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(l&&l.visible&&"string"==typeof l.text){p=tA(l.text,l.textStyle,null===(a=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===a?void 0:a.text).height;const t=bD(l.padding);g=l.space+t[0]+t[2]}return u&&(u=(u-c-g-p-m-_)/e),u}release(){super.release(),this._breaks=null}}AO.defaultAttributes=CD,tw(AO,nO);class wO{isInValidValue(t){const{startAngle:e=$k,endAngle:i=Xk}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=$k,endAngle:i=Xk,center:s,radius:n,inside:r=!1,innerRadius:a=0}=this.attribute;return Tt(s,r&&a>0?a:n,e+(i-e)*t)}getVerticalVector(t,e=!1,i){return ID(t,i,this.attribute.center,e,this.attribute.inside)}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}function TO(t,e){const i=t.length;return{prevLabel:e>=1?t[e-1]:t[i-1],nextLabel:e=3){const{prevLabel:i,nextLabel:n}=TO(t,e);s.push(i,n)}else 2===t.length&&s.push(t[0===e?1:0]);const n=t[e];let r=Math.min(Math.abs(n.attribute.y-i.y1),Math.abs(n.attribute.y-i.y2));s.forEach((t=>{r=Math.min(r,Math.abs(t.attribute.y-n.attribute.y))})),r>0&&n.setAttributes({whiteSpace:"normal",heightLimit:r})}MO(),SO();class EO extends WD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},EO.defaultAttributes,t))}renderLine(t){const{startAngle:e=$k,endAngle:i=Xk,radius:s,center:n,innerRadius:r=0,line:a={},inside:o=!1,sides:l}=this.attribute;let h,d=s,c=r;if(o&&r>0&&(d=r,c=0),il(l)&&l>=3){const t=FD(n,l,d,e,i);h=ca.path(Object.assign(Object.assign({},a.style),{path:YD(t,!0)}))}else{const t=Object.assign(Object.assign(Object.assign({},n),{startAngle:e,endAngle:i,radius:d,innerRadius:c}),a.style);h=ca.circle(t)}h.name=wD.line,h.id=this._getNodeId("line"),jm(a.state)||(h.states=E({},LD,a.state)),t.add(h)}getTitleAttribute(){var t,e,i;const{center:s,radius:n,innerRadius:r=0}=this.attribute,a=this.attribute.title,{space:o=4,textStyle:l={},shape:h,background:d,state:c={}}=a,u=function(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=2){const i=this.data[1].value-this.data[0].value,h=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t{const{x:o,y:l}=e.attribute,h=e.AABBBounds;if(es(o,a.x)){if(l>n.y2||l=3){const{prevLabel:n,nextLabel:a}=TO(t,s);let l=n.attribute.x,h=a.attribute.x;l>h&&(l=a.attribute.x,h=n.attribute.x);const d=l===h?r:o>=l&&o<=h?h-l:Math.min(Math.abs(l-o),Math.abs(h-o));e.AABBBounds.width()>d&&LO(e,d,i)}else e.AABBBounds.width()>r&&LO(e,r,i)}else o>a.x&&h.x2>n.x2?(LO(e,n.x2-o,i),r&&CO(t,s,n)):o0?"top":"middle"}getLabelAlign(t,e,i){return es(t[0],0)?{textAlign:"center",textBaseline:t[1]>0?"top":"bottom"}:t[0]<0?{textAlign:"right",textBaseline:this.getTextBaseline(t)}:t[0]>0?{textAlign:"left",textBaseline:this.getTextBaseline(t)}:{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,s){return t}}EO.defaultAttributes=CD,tw(EO,wO);class DO extends i_{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(t),this.spec.scale=void 0}const e=S(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}const OO=(t,e,i,s,n,r)=>{var a;const o=t.getCoordinateAxisPosition();n&&"auto"===n.position&&(n.position=i?"content":o);const l=t.getCoordinateAxisPoints(s);if(l){const s={start:l[0],end:l[1],verticalFactor:("top"===o||"left"===o?-1:1)*(i?-1:1)*((null===(a=t.getSpec().range)||void 0===a?void 0:a.reversed)?-1:1)};if(r&&"polar"===e.type){const t=e.angle();s.center=e.origin(),s.startAngle=t[0],s.endAngle=t[1]}return s}const h=e.radius(),d=e.angle();return{center:e.origin(),radius:h[1],innerRadius:h[0],inside:i,startAngle:d[0],endAngle:d[1]}};class PO extends DO{constructor(t,e,i){super(t,tc.axis,e),this.spec.componentType=tc.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=fc.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce(((i,s)=>{const n=e[s];return n&&(i[s]={callback:(e,i,s)=>{var r,a;const o=this.spec.skipTheme?null:this.view.getCurrentTheme();let l=Pm(n,e,i,s);const h=Up(this.spec.inside,s,e,i),d=Up(this.spec.baseValue,s,e,i),c=null===(r=null==t?void 0:t.getCoordinate)||void 0===r?void 0:r.call(t);c&&(l=Object.assign(OO(t,c,h,d,this.spec.layout),l));const u=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t),p=Up(this.spec.tickCount,s,e,i);switch(this._getAxisComponentType()){case ic.lineAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.axis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p);case ic.circleAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleAxis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p)}return l}}),i}),{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if(D(e)){const i=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=(null===(t=null==i?void 0:i.getCoordinate)||void 0===t?void 0:t.call(i))?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType="circle"===e?ic.circleAxis:ic.lineAxis,this._axisComponentType}}PO.componentType=tc.axis;const RO=()=>{fc.registerGraphicComponent(ic.lineAxis,((t,e)=>new AO(t,e))),fc.registerComponent(tc.axis,PO)},BO=()=>{fc.registerGraphicComponent(ic.circleAxis,(t=>new EO(t))),fc.registerComponent(tc.axis,PO)};function IO(t,e,i,s){let n="";if(!t||0===e.length)return n;const r=e[0],a=xe.distancePP(t,r),o=i?0:1;return s?n+=`M${t.x},${t.y-a}A${a},${a},0,0,${o},${t.x},${t.y+a}A${a},${a},0,0,${o},${t.x},${t.y-a}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${a},${a},0,0,${o},${t.x},${t.y}`})),n}function FO(t,e,i){const{type:s,closed:n}=i,r=e.slice(0).reverse();let a="",o="";if("line"===s&&i.smoothLink&&i.center){const e=t[0],s=r[0],l=i.center;a=YD(t,!!n),o=YD(r,!!n);const h=xe.distancePP(s,l),d=xe.distancePP(e,l);a+=`A${h},${h},0,0,1,${s.x},${s.y}L${s.x},${s.y}`,o+=`A${d},${d},0,0,0,${e.x},${e.y}`}else if("circle"===s){const{center:e}=i;a=IO(e,t,!1,!!n),o=IO(e,r,!0,!!n)}else"line"!==s&&"polygon"!==s||(a=YD(t,!!n),o=YD(r,!!n));return n?a+=o:(o="L"+o.substring(1),a+=o,a+="Z"),a}class YO extends Bk{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&RD(this._innerView),this.removeAllChild(!0),this._innerView=ca.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){return BD(t,this.getVerticalVector(e,i,t))}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){const i=E({},this.attribute,this.getGridAttribute(t)),{type:s,items:n,style:r,closed:a,alternateColor:o,depth:l=0}=i,h=t?`${wD.grid}-sub`:`${wD.grid}`;if(n.forEach(((t,i)=>{const{id:n,points:o}=t;let d="";if("line"===s||"polygon"===s)d=YD(o,!!a);else if("circle"===s){const{center:t}=this.attribute;d=IO(t,o,!1,!!a)}const c=ca.path(Object.assign({path:d,z:l},ws(r)?E({},this.skipDefault?null:YO.defaultAttributes.style,r(t,i)):r));c.name=`${h}-line`,c.id=this._getNodeId(`${h}-path-${n}`),e.add(c)})),l&&"line"===s&&n.forEach(((t,i)=>{const{id:s,points:n}=t,o=[];o.push(n[0]);const d=n[1].x-n[0].x,c=n[1].y-n[0].y,u=Math.sqrt(d*d+c*c),p=l/u;o.push({x:n[0].x+d*p,y:n[0].y+c*p});const g=YD(o,!!a),m=ht(o[0].x-o[1].x),_=ht(o[0].y-o[1].y),f=ca.path(Object.assign({path:g,z:0,alpha:m>_?(n[1].x-n[0].x>0?-1:1)*rt/2:0,beta:m<_?-rt/2:0,anchor3d:m>_?[o[0].x,0]:[0,o[0].y]},ws(r)?E({},this.skipDefault?null:YO.defaultAttributes.style,r(t,i)):r));f.name=`${h}-line`,f.id=this._getNodeId(`${h}-path-${s}`),e.add(f)})),n.length>1&&o){const t=y(o)?o:[o,"transparent"],s=e=>t[e%t.length],r=this.attribute.items,a=r[0],l=r[r.length-1],d=!es(a.value,0)&&!es(l.value,0),c=!es(a.value,1)&&!es(l.value,1),u=[],p=a.value>l.value;(p&&c||!p&&d)&&u.push(this.getGridPointsByValue(p?1:0)),n.forEach((t=>{u.push(t.points)})),(p&&d||!p&&c)&&u.push(this.getGridPointsByValue(p?0:1));for(let t=0;t=2&&(t=this.data[1].value-this.data[0].value),t}_getPointsOfSubGrid(t,e){const i=this.data.length,s=[];return i>=2&&this.data.forEach((i=>{let n=i.value;if(!e){const e=i.value-t/2;if(this.isInValidValue(e))return;n=e}s.push({value:n})})),s}release(){super.release(),this._prevInnerView=null,this._innerView=null}}YO.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},p_(),TM();class jO extends YO{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},YO.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){const{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:s=6,startAngle:n=$k,endAngle:r=Xk}=this.attribute;i=FD(t,s,xe.distancePP(t,e),n,r)}return i}getGridPointsByValue(t){const e=this.getTickCoord(t);return this._getGridPoint(this.attribute.type,e)}getGridAttribute(t){const{type:e,alignWithLabel:i=!0}=this.attribute,s=this._parseTickSegment();let n,r=[];if(t){n=E({},this.attribute,this.attribute.subGrid);const t=[],{count:e=4}=n;if(this.data.length>=2){const n=this._getPointsOfSubGrid(s,i);for(let i=0;i{let{point:r}=n;if(!i){const t=n.value-s/2;if(this.isInValidValue(t))return;r=this.getTickCoord(t)}t.push({id:n.label,datum:n,points:this._getGridPoint(e,r)})})),r=t}return Object.assign(Object.assign({},n),{items:r})}}tw(jO,nO);p_(),TM();class HO extends YO{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},YO.defaultAttributes,t),e)}getGridPointsByValue(t){const e=this.getTickCoord(t),{radius:i,innerRadius:s=0}=this.attribute;return[e,this.getVerticalCoord(e,i-s,!0)]}getGridAttribute(t){let e,i=[];const s=this.attribute,{radius:n,innerRadius:r=0,startAngle:a=$k,endAngle:o=Xk,center:l,subGrid:h}=s,d=function(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=2){const e=this._getPointsOfSubGrid(p,c);for(let i=0;i{let{point:i}=e;if(!c){const t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),i=t}return Object.assign(Object.assign({},e),{items:i,center:l,type:"line"})}}tw(HO,wO);class zO extends DO{constructor(t,e,i){super(t,tc.grid,e),this.spec.componentType=tc.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){const t=S(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(t)}this.spec.target=t;const e=S(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=fc.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=this.spec.skipTheme?null:this.view.getCurrentTheme();let h,d=Pm(s,t,e,i);const c=Up(this.spec.baseValue,i,t,e);if(this._targetAxis){const t=null===(n=this._targetAxis.getSpec())||void 0===n?void 0:n.scale;h=S(t)?this.view.getScaleById(t):t;const e=this._targetAxis.elements[0];if(e)switch(this._getGridComponentType()){case sc.lineAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),start:e.getGraphicAttribute("start"),end:e.getGraphicAttribute("end"),verticalFactor:null!==(r=e.getGraphicAttribute("verticalFactor"))&&void 0!==r?r:1},d);break;case sc.circleAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),center:e.getGraphicAttribute("center"),radius:e.getGraphicAttribute("radius"),innerRadius:e.getGraphicAttribute("innerRadius"),inside:e.getGraphicAttribute("inside"),startAngle:e.getGraphicAttribute("startAngle"),endAngle:e.getGraphicAttribute("endAngle")},d)}}else{h=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;const s=Up(this.spec.inside,i,t,e),n=null===(a=null==h?void 0:h.getCoordinate)||void 0===a?void 0:a.call(h);n&&(d=Object.assign(OO(h,n,s,c,this.spec.layout,!0),d))}this._getGridComponentType()===sc.lineAxisGrid&&(d="line"!==this.spec.gridShape&&this.spec.gridShape?Object.assign({center:d.start,closed:!0},d,{type:this.spec.gridShape}):Object.assign({},d,{type:"line"}));const u=null===(o=null==h?void 0:h.getScale)||void 0===o?void 0:o.call(h),p=Up(this.spec.tickCount,i,t,e);switch(this._getGridComponentType()){case sc.lineAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.grid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p);case sc.circleAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleGrid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p)}return d}}),e}),{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)"circle"===this.spec.gridType?this._gridComponentType=sc.circleAxisGrid:this._gridComponentType=sc.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case ic.circleAxis:this._gridComponentType=sc.circleAxisGrid;break;case ic.lineAxis:default:this._gridComponentType=sc.lineAxisGrid}else if(this.spec.scale){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=(null===(t=null==e?void 0:e.getCoordinate)||void 0===t?void 0:t.call(e))?e.getCoordinateAxisPoints()?sc.lineAxisGrid:sc.circleAxisGrid:sc.lineAxisGrid}else this._gridComponentType=sc.lineAxisGrid;return this._gridComponentType}}zO.componentType=tc.grid;const NO=()=>{fc.registerGraphicComponent(sc.lineAxisGrid,((t,e)=>new jO(t,e))),fc.registerComponent(tc.grid,zO)},VO=()=>{fc.registerGraphicComponent(sc.circleAxisGrid,((t,e)=>new HO(t,e))),fc.registerComponent(tc.grid,zO)},WO=(t,e,i,s)=>YE(t,e,i).map((t=>s?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),GO=(t,e,i=0)=>Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2,UO=(t,e)=>t[1]{var i;const s=t.domain();if(!s.length)return[];const{tickCount:n,forceTickCount:r,tickStep:a,labelGap:o=4,axisOrientType:l,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(l),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?BE([s[s.length-1]]):BE([s[0]]);let p;if(M(a))p=t.stepTicks(a);else if(M(r))p=t.forceTicks(r);else if(M(n)){const e=ws(n)?n({axisLength:u,labelStyle:h}):n;p=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=Ga(c),a=Wa(c);if(s.length<=u/n){const i=(a-r)/s.length,n=WO(t,s,e,d),l=Math.min(...n.map((t=>t[2]))),h=XO(s,n,o,e.labelLastVisible,Math.floor(l/i),!1);p=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(p=p.slice(0,p.length-h.delCount)),p.push(s[s.length-1]))}else{const i=[s[0],s[Math.floor(s.length/2)],s[s.length-1]],n=WO(t,i,e,d);let l=null;n.forEach((t=>{l?l[2]0?Math.ceil(s.length*(o+l[2])/(a-r-o)):s.length-1;p=t.stepTicks(h),!e.labelLastVisible||p.length&&p[p.length-1]===s[s.length-1]||(p.length&&Math.abs(t.scale(p[p.length-1])-t.scale(s[s.length-1])){let a=0,o=0,l=-1,h=Number.MAX_VALUE;const d=s=>{let n=!0,r=0;do{r+sd(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!s){o=u;break}{const s=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==s&&!GO(e[n],e[s],i))break;r++}while(n>0);if(n===s){o=u,a=r;break}{const i=Math.floor(t.length/u)-r+1;if(i=0?UO(e[n-u],e[n]):t,c=Math.abs(t-d);if(cthis._scales[t];return{isContinuous:!1,dataToPosition:this.dataToPosition.bind(this),getScale:t,getBandwidth:(e=0)=>t(e).bandwidth(),getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse,getSpec:()=>this._spec}}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,$O),t}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){if(this._scale){const{bandSize:t,maxBandSize:e,minBandSize:i}=this._getOuterBandSizeFromSpec();if(t&&this._scale.bandwidth(t),e&&this._scale.maxBandwidth(e),i&&this._scale.minBandwidth(i),this._scale.isBandwidthFixed()&&this._spec.autoRegionSize&&(t||e)){const i=yb(this._scale.domain().length,null!=t?t:e,this._scale.paddingInner(),this._scale.paddingOuter());["bottom","top"].includes(this._orient)?this._regions.forEach((t=>t.setMaxWidth(i))):["left","right"].includes(this._orient)&&this._regions.forEach((t=>t.setMaxHeight(i)))}}}_getOuterBandSizeFromSpec(){var t;let{bandSize:e,maxBandSize:i,minBandSize:s,bandSizeLevel:n=0}=this._spec;const{gap:r,extend:a=0}=null!==(t=this._spec.bandSizeExtend)&&void 0!==t?t:{};n=Math.min(n,this._scales.length-1);for(let t=n;t>0;t--){const o=this._scales[t],l=o.domain(),h=o.paddingInner(),d=o.paddingOuter(),c=e=>{const i=t===n?a:0;return D(r)||t{RO(),NO(),mD(),Ql.registerComponent(KO.type,KO)};function ZO(t){const e=[];for(let i=0;it>i&&ti.reduce(((t,s,n)=>(t.push([s,i.length===n+1?e:i[n+1]]),t)),[[t,i[0]]]))(i,s,n)}const QO=(t,e)=>t-e;function tP(t,e){const i=((t,e)=>{const i=[0];let s=0,n=0;for(;s{const n=t[i-1]?t[i-1][1]:0,r=(100*n+100*+(e/s).toFixed(2))/100;return t.push([n,r>1||r>.95?1:r]),t}),[]).filter((t=>!(0===t[0]&&0===t[1]||1===t[0]&&1===t[1])))}const eP=Math.sqrt(50),iP=Math.sqrt(10),sP=Math.sqrt(2);class nP{constructor(){this._extend={},this.niceLabelFormatter=null}setExtraAttrFromSpec(){M(this._spec.nice)&&(this._nice=this._spec.nice),M(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=XE(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;if(!this._nice)return!1;let e=5;const i=this._spec.tick||{};if(il(i.forceTickCount))e=i.forceTickCount;else if(ws(i.tickCount)){const t=this._scale.range();let s=Math.abs(Va(t)-t[0]);1===s&&this._option&&(s=Ad(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({axisLength:s,labelStyle:this._spec.label&&this._spec.label.style})}else e=il(i.tickCount)?i.tickCount:5;"accurateFirst"===this._spec.niceType&&(e=Math.max(5,e));const{min:s,max:n}=null!==(t=this._domain)&&void 0!==t?t:{};return D(s)&&D(n)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice(e):(M(s)||M(this._softMinValue))&&D(n)&&D(this._softMaxValue)?this._scale.niceMax(e):!(!D(s)||!D(this._softMinValue)||!M(n)&&!M(this._softMaxValue))&&this._scale.niceMin(e)}setLogScaleNice(){var t;if(!this._nice)return!1;const{min:e,max:i}=null!==(t=this._domain)&&void 0!==t?t:{};return D(e)&&D(i)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice():(M(e)||M(this._softMinValue))&&D(i)&&D(this._softMaxValue)?this._scale.niceMax():!(!D(e)||!D(this._softMinValue)||!M(i)&&!M(this._softMaxValue))&&this._scale.niceMin()}setScaleNice(){return"log"===this._spec.type?this.setLogScaleNice():this.setLinearScaleNice()}dataToPosition(t,e){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){let e=[];if(t.length){const i=this._spec.breaks&&this._spec.breaks.length;let s,n,r=[];if(t.forEach((t=>{const{min:e,max:a}=t;s=void 0===s?e:Math.min(s,e),n=void 0===n?a:Math.max(n,a),i&&(r=r.concat(t.values))})),i){const t=[],i=[];for(let e=0;et[0]-e[0])),t.length){const{domain:s,scope:n}=function(t,e){return t.sort(QO),e.sort(QO),{domain:JO(t,e),scope:tP(t,e)}}(r,ZO(t));e=ZO(s),this._break={domain:s,scope:n,breakDomains:t,breaks:i}}else e=[s,n]}else e=[s,n]}else e[0]=0,e[1]=0;return this.setSoftDomainMinMax(e),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this._expand)return;let e=t[0],i=Va(t);e===i&&(0===i?i=1:i>0?e=0:i<0&&(i=0)),M(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),M(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){const{min:e,max:i}=XE(this._spec);if(M(e)||M(i)||"linear"!==this._spec.type)return t;if(Math.abs(Ga(t)-Wa(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[t.length-1]=1;else{let i=e/5;const s=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,s);i=(n>=eP?10:n>=iP?5:n>=sP?2:1)*Math.pow(10,s),t[0]=0,t[t.length-1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[t.length-1]*=-1)}return t}includeZero(t){this._zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(Va(t),0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e;const i=t.length-1,s=t[0]-t[i]>0,n=s?i:0,r=s?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e=Va(t)&&(t[t.length-1]=e),this._softMaxValue=e}}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){if(!this.isSeriesDataEnable())return;const t=this.collectData(),e=this.computeLinearDomain(t);this.updateScaleDomainByModel(e)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this._updateNiceLabelFormatter(t),this._domainAfterSpec=this._scale.domain(),this.event.emit(zd.scaleDomainUpdate,{model:this}),this.event.emit(zd.scaleUpdate,{model:this,value:"domain"})}getDomainAfterSpec(){return this._domainAfterSpec}_updateNiceLabelFormatter(t){const e=Math.abs(Va(t)-t[0]),i=Math.max(-Math.floor(Math.log10(e)),0)+2,s=Math.pow(10,i);this.niceLabelFormatter=t=>il(+t)?Math.round(+t*s)/s:t}}function rP(t,e,i,s){let n;const{breakData:r}=t;if(r&&r()){const{breakDomains:t}=r(),a=e.domain();n=[];for(let e=0;e{t.some((t=>e>=t[0]&&e<=t[1]))||n.push(e)}));e.domain(a)}else n=s(i);return n}function aP(t,e,i,s,n=!1){if(i&&!e.includes(t)){let i=e.length;if(i>1){n?e.push(t):e.unshift(t);for(let t=0;t{var i,s;if(!nd(t.type))return BE(t.domain());const n=t.range(),r=Math.abs(n[n.length-1]-n[0]);if(r<2)return BE([t.domain()[0]]);const{tickCount:a,forceTickCount:o,tickStep:l,noDecimals:h=!1,labelStyle:d,breakData:c}=e;let u;if(M(l))u=t.stepTicks(l);else if(M(o))u=rP(e,t,o,((e,i)=>i&&i.length?t.domain(i,!0).forceTicks(e):t.forceTicks(e)));else if("d3"===e.tickMode){const s=null!==(i=ws(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==i?i:5;u=rP(e,t,s,((e,i)=>i&&i.length?t.domain(i,!0).d3Ticks(e,{noDecimals:h}):t.d3Ticks(e,{noDecimals:h})))}else{const i=null!==(s=ws(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==s?s:5,n=ws(e.tickMode)?e.tickMode:void 0;u=rP(e,t,i,((e,i)=>i&&i.length?t.domain(i,!0).ticks(e,{noDecimals:h,customTicks:n}):t.ticks(e,{noDecimals:h,customTicks:n})))}const p=t.domain();if(e.labelFirstVisible&&p[0]!==u[0]&&!u.includes(p[0])&&u.unshift(p[0]),e.labelLastVisible&&p[p.length-1]!==u[u.length-1]&&!u.includes(p[p.length-1])&&u.push(p[p.length-1]),e.sampling&&u.length>1&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:s}=e;let n=YE(t,u,e).map(((t,e)=>({AABBBounds:t,value:u[e]})));const r=[...n],a=r[0],o=Va(r),l=c&&c()?lP.greedy:lP.parity;for(;n.length>=3&&HD(n,i);)n=l(n,i);const h=e.labelFirstVisible;let d=e.labelLastVisible;jD(a,o,i)&&n.includes(o)&&n.length>1&&h&&d&&(n.splice(n.indexOf(o),1),d=!1),aP(a,n,h,(t=>jD(t,a,i))),aP(o,n,d,(t=>jD(t,o,i)||!(!h||t===a)&&jD(t,a,i)),!0);const p=n.map((t=>t.value));p.length<3&&s&&(p.length>1&&p.pop(),Va(p)!==Va(u)&&p.push(Va(u))),u=p}return BE(u)},lP={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,s)=>!(s&&jD(i,t,e)||(i=t,0))))}};class hP extends vD{constructor(){super(...arguments),this.type=r.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new Zb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){var t,e;super.initScales();const i=[0,1];M(null===(t=this._domain)||void 0===t?void 0:t.min)&&(i[0]=this._domain.min),M(null===(e=this._domain)||void 0===e?void 0:e.max)&&(i[1]=this._domain.max),this._scale.domain(i)}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{breakData:(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)?()=>this._break:null})}_getUpdateAttribute(t){var e,i;const s=super._getUpdateAttribute(t);if(!Td(this._orient)&&(null===(i=null===(e=this._break)||void 0===e?void 0:e.breaks)||void 0===i?void 0:i.length)){const{width:t,height:e}=this.getLayoutRect(),i=Ad(this._orient),n=i?t:e;s.breaks=this._break.breaks.map((t=>{const{range:e,breakSymbol:s,gap:r=6}=t,a=this.valueToPosition((e[0]+e[1])/2)/n;let o;o=al(r)?Number(r.substring(0,r.length-1))/100:r/n;const l=il(null==s?void 0:s.angle)?s.angle:i?60:15;return{range:[a-o/2,a+o/2],breakSymbol:Object.assign(Object.assign({visible:!0},s),{angle:l*Math.PI/180}),rawRange:e}}))}return s}getNewScaleRange(){var t,e;let i=super.getNewScaleRange();return(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)&&(null===(e=this._break)||void 0===e?void 0:e.scope)&&(i=ZO(this._break.scope).map((t=>i[0]+(Va(i)-i[0])*t))),i}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,oP),t}}hP.type=r.cartesianLinearAxis,hP.specKey="axes",tw(hP,nP);const dP=()=>{RO(),NO(),mD(),Ql.registerComponent(hP.type,hP)};class cP extends QC{constructor(){super(...arguments),this.type=Sl.line,this.transformerConstructor=AE,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},i=null!==(t=this._spec.seriesMark)&&void 0!==t?t:"line";this.initLineMark(e,"line"===i),this.initSymbolMark(e,"point"===i)}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initMarkStyle(){this.initLineMarkStyle(this._direction),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._lineMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("line"))||void 0===i?void 0:i(n,r),NC("line",this._spec,this._markAttributeContext))),this._symbolMark){const t=JC(this);this._symbolMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),NC("point",this._spec,this._markAttributeContext),t))}}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){var e;const i="point"!==(null===(e=this._spec)||void 0===e?void 0:e.seriesMark);return e=>{var s,n;return i&&"fill"===e&&(e="stroke"),null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}cP.type=Sl.line,cP.mark=nE,cP.transformerConstructor=AE,tw(cP,sE);const uP=(t,e)=>{var i;const s=t.spec,{regionId:n,regionIndex:r}=s;if(M(n)){const t=Na(n);return null===(i=e.region)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Na(r).map((t=>{var i;return null===(i=e.region)||void 0===i?void 0:i[t]})).filter(M)};class pP{constructor(t){this._option=t,this.type=t.type,this.seriesType=t.seriesType}initChartSpec(t){return this.transformSpec(t),this.transformModelSpec(t)}transformSpec(t){t.region&&0!==t.region.length||(t.region=[{}]),void 0===t.tooltip&&(t.tooltip={}),M(t.stackInverse)&&t.region.forEach((e=>{!M(e.stackInverse)&&(e.stackInverse=t.stackInverse)})),M(t.stackSort)&&t.region.forEach((e=>{!M(e.stackSort)&&(e.stackSort=t.stackSort)}))}transformModelSpec(t){return this.createSpecInfo(t,((e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})).transformSpec(n,t,s);zy(t,r,l.spec),zy(s,null!=a?a:r,Object.assign(Object.assign({},i),l))}))}createSpecInfo(t,e){var i,s;e||(e=(e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})),h=l.transformSpec(n,t,s);zy(s,null!=a?a:r,Object.assign(Object.assign(Object.assign({},i),h),{theme:l.getTheme(n,t)}))});const n={};return this.forEachRegionInSpec(t,e,n),this.forEachSeriesInSpec(t,e,n),null===(i=n.series)||void 0===i||i.forEach(((t,e)=>{var i,s;const r=(null!==(s=null!==(i=uP(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[])[0];r&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(e),t.regionIndexes=r.regionIndexes.slice())})),this.forEachComponentInSpec(t,e,n),Object.values(null!==(s=n.component)&&void 0!==s?s:{}).forEach((t=>t.forEach(((t,e)=>{var i,s,r;if(t){if(!t.regionIndexes){const e=null!==(s=null!==(i=uP(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[];t.regionIndexes=e.map((t=>t.regionIndexes[0]))}if(!t.seriesIndexes){const e=((t,e)=>{var i;const s=t.spec,{seriesId:n,seriesIndex:r}=s;if(M(n)){const t=Na(n);return null===(i=e.series)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Na(r).map((t=>{var i;return null===(i=e.series)||void 0===i?void 0:i[t]})).filter(M)})(t,n);if(e)t.seriesIndexes=e.map((({seriesIndexes:t})=>t[0]));else{const e=new Set;(null!==(r=t.regionIndexes)&&void 0!==r?r:[]).forEach((t=>{var i,s;const r=null===(i=n.region)||void 0===i?void 0:i[t];null===(s=null==r?void 0:r.seriesIndexes)||void 0===s||s.forEach((t=>e.add(t)))})),t.seriesIndexes=Array.from(e)}}}})))),n}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t){var e,i,s,n;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!==(e=t.animation)&&void 0!==e?e:this._option.animation,animationThreshold:null!==(i=t.animationThreshold)&&void 0!==i?i:null===(n=(s=this._option).getTheme)||void 0===n?void 0:n.call(s).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,animationState:t.animationState,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph,interactions:t.interactions}}forEachRegionInSpec(t,e,i){var s;return(null!==(s=t.region)&&void 0!==s?s:[]).map(((t,s)=>e(Ql.getRegionInType("region"),{spec:t,specPath:["region",s],type:"region",regionIndexes:[s]},i)))}forEachSeriesInSpec(t,e,i){var s;return(null!==(s=t.series)&&void 0!==s?s:[]).map(((t,s)=>e(Ql.getSeriesInType(t.type),{spec:t,specPath:["series",s],type:t.type,seriesIndexes:[s]},i)))}forEachComponentInSpec(t,e,i){var s,n,a;const o=[],l=Ql.getComponents();let h,d,c,u;const p=[];for(let e=0;e0&&(g=!0,s.forEach((t=>{const s=Ql.getComponentInKey(t.type);o.push(e(s,t,i))})))}if(d&&!g){const s=d.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(g=!0,s.forEach((t=>{const s=Ql.getComponentInKey(t.type);o.push(e(s,t,i))})))}return c&&!g&&(null===(n=c.getSpecInfo(t,i))||void 0===n||n.forEach((t=>{o.push(e(c,t,i))}))),p.forEach((s=>{var n;null===(n=s.getSpecInfo?s.getSpecInfo(t,i):qT(t,s.specKey,s.type))||void 0===n||n.forEach((t=>{o.push(e(s,t,i))}))})),u&&(null===(a=qT(t,u.specKey,u.type))||void 0===a||a.forEach((t=>{o.push(e(u,t,i))}))),o}transformSeriesSpec(t){const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}_findBandAxisBySeries(t,e,i){const s="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find((i=>{if(!s.includes(i.orient))return!1;if(M(i.seriesId)){if(Na(i.seriesId).includes(null==t?void 0:t.id))return!0}else if(M(i.seriesIndex)){if(Na(i.seriesIndex).includes(e))return!0}else if("band"===i.type)return!0;return!0}))}_applyAxisBandSize(t,e,i){const{barMaxWidth:s,barMinWidth:n,barWidth:r,barGapInGroup:a}=i;let o=!1;h(n)?(t.minBandSize=n,o=!0):h(r)?(t.minBandSize=r,o=!0):h(s)&&(t.minBandSize=s,o=!0),o&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:y(a)?a[a.length-1]:a})}}class gP extends pP{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{xField:t.xField,yField:t.yField,zField:t.zField,seriesField:t.seriesField,seriesStyle:t.seriesStyle,direction:t.direction,stack:t.stack,percent:t.percent,stackOffsetSilhouette:t.stackOffsetSilhouette,totalLabel:t.totalLabel,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e],this._transformAxisSpec(t)}_setDefaultXAxisSpec(t){return{orient:"bottom"}}_setDefaultYAxisSpec(t){return{orient:"left"}}_setDefaultZAxisSpec(t){return{orient:"z"}}_transformAxisSpec(t){if(this.needAxes()){t.axes||(t.axes=[]);const e={x:!1,y:!1,z:!1};t.axes.forEach((i=>{const{orient:s}=i;let n=null;"top"!==s&&"bottom"!==s||(e.x=!0,n=this._setDefaultXAxisSpec(t)),"left"!==s&&"right"!==s||(e.y=!0,n=this._setDefaultYAxisSpec(t)),"z"===s&&(e.z=!0,n=this._setDefaultZAxisSpec(t)),n&&Object.keys(n).forEach((t=>{D(i[t])&&(i[t]=n[t])})),$d(i,"trimPadding")&&Pl(i,xy(this.type,t))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t)),t.zField&&!e.z&&t.axes.push(this._setDefaultZAxisSpec(t))}}}class mP extends gP{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"line",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,lineLabel:t.lineLabel})}transformSpec(t){super.transformSpec(t),vy(t)}}class _P{get dataList(){return this._dataArr}constructor(t){this._dataArr=[],this._dataSet=t}parseData(t){this._dataArr=[];const e=Na(t);for(let t=0;t{e.markRunning()})),this._dataValueForEach(s,((t,e)=>{Hp(e,t,i)})),0))}_dataValueForEach(t,e){t.forEach(((t,i)=>{if(t instanceof R)return;const s=this.getSeriesData(t.id,i);s&&e(t,s,i)}))}getSeriesData(t,e){if(!this._dataArr.length)return null;if("string"==typeof t){const e=this._dataArr.filter((e=>e.name===t));if(e[0])return e[0];yl(`no data matches dataId ${t}!`)}if("number"==typeof e){if(this._dataArr[e])return this._dataArr[e];yl(`no data matches dataIndex ${e}!`)}return this._dataArr[0]}}class fP{constructor(t,e){this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=t=>{const e=[];return this._scaleSpecMap.forEach(((i,s)=>{nl(i.domain)&&i.domain.forEach((s=>{s.dataId===t&&s.fields.forEach((t=>{FT(e,[{key:t,operations:nd(i.type)?["max","min"]:["values"]}])}))}))})),this._markAttributeScaleMap.forEach(((i,s)=>{const n=this.getScale(s);i.forEach((i=>{this._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&FT(e,[{key:i.field,operations:nd(n.type)?["max","min"]:["values"]}])}))})),e},this._spec=t,this._chart=e,this._setAttrFromSpec()}_createFromSpec(t){if(!t.id)return null;let e=this._scaleMap.get(t.id);return e||(e="ordinal"===t.type&&"color"===t.id?ax("colorOrdinal"):ax(t.type)),e?(y(t.range)&&e.range(t.range),y(t.domain)&&(nl(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}_setAttrFromSpec(){var t;if(!(null===(t=this._spec)||void 0===t?void 0:t.length))return;const e=new Map,i=new Map;this._spec.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._modelScaleSpecMap.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Im(t,this._spec))return e;e.change=!0;for(let i=0;it.id===s.id));if(!r.id)return e.reMake=!0,e;if(r.type!==s.type)return e.reMake=!0,e;if(!Im(r.specified,s.specified))return e.reMake=!0,e;s.range&&!Im(s.range,n.range())&&(n.range(s.range),e.reRender=!0),nl(s.domain)?e.reRender=!0:Im(s.domain,n.domain())||(n.domain(s.domain),e.reRender=!0),this._scaleSpecMap.set(s.id,s)}return this._spec=t,e}registerModelScale(t){const e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}removeModelScale(t){this._modelScaleSpecMap.forEach((e=>{t(e)&&(this._modelScaleSpecMap.delete(e.id),this._scaleSpecMap.delete(e.id),this._scaleMap.delete(e.id))}))}getScale(t){return this._scaleMap.get(t)}getScaleSpec(t){return this._scaleSpecMap.get(t)}_getSeriesByRawDataId(t){const e=this._chart.getAllSeries();for(let i=0;i{const s=this._scaleMap.get(i);if(!s)return;if(!nl(e.domain))return e.domain&&0!==e.domain.length||s.domain(t),void this._updateMarkScale(i,s,s.domain().slice());let n;n=nd(e.type)?[null,null]:new Set,e.domain.forEach((t=>{const i=this._getSeriesByRawDataId(t.dataId);if(!i)return;const s=nd(e.type);t.fields.forEach((t=>{const e=i.getRawDataStatisticsByField(t,s);e&&(s?(D(n[0])?n[0]=e.min:n[0]=Math.min(e.min,n[0]),D(n[1])?n[1]=e.max:n[1]=Math.max(e.max,n[1])):e.values.forEach((t=>{n.add(t)})))}))}));const r=n;nd(e.type)||(n=Array.from(n)),s.domain(n),this._updateMarkScale(i,s,r)}))}_updateMarkScale(t,e,i){const s=this._markAttributeScaleMap.get(t);s&&0!==s.length&&s.forEach((t=>{if(!t.field||!t.markScale||t.markScale===e)return;if(D(t.changeDomain)||"none"===t.changeDomain||D(t.seriesId))return void(nd(e.type)?t.markScale.domain(i):e.domain(Array.from(i)));const s=this._getSeriesBySeriesId(t.seriesId),n=nd(e.type),r=s.getRawDataStatisticsByField(t.field,n);if(!jm(r))return"expand"===t.changeDomain?(n?(i[0]=Math.min(i[0],r.min),i[1]=Math.max(i[1],r.max)):(r.values.forEach((t=>{i.add(t)})),i=Array.from(i)),void t.markScale.domain(i)):void("replace"!==t.changeDomain||(n?t.markScale.domain([r.min,r.max]):t.markScale.domain(r.values)));nd(e.type)?t.markScale.domain(i):e.domain(Array.from(i))}))}registerMarkAttributeScale(t,e){const i=this._scaleMap.get(t.scale);let s=this._markAttributeScaleMap.get(t.scale);s||(s=[],this._markAttributeScaleMap.set(t.scale,s));let n=i;return(D(t.field)||!D(t.changeDomain)&&"none"!==t.changeDomain&&!D(e))&&(n=i.clone()),s.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:n})),n}}var vP=function(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{var t;return null!==(t=this._series)&&void 0!==t?t:[]},this.getRegionsInIndex=t=>t&&0!==t.length?this._regions.filter(((e,i)=>t.includes(i))):[this._regions[0]],this.getAllRegions=()=>this._regions,this.getRegionsInIds=t=>t?this._regions.filter((e=>t.includes(e.id))):[],this.getRegionsInQuerier=t=>t?this._regions.filter(((e,i)=>Na(t).some((t=>M(t.regionId)&&t.regionId===e.userId||t.regionIndex===i)))):this._regions,this.getRegionsInUserId=t=>{if(t)return this._regions.find((e=>e.userId===t))},this.getRegionsInUserIdOrIndex=(t,e)=>this.getAllRegions().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponents=()=>this._components,this.getSeriesInIndex=t=>t&&0!==t.length?this._series.filter(((e,i)=>t.includes(i))):[this._series[0]],this.getSeriesInIds=t=>t?this._series.filter((e=>t.includes(e.id))):[],this.getSeriesInUserId=t=>{if(t)return this._series.find((e=>e.userId===t))},this.getSeriesInUserIdOrIndex=(t,e)=>this.getAllSeries().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponentByIndex=(t,e)=>{const i=this._components.filter((e=>(e.specKey||e.type)===t));if(i&&0!==i.length)return i[e]},this.getComponentsByKey=t=>this._components.filter((e=>(e.specKey||e.type)===t)),this.getComponentByUserId=t=>{const e=this._components.find((e=>e.userId===t));if(e)return e},this.getComponentsByType=t=>this._components.filter((e=>e.type===t)),this._paddingSpec=hl(null!==(i=t.padding)&&void 0!==i?i:e.getTheme().padding),this._event=new Gd(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new _P(this._dataSet),this._modelOption=Object.assign(Object.assign({},e),{mode:this._option.mode,map:this._idMap,getChartLayoutRect:()=>this._layoutRect,getChartViewRect:()=>this._viewRect,getChart:()=>this,globalScale:this._globalScale,onError:null===(s=this._option)||void 0===s?void 0:s.onError,disableTriggerEvent:!0===(null===(n=this._option)||void 0===n?void 0:n.disableTriggerEvent),getSeriesData:this._chartData.getSeriesData.bind(this._chartData)}),this._spec=t}created(){this._transformer=new this.transformerConstructor(Object.assign(Object.assign({},this._option),{type:this.type,seriesType:this.seriesType})),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}init(){var t,e;null===(t=this._beforeInit)||void 0===t||t.call(this),this._regions.forEach((t=>t.init({}))),this._series.forEach((t=>t.init({}))),this._components.forEach((t=>t.init({dataSet:this._dataSet}))),this._initEvent(),null===(e=this._initStack)||void 0===e||e.call(this),this.reDataFlow()}reDataFlow(){this._series.forEach((t=>{var e;return null===(e=t.getRawData())||void 0===e?void 0:e.markRunning()})),this._series.forEach((t=>t.fillData())),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){const s={width:t,height:e};this._canvasRect=s,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}_createBackground(){const t=this._spec.background;if(!t||"object"!=typeof t||M(t.gradient))return;const e=oD(t,["x","y","width","height","x1","y1","image"]);e.background=t.image,this._backgroundMark=Ql.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},e),{x:()=>this._viewBox.x1,y:()=>this._viewBox.y1,width:()=>this._viewBox.x2-this._viewBox.x1,height:()=>this._viewBox.y2-this._viewBox.y1}))}_createRegion(t,e){if(!t)return;const{spec:i}=e,s=vP(e,["spec"]),n=new t(i,Object.assign(Object.assign({},this._modelOption),s));n&&(n.created(),this._regions.push(n))}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=vP(e,["spec"]);let n;if(M(i.regionId)?n=this.getRegionsInUserId(i.regionId):M(i.regionIndex)&&(n=this.getRegionsInIndex([i.regionIndex])[0]),!n&&!(n=this._regions[0]))return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{type:i.type,region:n,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));r&&(r.created(),this._series.push(r),n.addSeries(r))}getSeriesById(t){return this._series.find((e=>e.id===t))}_createComponent(t,e){const i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey,getComponentsByType:this.getComponentsByType}));i&&(i.created(),this._components.push(i))}getAllComponents(){return this._components}getAllModels(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}getModelInFilter(t){if(S(t))return this.getAllModels().find((e=>e.userId===t));if(ws(t))return this.getAllModels().find((e=>t(e)));let e=0;return this.getAllModels().find((i=>{var s;if((null!==(s=i.specKey)&&void 0!==s?s:i.type)===t.type){if(e===t.index)return!0;e++}return!1}))}_createLayout(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}setLayout(t){this._option.layout=t,this._initLayoutFunc()}_initLayoutFunc(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){let s=!1;(this._spec.zField||this._spec.series&&this._spec.series.some((t=>t.zField)))&&(s=!0);const n=Ql.getLayoutInKey(null!==(e=null===(t=this._spec.layout)||void 0===t?void 0:t.type)&&void 0!==e?e:s?"layout3d":"base");if(n){const t=new n(this._spec.layout,{onError:null===(i=this._option)||void 0===i?void 0:i.onError});this._layoutFunc=t.layoutItems.bind(t)}}}layout(t){var e,i,s,n;if(null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeLayoutWithSceneGraph)||void 0===i||i.call(e),this.getLayoutTag()){this._event.emit(zd.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart(t);const e=this.getLayoutElements();this._layoutFunc(this,e,this._layoutRect,this._viewBox),this._event.emit(zd.afterLayout,{elements:e,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(zd.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterLayoutWithSceneGraph)||void 0===n||n.call(s)}onLayoutStart(t){this.getAllModels().forEach((e=>e.onLayoutStart(this._layoutRect,this._viewRect,t)))}onLayoutEnd(t){this.getAllModels().forEach((e=>{"series"!==e.modelType&&e.onLayoutEnd(t)}))}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach((e=>e.onEvaluateEnd(t)))}getLayoutElements(){return this.getAllModels().map((t=>t.layout)).filter((t=>!!t))}getModelById(t){const e=this._idMap.get(t);if(e&&e instanceof Ny)return e}getModelByUserId(t){const e=this.getSeriesInUserId(t);if(e)return e;const i=this.getRegionsInUserId(t);return i||(this.getComponentByUserId(t)||void 0)}getAllMarks(){return Array.from(this._idMap.values()).filter((t=>t&&t instanceof yx))}getMarkById(t){const e=this._idMap.get(t);if(e&&e instanceof yx)return e}updateData(t,e,i=!0,s){const n=this._dataSet.getDataView(t);n&&(n.markRunning(),n.parseNewData(e,s)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}updateFullData(t,e=!0){Na(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&e.markRunning()})),Na(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&Hp(e,t,!0)})),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}onRender(t){}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=yy(this._spec,this._option,{width:dh,height:ch})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t;const e=this._spec.scales?[...this._spec.scales]:[];let i=e.find((t=>"color"===t.id));const s=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){const t=this._spec.color;if(y(t))i.range=t;else{const e=t;Object.prototype.hasOwnProperty.call(e,"type")&&(i.type=e.type),Object.prototype.hasOwnProperty.call(e,"domain")&&(i.domain=e.domain),Object.prototype.hasOwnProperty.call(e,"range")&&(i.range=e.range),Object.prototype.hasOwnProperty.call(e,"specified")&&(i.specified=e.specified)}}return(null===(t=i.range)||void 0===t?void 0:t.length)||(i.range=Tl(s),i.rangeTheme=!0),e}_createGlobalScale(){this._globalScale=new fP(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){const t=new Set;this._series.forEach((e=>{const i=e.getSeriesKeys();i&&i.forEach((e=>t.add(e)))}));const e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){by(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){const t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=Tl(e),this._globalScale.getScale("color").range(t.range))}_getSpecKeys(t){const e={width:!0,height:!0};return Object.keys(t).filter((t=>!e[t])).sort()}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;const i=this._getSpecKeys(this._spec);if(!Im(i,this._getSpecKeys(t)))return e.reMake=!0,e;for(let s=0;s{by(t,e.updateSpec(this._spec.region[e.getSpecIndex()]))})):t.reMake=!0)}updateComponentSpec(t){const e={},i={[r.title]:!0,[r.brush]:!0,[r.mapLabel]:!0};this._components.forEach((s=>{var n,a;if(s.type===r.label||s.type===r.totalLabel)return;i[s.type]&&(i[s.type]=!1);const o=s.specKey||s.type,l=null!==(n=this._spec[o])&&void 0!==n?n:{};y(l)?(e[o]=e[o]||{specCount:l.length,componentCount:0},e[o].componentCount++,by(t,s.updateSpec(null!==(a=l[s.getSpecIndex()])&&void 0!==a?a:{},l))):by(t,s.updateSpec(l))}));for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];s.componentCount!==s.specCount&&(t.reMake=!0)}const s=t=>t&&!1!==t.visible;Object.keys(i).forEach((e=>{if(i[e]){const i=this._spec[e];(y(i)?i.some(s):s(i))&&(t.reMake=!0)}}))}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach((e=>{const i=this._spec.series[e.getSpecIndex()];by(t,e.updateSpec(i))})):t.reMake=!0}getCanvas(){var t,e;return null!==(e=null===(t=this.getCompiler())||void 0===t?void 0:t.getCanvas())&&void 0!==e?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;const{x1:i=0,y1:s=0,x2:n,y2:r}=t;e={width:n-i,height:r-s}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=ll(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(zd.layoutRectUpdate,{chart:this})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}reInit(){[...this._regions,...this._series,...this._components].forEach((t=>{const e=t.getSpecInfo();e&&e.spec&&t.reInit(e.spec)}))}clear(){this.getAllModels().forEach((t=>{var e;return null===(e=t.clear)||void 0===e?void 0:e.call(t)}))}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllSeries().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllComponents().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)}))}compileLayout(){const{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){var t;this._backgroundMark&&(this._backgroundMark.compile({context:{model:this}}),null===(t=this._backgroundMark.getProduct())||void 0===t||t.layout((()=>{})))}compileRegions(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeRegionCompile)||void 0===e||e.call(t),this.getAllRegions().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterRegionCompile)||void 0===s||s.call(i)}compileSeries(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeSeriesCompile)||void 0===e||e.call(t),this.getAllSeries().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterSeriesCompile)||void 0===s||s.call(i)}compileComponents(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeComponentCompile)||void 0===e||e.call(t),this.getAllComponents().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterComponentCompile)||void 0===s||s.call(i)}release(){[...this._components,...this._regions,...this._series].forEach((t=>{t.beforeRelease()})),super.release(),this.clear(),[...this._components,...this._regions,...this._series].forEach((t=>{t.release()})),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}onLayout(t){const e=t.rootMark;this.layout({group:e,srView:t})}updateState(t,e){const i=this.getAllSeries();for(const s in t){if(jm(t[s]))continue;const n=t[s];let r={stateValue:s};r=ws(n.filter)?Object.assign({filter:n.filter},r):Object.assign(Object.assign({},n.filter),r),n.level&&(r.level=n.level),i.forEach((t=>{t.getMarks().forEach((i=>{i.stateStyle[s]&&(e&&!e(t,i,s)||(i.state.changeStateInfo(r),i.updateMarkState(s)))}))}))}}setSelected(t,e,i){this._setStateInDatum(Sy.STATE_SELECTED,!0,t,e,i)}setHovered(t,e,i){this._setStateInDatum(Sy.STATE_HOVER,!0,t,e,i)}clearState(t){this.getAllRegions().forEach((e=>{e.interaction.clearEventElement(t,!0),e.interaction.resetInteraction(t,null)}))}clearAllStates(){this.getAllRegions().forEach((t=>{t.interaction.clearAllEventElement(),t.interaction.resetAllInteraction()}))}clearSelected(){this.clearState(Sy.STATE_SELECTED)}clearHovered(){this.clearState(Sy.STATE_HOVER)}_initEvent(){[zd.dataZoomChange,zd.scrollBarChange].forEach((t=>{this._event.on(t,(({value:t})=>{this._disableMarkAnimation(["exit","update"]);const e=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(hc.AFTER_MARK_RENDER_END,e)};this._event.on(hc.AFTER_MARK_RENDER_END,e)}))}))}_enableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)}))}_disableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)}))}_setStateInDatum(t,e,i,s,n){const r=(i=i?Na(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(n).forEach((n=>{i?(n.getSeries().forEach((e=>{e.getMarks().forEach((a=>{if(a.getProduct()&&(!s||ws(s)&&s(e,a))){const e=a.getProduct().isCollectionMark(),s=a.getProduct().elements;let o=[];if(e)o=s.filter((t=>{const e=t.getDatum();i.every(((t,i)=>r.every((s=>t[s]==e[i][s]))))}));else if(i.length>1){const t=i.slice();o=s.filter((e=>{if(0===t.length)return!1;const i=e.getDatum(),s=t.findIndex((t=>r.every((e=>t[e]==i[e]))));return s>=0&&(t.splice(s,1),!0)}))}else{const t=s.find((t=>r.every((e=>i[0][e]==t.getDatum()[e]))));t&&(o=[t])}o.forEach((e=>{n.interaction.startInteraction(t,e)}))}}))})),e&&n.interaction.reverseEventElement(t)):n.interaction.clearEventElement(t,!0)}))}setDimensionIndex(t,e){var i,s,n,a;let o=null;Array.from(this._event.getComposedEventMap().values()).forEach((i=>{const{eventType:s,event:n}=i;if(s===td.dimensionHover||s===td.dimensionClick){const i=n.dispatch(t,e);(null==i?void 0:i.length)&&(o=i)}}));const l=D(t)||!o||o.every((t=>ad(t.axis.getScale().type)&&D(t.index)));if(!1!==e.tooltip){const t=this.getComponentsByType(r.tooltip)[0];if(null==t?void 0:t.getVisible())if(l)null===(s=(i=t).hideTooltip)||void 0===s||s.call(i);else{const i={};o.forEach((t=>{const{axis:e,value:s,data:n}=t,r="left"===e.getOrient()||"right"===e.getOrient();n.forEach((t=>{var e,n,a;const o=r?t.series.fieldY[0]:t.series.fieldX[0];i[o]=null!==(a=null===(n=null===(e=t.datum)||void 0===e?void 0:e[0])||void 0===n?void 0:n[o])&&void 0!==a?a:s}))})),t.showTooltip(i,e.showTooltipOption)}}if(!1!==e.crosshair){const t=this.getComponentsByType(r.cartesianCrosshair)[0];t&&t.clearAxisValue&&t.setAxisValue&&(l?(null===(n=t.clearAxisValue)||void 0===n||n.call(t),null===(a=t.hide)||void 0===a||a.call(t)):o.forEach((e=>{const{axis:i,value:s}=e;t.clearAxisValue(),t.setAxisValue(s,i),t.layoutByValue()})))}}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}}const bP=(t,e)=>{const i={nodes:{}},{fields:s}=e;if(!(null==s?void 0:s.length))return i;const n=s.length-1;let r,a,o=i;return t.forEach((t=>{t.latestData&&t.latestData.forEach((t=>{o=i;for(let e=0;e{var e;const i=t.getSeries();if(!i.some((t=>t.getStack())))return;const s=i.some((t=>{var e,i;return null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.totalLabel)||void 0===i?void 0:i.visible})),n=s||i.some((t=>t.getPercent())),r=i.some((t=>t.getStackOffsetSilhouette())),a=HT(t,!0);for(const e in a)for(const i in a[e].nodes)WT(a[e].nodes[i],t.getStackInverse(),n,s);if(r)for(const t in a)for(const e in a[t].nodes)VT(a[t].nodes[e]);s&&t.getSeries().forEach((t=>{const e=t.getStackData(),i=t.getStackValue(),s=t.getStackValueField();e&&s&&NT(a[i],s)})),(null===(e=this._options)||void 0===e?void 0:e.afterStackRegion)&&this._options.afterStackRegion(t,a)},this._chart=t,this._options=e}init(){this._chart.getAllRegions().forEach((t=>{t.event.on(zd.regionSeriesDataFilterOver,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},this.stackRegion)}))}stackAll(){this._chart.getAllRegions().forEach((t=>{this.stackRegion({model:t})}))}}class SP{_beforeInit(){this._dataSet&&Cp(this._dataSet,"stackSplit",bP)}_initStack(){this._stack=new xP(this),this._stack.init()}}class MP extends yP{constructor(){super(...arguments),this.transformerConstructor=mP,this.type="line",this.seriesType=Sl.line}}MP.type="line",MP.seriesType=Sl.line,MP.transformerConstructor=mP,tw(MP,SP);class kP extends rE{constructor(){super(...arguments),this.type=kP.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getIgnoreAttributes(){return[]}}kP.type="area";const AP=()=>{Ql.registerMark(kP.type,kP),Mx(),OS(),fc.registerGraphic(Qd.area,SS),YA(),HA(),YC()};class wP extends sL{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var s,n,r,a;for(const i of Na(e)){let e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(!1!==e||"fill"!==i&&"stroke"!==i||(e="fill"===i?null===(r=null===(n=this.series.getSeriesStyle(t))||void 0===n?void 0:n("stroke"))||void 0===r?void 0:r[0]:null===(a=this.series.getSeriesStyle(t))||void 0===a?void 0:a("fill")),M(e))return e}return i}}}const TP=Object.assign(Object.assign(Object.assign({},_L),iE),{area:{name:"area",type:"area"}});class LP extends AE{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){var e,i,s;super._transformLabelSpec(t),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0),!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)||this._addMarkLabelSpec(t,"area")}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o;super._transformSpecAfterMergingTheme(t,e,i);const{area:l={},line:h={},seriesMark:d}=t,c=!1!==l.visible&&!1!==(null===(s=l.style)||void 0===s?void 0:s.visible),u=!1!==h.visible&&!1!==(null===(n=h.style)||void 0===n?void 0:n.visible);l.support3d=!(!l.support3d&&!h.support3d),l.zIndex=M(l.zIndex)||M(h.zIndex)?Math.max(null!==(r=l.zIndex)&&void 0!==r?r:0,null!==(a=h.zIndex)&&void 0!==a?a:0):void 0,l.style&&delete l.style.stroke,l.state&&Object.keys(l.state).forEach((t=>{"style"in l.state[t]?delete l.state[t].style.stroke:delete l.state[t].stroke}));let p=l,g=h;("line"===d||u&&!c)&&(p=h,g=l),l.style=Pl({},g.style,p.style),l.state=Pl({},g.state,p.state),c||(l.style.fill=!1),u||(l.style.stroke=!1),!1===l.interactive&&(l.style.fillPickable=!1),!1===h.interactive&&(h.style.strokePickable=!1),l.interactive=!(!l.interactive&&null!==(o=h.interactive)&&void 0!==o&&!o),l.visible=!(!c&&!u),t.area=l,t.line=h}}class CP extends QC{constructor(){super(...arguments),this.type=Sl.area,this.transformerConstructor=LP,this._sortDataByAxis=!1}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},s=this._spec.area||{},n=!1!==s.visible&&!1!==(null===(t=s.style)||void 0===t?void 0:t.visible),r=null!==(e=this._spec.seriesMark)&&void 0!==e?e:"area";this._areaMark=this._createMark(CP.mark.area,{groupKey:this._seriesField,isSeriesMark:n&&"point"!==r,stateSort:s.stateSort},Object.assign(Object.assign({},i),{morphElementKey:this.getDimensionField()[0],setCustomizedShape:s.customShape})),this.initSymbolMark(i,"point"===r)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){var t,e,i,s,n;const r=null!==(i=null===(e=null===(t=this.getSpec().area)||void 0===t?void 0:t.style)||void 0===e?void 0:e.curveType)&&void 0!==i?i:null===(n=null===(s=this.getSpec().line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.curveType,a=r===tE?"horizontal"===this._direction?"monotoneY":"monotoneX":r,o=this._areaMark;o&&("horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:t=>{var e,i;return ox(this.dataToPositionX1(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",Py.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:t=>{var e,i;return ox(this.dataToPositionY1(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series),this.setMarkStyle(o,{fill:this.getColorAttribute(),stroke:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(o,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.setMarkStyle(o,{curveType:a},"normal",Py.Built_In),Object.keys(o.stateStyle).forEach((t=>{o.stateStyle[t].stroke&&o.setPostProcess("stroke",(t=>[t,!1,!1,!1]),t)})))}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("line"))||void 0===e?void 0:e(n,r),NC("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("area"))||void 0===i?void 0:i(n,r),NC("area",this._spec,this._markAttributeContext))),this._symbolMark){const t=JC(this);this._symbolMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),NC("point",this._spec,this._markAttributeContext),t))}}initTooltip(){this._tooltipHelper=new wP(this);const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._areaMark&&t.add(this._areaMark),this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,s,n,r,a;const o=null!==(i=this._spec.seriesMark)&&void 0!==i?i:"area";let l=null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0;return"fill"!==e||l&&"line"!==o||(e="stroke",l=null!==(a=null===(r=this._seriesMark)||void 0===r?void 0:r.getAttribute(e,t))&&void 0!==a?a:void 0),"stroke"===e&&y(l)?l[0]:l}}}CP.type=Sl.area,CP.mark=TP,CP.transformerConstructor=LP,tw(CP,sE);class EP extends gP{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,area:t.area,seriesMark:t.seriesMark,activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,areaLabel:t.areaLabel})}transformSpec(t){super.transformSpec(t),vy(t)}}class DP extends yP{constructor(){super(...arguments),this.transformerConstructor=EP,this.type="area",this.seriesType=Sl.area}}function OP(t,e=!0){return(i,s,n)=>{const r="vertical"===t.direction?t.yField:t.xField,a=null==i?void 0:i[r];return"vertical"===t.direction?{overall:e?t.growFrom():e,orient:a>0?"negative":"positive"}:{overall:!!e&&t.growFrom(),orient:a>0?"positive":"negative"}}}DP.type="area",DP.seriesType=Sl.area,DP.transformerConstructor=EP,tw(DP,SP);const PP=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:OP(t,e)}),RP=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:OP(t,e)}),BP={type:"fadeIn"},IP={type:"growCenterIn"};function FP(t,e){if(!1===e)return{};switch(e){case"fadeIn":return BP;case"scaleIn":return IP;default:return PP(t)}}class YP extends yx{constructor(){super(...arguments),this.type=YP.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}YP.type="rect";const jP=()=>{Ql.registerMark(YP.type,YP),WA(),IC()},HP=Object.assign(Object.assign({},_L),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),zP=Object.assign(Object.assign({},_L),{bar3d:{name:"bar3d",type:"rect3d"}});function NP(t,e,i){var s,n;if(t.values.length>0){let r;if(t.sortDatums.length){let a=t.sortDatums;e&&(a=t.sortDatums.slice().reverse());for(let t=0;t{var a,o;const l=null===(o=(a=t[i.axisHelper]).getScale)||void 0===o?void 0:o.call(a,0);for(let a=0;athis._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[fL]):this._spec.barMinHeight?this._calculateRectPosition(t,!1):ox(this._dataToPosX(t),e),this._getBarXEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[vL]):ox(this._dataToPosX1(t),e),this._getBarYStart=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[yL]):this._spec.barMinHeight?this._calculateRectPosition(t,!0):ox(this._dataToPosY(t),e),this._getBarYEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[bL]):ox(this._dataToPosY1(t),e),this._getBarBackgroundXStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundXEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundYStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundYEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundPositionXEncoder=()=>{var t;return null===(t=this._barBackgroundPositionXEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionXEncoder=t=>{this._barBackgroundPositionXEncoder=t.bind(this)},this._getBarBackgroundPositionYEncoder=()=>{var t;return null===(t=this._barBackgroundPositionYEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionYEncoder=t=>{this._barBackgroundPositionYEncoder=t.bind(this)}}initMark(){var t,e;this._initBarBackgroundMark(),this._barMark=this._createMark(Object.assign(Object.assign({},GP.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{groupKey:this._seriesField,isSeriesMark:!0,stateSort:null===(t=this._spec.bar)||void 0===t?void 0:t.stateSort},{progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold,morphElementKey:this.getDimensionField()[0],morph:GC(this._spec,this._barMarkName),setCustomizedShape:null===(e=this._spec.bar)||void 0===e?void 0:e.customShape})}_initBarBackgroundMark(){this._spec.barBackground&&this._spec.barBackground.visible&&(this._barBackgroundMark=this._createMark(GP.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId(),stateSort:this._spec.barBackground.stateSort},{setCustomizedShape:this._spec.barBackground.customShape,progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold}))}initMarkStyle(){this._barMark&&this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",Py.Series)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initTooltip(){super.initTooltip();const{mark:t,group:e}=this._tooltipHelper.activeTriggerSet;this._barMark&&(t.add(this._barMark),e.add(this._barMark))}_statisticViewData(){var t,e;super._statisticViewData();const i=null!==(t=this._spec.barBackground)&&void 0!==t?t:{};if(!i.visible)return;const s=this._getRelatedComponentSpecInfo("axes").some((t=>t.type===r.cartesianBandAxis));let n;if(Cp(this._option.dataSet,"addVChartProperty",UT),s){const t=([t],{scaleDepth:e})=>{var i,s;let n=[{}];const r=this.getDimensionField(),a=D(e)?r.length:Math.min(r.length,e);for(let e=0;e{const i=[],[s,n]=this.getDimensionContinuousField(),r={};return e.latestData.forEach((t=>{const e=`${t[s]}-${t[n]}`;r[e]||(r[e]={[s]:t[s],[n]:t[n]},i.push(r[e]))})),i};Cp(this._option.dataSet,"dimensionItems",t);const e=this.getViewData();n=new R(this._option.dataSet).parse([e],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:uL.bind(this),call:pL}},!1),null==e||e.target.addListener("change",n.reRunAllTransform)}this._barBackgroundViewData=new lL(this._option,n)}init(t){var e,i;super.init(t),"vertical"===this.direction?"band"===(null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():"band"===(null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){const t=this.getRegion();return this.getStack()&&t.getSeries().filter((t=>t.type===this.type&&t.getSpec().barMinHeight)).length}_calculateStackRectPosition(t){const e=this.getRegion();if(e._bar_series_position_calculated)return;let i,s,n,r,a;e._bar_series_position_calculated=!0,t?(i=bL,s=yL,n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(i=vL,s=fL,n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=HT(e,!1,(t=>t.type===this.type));for(const l in o)for(const h in o[l].nodes)NP(o[l].nodes[h],e.getStackInverse(),{isVertical:t,start:i,end:s,startMethod:n,endMethod:r,axisHelper:a})}_calculateRectPosition(t,e){var i,s;let n,r,a;e?(n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=null===(s=(i=this[a]).getScale)||void 0===s?void 0:s.call(i,0),l=this[a].isInverse(),h=this._spec.barMinHeight,d=ox(this[n](t),o),c=ox(this[r](t),o);let u=Math.abs(d-c);uthis._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n),y:t=>this._getPosition(this.direction,t),height:()=>this._getBarWidth(this._yAxisHelper),width:()=>{},y1:()=>{}},"normal",Py.Series):this.setMarkStyle(this._barMark,{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r),x:t=>this._getPosition(this.direction,t),width:()=>this._getBarWidth(this._xAxisHelper),x1:()=>{},height:()=>{}},"normal",Py.Series),this._initStackBarMarkStyle(),this._initBandBarBackgroundMarkStyle()}_initStackBarMarkStyle(){var t,e,i,s;if(!this._spec.stackCornerRadius)return;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);this._barMark.setMarkConfig({clip:!0,clipPath:()=>{const t=[];return this._forEachStackGroup((e=>{let i=1/0,s=-1/0,a=!1,o=1/0,l=-1/0;e.values.forEach((t=>{const e=t[AT],n=t[wT],r=t[TT],h=t[LT];i=Math.min(i,e,n),s=Math.max(s,e,n),M(r)&&M(h)&&(a=!0,o=Math.min(o,r,h),l=Math.max(l,r,h))}));const h=Object.assign(Object.assign(Object.assign({},e.values[0]),{[AT]:i,[wT]:s}),a?{[TT]:o,[LT]:l}:void 0),d="horizontal"===this.direction?{x:this._getBarXStart(h,n),x1:this._getBarXEnd(h,n),y:this._getPosition(this.direction,h),height:this._getBarWidth(this._yAxisHelper)}:{y:this._getBarYStart(h,r),y1:this._getBarYEnd(h,r),x:this._getPosition(this.direction,h),width:this._getBarWidth(this._xAxisHelper)};t.push(qv(Object.assign(Object.assign({},d),{cornerRadius:ws(this._spec.stackCornerRadius)?this._spec.stackCornerRadius(d,h,this._markAttributeContext):this._spec.stackCornerRadius,fill:!0})))})),t}})}initLinearRectMarkStyle(){var t,e,i,s;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);if("horizontal"===this.direction){const t=M(this._fieldY2)?{y:t=>ox(this._dataToPosY(t),r),y1:t=>ox(this._dataToPosY1(t),r)}:{y:t=>ox(this._dataToPosY(t)-this._getBarWidth(this._yAxisHelper)/2,r),height:t=>this._getBarWidth(this._yAxisHelper)};this.setMarkStyle(this._barMark,Object.assign({x:t=>this._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n)},t),"normal",Py.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign({x:()=>this._getBarBackgroundXStart(n),x1:()=>this._getBarBackgroundXEnd(n)},t),"normal",Py.Series)}else{const t=M(this._fieldX2)?{x:t=>ox(this._dataToPosX(t),n),x1:t=>ox(this._dataToPosX1(t),n)}:{x:t=>ox(this._dataToPosX(t)-this._getBarWidth(this._xAxisHelper)/2,n),width:t=>this._getBarWidth(this._xAxisHelper)};this.setMarkStyle(this._barMark,Object.assign(Object.assign({},t),{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r)}),"normal",Py.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign(Object.assign({},t),{y:()=>this._getBarBackgroundYStart(r),y1:()=>this._getBarBackgroundYEnd(r)}),"normal",Py.Series)}}_initBandBarBackgroundMarkStyle(){var t,e,i,s,n;if(!this._barBackgroundMark)return;const r=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),a=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0),o=null!==(n=this._spec.barBackground)&&void 0!==n?n:{},l=D(o.fieldLevel)?void 0:o.fieldLevel+1;"horizontal"===this.direction?this.setMarkStyle(this._barBackgroundMark,{x:()=>this._getBarBackgroundXStart(r),x1:()=>this._getBarBackgroundXEnd(r),y:t=>this._getPosition(this.direction,t,l,"barBackground"),height:()=>this._getBarWidth(this._yAxisHelper,l),width:()=>{},y1:()=>{}},"normal",Py.Series):this.setMarkStyle(this._barBackgroundMark,{x:t=>this._getPosition(this.direction,t,l,"barBackground"),y:()=>this._getBarBackgroundYStart(a),y1:()=>this._getBarBackgroundYEnd(a),width:()=>this._getBarWidth(this._xAxisHelper,l),x1:()=>{},height:()=>{}},"normal",Py.Series)}initAnimation(){var t,e;const i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},s=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset,n=JC(this);this._barMark.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("bar"))||void 0===e?void 0:e(i,s),NC(this._barMarkName,this._spec,this._markAttributeContext),n))}_getBarWidth(t,e){var i,s;const n=this._groups?this._groups.fields.length:1,r=D(e)?n:Math.min(n,e),a=null!==(s=null===(i=t.getBandwidth)||void 0===i?void 0:i.call(t,r-1))&&void 0!==s?s:6,o=M(this._spec.barWidth)&&r===n,l=M(this._spec.barMinWidth),h=M(this._spec.barMaxWidth);let d=a;return o&&(d=cl(this._spec.barWidth,a)),l&&(d=Math.max(d,cl(this._spec.barMinWidth,a))),h&&(d=Math.min(d,cl(this._spec.barMaxWidth,a))),d}_getPosition(t,e,i,s){var n,r,a,o,l;let h,d,c;"horizontal"===t?(h=this.getYAxisHelper(),d="height",c="barBackground"===s?this.dataToBarBackgroundPositionY.bind(this):this.dataToPositionY.bind(this)):(h=this.getXAxisHelper(),d="width",c="barBackground"===s?this.dataToBarBackgroundPositionX.bind(this):this.dataToPositionX.bind(this));const u=h.getScale(0),p=this._groups?this._groups.fields.length:1,g=D(i)?p:Math.min(p,i),m=null!==(r=null===(n=h.getBandwidth)||void 0===n?void 0:n.call(h,g-1))&&void 0!==r?r:6,_=g===p?this._barMark.getAttribute(d,e):m;if(g>1&&M(this._spec.barGapInGroup)){const t=this._groups.fields,i=Na(this._spec.barGapInGroup);let s=0,n=0;for(let r=t.length-1;r>=1;r--){const d=t[r],c=null!==(o=null===(a=h.getScale(r))||void 0===a?void 0:a.domain())&&void 0!==o?o:[],u=c.length,p=cl(null!==(l=i[r-1])&&void 0!==l?l:Va(i),m),g=c.indexOf(e[d]);r===t.length-1?(s+=u*_+(u-1)*p,n+=g*(_+p)):(n+=g*(s+p),s+=s+(u-1)*p)}return u.scale(e[t[0]])+h.getBandwidth(0)/2-s/2+n}const f=nd(u.type||"band");return c(e,g)+.5*(m-_)+(f?-m/2:0)}dataToBarBackgroundPositionX(t,e){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,e,this._getBarBackgroundPositionXEncoder,this._setBarBackgroundPositionXEncoder)}dataToBarBackgroundPositionY(t,e){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,e,this._getBarBackgroundPositionYEncoder,this._setBarBackgroundPositionYEncoder)}onLayoutEnd(t){super.onLayoutEnd(t),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}compile(){if(super.compile(),this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),null===(t=this._barBackgroundViewData)||void 0===t||t.compile()}fillData(){var t,e;super.fillData(),null===(e=null===(t=this._barBackgroundViewData)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._barBackgroundViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._barBackgroundViewData)||void 0===s||s.updateData()}release(){var t;super.release(),null===(t=this._barBackgroundViewData)||void 0===t||t.release(),this._barBackgroundViewData=null}}GP.type=Sl.bar,GP.mark=HP,GP.transformerConstructor=WP;const UP=()=>{ME(),jP(),Ql.registerAnimation("bar",((t,e)=>({appear:FP(t,e),enter:PP(t,!1),exit:RP(t,!1),disappear:RP(t)}))),qO(),dP(),Ql.registerSeries(GP.type,GP)};class $P extends gP{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barMinHeight:t.barMinHeight,sampling:t.sampling,samplingFactor:t.samplingFactor,barBackground:t.barBackground,stackCornerRadius:t.stackCornerRadius})}transformSpec(t){super.transformSpec(t),vy(t)}_transformAxisSpec(t){var e,i;if(super._transformAxisSpec(t),!t.axes)return;const s=t.series.some((t=>"horizontal"===t.direction)),n=null!==(e=t.axes.find((t=>"band"===t.type)))&&void 0!==e?e:t.axes.find((t=>(s?["left","right"]:["top","bottom"]).includes(t.orient)));if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize&&t.autoBandSize){const e=As(t.autoBandSize)&&null!==(i=t.autoBandSize.extend)&&void 0!==i?i:0,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o}=t.series.find((t=>"bar"===t.type));this._applyAxisBandSize(n,e,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}class XP extends yP{constructor(){super(...arguments),this.transformerConstructor=$P,this.type="bar",this.seriesType=Sl.bar}}XP.type="bar",XP.seriesType=Sl.bar,XP.transformerConstructor=$P,tw(XP,SP);class KP extends yx{constructor(){super(...arguments),this.type=KP.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}}KP.type="rect3d";const qP=()=>{Ql.registerMark(KP.type,KP),Mx(),YM(),fc.registerGraphic(Qd.rect3d,EM),IC()};class ZP extends GP{constructor(){super(...arguments),this.type=Sl.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d"}}ZP.type=Sl.bar3d,ZP.mark=zP;const JP=()=>{Ql.registerAnimation("bar3d",((t,e)=>({appear:FP(t,e),enter:PP(t,!1),exit:RP(t,!1),disappear:RP(t)}))),qP(),qO(),dP(),Ql.registerSeries(ZP.type,ZP)};class QP extends $P{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup})}}class tR{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=B.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 s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/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,s.set3dOptions(this.option3d),s.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 eR=()=>{Kx(),Zx(),Cg.registerPlugin("ViewTransform3dPlugin",tR)};class iR extends XP{constructor(){super(...arguments),this.transformerConstructor=QP,this.type="bar3d",this.seriesType=Sl.bar3d}}iR.type="bar3d",iR.seriesType=Sl.bar3d,iR.transformerConstructor=QP;const sR=[10,20],nR=ed.Linear,rR="circle",aR=ed.Ordinal,oR=["circle","square","triangle","diamond","star"],lR=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"},hR=Object.assign(Object.assign({},_L),{point:{name:"point",type:"symbol"}});class dR extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class cR extends QC{constructor(){super(...arguments),this.type=Sl.scatter,this.transformerConstructor=dR,this._invalidType="zero"}setAttrFromSpec(){super.setAttrFromSpec(),this._size=this._spec.size,this._sizeField=this._spec.sizeField,this._shape=this._spec.shape,this._shapeField=this._spec.shapeField}_getSeriesAttribute(t,e,{defaultScaleType:i,defaultRange:s},n){var r,a,o,l;if(ws(e))return e;if(y(e)){if(D(t))return null===(r=this._option)||void 0===r||r.onError(`${n}Field is required.`),e;if("ordinal"!==i&&e.length>2)return null===(a=this._option)||void 0===a||a.onError(`${n} length is invalid, specify up to 2 ${n}s.`),e;const s=`${hh}_series_scatter_${this.id}_scale_${n}`;return this._option.globalScale.registerModelScale({id:s,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:s,field:t}}if(As(e)){if(D(t))return null===(o=this._option)||void 0===o||o.onError(`${n}Field is required.`),e;const r=`${hh}_series_scatter_${this.id}_scale_${n}`,a=Object.assign({id:r,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:s},e);return this._option.globalScale.registerModelScale(a),{scale:a.id,field:t}}return null===(l=this._option)||void 0===l||l.onError(`${n} attribute is invalid.`),e}getSizeAttribute(t,e){return D(e)?10:h(e)?e:!S(e)||("string"!=typeof(i=e)||isNaN(Number(i))||isNaN(parseFloat(i)))?this._getSeriesAttribute(t,e,{defaultScaleType:nR,defaultRange:sR},"size"):parseFloat(e);var i}getShapeAttribute(t,e){return D(e)?rR:S(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:aR,defaultRange:oR},"shape")}initMark(){var t,e;this._symbolMark=this._createMark(cR.mark.point,{groupKey:this._seriesField,isSeriesMark:!0,stateSort:null===(t=this._spec.point)||void 0===t?void 0:t.stateSort},{progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold,morph:GC(this._spec,cR.mark.point.name),morphElementKey:this.getDimensionField()[0],setCustomizedShape:null===(e=this._spec.point)||void 0===e?void 0:e.customShape})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;const s=JC(this),n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._symbolMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("scatter"))||void 0===i?void 0:i({},n),NC("point",this._spec,this._markAttributeContext),s))}initSymbolMarkStyle(){const t=this._symbolMark;t&&("zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,fill:this.getColorAttribute(),size:h(this._size)||ws(this._size)?this._size:10,symbolType:S(this._shape)||ws(this._shape)?this._shape:rR},Sy.STATE_NORMAL,Py.Series),(M(this._sizeField)||M(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},Sy.STATE_NORMAL,Py.User_Mark),(M(this._shapeField)||M(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},Sy.STATE_NORMAL,Py.User_Mark))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);const e=[this.getDimensionField()[0],this.getStackValueField()].every((t=>{var e,i,s;return t&&(null===(s=null===(i=null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[t])||void 0===s?void 0:s.allValid)}));"zero"===this._invalidType||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",Py.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this._symbolMark.getProduct()&&this._symbolMark.compileEncode()}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null},Sy.STATE_NORMAL,Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},Sy.STATE_NORMAL,Py.Series))}handleZoom(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}handlePan(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}cR.type=Sl.scatter,cR.mark=hR,cR.transformerConstructor=dR;class uR extends gP{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,size:t.size,sizeField:t.sizeField,shape:t.shape,shapeField:t.shapeField})}}class pR extends yP{constructor(){super(...arguments),this.transformerConstructor=uR,this.type="scatter",this.seriesType=Sl.scatter}}function gR(){var t,e=[];return{point:function(e,i,s){t.push([e,i,s])},lineStart:function(){e.push(t=[])},lineEnd:Zc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function mR(t,e){return Yc(t[0]-e[0])=0;--r)n.point((d=h[r])[0],d[1]);else s(u.x,u.p.x,-1,n);u=u.p}h=(u=u.o).z,p=!p}while(!u.v);n.lineEnd()}}}function vR(t){if(e=t.length){for(var e,i,s=0,n=t[0];++se?1:t>=e?0:NaN}1===(wR=ER).length&&(TR=wR,wR=function(t,e){return ER(TR(t),e)});var DR=Array.prototype;function OR(t){for(var e,i,s,n=t.length,r=-1,a=0;++r=0;)for(e=(s=t[n]).length;--e>=0;)i[--a]=s[e];return i}function PR(t,e,i,s){return function(n){var r,a,o,l=e(n),h=gR(),d=e(h),c=!1,u={point:p,lineStart:m,lineEnd:_,polygonStart:function(){u.point=f,u.lineStart=v,u.lineEnd=y,a=[],r=[]},polygonEnd:function(){u.point=p,u.lineStart=m,u.lineEnd=_,a=OR(a);var t=function(t,e){var i=CR(e),s=e[1],n=Gc(s),r=[Gc(i),-zc(i),0],a=0,o=0;LR.reset(),1===n?s=Pc+Dc:-1===n&&(s=-Pc-Dc);for(var l=0,h=t.length;l=0?1:-1,A=k*M,w=A>Oc,T=m*x;if(LR.add(Hc(T*k*Gc(A),_*S+T*zc(A))),a+=w?M+k*Bc:M,w^p>=i^y>=i){var L=SR(bR(u),bR(v));AR(L);var C=SR(r,L);AR(C);var E=(w^M>=0?-1:1)*qc(C[2]);(s>E||s===E&&(L[0]||L[1]))&&(o+=w^M>=0?1:-1)}}return(a<-Dc||a0){for(c||(n.polygonStart(),c=!0),n.lineStart(),t=0;t1&&2&l&&u.push(u.pop().concat(u.shift())),a.push(u.filter(RR))}return u}}function RR(t){return t.length>1}function BR(t,e){return((t=t.x)[0]<0?t[1]-Pc-Dc:Pc-t[1])-((e=e.x)[0]<0?e[1]-Pc-Dc:Pc-e[1])}DR.slice,DR.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);const IR=PR((function(){return!0}),(function(t){var e,i=NaN,s=NaN,n=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(r,a){var o=r>0?Oc:-Oc,l=Yc(r-i);Yc(l-Oc)0?Pc:-Pc),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),t.point(r,s),e=0):n!==o&&l>=Oc&&(Yc(i-n)Dc?jc((Gc(e)*(r=zc(s))*Gc(i)-Gc(s)*(n=zc(e))*Gc(t))/(n*r*a)):(e+s)/2}(i,s,r,a),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),e=0),t.point(i=r,s=a),n=o},lineEnd:function(){t.lineEnd(),i=s=NaN},clean:function(){return 2-e}}}),(function(t,e,i,s){var n;if(null==t)n=i*Pc,s.point(-Oc,n),s.point(0,n),s.point(Oc,n),s.point(Oc,0),s.point(Oc,-n),s.point(0,-n),s.point(-Oc,-n),s.point(-Oc,0),s.point(-Oc,n);else if(Yc(t[0]-e[0])>Dc){var r=t[0]0)do{h.point(0===d||3===d?t:i,d>1?s:e)}while((d=(d+o+4)%4)!==c);else h.point(r[0],r[1])}function a(s,n){return Yc(s[0]-t)0?0:3:Yc(s[0]-i)0?2:1:Yc(s[1]-e)0?1:0:n>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var i=a(t,1),s=a(e,1);return i!==s?i-s:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(a){var l,h,d,c,u,p,g,m,_,f,v,y=a,b=gR(),x={point:S,lineStart:function(){x.point=M,h&&h.push(d=[]),f=!0,_=!1,g=m=NaN},lineEnd:function(){l&&(M(c,u),p&&_&&b.rejoin(),l.push(b.result())),x.point=S,_&&y.lineEnd()},polygonStart:function(){y=b,l=[],h=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,n=h.length;is&&(u-r)*(s-a)>(p-a)*(t-r)&&++e:p<=s&&(u-r)*(s-a)<(p-a)*(t-r)&&--e;return e}(),i=v&&e,n=(l=OR(l)).length;(i||n)&&(a.polygonStart(),i&&(a.lineStart(),r(null,null,1,a),a.lineEnd()),n&&fR(l,o,e,r,a),a.polygonEnd()),y=a,l=h=d=null}};function S(t,e){n(t,e)&&y.point(t,e)}function M(r,a){var o=n(r,a);if(h&&d.push([r,a]),f)c=r,u=a,p=o,f=!1,o&&(y.lineStart(),y.point(r,a));else if(o&&_)y.point(r,a);else{var l=[g=Math.max(jR,Math.min(YR,g)),m=Math.max(jR,Math.min(YR,m))],b=[r=Math.max(jR,Math.min(YR,r)),a=Math.max(jR,Math.min(YR,a))];!function(t,e,i,s,n,r){var a,o=t[0],l=t[1],h=0,d=1,c=e[0]-o,u=e[1]-l;if(a=i-o,c||!(a>0)){if(a/=c,c<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-o,c||!(a<0)){if(a/=c,c<0){if(a>d)return;a>h&&(h=a)}else if(c>0){if(a0)){if(a/=u,u<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-l,u||!(a<0)){if(a/=u,u<0){if(a>d)return;a>h&&(h=a)}else if(u>0){if(a0&&(t[0]=o+h*c,t[1]=l+h*u),d<1&&(e[0]=o+d*c,e[1]=l+d*u),!0}}}}}(l,b,t,e,i,s)?o&&(y.lineStart(),y.point(r,a),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),o||y.lineEnd(),v=!1)}g=r,m=a,_=o}return x}}function zR(t,e){function i(i,s){return i=t(i,s),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,s){return(i=e.invert(i,s))&&t.invert(i[0],i[1])}),i}function NR(t,e){return[Yc(t)>Oc?t+Math.round(-t/Bc)*Bc:t,e]}function VR(t,e,i){return(t%=Bc)?e||i?zR(GR(t),UR(e,i)):GR(t):e||i?UR(e,i):NR}function WR(t){return function(e,i){return[(e+=t)>Oc?e-Bc:e<-Oc?e+Bc:e,i]}}function GR(t){var e=WR(t);return e.invert=WR(-t),e}function UR(t,e){var i=zc(t),s=Gc(t),n=zc(e),r=Gc(e);function a(t,e){var a=zc(e),o=zc(t)*a,l=Gc(t)*a,h=Gc(e),d=h*i+o*s;return[Hc(l*n-d*r,o*i-h*s),qc(d*n+l*r)]}return a.invert=function(t,e){var a=zc(e),o=zc(t)*a,l=Gc(t)*a,h=Gc(e),d=h*n-l*r;return[Hc(l*n+h*r,o*i+d*s),qc(d*i-o*s)]},a}function $R(t){return function(e){var i=new XR;for(var s in t)i[s]=t[s];return i.stream=e,i}}function XR(){}function KR(t,e,i){var s=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=s&&t.clipExtent(null),wc(i,t.stream(mu)),e(mu.result()),null!=s&&t.clipExtent(s),t}function qR(t,e,i){return KR(t,(function(i){var s=e[1][0]-e[0][0],n=e[1][1]-e[0][1],r=Math.min(s/(i[1][0]-i[0][0]),n/(i[1][1]-i[0][1])),a=+e[0][0]+(s-r*(i[1][0]+i[0][0]))/2,o=+e[0][1]+(n-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([a,o])}),i)}function ZR(t,e,i){return qR(t,[[0,0],e],i)}function JR(t,e,i){return KR(t,(function(i){var s=+e,n=s/(i[1][0]-i[0][0]),r=(s-n*(i[1][0]+i[0][0]))/2,a=-n*i[0][1];t.scale(150*n).translate([r,a])}),i)}function QR(t,e,i){return KR(t,(function(i){var s=+e,n=s/(i[1][1]-i[0][1]),r=-n*i[0][0],a=(s-n*(i[1][1]+i[0][1]))/2;t.scale(150*n).translate([r,a])}),i)}NR.invert=NR,XR.prototype={constructor:XR,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var tB=16,eB=zc(30*Fc);function iB(t,e){return+e?function(t,e){function i(s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f=h-s,v=d-n,y=f*f+v*v;if(y>4*e&&m--){var b=a+u,x=o+p,S=l+g,M=$c(b*b+x*x+S*S),k=qc(S/=M),A=Yc(Yc(S)-1)e||Yc((f*C+v*E)/y-.5)>.3||a*u+o*p+l*g0,n=Yc(e)>Dc;function r(t,i){return zc(t)*zc(i)>e}function a(t,i,s){var n=[1,0,0],r=SR(bR(t),bR(i)),a=xR(r,r),o=r[0],l=a-o*o;if(!l)return!s&&t;var h=e*a/l,d=-e*o/l,c=SR(n,r),u=kR(n,h);MR(u,kR(r,d));var p=c,g=xR(u,p),m=xR(p,p),_=g*g-m*(xR(u,u)-1);if(!(_<0)){var f=$c(_),v=kR(p,(-g-f)/m);if(MR(v,u),v=yR(v),!s)return v;var y,b=t[0],x=i[0],S=t[1],M=i[1];x0^v[1]<(Yc(v[0]-b)Oc^(b<=v[0]&&v[0]<=x)){var w=kR(p,(-g+f)/m);return MR(w,u),[v,yR(w)]}}}function o(e,i){var n=s?t:Oc-t,r=0;return e<-n?r|=1:e>n&&(r|=2),i<-n?r|=4:i>n&&(r|=8),r}return PR(r,(function(t){var e,i,l,h,d;return{lineStart:function(){h=l=!1,d=1},point:function(c,u){var p,g=[c,u],m=r(c,u),_=s?m?0:o(c,u):m?o(c+(c<0?Oc:-Oc),u):0;if(!e&&(h=l=m)&&t.lineStart(),m!==l&&(!(p=a(e,g))||mR(e,p)||mR(g,p))&&(g[2]=1),m!==l)d=0,m?(t.lineStart(),p=a(g,e),t.point(p[0],p[1])):(p=a(e,g),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(n&&e&&s^m){var f;_&i||!(f=a(g,e,!0))||(d=0,s?(t.lineStart(),t.point(f[0][0],f[0][1]),t.point(f[1][0],f[1][1]),t.lineEnd()):(t.point(f[1][0],f[1][1]),t.lineEnd(),t.lineStart(),t.point(f[0][0],f[0][1],3)))}!m||e&&mR(e,g)||t.point(g[0],g[1]),e=g,l=m,i=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return d|(h&&l)<<1}}}),(function(e,s,n,r){!function(t,e,i,s,n,r){if(i){var a=zc(e),o=Gc(e),l=s*i;null==n?(n=e+s*Bc,r=e-l/2):(n=FR(a,n),r=FR(a,r),(s>0?nr)&&(n+=s*Bc));for(var h,d=n;s>0?d>r:d2?t[2]%360*Fc:0,C()):[_*Ic,f*Ic,v*Ic]},T.angle=function(t){return arguments.length?(y=t%360*Fc,C()):y*Ic},T.reflectX=function(t){return arguments.length?(b=t?-1:1,C()):b<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},T.precision=function(t){return arguments.length?(a=iB(o,w=t*t),E()):$c(w)},T.fitExtent=function(t,e){return qR(T,t,e)},T.fitSize=function(t,e){return ZR(T,t,e)},T.fitWidth=function(t,e){return JR(T,t,e)},T.fitHeight=function(t,e){return QR(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&L,C()}}function lB(t){var e=0,i=Oc/3,s=oB(t),n=s(e,i);return n.parallels=function(t){return arguments.length?s(e=t[0]*Fc,i=t[1]*Fc):[e*Ic,i*Ic]},n}function hB(t,e){var i=Gc(t),s=(i+Gc(e))/2;if(Yc(s)2?t[2]*Fc:0),e.invert=function(e){return(e=t.invert(e[0]*Fc,e[1]*Fc))[0]*=Ic,e[1]*=Ic,e},e}(n.rotate()).invert([0,0]));return l(null==h?[[o[0]-r,o[1]-r],[o[0]+r,o[1]+r]]:t===_B?[[Math.max(o[0]-r,h),e],[Math.min(o[0]+r,i),s]]:[[h,Math.max(o[1]-r,e)],[i,Math.min(o[1]+r,s)]])}return n.scale=function(t){return arguments.length?(a(t),d()):a()},n.translate=function(t){return arguments.length?(o(t),d()):o()},n.center=function(t){return arguments.length?(r(t),d()):r()},n.clipExtent=function(t){return arguments.length?(null==t?h=e=i=s=null:(h=+t[0][0],e=+t[0][1],i=+t[1][0],s=+t[1][1]),d()):null==h?null:[[h,e],[i,s]]},d()}function vB(t){return Xc((Pc+t)/2)}function yB(t,e){var i=zc(t),s=t===e?Gc(t):Vc(i/zc(e))/Vc(vB(e)/vB(t)),n=i*Wc(vB(t),s)/s;if(!s)return _B;function r(t,e){n>0?e<-Pc+Dc&&(e=-Pc+Dc):e>Pc-Dc&&(e=Pc-Dc);var i=n/Wc(vB(e),s);return[i*Gc(s*t),n-i*zc(s*t)]}return r.invert=function(t,e){var i=n-e,r=Uc(s)*$c(t*t+i*i),a=Hc(t,Yc(i))*Uc(i);return i*s<0&&(a-=Oc*Uc(t)*Uc(i)),[a/s,2*jc(Wc(n/r,1/s))-Pc]},r}function bB(t,e){return[t,e]}function xB(t,e){var i=zc(t),s=t===e?Gc(t):(i-zc(e))/(e-t),n=i/s+t;if(Yc(s)Dc&&--n>0);return[t/(.8707+(r=s*s)*(r*(r*r*r*(.003971-.001529*r)-.013791)-.131979)),s]},EB.invert=pB(qc),DB.invert=pB((function(t){return 2*jc(t)})),OB.invert=function(t,e){return[-e,2*jc(Nc(t))-Pc]},Qu();const PB={},RB=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function BB(t,e){t&&S(t)||Cm("Projection type must be a name string.");const i=t.toLowerCase();return arguments.length>1&&(PB[i]=function(t,e){return function i(){const s=e();return s.type=t,s.path=Qu().projection(s),s.copy=s.copy||function(){const t=i();return RB.forEach((e=>{s[e]&&t[e](s[e]())})),t.path.pointRadius(s.path.pointRadius()),t},s}}(i,e)),PB[i]||null}const IB={albers:cB,albersusa:function(){var t,e,i,s,n,r,a=cB(),o=dB().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=dB().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){r=[t,e]}};function d(t){var e=t[0],a=t[1];return r=null,i.point(e,a),r||(s.point(e,a),r)||(n.point(e,a),r)}function c(){return t=e=null,d}return d.invert=function(t){var e=a.scale(),i=a.translate(),s=(t[0]-i[0])/e,n=(t[1]-i[1])/e;return(n>=.12&&n<.234&&s>=-.425&&s<-.214?o:n>=.166&&n<.234&&s>=-.214&&s<-.115?l:a).invert(t)},d.stream=function(i){return t&&e===i?t:(s=[a.stream(e=i),o.stream(i),l.stream(i)],n=s.length,t={point:function(t,e){for(var i=-1;++i2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}};Object.keys(IB).forEach((t=>{BB(t,IB[t])}));const FB="Feature",YB="FeatureCollection";const jB=RB.concat(["pointRadius","fit","extent","size"]);function HB(t,e){let i=[];return t?(Object.keys(t).forEach((s=>{jB.includes(s)&&(i=i.concat(Wp(t[s],e)))})),i):i}class zB extends Qp{constructor(t){super(t),this.grammarType="projection"}parse(t){return super.parse(t),this.pointRadius(t.pointRadius),this.size(t.size),this.extent(t.extent),this.fit(t.fit),this.configure(t),this.commit(),this}pointRadius(t){return D(this.spec.pointRadius)||this.detach(Wp(this.spec.pointRadius,this.view)),this.spec.pointRadius=t,this.attach(Wp(t,this.view)),this.commit(),this}size(t){return D(this.spec.size)||this.detach(Wp(this.spec.size,this.view)),this.spec.size=t,this.attach(Wp(t,this.view)),this.commit(),this}extent(t){return D(this.spec.extent)||this.detach(Wp(this.spec.extent,this.view)),this.spec.extent=t,this.attach(Wp(t,this.view)),this.commit(),this}fit(t){return D(this.spec.fit)||this.detach(Wp(this.spec.fit,this.view)),this.spec.fit=t,this.attach(Wp(t,this.view)),this.commit(),this}configure(t){return this.detach(HB(this.spec,this.view)),D(t)?this.spec={type:this.spec.type,fit:this.spec.fit,extent:this.spec.extent,size:this.spec.size,pointRadius:this.spec.pointRadius}:(Object.assign(this.spec,t),this.attach(HB(this.spec,this.view))),this.commit(),this}evaluate(t,e){if(this.projection&&this.projection.type===this.spec.type||(this.projection=function(t){const e=BB((t||"mercator").toLowerCase());return e||Cm("Unrecognized projection type: "+t),e()}(this.spec.type),this.projection.type=this.spec.type),RB.forEach((t=>{D(this.spec[t])||function(t,e,i){ws(t[e])&&t[e](i)}(this.projection,t,Up(this.spec[t],e,BB))})),D(this.spec.pointRadius)||this.projection.path.pointRadius(Up(this.spec.pointRadius,e,BB)),!(D(this.spec.fit)||D(this.spec.extent)&&D(this.spec.size))){const t=function(t){const e=Na(t);return 1===e.length?e[0]:{type:YB,features:e.reduce(((t,e)=>t.concat(function(t){return t.type===YB?t.features:Na(t).filter((t=>!D(t))).map((t=>t.type===FB?t:{type:FB,geometry:t}))}(e))),[])}}(Up(this.spec.fit,e,BB));this.spec.extent?this.projection.fitExtent(Up(this.spec.extent,e,BB),t):this.spec.size&&this.projection.fitSize(Up(this.spec.size,e,BB),t)}return this.projection}output(){return this.projection}}const NB=(t,e)=>{if(!e.from||!e.from())return t;const i=e.fields,s=e.key,n=e.values,r=e.default,a=e.as||[i],o=e.from().reduce((function(t,e){return e[i]&&t.set(e[i],e),t}),new Map);let l;if(ws(e.set))l=function(t){const i=o.get(t[s]);e.set(t,i)};else if(n){const t=n.length;l=function(e){const i=o.get(e[s]);if(D(i))for(let i=0;i(l(t),t)))};class VB extends qC{constructor(){super(...arguments),this.type=Sl.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return null===(t=this._mapViewData)||void 0===t?void 0:t.getDataView()}get nameField(){return this._nameField}set nameField(t){this._nameField=t}get valueField(){return this._valueField}set valueField(t){this._valueField=t}getNameProperty(){return this._nameProperty}getCentroidProperty(){return this._centroidProperty}getCoordinateHelper(){return this._coordinateHelper}setCoordinateHelper(t){this._coordinateHelper=t}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){var i;let s=null;if(!t)return s;if(e&&!this.isDatumInViewData(t))return s;const{dataToPosition:n,latitudeField:r,longitudeField:a}=this._coordinateHelper;if(s=this.nameToPosition(t),null===s){const e=a?null==t?void 0:t[a]:Number.NaN,o=r?null==t?void 0:t[r]:Number.NaN;s=null!==(i=null==n?void 0:n([e,o]))&&void 0!==i?i:null}return s}nameToPosition(t){const e=this.getDatumName(t);return D(e)?null:this.nameValueToPosition(e)}nameValueToPosition(t){var e,i;const s=null===(i=null===(e=this.getMapViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.filter((e=>this.getDatumName(e)===t))[0];if(D(s))return null;const{dataToPosition:n}=this._coordinateHelper,r=this.getDatumCenter(s),a=null==n?void 0:n(r);return D(a)||isNaN(a.x)||isNaN(a.y)?null:a}dataToLatitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}valueToPosition(t,e){return{x:this.dataToLongitude(t),y:this.dataToLatitude(e)}}positionToData(t){}latitudeToData(t){}longitudeToData(t){}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}release(){super.release(),this._mapViewData.release(),this._mapViewData=this._mapViewDataStatistics=null}getStackGroupFields(){return[this._nameField]}getStackValueField(){return this._spec.valueField}compileData(){var t;null===(t=this._mapViewData)||void 0===t||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){const t=`${hh}_series_${this.id}_mapViewDataStatic`;this._mapViewDataStatistics=this.createStatisticalData(t,this._mapViewData.getDataView()),this._mapViewData.getDataView().target.removeListener("change",this._mapViewDataStatistics.reRunAllTransform)}}getSeriesKeys(){var t,e,i,s,n;return this._seriesField?null!==(n=null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:null===(s=null===(i=this._mapViewDataStatistics)||void 0===i?void 0:i.latestData[this._seriesField])||void 0===s?void 0:s.values)&&void 0!==n?n:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),null===(t=this._mapViewData.getDataView())||void 0===t||t.reRunAllTransform(),null===(e=this._mapViewDataStatistics)||void 0===e||e.reRunAllTransform()}getActiveMarks(){return[]}}const WB=`${hh}_MAP_LOOK_UP_KEY`,GB=(t,e)=>(t.features&&t.features.forEach(((t,i)=>{var s;t[bT]=i;const n=null===(s=t.properties)||void 0===s?void 0:s[e.nameProperty];e.nameMap&&e.nameMap[n]?t[WB]=e.nameMap[n]:t[WB]=n})),t.features);class UB extends sL{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)}}}class $B extends yx{constructor(){super(...arguments),this.type=$B.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}$B.type="path";const XB=()=>{Ql.registerMark($B.type,$B),VA()},KB=Object.assign(Object.assign({},_L),{area:{name:"area",type:"path"}});class qB{constructor(t){this.projection=BB(t.type)()}fit(t,e,i){const s={type:"FeatureCollection",features:i};this.projection.fitExtent([t,e],s)}center(t){var e,i;null===(i=null===(e=this.projection)||void 0===e?void 0:e.center)||void 0===i||i.call(e,t)}project(t){var e;return null===(e=this.projection)||void 0===e?void 0:e.call(this,t)}shape(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.path)||void 0===i?void 0:i.call(e,t)}invert(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.invert)||void 0===i?void 0:i.call(e,t)}scale(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.scale();this.projection.scale(t)}}translate(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){const s=this.projection.copy();return null==s?void 0:s.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class ZB{parserScrollEvent(t){return t?!(t.ctrlKey||0===t.deltaY&&0===t.deltaX)&&(t.scrollX=t.deltaX,t.scrollY=t.deltaY,t):t}parserZoomEvent(t){if(!t)return t;const e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}clearZoom(){}clearScroll(){}clearDrag(){}parserDragEvent(){return!0}}class JB{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0,this.pointerId=null}parserDragEvent(t){return!0}parserZoomEvent(t){const e=t.scale;if(0===this._lastScale)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;const i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function QB(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:ZB}:fl(t)||vl(t)?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:JB}:null}const tI={debounce:Kd,throttle:qd};class eI{constructor(){this._isGestureListener=!1}initZoomable(t,e=n["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getChart().getVGrammarView().renderer._gestureController,this._isGestureListener=fl(this._renderMode)||vl(this._renderMode),QB(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return QB(this._renderMode)[t]}_zoomEventDispatch(t,e,i){if(!this._isGestureListener&&!t.event)return;const s=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(s);const{zoomDelta:n,zoomX:r,zoomY:a}=s;if(D(n))return;if(!Nt({x:r,y:a},this._getRegionOrSeriesLayout(e),!1))return;let o={};i&&(o=i({zoomDelta:n,zoomX:r,zoomY:a},s)),this._eventObj.emit("zoom",Object.assign(Object.assign({scale:s.zoomDelta,scaleCenter:{x:s.zoomX,y:s.zoomY}},o),{model:this}))}_getRegionOrSeriesLayout(t){"region"!==t.type&&(t=t.getRegion());const{x:e,y:i,width:s,height:n}=t.layout.getLayout();return{x1:e,y1:i,x2:e+s,y2:i+n}}_bindZoomEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:Vd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:Vd.chart,consume:!1}];l.on(...d,tI[a]((t=>{this._zoomableTrigger.clearZoom()}),o)),l.on(...h,tI[a]((t=>{this._zoomEventDispatch(t,e,i)}),o))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||QB(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||QB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindZoomEventAsRegion(t.event,t,i,s)})):this._bindZoomEventAsRegion(this._eventObj,t,i,s)}))}_scrollEventDispatch(t,e,i){let s=!1;if(!this._isGestureListener&&(!t.event||this._option.disableTriggerEvent))return s;const n=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(n);const{scrollX:r,scrollY:a,canvasX:o,canvasY:l}=n;return D(r)&&D(a)?s:Nt({x:o,y:l},this._getRegionOrSeriesLayout(e),!1)?(i&&(s=i({scrollX:r,scrollY:a},n)),this._eventObj.emit("scroll",{scrollX:r,scrollY:a,model:this}),s):s}_bindScrollEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:Vd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:Vd.chart,consume:!1}];l.on(...d,tI[a]((t=>{this._zoomableTrigger.clearScroll()}),o)),l.on(...h,tI[a]((t=>this._scrollEventDispatch(t,e,i)),o))}initScrollEventOfSeries(t,e,i){QB(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||QB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindScrollEventAsRegion(t.event,t,i,s)})):this._bindScrollEventAsRegion(this._eventObj,t,i,s)}))}_bindDragEventAsRegion(t,e,i,s){t.on(this._getZoomTriggerEvent("start"),{level:Vd.chart},(t=>{if(!t.event)return;const{event:n}=t;Nt({x:n.canvasX,y:n.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(t,i,s)})),t.on("click",{level:Vd.chart},(()=>!this._clickEnable))}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||QB(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,e,i)}))}initDragEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||QB(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&(t.event.on(this._getZoomTriggerEvent("start"),{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,i)})),t.event.on("click",{level:Vd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>!this._clickEnable)))})):this._bindDragEventAsRegion(this._eventObj,t,i,s)}))}_handleDrag(t,e,i){var s,n,r;if(this._option.disableTriggerEvent)return;if(this._clickEnable=!1,!this._zoomableTrigger.parserDragEvent(t.event))return;const a=null!==(s=null==i?void 0:i.delayType)&&void 0!==s?s:"throttle",o=null!==(n=null==i?void 0:i.delayTime)&&void 0!==n?n:0,l=null===(r=null==i?void 0:i.realTime)||void 0===r||r,h=this._getZoomTriggerEvent("move"),d=this._getZoomTriggerEvent("end"),c=t.event;let u=c.canvasX,p=c.canvasY,g=c.canvasX,m=c.canvasY;const _=tI[a]((t=>{this._clickEnable=!0;const i=t.event,s=[i.canvasX-g,i.canvasY-m];g=i.canvasX,m=i.canvasY,!l&&e&&e(s,t.event),this._eventObj.emit("panend",{delta:s,model:this}),this._zoomableTrigger.pointerId=null,this._eventObj.off(h,{level:Vd.chart,source:Nd.chart},f),this._eventObj.off(d,{level:Vd.chart,source:Nd.window},_),this._eventObj.allow(d)}),o),f=tI[a]((t=>{if(!this._zoomableTrigger.parserDragEvent(t.event))return;this._clickEnable=!1,this._eventObj.prevent(d,_);const i=t.event,s=[i.canvasX-u,i.canvasY-p];u=i.canvasX,p=i.canvasY,l&&e&&e(s,t.event),this._eventObj.emit("panmove",{delta:s,model:this})}),o);this._eventObj.on(h,{level:Vd.chart,source:Nd.chart},f),this._eventObj.on(d,{level:Vd.chart,source:Nd.chart},_)}}function iI(t,e){return`${hh}_${e}_${t}`}class sI extends aD{constructor(){super(...arguments),this.type=r.geoCoordinate,this.name=r.geoCoordinate,this.layoutType="none",this.layoutZIndex=Dy.Mark,this._projectionSpec={name:iI(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,s,n,r,a,o;let l=t.zoomDelta;const h=this._actualScale;return this._actualScale*=l,this._actualScale<(null===(i=this._spec.zoomLimit)||void 0===i?void 0:i.min)?(this._actualScale=null===(s=this._spec.zoomLimit)||void 0===s?void 0:s.min,l=(null===(n=this._spec.zoomLimit)||void 0===n?void 0:n.min)/h):this._actualScale>(null===(r=this._spec.zoomLimit)||void 0===r?void 0:r.max)&&(this._actualScale=null===(a=this._spec.zoomLimit)||void 0===a?void 0:a.max,l=(null===(o=this._spec.zoomLimit)||void 0===o?void 0:o.max)/h),this.zoom(l,[t.zoomX,t.zoomY]),{scale:l,totalScale:this._actualScale}},this.pan=(t=[0,0])=>{var e,i,s;const n=null!==(i=null===(e=this._projection)||void 0===e?void 0:e.translate())&&void 0!==i?i:[0,0];let r=n[0],a=n[1];r+=t[0],a+=t[1],null===(s=this._projection)||void 0===s||s.translate([r,a])}}get longitudeField(){return this._longitudeField}get latitudeField(){return this._latitudeField}get projectionSpec(){return this._projectionSpec}setProjection(t){this._projectionSpec=Object.assign(Object.assign({},t),{name:this._projectionSpec.name})}getZoom(){return this._actualScale}static getSpecInfo(t){if(D(t))return null;const e=[];return t.region.forEach(((t,i)=>{if("geo"===t.coordinate){const s=Object.assign(Object.assign({},t),{padding:0});e.push({spec:s,regionIndex:i,type:r.geoCoordinate,specInfoPath:["component","geoCoordinate",i]})}})),e}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this._spec.roam&&this.initZoomable(this.event,this._option.mode),this._projectionSpec=Pl(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>(null===(t=this._spec.zoomLimit)||void 0===t?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<(null===(e=this._spec.zoomLimit)||void 0===e?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=null!==(i=this._projectionSpec.zoom)&&void 0!==i?i:1,this._initialScale=this._actualScale,this._longitudeField=this._spec.longitudeField,this._latitudeField=this._spec.latitudeField}created(){super.created(),this._regions=this._option.getRegionsInIndex([this._option.regionIndex]),this.initProjection(),this.coordinateHelper(),this.initEvent(),this._initCenterCache()}dispatchZoom(t,e){const i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},{scale:s,totalScale:n}=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});1!==s&&this.event.emit("zoom",{scale:s,scaleCenter:i,totalScale:n,model:this})}initEvent(){this.event.on(zd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const{roam:t}=this._spec;t&&(this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),this.initDragEventOfRegions(this._regions,t.blank?null:()=>!0,this.pan),this._regions.forEach((t=>{t.getSeries().forEach((t=>{t.event.on("zoom",(e=>(t.handleZoom(e),!0))),t.event.on("panmove",(e=>(t.handlePan(e),!0)))}))})))}initProjection(){var t;this._projection=new qB(this._projectionSpec),null!==this._projection.projection||null===(t=this._option)||void 0===t||t.onError("unsupported projection type!")}coordinateHelper(){const t={longitudeField:this._longitudeField,latitudeField:this._latitudeField,dataToPosition:this.dataToPosition.bind(this),dataToLongitude:this.dataToLongitude.bind(this),dataToLatitude:this.dataToLatitude.bind(this),shape:this.shape.bind(this),getCoordinateId:()=>this.id};this._regions.forEach((e=>{e.getSeries().forEach((e=>{e.type===Sl.map?e.setCoordinateHelper(t):(e.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.x}return this.dataToLongitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.x}return this.dataToLongitude(t)},getFields:()=>[this._longitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})),e.setYAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.y}return this.dataToLatitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.y}return this.dataToLatitude(t)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))}))}))}onLayoutEnd(t){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());const{width:e,height:i}=this.getLayoutRect(),{translate:s,scale:n,center:r}=this.evaluateProjection([0,0],[e,i]);s&&this._projection.translate(s),n&&this._projection.scale(n),r&&this._projection.center(r),wE(this._regions,(t=>{var e;if(t.type===Sl.map){t.areaPath.clear();const i=null===(e=t.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();i&&i.attribute.postMatrix&&i.setAttributes({postMatrix:new Ot})}})),this._actualScale=this._initialScale,super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}collectFeatures(){const t=[];return this._regions.forEach((e=>{e.getSeries().forEach((e=>{var i,s;e.type===Sl.map&&t.push(...null!==(s=null===(i=e.getMapViewData())||void 0===i?void 0:i.latestData)&&void 0!==s?s:[])}))})),t}dataToPosition(t=[]){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t[0],t[1]]);return{x:null==i?void 0:i[0],y:null==i?void 0:i[1]}}dataToLatitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([0,t]);return null==i?void 0:i[1]}dataToLongitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t,0]);return null==i?void 0:i[0]}zoom(t,e=[0,0]){var i,s,n,r,a,o;let l=null!==(s=null===(i=this._projection)||void 0===i?void 0:i.scale())&&void 0!==s?s:0;const h=null!==(r=null===(n=this._projection)||void 0===n?void 0:n.translate())&&void 0!==r?r:[0,0];let d=h[0],c=h[1];l*=t,d-=(e[0]-d)*(t-1),c-=(e[1]-c)*(t-1),null===(a=this._projection)||void 0===a||a.scale(l),null===(o=this._projection)||void 0===o||o.translate([d,c])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;const s=this._projection.evaluate(t,e,this.collectFeatures());let n=s.translate();const r=s.scale()*this._initialScale,a=null!==(i=this._projectionSpec.center)&&void 0!==i?i:s.invert([e[0]/2,e[1]/2]);return a&&(n=[e[0]/2,e[1]/2]),{translate:n,scale:r,center:a}}_initCenterCache(){this._centerCache||(this._centerCache=new Map),this._regions.forEach((t=>{t.getSeries().forEach((t=>{var e,i;"map"===t.type&&(null!==(i=null===(e=t.getMapViewData())||void 0===e?void 0:e.latestData)&&void 0!==i?i:[]).forEach(((e={})=>{const i=e[t.getDimensionField()[0]]||e[WB],s=t.getDatumCenter(e);i&&M(s)&&this._centerCache.set(i,{x:s[0],y:s[1]})}))}))}))}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["roam","longitudeField","latitudeField","projection","zoomLimit"].some((i=>!Im(null==e?void 0:e[i],t[i])))),i}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}sI.type=r.geoCoordinate,tw(sI,eI);const nI=()=>{Ql.registerComponent(sI.type,sI)};class rI extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class aI extends VB{constructor(){super(...arguments),this.type=Sl.map,this.transformerConstructor=rI,this._areaCache=new Map}getNameMap(){return this._nameMap}get areaPath(){return this._areaCache}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.map=this._spec.map,this._nameMap=this._spec.nameMap,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._spec.nameProperty&&(this._nameProperty=this._spec.nameProperty),this._spec.centroidProperty&&(this._centroidProperty=this._spec.centroidProperty),this.map||null===(t=this._option)||void 0===t||t.onError(`map type '${this.map}' is not specified !`),Dp.get(this.map)||null===(e=this._option)||void 0===e||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),Cp(this._dataSet,"copyDataView",Fp),Cp(this._dataSet,"map",GB),Cp(this._dataSet,"lookup",NB);const i=Dp.get(this.map);i||null===(t=this._option)||void 0===t||t.onError("no valid map data found!");const s=new R(this._dataSet,{name:`map_${this.id}_data`});s.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:zp.copyDataView}).transform({type:"map",options:{nameMap:this._nameMap,nameProperty:this._nameProperty}}).transform({type:"lookup",options:{from:()=>{var t;return null===(t=this._data)||void 0===t?void 0:t.getLatestData()},key:WB,fields:this._nameField,set:(t,e)=>{e&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new lL(this._option,s)}compileData(){var t;super.compileData(),null===(t=this._mapViewData)||void 0===t||t.compile()}initMark(){this._pathMark=this._createMark(aI.mark.area,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0,dataView:this._mapViewData.getDataView(),dataProductId:this._mapViewData.getProductId()},{morph:GC(this._spec,aI.mark.area.name),morphElementKey:this.getDimensionField()[0]})}initMarkStyle(){const t=this._pathMark;t&&(this.setMarkStyle(t,{fill:t=>{var e,i,s,n;return M(t[null!==(e=this._seriesField)&&void 0!==e?e:ST])?(null!==(i=this._option.globalScale.getScale("color"))&&void 0!==i?i:this._getDefaultColorScale()).scale(t[null!==(s=this._seriesField)&&void 0!==s?s:ST]):null===(n=this._spec)||void 0===n?void 0:n.defaultFillColor},path:this.getPath.bind(this)},"normal",Py.Series),t.setPostProcess("fill",(t=>M(t)?t:this._spec.defaultFillColor)),this.setMarkStyle(t,{smoothScale:!0},"normal",Py.Built_In))}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{text:t=>this.getDatumName(t),x:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(zC(null===(t=Ql.getAnimationInKey("fadeInOut"))||void 0===t?void 0:t(),NC("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new UB(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;const i=this._areaCache.get(t[bT]);if(i)return i.shape;const s=null===(e=this._coordinateHelper)||void 0===e?void 0:e.shape(t);return this._areaCache.set(t[bT],{shape:s}),s}onEvaluateEnd(){this._mapViewData.updateData()}getDimensionField(){return[this.nameField]}getMeasureField(){return[this.valueField]}release(){super.release(),this._areaCache.clear(),this._nameMap={},this._mapViewData=null}handleZoom(t){var e,i,s;const{scale:n,scaleCenter:r}=t;if(1===n)return;const a=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new Ot}),a.scale(n,n,r));const o=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();o&&o.evaluate(null,null)}handlePan(t){var e,i,s;const{delta:n}=t;if(0===n[0]&&0===n[1])return;const r=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new Ot}),r.translate(n[0],n[1]));const a=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();a&&a.evaluate(null,null)}getDatumCenter(t){var e,i,s,n;return this._centroidProperty&&(null===(e=t.properties)||void 0===e?void 0:e[this._centroidProperty])?null===(i=t.properties)||void 0===i?void 0:i[this._centroidProperty]:il(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:(null===(s=t.properties)||void 0===s?void 0:s.center)?t.properties.center:(null===(n=t.properties)||void 0===n?void 0:n.centroid)?t.properties.centroid:[Number.NaN,Number.NaN]}getDatumName(t){var e;if(t[this.nameField])return t[this.nameField];const i=null===(e=t.properties)||void 0===e?void 0:e[this._nameProperty];if(i){if(this._spec.nameMap&&this._spec.nameMap[i])return this._spec.nameMap[i];if(this._spec.showDefaultName||!this._spec.nameMap)return i}return""}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._mapViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._mapViewData)||void 0===s||s.updateData()}_getDataIdKey(){return bT}getActiveMarks(){return[this._pathMark]}}aI.type=Sl.map,aI.mark=KB,aI.transformerConstructor=rI;class oI extends pP{_isValidSeries(t){return t===Sl.map}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:t.type,nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,map:t.map,nameProperty:t.nameProperty,centroidProperty:t.centroidProperty,nameMap:t.nameMap,area:t.area,defaultFillColor:t.defaultFillColor,showDefaultName:t.showDefaultName})}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"}));const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class lI extends yP{constructor(){super(...arguments),this.transformerConstructor=oI,this.type="map",this.seriesType=Sl.map}}function hI(t){return function(e){let i;return i=y(t)?t.reduce(((t,e)=>null==t?void 0:t[e]),e):null==e?void 0:e[t],i}}lI.type="map",lI.seriesType=Sl.map,lI.transformerConstructor=oI;class dI extends qC{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=Sh,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(t){return this._angleField=M(t)?Na(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=M(t)?Na(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=Na(t),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(t){return this._radiusScale=t,t}get angleScale(){return this._angleScale}setAngleScale(t){return this._angleScale=t,t}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(t){this._angleAxisHelper=t,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(t){this._radiusAxisHelper=t,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(t,e){if(D(t)||D(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:Number.NaN,y:Number.NaN};const i=this.radiusAxisHelper.dataToPosition(Na(e));if(i<0){if("break"===this._invalidType||"link"===this._invalidType)return{x:Number.NaN,y:Number.NaN};if("zero"===this._invalidType)return this.angleAxisHelper.center()}const s=this.angleAxisHelper.dataToPosition(Na(t));return this.angleAxisHelper.coordToPoint({angle:s,radius:i})}dataToPosition(t,e){return t&&this.angleAxisHelper&&this.radiusAxisHelper?e&&!this.isDatumInViewData(t)?null:this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getDatumPositionValues(t,this._radiusField)):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}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;const i=[];return(null===(t=this.radiusAxisHelper)||void 0===t?void 0:t.getScale)&&this._radiusField.forEach((t=>{const e={key:t,operations:[]};nd(this.radiusAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),(null===(e=this.angleAxisHelper)||void 0===e?void 0:e.getScale)&&this._angleField.forEach((t=>{const e={key:t,operations:[]};nd(this.angleAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),i}setAttrFromSpec(){super.setAttrFromSpec(),M(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),M(this._spec.radius)&&(this._outerRadius=this._spec.radius),M(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){const t=this._angleAxisHelper||this._radiusAxisHelper;if(t)return t.layoutRadius();const{width:e,height:i}=this._region.getLayoutRect();return Math.min(e/2,i/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(zd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e=this._angleAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&ZC(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){const t=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach((e=>{t.push(e)})),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach((e=>{t.push(e)})),t}}function cI(t){return sl(t)?Number.parseFloat(t):0}const uI=(t,e)=>{const{asStartAngle:i,asEndAngle:s,asMiddleAngle:n,asRadian:r,asRatio:a,asQuadrant:o,asK:l,showAllZero:h,supportNegative:d,showEmptyCircle:c}=e,u=e.angleField(),p=e.startAngle(),g=e.endAngle(),m=e.minAngle(),_=t.map((t=>Object.assign({},t)));if(!_||0===_.length)return _;if(!h&&c&&pI(_,u,d))return _;const f=(t,e,a)=>{t[i]=e,t[s]=e+a,t[n]=e+a/2,t[r]=a,t[o]=Dt(e+a/2)};let v=0,y=-1/0,b=!0;for(let t=0;t<_.length;t++){const e=d?Math.abs(cI(_[t][u])):cI(_[t][u]);v+=e,y=Math.max(e,y),b&&0!==e&&(b=!1),_[t][uh]=e}const x=_.map((t=>Number(t[u]))),S=g-p;let M=p,k=S,A=0;const w=function(t,e=2){const i=t.reduce(((t,e)=>t+(isNaN(e)?0:e)),0);if(0===i)return 0;const s=Math.pow(10,e),n=t.map((t=>(isNaN(t)?0:t)/i*s*100)),r=100*s,a=n.map((t=>Math.floor(t)));let o=a.reduce(((t,e)=>t+e),0);const l=n.map(((t,e)=>t-a[e]));for(;ot&&(t=l[i],e=i);++a[e],l[e]=0,++o}return a.map((t=>t/s))}(x);if(_.forEach(((t,e)=>{const i=t[uh],s=v?i/v:0;let n=s*S;n{f(e,p+i*t,t)}))}else{const t=k/A;M=p,_.forEach((e=>{const i=e[r]===m?m:e[uh]*t;f(e,M,i),M+=i}))}if(0!==v&&(_[_.length-1][s]=g),b&&h){const t=S/_.length;_.forEach(((e,i)=>{f(e,p+i*t,t)}))}return _},pI=(t,e,i)=>!!D(t)||0===t.length||!!t.every((t=>0===cI(t[e])))||!i&&0===t.reduce(((t,i)=>t+cI(i[e])),0);function gI(t,e,i){return(s,n,r)=>e?"radius"===t.growField?{overall:0}:{overall:t.growFrom(s,n,i)}:{overall:!1}}const mI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",options:gI(t,!0,Np.appear)}),_I={type:"fadeIn"},fI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",easing:"linear",options:gI(t,!0,Np.enter)}),vI=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",easing:"linear",options:gI(t,!0,Np.exit)}),yI=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",options:gI(t,!0,Np.exit)});function bI(t,e){if(!1===e)return{};switch(e){case"fadeIn":return _I;case"growRadius":return mI(Object.assign(Object.assign({},t),{growField:"radius"}));default:return mI(Object.assign(Object.assign({},t),{growField:"angle"}))}}class xI extends yx{constructor(t,e){super(t,e),this.type=SI.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(t,e,i="normal",s,n)=>{var r;return n+(null!==(r=this.getAttribute("radiusOffset",e,i,s))&&void 0!==r?r:0)},this.computeCenter=(t,e,i="normal",s,n)=>Tt({x:0,y:0},this.getAttribute("centerOffset",e,i,s),e[fh])[t]+n,this._computeExChannel.x=this.computeCenter,this._computeExChannel.y=this.computeCenter,this._computeExChannel.outerRadius=this.computeOuterRadius,this._extensionChannel.centerOffset=["x","y"],this._extensionChannel.radiusOffset=["outerRadius"]}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{startAngle:0,endAngle:0,outerRadius:0,innerRadius:0,cornerRadius:0,lineWidth:0,innerPadding:0,outerPadding:0})}}class SI extends xI{constructor(){super(...arguments),this.type=SI.type}}SI.type="arc";const MI=()=>{Mx(),Gx(),fc.registerGraphic(Qd.arc,wx),RA("arc",IA),FC(),Ql.registerMark(SI.type,SI)},kI=Object.assign(Object.assign({},_L),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),AI=Object.assign(Object.assign({},_L),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class wI extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const i=this._getDefaultSpecFromChart(e);s=Pl({},this._theme,i,t);const n=(t,e)=>Pl({},"inside"===t||"inside-center"===t?this._theme.innerLabel:this._theme.outerLabel,e);y(s.label)?s.label=s.label.map((t=>n(t.position,t))):s.label=n(s.label.position,s.label)}return{spec:s,theme:i}}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{centerX:s,centerY:n}=t;return M(s)&&(i.centerX=s),M(n)&&(i.centerY=n),Object.keys(i).length>0?i:void 0}}const TI=`${hh}_LABEL_VISIBLE`,LI=(t,e,i,s)=>{const n=t();if(h(n))return n;if(ws(n))return n(e(),i());const r=e();if("auto"===n&&r.width>0&&r.height>0){const{startAngle:t=0,endAngle:e=2*Math.PI}=s();return function(t,e,i,s){const{x:n,y:r}=e,a=function(t,e){const i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const s=Et(Math.min(t,e)),n=s+i,r=[s,n];let a=Math.floor(s/Math.PI)*Math.PI/2;for(;as&&r.push(a),a+=Math.PI/2;return r}(i,s),{width:o,height:l}=t,h=[];return a.forEach((t=>{const e=Math.sin(t),i=Math.cos(t);1===e?h.push(l-r):-1===e?h.push(r):1===i?h.push(o-n):-1===i?h.push(n):(e>0?h.push(Math.abs((l-r)/e)):h.push(Math.abs(r/e)),i>0?h.push(Math.abs((o-n)/i)):h.push(Math.abs(n/i)))})),Math.min.apply(null,h)}(r,i(),t,e)}return Math.min(r.width/2,r.height/2)};class CI extends dI{constructor(){super(...arguments),this.transformerConstructor=wI,this._pieMarkName="pie",this._pieMarkType="arc",this.getCenter=()=>{var t,e;const i=this._region.getLayoutRect();return{x:ol(null===(t=this._spec)||void 0===t?void 0:t.centerX,i.width,i,i.width/2),y:ol(null===(e=this._spec)||void 0===e?void 0:e.centerY,i.height,i,i.height/2)}},this._startAngle=bh,this._endAngle=xh,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=t=>{const e=t[fh];if(D(e))return null;const i=this.computeDatumRadius(t),s=this.computeDatumInnerRadius(t);return Tt(this.computeCenter(t),(i+s)/2,e)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.getCenter().x,y:()=>this.getCenter().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}setAttrFromSpec(){var t,e,i,s,n,r;super.setAttrFromSpec(),this._centerOffset=null!==(t=this._spec.centerOffset)&&void 0!==t?t:0,this._cornerRadius=null!==(e=this._spec.cornerRadius)&&void 0!==e?e:0;const a=function(t,e){let i=0,s=2*Math.PI;const n=M(t),r=M(e);for(n||r?r?n?(i=t,s=e):(i=e-2*Math.PI,s=e):(i=t,s=t+2*Math.PI):(i=0,s=2*Math.PI);s<=i;)s+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI,s-=2*Math.PI;for(;s<0;)i+=2*Math.PI,s+=2*Math.PI;return{startAngle:i,endAngle:s}}(M(this._spec.startAngle)?At(this._spec.startAngle):this._startAngle,M(this._spec.endAngle)?At(this._spec.endAngle):this._endAngle);this._startAngle=a.startAngle,this._endAngle=a.endAngle,this._padAngle=M(this._spec.padAngle)?At(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[],this._showEmptyCircle=null!==(s=null===(i=this._spec.emptyPlaceholder)||void 0===i?void 0:i.showEmptyCircle)&&void 0!==s&&s,this._showAllZero=null!==(n=this._spec.showAllZero)&&void 0!==n&&n,this._supportNegative=null!==(r=this._spec.supportNegative)&&void 0!==r&&r}initData(){super.initData();const t=this.getViewData();if(!t)return;Cp(this._dataSet,"pie",uI),t.transform({type:"pie",options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>M(this._spec.minAngle)?At(this._spec.minAngle):0,asStartAngle:gh,asEndAngle:mh,asRatio:ph,asMiddleAngle:fh,asRadian:yh,asQuadrant:vh,asK:_h,showAllZero:this._showAllZero,supportNegative:this._supportNegative,showEmptyCircle:this._showEmptyCircle}},!1);const e=new R(this._dataSet,{name:`${hh}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new lL(this._option,e)}compileData(){var t;super.compileData(),null===(t=this._viewDataLabel)||void 0===t||t.compile()}initMark(){var t,e;this._pieMark=this._createMark(Object.assign(Object.assign({},CI.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{key:xT,groupKey:this._seriesField,skipBeforeLayouted:!0,isSeriesMark:!0,stateSort:null===(t=this._spec.pie)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.pie)||void 0===e?void 0:e.customShape,morph:GC(this._spec,this._pieMarkName),morphElementKey:this._seriesField}),this._showEmptyCircle&&(this._emptyArcMark=this._createMark({name:"emptyCircle",type:"arc"},{dataView:!1}))}startAngleScale(t){return hI(gh)(t)}endAngleScale(t){return hI(mh)(t)}_computeLayoutRadius(){return LI((()=>this._spec.layoutRadius),this.getLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}initMarkStyle(){const t={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:lx(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:lx(this._innerRadius)?this._innerRadius:()=>this._computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this._computeLayoutRadius()*this._cornerRadius,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),padAngle:this._padAngle,centerOffset:this._centerOffset},e=this._pieMark;e&&this.setMarkStyle(e,t,"normal",Py.Series);const i=this._emptyArcMark;i&&this.setMarkStyle(i,Object.assign(Object.assign({},t),{visible:()=>{const t=this.getAngleField()[0];return pI(this.getViewData().latestData,t,this._supportNegative)}}),"normal",Py.Series)}initInteraction(){this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e,i){if(super.initMarkStyleWithSpec(t,e,i),t.name===this._pieMarkName){const e=this.getSpec()[t.name];if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,Py.User_Mark)}"emptyCircle"===t.name&&this.setMarkStyle(t,this.generateRadiusStyle(e.style),"normal",Py.User_Mark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{visible:hI(TI).bind(this),text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark()}initEvent(){var t;super.initEvent(),null===(t=this._viewDataLabel.getDataView())||void 0===t||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(t){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd(t)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(zd.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),t.cornerRadius&&(e.cornerRadius=()=>this._computeLayoutRadius()*t.cornerRadius),e}computeCenter(t){return{x:this._pieMark.getAttribute("x",t,"normal"),y:this._pieMark.getAttribute("y",t,"normal")}}getRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.outerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.outerRadius;return null!=l?l:this._outerRadius}getInnerRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.innerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.innerRadius;return null!=l?l:this._innerRadius}computeRadius(t,e){return this._computeLayoutRadius()*t*(D(e)?1:e)+this._centerOffset}computeDatumRadius(t,e){return this._computeLayoutRadius()*this.getRadius(e)+this._centerOffset}_compareSpec(t,e,i){i=null!=i?i:{data:!0};const s=["centerX","centerY","centerOffset","radius","innerRadius","cornerRadius","startAngle","endAngle","padAngle"];s.forEach((t=>{i[t]=!0}));const n=super._compareSpec(t,e,i);return t=null!=t?t:{},s.some((i=>t[i]!==e[i]))&&(n.reRender=!0,n.change=!0),n}computeDatumInnerRadius(t,e){return this._computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t,e){const i=t[fh];if(D(i))return null;if(e&&!this.isDatumInViewData(t))return null;const s=this.computeDatumRadius(t);return Tt(this.computeCenter(t),s,i)}initAnimation(){var t,e,i;const s={growFrom:(t,e,i)=>{var s;if(i===Np.appear)return this._startAngle;if(i===Np.disappear)return this._endAngle;const n=[Np.disappear,Np.exit],r=e.mark.elements,a=null==t?void 0:t[bT];if(void 0===r.find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[bT]){var e;return(null===(e=t.data[0])||void 0===e?void 0:e[bT])>a})))return this._endAngle;const o=[...r].reverse().find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[bT])t.getAttribute("x",e),to:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[fh]).x},y:{from:e=>t.getAttribute("y",e),to:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[fh]).y}}}},{duration:o,effects:{easing:l,channel:{x:{to:e=>t.getAttribute("x",e),from:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[fh]).x},y:{to:e=>t.getAttribute("y",e),from:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[fh]).y}}}}]}}(this._pieMark,t.normal)),this._pieMark.setAnimationConfig(t)}if(this._emptyArcMark){const t=zC(null===(i=Ql.getAnimationInKey("emptyCircle"))||void 0===i?void 0:i(s,null!=n?n:"fadeIn"));this._emptyArcMark.setAnimationConfig(t)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}CI.transformerConstructor=wI,CI.mark=kI;class EI extends CI{constructor(){super(...arguments),this.type=Sl.pie}}EI.type=Sl.pie;class DI extends pP{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Na(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return M(r)&&n.forEach((t=>{D(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:t.radius,outerRadius:t.outerRadius,innerRadius:t.innerRadius,startAngle:t.startAngle,endAngle:t.endAngle,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),y(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class OI extends DI{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.seriesField,valueField:t.valueField||t.angleField,center:t.center,centerOffset:t.centerOffset,cornerRadius:t.cornerRadius,padAngle:t.padAngle,minAngle:t.minAngle,emptyPlaceholder:t.emptyPlaceholder,emptyCircle:null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,showAllZero:t.showAllZero,supportNegative:t.supportNegative,layoutRadius:t.layoutRadius})}}class PI extends yP{constructor(){super(...arguments),this.transformerConstructor=OI}}PI.transformerConstructor=OI;class RI extends PI{constructor(){super(...arguments),this.transformerConstructor=OI,this.type="pie",this.seriesType=Sl.pie}}RI.type="pie",RI.seriesType=Sl.pie,RI.transformerConstructor=OI;class BI extends xI{constructor(){super(...arguments),this.type=BI.type,this._support3d=!0}}BI.type="arc3d";const II=()=>{FC(),Mx(),rS(),fc.registerGraphic(Qd.arc3d,$x),Ql.registerMark(BI.type,BI)};class FI extends wI{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class YI extends CI{constructor(){super(...arguments),this.type=Sl.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=FI}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",Py.Series)}initLabelMarkStyle(t,e={}){if(!t)return;super.initLabelMarkStyle(t);const i={};t.setMarkConfig({support3d:!0}),i.beta=this._angle3d,i.anchor3d=t=>{const{x:e,y:i}=this.getCenter();return[e,i]},i.angle=t=>{const i=t[fh];return"inside"===e.position?wt(i):0},this.setMarkStyle(t,Object.assign(Object.assign({},i),{z:100}),void 0,Py.Mark)}}YI.type=Sl.pie3d,YI.mark=AI,YI.transformerConstructor=FI;class jI extends OI{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class HI extends PI{constructor(){super(...arguments),this.transformerConstructor=jI,this.type="pie3d",this.seriesType=Sl.pie3d}}HI.type="pie3d",HI.seriesType=Sl.pie3d,HI.transformerConstructor=jI;const zI=t=>{const e="angle"===t.growField?0:t.innerRadius;return"angle"===t.growField?{type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}:{channel:{innerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.innerRadius}},outerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.outerRadius}}}}},NI={type:"fadeIn"},VI=t=>({type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}),WI=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"}),GI=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"});function UI(t,e){if(!1===e)return{};switch(e){case"fadeIn":return NI;case"growAngle":return zI(Object.assign(Object.assign({},t),{growField:"angle"}));default:return zI(Object.assign(Object.assign({},t),{growField:"radius"}))}}class $I extends dI{getStackGroupFields(){return this._angleField}getStackValueField(){return Na(this._spec.valueField)[0]||Na(this._spec.radiusField)[0]}getGroupFields(){return this._angleField}setAttrFromSpec(){super.setAttrFromSpec(),this.setAngleField(this._spec.categoryField||this._spec.angleField),this.setRadiusField(this._spec.valueField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice(),this.setInnerRadiusField(this._spec.valueField||this._spec.radiusField),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(wT),this.setInnerRadiusField(AT)}setValueFieldToPercent(){this.setRadiusField(LT),this.setInnerRadiusField(TT)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}const XI=Object.assign(Object.assign({},_L),{rose:{name:"rose",type:"arc"}});class KI extends KC{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}var qI=function(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{if(!function(t){const e=null==t?void 0:t.orient;return"angle"===e||"radius"===e}(i))return;const{axisType:d,componentName:c,startAngle:u,endAngle:p,center:g,outerRadius:m,layoutRadius:_}=((t,e)=>{var i,s,n,a,o,l;const h=null!==(i=t.type)&&void 0!==i?i:"angle"===t.orient?"band":"linear",d=`${r.polarAxis}-${h}`,c=null!==(s=t.startAngle)&&void 0!==s?s:e.startAngle,u=null!==(n=t.endAngle)&&void 0!==n?n:e.endAngle;return{axisType:h,componentName:d,startAngle:null!=c?c:-90,endAngle:null!=u?u:M(c)?c+360:270,center:M(e.center)?e.center:M(null==e?void 0:e.centerX)||M(null==e?void 0:e.centerY)?{x:null==e?void 0:e.centerX,y:null==e?void 0:e.centerY}:void 0,outerRadius:null!==(l=null!==(o=null!==(a=t.outerRadius)&&void 0!==a?a:t.radius)&&void 0!==o?o:e.outerRadius)&&void 0!==l?l:e.radius,layoutRadius:e.layoutRadius}})(i,t);i.center=g,i.startAngle=u,i.endAngle=p,i.outerRadius=m,i.type=d,i.layoutRadius=_;const f={spec:i,specPath:e?[this.specKey,h]:[this.specKey],specInfoPath:["component",this.specKey,h],type:c};s.push(f),"radius"===i.orient?(o.push(f),a=h):(l.push(f),n=h)})),o.forEach((t=>{t.angleAxisIndex=n})),l.forEach((t=>{t.radiusAxisIndex=a})),s}static createComponent(t,e){const{spec:i}=t,s=qI(t,["spec"]),n=Ql.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}constructor(t,e){super(t,e),this.type=r.polarAxis,this.name=r.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=Dy.Axis,this._tick=void 0,this._center=null,this._startAngle=bh,this._endAngle=xh,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),wE(this._regions,(t=>{"radius"===this.getOrient()?tD(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.radiusAxisHelper=this.axisHelper()):tD(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;const i=null===(e=this.getRegions())||void 0===e?void 0:e[0];return i?i.getLayoutStartPoint():t},this.getCenter=()=>{var t,e;const i=this.getRefLayoutRect(),{width:s,height:n}=i;return{x:ol(null===(t=this._center)||void 0===t?void 0:t.x,s,i,s/2),y:ol(null===(e=this._center)||void 0===e?void 0:e.y,n,i,n/2)}},this.getRefLayoutRect=()=>this.getRegions()[0].getLayoutRect(),this._coordinateType="polar"}setAttrFromSpec(){super.setAttrFromSpec(),this.visible&&(this._axisStyle=this._getAxisAttributes(),this._gridStyle=this._getGridAttributes()),this._tick=this._spec.tick,this._orient="angle"===this._spec.orient?"angle":"radius",this._center=this._spec.center,this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._inverse=this._spec.inverse}onRender(t){}changeRegions(){}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimal:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,startAngle:this.startAngle,labelOffset:$E(this._spec),getRadius:()=>this.getOuterRadius(),inside:this._spec.inside})}updateScaleRange(){const t=this._scale.range();let e;return e="radius"===this.getOrient()?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],!(t&&e&&t[0]===e[0]&&t[1]===e[1]||(this._scale.range(e),0))}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:"radius"===this.getOrient()?e.getRadiusField():e.getAngleField(),n}updateSeriesScale(){wE(this._regions,(t=>{"radius"===this.getOrient()?tD(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setRadiusScale(this._scale),t.radiusAxisHelper=this.axisHelper()):tD(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){const e="radius"===this.getOrient()?t.getRadiusField():t.getAngleField();return nd(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:nd(this._scale.type),dataToPosition:this.dataToPosition.bind(this),coordToPoint:this.coordToPoint.bind(this),pointToCoord:this.pointToCoord.bind(this),center:this.getCenter.bind(this),layoutRadius:this._computeLayoutRadius.bind(this),getScale:(t=0)=>this._scales[t],getAxisId:()=>this.id,getSpec:()=>this._spec}}positionToData(t){const e=this.pointToCoord(t);return"radius"===this.getOrient()?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){return Tt(this.getCenter(),t.radius,t.angle)}pointToCoord(t){return Lt(t,this.getCenter(),this._startAngle,this._endAngle)}getOuterRadius(){return this.computeLayoutOuterRadius()}getInnerRadius(){return this.computeLayoutInnerRadius()}updateLayoutAttribute(){this._visible&&("radius"===this.getOrient()?this._layoutRadiusAxis():this._layoutAngleAxis()),super.updateLayoutAttribute()}_getNormalizedValue(t,e){return 0===e?0:(this.dataToPosition(t)-this._getStartValue())/e}getLabelItems(t){var e;const i=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();return i&&i.length?[i.map((e=>QE(e.value,this._getNormalizedValue([e.value],t))))]:[]}_getStartValue(){return"radius"===this.getOrient()?this.computeLayoutInnerRadius():this._startAngle}_layoutAngleAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this._endAngle-this._startAngle,o=this.getLabelItems(a),l=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:s,radius:n,innerRadius:r,startAngle:this._startAngle,endAngle:this._endAngle,sides:(null===(i=null===(e=null===(t=this._getRelatedAxis(this._option.radiusAxisIndex))||void 0===t?void 0:t.getSpec())||void 0===e?void 0:e.grid)||void 0===i?void 0:i.smooth)?void 0:this.getScale().domain().length}),h=Object.assign(Object.assign({},l),{size:this.getRefLayoutRect(),title:{text:this._spec.title.text||this._dataFieldText},items:o,orient:"angle"});this._spec.grid.visible&&(h.grid=Object.assign({type:"line",smoothLink:!0,items:o[0]},l)),this._update(h)}_layoutRadiusAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this.coordToPoint({angle:this._startAngle,radius:n}),o=this.coordToPoint({angle:this._startAngle,radius:r}),l=xe.distancePP(o,a),h=this.getLabelItems(l),d=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:o,end:a,verticalFactor:-1}),c=Object.assign(Object.assign({},d),{title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"radius"});(null===(t=this._spec.grid)||void 0===t?void 0:t.visible)&&(c.grid=Object.assign({items:h[0],type:(null===(e=this._spec.grid)||void 0===e?void 0:e.smooth)?"circle":"polygon",center:s,closed:!0,sides:null===(i=this._getRelatedAxis(this._option.angleAxisIndex))||void 0===i?void 0:i.getScale().domain().length,startAngle:this._startAngle,endAngle:this._endAngle},d)),this._update(c)}_getRelatedAxis(t){if(M(t))return this._option.getComponentByIndex(this.specKey,t)}_computeLayoutRadius(){return LI((()=>this._spec.layoutRadius),this.getRefLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}computeLayoutOuterRadius(){var t;const e=null!==(t=this._spec.outerRadius)&&void 0!==t?t:this._spec.radius,i=null!=e?e:this.getRefSeriesRadius().outerRadius;return this._computeLayoutRadius()*i}computeLayoutInnerRadius(){var t;const e=null!==(t=this._spec.innerRadius)&&void 0!==t?t:this.getRefSeriesRadius().innerRadius;return this._computeLayoutRadius()*e}getRefSeriesRadius(){let t=Sh,e=0;const i=this.getChart().getSpec();return wE(this.getRegions(),(s=>{const n=s;if(r=n.type,[Sl.rose,Sl.radar,Sl.circularProgress].includes(r)){const{outerRadius:s=i.outerRadius,innerRadius:r=i.innerRadius}=n;il(s)&&(t=s),il(r)&&(e=r)}var r}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){const{grid:e}=t,i=qI(t,["grid"]);this._axisMark.getProduct().encode(Pl({},this._axisStyle,i)),this._gridMark&&this._gridMark.getProduct().encode(Pl({},this._gridStyle,e))}invert(t){var e;if("angle"===this.getOrient()&&"band"===this._scale.type){const i=this._scale.range(),s=i[i.length-1]-i[0],n=.5===(null!==(e=this.getSpec().bandPosition)&&void 0!==e?e:this._defaultBandPosition)?0:this._scale.bandwidth()/2;if(i[0]<0){const e=(t+n+Math.abs(i[0]))%s-Math.abs(i[0]);return this._scale.invert(e)}return this._scale.invert((t+n)%s)}return this._scale.invert(t)}}ZI.type=r.polarAxis,ZI.specKey="axes";const JI=(t,e)=>{const{tickCount:i,forceTickCount:s,tickStep:n,getRadius:r,labelOffset:a,labelGap:o=0,labelStyle:l}=e,h=null==r?void 0:r();if(!h)return BE(t.domain());let d;if(M(n))d=t.stepTicks(n);else if(M(s))d=t.forceTicks(s);else if(M(i)){const e=t.range(),s=Math.abs(e[e.length-1]-e[0]),n=ws(i)?i({axisLength:s,labelStyle:l}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),s=t.range(),n=((t,e,i)=>{var s;const{labelStyle:n,getRadius:r,labelOffset:a,labelFormatter:o,inside:l}=i,h=null==r?void 0:r(),d=null!==(s=n.angle)&&void 0!==s?s:0,c=Qk(n);return e.map((e=>{const i=o?o(e):`${e}`,{width:s,height:r}=c.quickMeasure(i),u=Math.max(s,12),p=Math.max(r,12),g=t.scale(e),m={x:0,y:0};let _=0,f=0;const v={align:n.textAlign,baseline:n.textBaseline},{x:y,y:b}=function(t,e,i,s,n){const r=Tt({x:0,y:0},i,t),a=BD(r,ID(s,r,e,n));return o=a,l=ID(s||1,a,e,n),{x:o.x+l[0],y:o.y+l[1]};var o,l}(g,m,h,a,l);return v.align||(es(y,m.x)?v.baseline||(v.baseline=b>m.y?"top":"bottom"):y>m.x?v.align="left":yMath.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-p)}else d=t.domain();return BE(d)},QI=(t,e,i,s)=>{let n=s;do{let s=!0;n++;let r=0;do{r+n2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&IE(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}};class tF extends ZI{constructor(){super(...arguments),this.type=r.polarBandAxis,this._scale=new ix}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){const t=super.axisHelper();return Object.assign(Object.assign({},t),{getBandwidth:e=>t.getScale(e).bandwidth()})}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,JI),t}transformScaleDomain(){}}tF.type=r.polarBandAxis,tF.specKey="axes",tw(tF,yD);const eF=()=>{RO(),NO(),BO(),VO(),mD(),Ql.registerComponent(tF.type,tF)};class iF extends ZI{constructor(){super(...arguments),this.type=r.polarLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new Zb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,oP),t}}iF.type=r.polarLinearAxis,iF.specKey="axes",tw(iF,nP);const sF=()=>{RO(),NO(),BO(),VO(),mD(),Ql.registerComponent(iF.type,iF)};class nF extends $I{constructor(){super(...arguments),this.type=Sl.rose,this.transformerConstructor=KI,this._roseMark=null,this._labelMark=null}initMark(){this.initRoseMark()}initMarkStyle(){this.initRoseMarkStyle()}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}initRoseMark(){var t,e;this._roseMark=this._createMark(nF.mark.rose,{groupKey:this._seriesField,isSeriesMark:!0,stateSort:null===(t=this._spec.rose)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.rose)||void 0===e?void 0:e.customShape,morph:GC(this._spec,nF.mark.rose.name),morphElementKey:this.getDimensionField()[0]})}getRoseAngle(){var t,e,i;return null!==(i=null===(e=(t=this.angleAxisHelper).getBandwidth)||void 0===e?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))&&void 0!==i?i:.5}startAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}endAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+this.getRoseAngle()-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}initRoseMarkStyle(){const t=this._roseMark;t&&this.setMarkStyle(t,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),fill:this.getColorAttribute(),outerRadius:t=>ox(this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:t=>{var e;if(!this.getStack())return 0;const i=ox(this.radiusAxisHelper.dataToPosition([t[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return i<=Number.MIN_VALUE?this._computeLayoutRadius()*(null!==(e=this._spec.innerRadius)&&void 0!==e?e:0):i}})}initTooltip(){super.initTooltip(),this._roseMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._roseMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:0})}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._roseMark){const t={innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)}};this._roseMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("rose"))||void 0===i?void 0:i(t,s),NC("rose",this._spec,this._markAttributeContext)))}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}nF.type=Sl.rose,nF.mark=XI,nF.transformerConstructor=KI;class rF extends DI{needAxes(){return!0}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.angleField,valueField:t.valueField||t.radiusField})}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class aF extends rF{_getDefaultSeriesSpec(t){var e,i,s;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:null!==(e=t.radius)&&void 0!==e?e:Sh,outerRadius:null!==(i=t.outerRadius)&&void 0!==i?i:Sh,innerRadius:null!==(s=t.innerRadius)&&void 0!==s?s:0,seriesField:t.seriesField,stack:t.stack,percent:t.percent})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&D(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Na(t.crosshair||{}).map((t=>Pl({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}class oF extends yP{constructor(){super(...arguments),this.transformerConstructor=aF,this.type="rose",this.seriesType=Sl.rose}}oF.type="rose",oF.seriesType=Sl.rose,oF.transformerConstructor=aF,tw(oF,SP);class lF extends Rs{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center,this._center&&this._prevCenter||(this.valid=!1)}getEndProps(){return!1===this.valid?{}:Tt(this._center,this._toRadius,this._toAngle)}onBind(){const{angle:t,radius:e}=Lt(this.from,this._prevCenter),{angle:i,radius:s}=Lt(this.to,this._center);il(i*s)||(this.valid=!1),this._fromAngle=il(t)?t:i,this._fromRadius=il(e)?e:s,this._toAngle=i,this._toRadius=s,md(this._fromAngle,this._toAngle)&&md(this._fromRadius,this._toRadius)&&(this.valid=!1)}onUpdate(t,e,i){if(!1===this.valid)return i.x=this.to.x,void(i.y=this.to.y);if(t){const{x:t,y:e}=this.getEndProps();i.x=t,i.y=e,i.center=this._center}else{const{x:t,y:s}=Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*e,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*e},this._fromRadius+(this._toRadius-this._fromRadius)*e,this._fromAngle+(this._toAngle-this._fromAngle)*e);i.x=t,i.y=s}}}class hF extends vA{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center}onUpdate(t,e,i){this.points=this.points.map(((s,n)=>{const r=this.polarPointInterpolation(this.interpolatePoints[n][0],this.interpolatePoints[n][1],e);return t&&(i.center=this._center),r.context=s.context,r})),i.points=this.points}_interpolationSinglePoint(t,e,i){if(!Md(t)&&!Md(e))return e;const s=Lt(t,this._prevCenter),n=Lt(e,this._center);let r=Et(s.angle),a=Et(n.angle);!il(r)&&il(a)&&(r=a),il(r)&&!il(a)&&(a=r);const o=r+(a-r)*i,l=s.radius+(n.radius-s.radius)*i;return Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*i,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*i},l,o)}polarPointInterpolation(t,e,i){const{x:s,y:n}=this._interpolationSinglePoint(t,e,i),{x:r,y:a}=this._interpolationSinglePoint({x:t.x1,y:t.y1},{x:e.x1,y:e.y1},i),o=new be(s,n,r,a);return o.defined=e.defined,o}}const dF=t=>({type:"in"===t?"fadeIn":"fadeOut"});function cF(t,e,i){return"fadeIn"===e?dF(i):((t,e)=>({type:"in"===e?"growPointsIn":"growPointsOut",options:()=>({center:t.center()})}))(t,i)}function uF(t,e,i){return"fadeIn"===e?dF(i):((t,e)=>{const i=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.x},s=(t,e)=>e.getGraphicAttribute("x"),n=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.y},r=(t,e)=>e.getGraphicAttribute("y");return"in"===e?{channel:{x:{from:i,to:s},y:{from:n,to:r}}}:{channel:{x:{from:s,to:i},y:{from:r,to:n}}}})(t,i)}const pF=(t,e)=>({custom:bA,customParameters:(i,s)=>{var n;return{group:s.getGraphicItem(),startAngle:null!==(n=t.startAngle)&&void 0!==n?n:Math.PI/2,orient:"clockwise",center:t.center(),radius:t.radius(),animationType:e}}}),gF=Object.assign(Object.assign(Object.assign({},_L),iE),{area:{name:"area",type:"area"}});class mF extends $I{constructor(){super(...arguments),this.type=Sl.radar,this.transformerConstructor=AE,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},r=!1!==(null===(t=this._spec.area)||void 0===t?void 0:t.visible)&&!1!==(null===(i=null===(e=this._spec.area)||void 0===e?void 0:e.style)||void 0===i?void 0:i.visible),a=null!==(s=this._spec.seriesMark)&&void 0!==s?s:"area";this.initAreaMark(n,r&&"area"===a),this.initLineMark(n,"line"===a||"area"===a&&!r),this.initSymbolMark(n,"point"===a)}initMarkStyle(){this.initAreaMarkStyle(),this.initLineMarkStyle(),this.initSymbolMarkStyle(),[this._lineMark,this._symbolMark,this._areaMark].forEach((t=>{t&&this.setMarkStyle(t,{center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()}})}))}initAreaMark(t,e){var i,s;this._areaMark=this._createMark(mF.mark.area,{groupKey:this._seriesField,isSeriesMark:e,stateSort:null===(i=this._spec.area)||void 0===i?void 0:i.stateSort},Object.assign(Object.assign({},t),{setCustomizedShape:null===(s=this._spec.area)||void 0===s?void 0:s.customShape}))}initAreaMarkStyle(){const t=this._areaMark;t&&(this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),x1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).x:Number.NaN,y1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).y:Number.NaN,fill:this.getColorAttribute(),curveType:eE,closePath:!0},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.event.on(zd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"defined")})))}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._areaMark&&t.add(this._areaMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initAnimation(){var t,e,i,s;const n={center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()},radius:()=>{const t=this.getLayoutRect();return Math.min(t.width,t.height)},startAngle:M(this._spec.startAngle)?At(this._spec.startAngle):bh},r=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===r&&this._rootMark&&this._rootMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("radarGroup"))||void 0===s?void 0:s(n,r),NC("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach((([t,e])=>{if(M(t)){const i=Ql.getAnimationInKey(e);t.setAnimationConfig(zC(null==i?void 0:i(n,r),NC(t.name,this._spec,this._markAttributeContext)))}}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,s,n,r;let a=null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0;return"fill"!==e||a||(e="stroke",a=null!==(r=null===(n=this._seriesMark)||void 0===n?void 0:n.getAttribute(e,t))&&void 0!==r?r:void 0),"stroke"===e&&y(a)?a[0]:a}}}mF.type=Sl.radar,mF.mark=gF,mF.transformerConstructor=AE,tw(mF,sE);class _F extends rF{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,line:t.line,point:t.point,stack:t.stack,percent:t.percent,area:Pl({visible:!1},t.area),seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"area",activePoint:t.activePoint,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Na(t.crosshair||{}).map((t=>Pl({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class fF extends yP{constructor(){super(...arguments),this.transformerConstructor=_F,this.type="radar",this.seriesType=Sl.radar}}fF.type="radar",fF.seriesType=Sl.radar,fF.transformerConstructor=_F,tw(fF,SP);class vF extends pP{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=As(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{$d(e,"trimPadding")&&Pl(e,xy(this.type,t))})),this._transformAxisSpec(t)}}class yF extends yP{constructor(){super(...arguments),this.transformerConstructor=vF,this.type="common"}}yF.type="common",yF.transformerConstructor=vF,tw(yF,SP);class bF extends sL{constructor(){super(...arguments),this.shapeTypeCallback=()=>"square"}enableByType(t){return"mark"===t}getDefaultTitlePattern(t){return{key:"link info",value:"link info"}}getDefaultContentList(){return[{key:"time",value:t=>$T.getInstance().timeFormat("%Y%m%d %H:%M",t.from.split("_")[1])},{key:"type",value:t=>t.action_type},{key:"from",value:t=>t.from},{key:"to",value:t=>t.to}]}}class xF extends yx{constructor(){super(...arguments),this.type=xF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}}xF.type="rule";const SF=()=>{Ql.registerMark(xF.type,xF),GA()},MF=Object.assign(Object.assign({},_L),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),kF=(t,e)=>{const{infoKey:i,fields:s,linkData:n,dotData:r}=e,{fromField:a,toField:o,xField:l,yField:h}=s(),d=n(),c=r(),u={};return c.forEach((t=>{const e={};for(const s in t)s!==i&&(e[s]=t[s]);const s=t[i];null==s||s.forEach((t=>{u[t.node_name]=Object.assign({},e,t)}))})),d.forEach((t=>{var e,i,s,n;t[a+"_xField"]=null===(e=null==u?void 0:u[t[a]])||void 0===e?void 0:e[l],t[a+"_yField"]=null===(i=null==u?void 0:u[t[a]])||void 0===i?void 0:i[h],t[o+"_xField"]=null===(s=null==u?void 0:u[t[o]])||void 0===s?void 0:s[l],t[o+"_yField"]=null===(n=null==u?void 0:u[t[o]])||void 0===n?void 0:n[h]})),d};class AF extends QC{constructor(){super(...arguments),this.type=Sl.link}getFromField(){return this._fromField}setFromField(t){M(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){M(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){M(t)&&(this._dotSeriesSpec=t)}_getDotData(){const t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),Cp(this._option.dataSet,"linkDotInfo",kF),null===(t=this.getViewData())||void 0===t||t.transform({type:"linkDotInfo",options:{infoKey:"dots",fields:()=>({fromField:this._fromField,toField:this._toField,xField:this._dotSeriesSpec.xField,yField:this._dotSeriesSpec.yField}),linkData:()=>this._rawData.latestData,dotData:()=>this._getDotData()},level:zp.linkDotInfo},!1)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFromField(this._spec.fromField),this.setToField(this._spec.toField),this.setDotTypeField(this._spec.dotTypeField),this.setDotSeriesSpec(this._spec.dotSeriesSpec)}initMark(){this._clipMark=this._createMark(AF.mark.group),this._containerMark=this._createMark(AF.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(AF.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(AF.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,s;const n=this._clipMark;n&&(this.setMarkStyle(n,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight},"normal",Py.Series),n.setMarkConfig({interactive:!1,clip:!0}));const r=this._containerMark;r&&(this.setMarkStyle(r,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",Py.Series),r.setMarkConfig({interactive:!1}));const a=this._linkMark;a&&this.setMarkStyle(a,{stroke:this.getColorAttribute(),strokeOpacity:this.dataToOpacity.bind(this),x:this.dataToPositionXFrom.bind(this),y:this.dataToPositionYFrom.bind(this),x1:this.dataToPositionXTo.bind(this),y1:this.dataToPositionYTo.bind(this)},"normal",Py.Series);const o=this._arrowMark;if(o){const n=null!==(s=null===(i=null===(e=null===(t=this._theme)||void 0===t?void 0:t.arrow)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)&&void 0!==s?s:10;this.setMarkStyle(o,{x:this.dataToPositionXTo.bind(this),y:t=>this.dataToPositionArrowYTo(t,n),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:n,symbolType:t=>this.isPositionYFromHigher(t)?"triangleDown":"triangleUp"},"normal",Py.Series)}}afterInitMark(){super.afterInitMark()}dataToPositionXFrom(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:i}=this._yAxisHelper,s=this.isPositionYFromHigher(t)?-e/2:e/2;return i(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})+s}dataToOpacity(t){return this.isPositionXOuterRange(t,this._fromField+"_xField")||this.isPositionXOuterRange(t,this._toField+"_xField")||t[this._fromField]===t[this._toField]?0:1}isPositionYFromHigher(t){return this.dataToPositionYFrom(t)s(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:ST}}initInteraction(){const t=[];this._linkMark&&t.push(this._linkMark),this._arrowMark&&t.push(this._arrowMark),this._parseInteractionConfig(t)}initTooltip(){this._tooltipHelper=new bF(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotInfoData(){var t,e;return null===(e=null!==(t=this._linkMark)&&void 0!==t?t:this._arrowMark)||void 0===e?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}AF.type=Sl.link,AF.mark=MF;class wF extends sL{constructor(){super(...arguments),this.shapeTypeCallback=()=>"square"}enableByType(t){return"mark"===t}getDefaultTitlePattern(t){return{key:"event info",value:"event info"}}getDefaultContentList(){return[{key:t=>t.type,value:t=>t.id},{key:"event_time",value:t=>$T.getInstance().timeFormat("%Y%m%d",t.event_time)},{key:"action_type",value:t=>t.action_type},{key:"children",value:t=>t.children}]}getTooltipData(t,e,i,s,n){var r,a,o,l;const h=super.getTooltipData(t,e,i,s,n),d=null!==(o=null===(a=null===(r=this.spec)||void 0===r?void 0:r[t])||void 0===a?void 0:a.updateContent)&&void 0!==o?o:null===(l=null==e?void 0:e[t])||void 0===l?void 0:l.updateContent;return h&&!d&&(h.updateContent=(t,e,i)=>{const s=[],n=t.filter((t=>"children"===t.key));return n.length>0&&n[0].value.forEach((t=>{let e=!0;for(const i in t)s.push(Object.assign(Object.assign({},n[0]),{shapeType:"circle",hasShape:e,key:i,value:t[i]+""})),e=!1})),t.concat(s)}),h}}const TF=(t,e)=>{var i;const s=(null===(i=t[0])||void 0===i?void 0:i.latestData)?t[0].latestData:t||[],n=[];return s.forEach((t=>{const i={};for(const s in t)s!==e&&(i[s]=t[s]);const s=t[e];null==s||s.forEach((t=>{n.push(Object.assign({},i,t))}))})),n},LF={fill:"#bbb",fillOpacity:.2};class CF extends yx{getTextType(){return this._textType}constructor(t,e){super(t,e),this.type=CF.type,this._textType="text"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}initStyleWithSpec(t,e){super.initStyleWithSpec(t,e),t.textType&&(this._textType=t.textType)}compileEncode(){super.compileEncode(),"rich"===this._textType&&this._product.encodeState("group",{textType:this._textType})}}CF.type="text";const EF=()=>{Ql.registerMark(CF.type,CF),$A(),Mx(),ik(),fc.registerGraphic(Qd.richtext,UM)},DF=Object.assign(Object.assign({},_L),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}});class OF extends QC{constructor(){super(...arguments),this.type=Sl.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){M(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){M(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){M(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){M(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){M(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map((t=>t[this._fieldY[0]])),Cp(this._option.dataSet,"objFlat",TF),Cp(this._option.dataSet,"copyDataView",Fp),Ep(this._option.dataSet,"dataview",b),null===(t=this.getViewData())||void 0===t||t.transform({type:"objFlat",options:"dots",level:zp.dotObjFlat},!1)}getStatisticFields(){return[{key:this._fieldY[0],operations:["values"],customize:this._xDimensionStatisticsDomain}]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setSeriesGroupField(this._spec.seriesGroupField),this.setTitleField(this._spec.titleField),this.setSubTitleField(this._spec.subTitleField),this.setDotTypeField(this._spec.dotTypeField),this.setHighLightSeriesGroup(this._spec.highLightSeriesGroup),this.setGridBackground(Pl(LF,(null===(t=this._spec.grid)||void 0===t?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(OF.mark.group),this._containerMark=this._createMark(OF.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(OF.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(OF.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(OF.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(OF.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(OF.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(OF.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){const t=this._clipMark;t&&(this.setMarkStyle(t,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight},"normal",Py.Series),t.setMarkConfig({interactive:!1,clip:!0}));const e=this._containerMark;e&&(this.setMarkStyle(e,{x:this._spec.leftAppendPadding},"normal",Py.Series),e.setMarkConfig({interactive:!1}));const i=this._gridBackgroundMark;i&&this.setMarkStyle(i,{x:this.getRegionRectLeft.bind(this),x1:this.getRegionRectRight.bind(this),y:this.dataToGridBackgroundPositionY.bind(this),y1:this.dataToGridBackgroundPositionY1.bind(this),fill:this._gridBackground.fill,fillOpacity:this.dataToGridBackgroundOpacity.bind(this)},"normal",Py.Series);const s=this._gridMark;s&&this.setMarkStyle(s,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",Py.Series);const n=this._dotMark;n&&this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",Py.Series);const r=this._titleMark;r&&this.setMarkStyle(r,{fill:this.getColorAttribute(),text:t=>t[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Py.Series);const a=this._subTitleMark;a&&this.setMarkStyle(a,{fill:this.getColorAttribute(),text:t=>t[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Py.Series);const o=this._symbolMark;o&&this.setMarkStyle(o,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",Py.Series)}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})-i(0)/2}dataToGridBackgroundPositionY1(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})+i(0)/2}dataToOpacity(t){var e,i,s,n;if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:r,getScale:a}=this._xAxisHelper;return r(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})a(0).range()[1]?0:null!==(n=null===(s=null===(i=null===(e=this._theme)||void 0===e?void 0:e.dot)||void 0===i?void 0:i.style)||void 0===s?void 0:s.fillOpacity)&&void 0!==n?n:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(t){var e,i;super.onLayoutEnd(t);const s=null!==(i=null===(e=this._spec)||void 0===e?void 0:e.leftAppendPadding)&&void 0!==i?i:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+s},"normal",Py.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._seriesGroupField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:ST}}getDotColorScale(){var t,e,i;const s=this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?null===(i=this.getViewDataStatistics())||void 0===i?void 0:i.latestData[this._seriesField].values:[],n=this._getDataScheme();return(new nx).domain(s).range(n)}getDotColorAttribute(){var t,e,i,s;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this.getDotColorScale(),field:null!==(s=null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesGroupField)&&void 0!==i?i:this._seriesField)&&void 0!==s?s:ST}}initTooltip(){this._tooltipHelper=new wF(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotData(){var t;return null===(t=this._dotMark)||void 0===t?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}OF.type=Sl.dot,OF.mark=DF;class PF extends pP{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Na(e.data)[0];return t instanceof R?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Na(t.data).find(((t,i)=>e.dataId?t instanceof R?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof R?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;super.transformSpec(t);let _=0;const f=[],v=[],y=[],b=[],x=[],S=(this._option.getCompiler().getVGrammarView().width(),this._option.getCompiler().getVGrammarView().height());let M=0;if(null==t?void 0:t.legends){f.push({modelId:`legendRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${_}`);const o=Na(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=hl(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:_,size:l}),M+=l,_++}(null==t?void 0:t.dataZoom)&&(f.push({modelId:`dataZoomRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${_}`),M+=60,_++,this.addPaddingRow(x,_,10),M+=10,_++),M+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(v,f,_,t),_++);const k=t.series.filter((t=>t.type!==Sl.link)).length,A=(S-M-20*k)/k,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(d=null==t?void 0:t.appendPadding)||void 0===d?void 0:d.right)||0;null===(c=null==t?void 0:t.series)||void 0===c||c.forEach((e=>{var i,s;if([Sl.bar,Sl.line,Sl.area,Sl.dot].includes(e.type)){if(f.push({modelId:`${e.type}Row${_}`,col:1,row:_}),f.push({modelId:`axesLeftRow${_}`,col:0,row:_}),v.push({id:`${e.type}Row${_}`,clip:!1}),x.push({index:_,size:(null==e?void 0:e.height)||A}),y.push({orient:"left",id:`axesLeftRow${_}`,type:e.type===Sl.dot?"band":"linear",visible:e.type!==Sl.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:v.length-1}),e.type===Sl.dot){f.push({modelId:`scrollBarRightRow${_}`,col:2,row:_});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||A)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===Sl.dot&&s<1,id:`scrollBarRightRow${_}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:v.length-1,axisId:`axesLeftRow${_}`},Na(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=v.length-1,_++,this.addPaddingRow(x,_,(null==e?void 0:e.padding)||20),_++,e.leftAppendPadding=w,e.type===Sl.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,_,20),_++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===Sl.link){const i=e.dotSeriesIndex+1;f.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[v.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(v,f,_,t),_++);const L={type:"grid",col:4,row:_,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:f};t.layout=L,t.region=v,null===(m=t.axes)||void 0===m||m.push(...y),t.scrollBar=b}}class RF extends yP{constructor(){super(...arguments),this.transformerConstructor=PF,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=function(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);nt.type="linear"))}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{x2Field:null==t?void 0:t.x2Field,y2Field:null==t?void 0:t.y2Field,barMinHeight:null==t?void 0:t.barMinHeight,barBackground:null==t?void 0:t.barBackground})}}class IF extends yP{constructor(){super(...arguments),this.transformerConstructor=BF}}IF.transformerConstructor=BF,tw(IF,SP);class FF extends BF{transformSpec(t){super.transformSpec(t),vy(t)}}class YF extends IF{constructor(){super(...arguments),this.transformerConstructor=FF,this.type="histogram",this.seriesType=Sl.bar}}YF.type="histogram",YF.seriesType=Sl.bar,YF.transformerConstructor=FF;class jF extends IF{constructor(){super(...arguments),this.transformerConstructor=FF,this.type="histogram3d",this.seriesType=Sl.bar3d}}jF.type="histogram3d",jF.seriesType=Sl.bar3d,jF.transformerConstructor=FF;const HF=Object.assign(Object.assign({},_L),{group:{name:"group",type:"group"}});class zF extends dI{constructor(){super(...arguments),this._arcGroupMark=null,this._getAngleValueStart=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?AT:BT],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle);let o;if(M(s)){const t=nb(n,(t=>t.value-s)),e=t>=n.length||s>n[t].value-r/2?Math.min(t,n.length-1):t>0?t-1:void 0;void 0!==e&&(o=this.angleAxisHelper.dataToPosition([n[e].value-r/2]))}return D(o)&&(o=this.angleAxisHelper.dataToPosition([n[0].value-r/2])),o+a}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?wT:this._angleField[0]],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle),o=nb(n,(t=>t.value-s)),l=o>=n.length||s>n[o].value-r/2?Math.min(o,n.length-1):o>0?o-1:void 0;let h;return h=void 0!==l?this.angleAxisHelper.dataToPosition([n[l].value+r/2]):this.angleAxisHelper.dataToPosition([n[0].value-r/2]),h+a}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();const s=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getSpec(),n=null!==(e=this._spec.startAngle)&&void 0!==e?e:null==s?void 0:s.startAngle;this._startAngle=M(n)?At(n):bh;const r=null!==(i=this._spec.endAngle)&&void 0!==i?i:null==s?void 0:s.endAngle;this._endAngle=M(r)?At(r):xh,this.setAngleField(this._spec.valueField||this._spec.angleField),this.setRadiusField(this._spec.categoryField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice()}getStackGroupFields(){return this._radiusField}getStackValueField(){var t;return null===(t=this._angleField)||void 0===t?void 0:t[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){const e=super._convertMarkStyle(t);if(e.fill){const i=t.fill;"conical"!==(null==i?void 0:i.gradient)||M(null==i?void 0:i.startAngle)||M(null==i?void 0:i.endAngle)||(e.fill=Object.assign(Object.assign({},i),{startAngle:this._startAngle,endAngle:this._endAngle}))}return e}_getAngleValueStartWithoutMask(t){if(this.getStack()){const e=ox(this.angleAxisHelper.dataToPosition([t[AT]]),this.angleAxisHelper.getScale(0));if(il(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this.getStack()){const e=ox(this.angleAxisHelper.dataToPosition([t[wT]]),this.angleAxisHelper.getScale(0));if(il(e))return e}return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(zF.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){const t=this._arcGroupMark;t.created(),this.setMarkStyle(t,{x:0,y:0},"normal",Py.Series),this._arcGroupMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0,clipPath:()=>{const t=this._getAngleAxis();if(this._isTickMaskVisible(t)){const{tickMask:e}=this._spec,{angle:i,offsetAngle:s,style:n={}}=e,r=this._getAngleAxisSubTickData(t),{x:a,y:o}=this.angleAxisHelper.center(),l=this._computeLayoutRadius(),h=n;return r.map((({value:t})=>{const e=this.angleAxisHelper.dataToPosition([t])+At(s),n=At(i)/2;return wx(Object.assign(Object.assign({},h),{x:a,y:o,startAngle:e-n,endAngle:e+n,innerRadius:l*this._innerRadius,outerRadius:l*this._outerRadius,fill:!0}))}))}const{width:e,height:i}=this.getLayoutRect();return[qv({width:e,height:i,fill:!0})]}})}_getAngleAxis(){if(!this.angleAxisHelper)return;const t=this.angleAxisHelper.getAxisId();return this._option.getChart().getAllComponents().find((e=>e.id===t))}_getAngleAxisTickData(t){var e;return null===(e=null==t?void 0:t.getTickData())||void 0===e?void 0:e.getLatestData()}_isTickMaskVisible(t){const e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&!1!==i.visible&&(null==e?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;const i=this._getAngleAxisTickData(t),s=[],{subTick:n={},tick:r={}}=null!==(e=null==t?void 0:t.getSpec())&&void 0!==e?e:{},{tickCount:a=4}=n,{alignWithLabel:o}=r;if((null==i?void 0:i.length)>=2){const t=i[1].value-i[0].value;for(let e=0;e({type:"growAngleIn",options:{overall:t.startAngle}}))(t)}const GF=()=>{Ql.registerAnimation("circularProgress",((t,e)=>({appear:WF(t,e),enter:{type:"growAngleIn"},disappear:{type:"growAngleOut"}})))};class UF extends KC{constructor(){super(...arguments),this._supportStack=!0}}class $F extends zF{constructor(){super(...arguments),this.type=Sl.circularProgress,this.transformerConstructor=UF,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){const e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(il(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){const s=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+(null===(i=(e=this.radiusAxisHelper).getBandwidth)||void 0===i?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(il(s))return s}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])+this.radiusAxisHelper.getScale(0).step()}}getStackGroupFields(){return this.getGroupFields()}getGroupFields(){return this._radiusField}initMark(){super.initMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){super.initMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e;return this._progressMark=this._createMark($F.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0,stateSort:null===(t=this._spec.progress)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.progress)||void 0===e?void 0:e.customShape}),this._progressMark}_initProgressMarkStyle(){var t;const e=this._progressMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart,endAngle:this._getAngleValueEnd,innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",Py.Series)}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initTooltip(){super.initTooltip(),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark)}_initTrackMark(){var t,e;return this._trackMark=this._createMark($F.mark.track,{parent:this._arcGroupMark,stateSort:null===(t=this._spec.track)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.track)||void 0===e?void 0:e.customShape}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&this.setMarkStyle(t,{visible:t=>{const e=this.angleAxisHelper.getScale(0).range(),i=Math.min(e[0],e[e.length-1]),s=this._getAngleValueStartWithoutMask(t);return Math.abs(s-i)<=1e-14},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{const t=this.getStack()?AT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[t]:e[0]})},endAngle:()=>{const t=this.getStack()?wT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueEnd({[t]:e[e.length-1]})},innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:100},"normal",Py.Series)}initAnimation(){var t,e,i,s;const n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),NC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),NC("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}$F.type=Sl.circularProgress,$F.mark=NF,$F.transformerConstructor=UF;class XF extends DI{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,categoryField:t.categoryField||t.radiusField,valueField:t.valueField||t.angleField,startAngle:t.startAngle,endAngle:t.endAngle,radius:t.radius,innerRadius:t.innerRadius,centerX:t.centerX,centerY:t.centerY})}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),D(l.type)&&(l.type="linear"),D(o.type)&&(o.type="band");const h=XE(l,{min:0,max:1});D(l.min)&&(l.min=h.min),D(l.max)&&(l.max=h.max),s&&Object.assign(l,Pl({},s,l)),n&&Object.assign(o,Pl({},n,o))}}class KF extends XF{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{cornerRadius:null!==(e=t.cornerRadius)&&void 0!==e?e:0,roundCap:null!==(i=t.roundCap)&&void 0!==i&&i,progress:t.progress,track:t.track,tickMask:t.tickMask})}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}class qF extends yP{constructor(){super(...arguments),this.transformerConstructor=KF,this.type="circularProgress",this.seriesType=Sl.circularProgress}}qF.type="circularProgress",qF.seriesType=Sl.circularProgress,qF.transformerConstructor=KF,tw(qF,SP);const ZF=Object.assign(Object.assign({},HF),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),JF=Object.assign(Object.assign({},_L),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),QF={type:"fadeIn"};class tY extends KC{constructor(){super(...arguments),this._supportStack=!1}}class eY extends sL{enableByType(t){return"dimension"!==t}}class iY extends zF{constructor(){super(...arguments),this.type=Sl.gaugePointer,this.transformerConstructor=tY,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(iY.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},iY.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(iY.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new eY(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return M(this.radiusAxisHelper)&&M(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=Wa(e),s=Ga(e),n=js(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),d=Math.sin(l);return{x:a*h+o*d,y:-(o*h-a*d)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}initInteraction(){this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),NC("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}iY.type=Sl.gaugePointer,iY.mark=JF,iY.transformerConstructor=tY;const sY=()=>{Ql.registerSeries(iY.type,iY),XB(),jP(),Ql.registerAnimation("gaugePointer",((t,e)=>{const i=function(t,e){return"fadeIn"===e?QF:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),eF(),sF()};class nY extends KC{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class rY extends zF{constructor(){super(...arguments),this.type=Sl.gauge,this.transformerConstructor=nY,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=At(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),Cp(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[IT]=t[this._angleField[0]],t[BT]=e>0?i[e-1][IT]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(rY.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(rY.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Kb(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Kb(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueStartWithoutPadAngle(t){return M(t[BT])?this.angleAxisHelper.dataToPosition([t[BT]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[IT]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),NC("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}rY.type=Sl.gauge,rY.mark=ZF,rY.transformerConstructor=nY;class aY extends XF{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{radiusField:t.radiusField,pin:t.pin,pinBackground:t.pinBackground,pointer:t.pointer})}_getDefaultCircularProgressSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:Sl.circularProgress})}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===Sl.gauge||t.type===Sl.circularProgress));D(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(D(a.radiusField)&&D(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),D(a.valueField)&&D(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===Sl.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:Dy.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),D(i.angle.type)&&(i.angle.type="linear"),D(i.radius.type)&&(i.radius.type="linear"),D(i.angle.zIndex)&&(i.angle.zIndex=Dy.Region+50)}}class oY extends yP{constructor(){super(...arguments),this.transformerConstructor=aY,this.type="gauge",this.seriesType=Sl.gaugePointer}}oY.type="gauge",oY.seriesType=Sl.gaugePointer,oY.transformerConstructor=aY;class lY extends pP{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class hY extends yP{constructor(){super(...arguments),this.transformerConstructor=lY,this.type="wordCloud",this.seriesType=Sl.wordCloud}}hY.transformerConstructor=lY;const dY=[0],cY=[20,40],uY=[200,500],pY={shrink:!1,enlarge:!1,fontSizeLimitMin:0},gY=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon","rect"],mY=`${hh}_WORD_CLOUD_TEXT`,_Y=Object.assign(Object.assign({},_L),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"},wordMask:{name:"wordMask",type:"rect"}});class fY extends qC{constructor(){super(...arguments),this._fontSizeRange=[20,20],this._isWordCloudShape=!1,this._dataChange=!0,this.handleMaskCanvasUpdate=(t,e)=>{this._maskCanvas=t},this.getWordColor=t=>t.isFillingWord?(this._fillingColorCallback&&!this._dataChange||(this._fillingColorCallback=this._wordCloudShapeConfig.fillingColorHexField?t=>t[this._wordCloudShapeConfig.fillingColorHexField]:this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField,!0)),this._fillingColorCallback(t)):(this._keyWordColorCallback&&!this._dataChange||(this._keyWordColorCallback=this._spec.colorHexField?t=>t[this._spec.colorHexField]:this.initColorCallback(this._seriesField,!1)),this._keyWordColorCallback(t)),this._calculateFontWeight=t=>{const e=this.getRawDataStatisticsByField(this._valueField,!0);return e.min===e.max?this._fontWeightRange[0]:this._fontWeightRange[0]+(this._fontWeightRange[this._fontWeightRange.length-1]-this._fontWeightRange[0])*(t[this._valueField]-e.min)/(e.max-e.min)}}setValueField(t){M(t)&&(this._valueField=t)}setFontSizeRange(t){M(t)?this._fontSizeRange=t:this._fontSizeRange=cY}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._colorMode=null!==(t=this._spec.colorMode)&&void 0!==t?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=null!==(e=this._spec.fontWeightRange)&&void 0!==e?e:uY,this._rotateAngles=null!==(i=this._spec.rotateAngles)&&void 0!==i?i:dY,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=null!==(s=this._spec.maskShape)&&void 0!==s?s:"circle",this._textField=(null===(n=this._spec.word)||void 0===n?void 0:n.formatMethod)?mY:this._nameField;const r=this._spec.wordCloudConfig;this._wordCloudConfig=Object.assign({drawOutOfBound:"hidden",layoutMode:"default",zoomToFit:pY},this._spec.wordCloudConfig),r&&!D(r.layoutMode)||_l(this._option.mode)||(this._wordCloudConfig.layoutMode="fast"),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:dY,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._isWordCloudShape=!gY.includes(this._maskShape)&&!["fast","grid","cloud"].includes(this._wordCloudConfig.layoutMode),this._defaultFontFamily=this._option.getTheme().fontFamily}initData(){var t,e;super.initData(),null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.target)||void 0===e||e.addListener("change",(()=>{this._dataChange=!0,this.compile()}))}initMark(){var t;(null===(t=this._spec.wordMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(fY.mark.wordMask,{dataView:!1})),this._wordMark=this._createMark(fY.mark.word,{key:xT,groupKey:this._seriesField,isSeriesMark:!0},{morphElementKey:this._seriesField})}initMarkStyle(){this.initMarkStyleOfWord(this._wordMark,this._spec.word,this._spec.colorHexField,this._seriesField),this._maskMark&&this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,background:()=>this._maskCanvas},"normal",Py.Series)}initMarkStyleOfWord(t,e,i,s,n){var r,a;t&&(this.setMarkStyle(t,{text:(null==e?void 0:e.formatMethod)?t=>e.formatMethod(t):t=>t[this._textField],x:t=>t.x,y:t=>t.y,fontSize:t=>t.fontSize,fontStyle:t=>t.fontStyle,angle:t=>t.angle,visible:t=>t.visible},"normal",Py.Series),this.setMarkStyle(t,{fill:null!==(a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:this.getWordColor,fontWeight:t=>t.fontWeight,fontFamily:t=>t.fontFamily},"normal",Py.User_Mark))}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark)}initAnimation(){[this._wordMark].forEach((t=>{var e,i;if(t){const s=null===(i=null===(e=this._spec)||void 0===e?void 0:e.animationAppear)||void 0===i?void 0:i.preset,n={animationConfig:()=>{var e,i;return null===(i=null===(e=t.getAnimationConfig())||void 0===e?void 0:e.appear)||void 0===i?void 0:i[0]}};t.setAnimationConfig(zC(Ql.getAnimationInKey("wordCloud")(n,s),NC("word",this._spec,this._markAttributeContext)))}}))}getWordOrdinalColorScale(t,e){var i,s,n,r,a;const o=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,l=t?null===(i=this.getViewData())||void 0===i?void 0:i.latestData.map((e=>e[t])):[],h=null!==(n=null!=o?o:null===(s=this._option.globalScale.getScale("color"))||void 0===s?void 0:s.range())&&void 0!==n?n:this._getDataScheme();return null===(a=(r=(new nx).domain(l)).range)||void 0===a?void 0:a.call(r,h)}initColorCallback(t,e){var i,s,n,r;if("ordinal"===this._colorMode){const i=this.getWordOrdinalColorScale(t,e);return e=>i.scale(e[null!=t?t:ST])}const a=null!==(i=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)&&void 0!==i?i:this._option.globalScale.getScale("color").range();if(1===a.length)return t=>a[0];if(this._valueField){const t=this.getRawDataStatisticsByField(this._valueField,!0);if(t.min===t.max)return a[0];const e=(new Zb).domain([t.min,t.max]).range(a);return t=>e.scale(t[this._valueField])}const o=(new Zb).domain([0,null!==(r=null===(n=null===(s=this.getViewData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)&&void 0!==r?r:1]).range(a);return t=>o.scale(t[bT])}compile(){super.compile();const{width:t,height:e}=this._region.getLayoutRect();if(!il(t)||!il(e)||!(e>0&&t>0))return;const i=[];this._isWordCloudShape?i.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):i.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.getProduct().transform(i)}_getCommonTransformOptions(){var t,e,i,s,n,r;const{width:a,height:o}=this._region.getLayoutRect(),l=null!==(t=this._spec.word)&&void 0!==t?t:{},h=null!==(e=l.style)&&void 0!==e?e:{};return{size:[a,o],shape:As(this._maskShape)&&"text"===this._maskShape.type&&D(this._maskShape.fontFamily)?Object.assign({fontFamily:null===(i=this._option.getTheme())||void 0===i?void 0:i.fontFamily},this._maskShape):this._maskShape,onUpdateMaskCanvas:this.handleMaskCanvasUpdate,dataIndexKey:xT,text:l.formatMethod?t=>l.formatMethod(t):{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:"auto"===this._fontSizeRange?null:this._fontSizeRange,padding:null!==(n=null===(s=this._spec.word)||void 0===s?void 0:s.padding)&&void 0!==n?n:1,fontFamily:M(this._spec.fontFamilyField)?{field:this._spec.fontFamilyField}:null!==(r=h.fontFamily)&&void 0!==r?r:this._defaultFontFamily,fontWeight:M(this._spec.fontWeightField)?{field:this._spec.fontWeightField}:M(h.fontWeight)?h.fontWeight:M(this._valueField)?this._calculateFontWeight:"normal",fontStyle:M(this._spec.fontStyleField)?{field:this._spec.fontStyleField}:h.fontStyle}}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},this._getCommonTransformOptions()),{layoutType:this._wordCloudConfig.layoutMode,rotate:this._rotateAngles,randomVisible:null===(t=this._spec.random)||void 0===t||t,clip:"clip"===this._wordCloudConfig.drawOutOfBound,shrink:this._wordCloudConfig.zoomToFit.shrink,enlarge:this._wordCloudConfig.zoomToFit.enlarge,minFontSize:this._wordCloudConfig.zoomToFit.fontSizeLimitMin,progressiveTime:this._wordCloudConfig.progressiveTime,progressiveStep:this._wordCloudConfig.progressiveStep,repeatFill:this._wordCloudConfig.zoomToFit.repeat})}_wordCloudShapeTransformOption(){var t,e,i,s,n,r;const a=null!==(e=null===(t=this._spec.fillingWord)||void 0===t?void 0:t.style)&&void 0!==e?e:{},o=null!==(i=this._wordCloudShapeConfig)&&void 0!==i?i:{};return Object.assign(Object.assign(Object.assign({},o),this._getCommonTransformOptions()),{rotateList:this._rotateAngles,fillingRotateList:o.fillingRotateAngles,fillingFontFamily:M(o.fillingFontFamilyField)?{field:o.fillingFontFamilyField}:null!==(s=a.fontFamily)&&void 0!==s?s:this._defaultFontFamily,fillingPadding:null!==(r=null===(n=this._spec.fillingWord)||void 0===n?void 0:n.padding)&&void 0!==r?r:1,fillingFontStyle:M(o.fillingFontStyleField)?{field:o.fillingFontStyleField}:a.fontStyle,fillingFontWeight:M(o.fillingFontWeightField)?{field:o.fillingFontWeightField}:a.fontWeight})}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}dataToPositionZ(t){return null}valueToPosition(t,e){return null}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}onLayoutEnd(t){super.onLayoutEnd(t),this.compile(),this._dataChange=!1}getActiveMarks(){return[this._wordMark]}reInit(){super.reInit(),this._keyWordColorCallback&&(this._keyWordColorCallback=null),this._fillingColorCallback&&(this._fillingColorCallback=null)}}fY.mark=_Y;const vY=t=>({custom:SA,customParameters:(e,i)=>t,easing:"linear",loop:1/0,duration:6e3});function yY(t,e){return!1===e?{}:"fadeIn"===e?{type:"fadeIn"}:(t=>({channel:{fontSize:{from:0}},duration:200,delay:(e,i,s)=>{const n=t.animationConfig(),r=(null==n?void 0:n.duration)||200,a=(null==n?void 0:n.totalTime)||CC.appear.duration,o=s.VGRAMMAR_ANIMATION_PARAMETERS.elementCount;return s.VGRAMMAR_ANIMATION_PARAMETERS.elementIndex*function(t,e,i){return t*i{Ql.registerAnimation("wordCloud",((t,e)=>({appear:yY(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}})))},xY=()=>{Ql.registerAnimation("wordCloud3d",(t=>({appear:vY(t)})))},SY={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:MY,triangle:MY,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 MY(){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))}}function kY(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}const AY=t=>SY[t]?SY[t]():SY.circle();function wY(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}const TY=(t,e)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)";function LY(t){return ws(t)?t:function(){return t}}class CY{constructor(t){var e,i;switch(this.options=E({},CY.defaultOptions,t),ws(this.options.shape)?this.shape=this.options.shape:this.shape=AY(this.options.shape),this.getText=null!==(e=LY(this.options.text))&&void 0!==e?e:t=>t,this.getTextFontWeight=LY(this.options.fontWeight),this.getTextFontSize=LY(this.options.fontSize),this.getTextFontStyle=LY(this.options.fontStyle),this.getTextFontFamily=LY(this.options.fontFamily),this.outputCallback=null!==(i=this.options.outputCallback)&&void 0!==i?i:t=>t,this.options.color){case"random-dark":this.getTextColor=()=>TY(10,50);break;case"random-light":this.getTextColor=()=>TY(50,90);break;default:this.getTextColor=LY(this.options.color)}if(D(this.options.rotate))if(this.options.useRandomRotate){const t=Math.abs(this.options.maxRotation-this.options.minRotation),e=Math.abs(Math.floor(this.options.rotationSteps)),i=Math.min(this.options.maxRotation,this.options.minRotation);this.getTextRotate=()=>0===this.options.rotateRatio||Math.random()>this.options.rotateRatio?0:0===t?i:e>0?i+Math.floor(Math.random()*e)*t/(e-1):i+Math.random()*t}else this.getTextRotate=()=>0;else this.getTextRotate=ws(this.options.rotate)?t=>{var e;return At(null!==(e=this.options.rotate(t))&&void 0!==e?e:0)}:(t,e)=>{const i=Na(this.options.rotate),s=this.options.random?Math.random():wY(e);return At(i[Math.floor(s*i.length)])}}canRepeat(){return!1}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>=((null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1)*this.options.progressiveStep:this.options.progressiveTime>0&&(new Date).getTime()-this.escapeTime>this.options.progressiveTime}progressiveRun(){var t;if(this.options.progressiveStep>0?this.currentStepIndex=(null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndexi)&&(t++,e=0,this.failCount=n?0:this.failCount+1),this.progressiveIndex=t,this.exceedTime())break;t===this.data.length&&this.failCountObject.assign(Object.assign({},t),{isFill:!0})))],this.isTryRepeatFill=!0)}return this.progressiveResult}return this.result}initProgressive(){this.failCount=0,this.progressiveIndex=0,this.options.progressiveStep>0?this.currentStepIndex=-1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.progressiveResult=[]}output(){return this.result?this.outputCallback(this.result):null}progressiveOutput(){return this.progressiveResult?this.outputCallback(this.progressiveResult):null}unfinished(){return this.data&&this.data.length&&!D(this.progressiveIndex)&&this.progressiveIndex[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};class DY extends CY{constructor(t){var e;super(E({},DY.defaultOptions,t)),this.cw=64,this.ch=2048,this._size=[256,256],this._isBoardExpandCompleted=!1,this._placeStatus=0,this._tTemp=null,this._dtTemp=null,this._dy=0,this.cacheMap=new Map,this.options.minFontSize<=DY.defaultOptions.minFontSize&&(this.options.minFontSize=DY.defaultOptions.minFontSize),this.spiral=S(this.options.spiral)?null!==(e=EY[this.options.spiral])&&void 0!==e?e:EY.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=LY(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){const e=this.data[t];if(""===(""+e.text).trim())return!0;const{maxRadius:i,center:s}=kY(this.options.shape,this._size);if(e.x=s[0],e.y=s[1],function(t,e,i,s,n,r){if(e.sprite)return;const a=t.context,o=t.ratio;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,(n<<5)/o,r/o);let l=0,h=0,d=0;const c=i.length;let u,p,g,m,_;for(--s;++s>5<<5,g=~~Math.max(Math.abs(n+r),Math.abs(n-r))}else u=u+31>>5<<5;if(g>d&&(d=g),l+u>=n<<5&&(l=0,h+=d,d=0),h+g>=r)break;a.translate((l+(u>>1))/o,(h+(g>>1))/o),e.angle&&a.rotate(e.angle),a.fillText(e.text,0,0),e.padding&&(a.lineWidth=2*e.padding,a.strokeText(e.text,0,0)),a.restore(),e.width=u,e.height=g,e.xoff=l,e.yoff=h,e.x1=u>>1,e.y1=g>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=u}const f=a.getImageData(0,0,(n<<5)/o,r/o).data,v=[];for(;--s>=0;){if(!(e=i[s]).hasText)continue;for(u=e.width,p=u>>5,g=e.y1-e.y0,m=0;m>5),i=f[(h+_)*(n<<5)+(l+m)<<2]?1<<31-m%32:0;v[e]|=i,t|=i}t?r=_:(e.y0++,g--,_--,h++)}e.y1=e.y0+r,e.sprite=v.slice(0,(e.y1-e.y0)*p)}}(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i))return this.result.push(e),this._bounds?function(t,e){const i=t[0],s=t[1];e.x+e.x0s.x&&(s.x=e.x+e.x1),e.y+e.y1>s.y&&(s.y=e.y+e.y1)}(this._bounds,e):this._bounds=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=this._size[0]>>1,e.y-=this._size[1]>>1,this._tTemp=null,this._dtTemp=null,!0;if(this.updateBoardExpandStatus(e.fontSize),e.hasText&&this.shouldShrinkContinue()){if(1===this._placeStatus){const t=e.fontSize*this._originSize[0]/this.options.minFontSize,i=Math.max(e.width,e.height);if(i<=t)this.expandBoard(this._board,this._bounds,i/this._size[0]);else{if(!this.options.clip)return!0;this.expandBoard(this._board,this._bounds,t/this._size[0])}}else this._placeStatus,this.expandBoard(this._board,this._bounds);return this.updateBoardExpandStatus(e.fontSize),!1}return this._tTemp=null,this._dtTemp=null,!0}layout(t,e){this.initProgressive(),this.result=[],this._size=[e.width,e.height],this.clearCache(),this._originSize=[...this._size];const i=this.getContext($o.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null,t.length,this.result=[];const s=t.map(((t,e)=>({text:this.getText(t),fontFamily:this.getTextFontFamily(t),fontStyle:this.getTextFontStyle(t),fontWeight:this.getTextFontWeight(t),angle:this.getTextRotate(t,e),fontSize:~~this.getTextFontSize(t),padding:this.getTextPadding(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:t,x:0,y:0,width:0,height:0}))).sort((function(t,e){return e.fontSize-t.fontSize}));if(this.originalData=s,this.data=s,this.progressiveRun(),!this.options.clip&&this.options.enlarge&&this._bounds&&this.shrinkBoard(this._bounds),this._bounds&&["cardioid","triangle","triangle-upright"].includes(this.options.shape)){const t=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(t-this._size[1]/2)}return this.result}formatTagItem(t){const e=this._size,i=this.zoomRatio(),s=this.dy(),n=e[0]>>1,r=e[1]>>1,a=t.length,o=[];let l,h;for(let e=0;e=this._size[0]||i.y>=this._size[1])return;const s=Math.min(e.x,this._size[0]-i.x),n=Math.min(e.y,this._size[1]-i.y),r=2*Math.min(s/this._size[0],n/this._size[1]);this._size=this._size.map((t=>t*(1-r)))}expandBoard(t,e,i){const s=this._size[0]*(i||1.1)-this._size[0]>>5;let n=2*s>2?s:2;n%2!=0&&n++;let r=Math.ceil(this._size[1]*(n<<5)/this._size[0]);r%2!=0&&r++;const a=this._size[0],o=this._size[1],l=new Array(n).fill(0),h=new Array(r/2*(n+(a>>5))).fill(0);this.insertZerosToArray(t,o*(a>>5),h.length+n/2);for(let e=o-1;e>0;e--)this.insertZerosToArray(t,e*(a>>5),l.length);this.insertZerosToArray(t,0,h.length+n/2),this._size=[a+(n<<5),o+r],e&&(e[0].x+=(n<<5)/2,e[0].y+=r/2,e[1].x+=(n<<5)/2,e[1].y+=r/2)}insertZerosToArray(t,e,i){const s=Math.floor(i/6e4),n=i%6e4;for(let i=0;i>2);t.width=(this.cw<<5)/i,t.height=this.ch/i;const s=t.getContext("2d");return s.fillStyle=s.strokeStyle="red",s.textAlign="center",{context:s,ratio:i,canvas:t}}place(t,e,i,s){let n=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;const r=this.random()<.5?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,r))return null;const a=e.x,o=e.y,l=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),h=this.spiral(this._size);let d,c,u,p,g=-r;for(this._tTemp=null,this._dtTemp=null;d=h(g+=r);){c=d[0],u=d[1];const h=Math.sqrt(c**2+u**2);let f=Math.atan(u/c);c<0?f+=Math.PI:u<0&&(f=2*Math.PI+f);const v=this.shape(f);if(Math.min(Math.abs(c),Math.abs(u))>=l)break;if(h>=s)n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);else{if(e.x=a+~~(h*v*Math.cos(-f)),e.y=o+~~(h*v*Math.sin(-f)),p=e,this.options.clip)if(this.shouldShrinkContinue()){if(RY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}}else{if(PY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}RY(p,this._size)&&(p=BY(p,this._size))}else if(RY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}if(n=!0,!(i&&(m=p,_=i,!(m.x+m.x1>_[0].x&&m.x+m.x0<_[1].x&&m.y+m.y1>_[0].y&&m.y+m.y0<_[1].y))||i&&OY(p,t,this._size))){const i=p.sprite,s=p.width>>5,n=this._size[0]>>5,r=p.x-(s<<4),a=127&r,o=32-a,l=p.y1-p.y0;let h,d=(p.y+p.y0)*n+(r>>5);for(let e=0;e>>a:0);d+=n}return e.sprite=null,p.sprite=null,!0}}}var m,_;return null!==this._tTemp&&(this._placeStatus=3),!this.shouldShrinkContinue()&&this.setCache(p,r),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){const i=`${t.angle}-${e}`,s=t.x1-t.x0,n=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:s,height:n});const{width:r,height:a}=this.cacheMap.get(i);(s=s&&a>=n}}function OY(t,e,i){const s=i[0]>>5,n=t.sprite,r=t.width>>5,a=t.x-(r<<4),o=127&a,l=32-o,h=t.y1-t.y0;let d,c=(t.y+t.y0)*s+(a>>5);for(let t=0;t>>o:0))&e[c+i])return!0;c+=s}return!1}DY.defaultOptions={enlarge:!1,minFontSize:2,maxSingleWordTryCount:2};const PY=(t,e)=>t.x+t.x0>e[0]||t.y+t.y0>e[0]||t.x+t.x1<0||t.y+t.y1<0,RY=(t,e)=>t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>e[0]||t.y+t.y1>e[1];function BY(t,e){const i=t.sprite,s=t.y1-t.y0,n=t.width>>5;let r=0;const a=[],o=Math.max(-(t.y0+t.y),0),l=Math.min(s+(e[1]-(t.y1+t.y)),s),h=Math.max(-(t.x0+t.x),0)>>5,d=Math.min(n+(e[0]-(t.x1+t.x)>>5)+1,n);for(let t=0;t{if(!t||"#fff"===t)return(t,e,i)=>{const s=t.width;return 0===t.data[e*s*4+4*i+3]||255===t.data[e*s*4+4*i+0]&&255===t.data[e*s*4+4*i+1]&&255===t.data[e*s*4+4*i+2]};const e=$o.createCanvas({width:1,height:1}).getContext("2d",{willReadFrequently:!0});e.fillStyle=t,e.fillRect(0,0,1,1);const i=e.getImageData(0,0,1,1).data;return(t,e,s)=>{const n=t.width;return[0,1,2,3].every((r=>t.data[4*(e*n+s)+r]===i[r]))}},FY=(t,e,i,s)=>{const{backgroundColor:n="#fff"}=t,r=s||$o.createCanvas({width:e,height:i,dpr:1}),a=r.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;a.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return a.fillStyle=n,a.fillRect(0,0,r.width,r.height),"text"===t.type?YY(t,r.width,r.height,a):"geometric"===t.type&&zY(t,r.width,r.height,a),r},YY=(t,e,i,s)=>{const{fontFamily:n="sans-serif",fontWeight:r="normal",fontStyle:a="normal",fontVariant:o="normal",fill:l,text:h,hollow:d}=t;let c=12;s.font=`${a} ${o} ${r} ${c}px ${n}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=null!=l?l:"black";const u=s.measureText(h),p="normal"!==a?1.1:1,g=M(u.actualBoundingBoxRight)&&M(u.actualBoundingBoxLeft)?Math.ceil(p*(Math.abs(u.actualBoundingBoxRight)+Math.abs(u.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(u.width),g,c);if(d&&(s.globalCompositeOperation="xor"),m>e){const t=Math.min(e/m,i/c);s.fillText(h,e/2,i/2),s.scale(t,t)}else c=Math.floor(c*e/m),c=Math.min(c,i),s.font=`${a} ${o} ${r} ${c}px ${n}`,s.fillText(h,Math.floor(e/2),Math.floor(i/2))},jY=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>Tt(t,e,i+r*n)))},HY=(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()},zY=(t,e,i,s)=>{const{fill:n,hollow:r}=t,{center:a,maxRadius:o}=kY(t.shape,[e,i]);s.fillStyle=null!=n?n:"black",r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?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,((t,e,i=0,s)=>{const n=2*Math.PI/s,r=AY("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return Tt(t,l,o)}))})({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)HY(s,jY({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)HY(s,jY({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)HY(s,jY({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)HY(s,jY({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)HY(s,jY({x:l,y:h},o,0,3));else if("star"===t.shape){const t=jY({x:l,y:h},o,-Math.PI/2,5),e=jY({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);HY(s,i)}else s.fillRect(0,0,e,i)};class NY extends CY{constructor(t){super(E({},NY.defaultOptions,t)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,d=this.getTextFontFamily(t),c=document.createElement("canvas"),u=c.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+d;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let m=p+2*g,_=3*g;const f=Math.ceil(m/this.gridSize),v=Math.ceil(_/this.gridSize);m=f*this.gridSize,_=v*this.gridSize;const y=-p/2,b=.4*-g,x=Math.ceil((m*Math.abs(Math.sin(h))+_*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((m*Math.abs(Math.cos(h))+_*Math.abs(Math.sin(h)))/this.gridSize),M=S*this.gridSize,k=x*this.gridSize;c.setAttribute("width",""+M),c.setAttribute("height",""+k),u.scale(1,1),u.translate(M/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+d,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,y,b);const A=u.getImageData(0,0,M,k).data;if(this.exceedTime())return null;const w=[];let T,L=S;const C=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(A[4*((e*this.gridSize+s)*M+(t*this.gridSize+n))+3])return i.push([t,e]),tC[1]&&(C[1]=t),eC[2]&&(C[2]=e))}};for(;L--;)for(T=x;T--;)E(L,T,w);return{datum:t,occupied:w,bounds:C,gw:S,gh:x,fillTextOffsetX:y,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:d,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),$a(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(As(e)){const i=FY(e,t.width,t.height);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n,r=IY(e.backgroundColor);const a=(t,e)=>{let i=this.gridSize;for(;i--;){let a=this.gridSize;for(;a--;)if(n=4,!r(s,e*this.gridSize+i,t*this.gridSize+a))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let o=this.ngx;for(;o--;){this.grid[o]=[];let t=this.ngy;for(;t--;)a(o,t),!1!==this.grid[o][t]&&(this.grid[o][t]=!0)}s=r=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=kY(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}}NY.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class VY extends CY{constructor(t){super(E({},VY.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let s=0,n=this.result.length;si.left+i.width||e.top>i.top+i.height))return!1;var e,i;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=b_(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,d=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();d[0]=Math.floor(d[0]),d[1]=Math.floor(d[1]);const c=t.fontFamily?UY(t.fontFamily):"sans-serif",u=t.fontStyle?UY(t.fontStyle):"normal",p=t.fontWeight?UY(t.fontWeight):"normal",m=t.rotate?UY(t.rotate):0,_=UY(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",v=t.padding?UY(t.padding):1,y=null!==(n=t.shape)&&void 0!==n?n:"square",b=null!==(r=t.shrink)&&void 0!==r&&r,x=null!==(a=t.enlarge)&&void 0!==a&&a,S=null!==(o=t.clip)&&void 0!==o&&o,M=t.minFontSize,k=t.randomVisible,A=t.as?Object.assign(Object.assign({},WY),t.as):WY,w=t.depth_3d,T=t.postProjection;let L=t.fontSize?UY(t.fontSize):14;const C=t.fontSizeRange;if(C&&!h(L)){const t=L,e=XY(KY(t,l),C);L=i=>e(t(i))}let E=DY;"fast"===t.layoutType?E=VY:"grid"===t.layoutType&&(E=NY);const D=new E(Object.assign(Object.assign({},t),{text:_,padding:v,spiral:f,shape:y,rotate:m,fontFamily:c,fontStyle:u,fontWeight:p,fontSize:L,shrink:b,clip:S,enlarge:x,minFontSize:M,random:k,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r0||t.progressiveTime>0?{progressive:D}:D.output()},UY=t=>S(t)||h(t)||ws(t)||y(t)?t:e=>e[t.field],$Y=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),XY=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=$Y(t[0]),n=$Y(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>($Y(t)-r)/(a-r)*(e[1]-e[0])+e[0]},KY=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function qY(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l{fc.registerTransform("wordcloud",{transform:GY,markPhase:"beforeJoin"},!0)};var JY;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(JY||(JY={}));const QY=t=>/^[\u4e00-\u9fa5]+$/.test(t),tj=(t,e)=>{if(D(t))return 0;let i=0;for(const e of t)QY(e)?i+=1:i+=.53;return i};class ej extends Zb{constructor(){super(ob,lb),this.type=ed.Sqrt}clone(){return(new ej).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}function ij(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:d,shapeMaxR:c,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=oj(i);let m=g.slice(0);const _=e.fontSizeShrinkFactor;let f=null,v=1,y=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;ex&&y>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==f&&(f=e,v=y),y*=_,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*_})),m=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===f){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/y})),i.skip=!0,y=v,f=null,m=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-d<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||rj(e,t,r)))return nj(e,t,r),!0}return!1}function nj(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,d=s[1];let c,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t>>l:0);u+=a}}function rj(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,d=n[1];let c,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t>>l:0))&e[u+i])return!0;u+=r}return!1}function aj(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,d=0,c=0,u=0;const p=s;for(--s;++s>5<<5,l=Math.ceil(l),l>c&&(c=l),h+o>=n&&(h=0,d+=c,c=l),d+l>=2048){if(0===d){t.hasText=!1;continue}break}d+l>=u&&(u=d+l),e.translate(h+(o>>1),d+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,d],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let m,_;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,d]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,c,u,p]=[1/0,-1/0,1/0,-1/0];for(_=0;_0){const e=1<<31-m%32;o[a*_+(m>>5)]|=e,mp&&(p=m),t|=e}t&&(_c&&(c=_))}t.bounds={dTop:(r[1]>>1)-l,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function oj(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t>5)]|=e}if(i[0]>s[0]){const t=(1<>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,S(i.shapeUrl)){i.isEmptyPixel=IY();const t=(a=i.shapeUrl)&&(Ms(a)||ks(a)||a.startsWith("{var i;const s=BS({image:a}),n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):(s.successCallback=()=>{var i;if(s){const n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):e(new Error("image load failed"+a))}else e(new Error("image load failed"+a))},s.failCallback=()=>{g.getInstance().error("image 加载失败!",a)})})):null;t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=$o.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const d=(t,e)=>{for(let s=0;s{for(let n=e;na&&d(n,o-1);)--o;for(;ll&&c(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=IY(i.shapeUrl.backgroundColor);const t=FY(i.shapeUrl,e.size[0],e.size[1]);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}var a}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x;const S=this.segmentationInput,M=function(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=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]?e[1]-1:h,d=d<0?0:d>=e[0]?e[0]-1:d,0!==n[h*e[0]+d]||t.isEmptyPixel(s,h,d)||(n[h*e[0]+d]=r,o.push([h,d]))}r++,o=[]}const l={},h={},d={},c={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0};for(let t=0;tc[s][1]&&(c[s][1]=t),ic[s][3]&&(c[s][3]=i),ig.x2&&(g.x2=i),tg.y2&&(g.y2=t)),h[s]=h[s]||0,h[s]++)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);d[t]=[i,s],m.push(...e);const[n,r,a,o]=c[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const _=Object.keys(d).map((t=>({label:t-1,boundary:l[t],area:h[t],center:d[t],maxPoint:c[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const f=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),y=~~Math.max(Math.sqrt((f-g.x1)**2+(v-g.y1)**2),Math.sqrt((f-g.x2)**2+(v-g.y2)**2),Math.sqrt((f-g.x1)**2+(v-g.y2)**2),Math.sqrt((f-g.x2)**2+(v-g.y1)**2)),b=g.width/g.height,x=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:_,labels:n,labelNumber:r-1};return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:y,shapeRatio:b,shapeCenter:[f,v],shapeArea:x});function M(t,i){const s=[[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+s[r][0],o=i+s[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===n[a*e[0]+o])return!0}return!1}}(S);if(!M.segmentation.regions.length)return;const k=this.options,A=this.data,w=k.colorMode||"ordinal",T={getText:gj(k.text),getFontSize:gj(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:w,getColor:k.colorField?gj(k.colorField):gj(k.text),getFillingColor:gj(k.fillingColorField),colorList:k.colorList||("ordinal"===w?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:gj(k.colorHexField),getFontFamily:gj(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:gj(k.padding||1),getFontStyle:gj(k.fontStyle||"normal"),getFontWeight:gj(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?gj(k.fontOpacity):()=>1};cj(A,T,M);const L={size:k.size,ratio:k.ratio||.8,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(t=k.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(e=k.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=k.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=k.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=k.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=k.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=k.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=k.fillingTimes)&&void 0!==o?o:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(l=k.fillingXStep)&&void 0!==l?l:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(h=k.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(c=k.fillingDeltaOpacity)&&void 0!==c?c:.05,getFillingFontFamily:gj(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:gj(k.fillingFontStyle||"normal"),getFillingFontWeight:gj(k.fillingFontWeight||"normal"),getFillingPadding:gj(null!==(u=k.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=k.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=k.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(_=k.minFontSize)&&void 0!==_?_:4,minFillFontSize:null!==(f=k.minFillFontSize)&&void 0!==f?f:2},C=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i{const i=tj(n(e));return i>l?t:t+i}),0)/t.length;let d;if(0===h)d=8;else{const t=.2*s.shapeArea;d=Math.sqrt(e*(t/h))}r=~~d,a=d*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(A,T,L,M);const{getText:E,getFontFamily:D,getFontStyle:O,getFontWeight:P,getPadding:R,getColor:B,getFillingColor:I,getColorHex:F,fontSizeScale:Y,colorScale:j,fillingColorScale:H,getFontOpacity:z,rotateList:N}=T,V=A.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:D(t),fontWeight:P(t),fontStyle:O(t),rotate:N[~~(S.randomGenerator()*N.length)],fontSize:Math.max(L.minInitFontSize,~~Y(t)),opacity:z(t),padding:R(t),color:F&&F(t)||j&&j(B(t))||"black",fillingColor:!I||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&C?void 0:F&&F(t)||H&&H(I(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=Wa(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/W)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:U,failedWords:$}=function(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),at.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?ij(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:d,shapeRatio:c}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=oj(i);let g=p.slice(0);const m=e.fontSizeEnlargeFactor,_=Math.min(r,t.length);let f=0;t.length>_&&(f=t.sort(((t,e)=>e.weight-t.weight))[_-1].weight);let v=0,y=1,b=!1;for(let r=0;r=f&&v++,v>=_&&!b){y*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),g=p.slice(0),M=!0,v=0;break}}else{if(a.weight>=f&&y>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/m})),y/=m,b=!0,g=p.slice(0),M=!0;break}if(a.weight>=f)return ij(t,e,i)}}M&&(r=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;tc?k-c:c,v),A=A>p?A-p:p;return w;function T(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:d}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(d),fontStyle:o(d),fontWeight:l(d),fontSize:e,rotate:g[~~(S()*g.length)],padding:m(d),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:d}}));L(n);let d=0;const{x1:c,y1:u,x2:p,y2:v}=b,[k,A]=[c+~~(S()*r*2),u+~~(S()*a*2)];for(let t=A;t<=v;t+=a)for(let e=k;e<=p;e+=r){aj(x,M,n,d);const i=n[d];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++d===n.length&&(d=0,_&&L(n));continue}const{dTop:l,dBottom:h,dLeft:c,dRight:u}=a;i.x-c<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!rj(i,f,y)&&(nj(i,f,y),w.push(Object.assign({},i)),++d===n.length&&(d=0,_&&L(n)))}}function L(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;et.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}(V,L,M),X=null!==(y=null===(v=k.text)||void 0===v?void 0:v.field)&&void 0!==y?y:"textKey",K=null!==(b=k.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=k.as?Object.assign(Object.assign({},lj),k.as):lj;let Z,J;const Q=[];for(let t=0;t{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=At(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=I?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&C?t.color:t.fillingColor:L.fillingColorList[~~(S.randomGenerator()*L.fillingColorList.length)],n[X]=t.text,n[K]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.view&&this.view.emit){this.view.emit(JY.AFTER_WORDCLOUD_SHAPE_LAYOUT,{successedWords:U,failedWords:$});const t=null===(x=this.view.renderer)||void 0===x?void 0:x.stage();t&&t.hooks.afterRender.tap(JY.AFTER_WORDCLOUD_SHAPE_DRAW,(()=>{this.view.emit(JY.AFTER_WORDCLOUD_SHAPE_DRAW,{successedWords:U,failedWords:$}),t.hooks.afterRender.unTap(JY.AFTER_WORDCLOUD_SHAPE_DRAW)}))}this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const dj=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:d}=e,{sameColorList:c}=i;let u,p,g=e.colorList,m=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new Qb).domain(e).range(g).scale(t),d&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!c)){const e=t.map((t=>d(t)));p=t=>(new Qb).domain(e).range(m).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new Zb).domain(pj(h,t)).range(g);if(u=t=>e.scale(t),d&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!c)){1===m.length&&(m=[m[0],m[0]]);const e=(new Zb).domain(pj(d,t)).range(m);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},cj=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new ej).domain(pj(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&ws(n)&&!s){const e=.5,[o,l]=pj(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),d=uj(h,i,!0);s=[~~(e*d),~~d];const c=(new ej).domain(pj(n,t)).range(s);a=t=>c.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=uj(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},uj=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=tj(e.text);return s{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},gj=t=>t?"string"==typeof t||"number"==typeof t?()=>t:ws(t)?t:e=>e[t.field]:null,mj=(t,e,i,s)=>{if(!t.size||D(t.size[0])||D(t.size[1])||t.size[0]<=0||t.size[1]<=0)return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||Cm("WordcloudShape shape must be specified."),t.text||Cm("WordcloudShape text must be specified."),(null==s?void 0:s.emit)&&s.emit(JY.BEFORE_WORDCLOUD_SHAPE_LAYOUT),!e||0===e.length)return[];const n=new hj(t,s);return n.layout(e),n.unfinished()?{progressive:n}:n.output()},_j=()=>{fc.registerTransform("wordcloudShape",{transform:mj,markPhase:"beforeJoin"},!0)};class fj extends fY{constructor(){super(...arguments),this.type=Sl.wordCloud}}fj.type=Sl.wordCloud;const vj=()=>{ZY(),EF(),bY(),Ql.registerSeries(fj.type,fj)};class yj extends lY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord,wordMask:t.wordMask}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class bj extends hY{constructor(){super(...arguments),this.transformerConstructor=yj,this.type="wordCloud",this.seriesType=Sl.wordCloud}}bj.type="wordCloud",bj.seriesType=Sl.wordCloud,bj.transformerConstructor=yj;class xj extends fY{constructor(){super(...arguments),this.type=Sl.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(fY.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",Py.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getVGrammarView(),s=e.width()-i.left||0-i.right||0,n=e.height()-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r}})),NC("word",this._spec,this._markAttributeContext)))}}xj.type=Sl.wordCloud3d;const Sj=()=>{ZY(),EF(),xY(),Ql.registerSeries(xj.type,xj)};class Mj extends lY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,depth_3d:t.depth_3d,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class kj extends hY{constructor(){super(...arguments),this.transformerConstructor=Mj,this.type="wordCloud3d",this.seriesType=Sl.wordCloud3d}}kj.type="wordCloud3d",kj.seriesType=Sl.wordCloud3d,kj.transformerConstructor=Mj;const Aj=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:d,asLastValueRatio:c,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:m=!1,isCone:_=!0,range:f}=e,v=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),y=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==f?void 0:f.min)&&void 0!==i?i:y,null!==(s=null==f?void 0:f.max)&&void 0!==s?s:v];return n.forEach(((t,e)=>{var i,s;const f=Number.parseFloat(t[r]),v=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),y=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=il(y*f)&&0!==f?y/f:0,S=il(f*v)&&0!==v?f/v:0;u&&(t[u]=v),g&&(t[g]=y),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===m?x:1/n.length),h&&(t[h]=f/b[1]),d&&(t[d]=e===n.length-1?_?0:t[h]:y/b[1]),c&&(t[c]=0===e?1:v/b[1]),p&&(t[p]=f)})),n},wj=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},Tj=`${hh}_FUNNEL_TRANSFORM_RATIO`,Lj=`${hh}_FUNNEL_REACH_RATIO`,Cj=`${hh}_FUNNEL_HEIGHT_RATIO`,Ej=`${hh}_FUNNEL_VALUE_RATIO`,Dj=`${hh}_FUNNEL_LAST_VALUE_RATIO`,Oj=`${hh}_FUNNEL_NEXT_VALUE_RATIO`,Pj=`${hh}_FUNNEL_LAST_VALUE`,Rj=`${hh}_FUNNEL_CURRENT_VALUE`,Bj=`${hh}_FUNNEL_NEXT_VALUE`,Ij=`${hh}_FUNNEL_TRANSFORM_LEVEL`;class Fj extends sL{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"转化率":null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[Lj])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return"转化率";const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return M(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]}}}class Yj extends yx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class jj extends Yj{constructor(){super(...arguments),this.type=jj.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}jj.type="polygon";const Hj=()=>{Ql.registerMark(jj.type,jj),Mx(),yk(),fc.registerGraphic(Qd.polygon,lS),jC()},zj=Object.assign(Object.assign({},_L),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),Nj=Object.assign(Object.assign({},_L),{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 Vj extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class Wj extends qC{constructor(){super(...arguments),this.type=Sl.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=Vj,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;Cp(this._dataSet,"funnel",Aj),Cp(this._dataSet,"funnelTransform",wj);const t=new R(this._dataSet,{name:`${hh}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new lL(this._option,t)}compileData(){var t;super.compileData(),null===(t=this._viewDataTransform)||void 0===t||t.compile()}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:Rj,asTransformRatio:Tj,asReachRatio:Lj,asHeightRatio:Cj,asValueRatio:Ej,asNextValueRatio:Oj,asLastValueRatio:Dj,asLastValue:Pj,asNextValue:Bj,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:Ij}})}initMark(){var t,e,i,s,n,r,a,o,l,h,d,c;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Wj.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,stateSort:null===(e=this._spec.funnel)||void 0===e?void 0:e.stateSort,noSeparateStyle:!0},{setCustomizedShape:null===(i=this._spec.funnel)||void 0===i?void 0:i.customShape,morph:GC(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Wj.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(s=this._theme)||void 0===s?void 0:s.transform,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId(),stateSort:null===(n=this._spec.transform)||void 0===n?void 0:n.stateSort,noSeparateStyle:!0},{setCustomizedShape:null===(r=this._spec.transform)||void 0===r?void 0:r.customShape})),null===(o=null===(a=this._spec)||void 0===a?void 0:a.outerLabel)||void 0===o?void 0:o.visible){const{line:t}=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{},{line:e}=null!==(d=null===(h=this._theme)||void 0===h?void 0:h.outerLabel)&&void 0!==d?d:{};this._funnelOuterLabelMark.label=this._createMark(Wj.mark.outerLabel,{themeSpec:null===(c=this._theme)||void 0===c?void 0:c.outerLabel,markSpec:this._spec.outerLabel,skipBeforeLayouted:!0,noSeparateStyle:!0}),this._funnelOuterLabelMark.line=this._createMark(Wj.mark.outerLabelLine,{themeSpec:e,markSpec:t,depend:[this._funnelOuterLabelMark.label],noSeparateStyle:!0})}}initTooltip(){this._tooltipHelper=new Fj(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){const t=this._funnelMark;t&&this.setMarkStyle(t,{points:t=>this.getPoints(t),visible:t=>M(t[this._valueField]),fill:this.getColorAttribute()},"normal",Py.Series);const e=this._funnelTransformMark;e&&this.setMarkStyle(e,{points:t=>this.getPoints(t)},"normal",Py.Series);const i=this._funnelOuterLabelMark.label;i&&this.setMarkStyle(i,{text:t=>{const e=`${t[this.getCategoryField()]}`;return ws(this._spec.outerLabel.formatMethod)?this._spec.outerLabel.formatMethod(e,t):e},x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t)},"normal",Py.Series);const s=this._funnelOuterLabelMark.line;s&&i&&this.setMarkStyle(s,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",Py.Series)}initLabelMarkStyle(t){var e,i;if(!t)return;const s=t.getTarget(),n=t.getComponent();s===this._funnelMark?(this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",Py.Series),(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(n),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())):this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*hI(Lj).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",Py.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),NC("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(zC(Ql.getAnimationInKey("fadeInOut")(),NC(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(zC(Ql.getAnimationInKey("funnel")({},o),NC(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(zC(null===(a=Ql.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),NC("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[Dj])/2:this._getSecondaryAxisLength(t[Ej])/2,n=this._getSecondaryAxisLength(t[Ej])/2):(s=this._getSecondaryAxisLength(t[Ej])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[Oj])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[Ij])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return M(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}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}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[xT]===t[xT]));if(!M(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),d=this._getMainAxisLength(!0);return l+=i*(h+d),l+=s?-d/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(h(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r,a,o;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const l=this.getPoints(t),h=(Math.abs(l[0].x-l[1].x)+Math.abs(l[2].x-l[3].x))/2,d=this.getCategoryField(),c=null===(r=null===(n=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.getGroupGraphicItem())||void 0===n?void 0:n.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[d])===t[d]}),!0))||void 0===r?void 0:r.AABBBounds,u=c?c.x2-c.x1:0,p=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let g=this.getLayoutRect().width-Math.max(h,u);return"center"===this._funnelAlign&&(g/=2),g-p-(null!==(o=null===(a=this._spec.outerLabel)||void 0===a?void 0:a.spaceWidth)&&void 0!==o?o:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,d,c,u,p;const g=this.getCategoryField(),m=null===(r=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.elements)||void 0===n?void 0:n.find((e=>{var i;return(null===(i=e.data[0])||void 0===i?void 0:i[g])===t[g]})))||void 0===r?void 0:r.getBounds(),_=null===(d=null===(h=null===(l=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getProduct())||void 0===l?void 0:l.getGroupGraphicItem())||void 0===h?void 0:h.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[g])===t[g]}),!0))||void 0===d?void 0:d.AABBBounds,f=null!==(c=this._spec.outerLabel)&&void 0!==c?c:{};let v,y,b,x;if(this._isHorizontal()){const e=null!==(u=f.spaceWidth)&&void 0!==u?u:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(b=this._getPolygonCenter(i).y-s/2-e,x=!1!==f.alignLabel?(null==m?void 0:m.y2)+e:b-e,v=this._getPolygonCenter(i).x,b-x{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class Uj extends yP{constructor(){super(...arguments),this.transformerConstructor=Gj,this.type="funnel",this.seriesType=Sl.funnel}}Uj.type="funnel",Uj.seriesType=Sl.funnel,Uj.transformerConstructor=Gj;class $j extends Yj{constructor(){super(...arguments),this.type=$j.type}}$j.type="pyramid3d";const Xj=()=>{Ql.registerMark($j.type,$j),Mx(),yS(),fc.registerGraphic(Qd.pyramid3d,dS),jC()};class Kj extends Vj{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class qj extends Wj{constructor(){super(...arguments),this.type=Sl.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=Kj}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},qj.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({},qj.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===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(qj.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(qj.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t,depend:[this._funnelOuterLabelMark.label]})}}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",Py.Series)}initLabelMarkStyle(t){var e,i;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",Py.Series),this._labelMark=t,(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(t.getComponent()),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())}}qj.type=Sl.funnel3d,qj.mark=Nj,qj.transformerConstructor=Kj;class Zj extends yP{constructor(){super(...arguments),this.transformerConstructor=Gj,this.type="funnel3d",this.seriesType=Sl.funnel3d}}function Jj(t){return()=>"vertical"===t.direction?{orient:"negative"}:{orient:"positive"}}Zj.type="funnel3d",Zj.seriesType=Sl.funnel3d,Zj.transformerConstructor=Gj;const Qj=t=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:Jj(t)}),tH={type:"fadeIn"};function eH(t,e){return!1===e?{}:"fadeIn"===e?tH:(t=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:Jj(t)}))(t)}class iH extends sL{enableByType(t){return"dimension"!==t}}const sH=Object.assign(Object.assign({},_L),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}});class nH extends QC{constructor(){super(...arguments),this.type=Sl.linearProgress,this._progressMark=null,this._trackMark=null,this._defaultProgressCustomShape=(t,e,i)=>{var s,n;const r=null===(s=this._spec)||void 0===s?void 0:s.cornerRadius,a=M(e.width)?e.width:e.x1-e.x,o=M(e.height)?e.height:e.y1-e.y,l=Math.min(0,a),h=Math.max(0,a),d=Math.min(0,o),c=Math.max(0,o);if(r>0){let t=r;if("vertical"===(null===(n=this._spec)||void 0===n?void 0:n.direction)){if(t=Math.min(Math.abs(a/2),r),2*t>Math.abs(o)){const e=Math.acos((t-Math.abs(o)/2)/t);return i.moveTo(l+t,d),i.arc(l+t,d+t,t,1.5*Math.PI,1.5*Math.PI-e,!0),i.arc(l+t,c-t,t,e+Math.PI/2,Math.PI/2,!0),i.lineTo(h-r,c),i.arc(h-t,c-t,t,Math.PI/2,Math.PI/2-e,!0),i.arc(h-t,d+t,t,-Math.PI/2+e,-Math.PI/2,!0),i.lineTo(l+t,d),i.closePath(),i}}else if(t=Math.min(Math.abs(o/2),r),2*t>Math.abs(a)){const e=Math.acos((t-Math.abs(a)/2)/t);return i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,Math.PI+e),i.arc(h-t,d+t,t,-e,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,e),i.arc(l+t,c-t,t,Math.PI-e,Math.PI),i.closePath(),i}i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,1.5*Math.PI),i.lineTo(h-t,d),i.arc(h-t,d+t,t,-Math.PI/2,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,Math.PI/2),i.lineTo(l+t,c),i.arc(l+t,c-t,t,Math.PI/2,Math.PI),i.closePath()}else i.moveTo(l,d),i.lineTo(h,d),i.lineTo(h,c),i.lineTo(l,c),i.closePath();return i}}initMark(){this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e,i;return this._progressMark=this._createMark(nH.mark.progress,{isSeriesMark:!0,stateSort:null===(t=this._spec.progress)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null!==(i=null===(e=this._spec.progress)||void 0===e?void 0:e.customShape)&&void 0!==i?i:this._defaultProgressCustomShape}),this._progressMark}_initProgressMarkStyle(){var t,e,i,s;const n=this._progressMark;if(n)if("vertical"===this._spec.direction){const i=this._spec.progress||{},s=null!==(t=i.leftPadding)&&void 0!==t?t:0,r=null!==(e=i.rightPadding)&&void 0!==e?e:0;this.setMarkStyle(n,{x:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2+s},y1:t=>{var e,i;return ox(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:()=>{var t;return null===(t=this._yAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},width:this._spec.bandWidth-s-r,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Py.Series)}else{const t=this._spec.progress||{},e=null!==(i=t.topPadding)&&void 0!==i?i:0,r=null!==(s=t.bottomPadding)&&void 0!==s?s:0;this.setMarkStyle(n,{x1:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:t=>{var i,s;return ox(this.dataToPositionY(t),null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0))-this._spec.bandWidth/2+e},height:this._spec.bandWidth-e-r,x:()=>{var t;return null===(t=this._xAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Py.Series)}}_initTrackMark(){var t,e;return this._trackMark=this._createMark(nH.mark.track,{stateSort:null===(t=this._spec.track)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.track)||void 0===e?void 0:e.customShape}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&("vertical"===this._spec.direction?this.setMarkStyle(t,{x:t=>{var e,i;return ox(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",Py.Series):this.setMarkStyle(t,{x:0,y:t=>{var e,i;return ox(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",Py.Series))}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("linearProgress"))||void 0===i?void 0:i(n,r),NC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),NC("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new iH(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}nH.type=Sl.linearProgress,nH.mark=sH;class rH extends gP{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{direction:null!==(e=t.direction)&&void 0!==e?e:"horizontal",cornerRadius:null!==(i=t.cornerRadius)&&void 0!==i?i:0,bandWidth:t.bandWidth,progress:t.progress,track:t.track})}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="band"),D(i.type)&&(i.type="linear");const n=XE(i,{min:0,max:1});D(i.min)&&(i.min=n.min),D(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="linear"),D(e.type)&&(e.type="band");const n=XE(s,{min:0,max:1});D(s.min)&&(s.min=n.min),D(s.max)&&(s.max=n.max)}}}class aH extends yP{constructor(){super(...arguments),this.transformerConstructor=rH,this.type="linearProgress",this.seriesType=Sl.linearProgress}}function oH(t,e,i,s,n,r,a,o,l){t.setMarkStyle(e,{textAlign:t=>{if("vertical"===l())return"center";const e=n(t),s=r(t);if("middle"===i)return"center";if(e>=s){if("start"===i)return"left";if("end"===i)return"right";if("outside"===i)return"left"}else{if("start"===i)return"right";if("end"===i)return"left";if("outside"===i)return"right"}return"center"},textBaseline:t=>{if("horizontal"===l())return"middle";const e=a(t),s=o(t);if("middle"===i)return"middle";if(s>=e){if("start"===i)return"bottom";if("end"===i)return"top";if("outside"===i)return"bottom"}else{if("start"===i)return"top";if("end"===i)return"bottom";if("outside"===i)return"top"}return"middle"}}),t.setMarkStyle(e,{x:t=>{const e=l(),a=n(t),o=r(t);if("vertical"===e)return(a+o)/2;if("middle"===i)return(a+o)/2;if(a>=o){if("start"===i)return o+s;if("end"===i)return a-s;if("outside"===i)return a+s}else{if("start"===i)return o-s;if("end"===i)return a+s;if("outside"===i)return a-s}return(a+o)/2},y:t=>{const e=l(),n=a(t),r=o(t);if("horizontal"===e)return(n+r)/2;if("middle"===i)return(n+r)/2;if(n>=r){if("start"===i)return r+s;if("end"===i)return n-s;if("outside"===i)return n+s}else{if("start"===i)return r-s;if("end"===i)return n+s;if("outside"===i)return n-s}return(n+r)/2}},"normal",Py.Series)}aH.type="linearProgress",aH.seriesType=Sl.linearProgress,aH.transformerConstructor=rH,tw(aH,SP);class lH extends sL{constructor(){super(...arguments),this._getMeasureData=t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]]}}const hH=t=>({type:"growCenterIn",options:{direction:"horizontal"===t.direction?"x":"y"}}),dH={type:"fadeIn"},cH=t=>({type:"growCenterOut",options:{direction:"horizontal"===t.direction?"x":"y"}});function uH(t,e){return"fadeIn"===e?dH:hH(t)}const pH=Object.assign(Object.assign({},HP),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),gH=Object.assign(Object.assign({},zP),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class mH extends WP{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar")}}class _H extends GP{constructor(){super(...arguments),this.type=Sl.rangeColumn,this._barMarkType="rect",this._barName=Sl.bar,this.transformerConstructor=mH}initMark(){var t,e,i,s,n,r,a,o,l,h;this._initBarBackgroundMark();const d=null===(t=this._spec.label)||void 0===t?void 0:t.position;this._barMark=this._createMark(_H.mark.bar,{groupKey:this._seriesField,isSeriesMark:!0,stateSort:null===(e=this._spec.bar)||void 0===e?void 0:e.stateSort},{setCustomizedShape:null===(i=this._spec.bar)||void 0===i?void 0:i.customShape,morph:GC(this._spec,_H.mark.bar.name),morphElementKey:this.getDimensionField()[0]}),!1!==(null===(s=this._spec.label)||void 0===s?void 0:s.visible)&&"bothEnd"===d&&(!1!==(null===(r=null===(n=this._spec.label)||void 0===n?void 0:n.minLabel)||void 0===r?void 0:r.visible)&&(this._minLabelMark=this._createMark(_H.mark.minLabel,{markSpec:null===(a=this._spec.label)||void 0===a?void 0:a.minLabel})),!1!==(null===(l=null===(o=this._spec.label)||void 0===o?void 0:o.maxLabel)||void 0===l?void 0:l.visible)&&(this._maxLabelMark=this._createMark(_H.mark.maxLabel,{markSpec:null===(h=this._spec.label)||void 0===h?void 0:h.maxLabel})))}initMarkStyle(){var t,e,i,s,n,r,a,o,l,h;super.initMarkStyle();const d=this._minLabelMark,c=null===(t=this._spec.label)||void 0===t?void 0:t.minLabel;d&&(this.setMarkStyle(d,{fill:null!==(i=null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[0]]:t[this._spec.yField[0]];return(null==c?void 0:c.formatMethod)?c.formatMethod(e,t):e}}),oH(this,d,null!==(s=null==c?void 0:c.position)&&void 0!==s?s:"end",null!==(n=null==c?void 0:c.offset)&&void 0!==n?n:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)));const u=this._maxLabelMark,p=null===(r=this._spec.label)||void 0===r?void 0:r.maxLabel;u&&(this.setMarkStyle(u,{fill:null!==(o=null===(a=null==p?void 0:p.style)||void 0===a?void 0:a.fill)&&void 0!==o?o:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[1]]:t[this._spec.yField[1]];return(null==p?void 0:p.formatMethod)?p.formatMethod(e,t):e}}),oH(this,u,null!==(l=null==p?void 0:p.position)&&void 0!==l?l:"start",null!==(h=null==p?void 0:p.offset)&&void 0!==h?h:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)))}initLabelMarkStyle(t){t&&(this.setMarkStyle(t,{text:t=>{let e,i;return"horizontal"===this._spec.direction?(e=t[this._spec.xField[0]],i=t[this._spec.xField[1]]):(e=t[this._spec.yField[0]],i=t[this._spec.yField[1]]),e+"-"+i},z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._labelMark=t)}_dataToPosX(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[0]),{bandPosition:this._bandPosition})}_dataToPosX1(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}_dataToPosY(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[0]),{bandPosition:this._bandPosition})}_dataToPosY1(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}initAnimation(){var t,e,i,s,n;const r=JC(this),a=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._barMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("rangeColumn"))||void 0===i?void 0:i({direction:this.direction},a),NC("bar",this._spec,this._markAttributeContext),r)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),NC("label",this._spec,this._markAttributeContext),r)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(zC(null===(n=Ql.getAnimationInKey("fadeInOut"))||void 0===n?void 0:n(),NC("label",this._spec,this._markAttributeContext),r))}initTooltip(){this._tooltipHelper=new lH(this),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark),this._minLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._minLabelMark),this._maxLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._maxLabelMark),this._labelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._labelMark)}}_H.type=Sl.rangeColumn,_H.mark=pH,_H.transformerConstructor=mH;class fH extends gP{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barBackground:t.barBackground,barMinHeight:t.barMinHeight,stackCornerRadius:t.stackCornerRadius});return s.bar=t.bar,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),vy(t)}}class vH extends yP{constructor(){super(...arguments),this.transformerConstructor=fH,this.type="rangeColumn",this.seriesType=Sl.rangeColumn}}vH.type="rangeColumn",vH.seriesType=Sl.rangeColumn,vH.transformerConstructor=fH;class yH extends _H{constructor(){super(...arguments),this.type=Sl.rangeColumn3d,this._barMarkType="rect3d",this._barName=Sl.bar3d}}yH.type=Sl.rangeColumn3d,yH.mark=gH;class bH extends gP{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup});return s.bar3d=t.bar3d,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class xH extends yP{constructor(){super(...arguments),this.transformerConstructor=bH,this.type="rangeColumn3d",this.seriesType=Sl.rangeColumn3d}}xH.type="rangeColumn3d",xH.seriesType=Sl.rangeColumn3d,xH.transformerConstructor=bH;const SH=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},MH=t=>{const e=t.mark.elements.filter((t=>t.diffState===Jd.update)),i=Ga(e.map((t=>{var e;return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth})));return e.filter((t=>{var e;return(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth)===i}))},kH=(t,e,i)=>jm(t)?[e,i]:[Ga(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Wa(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],AH=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=MH(i),a=kH(r,s,n);return SH(e.startAngle,a)*(n-s)+s},to:t=>t.startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=MH(i),a=kH(r,s,n);return SH(e.endAngle,a)*(n-s)+s},to:t=>t.endAngle},outerRadius:{from:t=>t.innerRadius,to:t=>t.outerRadius},innerRadius:{from:t=>t.innerRadius,to:t=>t.innerRadius}}}),wH=t=>[Ga(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Wa(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],TH=t=>({channel:{startAngle:{from:(t,e)=>e.getGraphicAttribute("startAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=MH(i),a=wH(r);return SH(i.getGraphicAttribute("startAngle",!1),a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getGraphicAttribute("endAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=MH(i),a=wH(r);return SH(i.getGraphicAttribute("endAngle",!1),a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getGraphicAttribute("outerRadius",!1),to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getGraphicAttribute("innerRadius",!1),to:()=>t.animationInfo().innerRadius}}}),LH=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},CH=(t,e=[],i)=>{const s=(null==i?void 0:i.maxDepth)>=0;return t.forEach((t=>{(!s||t.depth<=i.maxDepth)&&(e.push((null==i?void 0:i.callback)?i.callback(t):t),t.children&&(s&&t.depth===i.maxDepth?(t.children=null,t.isLeaf=!0):CH(t.children,e,i)))})),e},EH=(t,e={})=>{if(!t)return[];const i=[];return CH(t,i,e),i};function DH(t,e,i,s,n,r={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){const a=t.children;let o,l=-1;const h=a.length,d=t.value&&(s-e)/t.value;for(;++lD(t)?e:S(t)?e*parseFloat(t)/100:t;function PH(t){if(il(t))return t;const e=+t;return il(e)?e:0}const RH=(t,e,i=0,s=-1,n,r,a="value")=>{let o=0,l=null!=s?s:-1,h=i;return t.forEach(((t,s)=>{var d,c;const u={flattenIndex:++l,key:r?r(t):`${null!==(d=null==n?void 0:n.key)&&void 0!==d?d:""}-${s}`,maxDepth:-1,depth:i,index:s,value:t[a],isLeaf:!0,datum:n?n.datum.concat(t):[t],parentKey:null==n?void 0:n.key};if(null===(c=t.children)||void 0===c?void 0:c.length){u.children=[],u.isLeaf=!1;const e=RH(t.children,u.children,i+1,l,u,r,a);u.value=D(t[a])?e.sum:Math.max(e.sum,PH(t[a])),l=e.flattenIndex,h=Math.max(e.maxDepth,h)}else u.isLeaf=!0,u.value=PH(t[a]);o+=Math.abs(u.value),e.push(u)})),{sum:o,maxDepth:h,flattenIndex:l}},BH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;n=e(t,s,i,n),(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=BH(t.children,e,t,n))})),s},IH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=IH(t.children,e,t,n)),n=e(t,s,i,n)})),n},FH={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class YH{constructor(t){this._layoutNode=t=>{if(t.maxDepth=this._maxDepth,t.children){const e=this._parsedInnerRadius[t.depth+1],i=this._parsedOutterRadius[t.depth+1];DH(t,t.startAngle,Math.min(e,i),t.endAngle,Math.max(e,i),FH);const s=y(this.options.label)?this.options.label[t.depth+1]:this.options.label;t.children.forEach((t=>{if(t.x=this._parsedCenter[0],t.y=this._parsedCenter[1],s)return this._layoutLabel(t,v(s)?{align:"center",rotate:"radial"}:s)}))}},this.options=t?Object.assign({},YH.defaultOpionts,t):Object.assign({},YH.defaultOpionts);const e=this.options.nodeKey,i=ws(e)?e:e?Dm(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){const i=t.x0+OH(this.options.center[0],t.width),s=t.y0+OH(this.options.center[1],t.height),n=Math.min(t.width/2,t.height/2),r=this.options.innerRadius,a=this.options.outerRadius,o=y(r),l=o?r.map((t=>OH(t,n))):OH(r,n),h=y(a),d=this.options.gapRadius,c=h?a.map((t=>OH(t,n))):OH(a,n),u=eb(0,e+1);if(o)this._parsedInnerRadius=u.map(((t,e)=>{const i=l[e];return D(i)?n:i})),this._parsedOutterRadius=u.map(((t,i)=>{var s,r;return h?null!==(s=c[i])&&void 0!==s?s:n:iD(c[e])?n:c[e])),this._parsedInnerRadius=u.map(((t,e)=>{var i;return 0===e?l:this._parsedOutterRadius[e-1]-(y(d)?null!==(i=d[e])&&void 0!==i?i:0:d)}));else{const t=OH(r,n),i=(c-t)/(e+1);this._parsedInnerRadius=u.map(((e,s)=>t+s*i)),this._parsedOutterRadius=u.map(((t,e)=>{var s;return this._parsedInnerRadius[e]+i-(y(d)?null!==(s=d[e])&&void 0!==s?s:0:d)}))}this._parsedCenter=[i,s],this._maxRadius=n}layout(t,e){const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const s=[],n=RH(t,s,0,-1,null,this._getNodeKey);return this._parseRadius(i,n.maxDepth),this._maxDepth=n.maxDepth,this._layout(s,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:n.sum,datum:null,children:s,startAngle:this.options.startAngle,endAngle:this.options.endAngle}),s}_layout(t,e){this._layoutNode(e),t.forEach((t=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t.children,t):this._layoutNode(t)}))}_layoutLabel(t,e){var i;const s=(t.startAngle+t.endAngle)/2,n=("start"===e.align?t.innerRadius:"end"===e.align?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+(null!==(i=e.offset)&&void 0!==i?i:0),r=Tt({x:this._parsedCenter[0],y:this._parsedCenter[1]},n,s);if(t.label={x:r.x,y:r.y,textBaseline:"middle"},"tangential"===e.rotate)t.label.angle=s-Math.PI/2,t.label.textAlign="center",t.label.maxLineWidth=Math.abs(t.endAngle-t.startAngle)*n;else{const i=s%(2*Math.PI),n=i<0?i+2*Math.PI:i;n>Math.PI/2&&n<1.5*Math.PI?(t.label.angle=n+Math.PI,t.label.textAlign="start"===e.align?"end":"end"===e.align?"start":"center"):(t.label.angle=n,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}YH.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};const jH=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new YH(i).layout(t,{width:s,height:n})};class HH extends sL{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const zH=(t,e,i="key",s="children")=>{for(let n=0;n{for(let n=0;n{const r=Object.assign({},t);return Array.isArray(r[n])&&(r[n]=VH(r[n],e,i,s,n)),r})).filter((t=>+t[s]>=e&&+t[s]<=i||t[n]&&t[n].length>0)):t}var WH;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(WH||(WH={}));const GH=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(D(n))return t;if(i.type===WH.DrillDown)return Na(zH(t,n,s,"children"));if(i.type===WH.DrillUp){const e=NH(t,n,s,"children");if(e)return Na(e)}return t};class UH{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=QB(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;Cp(t,"drillFilter",GH),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(D(t.datum)||D(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!y(t)||jm(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:WH.DrillDown},e().reRunAllTransform(),i.emit(zd.drill,{value:{path:t,type:WH.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!y(n)||jm(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:WH.DrillUp},i().reRunAllTransform(),s.emit(zd.drill,{value:{path:n,type:WH.DrillUp},model:this}),n}}const $H=Object.assign(Object.assign({},_L),{sunburst:{name:"sunburst",type:"arc"}});class XH extends dI{constructor(){super(...arguments),this.type=Sl.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:dL),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:xT},getRawData:()=>this.getRawData()}),this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),Cp(this._dataSet,"sunburstLayout",jH),Cp(this._dataSet,"flatten",EH),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[M(this._centerX)?this._centerX:this.getLayoutRect().width/2,M(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:hL,operations:["max","min","values"]},{key:dL,operations:["values"]}])}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Cp(t.dataSet,"addVChartProperty",UT),t.transform({type:"addVChartProperty",options:{beforeCall:gL.bind(this),call:mL}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){var t,e;if(!1===this._sunburst.visible)return;const i=this._createMark(XH.mark.sunburst,{isSeriesMark:!0,stateSort:null===(t=this._spec.sunburst)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.sunburst)||void 0===e?void 0:e.customShape});this._sunburstMark=i}_initArcMarkStyle(){D(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(M(this._offsetX)?this._offsetX:0),y:t=>t.y+(M(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Py.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(XH.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return As(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(M(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(M(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},Sy.STATE_NORMAL,Py.Series)}initTooltip(){this._tooltipHelper=new HH(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Na(this.__innerRadius))[0],outerRadius:this._computeRadius(Na(this.__outerRadius))[0],startAngle:Na(this._startAngle)[0],endAngle:Na(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),NC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),NC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_computeRadius(t){return y(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}XH.type=Sl.sunburst,XH.mark=$H,tw(XH,UH);class KH extends pP{_getDefaultSeriesSpec(t){const e=M(t.startAngle)?t.startAngle:-90,i=M(t.endAngle)?t.endAngle:e+wt(2*Math.PI),s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,centerX:t.centerX,centerY:t.centerY,offsetX:t.offsetX,offsetY:t.offsetY,startAngle:e,endAngle:i,innerRadius:t.innerRadius,outerRadius:t.outerRadius,gap:t.gap,labelLayout:t.labelLayout,label:t.label,labelAutoVisible:t.labelAutoVisible,drill:t.drill,drillField:t.drillField}),n=Sl.sunburst;return s.type=n,s[n]=t[n],s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class qH extends yP{constructor(){super(...arguments),this.transformerConstructor=KH,this.type="sunburst",this.seriesType=Sl.sunburst}}qH.type="sunburst",qH.seriesType=Sl.sunburst,qH.transformerConstructor=KH;const ZH=4294967296;function JH(t,e){let i,s;if(ez(e,t))return[e];for(i=0;i0&&i*i>s*s+n*n}function ez(t,e){for(let i=0;i1e-6?(T+Math.sqrt(T*T-4*w*L))/(2*w):L/T);return{x:s+S+M*C,y:n+k+A*C,radius:C}}function rz(t,e,i){const s=t.x-e.x;let n,r;const a=t.y-e.y;let o,l;const h=s*s+a*a;h?(r=e.radius+i.radius,r*=r,l=t.radius+i.radius,l*=l,r>l?(n=(h+l-r)/(2*h),o=Math.sqrt(Math.max(0,l/h-n*n)),i.x=t.x-n*s-o*a,i.y=t.y-n*a+o*s):(n=(h+r-l)/(2*h),o=Math.sqrt(Math.max(0,r/h-n*n)),i.x=e.x+n*s-o*a,i.y=e.y+n*a+o*s)):(i.x=e.x+i.radius,i.y=e.y)}function az(t,e){const i=t.radius+e.radius-1e-6,s=e.x-t.x,n=e.y-t.y;return i>0&&i*i>s*s+n*n}function oz(t){const e=t._,i=t.next._,s=e.radius+i.radius,n=(e.x*i.radius+i.x*e.radius)/s,r=(e.y*i.radius+i.y*e.radius)/s;return n*n+r*r}function lz(t){return{_:t,next:null,prev:null}}function hz(t,e){const i=(t=Na(t)).length;if(!i)return 0;let s=t[0];if(s.x=0,s.y=0,1===i)return s.radius;const n=t[1];if(s.x=-n.radius,n.x=s.radius,n.y=0,2===i)return s.radius+n.radius;let r=t[2];rz(n,s,r);let a,o,l,h,d,c,u,p=lz(s),g=lz(n),m=lz(r);p.next=g,m.prev=g,g.next=m,p.prev=m,m.next=p,g.prev=p;for(let e=3;et.padding:y(null==t?void 0:t.padding)?e=>{var i;return null!==(i=t.padding[e.depth+1])&&void 0!==i?i:0}:()=>0,this._maxDepth=-1}layout(t,e){var i;const s="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const n=[],r=RH(t,n,0,-1,null,this._getNodeKey);this._maxDepth=r.maxDepth;const a=function(t=1){let e=t;return()=>(e=(1664525*e+1013904223)%ZH)/ZH}(),o={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:r.sum,datum:null,children:n,x:s.x0+s.width/2,y:s.y0+s.height/2},{nodeSort:l,setRadius:h,padding:d,includeRoot:c}=null!==(i=this.options)&&void 0!==i?i:{};if(!1!==l){const t=ws(l)?this.options.nodeKey:pz.defaultOpionts.nodeSort;BH([o],(e=>{e.children&&e.children.length&&e.children.sort(t)}))}if(h)BH([o],dz(h)),IH([o],cz(this._getPadding,.5,a)),BH([o],uz(1,this._maxDepth));else{const t=Math.min(s.width,s.height);BH([o],dz(pz.defaultOpionts.setRadius)),IH([o],cz(lg,1,a)),d&&IH([o],cz(this._getPadding,o.radius/t,a)),BH([o],uz(t/(2*o.radius),this._maxDepth))}return c?[o]:n}}pz.defaultOpionts={setRadius:t=>Math.sqrt(t.value),padding:0,nodeSort:(t,e)=>e.value-t.value};const gz=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new pz(i).layout(t,{width:s,height:n})};class mz extends sL{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const _z=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},fz=Object.assign(Object.assign({},_L),{circlePacking:{name:"circlePacking",type:"arc"}});class vz extends QC{constructor(){super(...arguments),this.type=Sl.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:dL),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:xT},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();D(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),Cp(this._dataSet,"circlePackingLayout",gz),Cp(this._dataSet,"flatten",EH),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Cp(t.dataSet,"addVChartProperty",UT),t.transform({type:"addVChartProperty",options:{beforeCall:gL.bind(this),call:mL}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t,e;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const i=this._createMark(vz.mark.circlePacking,{isSeriesMark:!0},{setCustomizedShape:null===(e=this._spec.circlePacking)||void 0===e?void 0:e.customShape});this._circlePackingMark=i}_initCirclePackingMarkStyle(){D(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},Sy.STATE_NORMAL,Py.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(vz.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},Sy.STATE_NORMAL,Py.Series)}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:hL,operations:["max","min","values"]},{key:dL,operations:["values"]}])}initTooltip(){this._tooltipHelper=new mz(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),NC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),NC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}vz.type=Sl.circlePacking,vz.mark=fz,tw(vz,UH);class yz extends pP{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,layoutPadding:t.layoutPadding,label:t.label,circlePacking:t.circlePacking,drill:t.drill,drillField:t.drillField}),i=Sl.circlePacking;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class bz extends yP{constructor(){super(...arguments),this.transformerConstructor=yz,this.type="circlePacking",this.seriesType=Sl.circlePacking}}function xz(t,e,i,s,n){const r=t.children;let a,o=-1;const l=r.length,h=t.value&&(n-i)/t.value;for(;++o{if(t>=e-1){const e=r[t];return e.x0=s,e.y0=n,e.x1=a,void(e.y1=o)}const d=l[t],c=i/2+d;let u=t+1,p=e-1;for(;u>>1;l[t]o-n){const r=i?(s*m+a*g)/i:a;h(t,u,g,s,n,r,o),h(u,e,m,r,n,a,o)}else{const r=i?(n*m+o*g)/i:o;h(t,u,g,s,n,a,r),h(u,e,m,s,r,a,o)}};h(0,a,t.value,e,i,s,n)},dice:DH,slice:xz,sliceDice:function(t,e,i,s,n){(t.depth%2==1?xz:DH)(t,e,i,s,n)}};class Mz{constructor(t){var e;this._filterByArea=(t,e)=>{var i;const s=this._getMinAreaByDepth(t.depth);if(s>0&&t.value*ethis._filterByArea(t,e)));i.length?i.length!==t.children.length&&(t.children=i):(t.isLeaf=!0,t.children=null)}return!0},this._getMinAreaByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.minVisibleArea)?this.options.minVisibleArea[t]:this.options.minVisibleArea)&&void 0!==e?e:0},this._getGapWidthByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.gapWidth)?this.options.gapWidth[t]:this.options.gapWidth)&&void 0!==e?e:0},this._getPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.padding)?this.options.padding[t]:this.options.padding)&&void 0!==e?e:0},this._getLabelPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.labelPadding)?this.options.labelPadding[t]:this.options.labelPadding)&&void 0!==e?e:0},this._layoutNode=t=>{const e=this._getGapWidthByDepth(t.depth);let i=t.x0,s=t.y0,n=t.x1,r=t.y1;if(t.maxDepth=this._maxDepth,e>0&&(i+=e/2,n-=e/2,s+=e/2,r-=e/2,i>n&&(i=(i+n)/2,n=i),s>r&&(s=(s+r)/2,r=s),t.x0=i,t.x1=n,t.y0=s,t.y1=r),t.children){const e=this._getLabelPaddingByDepth(t.depth),a=this._getPaddingByDepth(t.depth);a>0&&a0&&("top"===this.options.labelPosition&&s+es?(t.labelRect={x0:i,y0:r-e,x1:n,y1:r},r-=e):"left"===this.options.labelPosition&&i+ei&&(t.labelRect={x0:n-e,y0:s,x1:n,y1:r},n-=e));const o=this._getGapWidthByDepth(t.depth+1);o>0&&(i-=o/2,n+=o/2,s-=o/2,r+=o/2),this._splitNode(t,i,s,n,r)}},this.options=Object.assign({},Mz.defaultOpionts,t);const i=this.options.nodeKey,s=ws(i)?i:i?Dm(i):null;var n;this._getNodeKey=s,this._splitNode="squarify"===this.options.splitType?(n=this.options.aspectRatio,(t,e,i,s,r)=>{!function(t,e,i,s,n,r){const a=[],o=e.children;let l,h,d=0,c=0;const u=o.length;let p,g,m,_,f,v,y,b,x,S=e.value;for(;df&&(f=h),x=m*m*b,v=Math.max(f/x,x/_),v>y){m-=h;break}y=v}l=Object.assign({},e,{value:m,children:o.slice(d,c)}),a.push(l),p=0&&t.depth>=e)return!1;const i=this.options.minChildrenVisibleArea;if(h(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0)){var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t):this._layoutNode(t)}))}}Mz.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};const kz=(t,e)=>{const i=new Mz(t).layout(e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});if(t.flatten){const e=[];return CH(i,e,{maxDepth:null==t?void 0:t.maxDepth}),e}return i},Az=(t,e)=>{let i={},s=e.fields;if(ws(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=EH(n);return i=rL([{latestData:r}],e),i};class wz extends sL{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:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const Tz=Object.assign(Object.assign({},_L),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),Lz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class Cz extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}class Ez extends QC{constructor(){super(...arguments),this.type=Sl.treemap,this.transformerConstructor=Cz,this._categoryField="name",this._valueField="value",this._viewBox=new Kt,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:dL),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Ot),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:xT},getRawData:()=>this.getRawData()}),il(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){super.initData(),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}compile(){super.compile(),this._runTreemapTransform()}_runTreemapTransform(t=!1){var e,i,s,n;const r=this._data.getProduct();r&&r.transform([{type:"treemap",nameField:this._categoryField,valueField:this._valueField,x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize,flatten:!0},{type:"map",callback:t=>(t&&[dL,"name"].forEach((e=>{t[e]=t.datum[t.depth][this._categoryField]})),t)}]),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Cp(this._rawData.dataSet,"addVChartProperty",UT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:gL.bind(this),call:mL}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=Az([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=E(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){Cp(this._dataSet,"hierarchyDimensionStatistics",Az),Cp(this._dataSet,"flatten",EH);const i=new R(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:hL,operations:["max","min","values"]},{key:dL,operations:["values"]}])}initMark(){var t,e,i,s;const n=this._createMark(Ez.mark.nonLeaf,{isSeriesMark:!0,stateSort:null===(t=this._spec.nonLeaf)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.nonLeaf)||void 0===e?void 0:e.customShape});n&&(n.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=n);const r=this._createMark(Ez.mark.leaf,{isSeriesMark:!0,stateSort:null===(i=this._spec.leaf)||void 0===i?void 0:i.stateSort},{setCustomizedShape:null===(s=this._spec.leaf)||void 0===s?void 0:s.customShape});r&&(r.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=r)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Py.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},Sy.STATE_NORMAL,Py.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},Sy.STATE_NORMAL,Py.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},Sy.STATE_NORMAL,Py.Series))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},Sy.STATE_NORMAL,Py.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},Sy.STATE_NORMAL,Py.Series))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("treemap"))||void 0===e?void 0:e(),NC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new wz(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:d}=this._matrix;this._matrix.multiply(r,a,o,l,h,d),this.disableMarkAnimation(),this.event.on(hc.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.enable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().enableAnimation()})),this.event.off(hc.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.disable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}Ez.type=Sl.treemap,Ez.mark=Tz,Ez.transformerConstructor=Cz,tw(Ez,UH),tw(Ez,eI);class Dz extends pP{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,aspectRatio:t.aspectRatio,splitType:t.splitType,maxDepth:t.maxDepth,gapWidth:t.gapWidth,nodePadding:t.nodePadding,minVisibleArea:t.minVisibleArea,minChildrenVisibleArea:t.minChildrenVisibleArea,minChildrenVisibleSize:t.minChildrenVisibleSize,roam:t.roam,drill:t.drill,drillField:t.drillField,leaf:t.leaf,nonLeaf:t.nonLeaf,nonLeafLabel:t.nonLeafLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class Oz extends yP{constructor(){super(...arguments),this.transformerConstructor=Dz,this.type="treemap",this.seriesType=Sl.treemap}}Oz.type="treemap",Oz.seriesType=Sl.treemap,Oz.transformerConstructor=Dz;const Pz=`${hh}_waterfall_default_seriesField`,Rz=(t,e)=>{if(!t||0===t.length)return t;const{indexField:i,total:s,groupData:n}=e,r=[],{dimensionValues:a,dimensionData:o}=n().latestData,l=Array.from(a[i]);let h={start:0,end:0,positive:0,negative:0,lastIndex:null};return l.forEach(((t,i)=>{const n={start:h.end,end:h.end,lastIndex:h.lastIndex,lastEnd:h.end,index:t,isTotal:!1,positive:h.end,negative:h.end},a=o[t];if(null==a||a.forEach(((t,e)=>{e===a.length-1?t[PT]=!0:delete t[PT]})),a.length>1){const o=t=>{if(s&&"end"!==s.type){if("field"===s.type||"custom"===s.type)return!!t[s.tagField]}else if(i===l.length-1)return!0;return!1};if(a.some((t=>o(t))))return h=function(t,e,i,s,n,r,a,o,l){i.isTotal=!0;const{valueField:h,startAs:d,endAs:c,total:u}=o,p=[],g=[];if(t.forEach((t=>{l(t)?g.push(t):p.push(t)})),g.length===t.length){const l=Bz([t[0]],e,i,s,n,r,a,o);return g.forEach((e=>{e[d]=t[0][d],e[c]=t[0][c],e[h]=t[0][h]})),l}const m=g[0];let{start:_,end:f}=Iz(m,i,s,n,u);i.start=_,i.end=f;let v=_,y=_,b=f-_;return p.forEach((t=>{const e=+t[h];e>=0?(t[d]=+v,v=Mt(v,e)):(t[d]=+y,y=Mt(y,e)),t[c]=Mt(t[d],e),_=Mt(_,e),b=kt(b,e)})),g.forEach((t=>{t[d]=+_,t[c]=Mt(t[d],b),t[h]=b})),Object.assign(Object.assign({},i),{lastIndex:e})}(a,t,n,r,h,l,i,e,o),void r.push(n)}h=Bz(a,t,n,r,h,l,i,e),r.push(n)})),r};function Bz(t,e,i,s,n,r,a,o){const{valueField:l,startAs:h,endAs:d,total:c,seriesField:u,seriesFieldName:p}=o;return t.forEach((t=>{let e=!1;if(c&&"end"!==c.type){if(("field"===c.type||"custom"===c.type)&&t[c.tagField]){e=!0;const{start:r,end:a}=Iz(t,i,s,n,c);t[h]=r,t[d]=a,t[l]=a-r,i.start=r,i.end=a}}else a===r.length-1&&(i.start=0,t[h]=i.start,t[d]=i.end,e=!0);if(!e){const e=+t[l];e>=0?(t[h]=+i.positive,i.positive=Mt(i.positive,e)):(t[h]=+i.negative,i.negative=Mt(i.negative,e)),t[d]=Mt(t[h],e),i.end=Mt(i.end,e)}i.isTotal=e,(D(u)||u===Pz)&&(t[Pz]=e?p.total:+t[l]>=0?p.increase:p.decrease)})),Object.assign(Object.assign({},i),{lastIndex:e})}function Iz(t,e,i,s,n){return n&&"end"!==n.type?"field"===n.type||"custom"===n.type?"custom"===n.type?function(t,e,i){return i.product(t,e)}(t,s,n):n.collectCountField&&!D(t[n.collectCountField])?function(t,e,i,s){let n=0,r=i.end;const a=e.length-+t[s.collectCountField],o=e.length-1;return a<0?yl("total.collectCountField error"):n=e[a].start,o<0?yl("total.collectCountField error"):r=e[o].end,{start:n,end:r}}(t,i,e,n):function(t,e,i){let s=0,n=e.end;return i.startField&&!D(t[i.startField])&&(s=+t[i.startField]),i.valueField&&!D(t[i.valueField])&&(n=Mt(s,+t[i.valueField])),{start:s,end:n}}(t,e,n):{start:0,end:0}:function(t){return{start:0,end:t.end}}(e)}const Fz=(t,e)=>{if(!t)return t;const{indexField:i,valueField:s,total:n,seriesField:r}=e,a={[i]:(null==n?void 0:n.text)||"total",[s]:t.reduce(((t,e)=>Mt(t,+e[s])),0)};return r&&(a[r]="total"),t.push(a),t},Yz={type:"fadeIn"},jz={type:"growCenterIn"};function Hz(t,e){switch(e){case"fadeIn":return Yz;case"scaleIn":return jz;default:return PP(t,!1)}}const zz=Object.assign(Object.assign({},HP),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),Nz=(t,e)=>{if(!e.fields)return t;const i={};return{dimensionValues:i,dimensionData:Vz(t.map((t=>t.latestData)).flat(),e.fields,i)}};function Vz(t,e,i){if(0===e.length)return t;const s=e[0],n=e.slice(1);i[s]=new Set;const r=function(t,e,i){const s={};return t.forEach((t=>{const n=t[e];s[n]||(s[n]=[],i.add(n)),s[n].push(t)})),s}(t,s,i[s]);return n.length?(a=r,o=(t,e)=>Vz(t,n,i),Object.keys(a).reduce(((t,e)=>(t[e]=o(a[e]),t)),{})):r;var a,o}class Wz{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){const i=t.name,s=new R(e instanceof f?e:t.dataSet);s.name=i,s.parse([t],{type:"dataview"}),Cp(e,"dimensionTree",Nz),s.transform({type:"dimensionTree",options:{fields:this._fields}},!1),s.target.addListener("change",this.groupDataUpdate.bind(this)),this._groupData=s}groupDataUpdate(){}getGroupValueInField(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.groupData)||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.dimensionValues)||void 0===s?void 0:s[t];return n?Array.from(n):[]}}class Gz extends WP{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel","initStackLabelMarkStyle")}}const Uz={rect:qz,symbol:Kz,arc:Jz,point:function(t){const{labelSpec:e}=t;let i;return i=!1!==e.overlap&&{avoidBaseMark:!1},{position:"center",overlap:i}},"line-data":function(t){const e=Kz(t);return v(e.overlap)||(e.overlap.avoidBaseMark=!1),e},stackLabel:Qz,line:tN,area:tN,rect3d:qz,arc3d:Jz,treemap:function(t){return{customLayoutFunc:(t,e)=>e,overlap:!1}},venn:function(t){return{customLayoutFunc:(t,e)=>e,smartInvert:!0}}};function $z(t,e,i,s){var n;const{labelMark:r,series:a}=t,o={text:e[a.getMeasureField()[0]],data:e,textType:null!==(n=t.labelSpec.textType)&&void 0!==n?n:"text"},l=Object.keys(r.stateStyle.normal);for(const t of l){const i=r.getAttribute(t,e);o[t]=i}if(a.type!==Sl.sankey){const{formatFunc:t,args:n}=KT(i,s,o.text,e);t&&(o._originText=o.text,o.text=t(...n,{series:a}))}return o}function Xz(t){return ws(t)?e=>t(e.data):t}function Kz(t){var e,i,s;const{series:n,labelSpec:r}=t,a="horizontal"===n.direction?"right":"top",o=null!==(e=Xz(r.position))&&void 0!==e?e:a;let l;return l=!1!==r.overlap&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}],avoidBaseMark:"center"!==o},{position:o,overlap:l}}function qz(t){var e,i,s,n,r,a;const{series:o,labelSpec:l={}}=t,h=null!==(e=Xz(l.position))&&void 0!==e?e:"outside",d=null!==(i=o.direction)&&void 0!==i?i:"vertical",c="horizontal"===o.direction?null===(s=o.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=o.getYAxisHelper())||void 0===n?void 0:n.isInverse();let u,p=h;p=t=>{var e;const{data:i}=t,s=null!==(e="function"==typeof l.position?l.position(i):l.position)&&void 0!==e?e:"outside";if("outside"===s){const t=o.getMeasureField()[0],e={vertical:["top","bottom"],horizontal:["right","left"]},s=(null==i?void 0:i[t])>=0&&c||(null==i?void 0:i[t])<0&&!c?1:0;return e[d][s]}return s},u=!1!==l.overlap&&{strategy:null!==(a=null===(r=l.overlap)||void 0===r?void 0:r.strategy)&&void 0!==a?a:Zz(o)};let g=!1;return S(h)&&h.includes("inside")&&(g=!0),{position:p,overlap:u,smartInvert:g}}function Zz(t){return[{type:"position",position:e=>{var i,s;const{data:n}=e,r=t.getMeasureField()[0];return("horizontal"===t.direction?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]:"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]}}]}function Jz(t){var e;const{labelSpec:i}=t,s=null!==(e=Xz(i.position))&&void 0!==e?e:"outside",n=s;let r;return r=i.smartInvert?i.smartInvert:S(s)&&s.includes("inside"),{position:n,smartInvert:r}}function Qz(t,e,i){const s=t.series,n=t.labelSpec||{},r=s.getTotalData();return{customLayoutFunc:r=>r.map((r=>{const a=n.position||"withChange",o=n.offset||0,l=e?e(r.data):r.data,h=$z(t,l,n.formatMethod);return h.x=function(t,e,i,s){return"horizontal"===e.direction?"middle"===i?.5*(e.totalPositionX(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionX(t,t.end>=t.start?"end":"start")+s:"min"===i?e.totalPositionX(t,t.end>=t.start?"start":"end")-s:e.totalPositionX(t,"end")+(t.end>=t.start?s:-s):e.totalPositionX(t,"index",.5)}(l,s,a,o),h.y=function(t,e,i,s){return"horizontal"===e.direction?e.totalPositionY(t,"index",.5):"middle"===i?.5*(e.totalPositionY(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionY(t,t.end>=t.start?"end":"start")-s:"min"===i?e.totalPositionY(t,t.end>=t.start?"start":"end")+s:e.totalPositionY(t,"end")+(t.end>=t.start?-s:s)}(l,s,a,o),"horizontal"===s.direction?h.textAlign="middle"===a?"center":"withChange"===a&&l.end-l.start>=0||"max"===a?"left":"right":h.textBaseline="middle"===a?a:"withChange"===a&&l.end-l.start>=0||"max"===a?"bottom":"top",null==i||i(r,l,h),f_(Object.assign(Object.assign({},h),{id:r.id}))})),dataFilter:t=>{const e=[];return r.forEach((i=>{const n=t.find((t=>{var e;return i.index===(null===(e=t.data)||void 0===e?void 0:e[s.getDimensionField()[0]])}));n&&(n.data=i,e.push(n))})),e},overlap:{strategy:[]}}}function tN(t){var e,i,s,n;const{labelSpec:r,series:a}=t,o=null===(s=null===(i=null===(e=a.getViewDataStatistics)||void 0===e?void 0:e.call(a).latestData)||void 0===i?void 0:i[a.getSeriesField()])||void 0===s?void 0:s.values,l=o?o.map(((t,e)=>({[a.getSeriesField()]:t,index:e}))):[];return{position:null!==(n=r.position)&&void 0!==n?n:"end",data:l}}function eN(t){return[{type:"position",position:e=>"horizontal"===t.direction?["right","left"]:["bottom","top"]}]}class iN extends GP{constructor(){super(...arguments),this.type=Sl.waterfall,this.transformerConstructor=Gz,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null}getTotalData(){var t;return null===(t=this._totalData)||void 0===t?void 0:t.getLatestData()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups=new Wz(t),this._data&&this._groups.initData(this._data.getDataView(),this._dataSet))}setAttrFromSpec(){super.setAttrFromSpec(),this.setValueFieldToStack(),this._fieldX=[this._fieldX[0]],this._fieldY=[this._fieldY[0]],D(this._seriesField)&&(this._seriesField=Pz)}getSeriesKeys(){return this._seriesField===Pz?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t;super.initData(),Cp(this._dataSet,"waterfallFillTotal",Fz),Cp(this._dataSet,"waterfall",Rz),(D(this._spec.total)||"end"===this._spec.total.type)&&(null===(t=this._rawData)||void 0===t||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total}},!1));const e=Yp(this.getViewData(),this._dataSet,{name:`${hh}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",e.reRunAllTransform),this._totalData=new lL(this._option,e),e.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:AT,endAs:wT,total:this._spec.total,groupData:()=>this.getGroups().groupData}},!1)}compileData(){var t;super.compileData(),null===(t=this._totalData)||void 0===t||t.compile()}initAnimation(){var t,e,i,s;const n={yField:"horizontal"===this.direction?this._fieldY[0]:this.getStackValueField(),xField:"horizontal"===this.direction?this.getStackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,a=JC(this);this._barMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("waterfall"))||void 0===i?void 0:i(n,r),NC("bar",this._spec,this._markAttributeContext),a)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),NC("leaderLine",this._spec,this._markAttributeContext)))}viewDataUpdate(t){this._totalData.getDataView().reRunAllTransform(),this._totalData.updateData(),super.viewDataUpdate(t)}addViewDataFilter(t){}reFilterViewData(){}onEvaluateEnd(t){super.onEvaluateEnd(t),this._totalData.updateData()}initMark(){var t,e;super.initMark();const i=this._createMark(iN.mark.leaderLine,{key:"index",stateSort:null===(t=this._spec.leaderLine)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.leaderLine)||void 0===e?void 0:e.customShape});i&&(this._leaderLineMark=i,i.setDataView(this._totalData.getDataView(),this._totalData.getProductId()))}initLabelMarkStyle(t){var e;if(t)return!this._labelMark&&(null===(e=this._spec.label)||void 0===e?void 0:e.visible)?(super.initLabelMarkStyle(t),void(this._labelMark=t)):void 0}initStackLabelMarkStyle(t){t&&(this._stackLabelMark=t,t.skipEncode=!0,t.setRule("stackLabel"),t.setDataView(this._totalData.getDataView(),this._totalData.getProductId()),this.setMarkStyle(t,{text:t=>{var e;return"absolute"===(null===(e=this._spec.stackLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start)}}))}initTotalLabelMarkStyle(t){this.setMarkStyle(t,{text:t=>{var e;return"end"in t?"absolute"===(null===(e=this._spec.totalLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start):"horizontal"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]]}})}getTotalLabelComponentStyle(t){return Qz(Object.assign(Object.assign({},t),{series:this,labelSpec:this._spec.totalLabel}),(t=>{const e="vertical"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]];return this._totalData.getLatestData().find((t=>t.index===e))}))}totalPositionX(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._xAxisHelper;return"horizontal"===this._direction?ox(s([t[e]],{bandPosition:this._bandPosition})):s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("width",t)*(.5-i)}totalPositionY(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._yAxisHelper;return"horizontal"===this._direction?s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("height",t)*(.5-i):ox(s([t[e]],{bandPosition:this._bandPosition}))}initMarkStyle(){super.initMarkStyle(),this._leaderLineMark&&("horizontal"===this._direction?this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:t=>t.lastIndex?this.totalPositionY(t,"lastIndex",1):0,y1:t=>this.totalPositionY(t,"index",0)},"normal",Py.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>t.lastIndex?this.totalPositionX(t,"lastIndex",1):0,x1:t=>this.totalPositionX(t,"index",0),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",Py.Series))}}iN.type=Sl.waterfall,iN.mark=zz,iN.transformerConstructor=Gz;class sN extends $P{transformSpec(t){super.transformSpec(t),t.legends&&Na(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),vy(t)}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{bar:t.bar,stackLabel:t.stackLabel,leaderLine:t.leaderLine,total:t.total})}}class nN extends XP{constructor(){super(...arguments),this.transformerConstructor=sN,this.type="waterfall",this.seriesType=Sl.waterfall}}nN.type="waterfall",nN.seriesType=Sl.waterfall,nN.transformerConstructor=sN;const rN=`${hh}_BOX_PLOT_OUTLIER_VALUE`;var aN;!function(t){t.OUTLIER="outlier",t.MAX="max",t.MIN="min",t.MEDIAN="median",t.Q1="q1",t.Q3="q3",t.SERIES_FIELD="seriesField"}(aN||(aN={}));const oN=(t,e)=>{const i=[],{outliersField:s,dimensionField:n}=e;return(t[0].latestData||[]).forEach((t=>{let e=t[s];y(e)||(e=[e]),i.push(...e.map((e=>{const i={[rN]:e};return n.forEach((e=>{i[e]=t[e]})),i})))})),i};class lN extends sL{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===aN.OUTLIER?this.series.getOutliersField():t===aN.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case aN.MIN:return this.series.getMinField();case aN.MAX:return this.series.getMaxField();case aN.MEDIAN:return this.series.getMedianField();case aN.Q1:return this.series.getQ1Field();case aN.Q3:return this.series.getQ3Field();case aN.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===aN.OUTLIER?e[rN]:t===aN.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case aN.MIN:return e[this.series.getMinField()];case aN.MAX:return e[this.series.getMaxField()];case aN.MEDIAN:return e[this.series.getMedianField()];case aN.Q1:return e[this.series.getQ1Field()];case aN.Q3:return e[this.series.getQ3Field()];case aN.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>"line"===this.series.getShaftShape()?this.series.getMarkInName("boxPlot").getAttribute("stroke",t):this.series.getMarkInName("boxPlot").getAttribute("fill",t),this.getOutlierFillColor=t=>{var e;const i=this.series.getOutliersStyle();return null!==(e=null==i?void 0:i.fill)&&void 0!==e?e:this.series.getMarkInName("outlier").getAttribute("fill",t)},this.isOutlierMark=t=>M(t[rN])}getDefaultContentList(t){return[{key:this.getContentKey(aN.OUTLIER),value:this.getContentValue(aN.OUTLIER),shapeType:this.shapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor},{key:this.getContentKey(aN.MAX),value:this.getContentValue(aN.MAX)},{key:this.getContentKey(aN.Q3),value:this.getContentValue(aN.Q3)},{key:this.getContentKey(aN.MEDIAN),value:this.getContentValue(aN.MEDIAN)},{key:this.getContentKey(aN.Q1),value:this.getContentValue(aN.Q1)},{key:this.getContentKey(aN.MIN),value:this.getContentValue(aN.MIN)},{key:this.getContentKey(aN.SERIES_FIELD),value:this.getContentValue(aN.SERIES_FIELD)}]}}function hN(t){return"horizontal"===t}function dN(t){return"vertical"===t}class cN extends Wm{constructor(t){super(t),this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t],l={};if(!o)return l;if(ws(o))return l.attributes=o(this.getDatum(),this,t,e),l;if(!a&&(null===(r=this.graphicItem.glyphStates)||void 0===r?void 0:r[t]))return this.graphicItem.glyphStates[t];if(o){const e=this.items[0],i=[Object.assign({},e,{nextAttrs:{}})];return Om(this,i,o,this.mark.parameters()),this.coordinateTransformEncode(i),l.attributes=i[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[t]||(this.graphicItem.glyphStates[t]=l):this.graphicItem.glyphStates={[t]:l},l}return l},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[Wg]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);const e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach((t=>{const i=e[t.name];this.glyphGraphicItems[t.name]=t,t.onBeforeAttributeUpdate=e=>this.mark?bm(i,e,this,t.name):e})),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(hc.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();const i=v(e)?e:this.hasStateAnimation();return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(hc.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);const t=this.transformElementItems(this.items,this.mark.markType),e=!this.graphicItem;this.graphicItem||this.initGraphicItem(),this.diffState===Jd.enter||e?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==Jd.enter&&this.diffState!==Jd.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach((t=>{t.states={}})),this.useStates(this.states)),this.items.map((t=>{t.nextAttrs={}}))}encodeCustom(t){var e;let i={};const s=this.glyphMeta.getChannelEncoder(),n=this.glyphMeta.getFunctionEncoder();if(n&&(i=n.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),s){let e;Object.keys(s).forEach((n=>{var r;if(!D(t[n])){e||(e=Object.assign({},null===(r=this.graphicItem)||void 0===r?void 0:r.attribute,t));const a=s[n].call(null,n,t[n],e,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(null!=a?a:{}).forEach((t=>{var e;i[t]=Object.assign(null!==(e=i[t])&&void 0!==e?e:{},a[t])}))}}))}return i}encodeDefault(){const t={};if(this.glyphMeta.getDefaultEncoder()){const e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;const i=this.glyphMeta.getMarks(),s=bm(this.mark.getAttributeTransforms(),e,this),n=t?this.encodeDefault():null,r=this.encodeCustom(e);return Object.keys(i).forEach((s=>{const a=i[s],o=this.glyphGraphicItems[s],l=null==r?void 0:r[s],h=Object.assign({},l);if(t){const t=null==n?void 0:n[s];Object.keys(null!=t?t:{}).forEach((e=>{Ss(this.items[0].nextAttrs,e)||Ss(h,e)||(h[e]=t[e])}))}const d=Object.assign({},function(t,e){var i;return(null!==(i=ym[t])&&void 0!==i?i:[]).reduce(((t,i)=>(i.channels.forEach((i=>{Ss(e,i)&&(t[i]=e[i])})),t)),{})}(a,e),h),c=this._generateGlyphItems(a,this.items,d);this.coordinateTransformEncode(c);const u=this.transformElementItems(c,a);this.applyGlyphGraphicAttributes(u,s,o),a===Qd.shape&&(o.datum=c[0].datum)})),s}}_generateGlyphItems(t,e,i){const s=e.map((t=>Object.assign({},t,{nextAttrs:i})));return Gg.includes(t)&&this.mark.getSpec().enableSegments&&s.forEach(((t,s)=>{t.nextAttrs=Object.assign({},e[s].nextAttrs,i)})),s}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;const s=this.getPrevGraphicAttributes(i);return e&&Ss(s,t)?s[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,s){if(!this.graphicItem)return;const n=s?this.glyphGraphicItems[s]:this.graphicItem,r=this.getFinalGraphicAttributes(s),a=this.getPrevGraphicAttributes(s);i&&(r[t]=e),Ss(a,t)||(a[t]=n.attribute[t]),n.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;const s=i?this.glyphGraphicItems[i]:this.graphicItem,n=this.getFinalGraphicAttributes(i),r=this.getPrevGraphicAttributes(i);Object.keys(t).forEach((i=>{e&&(n[i]=t[i]),Ss(r,i)||(r[i]=s.attribute[i])})),s.setAttributes(t)}diffAttributes(t,e){const i={},s=this.getFinalGraphicAttributes(e);for(const e in t)Ss(s,e)&&Im(s[e],t[e])||(i[e]=t[e]);return i}applyGlyphGraphicAttributes(t,e,i){var s,n;if(this.mark.needAnimate()){const r=this.diffAttributes(t,e),a=null!==(s=this.getPrevGraphicAttributes(e))&&void 0!==s?s:{},o=null!==(n=this.getFinalGraphicAttributes(e))&&void 0!==n?n:{};Object.keys(r).forEach((t=>{a[t]=i.attribute[t],o[t]=r[t]})),this.setNextGraphicAttributes(r,e),this.setPrevGraphicAttributes(a,e),this.setFinalGraphicAttributes(o,e),i.setAttributes(r)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)}))}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)}))}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach((t=>{t[Wg]=null})),this.glyphGraphicItems=null),super.release()}}class uN extends Gm{constructor(t,e,i){super(t,Qd.glyph,i),this.glyphType=e,this.glyphMeta=fc.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){const i=function(t,e,i={}){if(!fc.getGraphicType(Qd.glyph))return;const s=fc.createGraphic(Qd.glyph,i),n=e.getMarks(),r=Object.keys(n).map((t=>{if(fc.getGraphicType(n[t])){const e=fc.createGraphic(n[t]);if(e)return e.name=t,e}}));return s.setSubGraphic(r),s}(0,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}createElement(){return new cN(this)}}uN.markType=Qd.glyph;const pN=()=>{fc.registerMark(Qd.glyph,uN)},gN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!il(l))return{};const h=e.getGraphicAttribute("x",!1),d=e.getGraphicAttribute("y",!1),c=e.getGraphicAttribute("min",!1),u=e.getGraphicAttribute("max",!1),p=e.getGraphicAttribute("q1",!1),g=e.getGraphicAttribute("q3",!1),m=e.getGraphicAttribute("median",!1),_={from:{x:h,y:d},to:{x:h,y:d}};return il(c)&&(_.from.min=l,_.to.min=c),il(u)&&(_.from.max=l,_.to.max=u),il(p)&&(_.from.q1=l,_.to.q1=p),il(g)&&(_.from.q3=l,_.to.q3=g),il(m)&&(_.from.median=l,_.to.median=m),_},mN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!il(l))return{};const h=e.getGraphicAttribute("x",!0),d=e.getGraphicAttribute("y",!0),c=e.getGraphicAttribute("min",!0),u=e.getGraphicAttribute("max",!0),p=e.getGraphicAttribute("q1",!0),g=e.getGraphicAttribute("q3",!0),m=e.getGraphicAttribute("median",!0),_={from:{x:h,y:d},to:{x:h,y:d}};return il(c)&&(_.to.min=l,_.from.min=c),il(u)&&(_.to.max=l,_.from.max=u),il(p)&&(_.to.q1=l,_.from.q1=p),il(g)&&(_.to.q3=l,_.from.q3=g),il(m)&&(_.to.median=l,_.from.median=m),_},_N=(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;if(i&&il(i.center))return i.center;let m,_,f,v,y;if(hN(e)){m=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x,_=null===(a=null===(r=t.getGraphicAttribute("points",!1,"max"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.x,f=null===(l=null===(o=t.getGraphicAttribute("points",!1,"min"))||void 0===o?void 0:o[0])||void 0===l?void 0:l.x;const e=t.getGraphicAttribute("width",!1,"box"),i=t.getGraphicAttribute("x",!1,"box");v=i,y=i+e}else{m=null===(d=null===(h=t.getGraphicAttribute("points",!1,"median"))||void 0===h?void 0:h[0])||void 0===d?void 0:d.y,_=null===(u=null===(c=t.getGraphicAttribute("points",!1,"max"))||void 0===c?void 0:c[0])||void 0===u?void 0:u.y,f=null===(g=null===(p=t.getGraphicAttribute("points",!1,"min"))||void 0===p?void 0:p[0])||void 0===g?void 0:g.y;const e=t.getGraphicAttribute("height",!1,"box"),i=t.getGraphicAttribute("y",!1,"box");v=i,y=i+e}return il(m)?m:il(v)&&il(y)?(v+y)/2:il(_)&&il(f)?(_+f)/2:il(f)?f:il(_)?_:NaN},fN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={shaft:{},box:{},max:{},min:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.height)&&void 0!==o?o:i.getGraphicAttribute("height",!1),f=null!==(l=t.boxWidth)&&void 0!==l?l:i.getGraphicAttribute("boxWidth",!1),v=null!==(h=t.boxHeight)&&void 0!==h?h:i.getGraphicAttribute("boxHeight",!1),y=null!==(d=t.ruleWidth)&&void 0!==d?d:i.getGraphicAttribute("ruleWidth",!1),b=null!==(c=t.ruleHeight)&&void 0!==c?c:i.getGraphicAttribute("ruleHeight",!1);return s&&hN(s.direction)?(il(v)?(Object.assign(u.box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2})):(Object.assign(u.box,{y:g-_/2,y1:g+_/2}),Object.assign(u.median,{y:g-_/2,y1:g+_/2})),il(b)?(Object.assign(u.max,{y:g-b/2,y1:g+b/2}),Object.assign(u.min,{y:g-b/2,y1:g+b/2})):(Object.assign(u.max,{y:g-_/2,y1:g+_/2}),Object.assign(u.min,{y:g-_/2,y1:g+_/2}))):(il(f)?(Object.assign(u.box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2})),il(y)?(Object.assign(u.max,{x:p-y/2,x1:p+y/2}),Object.assign(u.min,{x:p-y/2,x1:p+y/2})):(Object.assign(u.max,{x:p-m/2,x1:p+m/2}),Object.assign(u.min,{x:p-m/2,x1:p+m/2}))),u},vN=gN(_N),yN=mN(_N),bN=(t,e,i)=>{var s,n,r,a;if(il(null==i?void 0:i.center))return i.center;let o,l,h,d,c;if(hN(e)){o=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x;const e=t.getGraphicAttribute("width",!1,"minMaxBox"),i=t.getGraphicAttribute("x",!1,"minMaxBox");h=i,l=i+e;const r=t.getGraphicAttribute("width",!1,"q1q3Box"),a=t.getGraphicAttribute("x",!1,"q1q3Box");d=a,c=a+r}else{o=null===(a=null===(r=t.getGraphicAttribute("points",!1,"median"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.y;const e=t.getGraphicAttribute("height",!1,"minMaxBox"),i=t.getGraphicAttribute("y",!1,"minMaxBox");h=i,l=i+e;const s=t.getGraphicAttribute("height",!1,"q1q3Box"),n=t.getGraphicAttribute("y",!1,"q1q3Box");d=n,c=n+s}return il(o)?o:il(d)&&il(c)?(d+c)/2:il(l)&&il(h)?(l+h)/2:il(h)?h:il(l)?l:NaN},xN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={minMaxBox:{},q1q3Box:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.minMaxWidth)&&void 0!==o?o:i.getGraphicAttribute("minMaxWidth",!1),f=null!==(l=t.q1q3Width)&&void 0!==l?l:i.getGraphicAttribute("q1q3Width",!1),v=null!==(h=t.height)&&void 0!==h?h:i.getGraphicAttribute("height",!1),y=null!==(d=t.minMaxHeight)&&void 0!==d?d:i.getGraphicAttribute("minMaxHeight",!1),b=null!==(c=t.q1q3Height)&&void 0!==c?c:i.getGraphicAttribute("q1q3Height",!1);return s&&hN(s.direction)?(il(y)?Object.assign(u.minMaxBox,{y:g-y/2,y1:g+y/2}):Object.assign(u.minMaxBox,{y:g-v/2,y1:g+v/2}),il(b)?(Object.assign(u.q1q3Box,{y:g-b/2,y1:g+b/2}),Object.assign(u.median,{y:g-b/2,y1:g+b/2})):(Object.assign(u.q1q3Box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2}))):(il(_)?Object.assign(u.minMaxBox,{x:p-_/2,x1:p+_/2}):Object.assign(u.minMaxBox,{x:p-m/2,x1:p+m/2}),il(f)?(Object.assign(u.q1q3Box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.q1q3Box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2}))),u},SN=gN(bN),MN=mN(bN);class kN extends yx{constructor(){super(...arguments),this.type=kN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}_initProduct(t){const e=this.getStyle("shaftShape"),i=this.getVGrammarView(),s=this.getProductId(),n="bar"===e?"barBoxplot":"boxplot",r=this.getStyle("direction");this._product=i.glyph(n,null!=t?t:i.rootMark).id(s).configureGlyph({direction:r}),this._compiledProductId=s}}kN.type="boxPlot";const AN=Object.assign(Object.assign({},_L),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}});class wN extends QC{constructor(){super(...arguments),this.type=Sl.boxPlot}getMinField(){return this._minField}getMaxField(){return this._maxField}getQ1Field(){return this._q1Field}getMedianField(){return this._medianField}getQ3Field(){return this._q3Field}getOutliersField(){return this._outliersField}getShaftShape(){return this._shaftShape}getBoxFillColor(){return this._boxFillColor}getStrokeColor(){return this._strokeColor}getOutliersStyle(){return this._outliersStyle}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec();const r=null!==(e=null===(t=this._spec.boxPlot)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._minField=this._spec.minField,this._maxField=this._spec.maxField,this._q1Field=this._spec.q1Field,this._medianField=this._spec.medianField,this._q3Field=this._spec.q3Field,this._outliersField=this._spec.outliersField,this._lineWidth=null!==(i=r.lineWidth)&&void 0!==i?i:2,this._boxWidth=r.boxWidth,this._shaftShape=null!==(s=r.shaftShape)&&void 0!==s?s:"line",this._shaftWidth=r.shaftWidth,this._boxFillColor=r.boxFill,this._strokeColor=r.stroke,this._shaftFillOpacity="bar"===this._shaftShape?null!==(n=r.shaftFillOpacity)&&void 0!==n?n:.5:void 0,this._outliersStyle=this._spec.outliersStyle}initMark(){const t={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._boxPlotMark=this._createMark(wN.mark.boxPlot,{isSeriesMark:!0},t),this._outlierMark=this._createMark(wN.mark.outlier,{key:bT,dataView:this._outlierDataView.getDataView(),dataProductId:this._outlierDataView.getProductId()},t)}initMarkStyle(){var t,e,i,s,n;const r=this._boxPlotMark;if(r){const i={direction:this._direction,lineWidth:this._lineWidth,shaftShape:this._shaftShape,fill:null!==(t=this._boxFillColor)&&void 0!==t?t:"line"===this._shaftShape?"#FFF":this.getColorAttribute(),minMaxFillOpacity:this._shaftFillOpacity,stroke:null!==(e=this._strokeColor)&&void 0!==e?e:"line"===this._shaftShape?this.getColorAttribute():"#000"},s="horizontal"===this._direction?Object.assign(Object.assign({y:this.dataToPositionY.bind(this)},i),{boxHeight:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Height:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}}):Object.assign(Object.assign({x:this.dataToPositionX.bind(this)},i),{boxWidth:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Width:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}});this.setMarkStyle(r,s,Sy.STATE_NORMAL,Py.Series)}const a=this._outlierMark;a&&this.setMarkStyle(a,{fill:null!==(s=null===(i=this._outliersStyle)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),size:h(null===(n=this._outliersStyle)||void 0===n?void 0:n.size)?this._outliersStyle.size:10,symbolType:"circle"},Sy.STATE_NORMAL,Py.Series)}initBoxPlotMarkStyle(){var t,e;const i=this._boxPlotMark,s="horizontal"===this._direction?this._xAxisHelper:this._yAxisHelper;if(i&&s){const{dataToPosition:e}=s,n=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{min:t=>ox(e(this.getDatumPositionValues(t,this._minField),{bandPosition:this._bandPosition}),n),q1:t=>ox(e(this.getDatumPositionValues(t,this._q1Field),{bandPosition:this._bandPosition}),n),median:t=>ox(e(this.getDatumPositionValues(t,this._medianField),{bandPosition:this._bandPosition}),n),q3:t=>ox(e(this.getDatumPositionValues(t,this._q3Field),{bandPosition:this._bandPosition}),n),max:t=>ox(e(this.getDatumPositionValues(t,this._maxField),{bandPosition:this._bandPosition}),n)},Sy.STATE_NORMAL,Py.Series)}const n=this._outlierMark;if(n&&s){const{dataToPosition:t}=s,i=null===(e=null==s?void 0:s.getScale)||void 0===e?void 0:e.call(s,0),r="horizontal"===this._direction?{y:this.dataToPositionY.bind(this),x:e=>ox(t(this.getDatumPositionValues(e,rN),{bandPosition:this._bandPosition}),i)}:{x:this.dataToPositionX.bind(this),y:e=>ox(t(this.getDatumPositionValues(e,rN),{bandPosition:this._bandPosition}),i)};this.setMarkStyle(n,r,Sy.STATE_NORMAL,Py.Series)}}initData(){if(super.initData(),!this._data)return;Cp(this._dataSet,"foldOutlierData",oN),Cp(this._dataSet,"addVChartProperty",UT);const t=new R(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${hh}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:"horizontal"===this._direction?this._fieldY:this._fieldX,outliersField:this._outliersField}}),t.transform({type:"addVChartProperty",options:{beforeCall:uL.bind(this),call:pL}},!1),this._outlierDataView=new lL(this._option,t)}compileData(){var t;super.compileData(),null===(t=this._outlierDataView)||void 0===t||t.compile()}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,e="horizontal"===this._direction?this._fieldY:this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(t){super.onLayoutEnd(t),this._autoBoxWidth=null}_initAnimationSpec(t={}){const e=E({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="line"===this._shaftShape?"boxplotScaleIn":"barBoxplotScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="line"===this._shaftShape?"boxplotScaleOut":"barBoxplotScaleOut")})),e}initAnimation(){var t,e,i,s,n,r,a;const o=JC(this);if(this._boxPlotMark){const e=this._initAnimationSpec(null===(t=Ql.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),i=this._initAnimationSpec(NC("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(zC(e,i,o))}if(this._outlierMark){const t={appear:null===(e=this._spec.animationAppear)||void 0===e?void 0:e.symbol,disappear:null===(i=this._spec.animationDisappear)||void 0===i?void 0:i.symbol,enter:null===(s=this._spec.animationEnter)||void 0===s?void 0:s.symbol,exit:null===(n=this._spec.animationExit)||void 0===n?void 0:n.symbol,update:null===(r=this._spec.animationUpdate)||void 0===r?void 0:r.symbol};this._outlierMark.setAnimationConfig(zC(null===(a=Ql.getAnimationInKey("scaleInOut"))||void 0===a?void 0:a(),t,o))}}initTooltip(){this._tooltipHelper=new lN(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){const t=super.getStatisticFields(),e=t.find((t=>t.key===this._outliersField));return e&&(e.operations=["array-min","array-max"]),t}onEvaluateEnd(t){super.onEvaluateEnd(t),this._outlierDataView.updateData()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}wN.type=Sl.boxPlot,wN.mark=AN;class TN extends gP{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{boxPlot:t.boxPlot,direction:null!==(e=t.direction)&&void 0!==e?e:"vertical",minField:t.minField,maxField:t.maxField,q1Field:t.q1Field,medianField:t.medianField,q3Field:t.q3Field,outliersField:t.outliersField,outliersStyle:t.outliersStyle});return s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),vy(t)}}class LN extends yP{constructor(){super(...arguments),this.transformerConstructor=TN,this.type="boxPlot",this.seriesType=Sl.boxPlot}}LN.type="boxPlot",LN.seriesType=Sl.boxPlot,LN.transformerConstructor=TN;const CN=t=>{let e=0;return t.forEach(((t,i)=>{var s;D(t.value)&&((null===(s=t.children)||void 0===s?void 0:s.length)?t.value=CN(t.children):t.value=0),e+=Math.abs(t.value)})),e};function EN(t){return t.depth}function DN(t,e){return e-1-t.endDepth}const ON=(t,e)=>(null==t?void 0:t.y0)-(null==e?void 0:e.y0),PN=(t,e)=>{if(D(t.value))return null;const i=(e?t.targetLinks:t.sourceLinks).reduce(((t,e)=>(D(e.value)?t.count+=1:t.sum+=e.value,t)),{sum:0,count:0});return i.count>0?(t.value-i.sum)/i.count:null},RN={left:EN,right:DN,justify:function(t,e){return t.sourceLinks.length?t.depth:e-1},center:function(t,e,i){return t.targetLinks.length?t.depth:t.sourceLinks.length?Ga(t.sourceLinks.map((t=>i[t.target].depth)))-1:0},start:EN,end:DN},BN=Kb(0,1);class IN{constructor(t){this._ascendingSourceBreadth=(t,e)=>ON(this._nodeMap[t.source],this._nodeMap[e.source])||t.index-e.index,this._ascendingTargetBreadth=(t,e)=>ON(this._nodeMap[t.target],this._nodeMap[e.target])||t.index-e.index,this.options=Object.assign({},IN.defaultOptions,t);const e=this.options.nodeKey,i=ws(e)?e:e?Dm(e):null;this._getNodeKey=i,this._logger=g.getInstance(),this._alignFunc=ws(this.options.setNodeLayer)?t=>this.options.setNodeLayer(t.datum):RN[this.options.nodeAlign]}layout(t,e){if(!t)return null;const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};dN(this.options.direction)?this._viewBox={x0:i.y0,x1:i.y1,y0:i.x0,y1:i.x1,width:i.height,height:i.width}:this._viewBox=i;const s=this.computeNodeLinks(t),n=s.nodes;let r=s.links;if(this._nodeMap=s.nodeMap,this.computeNodeValues(n),this.computeNodeDepths(n),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(n),this._maxDepth<=1)return null;const a=this.computeNodeBreadths(n);if(this.computeLinkBreadths(n),n.forEach((t=>{t.sourceLinks=t.sourceLinks.filter((t=>!D(t.source)&&!D(t.target))),t.targetLinks=t.targetLinks.filter((t=>!D(t.source)&&!D(t.target)))})),r=r.filter((t=>!D(t.source)&&!D(t.target))),dN(this.options.direction))if(this.options.inverse){const t=this._viewBox.x1;n.forEach((e=>{const{y0:i,y1:s,x0:n,x1:r}=e;e.y0=t-r,e.y1=t-n,e.x0=i,e.x1=s})),r.forEach((e=>{e.vertical=!0;const{x0:i,x1:s,y0:n,y1:r}=e;e.x0=n,e.x1=r,e.y0=t-i,e.y1=t-s}))}else n.forEach((t=>{const{y0:e,y1:i}=t;t.y0=t.x0,t.y1=t.x1,t.x0=e,t.x1=i})),r.forEach((t=>{t.vertical=!0;const e=t.x0,i=t.x1;t.x0=t.y0,t.x1=t.y1,t.y0=e,t.y1=i}));else this.options.inverse&&(n.forEach((t=>{const{x0:e,x1:s}=t;t.x0=i.x1-s,t.x1=i.x1-e})),r.forEach((t=>{t.x0=i.x1-t.x0,t.x1=i.x1-t.x1})));return r.forEach((t=>{const e=this._nodeMap[t.source],i=this._nodeMap[t.target];t.sourceRect={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},t.targetRect={x0:i.x0,x1:i.x1,y1:i.y1,y0:i.y0}})),{nodes:n,links:r,columns:a}}computeHierarchicNodeLinks(t){const e=[],i=[],s={},n={},r=[];CN(t);const a=(t,i,n)=>{t.forEach(((t,o)=>{const l=this._getNodeKey?this._getNodeKey(t):n?`${n[n.length-1].key}-${o}`:`${i}-${o}`,h=D(t.value)?0:PH(t.value);if(s[l])s[l].value=void 0;else{const n={depth:i,datum:t,index:o,key:l,value:h,sourceLinks:[],targetLinks:[]};s[l]=n,e.push(n)}n&&r.push({source:n[n.length-1].key,target:l,value:h,parents:n}),t.children&&t.children.length&&a(t.children,i+1,n?n.concat([s[l]]):[s[l]])}))};return a(t,0,null),r.forEach(((t,e)=>{const r=`${t.source}-${t.target}`,a=oD(t,["parents"]);if(a.parents=t.parents.map((t=>oD(t,["sourceLinks","targetLinks"]))),n[r])return n[r].value+=PH(t.value),void n[r].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};i.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),n[r]=o})),{nodes:e,links:i,nodeMap:s}}computeSourceTargetNodeLinks(t){const e=[],i=[],s={};t.nodes&&t.nodes.forEach(((t,i)=>{const n={depth:-1,datum:t,index:i,key:this._getNodeKey?this._getNodeKey(t):i,value:t.value,sourceLinks:[],targetLinks:[]};s[n.key]=n,e.push(n)}));const n=[];return t.links.forEach(((r,a)=>{const o=!D(r.source),l=!D(r.target);if(t.nodes&&(!s[r.source]||!s[r.target]))return;t.nodes||!o||s[r.source]||(s[r.source]={value:void 0,depth:-1,index:e.length,key:r.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.source])),t.nodes||!l||s[r.target]||(s[r.target]={value:void 0,depth:-1,index:e.length,key:r.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.target]));const h={index:a,source:r.source,target:r.target,datum:r,value:r.value};this.options.divideNodeValueToLink&&D(r.value)&&n.push(h),i.push(h),o&&s[r.source].sourceLinks.push(h),l&&s[r.target].targetLinks.push(h)})),this.options.divideNodeValueToLink&&n.length&&n.forEach((t=>{const e=[PN(s[t.source]),PN(s[t.target],!0)].filter((t=>!D(t)));e.length&&(t.value=Ga(e))})),{nodeMap:s,nodes:e,links:i}}computeNodeLinks(t){let e;"links"in t?e=this.computeSourceTargetNodeLinks(t):(this._isHierarchic=!0,e=this.computeHierarchicNodeLinks(t.nodes));let i=e.nodes;const s=e.links;if(this.options.linkSortBy)for(let t=0,e=i.length;tt.targetLinks.length||t.sourceLinks.length))),{nodes:i,links:s,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e{var i;return t+(null!==(i=PH(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=PH(e.value))&&void 0!==i?i:0)}),0))}}computeNodeDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link"),this._maxDepth=r}computeNodeEndDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){const e=this.options.nodeWidth,i=this.options.linkWidth,s=this.options.minStepWidth,n=this._viewBox.width;let r=null,a=null,o=!1;if(S(e)){const t=js(parseFloat(e.replace("%",""))/100,0,1);let i=n/(this._maxDepth-1+t);s>0&&(i=Math.max(s,i)),r=i*t,a=i*(1-t),o=!0}else if(h(e)){if(r=e,h(i))a=i;else if(D(i)){let t=(n-e)/(this._maxDepth-1);s>0&&(t=Math.max(s,t)),a=t-e}o=!0}else ws(e)&&h(i)&&(a=i);const l=[];for(let e=0,i=t.length;e{const i=e.reduce(((t,e)=>t+e.value),0),s=e.reduce(((t,e)=>t+this.options.nodeGap(e)),0);return Math.min(t,(this._viewBox.height-s)/i)}),1/0);else{const e=t.reduce(((t,e)=>Math.max(t,e.length)),0),i=this._viewBox.height/e,s=Math.min(this.options.nodeGap,i);if(a=()=>s,this._gapY=s,(n+s)*e>this._viewBox.height&&(n=i-s),this.options.equalNodeHeight)o=this._viewBox.height/e-s;else{const e=n>0?Math.max(s,n):s;r=t.reduce(((t,i)=>{const s=i.reduce(((t,e)=>t+e.value),0);return Math.min(t,(this._viewBox.height-((i.length-1)*e+n))/s)}),1/0)}}const l="start"===this.options.gapPosition,d=!l&&"end"!==this.options.gapPosition,c=h(this.options.nodeHeight)?t=>this.options.nodeHeight:ws(this.options.nodeHeight)?this.options.nodeHeight:o>0?t=>o:t=>Math.max(t.value*r,0),u=h(this.options.linkHeight)?()=>this.options.linkHeight:ws(this.options.linkHeight)?this.options.linkHeight:(t,e,i)=>Math.max(e.value?i*BN(t.value/e.value):0,s,0);for(let e=0,i=t.length;e0)if("start"===this.options.crossNodeAlign);else if("end"===this.options.crossNodeAlign)for(let t=0,e=i.length;t1&&(p/=i.length-1,r+p>=0)){r+=p,this._gapY=Math.min(r);for(let t=1,e=i.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}D(this.options.nodeSortBy)&&n.sort(ON),this.resolveCollisions(n,i)}}relaxRightToLeft(t,e,i){for(let s=t.length-2;s>=0;--s){const n=t[s];for(let t=0,i=n.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}void 0===this.options.nodeSortBy&&n.sort(ON),this.resolveCollisions(n,i)}}resolveCollisions(t,e){const i=t.length>>1,s=t[i];this.resolveCollisionsBottomToTop(t,s.y0-this._gapY,i-1,e),this.resolveCollisionsTopToBottom(t,s.y1+this._gapY,i+1,e),this.resolveCollisionsBottomToTop(t,this._viewBox.y1,t.length-1,e),this.resolveCollisionsTopToBottom(t,this._viewBox.y0,0,e)}resolveCollisionsTopToBottom(t,e,i,s){for(;i1e-6&&(n.y0+=r,n.y1+=r),e=n.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,s){for(;i>=0;--i){const n=t[i],r=(n.y1-e)*s;r>1e-6&&(n.y0-=r,n.y1-=r),e=n.y0-this._gapY}}targetTop(t,e){let i,s,n,r=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,s=t.sourceLinks.length;ii.y1||n?(e.y0=i.y1-e.thickness/2,n=!0):s+=e.thickness}let r=i.y0;n=!1;for(let t=0,e=i.targetLinks.length;ti.y1||n?(e.y1=i.y1-e.thickness/2,n=!0):r+=e.thickness}}}computeLinkBreadthsOverlap(t){const e=this.options.linkOverlap;for(let i=0,s=t.length;i{const i=new IN(t).layout(Array.isArray(e)?e[0]:e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});return i?[i]:[]},YN=(t,e,i)=>{e.forEach((e=>{D(e[i])||t.add(e[i]),e.children&&e.children.length>0&&YN(t,e.children,i)}))},jN=t=>{var e;if(!t||!y(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},HN=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new IN(e),r=[];return r.push(n.layout(s,i)),r},zN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},NN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class VN extends sL{constructor(){super(...arguments),this._getDimensionData=t=>{if(t.source){if(h(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const WN=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),GN=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"},UN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.y0-n/2),l=c(t.y1-n/2)):"end"===t.align?(o=c(t.y0+t.thickness/2-n),l=c(t.y1+t.thickness/2-n)):(o=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${a},${c(l-n/2)}L${c(a+n)},${c((l+p)/2)}L${a},${c(p+n/2)}`:"",_=t.startArrow&&g?`L${r},${c(u+n/2)}L${c(r-n)},${c((o+u)/2)}L${r},${c(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${m}L${a},${p}L${r},${u}${_}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${m}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${_}Z`:`M${r},${o}C${h},${o},${d},${l},${a},${l}\n ${m}L${a},${p}C${d},${p},${h},${u},${r},${u}${_}Z`},$N=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(c=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d)),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.x0-n/2),l=c(t.x1-n/2)):"end"===t.align?(o=c(t.x0+t.thickness/2-n),l=c(t.x1+t.thickness/2-n)):(o=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${c(l-n/2)},${a}L${c((l+p)/2)},${c(a+n)}L${c(p+n/2)},${a}`:"",_=t.startArrow&&g?`L${c(u+n/2)},${r}L${c((u+o)/2)},${c(r-n)}L${c(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${m}L${p},${a}L${u},${r}${_}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${m}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${_}Z`:`M${o},${r}C${o},${h},${l},${d},${l},${a}\n ${m}L${p},${a}C${p},${d},${u},${h},${u},${r}${_}Z`},XN=(t,e,i,s)=>{var n;const r=null!==(n=t.direction)&&void 0!==n?n:null==s?void 0:s.direction,a=["vertical","TB","BT"].includes(r)?$N:UN,o="number"==typeof t.ratio&&t.ratio>=0&&t.ratio<=1,l=Object.keys(t);return["x0","y0","x1","y1"].every((t=>l.includes(t)))?{back:{path:o?a(t,1):""},front:{path:a(t,o?t.ratio:1)}}:{}},KN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1),thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}},qN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0),thickness:t.getGraphicAttribute("thickness",!0),round:t.getGraphicAttribute("round",!0),align:t.getGraphicAttribute("align",!0),pathType:t.getGraphicAttribute("pathType",!0),endArrow:t.getGraphicAttribute("endArrow",!0),startArrow:t.getGraphicAttribute("startArrow",!0)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}},ZN=(t,e,i)=>{const s={thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign(Object.assign({x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0)},s),s),to:Object.assign({x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1)},s)}};class JN extends yx{constructor(){super(...arguments),this.type=JN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId(),s=this.getStyle("direction");this._product=e.glyph("linkPath",null!=t?t:e.rootMark).id(i).configureGlyph({direction:s}),this._compiledProductId=i}}JN.type="linkPath";const QN=Object.assign(Object.assign({},_L),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class tV extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}class eV extends QC{constructor(){super(...arguments),this.type=Sl.sankey,this.transformerConstructor=tV,this._nodeLayoutZIndex=Dy.Node,this._labelLayoutZIndex=Dy.Label,this._viewBox=new Kt,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(M(a))return a;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a,o;const l=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(l)return l;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._nodesSeriesData)||void 0===s?void 0:s.getLatestData())||void 0===n?void 0:n.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,o=null===(a=null===(r=this._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color");return null==o?void 0:o.scale(null==i?void 0:i[this._spec.seriesField])}const d=h(t.source)?this.getNodeList()[t.source]:t.source;return null===(o=this._colorScale)||void 0===o?void 0:o.scale(d)},this._handleEmphasisElement=t=>{var e,i,s,n,r;const a=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},o=t.item;"adjacency"===a.effect?o&&o.mark===(null===(i=this._nodeMark)||void 0===i?void 0:i.getProduct())?this._handleNodeAdjacencyClick(o):o&&o.mark===(null===(s=this._linkMark)||void 0===s?void 0:s.getProduct())?this._handleLinkAdjacencyClick(o):this._handleClearEmpty():"related"===a.effect&&(o&&o.mark===(null===(n=this._nodeMark)||void 0===n?void 0:n.getProduct())?this._handleNodeRelatedClick(o):o&&o.mark===(null===(r=this._linkMark)||void 0===r?void 0:r.getProduct())?this._handleLinkRelatedClick(o):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getProductElements();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getProductElements();if(!s||!s.length)return;const n=[Sy.STATE_SANKEY_EMPHASIS,Sy.STATE_SANKEY_EMPHASIS_REVERSE];i.forEach((t=>{t.removeState(n)})),s.forEach((t=>{t.removeState(n)})),this._needClear=!1},this._handleNodeAdjacencyClick=t=>{const e=t.getDatum(),i=[e.key];if(this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=t.getDatum(),r=(null==n?void 0:n.parents)?"parents":"source";if(Na(n[r]).includes(e.key)){let s;if(i.includes(n.source)||i.push(n.source),i.includes(n.target)||i.push(n.target),"parents"===r){const t=n.datum;s=(t?t.filter((t=>t.parents.some((t=>t.key===e.key)))).reduce(((t,e)=>t+e.value),0):0)/n.value}t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:s})}else n.target===e.key?i.includes(n.source)||i.push(n.source):(t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=t.getDatum(),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getProductElements();if(!e||!e.length)return;e.forEach((e=>{e===t?(e.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(Sy.STATE_SANKEY_EMPHASIS),e.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=t.getDatum(),s=this._nodeMark.getProductElements();if(!s||!s.length)return;const n=this._linkMark.getProductElements();if(n&&n.length){if("source"==((null===(e=n[0].getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const d=n.getDatum(),c=(null==d?void 0:d.parents)?"parents":"source";if(Na(d[c]).includes(i.key)){if(e.includes(null!==(a=d.key)&&void 0!==a?a:d.index)||e.push(null!==(o=d.key)&&void 0!==o?o:d.index),t.includes(d.source)||t.push(d.source),!t.includes(d.target)){t.push(d.target);let i=s.find((t=>t.data[0].key===d.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(d.target===i.key&&(e.includes(null!==(l=d.key)&&void 0!==l?l:d.index)||e.push(null!==(h=d.key)&&void 0!==h?h:d.index),!t.includes(d.source))){t.push(d.source);let i=s.find((t=>t.data[0].key===d.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;e.includes(null!==(s=t.getDatum().key)&&void 0!==s?s:t.getDatum().index)?(t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS)):(t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Na(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;rt.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const r=s.getDatum(),a=(null==r?void 0:r.parents)?"parents":"source",o=r.datum,l=o?o.filter((t=>t[a].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===r.source&&t.target===r.target));if(l&&l.length){t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target);const e=l.reduce(((t,e)=>t+e.value),0)/r.value;return s.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(Sy.STATE_SANKEY_EMPHASIS),void s.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target),s.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(Sy.STATE_SANKEY_EMPHASIS),void s.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:h.value/r.value});s.removeState(Sy.STATE_SANKEY_EMPHASIS),s.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}this._needClear=!0}},this._handleLinkRelatedClick=t=>{var e;const i=this._nodeMark.getProductElements();if(!i||!i.length)return;const s=this._linkMark.getProductElements();if(s&&s.length){if("source"==((null===(e=t.getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[Sy.STATE_SANKEY_EMPHASIS,Sy.STATE_SANKEY_EMPHASIS_REVERSE];this._linkMark&&s.forEach((e=>{e.removeState(t)})),this._nodeMark&&i.forEach((e=>{e.removeState(t)}))}else{const e=t.getDatum(),n=[e.source,e.target],r=[];Na(e.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;st.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),s.forEach((t=>{const i=t.getDatum(),s=i.datum;if(i.source===e.source&&i.target===e.target)return t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:1});const a=s?s.filter((t=>{const i=t.parents.map((t=>t.key));return i.includes(e.source)&&i.includes(e.target)})):null;if(a&&a.length){n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target);const s=a.filter((t=>t.parents.some(((i,s)=>{var n;return i.key===e.source&&(null===(n=t.parents[s+1])||void 0===n?void 0:n.key)===e.target})))).reduce(((t,e)=>t+e.value),0),r=s/i.value;return t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:r})}const o=r.find((t=>t.source===i.source&&t.target===i.target));if(o)return n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target),t.removeState(Sy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(Sy.STATE_SANKEY_EMPHASIS),void t.addState(Sy.STATE_SANKEY_EMPHASIS,{ratio:o.value/i.value});t.removeState(Sy.STATE_SANKEY_EMPHASIS),t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._highLightElements(i,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var t,e,i,s;super.initData();const n=this.getViewData(),r=this.getRawData();if(r&&n){Cp(this._dataSet,"sankeyLayout",HN),Cp(this._dataSet,"sankeyFormat",jN),r.transform({type:"sankeyFormat"},!1),n.transform({type:"sankeyLayout",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,crossNodeAlign:this._spec.crossNodeAlign,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,minLinkHeight:this._spec.minLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse},level:zp.sankeyLayout});const{dataSet:a}=this._option;Cp(a,"sankeyNodes",zN),Cp(a,"flatten",EH);const o=new R(a,{name:`sankey-node-${this.id}-data`});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:uL.bind(this),call:pL}},!1),this._nodesSeriesData=new lL(this._option,o),Cp(a,"sankeyLinks",NN);const l=new R(a,{name:`sankey-link-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyLinks"}),l.transform({type:"addVChartProperty",options:{beforeCall:uL.bind(this),call:pL}},!1),this._linksSeriesData=new lL(this._option,l)}}compileData(){var t,e;super.compileData(),null===(t=this._linksSeriesData)||void 0===t||t.compile(),null===(e=this._nodesSeriesData)||void 0===e||e.compile()}initMark(){var t,e,i,s;const n=this._createMark(eV.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId(),stateSort:null===(t=this._spec.node)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.node)||void 0===e?void 0:e.customShape});n&&(n.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=n);const r=this._createMark(eV.mark.link,{dataView:this._linksSeriesData.getDataView(),dataProductId:this._linksSeriesData.getProductId(),stateSort:null===(i=this._spec.link)||void 0===i?void 0:i.stateSort},{setCustomizedShape:null===(s=this._spec.link)||void 0===s?void 0:s.customShape});r&&(this._linkMark=r)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.getLatestData(),i=Na(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.getLatestData(),i=Na(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},Sy.STATE_NORMAL,Py.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",Py.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness,direction:this.direction},Sy.STATE_NORMAL,Py.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",Py.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}_createText(t,e){if(D(t)||D(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=KT(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),NC("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(zC(null===(s=Ql.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),NC("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData.getDataView())||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData.getDataView())||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:Vd.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodesSeriesData.updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linksSeriesData.updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{t.removeState([Sy.STATE_SANKEY_EMPHASIS_REVERSE,Sy.STATE_SANKEY_EMPHASIS]),e.includes(t.getDatum().key)||t.addState(Sy.STATE_SANKEY_EMPHASIS_REVERSE)}))}initTooltip(){this._tooltipHelper=new VN(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!D(a[0])||(a=this.getNodeList(),a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new nx;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{M(t[i])&&e.add(t[i]),M(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return YN(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?y(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}eV.type=Sl.sankey,eV.transformerConstructor=tV,eV.mark=QN;const iV=()=>{fc.registerTransform("sankey",{transform:FN,markPhase:"beforeJoin"},!0),jP(),fc.registerGlyph("linkPath",{back:"path",front:"path"}).registerFunctionEncoder(XN).registerChannelEncoder("backgroundStyle",((t,e)=>({back:e}))).registerDefaultEncoder((()=>({back:{zIndex:0},front:{zIndex:1}}))),fc.registerAnimationType("linkPathGrowIn",KN),fc.registerAnimationType("linkPathGrowOut",qN),fc.registerAnimationType("linkPathUpdate",ZN),pN(),XA(),VA(),Ql.registerMark(JN.type,JN),EF(),Ql.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:WN(t,e)},DC))),Ql.registerAnimation("sankeyLinkPath",((t,e)=>({appear:GN(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),PC(),Ql.registerSeries(eV.type,eV)};class sV extends pP{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,sourceField:t.sourceField,targetField:t.targetField,direction:t.direction,nodeAlign:t.nodeAlign,crossNodeAlign:t.crossNodeAlign,nodeGap:t.nodeGap,nodeWidth:t.nodeWidth,linkWidth:t.linkWidth,minStepWidth:t.minStepWidth,minNodeHeight:t.minNodeHeight,minLinkHeight:t.minLinkHeight,dropIsolatedNode:t.dropIsolatedNode,nodeHeight:t.nodeHeight,linkHeight:t.linkHeight,equalNodeHeight:t.equalNodeHeight,linkOverlap:t.linkOverlap,iterations:t.iterations,nodeKey:t.nodeKey,linkSortBy:t.linkSortBy,nodeSortBy:t.nodeSortBy,setNodeLayer:t.setNodeLayer,node:t.node,link:t.link,label:t.label,emphasis:t.emphasis,inverse:t.inverse}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class nV extends yP{constructor(){super(...arguments),this.transformerConstructor=sV,this.type="sankey",this.seriesType=Sl.sankey}_setStateInDatum(t,e,i,s,n){const r=y(i)?i[0]:i,a=r?Object.keys(r):null;this.getRegionsInQuerier(n).forEach((i=>{if(!r)return void i.interaction.clearEventElement(t,!0);let n=!1;i.getSeries().forEach((e=>{var o,l;let h=null;e.getMarksWithoutRoot().forEach((o=>{if("text"===o.type)return;let l=null;const d=o.getProduct();d&&((!s||ws(s)&&s(e,o))&&(l=d.elements.find((t=>a.every((e=>{var i;let s=null===(i=t.getDatum())||void 0===i?void 0:i.datum;return y(s)&&(s=s[0]),r[e]==(null==s?void 0:s[e])}))))),l&&(n=!0,i.interaction.startInteraction(t,l),(d.id().includes("node")||d.id().includes("link"))&&(h=l)))})),h&&(null===(l=(o=e)._handleEmphasisElement)||void 0===l||l.call(o,{item:h}))})),e&&n&&i.interaction.reverseEventElement(t)}))}}nV.type="sankey",nV.seriesType=Sl.sankey,nV.transformerConstructor=sV;class rV extends sL{constructor(){super(...arguments),this._getMeasureData=t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]]}}const aV=Object.assign({},TP);class oV extends CP{constructor(){super(...arguments),this.type=Sl.rangeArea}initMark(){var t;const{customShape:e,stateSort:i}=null!==(t=this._spec.area)&&void 0!==t?t:{};this._areaMark=this._createMark(oV.mark.area,{groupKey:this._seriesField,isSeriesMark:!0,stateSort:i},{setCustomizedShape:e,morphElementKey:this.getDimensionField()[0]})}initMarkStyle(){this.initAreaMarkStyle()}initAreaMarkStyle(){const t=this._areaMark;t&&(super.initAreaMarkStyle(),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x1:t=>{if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}},"normal",Py.Series):this.setMarkStyle(this._areaMark,{y1:t=>{if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}},"normal",Py.Series),this.setMarkStyle(t,{stroke:!1},"normal",Py.Series))}initTooltip(){this._tooltipHelper=new rV(this)}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.fieldY;return!!(t&&t.latestData&&e.length)&&e.every((e=>t.latestData[e]&&t.latestData[e].allValid))}}oV.type=Sl.rangeArea,oV.mark=aV;class lV extends gP{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign({},super._getDefaultSeriesSpec(t));return s.area=t.area,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),vy(t)}}class hV extends yP{constructor(){super(...arguments),this.transformerConstructor=lV,this.type="rangeArea",this.seriesType=Sl.rangeArea}}function dV(t){if(t)return t.type===ed.Band?t.bandwidth():t.type===ed.Point?t.step():void 0}hV.type="rangeArea",hV.seriesType=Sl.rangeArea,hV.transformerConstructor=lV;class cV extends Gm{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});const e=this.spec.encode[t];if(e&&"update"===t){const i=this.parameters(),s=Gp(e)?null:Object.keys(e).reduce(((t,s)=>(Am(e[s])&&(t[s]=$p(e[s].scale,i)),t)),{});this._encoders[t]={callback:(t,i,n)=>{const r=Pm(e,t,i,n);if(D(r.size)){const t=s.x?dV(s.x):void 0,e=s.y?dV(s.y):void 0;D(t)&&D(e)?r.size=10:D(t)?r.size=e:D(e)&&(r.size=t),r.size=[t,e]}return D(r.shape)&&(r.shape="rect"),r}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if(h(i.padding)&&i.padding>0)t.size=y(i.size)?i.size.map((t=>Math.max(t-i.padding,1))):Math.max(i.size-i.padding,1);else if(y(i.padding)&&2===i.padding.length){const e=y(i.size)?i.size:[i.size,i.size];t.size=[Math.max(e[0]-i.padding[0],1),Math.max(e[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(ym.symbol)}release(){super.release(),this._encoders=null}}cV.markType=Qd.cell;class uV extends lE{constructor(){super(...arguments),this.type=uV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{padding:0})}}uV.type="cell";function pV(t){return!1===t?{}:{type:"fadeIn"}}class gV extends sL{enableByType(t){return"dimension"!==t}}const mV=Object.assign(Object.assign({},_L),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class _V extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class fV extends QC{constructor(){super(...arguments),this.type=Sl.heatmap,this.transformerConstructor=_V}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Na(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._cellMark=this._createMark(fV.mark.cell,{isSeriesMark:!0,stateSort:null===(t=this._spec.cell)||void 0===t?void 0:t.stateSort},Object.assign(Object.assign({},n),{setCustomizedShape:null===(e=this._spec.cell)||void 0===e?void 0:e.customShape,morph:GC(this._spec,fV.mark.cell.name),morphElementKey:this.getDimensionField()[0]})),this._backgroundMark=this._createMark(fV.mark.cellBackground,{stateSort:null===(i=this._spec.cellBackground)||void 0===i?void 0:i.stateSort},Object.assign(Object.assign({},n),{setCustomizedShape:null===(s=this._spec.cellBackground)||void 0===s?void 0:s.customShape}))}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",Py.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=bD(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",Py.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}initInteraction(){this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=JC(this);this._cellMark.setAnimationConfig(zC(null===(i=Ql.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),NC("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new gV(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}fV.type=Sl.heatmap,fV.mark=mV,fV.transformerConstructor=_V;const vV=()=>{EF(),Ql.registerMark(uV.type,uV),Mx(),Uv(),HA(),fc.registerGraphic(Qd.cell,Ev),fc.registerMark(Qd.cell,cV),Ql.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},DC),{appear:pV(e)}))),qO(),dP(),Ql.registerSeries(fV.type,fV)};class yV extends gP{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{valueField:t.valueField,cell:t.cell})}}class bV extends yP{constructor(){super(...arguments),this.transformerConstructor=yV,this.type="heatmap",this.seriesType=Sl.heatmap}}bV.type="heatmap",bV.seriesType=Sl.heatmap,bV.transformerConstructor=yV;const xV=Object.assign(Object.assign({},_L),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),SV=(t,e)=>{const i=ws(e)?e:t=>t;let s,n;if(t&&t.length){const e=t.length;for(let r=0;r{var i,s,n,r,a,o,l,d,c,u,p,g,m,_,f;if(!t||!(null==e?void 0:e.view)||!y(t))return t;const v=e.view();if(v.x1-v.x0==0||v.y1-v.y0==0||v.x1-v.x0==-1/0||v.x1-v.x0==1/0||v.y1-v.y0==-1/0||v.y1-v.y0==1/0)return t;const b=At(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=At(null!==(s=e.endAngle)&&void 0!==s?s:270),S=Math.max((v.x1-v.x0)/2,(v.y1-v.y0)/2),M=OH(null!==(n=e.innerRadius)&&void 0!==n?n:0,S),k=OH(e.outerRadius,S),A=[h(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:v.x0+OH(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",v.x1-v.x0),h(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:v.y0+OH(null!==(c=null===(d=e.center)||void 0===d?void 0:d[1])&&void 0!==c?c:"50%",v.y1-v.y0)],w=Dm(e.field),T=t.map(w),[L,C]=SV(T),E=L===C?t=>(M+k)/2:t=>M+(k-M)*(t-L)/(C-L),O=D(e.radiusField)?w:Dm(e.radiusField),P=null!==(p=null===(u=null==e?void 0:e.radiusRange)||void 0===u?void 0:u[1])&&void 0!==p?p:5;let R=t=>P;if(O){const[i,s]=O!==w?SV(t.map(O)):[L,C],n=null!==(m=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==m?m:5,r=null!==(f=null===(_=e.radiusRange)||void 0===_?void 0:_[1])&&void 0!==f?f:5;i!==s&&(R=t=>n+(r-n)*(O(t)-i)/(s-i))}const B=Math.min(b,x),I=Math.max(b,x),F=TV(B,I,t.length),Y=[],j=(I-B)/60;return t.forEach(((t,e)=>{const i=E(T[e]),s=R(t);let n,r,a=F[e];for(let t=0;t<60&&(n=A[0]+i*Math.cos(a),r=A[1]+i*Math.sin(a),LV({x:n,y:r,size:s},Y)||n-sv.x1||r-sv.y1);t++)t<59&&(a+=j,a>I?a=B:a{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const d=[];let c=t;for(;l=2&&(r/=2,n*=2));return d},LV=(t,e)=>!(!e||!e.length)&&e.some((e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2){if(!t||!y(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[bT]:null==n?void 0:n[bT],[ST]:null==n?void 0:n[ST]}};class EV extends yx{constructor(){super(...arguments),this.type=EV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.glyph("ripplePoint",null!=t?t:e.rootMark).id(i),this._compiledProductId=i}}EV.type="ripple";const DV=()=>{Ql.registerMark(EV.type,EV),fc.registerGlyph("ripplePoint",{symbol:"symbol",ripple0:"symbol",ripple1:"symbol",ripple2:"symbol"}).registerFunctionEncoder(((t,e,i,s)=>{var n;const r=Math.max(0,Math.min(t.ripple,1)),a=null!==(n=t.size)&&void 0!==n?n:i.getGraphicAttribute("size"),o=.5*a;return{ripple0:{size:a+o*r,fillOpacity:.75-.25*r},ripple1:{size:a+o*(1+r),fillOpacity:.5-.25*r},ripple2:{size:a+o*(2+r),fillOpacity:.25-.25*r}}})).registerDefaultEncoder((()=>({ripple0:{fillOpacity:.75},ripple1:{fillOpacity:.5},ripple2:{fillOpacity:.25}}))),pN(),XA(),UA()},OV=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class PV extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class RV extends dI{constructor(){super(...arguments),this.type=Sl.correlation,this.transformerConstructor=PV,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){M(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){M(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){var t,e,i;if(super.initData(),!this._data)return;Cp(this._dataSet,"correlation",wV);const s=new f;Ep(s,"dataview",b),Cp(s,"correlationCenter",CV);const n=new R(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new lL(this._option,n)}compileData(){var t;super.compileData(),null===(t=this._centerSeriesData)||void 0===t||t.compile()}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){var t,e,i,s;const n=this._createMark(RV.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:bT,stateSort:null===(t=this._spec.nodePoint)||void 0===t?void 0:t.stateSort},{setCustomizedShape:null===(e=this._spec.nodePoint)||void 0===e?void 0:e.customShape});n&&(n.setMarkConfig({zIndex:Dy.Node}),this._nodePointMark=n);const r=this._createMark(RV.mark.ripplePoint,{key:bT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});r&&(this._ripplePointMark=r);const a=this._createMark(RV.mark.centerPoint,{key:bT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId(),stateSort:null===(i=this._spec.centerPoint)||void 0===i?void 0:i.stateSort},{setCustomizedShape:null===(s=this._spec.centerPoint)||void 0===s?void 0:s.customShape});a&&(a.setMarkConfig({zIndex:Dy.Node}),this._centerPointMark=a)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[MV],y:t=>t[kV],size:t=>t[AV],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},Sy.STATE_NORMAL,Py.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},Sy.STATE_NORMAL,Py.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},Sy.STATE_NORMAL,Py.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},Sy.STATE_NORMAL,Py.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),NC("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}RV.type=Sl.correlation,RV.mark=xV,RV.transformerConstructor=PV;class BV extends pP{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,sizeField:t.sizeField,sizeRange:t.sizeRange,centerX:t.centerX,centerY:t.centerY,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,ripplePoint:t.ripplePoint,centerPoint:t.centerPoint,centerLabel:t.centerLabel,nodePoint:t.nodePoint,label:t.label}),i=Sl.correlation;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class IV extends yP{constructor(){super(...arguments),this.transformerConstructor=BV,this.type="correlation",this.seriesType=Sl.correlation}}IV.type="correlation",IV.seriesType=Sl.correlation,IV.transformerConstructor=BV;class FV extends hP{constructor(){super(...arguments),this.type=r.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),wE(this._regions,(t=>{Ad(this.getOrient())?tD(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):tD(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=Pl({},this._spec.tick,null===(t=this._spec.layers)||void 0===t?void 0:t[0])}_initData(){var t;if(super._initData(),null===(t=this._spec.layers)||void 0===t?void 0:t[1]){const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_layer_1_ticks`}).parse(this._scale,{type:"scale"}).transform({type:`${this.type}-ticks`,options:Object.assign(Object.assign({},this._tickTransformOption()),{tickCount:this._spec.layers[1].tickCount,forceTickCount:this._spec.layers[1].forceTickCount,tickStep:this._spec.layers[1].tickStep})},!1);this._layerTickData=new gx(this._option,t)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}_getLabelFormatMethod(){var t,e,i,s,n,r,a,o;const l=$T.getInstance(),h=(null===(e=null===(t=this._spec.layers)||void 0===t?void 0:t[1])||void 0===e?void 0:e.timeFormat)||"%Y%m%d",d="local"===((null===(s=null===(i=this._spec.layers)||void 0===i?void 0:i[1])||void 0===s?void 0:s.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat,c=(null===(r=null===(n=this._spec.layers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.timeFormat)||"%Y%m%d",u="local"===((null===(o=null===(a=this._spec.layers)||void 0===a?void 0:a[0])||void 0===o?void 0:o.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat;return(t,e,i,s,n)=>{var r;let a;return a=0===n?u(c,t):d(h,t),(null===(r=this._spec.label)||void 0===r?void 0:r.formatMethod)?this._spec.label.formatMethod(a,e):a}}getLabelItems(t){var e,i;const s=[],n=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();n&&n.length&&s.push(n.map((e=>QE(e.value,this._getNormalizedValue([e.value],t)))));const r=null===(i=this._layerTickData)||void 0===i?void 0:i.getLatestData();return r&&r.length&&s.push(r.map((e=>QE(e.value,this._getNormalizedValue([e.value],t))))),s}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,oP),t}transformScaleDomain(){}}FV.type=r.cartesianTimeAxis,FV.specKey="axes";class YV{nice(t=10,e){var i,s,n,r;const a=this._domain;let o=[],l=null;if(e){const t=Ib(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,l=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else l="all";if(l){const t=((t,e)=>{const i=t.slice();let s=0,n=i.length-1,r=i[s],a=i[n];return aMath.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(n=o[1])&&void 0!==n?n:t[t.length-1]:"max"===l&&(t[0]=null!==(r=o[0])&&void 0!==r?r:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function jV(t){return e=>-t(-e)}function HV(t=Number.EPSILON){return e=>Math.max(e,t)}class zV extends qb{constructor(){super(pb(10),ub(10)),this.type=ed.Log,this._limit=HV(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new zV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=pb(this._base),s=ub(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=jV(i),this._pows=jV(s),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=hb,this.untransformer=db):(this._logs=i,this._pows=s,this._limit=HV(),this.transformer=this._logs,this.untransformer=s),this}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._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return ab}d3Ticks(t=10,e){const i=this.domain(),s=this._limit(i[0]),n=this._limit(i[i.length-1]);return Yb(s,n,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Hb(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}tw(zV,YV);class NV extends hP{constructor(){super(...arguments),this.type=r.cartesianLogAxis,this._zero=!1,this._scale=new zV}initScales(){var t;super.initScales(),this._scale.base(null!==(t=this._spec.base)&&void 0!==t?t:10),this._scale.clamp(!0,null,!1)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,oP),t}transformScaleDomain(){}}NV.type=r.cartesianLogAxis,NV.specKey="axes",tw(NV,nP);class VV extends Zb{constructor(){super(gb(1),mb(1)),this.type=ed.Symlog,this._const=1}clone(){return(new VV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=gb(t),this.untransformer=mb(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),s=i[0],n=i[i.length-1];return Yb(s,n,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Hb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}tw(VV,YV);class WV extends hP{constructor(){super(...arguments),this.type=r.cartesianSymlogAxis,this._zero=!1,this._scale=new VV}initScales(){var t;super.initScales(),this._scale.constant(null!==(t=this._spec.constant)&&void 0!==t?t:10)}registerTicksTransform(){const t=`${this.type}-ticks`;return Cp(this._option.dataSet,t,oP),t}transformScaleDomain(){}}function GV(t){var e,i;const s=Object.assign({},t);return jm(t.style)||(s.textStyle=GE(t.style)),jm(t.textStyle)||Pl(s.textStyle,GE(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&GE(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&GE(s.background.style),s}WV.type=r.cartesianSymlogAxis,WV.specKey="axes",tw(WV,nP);class UV extends Bk{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute,s=bD(i),n=ca.group({x:s[3],y:s[0],pickable:t,childrenPickable:t});n.name=pT.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+s[1]+s[3],this.attribute.height=r.height()+s[0]+s[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:s=0,background:n,minWidth:r,maxWidth:a,shape:o}=t,l={x:0,y:0,text:e,textStyle:i,padding:bD(s),minWidth:r,maxWidth:a};o&&o.visible&&(l.shape=Object.assign({visible:!0},o.style),M(o.space)&&(l.space=o.space)),n&&n.visible&&(l.panel=Object.assign({visible:!0},n.style));const h=new PD(l);h.name=pT.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}function $V(){p_(),Uv(),cf()}const XV={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};$V();class KV extends Bk{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},KV.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current{let[s,n]=t;n=i-e?[e,i]:(s=Math.min(Math.max(s,e),i-r),[s,s+r])},tW={debounce:Kd,throttle:qd};ZV();class eW extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},eW.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:s,width:n,height:r,range:a}=this.attribute,o=this._sliderSize,[l,h]=this._getScrollRange();let d;if("vertical"===s){const t=i-this._viewPosition.y,e=js(t-o/2,l,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=js(t-o/2,l,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(a[1]-a[0])/2,d+(a[1]-a[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:s,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?s:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===$o.env?($o.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),$o.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:s}=this.stage.eventPointTransform(t);let n,r,a=0;const{width:o,height:l}=this.getSliderRenderBounds();return"vertical"===e?(r=s,a=r-this._prePos,n=a/l):(r=i,a=r-this._prePos,n=a/o),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[s,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:tW[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:s=[0,1]}=this.attribute,n=this.getScrollRange(),[r,a]=this._computeScrollValue(t),o=[n[0]+a,n[1]+a];this._dispatchEvent("scrollUp",{pre:i,value:QV(o,s[0],s[1])}),"browser"===$o.env?($o.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),$o.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:s=[0,1],range:n,realTime:r=!0}=this.attribute,a=QV(t,s[0],s[1]);if(e){const t=this._getSliderPos(a);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=a,r&&this._dispatchEvent("scrollDrag",{pre:n,value:a})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",tW[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:s,limitRange:n=[0,1],railStyle:r,sliderStyle:a,padding:o=2}=this.attribute,l=this.createOrUpdateChild("scrollbar-container",{},"group"),h=l.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this.getSliderRenderBounds(),c=this._getSliderPos(QV(s,n[0],n[1])),u=c[1]-c[0];let p;this._sliderSize=u,p="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const g=l.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{cornerRadius:this._getDefaultSliderCornerRadius()}),a),{boundsPadding:bD(o),pickMode:"imprecise"}),"rect");this._slider=g,this._container=l;const m=this._container.AABBBounds;this._viewPosition={x:m.x1,y:m.y1}}getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[s,n,r,a]=bD(i),o={x1:a,y1:s,x2:t-n,y2:e-r,width:Math.max(0,t-(a+n)),height:Math.max(0,e-(s+r))};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this.getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:n,y1:r}=this.getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[s*t[0]+r,s*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,s]=QV(t,0,1),{width:n,height:r,x1:a,y1:o}=this.getSliderRenderBounds(),l=this._sliderSize;return"horizontal"===e?QV([a+i*n,a+s*n],a,n-l):QV([o+i*r,o+s*r],o,r-l)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}eW.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};var iW=function(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{const e=t.target;if(e&&e.name&&e.name.startsWith(pT.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,s,n;const r=t.target;if(r&&r.name&&r.name.startsWith(pT.item)){const a=r.delegate,{selectMode:o="multiple"}=this.attribute;if(r.name===pT.focus||"focus"===o){const s=a.hasState(cT.focus);a.toggleState(cT.focus),s?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[cT.unSelected,cT.unSelectedHover,cT.focus],t),this._setLegendItemState(e,cT.selected,t)})):(this._setLegendItemState(a,cT.selected,t),this._removeLegendItemState(a,[cT.unSelected,cT.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[cT.selected,cT.selectedHover,cT.focus],t),this._setLegendItemState(e,cT.unSelected,t))})))}else{null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((t=>{t.removeState(cT.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=a.hasState(cT.selected),r=this._getSelectedLegends();if("multiple"===o){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(uT.legendItemClick,a,t);i?(this._removeLegendItemState(a,[cT.selected,cT.selectedHover],t),this._setLegendItemState(a,cT.unSelected,t)):(this._setLegendItemState(a,cT.selected,t),this._removeLegendItemState(a,[cT.unSelected,cT.unSelectedHover],t))}else this._setLegendItemState(a,cT.selected,t),this._removeLegendItemState(a,[cT.unSelected,cT.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[cT.selected,cT.selectedHover],t),this._setLegendItemState(e,cT.unSelected,t))}))}this._dispatchLegendEvent(uT.legendItemClick,a,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,cT.selected),this._removeLegendItemState(e,[cT.unSelected,cT.unSelectedHover])):(this._removeLegendItemState(e,[cT.selected,cT.selectedHover]),this._setLegendItemState(e,cT.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:s,maxHeight:n,defaultSelected:r,lazyload:a,autoPage:o}=this.attribute,{spaceCol:l=lT,spaceRow:h=hT}=t,d=this._itemsContainer,{items:c,isHorizontal:u,startIndex:p,isScrollbar:g}=this._itemContext,m=g?1:u?i:e;let _,{doWrap:f,maxWidthInCol:v,startX:b,startY:x,pages:S}=this._itemContext,k=0;for(let t=p,e=c.length;tthis._itemContext.currentPage*m);t++){a&&(this._itemContext.startIndex=t+1),_=c[t],_.id||(_.id=_.label),_.index=t;let e=!0;y(r)&&(e=r.includes(_.label));const i=this._renderEachItem(_,e,t,c),p=i.attribute.width,m=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,m),v=Math.max(p,v),this._itemMaxWidth=Math.max(p,this._itemMaxWidth),u?(M(s)&&(g&&o?(S=Math.ceil((b+p)/s),f=S>1):b+p>s&&(f=!0,b>0&&(S+=1,b=0,x+=m+h))),0===b&&0===x||i.setAttributes({x:b,y:x}),b+=l+p):(M(n)&&(g&&o?(S=Math.ceil((x+m)/n),f=S>1):n<=m?(S+=1,f=!0,x=0,t>0&&(b+=k+l)):nthis._itemContext.maxPages&&(g=this._renderPagerComponent()),g||(r.setAttribute("y",this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0),this._innerView.add(r))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,s){var n,r;const{label:a,value:o}=this.attribute.item,l=s.AABBBounds,h=i.AABBBounds,d=l.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:s.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(s.setAttribute("maxLineWidth",Math.max(e*(null!==(n=a.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=o.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,s){var n,r;const{id:a,label:o,value:l,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:p,autoEllipsisStrategy:g}=this.attribute.item,{shape:m,label:_,value:f,background:v}=this.attribute.item,b=this._handleStyle(m,t,e,i,s),x=this._handleStyle(_,t,e,i,s),S=this._handleStyle(f,t,e,i,s),k=this._handleStyle(v,t,e,i,s),A=bD(d);let w;!1===v.visible?(w=ca.group({x:0,y:0,cursor:null===(n=k.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(w,pT.item,t,w)):(w=ca.group(Object.assign({x:0,y:0},k.style)),this._appendDataToShape(w,pT.item,t,w,k.state)),w.id=`${null!=a?a:o}-${i}`,w.addState(e?cT.selected:cT.unSelected);const T=ca.group({x:0,y:0,pickable:!1});w.add(T);let L,C=0,E=0,O=0;if(m&&!1!==m.visible){const i=$d(b,"style.size",10);E=y(i)?i[0]||0:i,O=$d(m,"space",8);const s=ca.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),b.style));Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&D(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&D(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(s,pT.itemShape,t,w,b.state),s.addState(e?cT.selected:cT.unSelected),T.add(s)}let P=0;if(c){const e=$d(u,"size",10);L=ca.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0,boundsPadding:A},u),{visible:!0,pickMode:"imprecise"})),this._appendDataToShape(L,pT.focus,t,w),P=e}const R=_.formatMethod?_.formatMethod(o,t,i):o,B=sA(Object.assign(Object.assign({x:E/2+O,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=x.style)||void 0===r?void 0:r.fontSize},x.style),{text:R,_originText:_.formatMethod?o:void 0}));this._appendDataToShape(B,pT.itemLabel,t,w,x.state),B.addState(e?cT.selected:cT.unSelected),T.add(B);const I=$d(_,"space",8);if(M(l)){const s=$d(f,"space",c?8:0),n=f.formatMethod?f.formatMethod(l,t,i):l,r=sA(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:S.style.fontSize},S.style),{text:n,_originText:f.formatMethod?l:void 0}));if(this._appendDataToShape(r,pT.itemValue,t,w,S.state),r.addState(e?cT.selected:cT.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-A[1]-A[3]-E-O-I-P-s;this._autoEllipsis(g,t,B,r),f.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-E/2-A[1]-A[3]-P-s}):r.setAttribute("x",I+(B.AABBBounds.empty()?0:B.AABBBounds.x2))}else r.setAttribute("x",I+(B.AABBBounds.empty()?0:B.AABBBounds.x2));C=s+(r.AABBBounds.empty()?0:r.AABBBounds.x2),T.add(r)}else this._itemWidthByUser?(B.setAttribute("maxLineWidth",this._itemWidthByUser-A[1]-A[3]-E-O-P),C=I+(B.AABBBounds.empty()?0:B.AABBBounds.x2)):C=I+(B.AABBBounds.empty()?0:B.AABBBounds.x2);L&&(L.setAttribute("x",C),T.add(L));const F=T.AABBBounds,Y=F.width();if("right"===p){const t=F.x2,e=F.x1;T.forEachChildren(((i,s)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===L?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const j=F.height(),H=M(this.attribute.item.width)?this.attribute.item.width:Y+A[1]+A[3],z=this._itemHeightByUser||j+A[0]+A[2];return w.attribute.width=H,w.attribute.height=z,L&&L.setAttribute("visible",!1),T.translateTo(-F.x1+A[3],-F.y1+A[0]),w}_createPager(t){var e,i;const{disableTriggerEvent:s,maxRow:n}=this.attribute,r=t=>t<=99?99:t<=999?999:9999;return this._itemContext.isHorizontal?new KV(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:r(this._itemContext.pages)},E({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:s})):new KV(Object.assign({layout:"horizontal",total:r(this._itemContext.pages),disableTriggerEvent:s,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new eW(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e})):new eW(Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i){const{pager:s}=this.attribute,{totalPage:n,isHorizontal:r}=this._itemContext,a=s&&s.position||"middle";if(this._pagerComponent.setTotal(n),r){let s;s="start"===a?t:"end"===a?t+i-this._pagerComponent.AABBBounds.height()/2:t+i/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:e-this._pagerComponent.AABBBounds.width(),y:s})}else{let t;t="start"===a?0:"end"===a?e-this._pagerComponent.AABBBounds.width():(e-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:i-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){const{currentPage:s,totalPage:n,isHorizontal:r}=this._itemContext;this._pagerComponent.setScrollRange([(s-1)/n,s/n]),r?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:s=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,a=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let s;return 0===e[0]?s=1:1===e[1]?s=this._itemContext.totalPage:(s=e[0]*this._itemContext.totalPage,i.scrollByPosition?s+=1:s=Math.floor(s)+1),s}:t=>t.detail.current,o=t=>{const e=this._pagerComponent,i=e.getScrollRange(),{direction:s}=e.attribute,{width:n,height:r}=e.getSliderRenderBounds(),a="vertical"===s?t.deltaY/r:t.deltaX/n;e.setScrollRange([i[0]+a,i[1]+a],!0)},l=i=>{const o=a(i);if(o!==this._itemContext.currentPage){if(this._itemContext.currentPage=o,this._itemContext&&this._itemContext.startIndext.nativeEvent.preventDefault())),this.addEventListener("wheel",qd(o,t))}}else this._pagerComponent.addEventListener("toPrev",l),this._pagerComponent.addEventListener("toNext",l)}_renderPager(){const t=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,maxCol:s=1,maxRow:n=2,item:r={},pager:a={}}=this.attribute,{spaceCol:o=lT,spaceRow:l=hT}=r,h=this._itemsContainer,{space:d=dT,defaultCurrent:c=1}=a,u=iW(a,["space","defaultCurrent"]),{isHorizontal:p}=this._itemContext;let g,m=0,_=0,f=0,v=0,y=0,b=0,x=1;if(p){if(_=(n-1)*l+this._itemHeight*n,m=e,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),f=e-g.AABBBounds.width()-d,f<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{width:i,height:s}=t.attribute;f0&&t.setAttributes({x:y,y:b}),y+=o+i})),this._itemContext.startX=y,this._itemContext.startY=b,this._itemContext.pages=x;const i=Math.ceil(x/n);this._itemContext.totalPage=i,this._updatePositionOfPager(t,m,_)}else{if(m=this._itemMaxWidth*s+(s-1)*o,_=i,f=m,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),v=i-g.AABBBounds.height()-d-t,v<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;v0&&t.setAttributes({x:y,y:b}),b+=l+i}));const e=Math.ceil(x/s);this._itemContext.totalPage=e,this._updatePositionOfPager(t,m,_)}c>1&&(p?h.setAttribute("y",-(c-1)*(_+l)):h.setAttribute("x",-(c-1)*(m+o)));const S=ca.group({x:0,y:t,width:p?f:m,height:p?_:v,clip:!0,pickable:!1});return S.add(h),this._innerView.add(S),this._bindEventsOfPager(p?_+l:m+o,p?"y":"x"),!0}_renderScrollbar(){const t=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:s={},pager:n={}}=this.attribute,{spaceCol:r=lT,spaceRow:a=hT}=s,o=this._itemsContainer,{space:l=dT,defaultCurrent:h=1}=n,d=iW(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext;let u,p=0,g=0,m=0,_=0,f=1;if(c)p=e,g=e,m=this._itemHeight,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),this._updatePositionOfScrollbar(g,m,t);else{if(p=i,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),m=i-t,g=this._itemMaxWidth,m<=0)return this._innerView.removeChild(u),!1;const e=o.getChildren(),s=e.map((t=>t.attribute.height));if(1===s.length||s.every((t=>t===s[0]))){const t=s[0],i=m,n=Math.floor(i/(a+t));m=n*(a+t),f=Math.ceil(e.length/n)}else e.forEach(((t,e)=>{const{height:i}=t.attribute,s=f,n=_;f=Math.floor((_+i)/m)+1,_+=a+i,s!==f&&e===o.getChildren().length-1&&_-m>=1/3*i&&(m=n+i,f-=1)}));this._itemContext.totalPage=f,this._itemContext.pages=f,this._updatePositionOfScrollbar(g,m,t)}h>1&&(c?o.setAttribute("x",-(h-1)*(g+r)):o.setAttribute("y",-(h-1)*(m+a)));const v=ca.group({x:0,y:t,width:g,height:m,clip:!0,pickable:!1});return v.add(o),this._innerView.add(v),this._bindEventsOfPager(c?g:m,c?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(cT.selected)?this._setLegendItemState(t,cT.selectedHover,e):this._setLegendItemState(t,cT.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===pT.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(uT.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(cT.unSelectedHover)||t.hasState(cT.selectedHover))&&(i=!0),t.removeState(cT.unSelectedHover),t.removeState(cT.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(cT.unSelectedHover)&&!t.hasState(cT.selectedHover)||(i=!0),t.removeState(cT.unSelectedHover),t.removeState(cT.selectedHover)}));const s=t.getChildren()[0].find((t=>t.name===pT.focus),!1);s&&s.setAttribute("visible",!1),i&&this._dispatchLegendEvent(uT.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(uT.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let s=!1;t.hasState(e)||(s=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==pT.focus&&(s||t.hasState(e)||(s=!0),t.addState(e,!0))})),s&&this._dispatchLegendEvent(uT.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let s=!1;e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==pT.focus&&e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)}))})),s&&this._dispatchLegendEvent(uT.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(cT.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,s,n={}){t.name=e,t.data=i,t.delegate=s,t.states=E({},sW,n)}_dispatchLegendEvent(t,e,i){const s=this._getSelectedLegends();s.sort(((t,e)=>t.index-e.index));const n=s.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(cT.selected),currentSelectedItems:s,currentSelected:n,event:i})}_handleStyle(t,e,i,s,n){const r={};return t.style&&(ws(t.style)?r.style=t.style(e,i,s,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((a=>{t.state[a]&&(ws(t.state[a])?r.state[a]=t.state[a](e,i,s,n):r.state[a]=t.state[a])}))),r}release(){super.release(),this.removeAllEventListeners()}}nW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:lT,spaceRow:hT,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:dT,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};const rW=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},aW=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l}=e,h=a(),d=l();if(0===h.length&&d.length)return[];if(h.length===d.length)return t;const c={};h.forEach((t=>{c[t]=!0}));const u=null!==(i=o())&&void 0!==i?i:ST;return y(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===c[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===c[t.source]&&!0===c[t.target])))):M(u)&&(t=t.filter((t=>!0===c[r.getSeriesFieldValue(t,u)]))),t};class oW extends aD{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=Dy.Legend,this.layoutLevel=Oy.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{wE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),wE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=rl(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;M(s)&&(this._seriesUserId=Na(s)),M(e)&&(this._regionUserId=Na(e)),M(n)&&(this._seriesIndex=Na(n)),M(i)&&(this._regionUserIndex=Na(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(Im(e,t)||(i.reCompile=!0),i)}changeRegions(t){}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new gx(this._option,t),this._initSelectedData(),wE(this._regions,(t=>{t.event.on(zd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;D(t)||JSON.stringify(n)===JSON.stringify(t)||(wE(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(zd.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;il(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)Im(s,this._cacheAttrs)||this._legendComponent.setAttributes(Pl({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Pl({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());Im(t,this._cacheAttrs)||this._legendComponent.setAttributes(Pl({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),null===(i=this.getChart())||void 0===i||i.setLayoutTag(!0,null,!1),this.event.emit(zd.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}oW.specKey="legends";class lW extends oW{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(t){super.init(t),wE(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData()},level:zp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){Cp(this._option.dataSet,"discreteLegendFilter",aW),Cp(this._option.dataSet,"discreteLegendDataMake",rW);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return wE(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(D(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!nl(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return ws(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=jT(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const{title:i={},item:s={},pager:n={},background:r={},type:a,id:o,visible:l,orient:h,position:d,data:c,filter:u,regionId:p,regionIndex:g,seriesIndex:m,seriesId:_,padding:f}=t,v=function(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!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(uT.legendItemClick,(e=>{const i=$d(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(zd.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(uT.legendItemHover,(t=>{const e=$d(t,"detail");this.event.emit(zd.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(uT.legendItemUnHover,(t=>{const e=$d(t,"detail");this.event.emit(zd.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:il(s)?s:1,strokeOpacity:il(n)?n:1,opacity:il(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return ws(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=KT(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:d}=KT(o,l);l&&!o&&d&&(t.item.value.formatMethod=(t,e)=>d(l,t,e,a))}}lW.specKey="legends",lW.type=r.discreteLegend;const hW=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;il(n)&&(t=Math.min(n,t)),il(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},dW=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r}=e,a=i(),o=s(),l=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!As(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(a===n())return t;if(o&&!jm(a)){const[e,i]=a;return l(t)?VH(t,+e,+i,o):t.filter((t=>t[o]>=e&&t[o]<=i))}return t};var cW;function uW(t){return y(t)?t:[t,t]}function pW(t){return t?"ew-resize":"ns-resize"}!function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(cW||(cW={})),qV();class gW extends Bk{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},gW.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=js(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===$o.env?($o.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),$o.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:s,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{x:o,y:l}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=o,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=s):(h=l,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const p=js(d+u,0,c),g=this.calculateValueByPos(p);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,p,g):this._updateHandler(this._currentHandler,p,g),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===$o.env?($o.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),$o.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===$o.env?($o.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),$o.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n,inverse:r}=this.attribute;if(n===s)return;const{startHandler:a,endHandler:o}=this._getHandlers();let l,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(l=c,h=this._track.attribute.width,d=e):(l=u,h=this._track.attribute.height,d=i);const p=l-this._prePos;if(a){const t=this._isHorizontal?a.attribute.x:a.attribute.y,e=r?js(t+p,h,d):js(t+p,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(a,e,i)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,e=r?js(t+p,0,d-h):js(t+p,h,d),i=this.calculateValueByPos(e),s=null==a?void 0:a.attribute;this._updateHandler(o,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(s.x,o.attribute.x),width:Math.abs(s.x-o.attribute.x)}:{y:Math.min(s.y,o.attribute.y),height:Math.abs(s.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===$o.env?($o.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),$o.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n}=this.attribute;if(n===s)return;const r=this._startHandler,a=this._endHandler;let o,l,h,d;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,l=null==r?void 0:r.attribute.x,h=null==a?void 0:a.attribute.x,d=e):(o=t.viewY-this._rail.globalAABBBounds.y1,l=null==r?void 0:r.attribute.y,h=null==a?void 0:a.attribute.y,d=i);const c=this.calculateValueByPos(o);if(M(h)){const t=Math.abs(o-l)>Math.abs(o-h)?a:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:s,railHeight:n,min:r,max:a,inverse:o}=this.attribute;let l=0;return l=r===a?"start"===e?0:"end"===e?1:0:(t-r)/(a-r),(o?1-l:l)*("vertical"===i?n:s)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:s,min:n,max:r,inverse:a}=this.attribute,o="vertical"===e?s:i;return n+(r-n)*(a?1-t/o:t/o)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[s,n]=Na(t),{startHandler:r,endHandler:a}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(s),s),a&&this._updateHandler(a,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:s,railHeight:n,startText:r,endText:a,min:o,max:l,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;D(c)&&(c=[o,l]),this._currentValue={startValue:uW(c)[0],endValue:uW(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const p=ca.group({x:0,y:0});p.name=cW.innerView,this.add(p),this._innerView=p;let g,m=0;if(r&&r.visible){g=ca.text(Object.assign({x:u?0:s/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),g.name=cW.startText,p.add(g);const e=M(r.space)?r.space:0;m+=(u?g.AABBBounds.width():g.AABBBounds.height())+e}const _=ca.group({x:u?m:0,y:u?0:m});p.add(_);const f=ca.group({x:0,y:0});let v;if(f.name=cW.railContainer,this._railContainer=f,_.add(f),this._mainContainer=_,this._renderRail(f),m+=u?s:n,a&&a.visible){const t=M(a.space)?a.space:0;v=ca.text(Object.assign({x:u?m+t:s/2,y:u?n/2:m+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:a.text,lineHeight:null===(e=a.style)||void 0===e?void 0:e.fontSize},a.style)),v.name=cW.endText,p.add(v)}this._renderTrack(f),h&&(this._renderHandlers(_),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:s,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const a=ca.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},s));return a.name=cW.rail,t.add(a),this._rail=a,a}_renderHandlers(t){const{range:e,min:i,max:s,handlerSize:n=14,handlerStyle:r,handlerText:a,railHeight:o,railWidth:l,slidable:h}=this.attribute;let{value:d}=this.attribute;D(d)&&(d=[i,s]);const c=a&&a.visible,u=this._isHorizontal,[p,g]=uW(d),m=this.calculatePosByValue(p,e?"start":"end"),_=this._renderHandler(Object.assign({x:u?m:l/2,y:u?o/2:m,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":pW(u)},r));if(_.name=cW.startHandler,this._startHandler=_,t.add(_),this._currentValue.startPos=m,c){const i=this._renderHandlerText(p,e?"start":"end");i.name=cW.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(g,"end"),i=this._renderHandler(Object.assign({x:u?e:l/2,y:u?o/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":pW(u)},r));if(i.name=cW.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(g,"end");e.name=cW.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:s,railHeight:n,railWidth:r,trackStyle:a,railStyle:o,slidable:l,value:h}=this.attribute;let d,c;if(D(h))e?(d=i,c=s):d=c=i;else if(e){const t=QV(h,i,s);d=t[0],c=t[1]}else d=i,c=js(h,i,s);const u=this._isHorizontal;e||(d=i);const p=ca.group({x:0,y:0,width:r,height:n,cornerRadius:null==o?void 0:o.cornerRadius,clip:!0,pickable:!1});p.name=cW.trackContainer;const g=As(e)&&!0===e.draggableTrack;let m;m=!1===l?"default":!1===e||!1===g?"pointer":pW(u);const _=this.calculatePosByValue(d,"start"),f=this.calculatePosByValue(c,e?"end":"start"),v=ca.rect(Object.assign({x:u?Math.min(_,f):0,y:u?0:Math.min(_,f),width:u?Math.abs(f-_):r,height:u?n:Math.abs(f-_),cursor:m},a));v.name=cW.track,this._track=v,p.add(v),t.add(p)}_renderHandler(t){return ca.symbol(t)}_renderHandlerText(t,e){var i,s,n;const{align:r,handlerSize:a=14,handlerText:o={},railHeight:l,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),p=null!==(i=o.space)&&void 0!==i?i:4,g={text:o.formatter?o.formatter(t):t.toFixed(null!==(s=o.precision)&&void 0!==s?s:0),lineHeight:null===(n=o.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":pW(c)};return c?"top"===r?(g.textBaseline="bottom",g.textAlign="center",g.x=u,g.y=(l-a)/2-p):(g.textBaseline="top",g.textAlign="center",g.x=u,g.y=(l+a)/2+p):"left"===r?(g.textBaseline="middle",g.textAlign="end",g.x=(h-a)/2-p,g.y=u):(g.textBaseline="middle",g.textAlign="start",g.x=(h+a)/2+p,g.y=u),ca.text(Object.assign(Object.assign({},g),o.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:s,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:s/2,a=this._isHorizontal?i/2:0;if(e&&e.shape){const t=ca.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:a,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const o=e&&e.text||{},l=null!==(t=o.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?a-i/2-l:a+i/2+l,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=a,h.x="left"===n?r-s/2-l:a+s/2+l,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=ca.text(Object.assign(Object.assign({},h),o.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:s}=this.attribute,n=this._isHorizontal?i:s,r=this._tooltipState.pos*n,a=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[a]:r});const{align:o}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[a]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==o?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),As(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,s=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==s?void 0:s.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==s?void 0:s.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var s;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===cW.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(s=t.precision)&&void 0!==s?s:0),[n?"x":"y"]:e})}t.name===cW.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var s;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(s=r.precision)&&void 0!==s?s:0)});const a=t.name===cW.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[n?"x":"y"]:e}),t.name===cW.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}gW.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},JV(),qV();class mW extends UV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},mW.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!D(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:s,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:p,startText:g,endText:m,handlerText:_,showTooltip:f,tooltip:v,inverse:y,disableTriggerEvent:b}=this.attribute,x=[],S=(r-n)/(t.length-1);for(let e=0;e1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),s=e/g,n=i/g,r=n-s,a=t.filter((t=>t.offset>s&&t.offset{f.push({offset:(t.offset-s)/r,color:t.color})})),f.push({offset:1,color:_}),o.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}function _W(t="bottom"){let e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}mW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},JV(),qV(),TM();class fW extends UV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},fW.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,sizeBackground:v,disableTriggerEvent:y,inverse:b}=this.attribute,x=ca.group({x:0,y:0});this._innerView.add(x);const S=new gW({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l,handlerSize:h,handlerStyle:Object.assign({symbolType:_W(i)},d),railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,disableTriggerEvent:y,inverse:b});x.add(S);let M,k=0;"horizontal"===e?"top"===i?(M=`M0,0L${a},0L${b?0:a},12Z`,k=o):(M=`M0,12L${a},12L${b?0:a},0Z`,S.setAttribute("y",12)):"left"===i?M=`M${a},0L${a+12},${b?0:o}L${a},${o}Z`:(M=`M0,${b?0:o}L12,${o}L12,0Z`,S.setAttribute("x",12));const A=ca.path(Object.assign(Object.assign({x:0,y:k,path:M},v),{zIndex:0}));x.add(A);const w=this._title?this._title.AABBBounds.height()+$d(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,w-x.AABBBounds.y1),this._slider=S}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}fW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};const vW={color:mW,size:fW},yW=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],bW=[2,10];class xW extends oW{static getSpecInfo(t){const e=qT(t,this.specKey,this.type,(t=>{return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),wE(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData},level:zp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){Cp(this._option.dataSet,"continuousLegendFilter",dW),Cp(this._option.dataSet,"continuousLegendDataMake",hW);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>TE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=jT(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!nl(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=jT(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),jm(r)&&(r="color"===this._legendType?yW:bW);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},function(t){const e=Pl({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:d={},type:c,id:u,visible:p,orient:g,position:m,data:_,defaultSelected:f,field:v,filter:y,regionId:b,regionIndex:x,seriesIndex:S,seriesId:k,padding:A}=e,w=function(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{const i=$d(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(zd.legendFilter,{model:this,value:i,event:e})}),30))}}}xW.specKey="legends",xW.type=r.continuousLegend;const SW=(t,e)=>M(e)?t.map((t=>e[t])):void 0,MW=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),kW=t=>!D(t)&&(y(t)?t.length>0&&t.every(M):Object.keys(t).length>0),AW=["updateTitle","updateContent","updatePosition","maxLineCount","othersLine"],wW=t=>{const e=[];return t.forEach((t=>{t.data.forEach((t=>{M(t.series)&&e.push(t.series)}))})),e},TW={dom:`${hh}_TOOLTIP_HANDLER_DOM`,canvas:`${hh}_TOOLTIP_HANDLER_CANVAS`},LW={key:"其他",value:"..."},CW=["group","mark","dimension"];class EW{constructor(t){this._showTooltipByHandler=(t,e)=>{var i,s,n;if(D(t))return 1;e.changePositionOnly||this.clearCache(),this._updateViewSpec(t,e);const r=this._cacheActiveSpec;if(D(r)||!1===r.visible)return 1;e.tooltipSpec=this.component.getSpec(),e.activeTooltipSpec=r;const{title:a,content:o}=r,l=D(null==a?void 0:a.key)&&D(null==a?void 0:a.value)&&!(null==o?void 0:o.length);if(this.component.event.emit(zd.tooltipShow,Object.assign(Object.assign({},e),{isEmptyTooltip:l,tooltipData:t,activeType:this.activeType,tooltip:this.component})),l)return 1;let h;return(null===(i=r.handler)||void 0===i?void 0:i.showTooltip)?h=r.handler.showTooltip.bind(r.handler):(null===(s=this.component.tooltipHandler)||void 0===s?void 0:s.showTooltip)&&(h=this.component.tooltipHandler.showTooltip.bind(this.component.tooltipHandler)),h?null!==(n=h(this.activeType,t,e))&&void 0!==n?n:0:1},this.component=t}_preprocessDimensionInfo(t){const e=[];if(null==t||t.forEach((t=>{const i=Object.assign(Object.assign({},t),{data:t.data.filter((({series:t})=>{var e,i;return!1!==(null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.visible)}))});i.data.length>0&&e.push(i)})),e.length>0)return e}_updateViewSpec(t,e){var i,s,n,r,a,o,l,h,d;const{changePositionOnly:c,model:u}=e;if(!c||!this._cacheActiveSpec){const c=this.component.getSpec();if(this._cacheActiveSpec=((t,e,i,s,n)=>{var r,a,o;const l={activeType:t};switch(t){case"mark":case"group":if(i){const o=null===(r=i.getSpec())||void 0===r?void 0:r.tooltip;return l.visible=!0,(null==o?void 0:o.handler)&&(l.handler=o.handler),(null===(a=l.handler)||void 0===a?void 0:a.showTooltip)?l:((null==o?void 0:o[t])&&AW.forEach((e=>{M(o[t][e])&&(l[e]=o[t][e])})),Object.assign(Object.assign({},l),i.tooltipHelper.getTooltipData(t,e,s,s[0].datum,n)))}break;case"dimension":if(null==s?void 0:s.length){if(wW(s).every((t=>{var e;return!QT("dimension",null===(e=t.tooltipHelper)||void 0===e?void 0:e.spec)}))?l.visible=!1:l.visible=!0,l.handler=e.handler,null===(o=l.handler)||void 0===o?void 0:o.showTooltip)return l;const i=[];return s.forEach((r=>r.data.forEach((r=>{const{series:a}=r,o=a.tooltipHelper.getTooltipData(t,e,s,r.datum,n);o&&i.push(o)})))),function(t){if(!t||!t.length)return null;const e=[];return t.forEach((({content:t})=>{t&&t.forEach((t=>{e.push(t)}))})),e.length?Object.assign(Object.assign({},t[0]),{content:e}):t[0]}(i)}}return null})(this.activeType,this.component.getSpec(),u,t,e),this._cacheActiveSpec){D(this._cacheActiveSpec.handler)&&M(c.handler)&&(this._cacheActiveSpec.handler=c.handler);const u=null!==(i=c[this.activeType])&&void 0!==i?i:{},p=null!==(s=this._cacheActiveSpec.updateTitle)&&void 0!==s?s:u.updateTitle,g=null!==(n=this._cacheActiveSpec.updateContent)&&void 0!==n?n:u.updateContent,m=null!==(a=null!==(r=this._cacheActiveSpec.maxLineCount)&&void 0!==r?r:u.maxLineCount)&&void 0!==a?a:20;if(p&&(this._cacheActiveSpec.title=null!==(o=p(this._cacheActiveSpec.title,t,e))&&void 0!==o?o:this._cacheActiveSpec.title),g)this._cacheActiveSpec.content=null!==(l=g(this._cacheActiveSpec.content,t,e))&&void 0!==l?l:this._cacheActiveSpec.content;else if(m>=1&&(null===(h=this._cacheActiveSpec.content)||void 0===h?void 0:h.length)>m){const t=null!==(d=this._cacheActiveSpec.othersLine)&&void 0!==d?d:u.othersLine,e=t?Object.assign(Object.assign({},LW),t):LW;this._cacheActiveSpec.content=[...this._cacheActiveSpec.content.slice(0,m-1),Object.assign(Object.assign({},this._cacheActiveSpec.content[m-1]),e)]}}}}shouldHandleTooltip(t,e){var i,s;return!D(e)&&QT(this.activeType,null===(s=null===(i=t.model)||void 0===i?void 0:i.tooltipHelper)||void 0===s?void 0:s.spec)}clearCache(){this._cacheActiveSpec=void 0}}class DW extends EW{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){const s=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(t),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(t,s)}_getDimensionInfo(t){var e,i;let s;const n=this.component.getChart(),r=n.getCompiler().getStage().getLayer(void 0),a={x:t.event.viewX,y:t.event.viewY};if(r.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},a),s=[...null!==(e=Id(n,a,!0))&&void 0!==e?e:[],...null!==(i=kd(n,a))&&void 0!==i?i:[]],0===s.length)s=void 0;else if(s.length>1){const t=s.filter((t=>{var e;const i=t.axis;if(i.getSpec().hasDimensionTooltip)return!0;if(!ad(i.getScale().type))return!1;let s;for(const t of null!==(e=null==i?void 0:i.getRegions())&&void 0!==e?e:[]){for(const e of t.getSeries())if("cartesian"===e.coordinate){s=e;break}if(M(s))break}return M(s)&&s.getDimensionField()[0]===s.fieldY[0]?"left"===i.getOrient()||"right"===i.getOrient():"bottom"===i.getOrient()||"top"===i.getOrient()}));if(s=t.length?t:s.slice(0,1),s.length>1){const t=new Set;s.forEach((e=>{e.data=e.data.filter((({key:e})=>!t.has(e)&&(t.add(e),!0)))}))}}return s}getMouseEventData(t){return{tooltipInfo:this._getDimensionInfo(t),ignore:!1}}}class OW extends EW{constructor(){super(...arguments),this.activeType="group"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:Na(s),series:n}],a=Object.assign(Object.assign({},e),{groupDatum:this._getGroupDatum(e),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e,i;let s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.group;if(null==r?void 0:r.has(t.mark)){const n=this.component.getSpec()[this.activeType];((null==n?void 0:n.triggerMark)?Na(n.triggerMark):[]).includes(null===(i=t.mark)||void 0===i?void 0:i.name)&&(s={mark:t.mark,datum:t.datum,series:e})}}return{tooltipInfo:s,ignore:!1}}_getGroupDatum(t){const{model:e,mark:i,datum:s}=t,n=e;if(["line","area"].includes(i.type))return Na(s);const r=n.getViewData().latestData,a=n.getSeriesField();if(!a)return r;const o=Na(s)[0][a];return r.filter((t=>t[a]===o))}}class PW extends EW{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){var s,n,r;const{datum:a,series:o}=t,l=this.component.getSpec(),h=[{datum:[a],series:o}],d=o.tooltipHelper,c=null===(s=o.getSpec())||void 0===s?void 0:s.tooltip,u=null===(n=null==c?void 0:c.mark)||void 0===n?void 0:n.checkOverlap;let p=!1;if(!0===u||!0===(null===(r=l.mark)||void 0===r?void 0:r.checkOverlap)&&!1!==u){const t=null==d?void 0:d.activeTriggerSet.mark;if(t){p=!0;const i=this.component.getChart().getCompiler().getStage().getLayer(void 0),s={x:e.event.viewX,y:e.event.viewY};i.globalTransMatrix.transformPoint({x:e.event.viewX,y:e.event.viewY},s),t.forEach((t=>{t.getProductElements().forEach((t=>{const i=t.getGraphicItem();t!==e.item&&i&&i.containsPoint(s.x,s.y,le.GLOBAL,i.stage.getPickerService())&&h[0].datum.push(t.getDatum())}))}))}}const g=Object.assign(Object.assign({},e),{changePositionOnly:i,tooltip:this.component});if(i&&p){const t=this._cacheActiveSpec&&this._cacheActiveSpec.data;t&&t[0].series===h[0].series&&t[0].datum.length===h[0].datum.length&&!t[0].datum.some(((t,e)=>t!==h[0].datum[e]))||(g.changePositionOnly=!1)}return this._showTooltipByHandler(h,g)}getMouseEventData(t){var e;let i,s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.mark,a=null==n?void 0:n.ignoreTriggerSet.mark;(null==r?void 0:r.has(t.mark))?i={mark:t.mark,datum:t.datum,series:e}:(null==a?void 0:a.has(t.mark))&&(s=!0)}return{tooltipInfo:i,ignore:s}}}const RW=t=>M(t)&&!y(t),BW=t=>M(t)&&y(t);class IW extends rD{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i;const{spec:s,theme:n}=super._initTheme(t,e);return s.style=Pl({},this._theme,s.style),s.offset=Pl({},n.offset,t.offset),s.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:n.transitionDuration,{spec:s,theme:n}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h,d;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:vl(this._option.mode)||!_l(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.triggerOff=null!==(h=t.triggerOff)&&void 0!==h?h:t.trigger,t.confine=null!==(d=t.confine)&&void 0!==d?d:"canvas"===t.renderMode,M(t.parentElement)?S(t.parentElement)&&(t.parentElement=$o.getElementById(t.parentElement)):_l(this._option.mode)&&(t.parentElement=null==ml?void 0:ml.body)}}class FW extends aD{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=IW,this.specKey="tooltip",this.layoutType="none",this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{this._clickLock?(this._handleChartMouseOut(t),this._clickLock=!1):this._clickLock=!0},this._getMouseOutHandler=t=>e=>{var i,s,n,r;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const a=_l(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:o,clientY:l}=e.event;a&&t&&this._isPointerInChart({x:o,y:l})||(this._enterable?this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(r=this._spec.showDelay)&&void 0!==r?r:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{this._alwaysShow||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._handleMouseMove&&this._handleMouseMove.cancel&&this._handleMouseMove.cancel(),this._cacheEnterableRect=null,this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{var i,s,n;this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow||(this._clickLock?t&&(this._handleChartMouseOut(e),this._clickLock=!1):!t&&this._enterable&&(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(n=this._spec.showDelay)&&void 0!==n?n:50)):this._handleChartMouseMove(e,t))},this._handleChartMouseMove=(t,e)=>{const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1};for(let s=0,n=CW.length;s!t))&&!function(t){return D(t.mark)&&D(t.model)&&D(t.datum)}(t)&&(n&&RW(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):M(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),r.mark||r.group||r.dimension&&!D(s)?this._initEventOfTooltipContent():this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&yT.globalConfig.uniqueTooltip&&l&&yT.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(zd.tooltipHide,Object.assign(Object.assign({},t),{source:Nd.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;if(n.hideTooltip){const e=n.hideTooltip.call(n,t);return e||(this._isTooltipShown=!1),e}return 1},this.hideTooltip=()=>{const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:Nd.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}}isTooltipShown(){return this._isTooltipShown}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_registerEvent(){}_releaseEvent(){}onLayout(t){}onLayoutEnd(t){}onRender(t){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._hideTimer&&clearTimeout(this._hideTimer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(zd.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(zd.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?TW.canvas:TW.dom,n=Ql.getComponentPluginInType(t);n||bl("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip||!this._enterable)return;const i=null===(e=(t=this.tooltipHandler).getTooltipContainer)||void 0===e?void 0:e.call(t),s=null==i?void 0:i.firstChild;s&&(s.addEventListener("pointerenter",(()=>{var t;const e=null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s);e&&(this._cacheEnterableRect={x:e.x,y:e.y,width:e.width,height:e.height}),this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this._showTimer&&(clearTimeout(this._showTimer),this._showTimer=null)})),s.addEventListener("pointerleave",(()=>{var t,e;if(this._cacheEnterableRect){const i=null===(t=s.getBoundingClientRect)||void 0===t?void 0:t.call(s);i&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===i[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(e=this._spec.showDelay)&&void 0!==e?e:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.includes("dimension")&&(this.processor.dimension=new DW(this)),t.includes("group")&&(this.processor.group=new OW(this)),t.includes("mark")&&(this.processor.mark=new PW(this))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Na(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=this._option.mode;e.includes("hover")&&(this._handleMouseMove=this._throttle(this._getMouseMoveHandler(!1)),this._mountEvent("pointermove",{source:"chart"},this._handleMouseMove),(fl(i)||vl(i))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerleave",{source:"chart"},this._getMouseOutHandler(!1))),e.includes("click")?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){let e;return e=h(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10,qd(t,e)}reInit(t){var e,i;super.reInit(t),this.tooltipHandler?null===(i=(e=this.tooltipHandler).reInit)||void 0===i||i.call(e):this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(M(a.regionId)?[a.regionId]:void 0,M(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=((t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const d=e.getDimensionField(),c=e.getMeasureField(),u=e.getSeriesField(),p=M(u)?t[u]:void 0,g=M(u)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[u])||void 0===r?void 0:r.values)&&void 0!==a?a:[],m=SW(d,t);let _=SW(c,t);const f=kW(_),v=!f&&M(u)&&D(p)&&g.length>0,y=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(MW(d,m));if(!f&&(_=SW(c,i),!kW(_)))return;const n=e.type===Sl.pie?e.dataToCentralPosition(i):e.dataToPosition(i);D(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},series:e})};if("cartesian"===e.coordinate){const t=e,i=ad(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=d.map(((t,e)=>[t,e])).filter((([,t])=>D(null==m?void 0:m[t])));let r=[null!=m?m:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(v){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(MW(d,n));g.forEach((r=>{const o=a.find((t=>t[u]===r));if(_=SW(c,o),!kW(_))return;const l=t.dataToPosition(o);D(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(MW(d,n));if(!f&&(_=SW(c,r),!kW(_)))return;const o=t.dataToPosition(r);if(D(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===Sl.pie)y();else{const t=e;if(v){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(MW(d,m))).find((t=>t[u]===p));g.forEach((n=>{if(_=SW(c,i),!kW(_))return;const r=t.dataToPosition(i);D(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:n},series:e})}))}else y()}else"geo"===e.coordinate&&y()})),s})(t,l),d=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",c=l.getLayoutStartPoint(),u=l.getLayoutRect(),p=o.globalInstance.getContainer(),g=Object.assign({x:0,y:0},p?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(p):{}),m=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>MW(i,s)(t)&&MW(n,r)(t)&&(D(a)||MW([a],[o])(t))));return l},_=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),u.width),y:Math.min(Math.max(t.y,0),u.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:c.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:c.y+s.y;return{canvasX:n,canvasY:r,clientX:g.x+n,clientY:g.y+r}};if("dimension"===d){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>m(t))))&&void 0!==i?i:[]}}))}];M(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:Nd.chart,event:_({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0,itemMap:new Map};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return yT.globalConfig.uniqueTooltip&&yT.hideTooltip(l.id),d}if("mark"===d){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},m(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:Nd.chart,event:_(e.pos),item:void 0,itemMap:new Map};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return yT.globalConfig.uniqueTooltip&&yT.hideTooltip(l.id),d}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(D(this._cacheInfo)||D(t))return!1;if(BW(t)){if(RW(this._cacheInfo))return!1;const e=this._cacheInfo;if(e.length!==t.length||!t.every(((t,i)=>od(t,e[i]))))return!1}else{if(BW(this._cacheInfo))return!1;const e=this._cacheInfo;if((null==t?void 0:t.datum)!==e.datum||(null==t?void 0:t.mark)!==e.mark||(null==t?void 0:t.series)!==e.series)return!1}const s=this._cacheParams;return!D(s)&&!D(e)&&s.mark===e.mark&&s.model===e.model&&s.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}}FW.type=r.tooltip,FW.transformerConstructor=IW,FW.specKey="tooltip";class YW extends Bk{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}p_(),dM();class jW extends YW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},jW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}jW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p_(),fy();class HW extends YW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},HW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},s),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}var zW;HW.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(zW||(zW={}));var NW=function(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{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),h(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=qd((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(As(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshair(){this.showDefault&&this._showDefaultCrosshairBySpec()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:Vd.chart}:{source:Nd.chart};y(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;y(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}updateLayoutAttribute(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:fl(t)||vl(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Na(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(zd.tooltipHide,{source:Nd.chart},this._handleTooltipHideOrRelease),this.event.on(zd.tooltipShow,{source:Nd.chart},this._handleTooltipShow),this.event.on(zd.tooltipRelease,{source:Nd.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=$d(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{VW[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:d,y:c}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));e&&(e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-d),o=Math.min(o,i-c),l=Math.max(l,e+t.getLayoutRect().width-d),h=Math.max(h,i+t.getLayoutRect().height-c)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e}))})),r}changeRegions(t){}onLayoutEnd(t){const e=this._regions[0];this.setLayoutRect(e.getLayoutRect()),this.setLayoutStartPosition(e.getLayoutStartPoint()),super.onLayoutEnd(t)}onRender(t){}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||h(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const t=a.style||{},{stroke:o,fill:l,lineWidth:d}=t,c=t,{strokeOpacity:u,fillOpacity:p,opacity:g}=c,m=NW(c,["strokeOpacity","fillOpacity","opacity"]),_="line"===r.type;let f=_?u:p;if(h(g)&&(f=(null!=f?f:1)*g),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},m),_)r.style.stroke=o||l,r.style.lineWidth=$d(a,"width",d||2);else{r.style.fill=l||o,(null===(n=null===(s=null===(i=this._spec[e])||void 0===i?void 0:i.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(r.style.stroke=this._spec[e].line.style.stroke);const t=$d(a,"width");if("string"==typeof t){const e=parseInt(t.substring(0,t.length-1),10)/100;r.style.sizePercent=e}else"number"!=typeof t&&"function"!=typeof t||(r.style.size=t)}}if(o.visible){const t=o.labelBackground||{},e=o.style||{},i=t.style||{},{fill:s="rgba(47, 59, 82, 0.9)",stroke:n,outerBorder:a}=i,l=NW(i,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},e),{fill:e.fill||"#fff",stroke:$d(e,"stroke")}),panel:(v(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:s,stroke:n,outerBorder:Object.assign({stroke:s,distance:0,lineWidth:3},a)},l):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(function(t,e,i){return t.x1>e||t.x2i||t.y2a||o{const d=1&t,c=2&t;i||(i={x:0,y:0});let u=null,p=null,g=0,m=0;if(s.size){const t=Array.from(s.values())[0];g=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().x-i.x,u=t.axis}if(n.size){const t=Array.from(n.values())[0];m=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().y-i.y,p=t.axis}const _=!!s.size&&Number.isFinite(g),f=!!n.size&&Number.isFinite(m),v=o&&!_&&M(l),y=o&&!f&&M(h);let b,x,S;d&&(b=v?l:{height:0,leftPos:0,rightPos:0,topPos:0,x:0,bottom:{visible:!1,text:"",dx:0,dy:0},top:{visible:!1,text:"",dx:0,dy:0},visible:_,axis:u}),c&&(x=y?h:{width:0,leftPos:0,topPos:0,bottomPos:0,y:0,left:{visible:!1,text:"",dx:0,dy:0},right:{visible:!1,text:"",dx:0,dy:0},visible:f,axis:p});let k,A=0,w=0;if(r&&s.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const a=t.getScale();if(ad(a.type))S=a.bandwidth(),0===S&&a.step&&(A=a.step());else if(nd(a.type)){const s=e.fieldX[0],r=e.fieldX2,a=sD(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionX(a);r?(S=Math.abs(t-e.dataToPositionX1(a)),i=`${a[s]} ~ ${a[r]}`):S=1,g=t}n=t.niceLabelFormatter}if(b&&(null===(s=r.label)||void 0===s?void 0:s.visible)&&!v){const e=$E(t.getSpec());"bottom"===t.getOrient()?(b.bottom.visible=!0,b.bottom.defaultFormatter=n,b.bottom.text=i,b.bottom.dx=0,b.bottom.dy=e):"top"===t.getOrient()&&(b.top.visible=!0,b.top.defaultFormatter=n,b.top.text=i,b.top.dx=0,b.top.dy=-e)}})),a&&n.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const r=t.getScale();if(ad(r.type))k=r.bandwidth(),0===k&&r.step&&(w=r.step());else if(nd(r.type)){const s=e.fieldY[0],r=e.fieldY2,a=sD(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionY(a);r?(k=Math.abs(t-e.dataToPositionY1(a)),i=`${a[s]} ~ ${a[r]}`):k=1,m=t}n=t.niceLabelFormatter}if(x&&(null===(s=a.label)||void 0===s?void 0:s.visible)&&!y){const e=$E(t.getSpec());"left"===t.getOrient()?(x.left.visible=!0,x.left.defaultFormatter=n,x.left.text=i,x.left.dx=-e,x.left.dy=0):"right"===t.getOrient()&&(x.right.visible=!0,x.right.defaultFormatter=n,x.right.text=i,x.right.dx=e,x.right.dy=0)}})),b&&!v){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if($W(t,s),b.leftPos=t.x1,b.rightPos=t.x2,b.topPos=t.y1,b.height=t.y2-t.y1,b.x=g+i.x,r&&r.label){const{top:t,bottom:e}=b;t.visible&&UW(t,"top",r.label),e.visible&&UW(e,"bottom",r.label)}}if(x&&!y){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if($W(t,n),x.leftPos=t.x1,x.topPos=t.y1,x.bottomPos=t.y2,x.width=t.x2-t.x1,x.y=m+i.y,a&&a.label){const{left:t,right:e}=x;t.visible&&UW(t,"left",a.label),e.visible&&UW(e,"right",a.label)}}return{x:d&&b?b:void 0,y:c&&x?x:void 0,offsetWidth:A,offsetHeight:w,bandWidth:null!=S?S:0,bandHeight:null!=k?k:0}},UW=(t,e,i)=>{const{formatMethod:s,formatter:n}=i,{formatFunc:r,args:a}=KT(s,n,t.text,{label:t.text,position:e});r?t.text=r(...a):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))},$W=(t,e)=>{e.forEach((({axis:e})=>{e.getRegions().forEach((e=>{t.x1=Math.min(t.x1,e.getLayoutStartPoint().x),t.y1=Math.min(t.y1,e.getLayoutStartPoint().y),t.x2=Math.max(t.x2,e.getLayoutStartPoint().x+e.getLayoutRect().width),t.y2=Math.max(t.y2,e.getLayoutStartPoint().y+e.getLayoutRect().height)}))}))},XW=(t,e,i,s)=>{const{x:n,topPos:r,height:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n+i/2,y:r},end:{x:n+i/2,y:r+a}};else if("rect"===o){const o=qW(t,i,e.axis),{leftPos:h,rightPos:d}=e;l={visible:!0,start:{x:Math.max(n-o/2-s/2,h),y:r},end:{x:Math.min(n+i+o/2+s/2,d),y:r+a}}}return l},KW=(t,e,i,s)=>{const{leftPos:n,width:r,y:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n,y:a+i/2},end:{x:n+r,y:a+i/2}};else if("rect"===o){const o=qW(t,i,e.axis),{topPos:h,bottomPos:d}=e;l={visible:!0,start:{x:n,y:Math.max(a-o/2-s/2,h)},end:{x:n+r,y:Math.min(a+i+o/2+s/2,d)}}}return l},qW=(t,e,i)=>{var s,n,r;let a=0;if(null===(s=t.style)||void 0===s?void 0:s.sizePercent)a=(t.style.sizePercent-1)*e;else if("number"==typeof(null===(n=t.style)||void 0===n?void 0:n.size))a=t.style.size-e;else if("function"==typeof(null===(r=t.style)||void 0===r?void 0:r.size)){const s=i.getLayoutRect();a=t.style.size(s,i)-e}return a};class ZW extends WW{static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._currValueX=new Map,this._currValueY=new Map}_showDefaultCrosshairBySpec(){const{xField:t,yField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));s&&(1===i?(this._currValueX.clear(),this._currValueX.set(t,{axis:s,value:e})):(this._currValueY.clear(),this._currValueY.set(t,{axis:s,value:e})),this.layoutByValue(i))}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getValueAt(t,e){return t.getScale().invert(e)}clearAxisValue(){this._currValueX.clear(),this._currValueY.clear()}setAxisValue(t,e){Ad(e.getOrient())?this._currValueX.set(e.getSpecIndex(),{value:t,axis:e}):this._currValueY.set(e.getSpecIndex(),{value:t,axis:e})}_getAllAxisValues(t,e,i,s){let n=!1;return t.forEach((t=>{ad(t.axis.getScale().type)&&(n?this.enable=!1:n=!0)})),!!this.enable&&(t.forEach(((t,n)=>{const r=t.axis;i.set(n,{value:this._getValueAt(r,e-(s?r.getLayoutStartPoint().x-this.getLayoutStartPoint().x:r.getLayoutStartPoint().y-this.getLayoutStartPoint().y)),axis:r})})),!0)}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(M(t.dimType)?"y"===t.dimType:wd(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else this._currValueX.clear(),this._currValueY.clear(),o&&o.size&&this._getAllAxisValues(o,r,this._currValueX,!0),l&&l.size&&this._getAllAxisValues(l,a,this._currValueY,!1),this.layoutByValue(3)}hide(){this._xCrosshair&&this._xCrosshair.hideAll(),this._xTopLabel&&this._xTopLabel.hideAll(),this._xBottomLabel&&this._xBottomLabel.hideAll(),this._yCrosshair&&this._yCrosshair.hideAll(),this._yLeftLabel&&this._yLeftLabel.hideAll(),this._yRightLabel&&this._yRightLabel.hideAll()}layoutByValue(t=3){if(!this.enable)return;const e=LE(this._regions,"cartesian");if(!e)return;const{x:i,y:s,offsetWidth:n,offsetHeight:r,bandWidth:a,bandHeight:o}=GW(t,e,this.getLayoutStartPoint(),this._currValueX,this._currValueY,this._xHair,this._yHair,this.enableRemain,this._cacheXCrossHairInfo,this._cacheYCrossHairInfo);this.enableRemain&&(i&&(this._cacheXCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0})),s&&(this._cacheYCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0}))),i&&this._layoutVertical(i,a,n),s&&this._layoutHorizontal(s,o,r)}_layoutVertical(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._xHair)return;const{x:r,topPos:a,height:o,top:l,bottom:h,visible:d}=t;if(d){const d=this._xHair.type,c=XW(this._xHair,t,e,i);if(this._updateCrosshair("x",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a},l),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._xHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"center",textBaseline:"bottom"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xTopLabel,t,(t=>{t.name="crosshair-x-top-label",this._xTopLabel=t}))}else this._xTopLabel&&this._xTopLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a+o},h),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._xHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"center",textBaseline:"top"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xBottomLabel,t,(t=>{t.name="crosshair-x-bottom-label",this._xBottomLabel=t}))}else this._xBottomLabel&&this._xBottomLabel.hideAll()}}_layoutHorizontal(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._yHair)return;const{leftPos:r,width:a,y:o,left:l,right:h,visible:d}=t;if(d){const d=this._yHair.type,c=KW(this._yHair,t,e,i);if(this._updateCrosshair("y",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r,y:o+e/2},l),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._yHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"right",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yLeftLabel,t,(t=>{t.name="crosshair-y-left-label",this._yLeftLabel=t}))}else this._yLeftLabel&&this._yLeftLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+a,y:o+e},h),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._yHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"left",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yRightLabel,t,(t=>{t.name="crosshair-y-right-label",this._yRightLabel=t}))}else this._yRightLabel&&this._yRightLabel.hideAll()}}_parseFieldInfo(){const{xField:t,yField:e}=this._spec;this._parseAndSetCrosshair(t,"x"),this._parseAndSetCrosshair(e,"y")}_parseAndSetCrosshair(t,e){const i=`_${e}Hair`,s=`_${e}Crosshair`;if(t&&t.visible){if(this[i]=this._parseField(t,`${e}Field`),this[s]){const{style:t,type:e}=this[i],n="rect"===e?"rectStyle":"lineStyle";this[s].setAttributes({[n]:t})}}else this[s]&&this[s].parent&&this[s].parent.removeChild(this[s])}_updateCrosshair(t,e,i){const s=this.getContainer();let n;if(n="x"===t?this._xCrosshair:this._yCrosshair,n)n.setAttributes(i);else{const r="x"===t?this._xHair.style:this._yHair.style;"line"===e?n=new jW(Object.assign(Object.assign({},i),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===e&&(n=new HW(Object.assign(Object.assign({},i),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==s||s.add(n),"x"===t?this._xCrosshair=n:this._yCrosshair=n}}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(i(t=new PD(e)),null==s||s.add(t)),iD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._xCrosshair,this._xTopLabel,this._xBottomLabel,this._yCrosshair,this._yLeftLabel,this._yRightLabel]}}ZW.specKey="crosshair",ZW.type=r.cartesianCrosshair,p_(),Gx();class JW extends YW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},JW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:r,endAngle:a}),n),"arc")}setLocation(t){const{center:e,startAngle:i=$k,endAngle:s=Xk}=this.attribute,n=s-i,r=wt(Ct(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}JW.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},p_(),TM();class QW extends YW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},QW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,sides:s=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute,o=(a-r)%(2*Math.PI)==0,l=(a-r)/s;let h;for(let t=0;t<=s;t++){const n=Tt(e,i,r+l*t);0===t?h=`M${n.x},${n.y}`:h+=`L${n.x},${n.y}`,t===s&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,i=xe.distancePP(t,e);this.setAttribute("radius",i)}}QW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p_(),Gx();class tG extends YW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},tG.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,i=xe.distancePP(t,e);this.setAttribute("radius",i)}}tG.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};var eG=function(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);nt.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible))}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._currValueAngle=new Map,this._currValueRadius=new Map}_showDefaultCrosshairBySpec(){const{categoryField:t,valueField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));if(s){if(1===i){this._currValueAngle.clear();const i={angle:s.valueToPosition(e),radius:s.getOuterRadius()},n=s.coordToPoint(i);this._currValueAngle.set(t,this._getValueByAxis(s,n))}else{this._currValueRadius.clear();const i={angle:s.startAngle,radius:s.valueToPosition(e)},n=s.coordToPoint(i);this._currValueRadius.set(t,this._getValueByAxis(s,n))}this.layoutByValue(3)}}hide(){this._radiusCrosshair&&this._radiusCrosshair.hideAll(),this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll(),this._angleCrosshair&&this._angleCrosshair.hideAll(),this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getAllAxisValues(t,e,i){let s=!1;return t.forEach((t=>{ad(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!!this.enable&&(t.forEach(((t,s)=>{const n=t.axis;i.set(s,this._getValueByAxis(n,e))})),!0)}_getValueByAxis(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint(),a=t.positionToData({x:e.x-(i-n),y:e.y-(s-r)}),o={x:t.getCenter().x+this.getLayoutStartPoint().x,y:t.getCenter().y+this.getLayoutStartPoint().y};return{value:a,axis:t,center:o,innerRadius:t.getInnerRadius(),radius:t.getOuterRadius(),startAngle:t.startAngle,endAngle:t.endAngle,distance:xe.distancePP(e,t.getCenter()),coord:t.pointToCoord(e),point:e}}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)this._currValueAngle.clear(),this._currValueRadius.clear(),a&&this._getAllAxisValues(a,{x:n,y:r},this._currValueAngle),o&&this._getAllAxisValues(o,{x:n,y:r},this._currValueRadius),this.layoutByValue(3);else{if(this.enableRemain)return;this.hide()}}layoutByValue(t=3){if(!this.enable)return;const e=LE(this._regions,"polar");if(!e)return;const{angle:i,radius:s}=((t,e,i,s,n,r=!1,a,o)=>{let l={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,label:{visible:!1,text:"",offset:0}},h={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,sides:t.angleAxisHelper.getScale(0).domain().length,label:{visible:!1,text:"",offset:0}};if(s){l.visible=!!e.size;const i=t.angleAxisHelper.getBandwidth(0);e.forEach((e=>{var n,{axis:r,value:a,coord:o}=e,h=eG(e,["axis","value","coord"]);a=null!=a?a:"",Pl(l,h);const d=t.angleAxisHelper.dataToPosition([a]);l.angle=d;const c=r.niceLabelFormatter;(null===(n=s.label)||void 0===n?void 0:n.visible)&&(l.label.visible=!0,l.label.defaultFormatter=c,l.label.text=a,l.label.offset=$E(r.getSpec())),l.startAngle=d-i/2,l.endAngle=d+i/2}))}if(n&&(h.visible=!!i.size,i.forEach((t=>{var e,{axis:i,value:s,coord:r}=t,a=eG(t,["axis","value","coord"]);s=null!=s?s:"";const o=i.niceLabelFormatter;(null===(e=n.label)||void 0===e?void 0:e.visible)&&(h.label.visible=!0,h.label.defaultFormatter=o,h.label.text=s,h.label.offset=$E(i.getSpec())),h.angle=r.angle,h.axis=i,Pl(h,a)}))),r&&!l.visible&&M(a))l=a;else if(l.label.visible&&s&&s.label){const{label:t}=l,{formatMethod:e,formatter:i}=s.label,{formatFunc:n,args:r}=KT(e,i,t.text,{label:t.text,orient:"angle"});n?t.text=n(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}if(r&&!h.visible&&M(o))h=o;else if(h.label.visible&&n&&n.label){const{label:t}=h,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=KT(e,i,t.text,{label:t.text,orient:"radius"});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}return{angle:l,radius:h}})(e,this._currValueAngle,this._currValueRadius,this._angleHair,this._radiusHair,this.enableRemain,this._cacheAngleCrossHairInfo,this._cacheRadiusCrossHairInfo);this.enableRemain&&(this._cacheAngleCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0}),this._cacheRadiusCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0})),t&&(this._layoutRadius(s),this._layoutAngle(i))}_layoutAngle(t){var e;if(t._isCache&&this.enableRemain)return;const i=this.getContainer(),{angle:s,radius:n,label:r,center:a,visible:o}=t;if(o){const o="rect"===this._angleHair.type?"sector":"line",l=((t,e)=>{const{angle:i,innerRadius:s,radius:n,startAngle:r,endAngle:a,center:o}=e;let l;return l="sector"==("rect"===t.type?"sector":"line")?{center:o,innerRadius:s,radius:n,startAngle:r,endAngle:a}:{start:Tt(o,s,i),end:Tt(o,n,i)},l})(this._angleHair,t);if(this._angleCrosshair)this._angleCrosshair.setAttributes(l);else{let t;"line"===o?t=new jW(Object.assign(Object.assign({},l),{lineStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===o&&(t=new JW(Object.assign(Object.assign({},l),{sectorStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1}))),this._angleCrosshair=t,i.add(t)}if(r.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(s),i=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(a,n+r.offset,s)),this._angleHair.label),r),{textStyle:Object.assign(Object.assign({},null===(e=this._angleHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._angleLabelCrosshair,i,(t=>{t.name="crosshair-angle-label",this._angleLabelCrosshair=t}))}else this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}}_layoutRadius(t){var e;if(t._isCache&&this.enableRemain)return;const{center:i,startAngle:s,label:n,visible:r}=t,a=this.getContainer();if(r){const r=this._radiusHair.smooth?"circle":"polygon",o=((t,e)=>{const{center:i,startAngle:s,endAngle:n,distance:r,sides:a,axis:o,point:l,radius:h,innerRadius:d}=e;let c=r;if("polygon"==(t.smooth?"circle":"polygon")){const t=o.getCenter(),e=Ct(t,l),i=(n-s)/a,u=Math.floor((e-s)/i),p=u*i+s,g=Math.min((u+1)*i+s,n),m=Tt(t,r,p),_=Tt(t,r,g),f=function(t,e,i,s){if(!It(t,e,i,s))return!1;const n=[0,0],r=[0,0],a=[0,0];if(Bt(n,e,t),Bt(r,s,i),ht((o=n)[0]-(l=r)[0])+ht(o[1]-l[1])<1e-12)return!0;var o,l;Bt(a,i,t);const h=yt(a,r)/yt(n,r);return h>=0&&h<=1&&[t[0]+n[0]*h,t[1]+n[1]*h]}([_.x,_.y],[m.x,m.y],[t.x,t.y],[l.x,l.y]);f&&(c=js(xe.distancePN(l,f[0],f[1])+r,d,h))}return{center:i,startAngle:s,endAngle:n,radius:c,sides:a}})(this._radiusHair,t),l=o.radius;if(this._radiusCrosshair)this._radiusCrosshair.setAttributes(o);else{let t;t="polygon"===r?new QW(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex+1})):new tG(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex})),this._radiusCrosshair=t,a.add(t)}if(n.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(s),r=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(i,l,s)),this._radiusHair.label),n),{textStyle:Object.assign(Object.assign({},null===(e=this._radiusHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._radiusLabelCrosshair,r,(t=>{t.name="crosshair-radius-label",this._radiusLabelCrosshair=t}))}else this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll()}}_parseFieldInfo(){var t;const{categoryField:e,valueField:i}=this._spec;e&&e.visible&&(this._angleHair=this._parseField(e,"categoryField")),i&&i.visible&&(this._radiusHair=this._parseField(i,"valueField"),this._radiusHair.smooth=null===(t=null==i?void 0:i.line)||void 0===t?void 0:t.smooth)}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new PD(e),null==s||s.add(t),i(t)),iD(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._radiusCrosshair,this._radiusLabelCrosshair,this._angleCrosshair,this._angleLabelCrosshair]}}iG.specKey="crosshair",iG.type=r.polarCrosshair;const sG=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(D(a)||D(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Na(r).every((i=>{t[i]>=a[0]&&t[i]<=Va(a)&&(e=!0)})),e}:t=>{let e=!1;return Na(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},nG=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n}=e.input,{stateField:r,valueField:a}=e.output,o={},l=[];return n.forEach(((t,e)=>{var n;if(D(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&r.domain.forEach((t=>{o[t]=0})),t.latestData.forEach((t=>{Na(i[e]).forEach((i=>{D(t[i])||(D(o[t[i]])&&(o[t[i]]=0),D(s[e])||(o[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),Object.keys(o).forEach(((t,e)=>{const i={[r]:t};a&&(i[a]=o[t]),l.push(i)})),l};class rG extends aD{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-tthis._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent.getScale(),i=this._isReverse(),s=i?[1-this._end,1-this._start]:[this._start,this._end];if(i)switch(t){case"startHandler":e.rangeFactorEnd(s[1]);break;case"endHandler":e.rangeFactorStart(s[0]);break;default:e.rangeFactorStart(s[0],!0),e.rangeFactorEnd(s[1])}else switch(t){case"startHandler":e.rangeFactorStart(s[0]);break;case"endHandler":e.rangeFactorEnd(s[1]);break;default:e.rangeFactorEnd(s[1],!0),e.rangeFactorStart(s[0])}const n=e.rangeFactor();n?(this._start=i?1-n[1]:n[0],this._end=i?1-n[0]:n[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else wE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),wE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=t=>{var e,i;if(!this._activeRoam)return;const{zoomDelta:s,zoomX:n,zoomY:r}=t,{x:a,y:o}=this._regions[0].getLayoutStartPoint(),{width:l,height:h}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),c=null!==(i=null===(e=this._spec.roamZoom)||void 0===e?void 0:e.rate)&&void 0!==i?i:1;if(d>=1&&s<1)return;if(d<=.01&&s>1)return;const u=this._isHorizontal?n:r,p=d*(s-1)*c;let g=p/2,m=p/2;if(u){const t=this._isHorizontal?a:o,e=this._isHorizontal?l:h;g=Math.abs(t-u)/Math.abs(e-t)*p,m=Math.abs(e-u)/Math.abs(e-t)*p}const _=js(this._start+g,0,1),f=js(this._end-m,0,1);this._handleChange(Math.min(_,f),Math.max(_,f),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam)return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?ht(s/n)>=.5:ht(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i;if(!this._activeRoam)return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this._handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=Ld(t),this._isHorizontal="horizontal"===Cd(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),D(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!nd(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=Na(i.userId)),M(i.specIndex)&&(this._seriesIndex=Na(i.specIndex))),M(this._spec.seriesId)){const t=Na(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(M(this._spec.seriesIndex)){const t=Na(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(M(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Na(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(M(this._spec.regionId)){const t=Na(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(nd(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&(this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[Ga(t),Wa(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];if(this._relatedAxisComponent){const s={};wE(this._regions,(n=>{var r,a;const o="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,l="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(!o||!l)return;const h=o.getAxisId()===this._relatedAxisComponent.id?o:l.getAxisId()===this._relatedAxisComponent.id?l:this._isHorizontal?o:l,d=h===o?l:o,c=nd(d.getScale(0).type),u=nd(h.getScale(0).type);t.push(n.getRawData());const p=n.getSpec(),g="cartesian"===n.coordinate?Na(p.xField):Na(null!==(r=p.angleField)&&void 0!==r?r:p.categoryField),m="cartesian"===n.coordinate?Na(p.yField):Na(null!==(a=p.radiusField)&&void 0!==a?a:p.valueField);if(s[n.id]="link"===n.type?["from_xField"]:h===o?g:m,u?e.push(s[n.id]):e.push(s[n.id][0]),this._valueField){const t="link"===n.type?["from_yField"]:d===o?g:m;c&&i.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=s}else wE(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:s}=this._option;Ep(s,"dataview",b),Cp(s,"dataFilterComputeDomain",nG);const n=new R(s,{name:`${this.type}_${this.id}_data`});n.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new gx(this._option,n),n.reRunAllTransform(),s.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=E({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=E({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=E({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_statePointToData(t){const e=this._stateScale,i=e.domain();if(nd(e.type))return this._isReverse()?i[0]+(Va(i)-i[0])*(1-t):i[0]+(Va(i)-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(Va(s)-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&nd(e.type)&&(s=s.slice().reverse()),(i-s[0])/(Va(s)-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&M(this._spec.start)||"value"===e&&M(this._spec.startValue):"percent"===e&&M(this._spec.end)||"value"===e&&M(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this._statePointToData(i),this._endValue=this._statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,nd(this._stateScale.type)&&this._stateScale.domain()[0]!==Va(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(Va(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(Va(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=nd(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[Ga(e),Wa(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new ix,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(Cp(this._option.dataSet,"dataFilterWithNewDomain",sG),wE(this._regions,(t=>{t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>nd(this._stateScale.type)},level:zp.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}changeRegions(){}update(t){}resize(t){}_parseDomainFromState(t,e){if(nd(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a};this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,o)}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}onLayoutStart(t,e,i){super.onLayoutStart(t,e,i);const s=this._autoUpdate(t),n=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[n]:s?this[`_${n}`]:0},{[n]:Py.Built_In}),this._dataUpdating=!1}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),d=null==l?void 0:l.getScale(),c=this._getAxisBandSize(h);if(!this._dataUpdating&&ad(d.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;let u=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?d.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&d.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,ad(d.type)){c&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=d.rangeFactor())&&void 0!==a?a:[];u=!(D(t)&&D(e)||0===t&&1===e)}else{const[t,e]=null!==(o=d.rangeFactor())&&void 0!==o?o:[this._start,this._end];u=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),u?this.show():this.hide(),this._cacheVisibility=u,u}_getNeedClearVRenderComponents(){return[this._component]}}tw(rG,eI);const aG="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",oG={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:aG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:aG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},lG={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var hG;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(hG||(hG={}));var dG=function(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);nt,this._onHandlerPointerDown=(t,e)=>{t.stopPropagation(),"start"===e?(this._activeTag=hG.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=hG.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=hG.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=hG.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=hG.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t),"browser"===$o.env&&($o.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),$o.addEventListener("pointerup",this._onHandlerPointerUp)),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._pointerMove=t=>{t.stopPropagation();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute,r=this.eventPosToStagePos(t),{attPos:a,max:o}=this._layoutCache,l=(r[a]-this._activeCache.lastPos[a])/o;let{start:h,end:d}=this.state;this._activeState&&(this._activeTag===hG.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===hG.startHandler?h+l>d?(h=d,d=h+l,this._activeTag=hG.endHandler):h+=l:this._activeTag===hG.endHandler&&(d+l{t.preventDefault();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute;if(this._activeState&&this._activeTag===hG.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===$o.env&&($o.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),$o.removeEventListener("pointerup",this._onHandlerPointerUp)),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.removeEventListener("pointerup",this._onHandlerPointerUp)};const{position:i,showDetail:s}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText="auto"!==s&&s,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return void this.setAttribute("childrenPickable",!1);const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:s=!1,minSpan:n=0,maxSpan:r=1}=this.attribute,a=e-t;a!==this._spanCache&&(s||ar)||(this._spanCache=a,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){return this.stage.eventPointTransform(t)}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:n}=this.attribute,r=t[i]-n[i],a=e[i]-n[i],o=Math.min(Math.max(Math.min(r,a)/s,0),1),l=Math.min(Math.max(Math.max(r,a)/s,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:js(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===hG.background&&Math.abs(this.dragMaskSize())||0,height:s},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:js(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+s),width:i,height:this._activeState&&this._activeTag===hG.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if("start"===i){if(e.x1t.x2)return!0}else if("start"===i){if(e.y1t.y2)return!0;return!1}setTextAttr(t,e){var i,s,n,r,a,o,l,h;const{startTextStyle:d,endTextStyle:c}=this.attribute,{formatMethod:u}=d,p=dG(d,["formatMethod"]),{formatMethod:g}=c,m=dG(c,["formatMethod"]),{start:_,end:f}=this.state;this._startValue=this._statePointToData(_),this._endValue=this._statePointToData(f);const{position:v,width:y,height:b}=this.getLayoutAttrFromConfig(),x=u?u(this._startValue):this._startValue,S=g?g(this._endValue):this._endValue,M={x1:v.x,y1:v.y,x2:v.x+y,y2:v.y+b};let k,A,w,T;this._isHorizontal?(k={x:v.x+_*y,y:v.y+b/2},A={x:v.x+f*y,y:v.y+b/2},w={textAlign:this.isTextOverflow(M,t,"start")?"left":"right",textBaseline:null!==(s=null===(i=null==p?void 0:p.textStyle)||void 0===i?void 0:i.textBaseline)&&void 0!==s?s:"middle"},T={textAlign:this.isTextOverflow(M,e,"end")?"right":"left",textBaseline:null!==(r=null===(n=null==m?void 0:m.textStyle)||void 0===n?void 0:n.textBaseline)&&void 0!==r?r:"middle"}):(k={x:v.x+y/2,y:v.y+_*b},A={x:v.x+y/2,y:v.y+f*b},w={textAlign:null!==(o=null===(a=null==p?void 0:p.textStyle)||void 0===a?void 0:a.textAlign)&&void 0!==o?o:"center",textBaseline:this.isTextOverflow(M,t,"start")?"top":"bottom"},T={textAlign:null!==(h=null===(l=null==m?void 0:m.textStyle)||void 0===l?void 0:l.textAlign)&&void 0!==h?h:"center",textBaseline:this.isTextOverflow(M,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,E({},p,{text:x,x:k.x,y:k.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:w}),`data-zoom-start-text-${v}`),this._endText=this.maybeAddLabel(this._container,E({},m,{text:S,x:A.x,y:A.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:T}),`data-zoom-end-text-${v}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;const{x1:i,x2:s,y1:n,y2:r}=t,{dx:a=0,dy:o=0}=this.attribute.startTextStyle;if((new Kt).set(i,n,s,r).intersects(e)){const t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",o+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",a+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",o):this._startText.setAttribute("dx",a)}getLayoutAttrFromConfig(){var t,e,i,s,n,r;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:o,orient:l,middleHandlerStyle:h={},startHandlerStyle:d={},endHandlerStyle:c={},backgroundStyle:u={}}=this.attribute,{width:p,height:g}=o,m=null!==(e=null===(t=h.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let _,f,v;h.visible?this._isHorizontal?(_=p,f=g-m,v={x:a.x,y:a.y+m}):(_=p-m,f=g,v={x:a.x+("left"===l?m:0),y:a.y}):(_=p,f=g,v=a);const y=null!==(i=d.size)&&void 0!==i?i:this._isHorizontal?f:_,b=null!==(s=c.size)&&void 0!==s?s:this._isHorizontal?f:_;return d.visible&&(this._isHorizontal?(_-=(y+b)/2,v={x:v.x+y/2,y:v.y}):(f-=(y+b)/2,v={x:v.x,y:v.y+y/2})),f+=null!==(n=u.lineWidth/2)&&void 0!==n?n:1,_+=null!==(r=u.lineWidth/2)&&void 0!==r?r:1,this._layoutAttrFromConfig={position:v,width:_,height:f},this._layoutAttrFromConfig}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x,S,M,k,A,w,T,L,C,E,D,O,P;this._layoutAttrFromConfig=null;const{orient:R,backgroundStyle:B,backgroundChartStyle:I={},selectedBackgroundStyle:F={},selectedBackgroundChartStyle:Y={},middleHandlerStyle:j={},startHandlerStyle:H={},endHandlerStyle:z={},brushSelect:N,zoomLock:V}=this.attribute,{start:W,end:G}=this.state,{position:U,width:$,height:X}=this.getLayoutAttrFromConfig(),K=null!==(t=H.triggerMinSize)&&void 0!==t?t:40,q=null!==(e=z.triggerMinSize)&&void 0!==e?e:40,Z=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=Z,this._background=Z.createOrUpdateChild("background",Object.assign(Object.assign({x:U.x,y:U.y,width:$,height:X,cursor:N?"crosshair":"auto"},B),{pickable:!V&&(null===(i=B.pickable)||void 0===i||i)}),"rect"),(null===(s=I.line)||void 0===s?void 0:s.visible)&&this.setPreviewAttributes("line",Z),(null===(n=I.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",Z),N&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x+W*$,y:U.y,width:(G-W)*$,height:X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(r=Y.pickable)||void 0===r||r)}),"rect"):this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x,y:U.y+W*X,width:$,height:(G-W)*X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(a=F.pickable)||void 0===a||a)}),"rect"),(null===(o=Y.line)||void 0===o?void 0:o.visible)&&this.setSelectedPreviewAttributes("line",Z),(null===(l=Y.area)||void 0===l?void 0:l.visible)&&this.setSelectedPreviewAttributes("area",Z),this._isHorizontal){if(j.visible){const t=(null===(h=j.background)||void 0===h?void 0:h.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:U.x+W*$,y:U.y-t,width:(G-W)*$,height:t},null===(d=j.background)||void 0===d?void 0:d.style),{pickable:!V&&(null===(p=null===(u=null===(c=j.background)||void 0===c?void 0:c.style)||void 0===u?void 0:u.pickable)||void 0===p||p)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:U.x+(W+G)/2*$,y:U.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(m=null===(g=j.icon)||void 0===g?void 0:g.symbolType)&&void 0!==m?m:"square"},j.icon),{pickable:!V&&(null===(_=j.icon.pickable)||void 0===_||_)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+W*$,y:U.y+X/2,size:X,symbolType:null!==(f=H.symbolType)&&void 0!==f?f:"square"},lG.horizontal),H),{pickable:!V&&(null===(v=H.pickable)||void 0===v||v)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+G*$,y:U.y+X/2,size:X,symbolType:null!==(y=z.symbolType)&&void 0!==y?y:"square"},lG.horizontal),z),{pickable:!V&&(null===(b=z.pickable)||void 0===b||b)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+W*$-t/2,y:U.y+X/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},lG.horizontal),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+G*$-i/2,y:U.y+X/2-s/2,width:i,height:s,fill:"white",fillOpacity:0,zIndex:999},lG.horizontal),{pickable:!V}),"rect")}else{if(j.visible){const t=(null===(x=j.background)||void 0===x?void 0:x.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===R?U.x-t:U.x+$,y:U.y+W*X,width:t,height:(G-W)*X},null===(S=j.background)||void 0===S?void 0:S.style),{pickable:!V&&(null===(A=null===(k=null===(M=j.background)||void 0===M?void 0:M.style)||void 0===k?void 0:k.pickable)||void 0===A||A)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===R?U.x-t/2:U.x+$+t/2,y:U.y+(W+G)/2*X,angle:Math.PI/180*90,symbolType:null!==(T=null===(w=j.icon)||void 0===w?void 0:w.symbolType)&&void 0!==T?T:"square",strokeBoundsBuffer:0},j.icon),{pickable:!V&&(null===(C=null===(L=j.icon)||void 0===L?void 0:L.pickable)||void 0===C||C)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+W*X,size:$,symbolType:null!==(E=H.symbolType)&&void 0!==E?E:"square"},lG.vertical),H),{pickable:!V&&(null===(D=H.pickable)||void 0===D||D)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+G*X,size:$,symbolType:null!==(O=z.symbolType)&&void 0!==O?O:"square"},lG.vertical),z),{pickable:!V&&(null===(P=z.pickable)||void 0===P||P)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+$/2+t/2,y:U.y+W*X-e/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},lG.vertical),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+$/2+i/2,y:U.y+G*X-s/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},lG.vertical),{pickable:!V}),"rect")}this._showText&&this.renderText()}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let n,r;return this._isHorizontal?(n=[{x:e.x,y:e.y+s}],r=[{x:e.x+i,y:e.y+s}]):"left"===t?(n=[{x:e.x+i,y:e.y}],r=[{x:e.x+i,y:e.y+s}]):(n=[{x:e.x,y:e.y+s}],r=[{x:e.x,y:e.y}]),{basePointStart:n,basePointEnd:r}}simplifyPoints(t){var e;return t.length>1e4?function(t,e){return t.length<=10?t:function(t,e){let i,s,n=t[0].x,r=t[0].y;const a=[t[0]];for(let o=1,l=t.length;oe&&(n=t[o].x,r=t[o].y,a.push(t[o]));return t[t.length-1].x===n&&t[t.length-1].y===r||a.push(t[t.length-1]),a}(t,void 0!==e?e*e:1)}(t,null!==(e=this.attribute.tolerance)&&void 0!==e?e:this._previewData.length/1e4):t}getPreviewLinePoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:s,end:n}=this.state,{position:r,width:a,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?r.x+s*a:r.x,y:this._isHorizontal?r.y:r.y+s*o,width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?r.x+s*a:r.x),y:-(this._isHorizontal?r.y:r.y+s*o),width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new PD(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:i,end:s}=this.attribute;M(t)&&M(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&s===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,s;const{middleHandlerStyle:n={}}=this.attribute,r=null!==(e=null===(t=n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,a=null!==(s=null===(i=n.icon)||void 0===i?void 0:i.size)&&void 0!==s?s:10;return Math.max(r,...Na(a))}setPreviewPointsX(t){ws(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){ws(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){ws(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){ws(t)&&(this._previewPointsY1=t)}setStatePointToData(t){ws(t)&&(this._statePointToData=t)}}uG.defaultAttributes=oG;class pG extends rD{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Pl({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=y(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}class gG extends rG{constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=pG,this.specKey="dataZoom",this.layoutZIndex=Dy.DataZoom,this.layoutLevel=Oy.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),D(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),D(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,c=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0}onLayoutEnd(t){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd(t)}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new Zb;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2];this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,this._computeWidth()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeHeight()-this._middleHandlerSize,0])):"left"===this.layoutOrient?(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeWidth()-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([0,this._computeWidth()-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:this._computeWidth(),height:this._computeHeight()},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[Ga(e),Wa(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:h(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height-(this._startHandlerSize+this._endHandlerSize)/2}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(nd(t.type)&&e[0]===Va(e)||ad(t.type)&&1===(i=e,i&&y(i)?Array.from(new Set(Na(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this.getLayoutRect().width,height:this.getLayoutRect().height},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:M(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new uG(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this._statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange){i&&this._component&&this._component.setStartAndEnd(t,e),this._start=t,this._end=e;const n=this._statePointToData(t),r=this._statePointToData(e);(ws(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(zd.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,d,c;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:m={},selectedBackgroundChart:_={}}=this._spec;return{backgroundStyle:GE(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:GE(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:GE(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:GE(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:GE(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:GE(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:GE(g.style)},selectedBackgroundStyle:GE(this._spec.selectedBackground.style),dragMaskStyle:GE(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Pl(GE(null===(l=m.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},GE(null===(h=m.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Pl(GE(null===(d=_.line)||void 0===d?void 0:d.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},GE(null===(c=_.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=KT(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}gG.type=r.dataZoom,gG.transformerConstructor=pG,gG.specKey="dataZoom";class mG extends rG{constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=Dy.DataZoom,this.layoutLevel=Oy.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(t){var e,i;this._updateScaleRange(),null===(i=(e=this.effect).onZoomChange)||void 0===i||i.call(e),super.onLayoutEnd(t)}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return h(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new eW(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(t,e,i){super._handleChange(t,e,i);const s=md(this._start,t)&&md(this._end,e);if(this._shouldChange&&!s){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._statePointToData(t),n=this._statePointToData(e);(ws(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,s,n):this._handleStateChange(this._statePointToData(t),this._statePointToData(e)))&&this.event.emit(zd.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){}_initCommonEvent(){super._initCommonEvent(),this._component&&this._component.on("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])}))}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return D(i)||(s.padding=i),jm(null==t?void 0:t.style)||(s.railStyle=GE(t.style)),jm(null==e?void 0:e.style)||(s.sliderStyle=GE(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}mG.type=r.scrollBar,mG.specKey="scrollBar";const _G=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Na(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},fG={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};p_(),cf(),ik();class vG extends Bk{constructor(){super(...arguments),this.name="indicator"}_renderText(t,e,i,s,n,r){if(!1!==e.visible){const a=E({},$d(fG,n),e.style,{visible:e.visible});a.lineHeight=M(a.lineHeight)?a.lineHeight:a.fontSize,e.formatMethod&&(a._originText=a.text,a.text=e.formatMethod(a.text,a));const o=sA(a);return o.name=r,t.appendChild(o),e.autoFit&&il(i)&&this._setLocalAutoFit(i,o,e),e.autoLimit&&il(s)&&o.setAttribute("maxLineWidth",i),o}}render(){var t,e;if(this.removeAllChild(!0),!0!==this.attribute.visible)return;const{title:i={},content:s,size:n,limitRatio:r=1/0}=this.attribute,a=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1,pickable:null===(t=this.attribute.pickable)||void 0===t||t},"group");if(M(i)&&(this._title=this._renderText(o,i,a,r,"title.style","indicator-title")),M(s)){const t=Na(s),e=[];t.forEach(((t,i)=>{!1!==t.visible&&e.push(this._renderText(o,t,a,r,"content.style","indicator-content-"+i))})),this._content=e}this._setGlobalAutoFit(a),this._setYPosition();const l=null!==(e=null==o?void 0:o.AABBBounds.height())&&void 0!==e?e:0;o.setAttribute("y",n.height/2-l/2),o.setAttribute("x",n.width/2)}_setLocalAutoFit(t,e,i){var s,n,r,a,o,l,h,d,c;if("default"!==(null!==(s=i.fitStrategy)&&void 0!==s?s:"default"))return;const u=tA(null!==(r=null===(n=i.style)||void 0===n?void 0:n.text)&&void 0!==r?r:"",null!==(a=i.style)&&void 0!==a?a:{},null===(l=null===(o=this.stage)||void 0===o?void 0:o.getTheme())||void 0===l?void 0:l.text).width;if(u>0){const s=t*(null!==(h=i.fitPercent)&&void 0!==h?h:.5)/u,n=Math.floor((null!==(c=null===(d=i.style)||void 0===d?void 0:d.fontSize)&&void 0!==c?c:20)*s);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",M(i.style.lineHeight)?i.style.lineHeight:n)}}_setGlobalAutoFit(t){var e,i,s,n,r,a,o;const l=t/2,h=[];let d=0;const c=null!==(e=this.attribute.title)&&void 0!==e?e:{};c.autoFit&&"inscribed"===c.fitStrategy?(this._title.setAttribute("fontSize",12),h.push({text:this._title,spec:null!==(i=this.attribute.title)&&void 0!==i?i:{}})):d+=null!==(a=null===(r=null===(n=null===(s=this._title)||void 0===s?void 0:s.AABBBounds)||void 0===n?void 0:n.height)||void 0===r?void 0:r.call(n))&&void 0!==a?a:0;const u=null!==(o=c.space)&&void 0!==o?o:0;if(d+=u,Na(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i,s,n,r;const a=this._content[e];t.autoFit&&"inscribed"===t.fitStrategy?(a.setAttribute("fontSize",12),h.push({text:a,spec:t})):d+=null!==(n=null===(s=null===(i=null==a?void 0:a.AABBBounds)||void 0===i?void 0:i.height)||void 0===s?void 0:s.call(i))&&void 0!==n?n:0;const o=null!==(r=t.space)&&void 0!==r?r:0;d+=o})),h.length<=0)return;const p=12/h.reduce(((t,e)=>Math.max(t,e.text.AABBBounds.width())),0)*h.length,g=d/2,m=p**2+1,_=2*g*p,f=g**2-l**2,v=2*(p*((-_+Math.sqrt(_**2-4*m*f))/(2*m))+g),y=(v-d)/h.length;il(v)&&h.forEach((t=>{var e;const i=null===(e=t.spec.style)||void 0===e?void 0:e.lineHeight;t.text.setAttribute("fontSize",y),t.text.setAttribute("lineHeight",M(i)?i:y)}))}_setYPosition(){var t,e,i,s,n,r;let a=0;const o=null!==(s=null===(i=null===(e=null===(t=this._title)||void 0===t?void 0:t.AABBBounds)||void 0===e?void 0:e.height)||void 0===i?void 0:i.call(e))&&void 0!==s?s:0,l=null!==(r=null===(n=this.attribute.title)||void 0===n?void 0:n.space)&&void 0!==r?r:0;Na(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i;const s=this._content[e];s.setAttribute("y",o+l+a);const n=null!==(i=t.space)&&void 0!==i?i:0;a+=s.AABBBounds.height()+n}))}}class yG extends aD{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=Dy.Indicator,this.layoutLevel=Oy.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>t&&!1!==t.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Na(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Na(this._spec.regionId),Na(this._spec.regionIndex))}onRender(t){}changeRegions(t){}initEvent(){var t;if(this._option.disableTriggerEvent)return;if("none"===this._spec.trigger)return;const e=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();e&&("hover"===this._spec.trigger?(e.addEventListener("element-highlight:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-highlight:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))):(e.addEventListener("element-select:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-select:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){Cp(this._option.dataSet,"indicatorFilter",_G);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:()=>this._activeDatum}}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new gx(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:d}=r,c=function(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{const e=Pl({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},WE(oD(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?cl(o,this._computeLayoutRadius()):0,dy:l?cl(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==d.visible&&(!M(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},WE(oD(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:u},c)}_createOrUpdateIndicatorComponent(t){if(this._indicatorComponent)Im(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new vG(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}return this._cacheAttrs=t,this._indicatorComponent}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":ws(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>e.id===t))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}yG.type=r.indicator,yG.specKey="indicator";const bG=["sum","average","min","max","variance","standardDeviation","median"];function xG(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=Ga(s),r=Wa(s);return er}function SG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.x)&&xG(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),d=al(t.x)?wG(t.x,n)+r.x:l.getXAxisHelper().dataToPosition([t.x])+r.x,d}function MG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.y)&&xG(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),d=al(t.y)?wG(t.y,n)+r.y:l.getYAxisHelper().dataToPosition([t.y])+r.y,d}function kG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.angle)&&xG(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),a.angleAxisHelper.dataToPosition([t.angle])}function AG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.radius)&&xG(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),a.radiusAxisHelper.dataToPosition([t.radius])}function wG(t,e){return Number(t.substring(0,t.length-1))*e/100}function TG(t){return bG.includes(t)}function LG(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),d=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),c={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return p.forEach((t=>{const e=M(t.x),i=M(t.y);if(e&&i){const e=SG(t,g,n,c,h,a),i=MG(t,m,n,c,d,a);u.push([{x:e,y:i}])}else if(e){const e=SG(t,g,n,c,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=MG(t,m,n,c,d,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function CG(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=M(t.angle),i=M(t.radius);if(e&&i){const e=kG(t,l,n,r),i=AG(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=kG(t,l,n,r);a.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=AG(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function EG(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function DG(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=y(s);return r.forEach(((t,r)=>{var o,l,d,c;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:m,height:_}=p.getLayoutRect();let f=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(f=al(e)?Number(e.substring(0,e.length-1))*m/100:e),i&&(v=al(i)?Number(i.substring(0,i.length-1))*_/100:i)}const y=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Na(t.x),S=Na(t.y);1===x.length&&h(x[0])&&xG(y,x[0],i)&&(null===(l=null===(o=u.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",x[0])),1===S.length&&h(S[0])&&xG(b,S[0],i)&&(null===(c=null===(d=u.getYAxisHelper())||void 0===d?void 0:d.setExtendDomain)||void 0===c||c.call(d,"marker_yAxis_extend",S[0])),n.push({x:u.getXAxisHelper().dataToPosition(x)+g.x+f,y:u.getYAxisHelper().dataToPosition(S)+g.y+v})})),n}function OG(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),u=Na(t.angle),p=Na(t.radius);1===u.length&&h(u[0])&&xG(d,u[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",u[0])),1===p.length&&h(p[0])&&xG(c,p[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",p[0])),s.push({angle:l.angleAxisHelper.dataToPosition(u),radius:l.radiusAxisHelper.dataToPosition(p)})})),s}function PG(t,e,i){let{x:s,y:n}=t;return al(s)&&(s=wG(s,e)),al(n)&&(n=wG(n,i)),{x:s,y:n}}function RG(t,e,i){let s;if(s=ws(t)?Na(t(e.getData().getLatestData(),e)):Na(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=PG(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>PG(t,n,r)))}function BG(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.xi&&(i=r.x+a.width),r.yn&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function IG(t,e){const{labelBackground:i={},style:s,shape:n}=t,r=function(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);nn&&(d=n-l),h>r&&(c=r-h),{dx:d,dy:c}}function UG(t,e){const{dx:i,dy:s}=GG(t,e),{dx:n=0,dy:r=0}=t.attribute;i&&t.setAttribute("dx",i+n),s&&t.setAttribute("dy",s+r)}class $G extends Bk{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=zD(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=ND(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=VD(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=As(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:E({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:E({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:E({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}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:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(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:s}=this.attribute;let n;if(s){const s=ca.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=ca.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=ca.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(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}}function XG(t,e,i,s){var n,r,a,o,l;if(!t)return;null===(n=null==t?void 0:t.animates)||void 0===n||n.forEach((t=>t.stop("end")));const h=null!==(a=null===(r=t.attribute)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1,d=null!==(l=null===(o=t.attribute)||void 0===o?void 0:o.strokeOpacity)&&void 0!==l?l:1;t.setAttributes({fillOpacity:0,strokeOpacity:0}),t.animate().wait(e).to({fillOpacity:h,strokeOpacity:d},i,s)}function KG(t,e,i,s){t&&(XG(t.startSymbol,e,i,s),t.lines.forEach((t=>XG(t,e,i,s))),XG(t.line,e,i,s),XG(t.endSymbol,e,i,s))}function qG(t,e,i,s){t&&(XG(t.getTextShape(),e,i,s),XG(t.getBgRect(),e,i,s))}function ZG(t,e,i,s){var n,r,a,o;t&&(t.setAttributes({fillOpacity:null!==(r=null===(n=t.attribute)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(o=null===(a=t.attribute)||void 0===a?void 0:a.strokeOpacity)&&void 0!==o?o:1}),t.animate().wait(e).to({fillOpacity:0,strokeOpacity:0},i,s))}function JG(t,e,i,s){t&&(ZG(t.startSymbol,e,i,s),t.lines.forEach((t=>ZG(t,e,i,s))),ZG(t.line,e,i,s),ZG(t.endSymbol,e,i,s))}function QG(t,e,i,s){t&&(ZG(t.getTextShape(),e,i,s),ZG(t.getBgRect(),e,i,s))}function tU(t,e,i,s,n){const r=.1*i,a=.7*i,o=.1*i,l=.1*i;XG(t.startSymbol,s,r,n),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const o=a/t.lines.length;e.animate().wait(s+r+i*o).to({clipRange:1},o,n)})),XG(t.endSymbol,s+r+a,o,n),XG(e.getTextShape(),s+r+a+o,l,n),XG(e.getBgRect(),s+r+a+o,l,n)}function eU(t,e,i,s,n){KG(t,s,i,n),qG(e,s,i,n)}function iU(t,e,i,s,n){XG(t,s,i,n),qG(e,s,i,n)}function sU(t,e,i,s,n){XG(t,s,i,n),qG(e,s,i,n)}function nU(t,e,i,s,n,r){var a;KG(t,n,s,r),XG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?qG(i,n,s,r):XG(i,n,s,r)}function rU(t,e,i,s,n,r){var a;const o=.1*s,l=.65*s,h=.05*s,d=.1*s,c=.1*s;XG(t.startSymbol,n,o,r),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const s=l/t.lines.length;e.animate().wait(n+o+i*s).to({clipRange:1},s,r)})),XG(e,n+o+l,h,r),XG(t.endSymbol,n+o+l+h,d,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?(XG(i.getTextShape(),n+o+l+h+d,c,r),XG(i.getBgRect(),n+o+l+d,c,r)):XG(i,n+o+l+d,c,r)}function aU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"clipIn"===i?tU(t,e,s,r,a):"fadeIn"===i&&eU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"clipIn"===i?tU(t,e,s,n,a):"fadeIn"===i&&eU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){JG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function oU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&iU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&iU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){ZG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function lU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&sU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&sU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){ZG(t,s,i,n),QG(e,s,i,n)}(t,e,i,s,n)}}function hU(t,e,i,s){const[n,r]=t,{enter:a,update:o,exit:l}=i;if("enter"===s){const{type:t,duration:i,delay:s,easing:o}=a;"fadeIn"===t?nU(n,r,e,i,s,o):"callIn"===t&&rU(n,r,e,i,s,o)}else if("update"===s){const{type:t,duration:i,delay:s,easing:a}=o;"fadeIn"===t?nU(n,r,e,i,s,a):"callIn"===t&&rU(n,r,e,i,s,a)}else if("exit"===s){const{duration:t,delay:i,easing:s}=l;!function(t,e,i,s,n,r){var a;JG(t,n,s,r),ZG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?QG(i,n,s,r):ZG(i,n,s,r)}(n,r,e,t,i,s)}}const dU={type:"clipIn",duration:500,easing:"linear",delay:0},cU={type:"fadeIn",duration:500,easing:"linear",delay:0},uU={type:"callIn",duration:500,easing:"linear",delay:0},pU={type:"fadeOut",duration:500,easing:"linear",delay:0};class gU extends $G{constructor(){super(...arguments),this.name="markCommonLine",this.defaultUpdateAnimation=dU,this.defaultExitAnimation=pU}getLine(){return this._line}getLabel(){return this._label}setLabelPos(){const{label:t={},limitRect:e}=this.attribute,{position:i,confine:s,autoRotate:n}=t,r=this.getPointAttrByPosition(i),a=i.toString().toLocaleLowerCase().includes("start")?this._line.getStartAngle()||0:this._line.getEndAngle()||0;if(this._label.setAttributes(Object.assign(Object.assign({},r.position),{angle:n?this.getRotateByAngle(r.angle):0,textStyle:Object.assign(Object.assign({},this.getTextStyle(i,a,n)),t.textStyle)})),e&&s){const{x:t,y:i,width:s,height:n}=e;UG(this._label,{x1:t,y1:i,x2:t+s,y2:i+n})}}initMarker(t){const{label:e,state:i}=this.attribute,s=this.createSegment();s.name="mark-common-line-line",this._line=s,t.add(s);const n=new PD(Object.assign(Object.assign({},e),{state:{panel:E({},Zk,null==i?void 0:i.labelBackground),text:E({},Zk,null==i?void 0:i.label)}}));n.name="mark-common-line-label",this._label=n,t.add(n),this.setLabelPos()}updateMarker(){const{label:t,state:e}=this.attribute;this.setLineAttributes(),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},t),{state:{panel:E({},Zk,null==e?void 0:e.labelBackground),text:E({},Zk,null==e?void 0:e.label)}})),this.setLabelPos())}}var mU,_U,fU,vU;!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"}(mU||(mU={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom"}(_U||(_U={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(fU||(fU={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(vU||(vU={}));const yU=.001,bU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:mU.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},xU={postiveXAxis:{start:{textAlign:"left",textBaseline:"middle"},startTop:{textAlign:"left",textBaseline:"bottom"},startBottom:{textAlign:"left",textBaseline:"top"},insideStart:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"right",textBaseline:"bottom"},insideStartBottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},endTop:{textAlign:"left",textBaseline:"bottom"},endBottom:{textAlign:"left",textBaseline:"top"},insideEnd:{textAlign:"right",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},negativeXAxis:{start:{textAlign:"right",textBaseline:"middle"},startTop:{textAlign:"right",textBaseline:"bottom"},startBottom:{textAlign:"right",textBaseline:"top"},insideStart:{textAlign:"left",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"right",textBaseline:"middle"},endTop:{textAlign:"right",textBaseline:"bottom"},endBottom:{textAlign:"right",textBaseline:"top"},insideEnd:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"left",textBaseline:"bottom"},insideEndBottom:{textAlign:"left",textBaseline:"top"}}},SU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:fU.arcOuterMiddle,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},MU={interactive:!0,label:{position:_U.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},kU={interactive:!0,label:{position:fU.arcOuterMiddle,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},AU={arcInnerStart:{textAlign:"center",textBaseline:"bottom"},arcInnerEnd:{textAlign:"center",textBaseline:"bottom"},arcInnerMiddle:{textAlign:"center",textBaseline:"bottom"},arcOuterStart:{textAlign:"center",textBaseline:"top"},arcOuterEnd:{textAlign:"center",textBaseline:"top"},arcOuterMiddle:{textAlign:"center",textBaseline:"top"},center:{textAlign:"center",textBaseline:"middle"}},wU={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},TU={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"}}};function LU(){CU._animate=aU}WG(),xD();class CU extends gU{markerAnimate(t){CU._animate&&this._animationConfig&&CU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},CU.defaultAttributes,t)),this.name="markLine"}getPointAttrByPosition(t){var e;const{label:i={}}=this.attribute,{refX:s=0,refY:n=0}=i,r=this._line.getMainSegmentPoints(),a=null!==(e=this._line.getEndAngle())&&void 0!==e?e:0,o=(Wk(a),a),l=s*Math.cos(o)+n*Math.cos(o-Math.PI/2),h=s*Math.sin(o)+n*Math.sin(o-Math.PI/2);return t.includes("start")||t.includes("Start")?{position:{x:r[0].x+l,y:r[0].y+h},angle:o}:t.includes("middle")||t.includes("Middle")?{position:{x:(r[0].x+r[r.length-1].x)/2+l,y:(r[0].y+r[r.length-1].y)/2+h},angle:o}:{position:{x:r[r.length-1].x+l,y:r[r.length-1].y+h},angle:o}}getRotateByAngle(t){var e;return(Wk(t)?t:t-Math.PI)+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}getTextStyle(t,e,i){return Gk(Math.abs(e),Math.PI/2,yU)||Gk(Math.abs(e),3*Math.PI/2,yU)?Uk(i,e,t):Wk(e)?xU.postiveXAxis[t]:xU.negativeXAxis[t]}createSegment(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;return new MD({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,pickable:!1,state:{line:E({},Zk,null==a?void 0:a.line),startSymbol:E({},Zk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},Zk,null==a?void 0:a.lineEndSymbol)}})}setLineAttributes(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:{line:E({},Zk,null==a?void 0:a.line),startSymbol:E({},Zk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},Zk,null==a?void 0:a.lineEndSymbol)}})}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach((t=>{if(t.length)t.forEach((t=>{il(t.x)&&il(t.y)||(e=!1)}));else if(!il(t.x)||!il(t.y))return void(e=!1)})),e}}CU.defaultAttributes=bU;function EU(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=function(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{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let d=i;M(r)&&(d=Na(i)[r]),n&&Na(i).includes(n)&&(d=n);let c=s;M(h)&&(c=Na(s)[h]),o&&Na(s).includes(o)&&(c=o),l=Object.assign({x:void 0,y:void 0},a),S(t[d])&&TG(t[d])?l.x={field:d,aggrType:t[d]}:l.x=Na(d).map((e=>t[e])),S(t[c])&&TG(t[c])?l.y={field:c,aggrType:t[c]}:l.y=Na(c).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;M(r)&&(o=Na(s)[r]),n&&Na(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),S(t[o])&&TG(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Na(o).map((e=>t[e])),S(t[h])&&TG(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Na(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){const s=e.x;y(s)?i.x=s.map((i=>OU(i,t,e))):i.x=OU(s,t,e)}if(M(e.y)){const s=e.y;y(s)?i.y=s.map((i=>OU(i,t,e))):i.y=OU(s,t,e)}if(M(e.angle)){const s=e.angle;y(s)?i.angle=s.map((i=>OU(i,t,e))):i.angle=OU(s,t,e)}if(M(e.radius)){const s=e.radius;y(s)?i.radius=s.map((i=>OU(i,t,e))):i.radius=OU(s,t,e)}if(M(e.areaName)){const s=e.areaName;i.areaName=OU(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const DU={min:(t,e)=>_d(t[0].latestData,e.field),max:(t,e)=>fd(t[0].latestData,e.field),sum:function(t,e){return vd(t[0].latestData,e.field)},average:function(t,e){return yd(t[0].latestData,e.field)},variance:function(t,e){return bd(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(bd(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return((t,e)=>{let i=t;return!0!==e&&(i=t.sort(pd)),function(t,e,i=gd){const s=t.length;if(!s)return;if(e<=0||s<2)return i(t[0],0,t);if(e>=1)return i(t[s-1],s-1,t);const n=(s-1)*e,r=Math.floor(n),a=i(t[r],r,t);return a+(i(t[r+1],r+1,t)-a)*(n-r)}(i,.5)})(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function OU(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(ws(t))return t(a,o,l,s,n,r);if(w(t)){const{aggrType:i,field:s}=t;return DU[i](e,{field:s})}return t}class PU extends aD{constructor(){super(...arguments),this.layoutType="none",this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType))}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){return S(e)&&TG(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Na(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const i=new f;return i.registerParser("array",e),new R(i).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}onRender(t){}changeRegions(t){}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=LE(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e,i){D(this._spec.offsetX)||(this._layoutOffsetX=ol(this._spec.offsetX,e.width,e)),D(this._spec.offsetY)||(this._layoutOffsetY=ol(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e,i)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}}function RU(t,e){return function(t,e,i){const{predict:s}=function(t,e=t=>t.x,i=t=>t.y){let s=0,n=0,r=0,a=0,o=0;cd(t,e,i,((t,e)=>{++o,s+=(t-s)/o,n+=(e-n)/o,r+=(t*e-r)/o,a+=(t*t-a)/o}));const l=function(t,e,i,s){const n=s-t*t,r=Math.abs(n)<1e-24?0:(i-t*e)/n;return[e-r*t,r]}(s,n,r,a),h=t=>l[0]+l[1]*t;return{coef:l,predict:h,rSquared:ud(t,e,i,n,h)}}(t,(t=>t[e]),(t=>t[i])),n=_d(t,e),r=fd(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}function BU(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class IU extends PU{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=Dy.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=zG(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v;const{label:y={},startSymbol:b={},endSymbol:x={}}=this._spec,S={zIndex:this.layoutZIndex,interactive:null===(t=this._spec.interactive)||void 0===t||t,hover:null===(e=this._spec.interactive)||void 0===e||e,select:null===(i=this._spec.interactive)||void 0===i||i,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:YG(GE(null===(s=this._spec.line)||void 0===s?void 0:s.style),this._markerData),clipInRange:null!==(n=this._spec.clip)&&void 0!==n&&n,label:IG(y,this._markerData),state:{line:FG(null!==(a=null===(r=this._spec.line)||void 0===r?void 0:r.state)&&void 0!==a?a:{},this._markerData),lineStartSymbol:FG(null!==(l=null===(o=this._spec.startSymbol)||void 0===o?void 0:o.state)&&void 0!==l?l:{},this._markerData),lineEndSymbol:FG(null!==(d=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==d?d:{},this._markerData),label:FG(null!==(p=null===(u=null===(c=this._spec)||void 0===c?void 0:c.label)||void 0===u?void 0:u.state)&&void 0!==p?p:{},this._markerData),labelBackground:FG(null!==(f=null===(_=null===(m=null===(g=this._spec)||void 0===g?void 0:g.label)||void 0===m?void 0:m.labelBackground)||void 0===_?void 0:_.state)&&void 0!==f?f:{},this._markerData)},animation:null!==(v=this._spec.animation)&&void 0!==v&&v,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return b.visible?S.startSymbol=Object.assign(Object.assign({},b),{visible:!0,style:GE(b.style)}):S.startSymbol={visible:!1},x.visible?S.endSymbol=Object.assign(Object.assign({},x),{visible:!0,style:GE(x.style)}):S.endSymbol={visible:!1},this._newMarkLineComponent(S)}_getUpdateMarkerAttrs(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=l.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=BG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}const p=null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{},g=Object.assign(Object.assign({},p.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=p.label)||void 0===s?void 0:s.text});return Object.assign(Object.assign({},h),{label:g,limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c}=zG(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||d||c||e))return;Cp(this._option.dataSet,"markerAggregation",EU),Cp(this._option.dataSet,"markerRegression",RU),Cp(this._option.dataSet,"markerFilter",BU);const{options:u,needAggr:p,needRegr:g,processData:m}=this._computeOptions(),_=new R(this._option.dataSet);_.parse([m],{type:"dataview"}),p&&_.transform({type:"markerAggregation",options:u}),g&&_.transform({type:"markerRegression",options:u}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(()=>{this._markerLayout()})),this._markerData=_}}IU.specKey="markLine";class FU extends IU{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new CU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=M(e.coordinates),o=M(e.process),l=o&&M(e.process.x),h=o&&M(e.process.y),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:p,doXYY1Process:g,doYXX1Process:m,doXYProcess:_,doCoordinatesProcess:f}=zG(e);let v=[];if(u||g||p||m||_||a&&l||a&&h){const t=LG(i,s,n,r,c);v=1===t.length?t[0]:t.map((t=>t[0]))}else f?v=DG(i,r,c,e.coordinatesOffset):d&&(v=RG(e.positions,r,e.regionRelative));return{points:v}}_markerLayout(){var t,e,i,s,n,r,a,o;const l=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const o=this._startRelativeSeries,h=this._endRelativeSeries,{multiSegment:d,mainSegmentIndex:c}=this._spec.line||{},{connectDirection:u,expandDistance:p=0}=this._spec;let g;if(al(p)){const t=o.getRegion(),e=t.getLayoutStartPoint(),i=h.getRegion(),s=i.getLayoutStartPoint();if("bottom"===u||"top"===u){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));g=Number(p.substring(0,p.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));g=Number(p.substring(0,p.length-1))*n/100}}else g=p;const{points:m,label:_,limitRect:f}=l,v=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(m[0],m[1],u,g);let y;y=d&&M(c)?{position:"middle",autoRotate:!1,refX:0,refY:0}:Object.assign(Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(m[0],m[1],u,g)),{refX:0,refY:0}),il(null===(t=this._spec.label)||void 0===t?void 0:t.refX)&&(y.refX+=this._spec.label.refX),il(null===(e=this._spec.label)||void 0===e?void 0:e.refY)&&(y.refY+=this._spec.label.refY),il(null===(i=this._spec.label)||void 0===i?void 0:i.dx)&&(y.dx=(y.dx||0)+this._spec.label.dx),il(null===(s=this._spec.label)||void 0===s?void 0:s.dy)&&(y.dy=(y.dy||0)+this._spec.label.dy);const b=null!==(r=null===(n=this._markerComponent)||void 0===n?void 0:n.attribute)&&void 0!==r?r:{};null===(a=this._markerComponent)||void 0===a||a.setAttributes({points:d?[[v[0],v[1]],[v[1],v[2]],[v[2],v[3]]]:v,label:Object.assign(Object.assign(Object.assign({},_),y),{textStyle:Object.assign(Object.assign({},b.label.textStyle),{textAlign:"center",textBaseline:"middle"})}),limitRect:f,multiSegment:d,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(o=this._markerComponent)||void 0===o||o.setAttributes(l)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:d,doCoordinatesProcess:c}=zG(n);if(d)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(c){if(t=this._processSpecCoo(n),i=!1,e=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&"x"in n.process&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&"y"in n.process&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&"xy"in n.process){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}FU.type=r.markLine,FU.coordinateType="cartesian",SD();class YU extends MD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},MD.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:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},d={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,d];const c=this._renderSymbol(t,this._mainSegmentPoints,"start"),u=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=c,this.endSymbol=u;const p=ca.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),jm(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}WG(),SD();class jU extends gU{markerAnimate(t){jU._animate&&this._animationConfig&&jU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},jU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcLine"}getPointAttrByPosition(t){const{center:e,radius:i,startAngle:s,endAngle:n,label:r}=this.attribute,{refX:a=0,refY:o=0}=r;let l;switch(t){case fU.arcInnerStart:l=s;case fU.arcOuterStart:l=s;break;case fU.arcInnerEnd:l=n;case fU.arcOuterEnd:l=n;break;case fU.center:case fU.arcInnerMiddle:case fU.arcOuterMiddle:default:l=(s+n)/2}return{position:{x:e.x+(i+o)*Math.cos(l)+a*Math.cos(l-Math.PI/2),y:e.y+(i+o)*Math.sin(l)+a*Math.sin(l-Math.PI/2)},angle:l}}getTextStyle(t){return AU[t]}getRotateByAngle(t){var e;return t-Math.PI/2+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}createSegment(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;return new YU({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},Zk,null==o?void 0:o.line),startSymbol:E({},Zk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},Zk,null==o?void 0:o.lineEndSymbol)}})}setLineAttributes(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;this._line&&this._line.setAttributes({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},Zk,null==o?void 0:o.line),startSymbol:E({},Zk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},Zk,null==o?void 0:o.lineEndSymbol)}})}isValidPoints(){return!0}}jU.defaultAttributes=SU;class HU extends IU{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=zG(this._spec);return e||i?new jU(t):new CU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c,doCoordinatesProcess:u}=zG(e);let p=[],g={};const m={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||d||c){const t=CG(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:m}:{points:p.map((t=>Tt(m,t.radius,t.angle)))}}else u&&(p=OG(i,r,a),g={points:p.map((t=>Tt(m,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=zG(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}HU.type=r.polarMarkLine,HU.coordinateType="polar",p_(),cf(),ik();class zU extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},zU.defaultAttributes,t)),this.name="title"}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f;const{textType:v,text:b,subtextType:x,textStyle:S={},subtext:k,subtextStyle:A={},width:w,height:T,minWidth:L,maxWidth:C,minHeight:E,maxHeight:D,align:O,verticalAlign:P,padding:R=0}=this.attribute,B=bD(R),I=this.createOrUpdateChild("title-container",{x:B[3],y:B[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==S.visible){const{width:o,height:l,maxHeight:h,maxWidth:d,x:c=0,y:u=0,ellipsis:p=!0,wordBreak:g="break-word",maxWidth:m,lineClamp:_}=S;if("rich"===v||M(S.character)){const s=Object.assign({x:c,y:u,width:null!==(t=null!=o?o:w)&&void 0!==t?t:0,height:null!==(e=null!=l?l:T)&&void 0!==e?e:0,ellipsis:null==p||p,wordBreak:null!=g?g:"break-word",maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:null!==(i=S.character)&&void 0!==i?i:b},S);this._mainTitle=I.createOrUpdateChild("mainTitle",s,"richtext")}else if("html"===v){const t=Object.assign({html:Object.assign(Object.assign({dom:b},Jk),S),x:c,y:u,width:null!==(s=null!=o?o:w)&&void 0!==s?s:0,height:null!==(n=null!=l?l:T)&&void 0!==n?n:0,ellipsis:p,wordBreak:g,maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:[]},S);this._mainTitle=I.createOrUpdateChild("mainTitle",t,"richtext")}else M(b)&&(this._mainTitle=I.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:y(b)?b:[b],whiteSpace:"normal"},S),{maxLineWidth:null!==(a=null!==(r=S.maxLineWidth)&&void 0!==r?r:o)&&void 0!==a?a:w,heightLimit:null!=l?l:D,lineClamp:_,ellipsis:p,x:c,y:u}),"text"))}const F=this._mainTitle?this._mainTitle.AABBBounds.height():0,Y=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==A.visible){const{width:t,height:e,maxWidth:i,maxHeight:s,x:n=0,y:r=0,ellipsis:a=!0,wordBreak:g="break-word",lineClamp:m}=A,_=Math.max(Number.MIN_VALUE,D-F);if("rich"===x||M(A.character)){const d=Object.assign({x:n,y:r,width:null!==(o=null!=t?t:w)&&void 0!==o?o:0,height:null!==(l=null!=e?e:T)&&void 0!==l?l:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:null!==(h=A.character)&&void 0!==h?h:k},A);this._subTitle=I.createOrUpdateChild("subTitle",d,"richtext")}else if("html"===x){const o=Object.assign({html:Object.assign(Object.assign({dom:k},Jk),A),x:n,y:r,width:null!==(d=null!=t?t:w)&&void 0!==d?d:0,height:null!==(c=null!=e?e:T)&&void 0!==c?c:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:[]},A);this._subTitle=I.createOrUpdateChild("subTitle",o,"richtext")}else M(k)&&(this._subTitle=I.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:y(k)?k:[k],whiteSpace:"normal"},A),{maxLineWidth:null!==(u=A.maxLineWidth)&&void 0!==u?u:w,heightLimit:null!==(p=A.heightLimit)&&void 0!==p?p:_,lineClamp:m,ellipsis:a,x:0,y:F}),"text"))}const j=this._subTitle?this._subTitle.AABBBounds.height():0,H=this._subTitle?this._subTitle.AABBBounds.width():0;let z=Math.max(Y,H),N=F+(null!==(g=A.height)&&void 0!==g?g:j);if(M(w)&&(z=w),M(T)&&(N=T),M(L)&&zC&&(z=C),M(E)&&ND&&(N=D),I.attribute.width=z,I.attribute.height=N,I.attribute.boundsPadding=B,this._mainTitle){if(M(O)||M(S.align)){const t=S.align?S.align:O,e=null!==(m=S.width)&&void 0!==m?m:Y;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(M(P)||M(S.verticalAlign)){const t=S.verticalAlign?S.verticalAlign:P,e=S.height?S.height:N;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(M(O)||M(A.align)){const t=A.align?A.align:O,e=null!==(_=A.width)&&void 0!==_?_:H;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(M(P)||M(S.verticalAlign)){const t=A.verticalAlign?A.verticalAlign:P,e=F,i=null!==(f=A.height)&&void 0!==f?f:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}zU.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};class NU extends aD{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=Dy.Title,this.layoutLevel=Oy.Title,this._orient="top",this._orient=rl(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return qT(t,this.specKey,r.title,(t=>!1!==t.visible))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}update(t){}resize(t){}afterSetLayoutStartPoint(t){il(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),il(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:il(t.width())?t.width():0,height:this._spec.height?this._spec.height:il(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o,l;const h=Math.max(0,null!==(t=this._spec.width)&&void 0!==t?t:this.getLayoutRect().width);return!1===this._spec.visible?{visible:!1}:Object.assign(Object.assign({},oD(this._spec,["padding"])),{textType:null!==(e=this._spec.textType)&&void 0!==e?e:"text",text:null!==(i=this._spec.text)&&void 0!==i?i:"",subtextType:null!==(s=this._spec.subtextType)&&void 0!==s?s:"text",subtext:null!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,width:h,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:this._spec.maxWidth,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(l=this._spec.verticalAlign)&&void 0!==l?l:"top",textStyle:Object.assign({width:h},this._spec.textStyle),subtextStyle:Object.assign({width:h},this._spec.subtextStyle)})}_createOrUpdateTitleComponent(t){if(this._titleComponent)Im(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new zU(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}}function VU(){WU._animate=oU}NU.type=r.title,NU.specKey=r.title,WG(),yk();class WU extends $G{markerAnimate(t){WU._animate&&this._animationConfig&&WU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},WU.defaultAttributes,t)),this.name="markArea",this.defaultUpdateAnimation=cU,this.defaultExitAnimation=pU}getPointAttrByPosition(t){const{x1:e,x2:i,y1:s,y2:n}=this._area.AABBBounds;return t.includes("left")||t.includes("Left")?{x:e,y:(s+n)/2}:t.includes("right")||t.includes("Right")?{x:i,y:(s+n)/2}:t.includes("top")||t.includes("Top")?{x:(e+i)/2,y:s}:t.includes("bottom")||t.includes("Bottom")?{x:(e+i)/2,y:n}:{x:(e+i)/2,y:(s+n)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=null!==(t=e.position)&&void 0!==t?t:"middle",s=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},s),{textStyle:Object.assign(Object.assign({},wU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;UG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{points:e,label:i,areaStyle:s,state:n}=this.attribute,r=ca.polygon(Object.assign({points:e},s));r.states=E({},Zk,null==n?void 0:n.area),r.name="mark-area-polygon",this._area=r,t.add(r);const a=new PD(Object.assign(Object.assign({},i),{state:{panel:E({},Zk,null==n?void 0:n.labelBackground),text:E({},Zk,null==n?void 0:n.label)}}));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i,state:s}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({points:t},i)),this._area.states=E({},Zk,null==s?void 0:s.area)),this._label&&this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},e),{state:{panel:E({},Zk,null==s?void 0:s.labelBackground),text:E({},Zk,null==s?void 0:s.label)}})),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach((t=>{il(t.x)&&il(t.y)||(e=!1)})),e}}WU.defaultAttributes=MU;class GU extends PU{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=Dy.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=NG(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c;const u=null!==(t=this._spec.label)&&void 0!==t?t:{},p={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:YG(GE(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:IG(u,this._markerData),state:{area:FG(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData),label:FG(null===(o=this._spec.label)||void 0===o?void 0:o.state,this._markerData),labelBackground:FG(null===(d=null===(h=null===(l=this._spec)||void 0===l?void 0:l.label)||void 0===h?void 0:h.labelBackground)||void 0===d?void 0:d.state,this._markerData)},animation:null!==(c=this._spec.animation)&&void 0!==c&&c,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(p)}_markerLayout(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=this._getRelativeDataView().latestData,c=r?r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData:d;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=BG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}this._markerComponent&&this._markerComponent.setAttributes(Object.assign(Object.assign({},h),{label:Object.assign(Object.assign({},null===(e=this._markerComponent.attribute)||void 0===e?void 0:e.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=null===(i=this._markerComponent.attribute)||void 0===i?void 0:i.label)||void 0===s?void 0:s.text}),limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=NG(t);if(!(e||i||s||n||r||a||o))return null;const{options:l}=this._computeOptions(),h=this._getRelativeDataView();Cp(this._option.dataSet,"markerAggregation",EU),Cp(this._option.dataSet,"markerFilter",BU);const d=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});d.parse([h],{type:"dataview"}),d.transform({type:"markerAggregation",options:l}),d.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),d.target.on("change",(()=>{this._markerLayout()})),this._markerData=d}}GU.specKey="markArea";class UU extends GU{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new WU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=NG(e),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],p=[];if(l){p=LG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){p=LG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=DG(i,r,c,e.coordinatesOffset):d&&(u=RG(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=NG(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}UU.type=r.markArea,UU.coordinateType="cartesian",WG(),Gx();class $U extends $G{markerAnimate(t){$U._animate&&this._animationConfig&&$U._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},$U.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcArea",this.defaultUpdateAnimation=cU,this.defaultExitAnimation=pU}getPointAttrByPosition(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,label:a}=this.attribute,{refX:o=0,refY:l=0}=a;let h,d;switch(t){case fU.center:h=(i+s)/2,d=(n+r)/2;break;case fU.arcInnerStart:h=i,d=n;break;case fU.arcOuterStart:h=s,d=n;break;case fU.arcInnerEnd:h=i,d=r;break;case fU.arcOuterEnd:h=s,d=r;break;case fU.arcInnerMiddle:h=i,d=(n+r)/2;break;case fU.arcOuterMiddle:h=s,d=(n+r)/2;break;default:h=i,d=(n+r)/2}return{position:{x:e.x+(h+l)*Math.cos(d)+o*Math.cos(d-Math.PI/2),y:e.y+(h+l)*Math.sin(d)+o*Math.sin(d-Math.PI/2)},angle:d}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,{position:i="arcInnerMiddle",autoRotate:s}=e,n=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},n.position),{angle:s?n.angle-Math.PI/2+(null!==(t=e.refAngle)&&void 0!==t?t:0):0,textStyle:Object.assign(Object.assign({},AU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;UG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,areaStyle:a,label:o,state:l}=this.attribute,h=ca.arc(Object.assign({x:e.x,y:e.y,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r},a));h.states=E({},Zk,null==l?void 0:l.area),h.name="polar-mark-area-area",this._area=h,t.add(h);const d=new PD(Object.assign(Object.assign({},o),{state:{panel:E({},Zk,null==l?void 0:l.labelBackground),text:E({},Zk,null==l?void 0:l.label)}}));d.name="mark-area-label",this._label=d,t.add(d),this.setLabelPos()}updateMarker(){const{center:t,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n,areaStyle:r,label:a,state:o}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({x:t.x,y:t.y,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n},r)),this._area.states=E({},Zk,null==o?void 0:o.area)),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},a),{state:{panel:E({},Zk,null==o?void 0:o.labelBackground),text:E({},Zk,null==o?void 0:o.label)}})),this.setLabelPos())}isValidPoints(){return!0}}$U.defaultAttributes=kU;class XU extends GU{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=NG(this._spec);return i||e||s?new $U(t):new WU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=NG(e),d=null!==(t=e.autoRange)&&void 0!==t&&t;let c,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=CG(i,s,n,r,d);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(c=OG(i,r,d),u={points:c.map((t=>Tt(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=NG(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}XU.type=r.polarMarkArea,XU.coordinateType="polar";class KU extends Cv{constructor(t){super(t)}}var qU,ZU;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(qU||(qU={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(ZU||(ZU={}));class JU extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},JU.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},JU.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},JU.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},JU.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},JU.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(s=this._forwardAttr.style.symbolType)&&void 0!==s?s:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{D(this._playController)&&(this._playController=new KU(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{D(this._backwardController)&&(this._backwardController=new KU(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{D(this._forwardController)&&(this._forwardController=new KU(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent(qU.OnPlay)},this.pause=()=>{this._dispatchEvent(qU.OnPause)},this.forward=()=>{this._dispatchEvent(qU.OnForward)},this.backward=()=>{this._dispatchEvent(qU.OnBackward)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}JU.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},JU.defaultAttributes={[ZU.Start]:{},[ZU.Pause]:{},[ZU.Backward]:{},[ZU.Forward]:{}};const QU={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},t$=[200,10];var e$,i$;(i$=e$||(e$={})).Default="default",i$.Reverse="reverse";const s$=t=>"top"===t||"bottom"===t;class n$ extends Bk{getMinIndex(){return this._minIndex}getMaxIndex(){return this._maxIndex}getDataIndex(){return this._dataIndex}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},n$.defaultAttributes,t)),this._data=[],this._dataIndex=0,this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e;let i;il(this._handlerStyle.size)?i=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(i=ut(this._handlerStyle.size[0],this._handlerStyle.size[1]));const s={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:this._dataIndex,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:il(i)?i:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(s$(this._orient)){const e=Math.max(0,this._layoutInfo.slider.size),i=null!==(t=this._railStyle.height)&&void 0!==t?t:t$[1];s.layout="horizontal",s.railHeight=i,s.railWidth=e,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.width)&&void 0!==e?e:t$[1];s.layout="vertical",s.railWidth=i,s.railHeight=t,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}return s},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new gW(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return t.layout=s$(this._orient)?"horizontal":"vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new JU(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initDataIndex(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initDataIndex(){var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0}_initLayoutInfo(){var t,e,i;const s=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=s.filter((t=>"end"!==t.position)),r=s.filter((t=>"end"===t.position)),a=null!==(t=s$(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:t$[1],o=s.reduce(((t,e)=>{const i=e.style.size,s=h(i)?i:ut(i[0],i[1]);return t+e.space+s}),0),l=this._sliderVisible?(s$(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(i=this._size)||void 0===i?void 0:i.height)-o:0,d=l-this.attribute.slider.space,c=n.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:s$(this._orient)?t+s:(this._size.width-r)/2,y:s$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:d,x:s$(this._orient)?c+this.attribute.slider.space:(this._size.width-a)/2,y:s$(this._orient)?(this._size.height-a)/2:c+this.attribute.slider.space}),r.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:s$(this._orient)?t+s:(this._size.width-r)/2,y:s$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),c+l)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}var r$;function a$(){qV(),p_(),Uv()}n$.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},QU),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},QU),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},QU),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},QU),{key:"backward",position:"start"})}},function(t){t.change="change",t.play="play",t.pause="pause",t.backward="backward",t.forward="forward",t.end="end",t.OnChange="change",t.OnPlay="play",t.OnPause="pause",t.OnBackward="backward",t.OnForward="forward",t.OnEnd="end"}(r$||(r$={})),a$();class o$ extends n${constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i;super._initAttributes(),this._alternate=null!==(t=this.attribute.alternate)&&void 0!==t&&t,this._interval=null!==(e=this.attribute.interval)&&void 0!==e?e:1e3,this._direction=null!==(i=this.attribute.direction)&&void 0!==i?i:e$.Default},this._initDataIndex=()=>{var t;this._dataIndex=D(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(qU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(qU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(qU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(qU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{const e=Math.floor(t.detail.value)+.5;this._dataIndex=t.detail.value>=e?Math.ceil(t.detail.value):Math.floor(t.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(r$.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,((({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,maxIndex:e,dataIndex:i})=>t===e$.Default&&i===e)({direction:t,maxIndex:e,dataIndex:s})||(({direction:t,minIndex:e,dataIndex:i})=>t===e$.Reverse&&i===e)({direction:t,minIndex:i,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||(({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,minIndex:e,dataIndex:i})=>t===e$.Default&&i===e)({direction:t,minIndex:i,dataIndex:s})||(({direction:t,maxIndex:e,dataIndex:i})=>t===e$.Reverse&&i===e)({direction:t,maxIndex:e,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===e$.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(r$.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=$o.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{const e=Date.now();if(this._isReachEnd&&e-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(r$.change),this._activeIndex=this._dataIndex):e-this._tickTime>=this._interval&&(this._tickTime=e,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(r$.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=$o.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),$o.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(r$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,$o.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.pause))},this.backward=()=>{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex-1{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex+1>this._maxIndex?this._minIndex:this._dataIndex+1:Math.min(this._dataIndex+1,this._maxIndex),this._updateDataIndex(e),this.dispatchCustomEvent(r$.change),this.dispatchCustomEvent(r$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}a$();class l$ extends n${constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3;const e=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=e?e:1)):(this._totalDuration=this._interval*e,this._interval=this.attribute.interval)},this._initDataIndex=()=>{var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:this._minIndex},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(qU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(qU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(qU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(qU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{const e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(r$.change))},this.play=()=>{return t=this,e=void 0,s=function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(r$.play),this._rafId=$o.getRequestAnimationFrame()(this._play.bind(this)))},new((i=void 0)||(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())}));var t,e,i,s},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=$o.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,$o.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,$o.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(r$.pause))},this.backward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed-e;i<=0?(this._elapsed=0,this._startTime=t):(this._elapsed=i,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(r$.backward)},this.forward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed+e;i>=this._totalDuration?(this._startTime=t-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-e,this._elapsed=i),this._updateSlider(),this.dispatchCustomEvent(r$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}const h$=t=>GE(Object.assign({},t)),d$=t=>Object.assign(Object.assign({},t),{style:Object.assign({},GE(t.style))}),c$=t=>{var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;const _=h$(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),f=h$(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),v=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},GE(Object.assign({},k))),y=d$(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=d$(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==d?d:{}),x=d$(null!==(u=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==u?u:{}),S=d$(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),M=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(m=t.orient)&&void 0!==m?m:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:_,railStyle:f,handlerStyle:v}),controller:Object.assign(Object.assign({},t.controller),{start:y,pause:b,backward:x,forward:S})});var k;return t.visible||(M.controller.visible=!1,M.slider.visible=!1),M},u$=t=>"left"===t||"right"===t,p$=t=>"top"===t||"bottom"===t;class g$ extends aD{constructor(){super(...arguments),this.layoutZIndex=Dy.Player,this.layoutLevel=Oy.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},c$(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},c$(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?Im(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new o$(t):this._playerComponent=new l$(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Na(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Na(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Na(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Na(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=u$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=u$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,d=Math.max(...Na(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Na(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Na(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Na(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=d?h-d:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(zd.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&this._playerComponent.play()})),this._playerComponent.addEventListener(r$.end,(()=>{var t;this.event.emit(zd.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(r$.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(r$.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(r$.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(zd.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),il(t.x)){const e=u$(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(il(t.y)){const e=p$(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}changeRegions(t){}onRender(t){}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return h(this._spec.width)?Math.min(t.width,Number(this._spec.width)):u$(this._orient)?this._maxSize():t.width}_computeHeight(t){return h(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):p$(this._orient)?this._maxSize():t.height}_computeDx(t){return u$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return p$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];Na(e.data).forEach((t=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.globalInstance)||void 0===i||i.updateData(t.id,t.values)})),this.event.emit(zd.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}}g$.specKey="player",g$.type=r.player;class m$ extends Bk{constructor(t,e){const{dataLabels:i}=t,s=function(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{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}m$.defaultAttributes={pickable:!1};class _$ extends i_{constructor(t,e){super(t,tc.label,e),this.spec.componentType=tc.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){const t=Na(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t));this.detach(t)}if(this.spec.target=t,t){const e=Na(t).map((t=>S(t)?this.view.getMarkById(t):t));this.attach(e)}return this.commit(),this}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=Na(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t)),h=null===(r=null===(n=this.group)||void 0===n?void 0:n.getGroupGraphicItem)||void 0===r?void 0:r.call(n);let d=Up(this.spec.size,i);d||(d=h?{width:null!==(a=h.attribute.width)&&void 0!==a?a:h.AABBBounds.width(),height:null!==(o=h.attribute.height)&&void 0!==o?o:h.AABBBounds.height()}:{width:1/0,height:1/0});const c=this.spec.skipTheme?null:this.view.getCurrentTheme();return((t,e,i,s,n,r={})=>{var a;const o=null===(a=r.components)||void 0===a?void 0:a.dataLabel,l=t.map(((t,e)=>{var a,o,l,h,d;const c=Object.assign(Object.assign({},n),{labelIndex:e}),u=null!==(a=Up(s,c,t))&&void 0!==a?a:{},{components:p={}}=r;let g={};switch(t.markType){case Qd.line:case Qd.area:g="line"===u.type?p.lineLabel:"area"===u.type?p.areaLabel:p.lineDataLabel;break;case Qd.rect:case Qd.rect3d:case Qd.interval:g=p.rectLabel;break;case Qd.symbol:case Qd.circle:case Qd.cell:g=p.symbolLabel;break;case Qd.arc:case Qd.arc3d:g=p.arcLabel;break;case Qd.polygon:case Qd.path:default:g=p.pointLabel}const m=null!==(o=u.data)&&void 0!==o?o:[],_=null!==(h=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l[0])&&void 0!==h?h:{};if(m&&m.length>0)m.forEach(((e,s)=>{if(t.elements[s]){const n=Pm(i,e,t.elements[s],c);E(e,_,n)}}));else{const e=(t,e)=>{const{data:i}=t,s=function(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{if("willRelease"!==s.getGraphicItem().releaseStatus)if(t.isCollectionMark())s.getDatum().forEach((t=>{const n=Pm(i,t,s,c);m.push(e(n,_))}));else{const t=Pm(i,s.getDatum(),s,c);m.push(e(t,_))}}))}const f=E({},g,{baseMarkGroupName:null===(d=t.graphicItem)||void 0===d?void 0:d.name,getBaseMarks:()=>t.elements.map((t=>t.getGraphicItem()))},null!=u?u:{});return f.data=null!=m?m:g.data,f})).filter((t=>!D(t))),h=E({},o,{size:e});return h.dataLabels=l,h})(l,d,s,this.spec.labelStyle,i,c)}}),e}),{});this._encoders=e}}_$.componentType=tc.label;const f$=()=>{fc.registerGraphicComponent(tc.label,(t=>new m$(t))),fc.registerComponent(tc.label,_$)};class v$ extends aD{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=Dy.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,Im(e,t)||(i.reMake=!0),i}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}}v$.type=r.label;class y$ extends CF{constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}}y$.type="text",y$.constructorType="label";const b$=()=>{Ql.registerMark(y$.constructorType,y$),$A()};class x$ extends rD{_initTheme(t,e){return{spec:t,theme:this._theme}}}class S$ extends v${constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=x$,this.layoutZIndex=Dy.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initTextMarkStyle()}initEvent(){this.event.on(zd.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.disableAnimation()})),this.event.on(hc.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.enableAnimation()})),this.event.off(hc.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),wE(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n{if(e.visible){const n=this._labelInfoMap.get(s),o=this._createMark({type:"label",name:`${r}-label-${i}`},{noSeparateStyle:!0,attributeContext:t.getMarkAttributeContext()});o.setTarget(a),n.push({labelMark:o,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){this._labelInfoMap.forEach(((t,e)=>{if("region"===this._layoutRule){const i=this._createMark({type:"component",name:`${e.getGroupMark().name}-label-component`},{componentType:"label",noSeparateStyle:!0},{support3d:this._spec.support3d});i&&(i.setSkipBeforeLayouted(!0),t[0]&&M(t[0].labelSpec.zIndex)&&i.setMarkConfig({zIndex:t[0].labelSpec.zIndex}),this._marks.addMark(i),this._labelComponentMap.set(i,(()=>this._labelInfoMap.get(e))))}else t.forEach(((t,i)=>{const s=this._createMark({type:"component",name:`${t.labelMark.name}-component`},{componentType:"label",noSeparateStyle:!0},{support3d:t.baseMark.getMarkConfig().support3d});s&&(M(t.labelSpec.zIndex)&&s.setMarkConfig({zIndex:t.labelSpec.zIndex}),s.setSkipBeforeLayouted(!0),this._marks.addMark(s),this._labelComponentMap.set(s,(()=>this._labelInfoMap.get(e)[i])))}))}))}_initTextMarkStyle(){this._labelComponentMap.forEach(((t,e)=>{Na(t()).forEach((({labelMark:t})=>{t.setComponent(e)}))})),this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n,void 0),ws(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",Py.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();y(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e.getProduct(),t.map((({baseMark:t})=>t.getProduct())),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e.getProduct(),i.getProduct(),[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.target(e).configure({interactive:!1}).depend(s.map((t=>t.getMarks()[0].getProduct()))).labelStyle(((t,e)=>{var n,r;const a=i[e.labelIndex];if(a){const{labelSpec:t,labelMark:e,series:i}=a,o=e.getRule(),l=this._interactiveConfig(t),h=null!==(r=null===(n=this._spec)||void 0===n?void 0:n.centerOffset)&&void 0!==r?r:0;let d=Pl({textStyle:Object.assign({pickable:!0===t.interactive},t.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},function(t,e){var i;const{labelSpec:s}=e;s.overlap&&!As(s.overlap)&&(s.overlap={});const n=null!==(i=Uz[t])&&void 0!==i?i:Uz.point;return e.series.type===Sl.sankey?function(t){var e,i,s;const{series:n,labelSpec:r={}}=t,a=null!==(e=Xz(r.position))&&void 0!==e?e:"outside",o=n.direction;let l,h=a;return S(a)&&("vertical"===o?h="inside-start"===a?t=>"inside-left":"inside-middle"===a?t=>"center":"inside-end"===a?t=>"inside-right":t=>"bottom":"inside-start"===a?h=t=>"inside-left":"inside-middle"===a?h=t=>"center":"inside-end"===a?h=t=>"inside-right":"outside"===a&&(h=t=>"right")),l=!1!==r.overlap&&(!S(a)||!a.includes("inside"))&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:eN(n)},{position:h,overlap:l,smartInvert:!1,offset:0,syncState:!0}}(e):n(e)}(o,a),Object.assign(Object.assign(Object.assign({},oD(t,["position","style","state","type","stackDataFilterType","getStyleHandler"])),l),{centerOffset:h}),t.stackDataFilterType?{dataFilter:"min"===t.stackDataFilterType?t=>t.filter((t=>t.data[RT])):t=>t.filter((t=>t.data[PT]))}:{});return i&&i.parseLabelStyle&&(d=i.parseLabelStyle(d,t,e)),"line"!==o&&"area"!==o||(d.type=o),d}})).encode(((t,e,s)=>{if(i[s.labelIndex]){const{labelSpec:e,labelMark:n}=i[s.labelIndex];return n.skipEncode?{data:t}:$z(i[s.labelIndex],t,e.formatMethod,e.formatter)}})).size((()=>i[0].series.getRegion().getLayoutRect()))}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=y(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i,context:{model:this,labelInfo:e}})}))}getVRenderComponents(){const t=[];return this._labelComponentMap.forEach(((e,i)=>{const s=i.getProduct().getGroupGraphicItem();s&&t.push(s)})),t}}S$.type=r.label,S$.specKey="label",S$.transformerConstructor=x$;class M$ extends v${constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=Dy.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[DT]},"normal",Py.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){const t=this._getSeries(),e=this._createMark({type:"component",name:`${t.name}-total-label-component`},{componentType:"label",noSeparateStyle:!0},{support3d:this._spec.support3d});e&&this._marks.addMark(e)}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.getProduct().target(this._baseMark.getProduct()).configure({interactive:!1}).labelStyle((()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r}=this._spec,a=this._interactiveConfig(this._spec);return Pl({textStyle:{pickable:!0===this._spec.interactive},position:k$(t,this._baseMark.type),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>t.data[PT]))},a))}})).encode((e=>$z({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod))).size((()=>this._regions[0].getLayoutRect()))}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getProduct().getGroupGraphicItem();i&&t.push(i)})),t}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function k$(t,e){var i,s;let n;const{direction:r}=t,a={vertical:["top","bottom"],horizontal:["right","left"]},o=("horizontal"===r?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?1:0;switch(e){case"rect":case"symbol":n=a[r][o];break;default:n="top"}return n}M$.type=r.totalLabel,M$.specKey="totalLabel";const A$=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function w$(){T$._animate=hU}WG(),xD(),SD(),Uv(),qS(),dM();class T$ extends $G{markerAnimate(t){T$._animate&&this._animationConfig&&T$._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},T$.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=uU,this.defaultExitAnimation=pU,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return Gk(Math.abs(s),Math.PI/2,yU)||Gk(Math.abs(s),3*Math.PI/2,yU)?Uk(t,s,n):Wk(s)?TU.postiveXAxis[n]:TU.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:d=0,textStyle:c={},richTextStyle:u={},imageStyle:p={},position:g=vU.middle}=e,{state:m}=this.attribute,_=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(_)+h*Math.cos(_-Math.PI/2),v=l*Math.sin(_)+h*Math.sin(_-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},c),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,_,null!==(a=e.position)&&void 0!==a?a:"end")),c.textStyle),state:{panel:E({},Zk,null==m?void 0:m.textBackground),text:E({},Zk,null==m?void 0:m.text)}}))}else"richText"===n?(t.setAttributes({dx:this.getItemDx(t,g,u)+(u.dx||0),dy:this.getItemDy(t,g,u)+(u.dy||0)}),t.states=E({},Zk,null==m?void 0:m.richText)):"image"===n&&(t.setAttributes({dx:this.getItemDx(t,g,p)+(p.dx||0),dy:this.getItemDy(t,g,p)+(p.dy||0)}),t.states=E({},Zk,null==m?void 0:m.image));const y=Wk(_)?_:_-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(v||0),angle:o&&y+d})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(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,i){const{state:s}=this.attribute,{type:n="text",symbolStyle:r,richTextStyle:a,imageStyle:o,renderCustomCallback:l}=t;let h;return"symbol"===n?(h=ca.symbol(Object.assign(Object.assign({},i),r)),h.states=E({},Zk,null==s?void 0:s.symbol)):"text"===n?h=new PD(Object.assign(Object.assign({},i),{state:{panel:E({},Zk,null==s?void 0:s.textBackground),text:E({},Zk,null==s?void 0:s.text)}})):"richText"===n?(h=ca.richtext(Object.assign(Object.assign({},i),a)),h.states=E({},Zk,null==s?void 0:s.richText)):"image"===n?(h=ca.image(Object.assign(Object.assign({},i),o)),h.states=E({},Zk,null==s?void 0:s.image)):"custom"===n&&l&&(h=l(),h.states=E({},Zk,null==s?void 0:s.customMark)),h.name=`mark-point-${n}`,this.setItemAttributes(h,t,e,i,n),h}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,d=i.x-e.x,c=i.y-e.y;if(this._isStraightLine=Gk(d,0,yU)||Gk(c,0,yU),this._isArcLine){const{x:t,y:s}=e,{x:l,y:d}=i,c=(t+l)/2,u=c+h*(d>s?-1:1)*c,p=(s===d?0:-(t-l)/(s-d))*(u-c)+(s+d)/2;a=A$(s-p,t-u),o=A$(d-p,l-u),n={x:u,y:p},h>0?o{this._markerLayout()})),this._markerData=r}}C$.specKey="markPoint";class E$ extends C${constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._relativeSeries,n="x"in e&&"y"in e,r="coordinate"in e,a="position"in e,o=null!==(t=null==e?void 0:e.autoRange)&&void 0!==t&&t;let l;return n?l=LG(i,s,s,s,o)[0][0]:r?l=DG(i,s,o,e.coordinatesOffset)[0]:a&&(l=RG(e.position,s,e.regionRelative)[0]),{point:l}}_computeOptions(){const t=this._spec,{doXYProcess:e}=VG(t),i=M(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}E$.type=r.markPoint,E$.coordinateType="cartesian";class D$ extends C${constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=CG(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:Tt({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}D$.type=r.polarMarkPoint,D$.coordinateType="polar";class O$ extends C${constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:EG(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}O$.type=r.geoMarkPoint,O$.coordinateType="geo";const P$=1e-8;function R$(t,e,i,s,n){for(let r=0,a=n[n.length-1];re&&r>s||rn?o:0}function F$(t,e){return Math.abs(t-e)0&&R$(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}var j$;!function(t){t.drawStart="drawStart",t.drawEnd="drawEnd",t.drawing="drawing",t.moving="moving",t.moveStart="moveStart",t.moveEnd="moveEnd",t.brushClear="brushClear"}(j$||(j$={}));const H$={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},z$=5,N$={debounce:Kd,throttle:qd};p_(),yk();class V$ extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},V$.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||((this._activeDrawState||this._activeMoveState)&&t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:N$[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{var e;if(!this._activeDrawState&&!this._activeMoveState)return;t.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?((null===(e=this._operatingMask)||void 0===e?void 0:e._AABBBounds.empty())&&this._dispatchEvent(j$.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={}):(this._activeDrawState&&this._dispatchEvent(j$.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._activeMoveState&&this._dispatchEvent(j$.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{trigger:t=H$.trigger,updateTrigger:e=H$.updateTrigger,endTrigger:i=H$.endTrigger,resetTrigger:s=H$.resetTrigger}=this.attribute;this.stage.addEventListener(t,this._onBrushStart),this.stage.addEventListener(e,this._onBrushingWithDelay),this.stage.addEventListener(i,this._onBrushEnd),this.stage.addEventListener(s,this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t({x:t.x+n,y:t.y+r}))),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_initDraw(t){const{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,"single"===e&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(j$.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(i=this._operatingMask.attribute.dy)&&void 0!==i?i:0;const{interactiveRange:s}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:a=-1/0,maxX:o=1/0}=s,{x1:l,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,u=a-l,p=o-h,g=n-d,m=r-c;this._operatingMaskMoveRangeX=[u,p],this._operatingMaskMoveRangeY=[g,m],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(j$.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;const s=this.eventPosToStagePos(t),{sizeThreshold:n=z$,brushType:r}=this.attribute,a=this._cacheDrawPoints.length;if(a>0){const t=null!==(e=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==e?e:{};if(s.x===t.x&&s.y===t.y)return}"polygon"===r||a<=1?this._cacheDrawPoints.push(s):this._cacheDrawPoints[a-1]=s;const o=this._computeMaskPoints();this._operatingMask.setAttribute("points",o);const{x1:l=0,x2:h=0,y1:d=0,y2:c=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds;this._isDrawedBeforeEnd=!this._operatingMask._AABBBounds.empty()&&!!(Math.abs(h-l)>n||Math.abs(d-c)>n),this._isDrawedBeforeEnd&&(this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(j$.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}))}_moving(t){const e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(null==e?void 0:e.x)&&i.y===(null==e?void 0:e.y))return;const s=i.x-e.x,n=i.y-e.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],s))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(j$.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute;let s=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return s="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:i[0]},{x:r.x,y:i[0]},{x:r.x,y:i[1]},{x:n.x,y:i[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:k(this._cacheDrawPoints),s}_addBrushMask(){var t;const{brushStyle:e,hasMask:i}=this.attribute,s=ca.polygon(Object.assign(Object.assign({points:k(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!==(t=e.opacity)&&void 0!==t?t:1:0}));s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:n=-1/0,maxX:r=1/0}=e,a=this.eventPosToStagePos(t);return a.x>r||a.xs||a.y{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",Py.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",Py.Series))}))}))}static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>!1!==t.visible))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_extendDataInBrush(t){const e=[];for(const i in t)for(const s in t[i])e.push(Object.assign({},t[i][s].data[0]));return e}_extendDatumOutOfBrush(t){var e;const i=[];for(const s in t)i.push(null===(e=t[s].data)||void 0===e?void 0:e[0]);return i}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_updateBrushComponent(t,e){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild(),this._needInitOutState=!0}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new V$(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:GE(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r);const{brushMode:a="single"}=this._spec;this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(j$.drawStart,(e=>{this._emitEvent(zd.brushStart,t)})),r.addEventListener(j$.moveStart,(e=>{this._emitEvent(zd.brushStart,t)})),r.addEventListener(j$.drawing,(i=>{this._needInitOutState&&"single"===a&&this._initMarkBrushState(e,"outOfBrush"),this._needInitOutState=!1,this._needDisablePickable=!0,this._handleBrushChange(zd.brushChange,t,i),this._emitEvent(zd.brushChange,t)})),r.addEventListener(j$.moving,(e=>{this._handleBrushChange(zd.brushChange,t,e),this._emitEvent(zd.brushChange,t)})),r.addEventListener(j$.brushClear,(i=>{this._initMarkBrushState(e,""),this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(zd.brushChange,t,i),this._handleBrushChange(zd.brushClear,t,i),this._emitEvent(zd.brushChange,t),this._emitEvent(zd.brushClear,t)})),r.addEventListener(j$.drawEnd,(e=>{this._needInitOutState=!0,this._needDisablePickable=!1;const{operateMask:i}=e.detail;this._handleBrushChange(zd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(zd.brushEnd,t)})),r.addEventListener(j$.moveEnd,(e=>{const{operateMask:i}=e.detail;this._handleBrushChange(zd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(zd.brushEnd,t)}))}_handleBrushChange(t,e,i){const{operateMask:s}=i.detail;this._reconfigItem(s,e),this._reconfigLinkedItem(s,e)}_emitEvent(t,e){this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord}})}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},GE(t)),e)}_reconfigItem(t,e){this._itemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,n,r;const a=i.getGraphicItem(),o=e.id+"_"+i.key;(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[o])&&this._isBrushContainItem(t,a)?(i.addState("inBrush"),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][o]=i,delete this._outOfBrushElementsMap[o]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[o])&&!this._isBrushContainItem(t,a)&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._outOfBrushElementsMap[o]=i,delete this._inBrushElementsMap[t.name][o]),a.setAttribute("pickable",!this._needDisablePickable)}))}))}_reconfigLinkedItem(t,e){const i=e.getLayoutStartPoint(),s=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{if(!s.includes(e.id)){const s=e.getRegion().getLayoutStartPoint(),n=s.x-i.x,r=s.y-i.y;this._linkedItemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,a,o;const l=i.getGraphicItem(),h=e.id+"_"+i.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[h])&&this._isBrushContainItem(t,l,{dx:n,dy:r})?(i.addState("inBrush"),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][h]=i,delete this._linkedOutOfBrushElementsMap[h]):(null===(o=null===(a=this._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[h])&&!this._isBrushContainItem(t,l,{dx:n,dy:r})&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._linkedOutOfBrushElementsMap[h]=i),l.setAttribute("pickable",!this._needDisablePickable)}))}))}}))}_isBrushContainItem(t,e,i){var s,n,r;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points))return!1;const a=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],{a:o,b:l,c:h,d,e:c,f:u}=t.globalTransMatrix,p=(null==i?void 0:i.dx)||0,g=(null==i?void 0:i.dy)||0,m=a.map((t=>({x:o*t.x+h*t.y+c+p,y:l*t.x+d*t.y+u+g})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+p,t.globalAABBBounds.y1+g,t.globalAABBBounds.x2+p,t.globalAABBBounds.y2+g);const _=e.globalTransMatrix.e,f=e.globalTransMatrix.f;let v=[];if("symbol"===e.type){const{size:t=0}=null==e?void 0:e.attribute,i=Na(t)[0]/2;return v=[{x:_-i,y:f-i},{x:_+i,y:f-i},{x:_+i,y:f+i},{x:_-i,y:f+i}],Y$(m,v)}if("rect"===e.type){const{x1:t,x2:i,y1:s,y2:n}=null==e?void 0:e.AABBBounds,r=Math.abs(t-i),a=Math.abs(s-n);return v=[{x:_,y:f},{x:_+r,y:f},{x:_+r,y:f+a},{x:_,y:f+a}],Y$(m,v)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:d}=s,c=r?"x":"y",u=r?o:h,p=r?l:d;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[c]),r=s.getScale().invert(p-e.getLayoutStartPoint()[c]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),d=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,d),Math.max(h,d),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:d})}else{const i=t.getScale().range(),s=null!==(n=t.getScale().rangeFactor())&&void 0!==n?n:[0,1],r=Va(i){this._releatedAxes.push(this._option.getComponentByUserId(t))})):M(this._spec.axisIndex)?Na(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Na(t).includes(n.userId.toString())||e&&Na(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._option.getAllSeries().forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{const i=t.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{const s=t.id+"_"+i.key;i.removeState("inBrush"),i.removeState("outOfBrush"),i.addState(e),this._outOfBrushElementsMap[s]=i,this._linkedOutOfBrushElementsMap[s]=i}))}))}))}initEvent(){}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return this._brushComponents}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(t){var e;super.onLayoutEnd(t),this._option.disableTriggerEvent||(null===(e=this._spec.visible)||void 0===e||e)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach((e=>{e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}W$.type=r.brush,W$.specKey="brush";class G$ extends aD{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=Dy.CustomMark,this.layoutLevel=Oy.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;const t=this._option&&this._option.getAllSeries(),e=!1!==this._option.animation,i=[];t&&t.length&&t.forEach((t=>{const e=t&&t.getMarksWithoutRoot();e&&e.length&&e.forEach((t=>{i.push(t)}))})),this._createExtensionMark(this._spec,null,`${hh}_series_${this.id}_extensionMark`,0,{depend:i,hasAnimation:e})}_createExtensionMark(t,e,i,s=0,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation&&t.animation){const e=zC({},NC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(n.depend&&n.depend.length&&a.setDepend(...n.depend),D(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}))),M(t.dataId)||il(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}onRender(t){}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Kt).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Kt;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.getBounds())})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}}let U$,$$,X$,K$;function q$(t){return U$=1/0,$$=1/0,X$=-1/0,K$=-1/0,t.forEach((t=>{U$>t.x&&(U$=t.x),X$t.y&&($$=t.y),K$({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function J$(t,e,i,s={}){const n=At(t[0]),r=At(t[1]),a=At(i),o=function(t,e){void 0===e&&(e="kilometers");var i=rp[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,s.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:wt(n+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:wt(l)}}function Q$(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 tX(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function eX(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:tX(t.rect),anchorCandidates:aX(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>Q$(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;tQ$(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function iX(t){return t>180?t-360:t}function sX(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function nX(t,e){for(let i=0;i{const{x:r,y:a}=rX(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}G$.type=r.customMark,G$.specKey="customMark";class oX extends aD{constructor(){super(...arguments),this.type=r.mapLabel,this.name=r.mapLabel,this.specKey="mapLabel",this.layoutType="none",this.layoutZIndex=Dy.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return qT(t,this.specKey,this.type,(t=>t.visible&&M(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;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===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,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===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.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 e=t.getViewData();if(e){const t=new R(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:zp.copyDataView},!1),this._data=new gx(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){var t;this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handleZoom(t),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const e=this._spec.trigger;if("none"===e)return;const i=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();i&&("hover"===e?(i.addEventListener("element-highlight:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("element-highlight:reset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(null)}))):"click"===e&&(i.addEventListener("element-select:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("elementSelectReset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(t){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?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 s=new T$({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{t.removeAllChild();const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;let g=0,m=0,_=0,f=0,v=0;const y=this._spec.position||"top",b=this._spec.offset,x=hl(null===(i=this._spec.background)||void 0===i?void 0:i.padding),S=this._spec.space||0;m+=((null==x?void 0:x.left)||0)+((null==x?void 0:x.right)||0),_+=((null==x?void 0:x.top)||0)+((null==x?void 0:x.bottom)||0);const k={},A=this.dataToPosition(t),w=or({});if(w.name=`${this.name}_marker_itemContainer_${e}`,k.container=w,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=qv(GE(Object.assign({},this._spec.background.style)));t.setAttributes(A),k.labelBackground=t,w.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=Ev(GE(Object.assign({},this._spec.icon.style)));t.setAttributes(A),t.setAttribute("symbolType",null===(r=this._spec.icon.style)||void 0===r?void 0:r.shape);const e=t.AABBBounds,i=null!==(a=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==a?a:0,s=null!==(o=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==o?o:0;k.icon=t,w.appendChild(t),v=i,f+=s,g++}if(null===(l=this._spec.nameLabel)||void 0===l?void 0:l.visible){const e=f_(GE(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(h=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==h?h:0,n=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;k.nameLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}if((null===(c=this._spec.valueLabel)||void 0===c?void 0:c.visible)&&M(t[this.valueField])){const e=f_(GE(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(u=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==u?u:0,n=null!==(p=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==p?p:0;k.valueLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}const T=Object.values(k).find((t=>!!t&&"group"!==t.type)),L={x:null==T?void 0:T.getComputedAttribute("x"),y:null==T?void 0:T.getComputedAttribute("y")},C={x:L.x,y:L.y,width:0,height:0};C.width=m+f+(g-1)*S,C.height=_+v;const E={rect:C,point:L,index:e};if("outer"!==y){const t=["top","right","left","bottom"].filter((t=>t!==y));E.rect=rX(C,y,b),E.anchors=t,E.offset=b}else E.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:E,contentMarks:k}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:g}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=p)}})),null==h||h.setAttributes({x:0,y:0,width:c.width,height:c.height}),null==d||d.setAttributes({dx:-c.width/2,dy:-c.height/2});const _=this._data.getLatestData()[r],f=this.dataToPosition(_),v=this.getRegions()[0].getLayoutStartPoint(),y=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:v.x,y:v.y,position:f,visible:this._activeDatum.includes(_),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:c.x+c.width/2-f.x,offsetY:c.y+c.height/2-f.y},itemLine:{visible:y,type:"type-po",lineStyle:GE(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;tt.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=q$(s),l=i([(n+r)/2,(a+o)/2]);return l?eX(t.map((t=>{const s=t.rect,n=nX(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=J$(r,s,i);if(!nX(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],iX(sX(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=iX(sX(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=rX(t.rect,a,0),t}))):[]}(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):eX(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){return(null==t?void 0:t.id)===this._series.id}onRender(t){}changeRegions(){}_getNeedClearVRenderComponents(){return this._markerComponents}}oX.type=r.mapLabel,oX.specKey="mapLabel";class lX{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(il(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:ws(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;te.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>hX(t))),a=n.filter((t=>!hX(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>hX(t))),h=o.filter((t=>!hX(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);il(h.width)||(h.width=l.width),il(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function hX(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}lX.type="grid";class dX extends tb{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},r=e.filter((t=>"absolute"===t.layoutType)),a=r.filter((t=>"z"===t.layoutOrient));let o={width:0,height:0};a.length&&(o=a[0].getLayoutRect()),this.leftCurrent+=o.width/8,this.rightCurrent-=o.width/8,this.topCurrent+=o.height/8,this.bottomCurrent-=o.height/8;const{regionItems:l,relativeItems:h,relativeOverlapItems:d,allRelatives:c,overlapItems:u}=this._groupItems(e);this.layoutRegionItems(l,h,d,u),this._processAutoIndent(l,h,d,u,c,n);const p=r.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(p);const g=h.filter((t=>"axes"===t.model.specKey&&Ad(t.layoutOrient)))[0],m=h.filter((t=>"axes"===t.model.specKey&&wd(t.layoutOrient)))[0];if(g&&a.length){const t=g.getLayoutStartPoint(),e=g.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};a[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=g.getLayoutRect(),n=m.getLayoutRect(),r={length:a[0].getLayoutRect().width,width:s.width,height:n.height};g.model.setLayout3dBox&&g.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),a[0].model.setLayout3dBox&&a[0].model.setLayout3dBox(r),this.layoutZAxisItems(a,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{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,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}dX.type="layout3d";const cX=new qt;p_(),cf(),Uv(),fy();class uX extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},uX.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,s,n,r,a,o;const{titleStyle:l={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:p=0,maxWidth:g=1/0,padding:m=4,maxWidthPercent:_,visible:f,state:b,dx:x=0,dy:S=0}=this.attribute;let{title:k="",content:A=""}=this.attribute;k=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(k):k,A=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(A):A;const w=bD(m),T=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),L=g-w[1]-w[3],C=M(k)&&!1!==f,E=Object.assign(Object.assign({text:y(k)?k:[k],visible:C,wrap:!0},l),{x:w[3],y:w[0],maxLineWidth:L,textAlign:"left",textBaseline:"top"}),D=T.createOrUpdateChild("poptip-title",E,"text");jm(null==b?void 0:b.title)||(D.states=b.title);const O=D.AABBBounds,P=O.height(),R=O.width();let B=P+u;C||(B=0);const I=M(A)&&!1!==f,F=Object.assign(Object.assign({text:y(A)?A:[A],visible:I,wrap:!0},d),{x:w[3],y:w[0]+B,maxLineWidth:L,textAlign:"left",textBaseline:"top"}),Y=T.createOrUpdateChild("poptip-content",F,"text");jm(null==b?void 0:b.content)||(Y.states=b.content);const j=Y.AABBBounds,H=j.height(),z=j.width();I&&(B+=H);let N=ut(R+w[1]+w[3],z+w[1]+w[3]);N>g?N=g:NJ&&(J=n,Z=t)}}}}getAngleAndOffset(t,e,i,s){const n=s[1]/2;switch(t){case"tl":return{angle:rt/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-s[1]]};case"top":return{angle:rt/2*3,offset:[e/2,i+n],rectOffset:[0,-i-s[1]]};case"tr":return{angle:rt/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-s[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-s[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-s[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-s[1]]};case"bl":return{angle:rt/2,offset:[e/4,-n],rectOffset:[-e/4,-i-s[1]]};case"bottom":return{angle:rt/2,offset:[e/2,-n],rectOffset:[0,-i-s[1]]};case"br":return{angle:rt/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-s[1]]};case"lt":return{angle:rt,offset:[e+n,i/5],rectOffset:[-e/4,-i-s[1]]};case"left":return{angle:rt,offset:[e+n,i/2],rectOffset:[0,-i-s[1]]};case"lb":return{angle:rt,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-s[1]]}}}}uX.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};let pX=class{render(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const s={};E(s,uX.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(s):this.poptipComponent=new uX(s);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};E(e,c_.poptip,n),n=e,n.content=null!==(p=n.content)&&void 0!==p?p:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const a=h.stage.getLayer("_builtin_interactive");a&&a.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null===(g=this.poptipComponent.parent)||void 0===g||g.removeChild(this.poptipComponent),this.poptipComponent=null))}};pX=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}([V()],pX);var gX=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};class mX{constructor(){this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let _X=class extends mX{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};_X=gX([V()],_X);let fX=class extends mX{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);const{stage:e}=this.pluginService;e.addEventListener("pointerleave",this.pointerlave)}needHide(t){return"text"!==t.type||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip}needShow(t){return!0}deactivate(t){const{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};fX=gX([V()],fX);const vX=new I(((t,e,i,s)=>{i(pX)||(t(pX).toSelf().inSingletonScope(),t(fo).toService(pX)),i(_X)||(t(_X).toSelf(),t(pa).toService(_X)),i(fX)||(t(fX).toSelf(),t(pa).toService(fX))})),yX=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:e.height/t.offsetHeight):1,bX=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>eObject.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},y_||(y_=ca.CreateGraphic("richtext",{})),y_.setAttributes(a),y_.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}},xX="vchart-tooltip-container",SX={offsetX:10,offsetY:10,sanitize:function(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/\(/g,"(").replace(/ /g,"  ")}},MX=(t,e)=>{let i;if(M(t))if(h(t))i=t;else if(ws(t)){const s=t(e);h(s)&&(i=s)}return i},kX={left:[-2,0],right:[2,0],top:[0,-2],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-2],bottom:[0,2],bl:[-2,2],lb:[-2,2],br:[2,2],rb:[2,2],inside:[0,0],center:[0,0],centerBottom:[0,1],centerTop:[0,-1],centerLeft:[-1,0],centerRight:[1,0]},AX=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=kX[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i},wX={fontFamily:jh.fontFamily,spacing:10,wordBreak:"break-word"};function TX(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:wX),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const LX=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return M(a)&&(r.cornerRadius=[a,a,a,a]),r};class CX extends HE{constructor(){super(...arguments),this._visible=!0,this._attributes=null,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this.changeTooltip=(t,e,i)=>this._isReleased?1:t?this.changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this.changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:d}=t;if(!h)return 1;const c=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,c,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,d));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[c])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let m=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(m=!1),this._updateTooltip(m,Object.assign(Object.assign({},t),{changePositionOnly:d})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,d,c,u;const{tooltipSpec:p}=e,g={x:1/0,y:1/0};if(!p)return g;const m=e.event,{activeType:_,data:f}=t,v="dimension"===_?null===(n=null===(s=f[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==f?void 0:f[0],{offsetX:y,offsetY:b}=this._option,x=p[_],S=JT(null==x?void 0:x.position,f,e),k=null!==(r=JT(null==x?void 0:x.positionMode,f,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:A=0,height:w=0}=null!=i?i:{},T="canvas"===p.renderMode,L=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),C=null!==(o=null==L?void 0:L.width)&&void 0!==o?o:dh,E=null!==(l=null==L?void 0:L.height)&&void 0!==l?l:ch;let D=!1;const O={width:0,height:0};let P={x:0,y:0},R={x:0,y:0},B=1,I=1;if(_l(this._env)&&!p.confine){if(O.width=window.innerWidth,O.height=window.innerHeight,!T){const t=this._getParentElement(p);R=null!==(c=null===(d=null==t?void 0:t.getBoundingClientRect)||void 0===d?void 0:d.call(t))&&void 0!==c?c:g;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer,i=null==e?void 0:e.getBoundingClientRect();P={x:i.x-R.x,y:i.y-R.y},B=yX(e,i),I=yX(t,R)}}else O.width=C,O.height=E;const F=I/B,Y={},j={x:S,y:S},H={x:["left","right"],y:["top","bottom"]},z=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),d=null!=s?s:"x"===n?y:b;if("mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if("crosshair"===i&&"cartesian"===(null===(r=null==v?void 0:v.series)||void 0===r?void 0:r.coordinate)&&v.datum&&v.datum.length){D=!0;const t=((t,e)=>{var i;const s=new Map,n=new Map,{series:r,datum:a}=t,o="horizontal"===r.direction,l=(o?r.getYAxisHelper():r.getXAxisHelper()).getAxisId(),h=r.getChart().getComponentsByKey("axes").find((t=>t.id===l));if(!h)return;(o?n:s).set(h.getSpecIndex(),{value:null===(i=r.getDatumPositionValues(a[0],r.getDimensionField()))||void 0===i?void 0:i[0],axis:h});const d={visible:!!s.size,type:"rect"},c={visible:!!n.size,type:"rect"},{x:u,y:p,offsetWidth:g,offsetHeight:m,bandWidth:_,bandHeight:f}=GW(3,r,e,s,n,d,c);return u?XW(d,u,_,g):p?KW(c,p,f,m):void 0})(v,h);t&&(a=t.start[n],o=t.end[n])}else j[n]=t;if(D){const e=H[n][0],i="x"===n?A:w;switch(AX(t,n)){case-2:Y[e]=a-i*F-d;break;case 0:Y[e]=(a+o)/2-i*F/2;break;case-1:Y[e]=(a+o)/2-i*F-d;break;case 1:Y[e]=(a+o)/2+d;break;case 2:Y[e]=o+d}}},N=["x","y"];if(As(S))if(As(V=S)&&(M(V.left)||M(V.right)||M(V.top)||M(V.bottom))){const{left:t,right:e,top:i,bottom:s}=S;Y.left=MX(t,m),Y.top=MX(i,m),Y.right=MX(e,m),Y.bottom=MX(s,m)}else(t=>As(t)&&(M(t.x)||M(t.y)))(S)&&N.forEach((t=>{const e=S[t];h(e)||ws(e)?Y[H[t][0]]=MX(e,m):z(e,t)}));else M(S)&&(z({orient:S,mode:k},"x"),z({orient:S,mode:k},"y"));var V;const W={x:null,y:null},G=_l(this._env);return N.forEach((t=>{const e="x"===t?A:w,i="x"===t?C:E,s="x"===t?y:b,n=AX(j[t],t);if(il(Y[H[t][0]]))W[t]=Y[H[t][0]];else if(il(Y[H[t][1]]))W[t]=i-e*F-Y[H[t][1]];else{const i="x"===t?m.canvasX:m.canvasY;W[t]=n>0?i+s:i-e*F/2+(n<0?-1:0)*s}W[t]*=B,G&&(W[t]+=P[t]),W[t]/=I;const r="x"===t?O.width:O.height,a=-R[t]/I,o=(r-R[t])/I-e;2!==n&&W[t]o&&(W[t]=o)):-2!==n&&W[t]>o&&(D?W[t]=o:(W[t]-=0===n?s+e/2:2*s+e,W[t]{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:d}=e,{panel:c={},titleLabel:u,shape:p,keyLabel:g,valueLabel:m,spaceRow:_,maxContentHeight:f,align:v}=l,y=bD(c.padding),b=hl(c.padding),x=TX(Object.assign({textAlign:"right"===v?"right":"left"},u),i),S=TX(Object.assign({textAlign:"right"===v?"right":"left"},g),i),k=TX(m,i),A={fill:!0,size:null!==(s=null==p?void 0:p.size)&&void 0!==s?s:8,spacing:null!==(n=null==p?void 0:p.spacing)&&void 0!==n?n:6},w={panel:LX(c),padding:y,title:{},content:[],titleStyle:{value:x,spaceRow:_},contentStyle:{shape:A,key:S,value:k,spaceRow:_},hasContentShape:!1,keyWidth:0,valueWidth:0,maxContentHeight:f,enterable:h,transitionDuration:d,align:v},{title:T={},content:L=[]}=t;let C=b.left+b.right,E=b.top+b.bottom,D=b.top+b.bottom,O=0;const P=!!L.length;let R=0,B=0,I=0,F=0;if(P){const t=[],e=[],i=[],s=[];let n=0;w.content=L.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:d="",shapeFill:c,shapeStroke:u,shapeLineWidth:p,shapeSize:g,value:m,isKeyAdaptive:f,spaceRow:v,keyStyle:y,valueStyle:b,shapeHollow:x}=r,w={height:0,spaceRow:null!=v?v:_};if(M(h)){const i=Pl({},S,TX(y,void 0,{})),{width:s,height:n,text:r}=bX(h,i);w.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),f?e.push(s):t.push(s),o=Math.max(o,n)}if(M(m)){const t=Pl({},k,TX(b,void 0,{})),{width:e,height:s,text:n}=bX(m,t);w.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:d};x?t.stroke=c:t.fill=c,t.stroke=null!=u?u:c,t.lineWidth=p,w.shape=t;const e=null!=g?g:A.size;o=Math.max(e,o),s.push(e)}else w.shape={visible:!1};return w.height=o,n+=o,aG.autoWidth&&!1!==G.multiLine;if(z){G=Pl({},x,TX(V,void 0,{})),U()&&(G.multiLine=null===(r=G.multiLine)||void 0===r||r,G.maxWidth=null!==(a=G.maxWidth)&&void 0!==a?a:P?Math.ceil(O):void 0);const{text:t,width:e,height:i}=bX(N,G);w.title.value=Object.assign(Object.assign({width:U()?Math.min(e,null!==(o=G.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},G),{text:t}),Y=w.title.value.width,j=w.title.value.height,H=j+(P?w.title.spaceRow:0)}return E+=H,D+=H,w.title.width=Y,w.title.height=j,U()?C+=O||Y:C+=Math.max(Y,O),P&&w.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=C-b.left-b.right-F-R-S.spacing-k.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=C,w.panel.height=E,w.panelDomHeight=D,w})(t,this._component.getSpec(),e)}const{panel:r,panelDomHeight:a}=null!==(n=this._attributes)&&void 0!==n?n:{},o="canvas"===this._component.getSpec().renderMode;return{width:(null==r?void 0:r.width)+(o?r.lineWidth:0),height:(null!=a?a:null==r?void 0:r.height)+(o?r.lineWidth:0)}}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}CX.specKey="tooltip";const EX=(t,e)=>M(t)?y(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",DX=t=>{const e=t.split(" ").map((t=>Number.isNaN(t)?Number.parseFloat(t.substring(0,t.length-2)):Number.parseFloat(t)));return 1===e.length?e[0]:e};let OX;const PX=(t=document.body)=>{if(D(OX)){const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",t.appendChild(e);const i=document.createElement("div");e.appendChild(i),OX=e.offsetWidth-i.offsetWidth,e.parentNode.removeChild(e)}return OX};function RX(t,e){if(!t)return;const{fontFamily:i,fontSize:s,fill:n,textAlign:r,lineHeight:a,fontWeight:o,multiLine:l,wordBreak:h,maxWidth:d}=Pl({},e,t),c={};return c.fontFamily=i,c.fontSize=EX(s),c.color=n,c.textAlign=r,c.lineHeight=EX(xn(a,s)),c.fontWeight=o,c.whiteSpace=l?"initial":"nowrap",c.wordBreak=l?null!=h?h:"break-word":"normal",c.maxWidth=EX(d),c}class BX{static isInstance(t){return!!t&&t.type===BX.type}setOption(t){this._option=t,Object.values(this.children).forEach((e=>e.setOption(t)))}getParentEl(){return BX.isInstance(this.parent)?this.parent.product:this.parent}constructor(t,e,i){this.type=BX.type,this._renderContentCache=null,this.children={},this.parent=t,this._option=e,this.childIndex=null!=i?i:0}init(t,e){}initAll(){this.init(),Object.values(this.children).forEach((t=>t.initAll()))}setStyle(t){this.product&&t&&Object.keys(t).forEach((e=>{this.product.style[e]!==t[e]&&(this.product.style[e]=t[e])}))}setContent(t){}setVisibility(t){if(!this.product)return;const{style:e}=this.product;e.visibility=t?"visible":"hidden",Object.values(this.children).forEach((e=>e.setVisibility(t)))}getVisibility(){var t,e;return!!(null===(e=null===(t=this.product)||void 0===t?void 0:t.style)||void 0===e?void 0:e.visibility)&&"hidden"!==this.product.style.visibility}release(){var t;if(Object.values(this.children).forEach((t=>t.release())),this.children={},this.product){try{null===(t=this.getParentEl())||void 0===t||t.removeChild(this.product)}catch(t){}this.product=null}}createElement(t,e,i,s){const n=null==ml?void 0:ml.createElement(t),r=this.getParentEl();if(!n||!r)return;e&&n.classList.add(...e),i&&Object.keys(i).forEach((t=>{n.style[t]=i[t]})),s&&(n.id=s);let a=this.childIndex;if(BX.isInstance(this.parent)){let t=Number.MAX_VALUE;for(let e=0;et.product===r.children[e]));i.childIndex>this.childIndex&&i.childIndex=r.children.length?r.appendChild(n):r.insertBefore(n,r.children[a]),n}}BX.type="tooltipModel";const IX={fontSize:"13px",marginBottom:"0px",fontWeight:"normal"},FX={boxSizing:"border-box"},YX={display:"inline-block",verticalAlign:"top"},jX={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},HX={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},zX={paddingTop:"0px",paddingBottom:"0px",textAlign:"right",fontWeight:"normal"},NX={lineHeight:"normal",boxSizing:"border-box"};class VX extends BX{init(t,e,i){if(!this.product){const s=this.createElement(null!=i?i:"div",[...null!=t?t:[],"shape"],void 0,e);this.product=s}}setStyle(t,e){super.setStyle(t),this.setSvg(e)}setContent(t){this.setSvg(t)}setSvg(t){const e=function(t,e){var i,s,n,r,a,o;if(!(null==t?void 0:t.hasShape)||!t.symbolType)return"";const{symbolType:l,fill:h,stroke:d,hollow:c=!1}=t,u=t.size?e(t.size):"8px",p=t.lineWidth?e(t.lineWidth)+"px":"0px";let g="currentColor";const m=()=>d?e(d):g,_=DX(u),f=t=>new Cv({symbolType:t,size:_,fill:!0});let v=f(l);const y=v.getParsedPath();y.path||(v=f(y.pathStr));const b=v.getParsedPath().path,x=b.toString(),M=b.bounds;let k=`${M.x1} ${M.y1} ${M.width()} ${M.height()}`;if("0px"!==p){const[t,e,i,s]=k.split(" ").map((t=>Number(t))),n=Number(p.slice(0,-2));k=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!h||S(h)||c)return g=c?"none":h?e(h):"currentColor",`\n \n \n \n `;if(As(h)){g=null!==(i="gradientColor"+t.index)&&void 0!==i?i:"";let l="";const d=(null!==(s=h.stops)&&void 0!==s?s:[]).map((t=>``)).join("");return"radial"===h.gradient?l=`\n ${d}\n `:"linear"===h.gradient&&(l=`\n ${d}\n `),`\n \n ${l}\n \n \n `}return""}(t,this._option.valueToHtml);this.product&&e!==this._svgHtmlCache&&(this._svgHtmlCache=e,this.product.innerHTML=e)}release(){super.release(),this._svgHtmlCache=""}}class WX extends BX{init(t,e,i){this.product||(this.product=this.createElement(null!=i?i:"span",t,void 0,e))}setContent(t,e){if(!this.product)return;let i=this._option.valueToHtml(t);e&&(i=i.replaceAll("\n","
")),i!==this.product.innerHTML&&(this.product.innerHTML=i)}}const GX={overflowWrap:"normal",wordWrap:"normal"};class UX extends BX{constructor(t,e,i,s){super(t,e,s),this.className=i}init(){var t,e;this.product||(this.product=this.createElement("div",[this.className]));const i=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];if("shape-box"!==this.className||i.some((t=>t.hasShape&&t.shapeType))){Object.keys(this.children).forEach((t=>{const e=gd(t);e>=i.length&&(this.children[e].release(),delete this.children[e])}));for(let t=0;t{const e=gd(t);this.children[e].release(),delete this.children[e]}))}setStyle(){var t,e,i,s;const n=this._option.getTooltipStyle();super.setStyle(Pl({},YX,n.content,this._getContentColumnStyle()));const r=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],a=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[],o=(t,e,i)=>{var s,r;const{key:a,isKeyAdaptive:o}=t,{height:l}=e,{keyColumn:d}=n,c=Pl({},o?HX:jX,Object.assign(Object.assign(Object.assign({height:EX(l)},GX),d.common),null===(s=d.items)||void 0===s?void 0:s[i]));return S(a)&&""!==(null===(r=null==a?void 0:a.trim)||void 0===r?void 0:r.call(a))||h(a)||c.visibility?c.visibility="visible":c.visibility="hidden",c};a.forEach(((t,e)=>{var i;const s=r[e];"key-box"===this.className?this.children[e].setStyle(o(s,t,e)):"value-box"===this.className?this.children[e].setStyle(((t,e,i)=>{var s;const{height:r}=e,{valueColumn:a}=n;return Pl({},zX,Object.assign(Object.assign(Object.assign({height:EX(r)},GX),a.common),null===(s=a.items)||void 0===s?void 0:s[i]))})(0,t,e)):"shape-box"===this.className&&(null===(i=this.children[e])||void 0===i||i.setStyle(((t,e,i)=>{var s,r,a,l;const{height:h}=e,{shapeColumn:d}=n,c=o(t,e,i),u=`calc((${null!==(r=null!==(s=c.lineHeight)&&void 0!==s?s:c.fontSize)&&void 0!==r?r:"18px"} - ${null!==(a=d.width)&&void 0!==a?a:"8px"}) / 2)`;return Pl({},NX,Object.assign(Object.assign({height:EX(h),paddingTop:u},d.common),null===(l=d.items)||void 0===l?void 0:l[i]))})(s,t,e),this._getShapeSvgOption(s,e)))}))}setContent(){var t,e,i,s;const n=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];(null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[]).forEach(((t,e)=>{var i,s,r,a,o,l,d;let c;const u=n[e];if("key-box"===this.className){const n=u.key;c=S(n)&&""!==(null===(i=null==n?void 0:n.trim)||void 0===i?void 0:i.call(n))||h(n)?n:"",null===(s=this.children[e])||void 0===s||s.setContent(c,null===(r=t.key)||void 0===r?void 0:r.multiLine)}else if("value-box"===this.className){const i=u.value;c=S(i)&&""!==(null===(a=null==i?void 0:i.trim)||void 0===a?void 0:a.call(i))||h(i)?i:"",null===(o=this.children[e])||void 0===o||o.setContent(c,null===(l=t.value)||void 0===l?void 0:l.multiLine)}else"shape-box"===this.className&&(c=this._getShapeSvgOption(u,e),null===(d=this.children[e])||void 0===d||d.setContent(c))}))}_getContentColumnStyle(){var t,e;const i=this._option.getTooltipStyle();switch(this.className){case"shape-box":const s=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];return Object.assign(Object.assign({},i.shapeColumn),"shape-box"!==this.className||s.some((t=>t.hasShape&&t.shapeType))?{}:{display:"none"});case"key-box":return i.keyColumn;case"value-box":return i.valueColumn}}_getShapeSvgOption(t,e){var i;const s=this._option.getTooltipStyle(),n=Object.assign(Object.assign({},s.shapeColumn),null===(i=s.shapeColumn.items)||void 0===i?void 0:i[e]);return{hasShape:t.hasShape,symbolType:t.shapeType,size:n.width,fill:t.shapeFill,stroke:t.shapeStroke,lineWidth:t.shapeLineWidth,hollow:t.shapeHollow,index:e}}}class $X extends BX{init(){this.product||(this.product=this.createElement("div",["container-box"]));const{align:t}=this._option.getTooltipAttributes();"right"===t?(this.valueBox||(this.valueBox=this._initBox("value-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.shapeBox||(this.shapeBox=this._initBox("shape-box",2))):(this.shapeBox||(this.shapeBox=this._initBox("shape-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.valueBox||(this.valueBox=this._initBox("value-box",2)))}_initBox(t,e){const i=new UX(this.product,this._option,t,e);return i.init(),this.children[i.childIndex]=i,i}setStyle(t){super.setStyle(Pl(this._getContentContainerStyle(),t)),Object.values(this.children).forEach((t=>{t.setStyle()}))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}_getContentContainerStyle(){const t={whiteSpace:"nowrap",lineHeight:"0px"},{panelDomHeight:e,panel:i,maxContentHeight:s}=this._option.getTooltipAttributes();if(M(s)&&et+DX(e)),0);return Object.assign(Object.assign({},t),{width:`${a+PX(this._option.getContainer())}px`,maxHeight:EX(s),overflow:"auto"})}return t}release(){super.release(),this.shapeBox=null,this.keyBox=null,this.valueBox=null}}class XX extends BX{init(){const t=this._option.getTooltipActual();this.product||(this.product=this.createElement("h2"));const{align:e}=this._option.getTooltipAttributes();"right"!==e||this.textSpan||this._initTextSpan(0);const{title:i}=t;(null==i?void 0:i.hasShape)&&(null==i?void 0:i.shapeType)?this.shape||this._initShape("right"===e?1:0):this.shape&&this._releaseShape(),"right"===e||this.textSpan||this._initTextSpan(1)}_initShape(t=0){const e=new VX(this.product,this._option,t);e.init(),this.shape=e,this.children[e.childIndex]=e}_releaseShape(){this.shape&&(this.shape.release(),delete this.children[this.shape.childIndex],this.shape=null)}_initTextSpan(t=1){const e=new WX(this.product,this._option,t);e.init(),this.textSpan=e,this.children[e.childIndex]=e}setStyle(t){var e,i,s,n;const r=this._option.getTooltipStyle(),a=this._option.getTooltipActual(),{title:o}=a;super.setStyle(Pl({},IX,r.title,t)),null===(e=this.shape)||void 0===e||e.setStyle({paddingRight:null===(i=r.shapeColumn.common)||void 0===i?void 0:i.marginRight},{hasShape:null==o?void 0:o.hasShape,symbolType:null==o?void 0:o.shapeType,size:null===(s=r.shapeColumn.common)||void 0===s?void 0:s.width,fill:null==o?void 0:o.shapeFill,hollow:null==o?void 0:o.shapeHollow}),null===(n=this.textSpan)||void 0===n||n.setStyle({color:"inherit"})}setContent(){var t,e,i,s,n,r;const a=this._option.getTooltipStyle(),o=this._option.getTooltipActual(),l=this._option.getTooltipAttributes(),{title:h}=o;this.init(),null===(t=this.shape)||void 0===t||t.setStyle(void 0,{hasShape:null==h?void 0:h.hasShape,symbolType:null==h?void 0:h.shapeType,size:null===(e=a.shapeColumn.common)||void 0===e?void 0:e.width,fill:null==h?void 0:h.shapeFill,hollow:null==h?void 0:h.shapeHollow}),null===(i=this.textSpan)||void 0===i||i.setStyle({color:"inherit"}),null===(s=this.textSpan)||void 0===s||s.setContent(null==h?void 0:h.value,null===(r=null===(n=l.title)||void 0===n?void 0:n.value)||void 0===r?void 0:r.multiLine)}release(){super.release(),this.shape=null,this.textSpan=null}}const KX="99999999999999";class qX extends BX{constructor(t,e,i){super(t.getContainer(),t,0),this.title=null,this.content=null,this._classList=e,this._id=i}setVisibility(t){if(super.setVisibility(t),!this.product)return;const{classList:e}=this.product;t?e.add("visible"):e.remove("visible")}init(){var t;const e=this._option.getTooltipActual();this.product||this._initPanel(this._classList,this._id);const{title:i}=e;!1!==(null==i?void 0:i.visible)&&M(null==i?void 0:i.value)?this.title||this._initTitle():this.title&&this._releaseTitle(),(null!==(t=e.content)&&void 0!==t?t:[]).length>0?this.content||this._initContent():this.content&&this._releaseContent()}_initPanel(t,e){const i=this.createElement("div",t,{left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:KX,fontFamily:"sans-serif",fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh"},e);this.product=i}_initTitle(){const t=new XX(this.product,this._option,0);t.init(),this.title=t,this.children[t.childIndex]=t}_releaseTitle(){this.title&&(this.title.release(),delete this.children[this.title.childIndex],this.title=null)}_initContent(){const t=new $X(this.product,this._option,1);t.init(),this.content=t,this.children[t.childIndex]=t}_releaseContent(){this.content&&(this.content.release(),delete this.children[this.content.childIndex],this.content=null)}setStyle(){const t=this._option.getTooltipStyle();super.setStyle(Pl({},FX,t.panel)),Object.values(this.children).forEach((t=>t.setStyle()))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}release(){super.release(),this.title=null,this.content=null}}const ZX=t=>{Ql.registerComponentPlugin(t.type,t)};class JX extends CX{getVisibility(){var t;return!!(null===(t=this.model)||void 0===t?void 0:t.getVisibility())}setVisibility(t){var e;t!==this.getVisibility()&&(null===(e=this.model)||void 0===e||e.setVisibility(t))}constructor(){super(JX.type),this.type=TW.dom,this._tooltipContainer=null==ml?void 0:ml.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec(),e=t.parentElement;if(ml&&e&&e.children&&e.children.length){for(let t=0;tthis._domStyle,getTooltipActual:()=>this._tooltipActual,getTooltipAttributes:()=>this._attributes,getContainer:()=>this._container},[t.className],this.name)}}_removeTooltip(){var t;null===(t=this.model)||void 0===t||t.release(),this._container=null}_updateTooltip(t,e){var i,s;if(t&&this.model){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r,this._initStyle(),this.model.initAll(),this.model.setStyle(),this.model.setContent()),this.setVisibility(t);const a=this.model.product;if(a){const{x:t=0,y:o=0}=null!==(i=r.position)&&void 0!==i?i:{};if(n.updateElement){this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:t,y:o}),n.updateElement(a,r,e);const i=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight});this._updatePosition(i),this._cacheCustomTooltipPosition=i}else this._updatePosition({x:t,y:o})}}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){this._domStyle=function(t){var e,i,s;const{panel:n={},title:r,content:a,titleStyle:o={},contentStyle:l={},padding:h,keyWidth:d,valueWidth:c,enterable:u,transitionDuration:p,panelDomHeight:g=0,align:m="left"}=null!=t?t:{},{fill:_,shadow:f,shadowBlur:v,shadowColor:y,shadowOffsetX:b,shadowOffsetY:x,shadowSpread:S,cornerRadius:M,stroke:k,lineWidth:A=0,width:w=0}=n,{value:T={}}=o,{shape:L={},key:C={},value:E={}}=l,D=function(t){if(!t)return;const{size:e}=Pl({},void 0,t),i={};return i.width=EX(e),i}(L),O=RX(C),P=RX(E),{bottom:R,left:B,right:I,top:F}=hl(h),Y="right"===m?"marginLeft":"marginRight";return{align:m,panel:{width:EX(w+2*A),minHeight:EX(g+2*A),paddingBottom:EX(R),paddingLeft:EX(B),paddingRight:EX(I),paddingTop:EX(F),borderColor:k,borderWidth:EX(A),borderRadius:EX(M),backgroundColor:_?`${_}`:"transparent",boxShadow:f?`${b}px ${x}px ${v}px ${S}px ${y}`:"initial",pointerEvents:u?"auto":"none",transitionDuration:p?`${p}ms`:"initial",transitionProperty:p?"transform":"initial",transitionTimingFunction:p?"ease-out":"initial"},title:Object.assign({marginTop:"0px",marginBottom:(null==a?void 0:a.length)?EX(null==r?void 0:r.spaceRow):"0px"},RX(Pl({},T,null==r?void 0:r.value))),content:{},shapeColumn:{common:D,items:null==a?void 0:a.map((({spaceRow:t},e)=>({marginTop:"0px",marginBottom:eObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:iObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:i{const i=[t.shape,...e.map((t=>null==t?void 0:t.shape))],s=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return E(t,...e,{shape:i.every(D)?void 0:E({},...i),key:s.every(D)?void 0:E({},...s),value:n.every(D)?void 0:E({},...n)})},tK=t=>{const{width:e,height:i,wordBreak:s="break-word",textAlign:n,textBaseline:r,text:a}=t;return Array.isArray(a)?{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:Na(a).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:null==a?void 0:a.text}},eK={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Kk,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Kk,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Kk,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new qt).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},iK=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];p_(),fy(),Uv(),cf(),ik();class sK extends Bk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},sK.defaultAttributes,t),e),this.name="tooltip"}render(){var t;const{visible:e,content:i,panel:s,keyWidth:n,valueWidth:r,hasContentShape:a,autoCalculatePosition:o,autoMeasure:l,align:h}=this.attribute;if(!e)return void this.hideAll();l&&sK.measureTooltip(this.attribute),o&&sK.calculateTooltipPosition(this.attribute);const d=bD(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:d[3],y:d[0]},"group");const c=sK.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",E({symbolType:"circle"},c.shape,{visible:Vk(c)&&Vk(c.shape)}),"symbol"),"object"!=typeof c.value.text||null===c.value.text||"rich"!==c.value.text.type&&"html"!==c.value.text.type?c.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Vk(c)&&Vk(c.value)},tK(c.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!==(t=c.value.text)&&void 0!==t?t:"",visible:Vk(c)&&Vk(c.value)},c.value),"text"):"rich"===c.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Vk(c)&&Vk(c.value)},tK(c.value)),"richtext"):"html"===c.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:c.value.text.text},Jk),c.value),visible:Vk(c)&&Vk(c.value),width:c.value.width,height:c.value.height,wordBreak:c.value.wordBreak,textAlign:c.value.textAlign,textBaseline:c.value.textBaseline,singleLine:!1,textConfig:[]},c.value),"richtext"));const u=Vk(c.shape)?c.shape.size+c.shape.spacing:0,{textAlign:p,textBaseline:g}=c.value,m=s.width-d[3]-d[0]-u;"center"===p?this._tooltipTitle.setAttribute("x",u+m/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",u+m):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",c.height):"middle"===g?this._tooltipTitle.setAttribute("y",c.height/2):this._tooltipTitle.setAttribute("y",0);const _=Vk(c)?c.height+c.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+_);let t=0;i.forEach(((e,i)=>{const s=sK.getContentAttr(this.attribute,i);if(!Vk(s))return;const o=`tooltip-content-${i}`,l=this._tooltipContent.createOrUpdateChild(o,{visible:!0,x:0,y:t},"group"),d=s.shape.size+s.shape.spacing;let c="right"===h?(a?d:0)+(Vk(s.key)?n+s.key.spacing:0)+(Vk(s.value)?r:0):0;this._createShape("right"===h?c-s.shape.size/2:c+s.shape.size/2,s,l,o),a&&("right"===h?c-=d:c+=d);const u=this._createKey(s,l,o);u&&(nA(h,u,s.key.textAlign,c,n),u.setAttribute("y",0),"right"===h?c-=n+s.key.spacing:c+=n+s.key.spacing);const p=this._createValue(s,l,o);if(p){let t="right";M(s.value.textAlign)?t=s.value.textAlign:Vk(s.key)||"right"===h||(t="left"),p.setAttribute("textAlign",t),nA(h,p,t,c,r),p.setAttribute("y",0)}t+=s.height+s.spaceRow}))}}_createShape(t,e,i,s){var n;if(Vk(e.shape))return i.createOrUpdateChild(`${s}-shape`,Object.assign({visible:!0,x:t,y:e.shape.size/2+((null!==(n=xn(e.key.lineHeight,e.key.fontSize))&&void 0!==n?n:e.key.fontSize)-e.shape.size)/2},e.shape),"symbol")}_createKey(t,e,i){var s;if(Vk(t.key)){let n;return n=t.key.multiLine?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0},tK(t.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.key.text||null===t.key.text||"rich"!==t.key.text.type&&"html"!==t.key.text.type?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.key.text)&&void 0!==s?s:""},t.key),{textBaseline:"top"}),"text"):"rich"===t.key.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.key)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign(Object.assign({dom:t.key.text.text},Jk),t.key)},"richtext"),n}}_createValue(t,e,i){var s;if(Vk(t.value)){let n;return n=t.value.multiLine?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.value.text||null===t.value.text||"rich"!==t.value.text.type&&"html"!==t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.value.text)&&void 0!==s?s:""},t.value),{textBaseline:"top"}),"text"):"rich"===t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},tK(t.value)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign({dom:t.value.text.text,container:"",width:30,height:30,style:{}},t.value)},"richtext"),n}}setAttributes(t,e){const i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every((t=>iK.includes(t)))?(this._mergeAttributes(t,i),D(this.attribute.panel.width)&&this.attribute.autoMeasure&&sK.measureTooltip(this.attribute),sK.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:n,pointerX:r,pointerY:a,positionX:o,positionY:l,parentBounds:h}=t;let d=r,c=a;return"left"===o?d-=e+s:"center"===o?d-=e/2:d+=s,"top"===l?c-=i+n:"middle"===l?c-=i/2:c+=n,d+e>h.x2&&(d-=e+s),c+i>h.y2&&(c-=i+n),d{const n=sK.getContentAttr(t,i);(e.key||e.value)&&Vk(n)&&s.push([e,n])})),s.length){let n=!1;const o=[],l=[],h=[];s.forEach((([t,e],r)=>{var d;const{key:c,value:u,shape:p,spaceRow:g}=e,m=Vk(p),_=null!==(d=null==p?void 0:p.symbolType)&&void 0!==d?d:"",f=Qk(c),v=Qk(u);let y=0;if(Vk(c)){const{width:t,height:e}=f.quickMeasure(c.text);l.push(t),y=Math.max(y,e)}if(Vk(u)){const{width:t,height:e}=v.quickMeasure(u.text);h.push(t),y=Math.max(y,e)}m&&pv[_]&&(n=!0,o.push(p.size),y=Math.max(p.size,y)),t.height=y,a+=y,r{t.width=r})),t.hasContentShape=n,t.keyWidth=c,t.valueWidth=u}}return t.panel.width=r+s[1]+s[3],t.panel.height=a,t}static getTitleAttr(t){return QX({},sK.defaultAttributes.titleStyle,sK.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return QX({},sK.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}sK.defaultAttributes=eK;class nK extends CX{constructor(){super(nK.type),this.type=TW.canvas}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new sK({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}function rK(t,e){const i=e?t.toExponential(e-1):t.toExponential(),s=i.indexOf("e");if(s<0)return null;const n=i.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+i.slice(s+1)]}let aK;function oK(t,e){const i=rK(t,e);if(!i)return t+"";const s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}nK.type=TW.canvas;class lK{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const hK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dK(t){let e;if(e=hK.exec(t))return new lK({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});g.getInstance().error("invalid format: "+t)}const cK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class uK{constructor(){var t,e,i;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(e=[...this.locale.grouping].map(Number),i=`${this.locale.thousands}`,function(t,s){let n=t.length;const r=[];let a=0,o=e[0],l=0;for(;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:(t=[...this.locale.numerals].map(String),function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return uK.instance||(uK.instance=new uK),uK.instance}newFormat(t){const e=dK(t);let i=e.fill,s=e.align;const n=e.sign,r=e.symbol;let a=e.zero;const o=e.width;let l=e.comma,h=e.precision,d=e.trim,c=e.type;"n"===c?(l=!0,c="g"):pK[c]||(void 0===h&&(h=12),d=!0,c="g"),(a||"0"===i&&"="===s)&&(a=!0,i="0",s="=");const u="$"===r?this.currencyPrefix:"#"===r&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",p="$"===r?this.currencySuffix:/[%p]/.test(c)?this.percent:"",g=pK[c],m=/[defgprstz%]/.test(c);h=void 0===h?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h));const{nan:_,minus:f,decimal:v,group:y,numerals:b}=this;function x(t){let e,r,x,S=u,M=p,k=t;if("c"===c)M=g(k)+M,k="";else{k=+k;let t=k<0||1/k<0;if(k=isNaN(k)?_:g(Math.abs(k),h),d&&(k=function(t){const e=t.length;let i,s=-1;t:for(let n=1;n0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(k)),t&&0==+k&&"+"!==n&&(t=!1),S=(t?"("===n?n:f:"-"===n||"("===n?"":n)+S,M=("s"===c?cK[8+aK/3]:"")+M+(t&&"("===n?")":""),m)for(e=-1,r=k.length;++ex||x>57){M=(46===x?v+k.slice(e+1):k.slice(e))+M,k=k.slice(0,e);break}}l&&!a&&(k=y(k,1/0));let A=S.length+k.length+M.length,w=A>1)+S+k+M+w.slice(A);break;default:k=w+S+k+M}return b(k)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const i=dK(t);i.type="f";const s=this.newFormat(i.toString()),n=3*Math.max(-8,Math.min(8,Math.floor(function(t){const e=rK(Math.abs(t));return e?e[1]:NaN}(e)/3))),r=Math.pow(10,-n),a=cK[8+n/3];return function(t){return s(r*t)+a}}}const pK={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>oK(100*t,e),r:oK,s:function(t,e){const i=rK(t,e);if(!i)return t+"";const s=i[0],n=i[1],r=n-(aK=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+rK(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)},gK=/\{([^}]+)\}/,mK=/\{([^}]+)\}/g,_K=/:/;class fK extends HE{constructor(){super(fK.type),this.type="formatterPlugin",this._timeModeFormat={utc:$T.getInstance().timeUTCFormat,local:$T.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=uK.getInstance().format,this._numericSpecifier=uK.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[fK.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;ws(r)?this._formatter=r:(this._formatter=this._format.bind(this),ws(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),Ql.registerFormatter(this._formatter)}_format(t,e,i){return y(t)?t.map(((t,s)=>{const n=y(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):y(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=gK.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(mK,((t,i)=>{if(!_K.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(hK.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}fK.pluginType="chart",fK.specKey="formatter",fK.type="formatterPlugin";class vK extends yx{constructor(){super(...arguments),this.type=vK.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}vK.type="image";class yK{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Si.graphicService.hooks.onRemove.unTap(this.key),Si.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let s;return s=e?"string"==typeof e?Si.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Si.global.createDom(Object.assign({tagName:"div",parent:s},i)),nativeContainer:s}}parseDefaultStyleFromGraphic(t){return function(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[aa(i)]=t[i])})),["fontSize","lineHeight"].forEach((s=>{const n=aa(s);D(t[s])||(e[n]=i(t[s]))})),M(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&S(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:bs(t).text)}getTransformOfText(t){const e=bs(t).text,{textAlign:i=e.textAlign,textBaseline:s=e.textBaseline}=t.attribute,n=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:r,scaleX:a,scaleY:o}=n,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[s]}) rotate(${r}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[i]} ${h[s]}`}}updateStyleOfWrapContainer(t,e,i,s,n){const{pointerEvents:r}=n;let a=this.parseDefaultStyleFromGraphic(t);a.display=!1!==t.attribute.visible?"block":"none",a.pointerEvents=!0===r?"all":r||"none",i.style.position||(i.style.position="absolute",s.style.position="relative");let o=0,l=0;const h=t.globalAABBBounds;let d=n.anchorType;if(D(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||h.empty()){const e=t.globalTransMatrix;o=e.e,l=e.f}else{const t=zA(h,d);o=t.x,l=t.y}const c=Si.global.getElementTopLeft(s,!1),u=e.window.getTopLeft(!1),p=e.viewBox,g=o+u.left-c.left+p.x1,m=l+u.top-c.top+p.y1;if(a.left=`${g}px`,a.top=`${m}px`,"text"===t.type&&"position"===d&&(a=Object.assign(Object.assign({},a),this.getTransformOfText(t))),ws(n.style)){const e=n.style({top:m,left:g,width:h.width(),height:h.height()},t,i);e&&(a=Object.assign(Object.assign({},a),e))}else As(n.style)?a=Object.assign(Object.assign({},a),n.style):S(n.style)&&n.style&&(a=Object.assign(Object.assign({},a),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const i=t.split(":");if(2===i.length){const t=i[0].trim(),s=i[1].trim();t&&s&&(e[t]=s)}}})),e})(n.style)));Si.global.updateDom(i,{width:n.width,height:n.width,style:a})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===Si.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:oi.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:oi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&Si.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const{dom:n,container:r}=i;if(!n)return;const a=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&r&&r!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof n?this.htmlMap[a].wrapContainer.innerHTML=n:n!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,s,o,l,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===Si.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class bK extends yK{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=B.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:s}=this.htmlMap[t];e?Si.global.getRequestAnimationFrame()((()=>{e.unmount()})):s&&s(),i&&Si.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const n=s.params.ReactDOM,{element:r,container:a}=i;if(!r||!n||!n.createRoot&&!n.render)return;const o=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])n.createRoot?this.htmlMap[o].root.render(r):n.render(r,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,a);if(t)if(this.htmlMap||(this.htmlMap={}),n.createRoot){const i=n.createRoot(t);i.render(r),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else n.render(r,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{n.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,s,l,h,i),this.htmlMap[o].renderId=this.renderId}}yT.useRegisters([()=>{ME(),kE(),oE(),dE(),BC(),OC(),qO(),dP(),Ql.registerSeries(cP.type,cP),Ql.registerChart(MP.type,MP)},()=>{ME(),kE(),oE(),AP(),dE(),Ql.registerAnimation("area",RC),BC(),OC(),qO(),dP(),Ql.registerSeries(CP.type,CP),Ql.registerChart(DP.type,DP)},()=>{UP(),Ql.registerChart(XP.type,XP)},()=>{dE(),Ql.registerAnimation("scatter",((t,e)=>Object.assign({appear:lR(0,e)},EC))),qO(),dP(),Ql.registerSeries(cR.type,cR),Ql.registerChart(pR.type,pR)},()=>{MI(),Ql.registerAnimation("pie",((t,e)=>({appear:bI(t,e),enter:fI(t),exit:vI(t),disappear:yI(t)}))),Ql.registerAnimation("emptyCircle",((t,e)=>({appear:bI(t,e)}))),Ql.registerSeries(EI.type,EI),Ql.registerChart(RI.type,RI)},()=>{Ql.registerSeries(nF.type,nF),MI(),Ql.registerAnimation("rose",((t,e)=>({appear:UI(t,e),enter:VI(t),exit:WI(t),disappear:GI(t)}))),eF(),sF(),Ql.registerChart(oF.type,oF)},()=>{Ql.registerSeries(mF.type,mF),kE(),AP(),oE(),dE(),Ql.registerAnimation("radar",((t,e)=>({appear:"clipIn"===e?void 0:cF(t,e,"in"),enter:cF(t,e,"in"),exit:cF(t,e,"out"),disappear:"clipIn"===e?void 0:cF(t,e,"out"),update:[{options:{excludeChannels:["points","defined","center"]}},{channel:["points","center"],custom:hF,customParameters:t,duration:CC.update.duration,easing:CC.update.easing}]}))),Ql.registerAnimation("radarSymbol",((t,e)=>({appear:"clipIn"===e?void 0:uF(t,e,"in"),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:"clipIn"===e?void 0:uF(t,e,"out"),update:[{options:{excludeChannels:["x","y","center"]}},{channel:["x","y","center"],custom:lF,customParameters:t,duration:CC.update.duration,easing:CC.update.easing}]}))),Ql.registerAnimation("radarGroup",((t,e)=>({appear:pF(t,"in"),disappear:pF(t,"out")}))),Gx(),eF(),sF(),Ql.registerChart(fF.type,fF)},()=>{UP(),Ql.registerChart(YF.type,YF)},()=>{fc.registerGrammar("projection",zB,"projections"),nI(),XB(),Ql.registerSeries(aI.type,aI),Ql.registerImplement("registerMap",Rp),Ql.registerImplement("unregisterMap",Bp),PC(),Ql.registerChart(lI.type,lI)},()=>{sY(),Ql.registerSeries(rY.type,rY),MI(),GF(),sF(),Ql.registerChart(oY.type,oY)},()=>{vj(),Ql.registerChart(bj.type,bj)},()=>{_j(),ZY(),EF(),bY(),Ql.registerSeries(fj.type,fj),vj(),Ql.registerChart(bj.type,bj)},()=>{Hj(),EF(),SF(),Ql.registerSeries(Wj.type,Wj),Ql.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},DC))),Ql.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:xA,customParameters:(e,i)=>({animationType:"in",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:xA,customParameters:(e,i)=>({animationType:"out",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),PC(),Ql.registerChart(Uj.type,Uj)},()=>{SF(),jP(),Ql.registerAnimation("waterfall",((t,e)=>({appear:Hz(t,e),enter:PP(t,!1),exit:RP(t,!1),disappear:RP(t,!1)}))),PC(),qO(),dP(),Ql.registerSeries(iN.type,iN),Ql.registerChart(nN.type,nN)},()=>{Ql.registerMark(kN.type,kN),fc.registerGlyph("boxplot",{shaft:"rule",box:"rect",max:"rule",min:"rule",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","boxWidth","boxHeight","ruleWidth","ruleHeight"]).registerFunctionEncoder(fN).registerChannelEncoder("x",((t,e,i,s,n,r)=>r&&hN(r.direction)?null:{shaft:{x:e,x1:e}})).registerChannelEncoder("y",((t,e,i,s,n,r)=>r&&hN(r.direction)?{shaft:{y:e,y1:e}}:null)).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&hN(r.direction)?{box:{x:e}}:{box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&hN(r.direction)?{box:{x1:e}}:{box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&hN(r.direction)?{shaft:{x:e},min:{x:e,x1:e,visible:!0}}:{shaft:{y:e},min:{y:e,y1:e,visible:!0}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&hN(r.direction)?{shaft:{x1:e},max:{x:e,x1:e,visible:!0}}:{shaft:{y1:e},max:{y:e,y1:e,visible:!0}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&hN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=r&&hN(r.direction)?[(i.min+i.max)/2,i.y]:[i.x,(i.min+i.max)/2],l=null!==(a=i.anchor)&&void 0!==a?a:o;return{shaft:{angle:e,anchor:l},box:{angle:e,anchor:l},max:{angle:e,anchor:l},min:{angle:e,anchor:l},median:{angle:e,anchor:l}}})).registerDefaultEncoder((()=>({max:{visible:!1},min:{visible:!1},median:{visible:!1}}))),fc.registerAnimationType("boxplotScaleIn",vN),fc.registerAnimationType("boxplotScaleOut",yN),pN(),XA(),WA(),GA(),fc.registerGlyph("barBoxplot",{minMaxBox:"rect",q1q3Box:"rect",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","minMaxWidth","q1q3Width","minMaxHeight","q1q3Height"]).registerFunctionEncoder(xN).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&hN(r.direction)?{q1q3Box:{x:e}}:{q1q3Box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&hN(r.direction)?{q1q3Box:{x1:e}}:{q1q3Box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&hN(r.direction)?{minMaxBox:{x:e}}:{minMaxBox:{y:e}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&hN(r.direction)?{minMaxBox:{x1:e}}:{minMaxBox:{y1:e}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&hN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=null!==(a=i.anchor)&&void 0!==a?a:[i.x,(i.min+i.max)/2];return{minMaxBox:{angle:e,anchor:o},q1q3Box:{angle:e,anchor:o},median:{angle:e,anchor:o}}})).registerChannelEncoder("lineWidth",((t,e,i,s,n,r)=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}}))).registerChannelEncoder("minMaxFillOpacity",((t,e,i,s,n,r)=>({minMaxBox:{fillOpacity:e}}))).registerChannelEncoder("stroke",((t,e,i,s,n,r)=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}}))).registerDefaultEncoder((()=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0},median:{visible:!1}}))),fc.registerAnimationType("barBoxplotScaleIn",SN),fc.registerAnimationType("barBoxplotScaleOut",MN),pN(),XA(),WA(),GA(),dE(),OC(),qO(),dP(),Ql.registerSeries(wN.type,wN),Ql.registerChart(LN.type,LN)},()=>{Ql.registerSeries($F.type,$F),MI(),GF(),PC(),eF(),sF(),Ql.registerChart(qF.type,qF)},()=>{jP(),Ql.registerAnimation("linearProgress",((t,e)=>({appear:eH(t,e),enter:{type:"grow"},disappear:Qj(t)}))),PC(),Ql.registerSeries(nH.type,nH),Ql.registerChart(aH.type,aH)},()=>{jP(),EF(),Ql.registerAnimation("rangeColumn",((t,e)=>({appear:uH(t,e),enter:hH(t),exit:cH(t),disappear:cH(t)}))),PC(),qO(),dP(),Ql.registerSeries(_H.type,_H),Ql.registerChart(vH.type,vH)},()=>{AP(),qO(),dP(),Ql.registerSeries(oV.type,oV),Ql.registerChart(hV.type,hV)},()=>{Ql.registerSeries(XH.type,XH),MI(),EF(),PC(),Ql.registerAnimation("sunburst",((t,e)=>({appear:LH(0,e),enter:AH(t),exit:TH(t),disappear:TH(t)}))),Ql.registerChart(qH.type,qH)},()=>{Ql.registerSeries(vz.type,vz),MI(),EF(),OC(),Ql.registerAnimation("circlePacking",((t,e)=>({appear:_z(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),Ql.registerChart(bz.type,bz)},()=>{fc.registerTransform("filter",{transform:cE,markPhase:"beforeJoin"},!0),fc.registerTransform("map",{transform:uE,markPhase:"beforeJoin"},!0),jP(),EF(),Ql.registerAnimation("treemap",((t,e)=>({appear:Lz(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),PC(),fc.registerTransform("treemap",{transform:kz,markPhase:"beforeJoin"},!0),Ql.registerSeries(Ez.type,Ez),Ql.registerChart(Oz.type,Oz)},()=>{iV(),Ql.registerChart(nV.type,nV)},()=>{vV(),Ql.registerChart(bV.type,bV)},()=>{dE(),SF(),jP(),EF(),Ql.registerSeries(OF.type,OF),SF(),dE(),qO(),dP(),Ql.registerSeries(AF.type,AF),qO(),dP(),Ql.registerChart(RF.type,RF)},()=>{dE(),DV(),Ql.registerSeries(RV.type,RV),Ql.registerAnimation("correlation",((t,e)=>Object.assign({appear:OV(0,e)},EC))),Ql.registerChart(IV.type,IV)},()=>{Ql.registerChart(yF.type,yF)},()=>{eR(),JP(),Ql.registerChart(iR.type,iR)},()=>{eR(),Ql.registerAnimation("pie3d",((t,e)=>({appear:bI(t,e),enter:fI(t),exit:vI(t),disappear:yI(t)}))),II(),Ql.registerSeries(YI.type,YI),Ql.registerChart(HI.type,HI)},()=>{eR(),JP(),Ql.registerChart(jF.type,jF)},()=>{eR(),Xj(),EF(),SF(),Ql.registerSeries(qj.type,qj),Ql.registerChart(Zj.type,Zj)},()=>{eR(),qP(),qO(),dP(),Ql.registerSeries(yH.type,yH),Ql.registerChart(xH.type,xH)},()=>{eR(),Sj(),Ql.registerChart(kj.type,kj)},()=>{eR(),_j(),ZY(),EF(),xY(),Ql.registerSeries(xj.type,xj),eR(),Sj(),Ql.registerChart(kj.type,kj)},dP,qO,()=>{RO(),NO(),mD(),Ql.registerComponent(FV.type,FV)},()=>{RO(),NO(),mD(),Ql.registerComponent(NV.type,NV)},()=>{RO(),NO(),mD(),Ql.registerComponent(WV.type,WV)},eF,sF,()=>{Ql.registerComponent(lW.type,lW)},()=>{Ql.registerComponent(xW.type,xW)},()=>{Ql.registerComponent(FW.type,FW)},()=>{Ql.registerComponent(ZW.type,ZW)},()=>{Ql.registerComponent(iG.type,iG)},()=>{Ql.registerComponent(gG.type,gG)},()=>{Ql.registerComponent(mG.type,mG)},()=>{Ql.registerComponent(yG.type,yG)},nI,()=>{Ql.registerComponent(FU.type,FU),LU()},()=>{Ql.registerComponent(UU.type,UU),VU()},()=>{Ql.registerComponent(E$.type,E$),w$()},()=>{Ql.registerComponent(HU.type,HU),jU._animate=aU,LU()},()=>{Ql.registerComponent(XU.type,XU),$U._animate=lU,VU()},()=>{Ql.registerComponent(D$.type,D$),w$()},()=>{Ql.registerComponent(O$.type,O$),w$()},()=>{Ql.registerComponent(NU.type,NU)},()=>{Ql.registerComponent(g$.type,g$)},()=>{f$(),b$(),hD(),Ql.registerComponent(S$.type,S$,!0)},()=>{f$(),b$(),hD(),Ql.registerComponent(M$.type,M$,!0)},()=>{Ql.registerComponent(W$.type,W$)},()=>{Ql.registerComponent(G$.type,G$)},()=>{Ql.registerComponent(oX.type,oX)},()=>{Xi.load(vX)},()=>{Ql.registerLayout(lX.type,lX)},()=>{Ql.registerLayout(dX.type,dX)},()=>{qA(),oE(),dE(),SF(),EF(),AP(),jP(),XB(),MI(),Hj(),Ql.registerMark(vK.type,vK),Mx(),qS(),fc.registerGraphic(Qd.image,BS),DV(),hD(),II(),qP(),Xj()},()=>{ZX(JX)},()=>{ZX(nK)},()=>{var t;t=fK,Ql.registerChartPlugin(t.type,t)},()=>{fc.registerInteraction(eT.type,eT)},()=>{fc.registerInteraction(gT.type,gT)},()=>{fc.registerInteraction(mT.type,mT)},()=>{fc.registerInteraction(_T.type,_T)},()=>{fc.registerInteraction(oT.type,oT)},()=>{fc.registerInteraction(aT.type,aT)},()=>{tw(r_,iw),tw(Gm,mw),r_.useRegisters([kC,AC,nC,rC,SC,MC,wC,TC,LC])},()=>{Cg.registerPlugin("ReactAttributePlugin",bK)},()=>{Cg.registerPlugin("HtmlAttributePlugin",yK)}]);const xK=yT,SK=t=>Na(t).join(",");class MK extends sL{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>SK(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>SK(null==t?void 0:t[this.series.getDimensionField()[0]])}}const kK=Object.assign(Object.assign({},_L),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),AK=1e-10;function wK(t,e){const i=function(t){const e=[];for(let i=0;ie[i].radius+AK)return!1;return!0}(e,t)}));let n=0,r=0;const a=[];if(s.length>1){const e=EK(s);for(let t=0;t-1){const s=t[o.parentIndex[e]],n=Math.atan2(o.x-s.x,o.y-s.y),r=Math.atan2(i.x-s.x,i.y-s.y);let a=r-n;a<0&&(a+=2*Math.PI);const d=r-a/2;let c=xe.distancePP(l,{x:s.x+s.radius*Math.sin(d),y:s.y+s.radius*Math.cos(d)});c>2*s.radius&&(c=2*s.radius),(null===h||h.width>c)&&(h={circle:s,width:c,p1:o,p2:i})}null!==h&&(a.push(h),n+=TK(h.circle.radius,h.width),i=o)}}else{let e=t[0];for(let i=1;iMath.abs(e.radius-t[s].radius)){i=!0;break}i?n=r=0:(n=e.radius*e.radius*Math.PI,a.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-AK,y:e.y+e.radius},width:2*e.radius}))}return r/=2,e&&(e.area=n+r,e.arcArea=n,e.polygonArea=r,e.arcs=a,e.innerPoints=s,e.intersectionPoints=i),n+r}function TK(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function LK(t,e,i){if(i>=t+e)return 0;if(i<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(i*i-t*t+e*e)/(2*i);return TK(t,t-(i*i-e*e+t*t)/(2*i))+TK(e,s)}function CK(t,e){const i=xe.distancePP(t,e),s=t.radius,n=e.radius;if(i>=s+n||i<=Math.abs(s-n))return[];const r=(s*s-n*n+i*i)/(2*i),a=Math.sqrt(s*s-r*r),o=t.x+r*(e.x-t.x)/i,l=t.y+r*(e.y-t.y)/i,h=-(e.y-t.y)*(a/i),d=-(e.x-t.x)*(a/i);return[{x:o+h,y:l-d},{x:o-h,y:l+d}]}function EK(t){const e={x:0,y:0};for(let i=0;i{const e={},i=Object.values(t);if(!i.length)return[];wK(i,e);const s=e.arcs.map((({p1:t,p2:e,circle:i,width:s})=>({p1:t,p2:e,radius:i.radius,setId:i.setId,largeArcFlag:s>i.radius}))),n=[];let r=0,a=s[0];for(;rxe.distancePP(e.p1,t){if(!(null==t?void 0:t.length))return"";let e=0,i=t[0];const{p1:s}=i;let n=`M${s.x},${s.y}`;for(;i;){const{p2:s,radius:r,largeArcFlag:a}=i;n+=`A${r},${r} 0 ${a?1:0},0 ${s.x},${s.y}`,i=t[++e]}return n+=" Z",n},PK=t=>{var e;return null!==(e=null==t?void 0:t.map((t=>{const{p1:e,p2:i,radius:s,largeArcFlag:n,setId:r}=t,{x:a,y:o}=e,{x:l,y:h}=i,d=((l-a)**2+(h-o)**2)**.5,c=(a+l)/2,u=(o+h)/2,p=(s**2-(d/2)**2)**.5;let g=c+p*(h-o)/d,m=u-p*(l-a)/d;return(yt([l-a,h-o],[g-a,m-o])>0||n)&&(g=c-p*(h-o)/d,m=u+p*(l-a)/d),{x:g,y:m,radius:s,setId:r}})))&&void 0!==e?e:[]};class RK extends Rs{onBind(){this.fromCircles={},PK(this.from.arcs).forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},PK(this.to.arcs).forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=DK(s);i.arcs=n,i.path=OK(n)}}const BK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},IK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class FK extends KC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}function YK(t,e){let i=0;for(let s=0;s0)return g.getInstance().error("Initial bisect points must have opposite signs"),NaN;if(0===r)return e;if(0===a)return i;for(let i=0;i=0&&(e=i),Math.abs(o)o+r*n*l||h>=p)u=n;else{if(Math.abs(c)<=-a*l)return n;c*(u-d)>=0&&(u=d),d=n,p=h}return 0}n=n||1,r=r||1e-6,a=a||.1;for(let g=0;g<10;++g){if(VK(s.x,1,i.x,n,e),h=s.fx=t(s.x,s.fxprime),c=bt(s.fxprime,e),h>o+r*n*l||g&&h>=d)return p(u,n,d);if(Math.abs(c)<=-a*l)return n;if(c>=0)return p(n,u,h);d=h,u=n,n*=2}return n}function UK(t,e,i){let s={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let a,o=1;const l=(i=i||{}).maxIterations||20*e.length;s.fx=t(s.x,s.fxprime);const h=s.fxprime.slice();NK(h,s.fxprime,-1);for(let e=0;e=g[p-1].fx){let i=!1;if(v.fx>e.fx?(VK(y,1+d,f,-d,e),y.fx=t(y),y.fx=1)break;for(let e=1;e=Math.min(s[a].size,s[o].size)&&(r=0),n[a].push({set:o,size:i.size,weight:r}),n[o].push({set:a,size:i.size,weight:r})}const r=[];for(const t in n)if(n.hasOwnProperty(t)){let e=0;for(let i=0;i=8){const n=function(t,e){const i=(e=e||{}).restarts||10,s=[],n={};let r;for(r=0;r=Math.min(e[r].size,e[a].size)?l=1:t.size<=1e-10&&(l=-1),n[r][a]=n[a][r]=l})),{distances:s,constraints:n}}(t,s,n);let o=a.distances;const l=a.constraints,h=zK(o.map(zK))/o.length;o=o.map((t=>t.map((t=>t/h))));const d=function(t,e){return function(t,e,i,s){let n,r=0;for(n=0;n0&&g<=c||u<0&&g>=c||(r+=2*m*m,e[2*n]+=4*m*(a-h),e[2*n+1]+=4*m*(o-d),e[2*l]+=4*m*(h-a),e[2*l+1]+=4*m*(d-o))}}return r}(t,e,o,l)};let c,u;for(r=0;rwY(e)));u=UK(d,t,e),(!c||u.fx0){const e=t[0].x,i=t[0].y;for(s=0;s1){const i=Math.atan2(t[1].x,t[1].y)-e,n=Math.cos(i),r=Math.sin(i);let a,o;for(s=0;s2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(s=0;s=n&&(s=i[r],n=a)}const r=$K((function(i){return-1*JK({x:i[0],y:i[1]},t,e)}),[s.x,s.y],{maxIterations:500,minErrorDelta:1e-10}).x;let a={x:r[0],y:r[1]},o=!0;for(let e=0;et[e].radius){o=!1;break}for(let t=0;t{const{x0:i,x1:s,y0:n,y1:r,setField:a="sets",valueField:o="size",orientation:l=Math.PI/2,orientationOrder:h=null}=t;let d={},c={};if(e.length>0){const u=e.map((t=>({sets:Na(t[a]),size:t[o]})));let p=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const i=e.initialLayout||XK,s=e.lossFunction||YK,n=i(t=function(t){t=t.slice();const e=[],i={};for(let s=0;se)}));for(let s=0;s0&&g.getInstance().error("Area "+r+" not represented on screen")}return i}(d,u)}return e.map((t=>{const e=Na(t[a]),i=e.toString(),s=c[i],n=Object.assign(Object.assign({},t),{datum:t,sets:e,key:i,size:t[o],labelX:null==s?void 0:s.x,labelY:null==s?void 0:s.y}),r=d[i];if(r)return Object.assign(Object.assign({},n),{type:"circle",x:r.x,y:r.y,radius:r.radius});const l=DK(e.map((t=>d[t])));return Object.assign(Object.assign({},n),{type:"overlap",x:0,y:0,path:OK(l),arcs:l})}))},tq=(t,e)=>e.filter((e=>e.type===t.datumType));class eq extends qC{constructor(){super(...arguments),this.type=Sl.venn,this.transformerConstructor=FK,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:xT)}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){const e=this._data.getProduct();e&&e.transform([{type:"venn",x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,setField:this._categoryField,valueField:this._valueField}]),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(eq.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(eq.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},Sy.STATE_NORMAL,Py.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},Sy.STATE_NORMAL,Py.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},Sy.STATE_HOVER,Py.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>SK(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},Sy.STATE_NORMAL,Py.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>SK(t.sets)},Sy.STATE_NORMAL,Py.Series))}initTooltip(){this._tooltipHelper=new MK(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:SK(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return SK(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[SK(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Na(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(SK(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),NC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(zC(null===(e=Ql.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),NC(t.name,this._spec,this._markAttributeContext)))}))}}eq.type=Sl.venn,eq.mark=kK,eq.transformerConstructor=FK;class iq extends pP{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,circle:t.circle,overlap:t.overlap,overlapLabel:t.overlapLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class sq extends yP{constructor(){super(...arguments),this.transformerConstructor=iq,this.type="venn",this.seriesType=Sl.venn}}sq.type="venn",sq.seriesType=Sl.venn,sq.transformerConstructor=iq;var nq=i(6311),rq=i.n(nq),aq=i(5072),oq=i.n(aq),lq=i(7825),hq=i.n(lq),dq=i(7659),cq=i.n(dq),uq=i(5056),pq=i.n(uq),gq=i(540),mq=i.n(gq),_q=i(1113),fq=i.n(_q),vq=i(8932),yq={};yq.styleTagTransform=fq(),yq.setAttributes=pq(),yq.insert=cq().bind(null,"head"),yq.domAPI=hq(),yq.insertStyleElement=mq(),oq()(vq.A,yq),vq.A&&vq.A.locals&&vq.A.locals;var bq=i(4353),xq=i(3826),Sq=i.n(xq),Mq=i(8569),kq=i.n(Mq);function Aq(t,e){if((i=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var i,s=t.slice(0,i);return[s.length>1?s[0]+s.slice(2):s,+t.slice(i+1)]}i(5662),i(2355),i(8361),i(3309),i(9865),i(5592),i(1289),i(539),i(4405),i(2338),i(1130),i(1532),i(9990),i(5944),i(1092),i(4608),i(2509),i(9294),i(2745),i(5530),i(5993),i(9751),i(4780),i(5681),i(2706),i(2878),i(3672),i(494),i(2187),i(4072),i(9881),i(1995),i(2026),i(7329),i(7690),i(912),i(5571),i(2673),i(2619),i(5826),i(3713),i(1219),i(4719),i(3532),i(2498),i(7317),i(4288),i(4007),i(292),i(9964),i(7674),i(6290),i(3433),i(813),i(9836),i(4061),i(8418),i(3562),i(8660),i(7409),i(2010),i(2830),i(5811),i(8809),i(8298),i(4309),i(7420),i(5513),i(9286),i(3900),i(952),i(7741),i(6481),i(1335),i(6101),i(6364),i(8003),i(6605),i(4457),i(8615),i(3860),i(4485),i(6467),i(623),i(2739),i(5877),i(5376),i(2698),i(6462),i(6400),i(9677),i(9464),i(6803),i(7205),i(880),i(465),i(9423),i(3225),i(2218),i(2369),i(4509),i(4334),i(2796),i(5414),i(3222),i(5285),i(5665),i(6847),i(9998),i(5977),i(7439),i(5616),i(2487),i(9160),i(1340),i(2979),i(7250),i(7406),i(8928),i(5012),i(7081),i(2544),i(8142),i(321),i(4895),i(3187),i(8804),i(5084),i(9911),i(4173),i(1750),i(950),i(4734),i(860),i(5760),i(7933),i(6033),i(122),i(1349),i(6007),i(9252),i(225),i(3473);var wq,Tq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Lq(t){if(!(e=Tq.exec(t)))throw new Error("invalid format: "+t);var e;return new Cq({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Cq(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Eq(t,e){var i=Aq(t,e);if(!i)return t+"";var s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}Lq.prototype=Cq.prototype,Cq.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Dq={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Eq(100*t,e),r:Eq,s:function(t,e){var i=Aq(t,e);if(!i)return t+"";var s=i[0],n=i[1],r=n-(wq=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+Aq(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Oq(t){return t}var Pq,Rq,Bq=Array.prototype.map,Iq=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fq(t){var e,i,s=void 0===t.grouping||void 0===t.thousands?Oq:(e=Bq.call(t.grouping,Number),i=t.thousands+"",function(t,s){for(var n=t.length,r=[],a=0,o=e[0],l=0;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Oq:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Bq.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=Lq(t)).fill,i=t.align,c=t.sign,u=t.symbol,p=t.zero,g=t.width,m=t.comma,_=t.precision,f=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Dq[v]||(void 0===_&&(_=12),f=!0,v="g"),(p||"0"===e&&"="===i)&&(p=!0,e="0",i="=");var y="$"===u?n:"#"===u&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===u?r:/[%p]/.test(v)?l:"",x=Dq[v],S=/[defgprs%]/.test(v);function M(t){var n,r,l,u=y,M=b;if("c"===v)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?d:x(Math.abs(t),_),f&&(t=function(t){t:for(var e,i=t.length,s=1,n=-1;s0&&(n=0)}return n>0?t.slice(0,n)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==c&&(k=!1),u=(k?"("===c?c:h:"-"===c||"("===c?"":c)+u,M=("s"===v?Iq[8+wq/3]:"")+M+(k&&"("===c?")":""),S)for(n=-1,r=t.length;++n(l=t.charCodeAt(n))||l>57){M=(46===l?a+t.slice(n+1):t.slice(n))+M,t=t.slice(0,n);break}}m&&!p&&(t=s(t,1/0));var A=u.length+t.length+M.length,w=A>1)+u+t+M+w.slice(A);break;default:t=w+u+t+M}return o(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:c,formatPrefix:function(t,e){var i,s=c(((t=Lq(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor((i=e,((i=Aq(Math.abs(i)))?i[1]:NaN)/3)))),r=Math.pow(10,-n),a=Iq[8+n/3];return function(t){return s(r*t)+a}}}}Pq=Fq({thousands:",",grouping:[3],currency:["$",""]}),Rq=Pq.format,Pq.formatPrefix,MI(),XB(),Ql.registerAnimation("vennCircle",((t,e)=>({appear:BK(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),Ql.registerAnimation("vennOverlap",((t,e)=>({appear:IK(e),update:{custom:RK},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),PC(),fc.registerTransform("venn",{transform:QK,markPhase:"beforeJoin"},!0),fc.registerTransform("vennMark",{transform:tq,markPhase:"beforeJoin"},!0),Ql.registerSeries(eq.type,eq),Ql.registerChart(sq.type,sq),bq.extend(Sq()),bq.extend(kq()),HTMLWidgets.widget({name:"vchart",type:"output",factory:function(t,e,i){let s;return{renderValue:function(e){var i=document.getElementById(t.id);if(i.style.display="flex",i.style.flexDirection="column",e.hasOwnProperty("select")){const e=document.createElement("select");e.id=t.id+"_select",i.appendChild(e)}const n=document.createElement("div");if(n.style.flex="1 1 auto",i.appendChild(n),e.hasOwnProperty("map")&&xK.registerMap(e.map.name,e.map.topojson,{type:"topojson",object:"map"}),void 0===s?(s=new xK(e.specs,{dom:n}),s.renderAsync()):s.updateSpec(e.specs),e.hasOwnProperty("theme"),e.hasOwnProperty("events"))for(let t=0;t{console.log(t),console.log(e.select.data[t.value]),s.updateData(e.select.dataId,e.select.data[t[0].value])},new(rq())(r)}},resize:function(t,e){}}}})})();var n=window;for(var r in s)n[r]=s[r];s.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d9b1ccd..8fcceea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@visactor/vchart": "^1.12.8", + "@visactor/vchart": "^1.12.10", "@visactor/vchart-theme": "^1.11.6", "css-loader": "^7.1.2", "d3-format": "^3.1.0", @@ -433,26 +433,26 @@ } }, "node_modules/@visactor/vchart": { - "version": "1.12.8", - "resolved": "https://registry.npmjs.org/@visactor/vchart/-/vchart-1.12.8.tgz", - "integrity": "sha512-QG8KY/KMcr78AL1DPOMNBVi1pDK2AyRlaP7uQueu0vgBmqCbJfFNsAy7RUSNvufw3cDk85wfBqmsckqOiEeiow==", - "dev": true, - "dependencies": { - "@visactor/vdataset": "~0.18.17", - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-hierarchy": "0.14.10", - "@visactor/vgrammar-projection": "0.14.10", - "@visactor/vgrammar-sankey": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vgrammar-venn": "0.14.10", - "@visactor/vgrammar-wordcloud": "0.14.10", - "@visactor/vgrammar-wordcloud-shape": "0.14.10", - "@visactor/vrender-components": "0.20.9", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vscale": "~0.18.17", - "@visactor/vutils": "~0.18.17", - "@visactor/vutils-extension": "1.12.8" + "version": "1.12.10", + "resolved": "https://registry.npmjs.org/@visactor/vchart/-/vchart-1.12.10.tgz", + "integrity": "sha512-ujEcUMluhzu6nbNRdAwPXNYflDyslH69wkovYO+yRz7xWbRVZE6yPN1yjfvWmIndxEfl9mazTEJgOP2ZOM350w==", + "dev": true, + "dependencies": { + "@visactor/vdataset": "~0.18.18", + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-hierarchy": "0.14.13", + "@visactor/vgrammar-projection": "0.14.13", + "@visactor/vgrammar-sankey": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vgrammar-venn": "0.14.13", + "@visactor/vgrammar-wordcloud": "0.14.13", + "@visactor/vgrammar-wordcloud-shape": "0.14.13", + "@visactor/vrender-components": "0.20.12", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vscale": "~0.18.18", + "@visactor/vutils": "~0.18.18", + "@visactor/vutils-extension": "1.12.10" } }, "node_modules/@visactor/vchart-theme": { @@ -465,15 +465,15 @@ } }, "node_modules/@visactor/vdataset": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@visactor/vdataset/-/vdataset-0.18.17.tgz", - "integrity": "sha512-y5cy3ITmYl5G15qlYFXqcMFIPjhc06nsN8Y2Nuy/emAIWjzUYDOkOMpkquzBbs7ragr5Fv5lNixNVH0qh7OT0A==", + "version": "0.18.18", + "resolved": "https://registry.npmjs.org/@visactor/vdataset/-/vdataset-0.18.18.tgz", + "integrity": "sha512-lye23zpineMKV42JmuJaOY3fgl7aWhyDIwK9dWooqZzP14AFukPoK7ZvUeuKZihLrHxqtCg2VWEjovnh9O1RUg==", "dev": true, "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", - "@visactor/vutils": "0.18.17", + "@visactor/vutils": "0.18.18", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", @@ -490,166 +490,166 @@ } }, "node_modules/@visactor/vgrammar-coordinate": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-coordinate/-/vgrammar-coordinate-0.14.10.tgz", - "integrity": "sha512-xnYinHJQkkFqiCOZcax7XYQZ7ZX5kxnEHo9ir7h9M255Php+c17+rXfkatRlom+vw95VkmsAVI2MWpc5Fvs6og==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-coordinate/-/vgrammar-coordinate-0.14.13.tgz", + "integrity": "sha512-eOEOTgMX600sVDHrsEb+ti0V7juCQCivReZ8G5HJ/S7QNr2agKkv3Am0B4/vC83qnWkywj/zss11jXNANkb7QQ==", "dev": true, "dependencies": { - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-core": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-core/-/vgrammar-core-0.14.10.tgz", - "integrity": "sha512-XWkHUvAcL6BgzRjFyK6w3+PHLyU5O+uAhsA7IVadpbIsGYqajLhni5neiaHBtdpVtpUVNlI45uiEin1gga12pw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-core/-/vgrammar-core-0.14.13.tgz", + "integrity": "sha512-Qau88Y1NStjjjRKit2DfJ5/vhiAUyy8jwdU9wOCUgTTi4EGnKZEQ19yiK9J8XsCjmZ+kpKuRo4ppBsuBESfXDw==", "dev": true, "dependencies": { - "@visactor/vdataset": "~0.18.17", - "@visactor/vgrammar-coordinate": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-components": "0.20.9", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vscale": "~0.18.17", - "@visactor/vutils": "~0.18.17" + "@visactor/vdataset": "~0.18.18", + "@visactor/vgrammar-coordinate": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-components": "0.20.12", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vscale": "~0.18.18", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-hierarchy": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-hierarchy/-/vgrammar-hierarchy-0.14.10.tgz", - "integrity": "sha512-Z6YHCIunTjulfRHNKV78o9lMdI4/nGewvJ4SrE99Y0ER1wap6gmWeRr/5IBEkhK6NrCBugqg9xXA1Orbu0E2Cg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-hierarchy/-/vgrammar-hierarchy-0.14.13.tgz", + "integrity": "sha512-cCWqDoC09O/iXBatXnCwBSMRQREQW5vbruP8Wd9xcQbEs4Sn5Qjmd9wcmIiyBoIbzG+MIXsiDJIX4Ie1nw6hrA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-projection": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-projection/-/vgrammar-projection-0.14.10.tgz", - "integrity": "sha512-GuvUfhl+Mo2HSQeYu1NvEZ60Mu8I8v7VPL3r8zgYUAaFY79noEHC+CKSq6+kRJ5aDCb4dcCU3Gbg2jQ9/cbkXA==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-projection/-/vgrammar-projection-0.14.13.tgz", + "integrity": "sha512-UTQg0/oFiWB9FsUDmN1AyMiGd1688r8WM38OocuONfd+gOaCMV3pRfYmcek/l4tz21Gn3oWfjwgrL0xORdfxWA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vutils": "~0.18.17", + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vutils": "~0.18.18", "d3-geo": "^1.12.1" } }, "node_modules/@visactor/vgrammar-sankey": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-sankey/-/vgrammar-sankey-0.14.10.tgz", - "integrity": "sha512-DbFZTcbpKU+zDnnR/mFVjq92bp+cRQ3Yg827/F2fttv6yfs+fC+UZ6v7Oop6j9ajYv7/AGzstN5iFyJaakXnbw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-sankey/-/vgrammar-sankey-0.14.13.tgz", + "integrity": "sha512-bgj5rqOygeQjHcqO7opoTll2yhRp8VaoZ5QHrwytHnTUtTsM3Jr54IQ2oI1DyLWJekMWwL3MljiatxeZRdcmoA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-util": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-util/-/vgrammar-util-0.14.10.tgz", - "integrity": "sha512-P8ZAC94EOB4amwBYR9zipsWsbS6Ya5wnMb92ez8S49iGNNbxYtF0la6JOBC/EXby4i1F20tE/zpE4PyYzp20Ow==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-util/-/vgrammar-util-0.14.13.tgz", + "integrity": "sha512-hBKjW1jZfUgaN1sLJUJukyBQbjpkUP7uFSe67/xB/0yhOXEJARwrZ6T9ogdAdvTwaXqrYRWsk37yqmdFnNY6pg==", "dev": true, "dependencies": { - "@visactor/vrender-core": "0.20.9", - "@visactor/vutils": "~0.18.17" + "@visactor/vrender-core": "0.20.12", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-venn": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-venn/-/vgrammar-venn-0.14.10.tgz", - "integrity": "sha512-1wVnUdnJxT4QTVUZyrcH8rLOo+p2HpXionxFHv5YkxBn9/r3a9zC1znDqeyLvo4cdMA0GYQ1VWwsIpLOqw/2cg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-venn/-/vgrammar-venn-0.14.13.tgz", + "integrity": "sha512-1OpMyNFe5Of4LvY0eBqgQZulpoJP5jq+ErcWjmzBSccq/tIlkU3IvruItnHa5YtZDl2uNiOLAo9PykGlKGf3pw==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-wordcloud": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud/-/vgrammar-wordcloud-0.14.10.tgz", - "integrity": "sha512-AQpamflJM3RV2s3bFmVz/muuOx+GmOTbDcIU6OHZmaLb7FwFJWwm11TjcwSJpMczHzTE54tKBbo5wkquOpO8Yg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud/-/vgrammar-wordcloud-0.14.13.tgz", + "integrity": "sha512-h5GiL+M57rB97VPBppt/SnhN5RNV6rYuPP/QZbvgt94M6xyf7V72fTV0pcilmT9liDWrVBma81/lRgU0+UFfxA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vgrammar-wordcloud-shape": { - "version": "0.14.10", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud-shape/-/vgrammar-wordcloud-shape-0.14.10.tgz", - "integrity": "sha512-f1xkVeZNR/iCVStrEBw+ISubeNoYTfkdmnSlhOJ9xl0ZLCK/NmTl75Fghvs7mLLydBAX1XSKwfBHtt/1Gm9HgQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud-shape/-/vgrammar-wordcloud-shape-0.14.13.tgz", + "integrity": "sha512-NmcXTN9VsqzM8P3GR+vUm21sqxaOMY5y5VmyoPD1QJ8AqdJjBGUvPvlYIbAjizOA6xsS5laqEysZx11J21YSfA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.10", - "@visactor/vgrammar-util": "0.14.10", - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vscale": "~0.18.17", - "@visactor/vutils": "~0.18.17" + "@visactor/vgrammar-core": "0.14.13", + "@visactor/vgrammar-util": "0.14.13", + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vscale": "~0.18.18", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vrender-components": { - "version": "0.20.9", - "resolved": "https://registry.npmjs.org/@visactor/vrender-components/-/vrender-components-0.20.9.tgz", - "integrity": "sha512-Xx+47i/aPy6/1ZgxUH+J7nwzi4cplgUxgRYe6hhPqzlK4vVeNkqA46sUQVYBvX/JUi4t6uHDw9VBgAVPffpmGQ==", + "version": "0.20.12", + "resolved": "https://registry.npmjs.org/@visactor/vrender-components/-/vrender-components-0.20.12.tgz", + "integrity": "sha512-Dt+Ua+5b8zEQfpOsNSdTjtnhvP1iw4kCrILgcvlWBUqfVIFl+jG7TStSm9pqtB9o6+0mLUCnH9fgOSICfsa0yQ==", "dev": true, "dependencies": { - "@visactor/vrender-core": "0.20.9", - "@visactor/vrender-kits": "0.20.9", - "@visactor/vscale": "~0.18.17", - "@visactor/vutils": "~0.18.17" + "@visactor/vrender-core": "0.20.12", + "@visactor/vrender-kits": "0.20.12", + "@visactor/vscale": "~0.18.18", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@visactor/vrender-core": { - "version": "0.20.9", - "resolved": "https://registry.npmjs.org/@visactor/vrender-core/-/vrender-core-0.20.9.tgz", - "integrity": "sha512-jyGYhLpSOKz0+kJfYpQ6gcAi4CzOpmoIrM7FAj7QkpYvaT1iVFwIcFxEc93TqkMDoFCH+oezCXSlSKJ/McHODQ==", + "version": "0.20.12", + "resolved": "https://registry.npmjs.org/@visactor/vrender-core/-/vrender-core-0.20.12.tgz", + "integrity": "sha512-cvqqb6hVSpcwzWo6Og5TTH+mXbWNwc45rbF2/37/DBCjNm9S1feDf3fwbwAlUo0pxyKWF1bDU6GZKgsaTdypFw==", "dev": true, "dependencies": { - "@visactor/vutils": "~0.18.17", + "@visactor/vutils": "~0.18.18", "color-convert": "2.0.1" } }, "node_modules/@visactor/vrender-kits": { - "version": "0.20.9", - "resolved": "https://registry.npmjs.org/@visactor/vrender-kits/-/vrender-kits-0.20.9.tgz", - "integrity": "sha512-LJfPi9sXZ30EJj6ClKgYBGK7UBH3peaudNoFSdsxPec5Ie1e4hoHI0Ews34OvFW1ZJToc3DZuunyJLPSWaD7cA==", + "version": "0.20.12", + "resolved": "https://registry.npmjs.org/@visactor/vrender-kits/-/vrender-kits-0.20.12.tgz", + "integrity": "sha512-5r0dHVBZOBrUaKElSWBp676VDa+TqEui8C9qewyEWTzMqlN7tBmhrlcogFeVRbkTzXfNAKGWzrafbLHlQuMduQ==", "dev": true, "dependencies": { "@resvg/resvg-js": "2.4.1", - "@visactor/vrender-core": "0.20.9", - "@visactor/vutils": "~0.18.17", + "@visactor/vrender-core": "0.20.12", + "@visactor/vutils": "~0.18.18", "roughjs": "4.5.2" } }, "node_modules/@visactor/vscale": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@visactor/vscale/-/vscale-0.18.17.tgz", - "integrity": "sha512-jChQ7kq2CN/i+BtQ9wA2B8Xqmlw2xQDARDrmiUszXtuki07zNvq39UiNiQLQQjPq1qXb5hHNY4h4Wsp6fUa/RQ==", + "version": "0.18.18", + "resolved": "https://registry.npmjs.org/@visactor/vscale/-/vscale-0.18.18.tgz", + "integrity": "sha512-iRG4kv+5Fv4KX3AxEfV95XU3I6OmF0QizyAhqHxKa7L1MaT+MRvDDk5zHWf1E8gialLbL2xDe3GnT6g/4u5jhA==", "dev": true, "dependencies": { - "@visactor/vutils": "0.18.17" + "@visactor/vutils": "0.18.18" } }, "node_modules/@visactor/vutils": { - "version": "0.18.17", - "resolved": "https://registry.npmjs.org/@visactor/vutils/-/vutils-0.18.17.tgz", - "integrity": "sha512-V9KZTlqyjyKEnKqmH8n2VjxOKlR7bX07R7W8tgEV4andfCYG8ufbx+xniR3jYXxCtca4USAks2KwyJBj2H+Kww==", + "version": "0.18.18", + "resolved": "https://registry.npmjs.org/@visactor/vutils/-/vutils-0.18.18.tgz", + "integrity": "sha512-byEJefqxiCz3UWe+YedEVjsdPtnJOAtKdRYi4qT9ojgACdd6QqlWs53Eb7PlMZgWDxVxqkxJP2bZnRKw+ME0Xg==", "dev": true, "dependencies": { "@turf/helpers": "^6.5.0", @@ -658,13 +658,13 @@ } }, "node_modules/@visactor/vutils-extension": { - "version": "1.12.8", - "resolved": "https://registry.npmjs.org/@visactor/vutils-extension/-/vutils-extension-1.12.8.tgz", - "integrity": "sha512-lgpJ0aLSnBdErRufCQq6vNRQPQ5km7I7MgpEkpAHYzoE6STof/tRpqzT1STRQILI3Uk97hAtGPnwdUeS6vxpkA==", + "version": "1.12.10", + "resolved": "https://registry.npmjs.org/@visactor/vutils-extension/-/vutils-extension-1.12.10.tgz", + "integrity": "sha512-R08JD/vh+gTei1uxd2k1WZuMbqZwK4rGYaDBYpYPkwZZ47+/94wvGcPR0M+KhgOnAWqDfExqGj/v0CDYotFE6g==", "dev": true, "dependencies": { - "@visactor/vdataset": "~0.18.17", - "@visactor/vutils": "~0.18.17" + "@visactor/vdataset": "~0.18.18", + "@visactor/vutils": "~0.18.18" } }, "node_modules/@webassemblyjs/ast": { @@ -2188,9 +2188,9 @@ } }, "node_modules/simple-statistics": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/simple-statistics/-/simple-statistics-7.8.5.tgz", - "integrity": "sha512-yw4aOnkvPLbL80zamrEKznAnk5cIIkjEcx/z0aQl+m/YKMmVufrnWgWJWRspqZtwh+ElZXRhJ0MtnUjFUQV5Ow==", + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/simple-statistics/-/simple-statistics-7.8.7.tgz", + "integrity": "sha512-ed5FwTNYvkMTfbCai1U+r3symP+lIPKWCqKdudpN4NFNMn9RtDlFtSyAQhCp4oPH0YBjWu/qnW+5q5ZkPB3uHQ==", "dev": true, "engines": { "node": "*" diff --git a/package.json b/package.json index 72cb1e1..9a203eb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "author": "Victor PERRIER", "license": "MIT", "devDependencies": { - "@visactor/vchart": "^1.12.8", + "@visactor/vchart": "^1.12.10", "@visactor/vchart-theme": "^1.11.6", "css-loader": "^7.1.2", "d3-format": "^3.1.0",