1/*! LICENSE: 3573.cf7ffdf00e.js.LICENSE.txt */ 2(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[3573],{75024(t,e,i){"use strict";i.d(e,{H:()=>s});let s="__VCHART"},59668(t,e,i){"use strict";let s,r,a,n,l,o,h,u,d,c,p,g;i.d(e,{ThemeManager:()=>u$,Ay$:()=>zY});var f,m,_,y,v,b,x,S,A,k,M,w,T,C,B,E,P,O,R,I,L,D,F,z,H,j,V,N,W,U,G,Y,$,X,K,q,Z,J,Q,tt,te,ti,ts,tr,ta,tn,tl,to,th,tu,td,tc,tp,tg,tf,tm,t_,ty,tv,tb,tx,tS,tA,tk,tM,tw,tT,tC,tB,tE,tP,tO,tR,tI,tL,tD,tF,tz,tH,tj,tV,tN,tW,tU,tG,tY,t$,tX,tK,tq,tZ,tJ,tQ,t0,t1,t2,t3,t5,t4,t8,t6,t9,t7,et,ee,ei,es,er,ea,en={};i.r(en),i.d(en,{Zr:()=>mc});let el=t=>t;(o8=hd||(hd={}))["desktop-browser"]="desktop-browser",o8["mobile-browser"]="mobile-browser",o8.node="node",o8.worker="worker",o8.miniApp="miniApp",o8.wx="wx",o8.tt="tt",o8.harmony="harmony",o8["desktop-miniApp"]="desktop-miniApp",o8.lynx="lynx",(o6=hc||(hc={})).cartesianAxis="cartesianAxis",o6.cartesianBandAxis="cartesianAxis-band",o6.cartesianLinearAxis="cartesianAxis-linear",o6.cartesianTimeAxis="cartesianAxis-time",o6.cartesianLogAxis="cartesianAxis-log",o6.cartesianSymlogAxis="cartesianAxis-symlog",o6.polarAxis="polarAxis",o6.polarBandAxis="polarAxis-band",o6.polarLinearAxis="polarAxis-linear",o6.crosshair="crosshair",o6.cartesianCrosshair="cartesianCrosshair",o6.polarCrosshair="polarCrosshair",o6.dataZoom="dataZoom",o6.geoCoordinate="geoCoordinate",o6.indicator="indicator",o6.discreteLegend="discreteLegend",o6.continuousLegend="continuousLegend",o6.colorLegend="colorLegend",o6.sizeLegend="sizeLegend",o6.markLine="markLine",o6.markArea="markArea",o6.markPoint="markPoint",o6.polarMarkLine="polarMarkLine",o6.polarMarkArea="polarMarkArea",o6.polarMarkPoint="polarMarkPoint",o6.geoMarkPoint="geoMarkPoint",o6.tooltip="tooltip",o6.title="title",o6.player="player",o6.scrollBar="scrollBar",o6.label="label",o6.totalLabel="totalLabel",o6.brush="brush",o6.poptip="poptip",o6.customMark="customMark";var eo=i(9768),eh=i.n(eo),eu=i(75540);let ed=(t,e=!1)=>{let i=typeof t;return e?"number"===i:"number"===i||(0,eu.A)(t,"Number")},ec="u">typeof console;function ep(t,e,i){let s=[e].concat([].slice.call(i));ec&&console[t].apply(console,s)}(o9=hp||(hp={}))[o9.None=0]="None",o9[o9.Error=1]="Error",o9[o9.Warn=2]="Warn",o9[o9.Info=3]="Info",o9[o9.Debug=4]="Debug";class eg{static getInstance(t,e){return eg._instance&&ed(t)?eg._instance.level(t):eg._instance||(eg._instance=new eg(t,e)),eg._instance}static setInstance(t){return eg._instance=t}static setInstanceLevel(t){eg._instance?eg._instance.level(t):eg._instance=new eg(t)}static clearInstance(){eg._instance=null}constructor(t=hp.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find(e=>e===t)||this._onErrorHandler.push(t)}removeErrorHandler(t){let 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>=hp.Info}canLogDebug(){return this._level>=hp.Debug}canLogError(){return this._level>=hp.Error}canLogWarn(){return this._level>=hp.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=hp.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):ep(null!=(e=this._method)?e:"error","ERROR",t)),this}warn(...t){return this._level>=hp.Warn&&ep(this._method||"warn","WARN",t),this}info(...t){return this._level>=hp.Info&&ep(this._method||"log","INFO",t),this}debug(...t){return this._level>=hp.Debug&&ep(this._method||"log","DEBUG",t),this}}eg._instance=null;let ef=0;function em(t="dataset"){return ef>1e8&&(ef=0),t+"_"+ef++}class e_{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(eh()),i=(null==t?void 0:t.name)?t.name:em("dataset"),this.name=i,this._logger=null!=(e=null==t?void 0:t.logger)?e:eg.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null==(i=this._logger)||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)||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)||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)}
2multipleDataViewRemoveListener(t,e,i){if(this._callMap){let 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.markRunning()}),t.forEach(t=>{var e;return null==(e=this.getDataView(t.name))?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.markRunning()}),t.forEach(t=>{var e;return null==(e=this.getDataView(t.name))?void 0:e.updateRawData(t.data,t.options)})}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}let ey=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||(0,eu.A)(t,"Boolean");var ev=i(64091);let eb=(t,e,i)=>{let s=!ey(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!(0,ev.A)(t))throw TypeError("Invalid data: must be DataView array!");return(0,ev.A)(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};var ex=i(63574),eS=i(6181),eA=i(42496);function ek(t,e,i){let s;if(!(0,eA.A)(t)||"object"!=typeof t||e&&e(t))return t;let r=(0,ev.A)(t),a=t.length;s=r?Array(a):"object"==typeof t?{}:ey(t)||ed(t)||(0,eS.A)(t)?t:(0,eu.A)(t,"Date")?new Date(+t):void 0;let n=r?void 0:Object.keys(Object(t)),l=-1;if(s)for(;++l<(n||t).length;){let r=n?n[l]:l,a=t[r];i&&i.includes(r.toString())?s[r]=a:s[r]=ek(a,e,i)}return s}let eM=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var ew=i(31724);function eT(t,e,i=!1,s=!1){if(e&&t!==e&&(0,eA.A)(e)&&"object"==typeof e){let r=Object(e),a=[];for(let t in r)a.push(t);let{length:n}=a,l=-1;for(;n--;){let n=a[++l];!(0,eA.A)(r[n])||"object"!=typeof r[n]||s&&(0,ev.A)(t[n])?eC(t,n,r[n]):function(t,e,i,s=!1,r=!1){let a=t[i],n=e[i],l=e[i],o=!0;if((0,ev.A)(n)){if(s)l=[];else if((0,ev.A)(a))l=a;else if(eM(a)){l=Array(a.length);let t=-1,e=a.length;for(;++t<e;)l[t]=a[t]}}else(0,ew.A)(n)?(l=null!=a?a:{},"function"!=typeof a&&"object"==typeof a||(l={})):o=!1;o&&eT(l,n,s,r),eC(t,i,l)}(t,e,n,i,s)}}}function eC(t,e,i){var s,r;(void 0===i||(s=t[e],s===(r=i)||Number.isNaN(s)&&Number.isNaN(r)))&&(void 0!==i||e in t)||(t[e]=i)}function eB(t,...e){let i=-1,s=e.length;for(;++i<s;)eT(t,e[i],!0);return t}var eE=i(33049);let eP=t=>ed(t)&&Number.isFinite(t),eO=(t,e)=>{var i,s;if(!(null==e?void 0:e.fields)||0===t.length)return t;let r=e.fields,a=t[0],n={},l=[];for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)){let o,h=r[e];if(h.sort&&(eP(h.sortIndex)||(h.sortIndex=0),(0,eA.A)(h.sortReverse)||(h.sortReverse="desc"===h.sort)),!h.type){let s=a;e in a||(s=null!=(i=t.find(t=>e in t))?i:a),h.type="number"==typeof s[e]?"linear":"ordinal"}if("number"==typeof h.sortIndex&&(o={key:e,type:h.type,index:h.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===h.sortReverse},l.push(o)),(null==(s=h.domain)?void 0:s.length)>0)if("ordinal"===h.type){h._domainCache={},n[e]=h;let t={};h.domain.forEach((e,i)=>{t[e]=i,h._domainCache[e]=i}),o&&(o.sortIndex=t,o.sortIndexCount=h.domain.length)}else h.domain.length>=2&&(n[e]=h)}return Object.keys(n).length>0&&(t=t.filter(t=>{for(let e in n){let i=n[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0})),l.sort((t,e)=>t.index-e.index),t.sort((t,e)=>(function(t,e,i){for(let s=0;s<i.length;s++){let r=i[s],a=0;if("ordinal"===r.type?(void 0===r.sortIndex[e[r.key]]&&(r.sortIndex[e[r.key]]=r.sortIndexCount++),void 0===r.sortIndex[t[r.key]]&&(r.sortIndex[t[r.key]]=r.sortIndexCount++),a=r.sortIndex[t[r.key]]-r.sortIndex[e[r.key]]):"linear"===r.type&&(a=t[r.key]-e[r.key]),r.s
2ortReverse&&(a=-a),0!==a)return a}return 0})(t,e,l)),t};class eR{constructor(t,e){let i;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new(eh()),this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=(t={})=>{let e=this.latestData;return this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach(e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1})}),this.isRunning=!1,!1===t.emitMessage||t.skipEqual&&(0,ex.n)(e,this.latestData)||this.target.emit("change",{latestData:this.latestData}),this},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:em("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);let r=this.cloneParseData(t,e);if(null==e?void 0:e.type){let t=(null!=(s=this.dataSet.getParser(e.type))?s:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=t,this.history&&this.historyData.push(r,t),this.latestData=t}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;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;let e=this.transformsArr.findIndex(e=>e.type===t.type);e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}i&&this.transformsArr.push(t),e&&this.executeTransform(t)}return this.sortTransform(),this.isRunning=!1,this}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort((t,e)=>{var i,s;return(null!=(i=t.level)?i:0)-(null!=(s=e.level)?s:0)})}executeTransform(t,e={}){let{pushHistory:i,emitMessage:s,skipEqual:r}=e,a=this.dataSet.getTransform(t.type),n=this.latestData,l=a(n,t.options);this.history&&!1!==i&&this.historyData.push(l),this.latestData=l,!1===s||r&&(0,ex.n)(n,this.latestData)||this.target.emit("change",{latestData:this.latestData})}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}cloneParseData(t,e){let i=!1;return t instanceof eR||!0!==(null==e?void 0:e.clone)||(i=!0),i?ek(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){let i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null==(t=this.parseOption)?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t,e=!1){this._fields=t&&e?eB({},this._fields,t):t;let i=this.transformsArr.find(t=>"fields"===t.type);!(0,eE.A)(this._fields)&&(0,eE.A)(i)?(this.dataSet.registerTransform("fields",eO),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class eI{static GenAutoIncrementId(){return eI.auto_increment_id++}}eI.auto_increment_id=0;class eL{constructor(t){this.id=eI.GenAutoIncrementId(),this.registry=t}}let eD="multi_inject",eF="inversify:tagged",ez="inversify:paramtypes",eH=(o5={},function(t){Object.prototype.hasOwnProperty;let 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)),r=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),a=new WeakMap;function n(t,e,i){let s=a.get(t);if(o(s)){if(!i)return;s=new r,a.set(t,s)}let n=s.get(e);if(o(n)){if(!i)return;n=new r,s.set(e,n)}return n}function l(t,e,i){let s=n(e,i,!1);return!o(s)&&!!s.has(t)}function o(t){return void 0===t}function h(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t){let e=function(t){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}let e="string",s=function(t,e){let i=t[e];if(null!=i){if(!d(i))throw TypeError();return i}}(t,i);if(void 0!==s){let i=s.call(t,e);if(h(i))throw TypeError();return i}return function(t,e){if("string"===e){let e=t.toString;if(d(e)){let i=e.call(t);if(!h(i))return i}let i=t.valueOf;if(d(i)){let e=i.call(t);if(!h(e))return e}}else{let e=t.valueOf;if(d(e)){let i=e.call(t);if(!h(i))return i}let i=t.toString;if(d(i)){let e=i.call(t);if(!h(e))return e}}throw TypeError()}(t,e)}(t);return"symbol"==typeof e?e:""+e}function d(t){return"function"==typeof t}function c(t){let e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s||e!==s)return e;let i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;let a=r.constructor;return"function"!=typeof a||a===t?e:a}
2t("defineMetadata",function(t,e,i,s){var r,a;if(!h(i))throw TypeError();return r=t,a=e,void n(i,s,!0).set(r,a)}),t("hasMetadata",function(t,e,i){if(!h(e))throw TypeError();return o(i)||(i=u(i)),function t(e,i,s){if(l(e,i,s))return!0;let r=c(i);return null!==r&&t(e,r,s)}(t,e,i)}),t("hasOwnMetadata",function(t,e,i){if(!h(e))throw TypeError();return o(i)||(i=u(i)),l(t,e,i)}),t("getMetadata",function(t,e,i){if(!h(e))throw TypeError();return o(i)||(i=u(i)),function t(e,i,s){if(l(e,i,s)){var r=e,a=i,h=s;let t=n(a,h,!1);return o(t)?void 0:t.get(r)}let u=c(i);return null===u?void 0:t(e,u,s)}(t,e,i)})}(function(t,e){"function"!=typeof o5[t]&&Object.defineProperty(o5,t,{configurable:!0,writable:!0,value:e}),o4&&o4(t,e)}),o5);function ej(){return function(t){return eH.defineMetadata(ez,null,t),t}}class eV{constructor(t,e){this.key=t,this.value=e}toString(){return"named"===this.key?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function eN(t){return(e,i,s)=>{var r;let a,n;r=s.toString(),a={},eH.hasOwnMetadata(eF,e)&&(a=eH.getMetadata(eF,e)),void 0===(n=a[r])&&(n=[]),n.push(t),a[r]=n,eH.defineMetadata(eF,a,e)}}function eW(t){return e=>(i,s,r)=>eN(new eV(t,e))(i,s,r)}let eU=eW("inject");function eG(t){return eN(new eV("named",t))}let eY=Symbol("ContributionProvider");class e${constructor(t,e){this.serviceIdentifier=t,this.container=e,eK.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function eX(t,e){t(eY).toDynamicValue(({container:t})=>new e$(e,t)).inSingletonScope().whenTargetNamed(e)}class eK{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach(t=>{t.refresh()})}}eK.store=new Map;class eq{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){let 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 Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw Error("Missing name for tap");return Object.assign({type:t,fn:i},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--;let t=this.taps[s];this.taps[s+1]=t;let r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){s++;break}}this.taps[s]=t}}class eZ extends eq{call(...t){this.taps.map(t=>t.fn).forEach(e=>e(...t))}}let eJ=Symbol.for("EnvContribution"),eQ=Symbol.for("VGlobal"),e0="Singleton",e1="Transient",e2="ConstantValue",e3="Instance";class e5{constructor(t,e){this.id=eI.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(){let t=new e5(this.serviceIdentifier,this.scope);return t.activated=t.scope===e0&&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 e4{getConstructorMetadata(t){return{compilerGeneratedMetadata:eH.getMetadata(ez,t),userGeneratedMetadata:eH.getMetadata(eF,t)||{}}}getPropertiesMetadata(t){throw Error("ææªå®ç°")}}let e8=(p="named",t=>{let e=e=>{if(null==e)return!1;if(e.key===p&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;let i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===p&&i[e].value===t)return!0;return!1};return e.metaData=new eV(p,t),e});class e6{constructor(t){this._binding=t}inRequestScope(){throw Error("ææªå®ç°")}inSingletonScope(){return this._binding.scope=e0,this}inTransientScope(){return this._binding.scope=e1,this}whenTargetNamed(t){return this._binding.constraint=e8(t),this}}class e9{constructor(t){this._binding=t}to(t){return this._binding.type=e3,this._binding.implementationType=t,new e6(this._binding)}toSelf(){let t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type="DynamicValue",this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new e6(this._binding)}toConstantValue(t){return this._binding.type=e2,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=e0,new e6(this._binding)}toFactory(t){return this._binding.type="Factory",this._binding.factory=t,this._binding.scope=e0,new e6(this._binding)}toService(t){this.toDynamicValue(e=>e.container.get(t))}}let e7=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||e1,this.options=e,this.id=eI.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new e4}load(t){let e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){let e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){let e=this._getAllArgs(t);return this._get(e)}
2getTagged(t,e,i){let s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,"named",e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){let e=new e5(t,this.options.defaultScope),i=this._bindingDictionary.get(t)||[];return i.push(e),this._bindingDictionary.set(t,i),new e9(e)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){let t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{let s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),r=e=>i=>{let s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:r(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){let 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){let e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),r=[];for(let t=0;t<s.length;t++){let e=i[t],s={};e.forEach(t=>{s[t.key]=t.value});let a={inject:s.inject,multiInject:s[eD]},n=a.inject||a.multiInject,l={serviceIdentifier:n,constructorArgsMetadata:e},o=(this._bindingDictionary.get(n)||[]).filter(t=>t.constraint(l));if(o.length){let t={injectIdentifier:n,metadata:e,bindings:o};r.push(t)}}return r}_resolveFromBinding(t){let e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case e2:case"Function":e=t.cache;break;case e3:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;let 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===e0&&(t.cache=e,t.activated=!0)}},it=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let ie=new class{get renderService(){return this._renderService||(this._renderService=e7.get(it)),this._renderService}},ii=0;class is{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;let e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach(e=>e(t))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=ie.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++ii,t),this.tryRunAnimationFrameNextFrame(),ii}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}}class ir{constructor(){this._listenerMap=new Map,this._eventListenerTransformer=t=>t}setEventListenerTransformer(t){this._eventListenerTransformer=t||(t=>t)}addEventListener(t,e,i){if(!e)return;let s=this._resolveCapture(i),r=this._resolveOnce(i),a=this._getOrCreateListenerTypeMap(t),n=this._getOrCreateWrappedMap(a,e);if(n.has(s))return;let l=i=>{let a=this._eventListenerTransformer(i);"function"==typeof e?e(a):e.handleEvent&&e.handleEvent(a),r&&this._deleteListenerRecord(t,e,s)};n.set(s,{wrappedListener:l,options:i}),this._nativeAddEventListener(t,l,i)}removeEventListener(t,e,i){var s,r;if(!e)return;let a=this._resolveCapture(i),n=null==(r=null==(s=this._listenerMap.get(t))?void 0:s.get(e))?void 0:r.get(a);n&&(this._nativeRemoveEventListener(t,n.wrappedListener,a),this._deleteListenerRecord(t,e,a))}dispatchEvent(t){return this._nativeDispatchEvent(t)}
2clearAllEventListeners(){this._listenerMap.forEach((t,e)=>{t.forEach(t=>{t.forEach((t,i)=>{this._nativeRemoveEventListener(e,t.wrappedListener,i)})})}),this._listenerMap.clear()}_resolveCapture(t){return"boolean"==typeof t?t:!!(null==t?void 0:t.capture)}_resolveOnce(t){return"object"==typeof t&&!!(null==t?void 0:t.once)}_getOrCreateListenerTypeMap(t){let e=this._listenerMap.get(t);return e||(e=new Map,this._listenerMap.set(t,e)),e}_getOrCreateWrappedMap(t,e){let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_deleteListenerRecord(t,e,i){let s=this._listenerMap.get(t);if(!s)return;let r=s.get(e);r&&(r.delete(i),0===r.size&&s.delete(e),0===s.size&&this._listenerMap.delete(t))}_nativeAddEventListener(t,e,i){throw Error("_nativeAddEventListener must be implemented by derived classes")}_nativeRemoveEventListener(t,e,i){throw Error("_nativeRemoveEventListener must be implemented by derived classes")}_nativeDispatchEvent(t){throw Error("_nativeDispatchEvent must be implemented by derived classes")}}var ia=function(t,e){return function(i,s){e(i,s,t)}};let il=class extends ir{get env(){return this._env}get isImageAnonymous(){return this._isImageAnonymous}set isImageAnonymous(t){this._isImageAnonymous=t}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){super(),this.contributions=t,this._isImageAnonymous=!0,this._performanceRAFList=[],this.eventListenerTransformer=t=>t,this.id=eI.GenAutoIncrementId(),this.hooks={onSetEnv:new eZ(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}_nativeAddEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}bindContribution(t){let e=[];
2if(this.contributions.getContributions().forEach(i=>{let 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){let i=this._env;this._env=t;let 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)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getSpecifiedRequestAnimationFrame(t){this._env||this.setEnv("browser"),this._performanceRAFList[t]||(this._performanceRAFList[t]=new is);let e=this._performanceRAFList[t];return t=>e.addAnimationFrameCb(t)}getSpecifiedCancelAnimationFrame(t){if(this._env||this.setEnv("browser"),!this._performanceRAFList[t])return()=>!1;let e=this._performanceRAFList[t];return t=>e.removeAnimationFrameCb(t)}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)}loadFont(t,e,i){var s,r,a,n;return s=this,r=void 0,a=void 0,n=function*(){return this._env||this.setEnv("browser"),this.envContribution.loadFont(t,e,i)},new(a||(a=Promise))(function(t,e){function i(t){try{o(n.next(t))}catch(t){e(t)}}function l(t){try{o(n.throw(t))}catch(t){e(t)}}function o(e){var s;e.done?t(e.value):((s=e.value)instanceof a?s:new a(function(t){t(s)})).then(i,l)}o((n=n.apply(s,r||[])).next())})}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)}isMacOS(){return this._env||this.setEnv("browser"),this.envContribution.isMacOS()}copyToClipBoard(t){return this._env||this.setEnv("browser"),this.envContribution.copyToClipBoard(t)}};
2il=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),ia(0,eU(eY)),ia(0,eG(eJ)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],il),(o7=hg||(hg={}))[o7.estimate=0]="estimate",o7[o7.actualBounding=1]="actualBounding",o7[o7.fontBounding=2]="fontBounding";let io=Math.PI,ih=io/2,iu=2*io,id=2*Math.PI,ic=Math.abs,ip=Math.atan2,ig=Math.cos,im=Math.max,i_=Math.min,iy=Math.sin,iv=Math.sqrt,ib=Math.pow;function ix(t){return t>=1?ih:t<=-1?-ih:Math.asin(t)}function iS(t,e,i,s,r){let a=i,n=s;return"number"==typeof t&&"number"==typeof i&&(a=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof s&&(n=(1-r)*e+r*s),{x:a,y:n}}function iA(t,e){return t[0]*e[1]-t[1]*e[0]}function ik(t,e=10){return Math.round(t*e)/e}function iM(t){let e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}function iw(t,e){return ik(t+e,10**Math.max(iM(t),iM(e)))}function iT(t,e){return ik(t-e,10**Math.max(iM(t),iM(e)))}function iC(t){return Math.PI/180*t}function iB(t){return 180*t/Math.PI}function iE(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 iP(t,e={x:0,y:0},i=0,s=2*Math.PI){let{x:r,y:a}=t,{x:n,y:l}=e,o=r-n,h=a-l,u=Math.sqrt(o*o+h*h);if(0===u)return{radius:0,angle:0};o/=u;let d=Math.atan2(h/=u,o);if(d<i)for(;d<=i;)d+=2*Math.PI;if(d>s)for(;d>=s;)d-=2*Math.PI;return{radius:u,angle:d}}function iO(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function iR(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function iI(t){return(t=iR(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 iL{constructor(t=1,e=0,i=0,s=1,r=0,a=0){this.a=t,this.b=e,this.c=i,this.d=s,this.e=r,this.f=a}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,r,a){return this.e===r&&this.f===a&&this.a===t&&this.d===s&&this.b===e&&this.c===i}setValue(t,e,i,s,r,a){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=r,this.f=a,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){let t=this.a,e=this.b,i=this.c,s=this.d,r=this.e,a=this.f,n=new iL,l=t*s-e*i;return n.a=s/l,n.b=-e/l,n.c=-i/l,n.d=t/l,n.e=(i*a-s*r)/l,n.f=-(t*a-e*r)/l,n}rotate(t){let e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,r=this.b*e+this.d*i,a=-(this.a*i)+this.c*e,n=-(this.b*i)+this.d*e;return this.a=s,this.b=r,this.c=a,this.d=n,this}rotateByCenter(t,e,i){let s=Math.cos(t),r=Math.sin(t),a=s*this.a-r*this.b,n=r*this.a+s*this.b,l=s*this.c-r*this.d,o=r*this.c+s*this.d,h=s*this.e-r*this.f+((1-s)*e+r*i),u=r*this.e+s*this.f+((1-s)*i-r*e);return this.a=a,this.b=n,this.c=l,this.d=o,this.e=h,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,r,a){return this.multiply(t,e,i,s,r,a),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){let{a:t,b:e,c:i,d:s,e:r,f:a}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=a,this.f=r,this}multiply(t,e,i,s,r,a){let n=this.a,l=this.b,o=this.c,h=this.d,u=n*r+o*a+this.e,d=l*r+h*a+this.f;return this.a=n*t+o*e,this.b=l*t+h*e,this.c=n*i+o*s,this.d=l*i+h*s,this.e=u,this.f=d,this}interpolate(t,e){let i=new iL;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){let{a:i,b:s,c:r,d:a,e:n,f:l}=this,o=i*a-s*r,{x:h,y:u}=t;e.x=a/o*h+-r/o*u+(r*l-a*n)/o,e.y=-s/o*h+i/o*u+-(i*l-s*n)/o}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new iL(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){let t=this.a,e=this.b,i=this.c,s=this.d,r=t*s-e*i,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){let n=Math.sqrt(t*t+e*e);a.rotateDeg=e>0?Math.acos(t/n):-Math.acos(t/n),a.scaleX=n,a.scaleY=r/n,a.skewX=(t*i+e*s)/r,a.skewY=0}else if(0!==i||0!==s){let n=Math.sqrt(i*i+s*s);a.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/n):-Math.acos(i/n)),a.scaleX=r/n,a.scaleY=n,a.skewX=0,a.skewY=(t*i+e*s)/r}return a.rotateDeg=iB(a.rotateDeg),a}}let iD=iu-1e-8;class iF{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,r,a){if(Math.abs(r-s)>iD)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let n,l,o,h,u=1/0,d=-1/0,c=1/0,p=-1/0;function g(t){o=i*Math.cos(t),h=i*Math.sin(t),o<u&&(u=o),o>d&&(d=o),h<c&&(c=h),h>p&&(p=h)}if(g(s),g(r),r!==s)if((s%=iu)<0&&(s+=iu),(r%=iu)<0&&(r+=iu),r<s&&(a=!a,n=s,s=r,r=n),a)for(r-=iu,n=s-s%ih,l=0;l<4&&n>r;++l,n-=ih)g(n);else for(n=s-s%ih+ih,l=0;l<4&&n<r;++l,n+=ih)g(n);this.bounds.add(t+u,e+c),this.bounds.add(t+d,e+p)}arcTo(t,e,i,s,r){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,r,a){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(r,a)}closePath(){}ellipse(){throw Error("䏿¯æellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(){}}function iz(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function iH(t,e,i,s){let r=t[0],a=e[0],n=i[0],l=s[0];
2return a<r&&([r,a]=[a,r]),l<n&&([l,n]=[n,l]),!(a<n||l<r)&&(r=t[1],a=e[1],n=i[1],l=s[1],a<r&&([r,a]=[a,r]),l<n&&([l,n]=[n,l]),!(a<n||l<r))}function ij(t,e,i,s){if(!iH(t,e,i,s))return!1;let r=[0,0],a=[0,0],n=[0,0];if(iz(r,e,t),iz(a,s,i),ic(r[0]-a[0])+ic(r[1]-a[1])<1e-12)return!0;iz(n,i,t);let l=iA(n,a)/iA(r,a);return l>=0&&l<=1&&[t[0]+r[0]*l,t[1]+r[1]*l]}function iV(t,e,i){if(null===t)return e;if(null===e)return t;let{x11:s,x12:r,y11:a,y12:n,x21:l,x22:o,y21:h,y22:u}=iN(t,e,i);return s>=o||r<=l||a>=u||n<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,l),y1:Math.max(a,h),x2:Math.min(r,o),y2:Math.min(n,u)}}(ht=hf||(hf={}))[ht.NONE=0]="NONE",ht[ht.BBOX1=1]="BBOX1",ht[ht.BBOX2=2]="BBOX2";let iN=(t,e,i)=>{let s=t.x1,r=t.x2,a=t.y1,n=t.y2,l=e.x1,o=e.x2,h=e.y1,u=e.y2;return i&&(s>r&&([s,r]=[r,s]),a>n&&([a,n]=[n,a]),l>o&&([l,o]=[o,l]),h>u&&([h,u]=[u,h])),{x11:s,x12:r,y11:a,y12:n,x21:l,x22:o,y21:h,y22:u}};function iW(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);let{x11:s,x12:r,y11:a,y12:n,x21:l,x22:o,y21:h,y22:u}=iN(t,e,!0);return!(s>o||r<l||a>u||n<h)}return!0}function iU(t,e,i){if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,r=e.x2,a=e.y1,n=e.y2;return s>r&&([s,r]=[r,s]),a>n&&([a,n]=[n,a]),t.x>=s&&t.x<=r&&t.y>=a&&t.y<=n}function iG(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function iY({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 i$(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function iX(t,e){let i=e?iC(t.angle):t.angle,s=i$(t);return[iY({x:t.x1,y:t.y1},i,s),iY({x:t.x2,y:t.y1},i,s),iY({x:t.x2,y:t.y2},i,s),iY({x:t.x1,y:t.y2},i,s)]}function iK(t,e,i=!1){let s=iX(t,i),r=iX(e,i),a=(t,e)=>[e.x-t.x,e.y-t.y],n=a(i$(t),i$(e)),l=a(s[0],s[1]),o=a(s[1],s[2]),h=a(r[0],r[1]),u=a(r[1],r[2]),d=i?iC(t.angle):t.angle,c=i?iC(90-t.angle):t.angle+ih,p=i?iC(e.angle):e.angle,g=i?iC(90-e.angle):e.angle+ih;c>id&&(c-=id),g>id&&(g-=id);let f=(t,e,i,s)=>{let r=[Math.cos(e),Math.sin(e)];return t+(iG(r,i)+iG(r,s))/2>iG(r,n)};return f((t.x2-t.x1)/2,d,h,u)&&f((t.y2-t.y1)/2,c,h,u)&&f((e.x2-e.x1)/2,p,l,o)&&f((e.y2-e.y1)/2,g,l,o)}function iq(t,e,i){let{x1:s,y1:r,x2:a,y2:n}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f)):(t.clear(),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*a+i.c*r+i.e,i.b*a+i.d*r+i.f),t.add(i.a*a+i.c*n+i.e,i.b*a+i.d*n+i.f),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f)),e}class iZ{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new iZ(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 i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),s<e?(this.y2=e,this.y1=s):(this.y1=e,this.y2=s),this}add(t=0,e=0){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return(0,ev.A)(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){let 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){let r=this.scalePoints(t,e,i,s);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(t=0,e=0){return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return iq(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){let{x1:s,y1:r,x2:a,y2:n}=this,l=Math.cos(t),o=Math.sin(t),h=e-e*l+i*o,u=i-e*o-i*l;return[l*s-o*r+h,o*s+l*r+u,l*s-o*n+h,o*s+l*n+u,l*a-o*r+h,o*a+l*r+u,l*a-o*n+h,o*a+l*n+u]}scalePoints(t,e,i,s){let{x1:r,y1:a,x2:n,y2:l}=this;return[t*r+(1-t)*i,e*a+(1-e)*s,t*n+(1-t)*i,e*l+(1-e)*s]}}class iJ extends iZ{}class iQ extends iZ{constructor(t,e=0){var i;super(t),t&&(this.angle=null!=(i=t.angle)?i:e)}intersects(t){return iK(this,t)}setValue(t=0,e=0,i=0,s=0,r=0){return super.setValue(t,e,i,s),this.angle=r,this}clone(){return new iQ(this)}getRotatedCorners(){let t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[iY({x:this.x1,y:this.y1},this.angle,t),iY({x:this.x2,y:this.y1},this.angle,t),iY({x:this.x1,y:this.y2},this.angle,t),iY({x:this.x2,y:this.y2},this.angle,t)]}}class i0{constructor(){this._curves=[],this.bounds=new iJ}get curves(){return this._curves}getCurveLengths(){return this._curves.map(t=>t.getLength())}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}let i1=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,i2={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};
2function i3(t,e,i,s){let r=function(t,e,i,s,r,a,n,l,o){let h=iC(n),u=Math.sin(h),d=Math.cos(h),c=d*(l-t)*.5+u*(o-e)*.5,p=d*(o-e)*.5-u*(l-t)*.5,g=c*c/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(i*=g=Math.sqrt(g),s*=g);let f=d/i,m=u/i,_=-u/s,y=d/s,v=f*l+m*o,b=_*l+y*o,x=f*t+m*e,S=_*t+y*e,A=1/((x-v)*(x-v)+(S-b)*(S-b))-.25;A<0&&(A=0);let k=Math.sqrt(A);a===r&&(k=-k);let M=.5*(v+x)-k*(S-b),w=.5*(b+S)+k*(x-v),T=Math.atan2(b-w,v-M),C=Math.atan2(S-w,x-M)-T;C<0&&1===a?C+=iu:C>0&&0===a&&(C-=iu);let B=Math.ceil(Math.abs(C/(ih+.001))),E=[];for(let t=0;t<B;++t){let e=T+t*C/B,r=T+(t+1)*C/B;E[t]=[M,w,e,r,i,s,u,d]}return E}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<r.length;++e){let i=function(t){let e=t[0],i=t[1],s=t[2],r=t[3],a=t[4],n=t[5],l=t[6],o=t[7],h=o*a,u=-l*n,d=l*a,c=o*n,p=Math.cos(s),g=Math.sin(s),f=Math.cos(r),m=Math.sin(r),_=.5*(r-s),y=Math.sin(.5*_),v=8/3*y*y/Math.sin(_),b=e+p-v*g,x=i+g+v*p,S=e+f,A=i+m,k=S+v*m,M=A-v*f;return[h*b+u*x,d*b+c*x,h*k+u*M,d*k+c*M,h*S+u*A,d*S+c*A]}(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}(he=hm||(hm={}))[he.NONE=0]="NONE",he[he.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",he[he.UPDATE_SHAPE=2]="UPDATE_SHAPE",he[he.CLEAR_SHAPE=253]="CLEAR_SHAPE",he[he.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",he[he.INIT=179]="INIT",he[he.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",he[he.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",he[he.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",he[he.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",he[he.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",he[he.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",he[he.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",he[he.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",(hi=h_||(h_={}))[hi.GLOBAL=1]="GLOBAL",hi[hi.LOCAL=16]="LOCAL",hi[hi.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",hi[hi.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",(hs=hy||(hy={}))[hs.INIT=0]="INIT",hs[hs.DEFAULT=1]="DEFAULT",hs[hs.STATE=2]="STATE",hs[hs.ANIMATE_BIND=10]="ANIMATE_BIND",hs[hs.ANIMATE_PLAY=11]="ANIMATE_PLAY",hs[hs.ANIMATE_START=12]="ANIMATE_START",hs[hs.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",hs[hs.ANIMATE_END=14]="ANIMATE_END",hs[hs.TRANSLATE=20]="TRANSLATE",hs[hs.TRANSLATE_TO=21]="TRANSLATE_TO",hs[hs.SCALE=22]="SCALE",hs[hs.SCALE_TO=23]="SCALE_TO",hs[hs.ROTATE=24]="ROTATE",hs[hs.ROTATE_TO=25]="ROTATE_TO",(hr=hv||(hv={}))[hr.ROW=1]="ROW",hr[hr.COLUMN=2]="COLUMN",(ha=hb||(hb={}))[ha.CubicBezierCurve=0]="CubicBezierCurve",ha[ha.QuadraticBezierCurve=1]="QuadraticBezierCurve",ha[ha.ArcCurve=2]="ArcCurve",ha[ha.LineCurve=3]="LineCurve",ha[ha.EllipseCurve=4]="EllipseCurve",ha[ha.MoveCurve=5]="MoveCurve",(hn=hx||(hx={}))[hn.beforeFillStroke=0]="beforeFillStroke",hn[hn.afterFillStroke=1]="afterFillStroke";let i5=[(t,e,i,s,r,a,n)=>e.arc(t[1]*r+i,t[2]*a+s,t[3]*(r+a)/2,t[4],t[5],t[6],n),(t,e,i,s,r,a,n)=>e.arcTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,t[5]*(r+a)/2,n),(t,e,i,s,r,a,n)=>e.bezierCurveTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,t[5]*r+i,t[6]*a+s,n),(t,e,i,s)=>e.closePath(),(t,e,i,s,r,a)=>e.ellipse(t[1]*r+i,t[2]*a+s,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8]),(t,e,i,s,r,a,n)=>e.lineTo(t[1]*r+i,t[2]*a+s,n),(t,e,i,s,r,a,n)=>e.moveTo(t[1]*r+i,t[2]*a+s,n),(t,e,i,s,r,a,n)=>e.quadraticCurveTo(t[1]*r+i,t[2]*a+s,t[3]*r+i,t[4]*a+s,n),(t,e,i,s,r,a,n)=>e.rect(t[1]*r+i,t[2]*a+s,t[3]*r,t[4]*a,n)];function i4(t,e,i=0,s=0,r=1,a=1,n){for(let l=0;l<t.length;l++){let o=t[l];i5[o[0]](o,e,i,s,r,a,n)}}class i8{constructor(t=0,e=0,i,s){this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=s}clone(){return new i8(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return ed(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return ed(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw Error("æä¸æ¯æ")}div(t){throw Error("æä¸æ¯æ")}}class i6{static distancePP(t,e){return iv(ib(t.x-e.x,2)+ib(t.y-e.y,2))}static distanceNN(t,e,i,s){return iv(ib(t-i,2)+ib(e-s,2))}static distancePN(t,e,i){return iv(ib(e-t.x,2)+ib(i-t.y,2))}static pointAtPP(t,e,i){return new i8((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}class i9{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function i7(t,e){let{p0:i,p1:s}=t,r=i6.pointAtPP(i,s,e);return[new st(i,r),new st(r,s)]}class st extends i9{constructor(t,e){super(),this.type=hb.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i6.pointAtPP(this.p0,this.p1,t);throw Error("defined为falseçç¹ä¸è½getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=ip(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}
2calcLength(){return this._validPoint()?i6.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===hv.ROW?ic(this.p0.x-this.p1.x):t===hv.COLUMN?ic(this.p0.y-this.p1.y):0}draw(t,e,i,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+i),a>=1)t.lineTo(this.p1.x*s+e,this.p1.y*r+i);else if(a>0){let n=this.getPointAt(a);t.lineTo(n.x*s+e,n.y*r+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);let s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}function se(t,e){let i=0,s=t.length;for(let r=0;r<s;r++){let a=t[r],n=e[r],l=t[(r+1)%s],o=e[(r+1)%s];i+=i6.distanceNN(a,n,l,o)}return i/2}function si(t,e,i,s,r){let a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+s*r*r*r}function ss(t,e,i,s,r){return new i8(si(t.x,e.x,i.x,s.x,r),si(t.y,e.y,i.y,s.y,r))}function sr(t,e,i,s){let r=1-s;return r*r*t+2*r*s*e+s*s*i}function sa(t,e,i,s){return new i8(sr(t.x,e.x,i.x,s),sr(t.y,e.y,i.y,s))}function sn(t,e){let{p0:i,p1:s,p2:r,p3:a}=t,n=ss(i,s,r,a,e),l=i6.pointAtPP(i,s,e),o=i6.pointAtPP(s,r,e),h=i6.pointAtPP(r,a,e),u=i6.pointAtPP(l,o,e),d=i6.pointAtPP(o,h,e);return[new sl(i,l,u,n),new sl(n,d,h,a)]}class sl extends i9{constructor(t,e,i,s){super(),this.type=hb.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return ss(this.p0,this.p1,this.p2,this.p3,t);throw Error("defined为falseçç¹ä¸è½getPointAt")}calcLength(){var t,e,i,s;return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,se([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60}calcProjLength(t){return t===hv.ROW?ic(this.p0.x-this.p3.x):t===hv.COLUMN?ic(this.p0.y-this.p3.y):0}getAngleAt(t){let e=im(t-.01,0),i=i_(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(i);return ip(r.y-s.y,r.x-s.x)}draw(t,e,i,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+i),a>=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*r+i,this.p2.x*s+e,this.p2.y*r+i,this.p3.x*s+e,this.p3.y*r+i);else if(a>0){let[n]=sn(this,a);t.bezierCurveTo(n.p1.x*s+e,n.p1.y*r+i,n.p2.x*s+e,n.p2.y*r+i,n.p3.x*s+e,n.p3.y*r+i)}}includeX(t){let e=i_(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=im(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){let e=i_(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(im(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class so extends i9{constructor(t,e,i){super(),this.type=hb.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return sa(this.p0,this.p1,this.p2,t);throw Error("defined为falseçç¹ä¸è½getPointAt")}calcLength(){var t,e,i;return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,se([t.x,e.x,i.x],[t.y,e.y,i.y])):60}calcProjLength(t){return t===hv.ROW?ic(this.p0.x-this.p2.x):t===hv.COLUMN?ic(this.p0.y-this.p2.y):0}getAngleAt(t){let e=im(t-.01,0),i=i_(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(i);return ip(r.y-s.y,r.x-s.x)}draw(t,e,i,s,r,a){if(t.moveTo(this.p0.x*s+e,this.p0.y*r+i),a>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*r+i,this.p2.x*s+e,this.p2.y*r+i);else if(a>0){let[n]=function(t,e){let{p0:i,p1:s,p2:r}=t,a=sa(i,s,r,e),n=i6.pointAtPP(i,s,e),l=i6.pointAtPP(s,r,e);return[new so(i,n,a),new so(a,l,r)]}(this,a);t.quadraticCurveTo(n.p1.x*s+e,n.p1.y*r+i,n.p2.x*s+e,n.p2.y*r+i)}}getYAt(t){throw Error("QuadraticBezierCurveæä¸æ¯ægetYAt")}includeX(t){throw Error("QuadraticBezierCurveæä¸æ¯æincludeX")}}class sh{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){let i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new st(new i8(this._lastX,this._lastY),new i8(t,e))}quadraticCurveTo(t,e,i,s){let r=new so(new i8(this._lastX,this._lastY),new i8(t,e),new i8(i,s));this.path.addCurve(r),this._lastX=i,this._lastY=s}
2bezierCurveTo(t,e,i,s,r,a){let n=new sl(new i8(this._lastX,this._lastY),new i8(t,e),new i8(i,s),new i8(r,a));this.path.addCurve(n),this._lastX=r,this._lastY=a}arcTo(t,e,i,s,r){throw Error("CurveContext䏿¯æè°ç¨arcTo")}ellipse(t,e,i,s,r,a,n,l){throw Error("CurveContext䏿¯æè°ç¨ellipse")}rect(t,e,i,s){throw Error("CurveContext䏿¯æè°ç¨rect")}arc(t,e,i,s,r,a){throw Error("CurveContext䏿¯æè°ç¨arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}class su{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,r,a,n,l){let o=new sl(new i8(this._lastX,this._lastY),new i8(t,e),new i8(i,s),new i8(r,a));o.originP1=this._lastOriginP,o.originP2=l,o.defined=n,this.curves.push(o),this._lastX=r,this._lastY=a,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;let t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw Error("SegContext䏿¯æè°ç¨ellipse")}lineTo(t,e,i,s){let r=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw Error("SegContext䏿¯æè°ç¨quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,r){let a=new st(new i8(this._lastX,this._lastY),new i8(t,e));return a.originP1=s,a.originP2=r,a.defined=i,a}getPointAt(t){throw Error("ææªå®ç°")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===hv.COLUMN){if(!this.curves.length)return 0;let t=this.curves[0],i=this.curves[this.curves.length-1],s=null!=(e=i.p3)?e:i.p1;return ic(t.p0.y-s.y)}if(t===hv.ROW){if(!this.curves.length)return 0;let t=this.curves[0],e=this.curves[this.curves.length-1],s=null!=(i=e.p3)?i:e.p1;return ic(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((t,e)=>t+e.getLength(),0)),this.length}}class sd extends su{bezierCurveTo(t,e,i,s,r,a,n,l){return super.bezierCurveTo(e,t,s,i,a,r,n,l)}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 sc(t,e,i=1){let s=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function sp(t,e,i){let s=null!=e?e:ic(i[i.length-1].x-i[0].x)>ic(i[i.length-1].y-i[0].y)?hv.ROW:hv.COLUMN;return"monotoneY"===t?new sd(t,s):new su(t,s)}class sg{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){let 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 sf(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;let r=sp("linear",i,t);return sc(new sg(r,s),t,1),r}function sm(t,e,i,s,r){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 s_{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&&sm(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){let 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:sm(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}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 sy(t,e,i){let s=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(s||Number(r<0&&-0)),n=(i-t._y1)/(r||Number(s<0&&-0));return((a<0?-1:1)+(n<0?-1:1))*Math.min(Math.abs(a),Math.abs(n),.5*Math.abs((a*r+n*s)/(s+r)))||0}function sv(t,e){let i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}
2function sb(t,e,i,s,r){let a=t._x0,n=t._y0,l=t._x1,o=t._y1,h=(l-a)/3;t.context.bezierCurveTo(a+h,n+h*e,l-h,o-h*i,l,o,s,t.lastPoint1)}class sx{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:sb(this,this._t0,sv(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,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,sb(this,sv(this,e=sy(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2,t);break;default:sb(this,this._t0,e=sy(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}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 sS extends sx{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}class sA{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){let 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{let s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class sk extends sA{lineEnd(){this.context.closePath()}}function sM(t,e,i={}){let{direction:s,startPoint:r}=i;if(t.length<2-Number(!!r))return null;let a=new su("step",null!=s?s:ic(t[t.length-1].x-t[0].x)>ic(t[t.length-1].y-t[0].y)?hv.ROW:hv.COLUMN);return sc(new sA(a,e,r),t,1),a}class sw extends sg{lineEnd(){this.context.closePath()}}function sT(t,e,i,s,r){let a=t._x1,n=t._y1,l=t._x2,o=t._y2;if(t._l01_a>1e-12){let e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);a=(a*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,n=(n*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){let s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*s+t._x1*t._l23_2a-e*t._l12_2a)/r,o=(o*s+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(a,n,l,o,t._x2,t._y2,s,t.lastPoint1)}function sC(t,e){return function(i,s,r={}){let{direction:a,startPoint:n}=r;if(i.length<2-Number(!!n))return null;if(i.length<3-Number(!!n))return sf(i,r);let l=sp(t,a,i);return sc(new e(l,s,n),i,2),l}}let sB=sC("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){let{x:e,y:i}=t;if(this._point){let 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:sT(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}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()}}),sE=sC("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){let{x:e,y:i}=t;if(this._point){let 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:sT(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t)}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 sP(t,e,i){var s,r;switch(e){case"linear":default:return sf(t,i);case"basis":return function(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return sf(t,e);let r=sp("basis",i,t);return sc(new s_(r,s),t,2),r}(t,i);case"monotoneX":return function(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return sf(t,e);let r=sp("monotoneX",i,t);return sc(new sx(r,s),t,2),r}(t,i);case"monotoneY":return function(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return sf(t,e);let r=sp("monotoneY",i,t);return sc(new sS(r,s),t,2),r}(t,i);case"step":return sM(t,.5,i);case"stepClosed":return function(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;let r=new su("step",null!=i?i:ic(t[t.length-1].x-t[0].x)>ic(t[t.length-1].y-t[0].y)?hv.ROW:hv.COLUMN);return sc(new sk(r,.5,s),t,1),r}(t,i);case"stepBefore":return sM(t,0,i);case"stepAfter":return sM(t,1,i);case"catmullRom":return sB(t,null!=(s=null==i?void 0:i.curveTension)?s:.5,i);case"catmullRomClosed":return sE(t,null!=(r=null==i?void 0:i.curveTension)?r:.5,i);case"linearClosed":return function(t,e={}){let{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;let r=sp("linear",i,t);return sc(new sw(r,s),t,1),r}(t,i)}}class sO extends i0{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new iF(this.bounds)}get curves(){return this.tryBuildCurves()}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,r,a){return this.commandList.push([2,t,e,i,s,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,r,a),this}arcTo(t,e,i,s,r){return this.commandList.push([1,t,e,i,s,r]),this._ctx&&this._ctx.arcTo(t,e,i,s,r),this}ellipse(t,e,i,s,r,a,n,l){return this.commandList.push([4,t,e,i,s,r,a,n,l]),this._ctx&&this._ctx.ellipse(t,e,i,s,r,a,n,l),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,r,a){return this.commandList.push([0,t,e,i,s,r,a]),this._ctx&&this._ctx.arc(t,e,i,s,r,a),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()}tryBuildCurves(){if(!this._curves||!this._curves.length){let t=new sh(this);i4(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){let 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=>{let e=[],i=t[1],s=t[2],r=t[3];((t,e,i,s,r,a,n,l=!1)=>{let o=2*Math.PI,h=(e%o+o)%o,u,d=(i%o+o)%o;l?d>=h&&(d-=o):d<=h&&(d+=o);let c=Math.ceil(Math.abs(u=d-h)/(.5*Math.PI)),p=u/c;for(let e=0;e<c;e++){let i=h+p*e,o=h+p*(e+1),u=4/3*Math.tan(Math.abs(p)/4),d=Math.cos(i),c=Math.sin(i),g=Math.cos(o),f=Math.sin(o),m=d*a+s,_=c*n+r,y=g*a+s,v=f*n+r,b=l?-1:1,x=a*u*b,S=n*u*b;t.push(m-x*c,_+S*d,y+x*f,v-S*g,y,v)}})(e,t[4],t[5],i,s,r,r,t[6]);let a="";for(let t=0;t<e.length;t+=6)a+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return a},t[8]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[3]=t=>"Z",this.toStringCbList=t}let t=this.toStringCbList,e="";return this.commandList.forEach(i=>
2{e+=t[i[0]](i)}),e}fromString(t,e,i,o,h){this.clear();let u=function(t){let e,i;if(!t)return[];let o=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===o)return[];let h=[];for(let t=0,u=o.length;t<u;t++)if(r=(s=o[t]).slice(1),e=[a=s[0]],null!==(i=r.match(i1))){for(let t=0,s=i.length;t<s;t++)Number.isNaN(n=parseFloat(i[t]))||e.push(n);if(l=i2[a],e.length-1>l){let t,i=a;for(let s=1,r=e.length;s<r;s+=l){t=[i];for(let i=s,r=s+l;i<r;i++)t.push(e[i]);h.push(t),"m"===i?i="l":"M"===i&&(i="L")}}else h.push(e)}else h.push(e);return h}(t);return this._runCommandStrList(u,e,i,o,h),this._updateBounds(),this}fromLine(t){let{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;let r=sP(e,i);"x"===s?this.direction=hv.ROW:"y"===s?this.direction=hv.COLUMN:"auto"===s&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,i,s,r){return this.clear(),this._runCommandList(t.commandList,e,i,s,r),this._updateBounds(),this}transform(t,e,i,s){let r=this.commandList;if(!this.transformCbList){let t=[];t[6]=this.moveToTransform,t[5]=this.lineToTransform,t[7]=this.quadraticCurveToTransform,t[2]=this.bezierCurveToTransform,t[1]=this.arcToTransform,t[4]=this.ellipseTransform,t[8]=this.rectTransform,t[0]=this.arcTransform,t[3]=this.closePathTransform,this.transformCbList=t}r.forEach(r=>{this.transformCbList[r[0]](r,t,e,i,s)}),this._updateBounds()}moveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i,t[5]=t[5]*s+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s+e,t[4]=t[4]*r+i,t[5]=t[5]*(s+r)/2}ellipseTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s,t[4]=t[4]*r}rectTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*s,t[4]=t[4]*r}arcTransform(t,e,i,s,r){t[1]=t[1]*s+e,t[2]=t[2]*r+i,t[3]=t[3]*(s+r)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,r=1){let a,n,l,o,h,u=null,d=0,c=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(a=t[f],1===s&&1===r||(a=function(t,e,i){let s=sR[0]=t[0];if("a"===s||"A"===s)sR[1]=e*t[1],sR[2]=i*t[2],sR[3]=t[3],sR[4]=t[4],sR[5]=t[5],sR[6]=e*t[6],sR[7]=i*t[7];else if("h"===s||"H"===s)sR[1]=e*t[1];else if("v"===s||"V"===s)sR[1]=i*t[1];else for(let s=1,r=t.length;s<r;++s)sR[s]=(s%2==1?e:i)*t[s];return sR}(a,s,r)),a[0]){case"l":d+=a[1],c+=a[2],this.lineTo(d+e,c+i);break;case"L":d=a[1],c=a[2],this.lineTo(d+e,c+i);break;case"h":d+=a[1],this.lineTo(d+e,c+i);break;case"H":d=a[1],this.lineTo(d+e,c+i);break;case"v":c+=a[1],this.lineTo(d+e,c+i);break;case"V":c=a[1],this.lineTo(d+e,c+i);break;case"m":d+=a[1],c+=a[2],this.moveTo(d+e,c+i);break;case"M":d=a[1],c=a[2],this.moveTo(d+e,c+i);break;case"c":n=d+a[5],l=c+a[6],p=d+a[3],g=c+a[4],this.bezierCurveTo(d+a[1]+e,c+a[2]+i,p+e,g+i,n+e,l+i),d=n,c=l;break;case"C":d=a[5],c=a[6],p=a[3],g=a[4],this.bezierCurveTo(a[1]+e,a[2]+i,p+e,g+i,d+e,c+i);break;case"s":n=d+a[3],l=c+a[4],null===u[0].match(/[CcSs]/)?(p=d,g=c):(p=2*d-p,g=2*c-g),o=d+a[1],h=c+a[2],this.bezierCurveTo(p+e,g+i,o+e,h+i,n+e,l+i),p=o,g=h,d=n,c=l;break;case"S":n=a[3],l=a[4],null===u[0].match(/[CcSs]/)?(p=d,g=c):(p=2*d-p,g=2*c-g),o=a[1],h=a[2],this.bezierCurveTo(p+e,g+i,o+e,h+i,n+e,l+i),p=o,g=h,d=n,c=l;break;case"q":n=d+a[3],l=c+a[4],p=d+a[1],g=c+a[2],this.quadraticCurveTo(p+e,g+i,n+e,l+i),d=n,c=l;break;case"Q":n=a[3],l=a[4],this.quadraticCurveTo(a[1]+e,a[2]+i,n+e,l+i),d=n,c=l,p=a[1],g=a[2];break;case"t":n=d+a[1],l=c+a[2],null===u[0].match(/[QqTt]/)?(p=d,g=c):"t"===u[0]?(p=2*d-o,g=2*c-h):"q"===u[0]&&(p=2*d-p,g=2*c-g),o=p,h=g,this.quadraticCurveTo(p+e,g+i,n+e,l+i),d=n,c=l,p=d+a[1],g=c+a[2];break;case"T":n=a[1],l=a[2],p=2*d-p,g=2*c-g,this.quadraticCurveTo(p+e,g+i,n+e,l+i),d=n,c=l;break;case"a":i3(this,d+e,c+i,[a[1],a[2],a[3],a[4],a[5],a[6]+d+e,a[7]+c+i]),d+=a[6],c+=a[7];break;case"A":i3(this,d+e,c+i,[a[1],a[2],a[3],a[4],a[5],a[6]+e,a[7]+i]),d=a[6],c=a[7];break;case"z":case"Z":this.closePath()}u=a}}_runCommandList(t,e=0,i=0,s=1,r=1){if(0!==e||0!==i||1!==s||1!==r)for(let a=0,n=t.length;a<n;++a){let n=t[a].slice();switch(n[0]){case 5:this.lineToTransform(n,e,i,s,r);break;case 6:this.moveToTransform(n,e,i,s,r);break;case 2:this.bezierCurveToTransform(n,e,i,s,r);break;case 7:this.quadraticCurveToTransform(n,e,i,s,r);break;case 0:case 1:this.arcToTransform(n,e,i,s,r);break;case 4:this.ellipseTransform(n,e,i,s,r);break;case 8:this.rectTransform(n,e,i,s,r);break;case 3:this.closePath()}}else this.commandList=t.map(t=>t.slice())}_updateBounds(){this.bounds.clear(),i4(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===hv.COLUMN){if(!this._curves.length)return 0;let t=this._curves[0],e=this._curves[this._curves.length-1];return ic(t.p0.y-e.p1.y)}if(this.direction===hv.ROW){if(!this._curves.length)return 0;let t=this._curves[0],e=this._curves[this._curves.length-1];return ic(t.p0.x-e.p1.x)}return this._curves.reduce((t,e)=>t+e.getLength(),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){let i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){let r=(e=this._curves[s]).getLength(this.direction);if(i+r>=t)break;
2i+=r}let s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,r){this.tryBuildCurves();let a=this.getLength()*r,n=0;for(let r=0;r<this._curves.length;r++){let l=this._curves[r],o=l.getLength(this.direction);if(!(n+o<=a)){let r=1-(n+o-a)/o;l.draw(t,i,s,e,e,r);break}l.draw(t,i,s,e,e,1),n+=o}}}let sR=["l",0,0,0,0,0,0,0],sI={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new iL},sL={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},sD={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},sF=Object.assign({outerBorder:Object.assign(Object.assign({},sD),{distance:0}),innerBorder:Object.assign(Object.assign({},sD),{distance:0})},sD),sz={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,'-apple-system',segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"â¦",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:hg.fontBounding,keepCenterInLine:!1},sH=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,backgroundPosition:"top-left",blur:0,filter:"",cursor:null,html:null,react:null,vue:null},sL),sF),{alignSelf:"auto"}),{pickStrokeBuffer:0}),sj={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},sV=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),sH),sI),sN=Object.assign(Object.assign({},sV),{startAngle:0,endAngle:id,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),sW=Object.assign(Object.assign(Object.assign({},sV),sj),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),sU=Object.assign(Object.assign({},sV),{radius:1,startAngle:0,endAngle:id}),sG=Object.assign(Object.assign({},sV),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),sY=Object.assign(Object.assign({},sV),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),s$=Object.assign(Object.assign(Object.assign({},sV),sj),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),sX=Object.assign(Object.assign({},sV),{path:new sO,fillStrokeOrder:1,clipRange:1,customPath:()=>{eg.getInstance().warn("ç©ºå½æ°")}}),sK=Object.assign(Object.assign({},sV),{points:[],cornerRadius:0,closePath:!0}),sq=Object.assign(Object.assign({},sV),{width:100,height:100,spikes:5,thickness:.5}),sZ=Object.assign(Object.assign({},sV),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},sV),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});let sJ=Object.assign(Object.assign({},sV),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),sQ=Object.assign(Object.assign(Object.assign({},sV),sz),{strokeBoundsBuffer:0,keepDirIn3d:!0}),s0=Object.assign(Object.assign(Object.assign({},sV),sz),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),s1=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",imageMode:void 0,image:"",width:0,height:0,maxWidth:500,maxHeight:500,imagePosition:"top-left",imageScale:1,imageOffsetX:0,imageOffsetY:0},sV),{fill:!0,cornerRadius:0,cornerType:"round"}),s2=Object.assign(Object.assign({},s1),{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}),s3=function(){let t=/^(linear\-gradient)/i,e=/^(radial\-gradient)/i,i=/^(conic\-gradient)/i,s=/^to (left (top|bottom)|right (top|bottom)|to
2p (left|right)|bottom (left|right)|left|right|top|bottom)/i,r=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,a=/^(left|center|right|top|bottom)/i,n=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,o=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,u=/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,c=/^\)/,p=/^,/,g=/(^\#[0-9a-fA-F]+)/,f=/^([a-zA-Z]+)/,m=/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,_=/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,y="";function v(t){let e=Error(y+": "+t);throw e.source=y,e}function b(){return x("linear",t,S)||x("radial",e,k)||x("conic",i,A)}function x(t,e,i){let s=I(e);if(s){let e;I(d)||v("Missing (");let s=((e=i())&&(I(p)||v("Missing comma before color stops")),{type:t,orientation:e,colorStops:B(E)});return I(c)||v("Missing )"),s}}function S(){return R("directional",s,1)||R("angular",h,1)}function A(){return R("angular",u,1)}function k(){let t,e,i=M();return i&&((t=[]).push(i),e=y,I(p)&&((i=M())?t.push(i):y=e)),t}function M(){let t,e,i=((t=R("shape",/^(circle)/i,0))&&(t.style=O()||w()),t||((e=R("shape",/^(ellipse)/i,0))&&(e.style=P()||w()),e));if(i)i.at=T();else{let t=w();if(t){i=t;let e=T();e&&(i.at=e)}else{let t=C();t&&(i={type:"default-radial",at:t})}}return i}function w(){return R("extent-keyword",r,1)}function T(){if(R("position",/^at/,0)){let t=C();return t||v("Missing positioning value"),t}}function C(){let t={x:P(),y:P()};if(t.x||t.y)return{type:"position",value:t}}function B(t){let e=t(),i=[];if(e)for(i.push(e);I(p);)(e=t())?i.push(e):v("One extra comma");return i}function E(){let t=R("hex",g,1)||R("rgba",_,1)||R("rgb",m,1)||R("literal",f,0);return t||v("Expected color definition"),t.length=P(),t}function P(){return R("%",l,1)||R("position-keyword",a,1)||O()}function O(){return R("px",n,1)||R("em",o,1)}function R(t,e,i){let s=I(e);if(s)return{type:t,value:s[i]}}function I(t){let e=/^[\n\r\t\s]+/.exec(y);e&&L(e[0].length);let i=t.exec(y);return i&&L(i[0].length),i}function L(t){y=y.substr(t)}return function(t){let e;return y=t.toString(),e=B(b),y.length>0&&v("Invalid input not EOF"),e}}();class s5{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(s5.IsGradientStr(t))try{let e=s3(t)[0];if(e){if("linear"===e.type)return s5.ParseLinear(e);
2if("radial"===e.type)return s5.ParseRadial(e);if("conic"===e.type)return s5.ParseConic(e)}}catch(t){}return t}static processColorStops(t){if(!t||0===t.length)return[];if(t.some(t=>t.length)){let e=t.map(t=>({color:t.value,offset:t.length?parseFloat(t.length.value)/100:-1}));e[0].offset<0&&(e[0].offset=0),e[e.length-1].offset<0&&(e[e.length-1].offset=1);for(let t=1;t<e.length-1;t++)if(e[t].offset<0){let i=t-1,s=t+1;for(;s<e.length&&e[s].offset<0;)s++;let r=e[i].offset,a=e[s].offset,n=s-i;for(let t=1;t<n;t++)e[i+t].offset=r+(a-r)*t/n;t=s-1}return e}return t.map((e,i)=>{let s=t.length>1?i/(t.length-1):0;return{color:e.value,offset:s}})}static ParseConic(t){let{orientation:e,colorStops:i=[]}=t,s=io/2,r=parseFloat(e.value)/180*io-s;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+id,stops:s5.processColorStops(i)}}static ParseRadial(t){let{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:s5.processColorStops(e)}}static ParseLinear(t){let{orientation:e,colorStops:i=[]}=t,s=io/2,r="angular"===e.type?parseFloat(e.value)/180*io:0;for(;r<0;)r+=id;for(;r>=id;)r-=id;let a=0,n=0,l=0,o=0;return r<s?(a=0,n=1,l=Math.sin(r),o=n-Math.cos(r)):r<io?(a=0,n=0,l=Math.cos(r-s),o=Math.sin(r-s)):r<io+s?(n=0,l=(a=1)-Math.sin(r-io),o=Math.cos(r-io)):(l=(a=1)-Math.cos(r-s-io),o-=Math.sin(r-s-io)),{gradient:"linear",x0:a,y0:n,x1:l,y1:o,stops:s5.processColorStops(i)}}}function s4(t,e,i){let s=e,{a:r,b:a,c:n,d:l}=t.currentMatrix,o=Math.sign(r)*Math.sqrt(r*r+a*a),h=Math.sign(l)*Math.sqrt(n*n+l*l);return o+h===0?0:s=s/Math.abs(o+h)*2*i}function s8(t,e,i,s=0,r=0){var a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x,S,A,k,M,w,T,C,B,E,P,O,R,I,L,D,F,z;let H,j;if(!e||!0===e)return"black";if((0,ev.A)(e))for(let t=0;t<e.length&&!(j=e[t]);t++);else j=e;if("string"==typeof(j=s5.Parse(j)))return j;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){let e,V,N,W=i.AABBBounds,U=W.x2-W.x1,G=W.y2-W.y1,Y=W.x1-s,$=W.y1-r;if(i.attribute){let{scaleX:t=1,scaleY:e=1,angle:s=0}=i.attribute;U/=t,G/=e,Y/=t,$/=e,(s||1!==t||1!==e)&&(Y=null!=(a=i.x1WithoutTransform)?a:0,$=null!=(n=i.y1WithoutTransform)?n:0,U=null!=(l=i.widthWithoutTransform)?l:U,G=null!=(o=i.heightWithoutTransform)?o:G)}"linear"===j.gradient?(h=t,u=j,d=Y,c=$,p=U,g=G,e=h.createLinearGradient(d+(null!=(f=u.x0)?f:0)*p,c+(null!=(m=u.y0)?m:0)*g,d+(null!=(_=u.x1)?_:1)*p,c+(null!=(y=u.y1)?y:0)*g),u.stops.forEach(t=>{e.addColorStop(t.offset,t.color)}),H=e):"conical"===j.gradient?(v=t,b=j,x=Y,S=$,A=U,k=G,V=v.createConicGradient(x+(null!=(M=b.x)?M:0)*A,S+(null!=(w=b.y)?w:0)*k,b.startAngle,b.endAngle),b.stops.forEach(t=>{V.addColorStop(t.offset,t.color)}),H=V.GetPattern?V.GetPattern(A+x,k+S,void 0):V):"radial"===j.gradient&&(T=t,C=j,B=Y,E=$,P=U,O=G,N=T.createRadialGradient(B+(null!=(R=C.x0)?R:.5)*P,E+(null!=(I=C.y0)?I:.5)*O,Math.max(P,O)*(null!=(L=C.r0)?L:0),B+(null!=(D=C.x1)?D:.5)*P,E+(null!=(F=C.y1)?F:.5)*O,Math.max(P,O)*(null!=(z=C.r1)?z:.5)),C.stops.forEach(t=>{N.addColorStop(t.offset,t.color)}),H=N)}return H||"orange"}let s6={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"}};String.fromCharCode(160);let s9=/\w|\(|\)|-/,s7=/[.?!,;:/ï¼ãï¼ï¼ãï¼ï¼]/,rt=/\S/,re=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function ri(t,e,i,s,r){if(t.length<=1||!e||e<=0)return 0;let a=ie.graphicUtil.textMeasure,n=s,l=t.slice(0,n),o=Math.floor(a.measureText(l,i).width),h=t.slice(0,n+1),u=Math.floor(a.measureText(h,i).width);for(;o>e||u<=e;){if(o>e?n--:n++,n>t.length){n=t.length;break}if(n<0){n=0;break}l=t.slice(0,n),o=Math.floor(a.measureText(l,i).width),h=t.slice(0,n+1),u=Math.floor(a.measureText(h,i).width)}return r&&(n=rs(t,n)),n}function rs(t,e,i=!1){let s=e;for(;s9.test(t[s-1])&&s9.test(t[s])||s7.test(t[s]);)if(--s<=0)return i?function(t,e){let i=e;for(;s9.test(t[i+1])&&s9.test(t[i])||s7.test(t[i]);)if(++i>=t.length)return i;return i+1}(t,e):e;return s}function rr(t,e,i="actual"){var s;if(""===t)return{ascent:0,height:0,descent:0,width:0};let r=ie.graphicUtil.textMeasure.measureText(t,e),a={ascent:0,height:0,descent:0,width:0},n="actual"===i?r.actualBoundingBoxAscent:r.fontBoundingBoxAscent,l="actual"===i?r.actualBoundingBoxDescent:r.fontBoundingBoxDescent;"number"!=typeof n||"number"!=typeof l?(a.width=Math.floor(r.width),a.height=e.fontSize||0,a.ascent=a.height,a.descent=0):(a.width=Math.floor(r.width),a.height=Math.floor(n+l),a.ascent=Math.floor(n),a.descent=a.height-a.ascent);let o=null!=(s=e.space)?s:0;return a.width+=o,a}let ra=class{constructor(){this.id="ATextMeasure"}configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}_measureTextWithoutAlignBaseline(t,e,i){this.context.setTextStyleWithoutAlignBaseline(e);let s=this.context.measureText(t);return i?this.compatibleMetrics(s,e):s}_measureTextWithAlignBaseline(t,e,i){this.context.setTextStyle(e);let s=this.context.measureText(t);return i?this.compatibleMetrics(s,e):s}compatibleMetrics(t,e){if(null==t.actualBoundingBoxAscent||null==t.actualBoundingBoxDescent||null==t.fontBoundingBoxAscent||null==t.fontBoundingBoxDescent){t={width:t.width};let{ascent:i,descent:s}=this.measureTextBoundADscentEstimate(e);t.actualBoundingBoxAscent=i,t.actualBoundingBoxDescent=s,t.fontBoundingBoxAscent=i,t.fontBoundingBoxDescent=s}if(null==t.actualBoundingBoxLeft||null==t.actualBoundingBoxRight){t={width:t.width,actualBoundingBoxAscent:t.actualBoundingBoxAscent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent};let{left:i,right:s}=this.measureTextBoundLeftRightEstimate(e);t.actualBoundingBoxLeft=i,t.actualBoundingBoxRight=s}return t}estimate(t,{fontSize:e=sQ.fontSize}){let i=0,s=0;for(let e=0;e<t.length;e++)128>t.charCodeAt(e)?i++:s++;return{width:~~(.8*i*e+s*e),height:e}}measureTextWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsLeftRight(t,e,i){return this.context?{left:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxLeft,right:i.actualBoundingBoxRight}:this.measureTextBoundLeftRightEstimate(e)}measureTextPixelHeight(t,e,i){var s;return this.context?Math.abs((i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0)).actualBoundingBoxAscent-i.actualBoundingBoxDescent):null!=(s=e.fontSize)?s:sz.fontSize}measureTextPixelADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundHieght(t,e,i){var s;return this.context?Math.abs((i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0)).fontBoundingBoxAscent-i.fontBoundingBoxDescent):null!=(s=e.fontSize)?s:sz.fontSize}measureTextBoundADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).fontBoundingBoxAscent,descent:i.fontBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundADscentEstimate(t){var e;let i=null!=(e=t.fontSize)?e:sz.fontSize;return{ascent:.79*i,descent:.21*i}}measureTextBoundLeftRightEstimate(t){var e;let i=null!=(e=t.fontSize)?e:sz.fontSize,{textAlign:s}=t;return"center"===s?{left:i/2,right:i/2}:"right"===s||"end"===s?{left:i,right:0}:{left:0,right:i}}measureTextPixelADscentAndWidth(t,e,i){if(!this.context)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:this.estimate(t,e).width});let s=this._measureTextWithoutAlignBaseline(t,e,!0);if(i===hg.actualBounding)return{ascent:s.actualBoundingBoxAscent,descent:s.actualBoundingBoxDescent,width:s.width};if(i===hg.estimate)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:s.width});if(i===hg.fontBounding){let t=s.fontBoundingBoxAscent,e=s.fontBoundingBoxDescent;if(s.actualBoundingBoxDescent&&e<s.actualBoundingBoxDescent){let i=s.actualBoundingBoxDescent-e;e+=i,t-=i}else if(s.actualBoundingBoxAscent&&t<s.actualBoundingBoxAscent){let i=s.actualBoundingBoxAscent-t;t+=i,e-=i}return{ascent:t,descent:e,width:s.width}}return{ascent:s.actualBoundingBoxAscent,descent:s.actualBoundingBoxDescent,width:s.width}}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,s){if(0===t.length)return{verticalList:t,width:0};let{fontSize:r=12}=e;t.forEach(t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)});let a=[],n=0,l=0;for(;l<t.length&&n+t[l].width<i;l++)n+=t[l].width,a.push(t[l]);if(t[l]&&t[l].text.length>1){let r=this._clipText(t[l].text,e,i-n,0,t[l].text.length-1,"end",!1);if(s&&r.str!==t[l].text){let i="",s=0;for(let e=0;e<l;e++){let r=t[e];i+=r.text,s+=r.text.length}let a=rs(i+=t[l].text,s+r.str.length);(a-=s)!=r.str.length-1&&(r.str=r.str.substring(0,a),r.width=this.measureTextWidth(r.str,e))}a.push(Object.assign(Object.assign({},t[l]),{text:r.str,width:r.width})),n+=r.width}return{verticalList:a,width:n}}clipText(t,e,i,s,r){if(0===t.length)return{str:"",width:0};let a=this.measureTextWidth(t,e);if(a<=i)return{str:t,width:a};if((a=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};let n=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&n.str!==t){let i=rs(t,n.str.length,r);i!==n.str.length&&(i>n.str.length&&(n.wordBreaked=i,i=n.str.length),n.str=t.substring(0,i),n.width=this.measureTextWidth(n.str,e))}return n}_clipText(t,e,i,s,r,a,n){let l;if("start"===a)l=this._clipTextStart(t,e,i,s,r),n&&(l.result=n+l.str);else if("middle"===a){let s=this._clipTextMiddle(t,e,i,"","",0,0,1);l={str:"none",width:s.width,result:s.left+n+s.right}}else l=this._clipTextEnd(t,e,i,s,r),n&&(l.result=l.str+n);return l}_clipTextEnd(t,e,i,s,r){let a;if(s===r){eg.getInstance().warn(`ã_clipTextEndãä¸åºè¯¥èµ°å°è¿é${t}, ${s}, ${r}`);let i=t.substring(0,r+1);return{str:i,width:this.measureTextWidth(i,e)}}let n=Math.floor((s+r)/2),l=t.substring(0,n+1),o=this.measureTextWidth(l,e);if(o>i){if(l.length<=1)return{str:"",width:0};let r=t.substring(0,n);return(a=this.measureTextWidth(r,e))<=i?{str:r,width:a}:this._clipTextEnd(t,e,i,s,n)}if(o<i){if(n>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};let s=t.substring(0,n+2);return(a=this.measureTextWidth(s,e))>=i?{str:l,width:o}:this._clipTextEnd(t,e,i,n,r)}return{str:l,width:o}}_clipTextStart(t,e,i,s,r){let a,n=Math.ceil((s+r)/2),l=t.substring(n-1,t.length),o=this.measureTextWidth(l,e);if(o>i){if(l.length<=1)return{str:"",width:0};let s=t.substring(n,t.length);return(a=this.measureTextWidth(s,e))<=i?{str:s,width:a}:this._clipTextStart(t,e,i,n,t.length)}if(o<i){if(n<=0)return{str:t,width:this.measureTextWidth(t,e)};let r=t.substring(n-2,t.length);return(a=this.measureTextWidth(r,e))>=i?{str:l,width:o}:this._clipTextStart(t,e,i,s,n)}return{str:l,width:o}}_clipTextMiddle(t,e,i,s,r,a,n,l){let o=t.substring(0,l),h=this.measureTextWidth(o,e);if(h+n>i)return{left:s,right:r,width:a+n};let u=t.substring(t.length-l,t.length),d=this.measureTextWidth(u,e);return h+d>i?{left:o,right:r,width:h+n}:this._clipTextMiddle(t,e,i,o,u,h,d,l+1)}clipTextWithSuffixVertical(t,e,i,s,r,a){let n;if(""===s)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};let l=this.clipTextVertical(t,e,i,r);if(l.verticalList.length===t.length&&l.verticalList[l.verticalList.length-1].width===t[t.length-1].width)return l;let o=this.measureTextWidth(s,e);if(o>i)return l;if(i-=o,"start"===a){let a=this.revertVerticalList(t);n=this.clipTextVertical(a,e,i,r);let l=this.revertVerticalList(n.verticalList);l.unshift({text:s,direction:1,width:o}),n.verticalList=l}else if("middle"===a){let a=this.clipTextVertical(t,e,i/2,r),l=this.revertVerticalList(t),h=this.clipTextVertical(l,e,i/2,r);a.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach(t=>a.verticalList.push(t)),n={verticalList:a.verticalList,width:a.width+h.width}}else(n=this.clipTextVertical(t,e,i,r)).verticalList.push({text:s,direction:1,width:o});return n.width+=o,n}revertVerticalList(t){return t.reverse().map(t=>{let e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})})}clipTextWithSuffix(t,e,i,s,r,a,n=!1){if(""===s)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};let l=this.measureTextWidth(t,e);if(!n&&l<=i)return{str:t,width:l};let o=this.measureTextWidth(s,e);if(o>i)return{str:"",width:0};if(n&&l+o<=i)return{str:t+s,width:l+o};i-=o;let h=this._clipText(t,e,i,0,t.length-1,a,s);if(r&&h.str!==t){let i=rs(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else n&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=o,h}};
2ra=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],ra);let rn=Symbol.for("TextMeasureContribution"),rl=class extends ra{constructor(){super(...arguments),this.id="DefaultTextMeasureContribution"}};rl=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],rl);let ro=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)+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
2<=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 rh(t,e={},i){i||(i=1);let{fontStyle:s=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:a=e.fontWeight,fontSize:n=e.fontSize,fontFamily:l=e.fontFamily}=t;return(s?s+" ":"")+(r?r+" ":"")+(a?a+" ":"")+n*i+"px "+(l||"sans-serif")}class ru{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(),(0,eA.A)(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=(0,eA.A)(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if((0,eE.A)(this._canvas)&&((0,eA.A)(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),(0,eE.A)(this._canvas)&&"u">typeof window&&void 0!==window.document&&globalThis&&(0,eA.A)(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),(0,eE.A)(this._context)&&(0,eA.A)(this._canvas)){let t=this._canvas.getContext("2d");(0,eA.A)(t)&&(t.save(),t.font=rh(this.textSpec),this._contextSaved=!0,this._context=t)}return!(0,eE.A)(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;let{defaultFontParams:s={}}=this._option,{fontStyle:r=s.fontStyle,fontVariant:a=s.fontVariant,fontWeight:n=null!=(t=s.fontWeight)?t:"normal",fontSize:l=null!=(e=s.fontSize)?e:12,fontFamily:o=null!=(i=s.fontFamily)?i:"sans-serif",align:h,textAlign:u=null!=h?h:"center",baseline:d,textBaseline:c=null!=d?d:"middle",ellipsis:p,limit:g}=this._userSpec,{lineHeight:f=l}=this._userSpec;return(0,eS.A)(f)&&"%"===f[f.length-1]&&(f=l*(Number.parseFloat(f.substring(0,f.length-1))/100)),{fontStyle:r,fontVariant:a,fontFamily:o,fontSize:l,fontWeight:n,textAlign:u,textBaseline:c,ellipsis:p,limit:g,lineHeight:f}}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){let e;if((0,eE.A)(t))return{width:0,height:0};if((0,eE.A)(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);let{fontFamily:i,fontSize:s,fontWeight:r,textAlign:a,textBaseline:n,ellipsis:l,limit:o,lineHeight:h}=this.textSpec;try{let u=this._option.getTextBounds({text:t,fontFamily:i,fontSize:s,fontWeight:r,textAlign:a,textBaseline:n,ellipsis:!!l,maxLineWidth:o||1/0,lineHeight:h});e={width:u.width(),height:u.height()}}catch(i){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);let e=this._context.measureText(t),{fontSize:i,lineHeight:s}=this.textSpec;return{width:e.width,height:null!=s?s:i,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){let e={width:0,height:0};for(let i=0;i<t.length;i++){let s=t[i],r=this._measureSpecialChar(s);(0,eE.A)(r)&&ru.NUMBERS_CHAR_SET.includes(s)&&(r=this._measureNumberChar()),(0,eE.A)(r)&&["F","W"].includes(ro(s))&&(r=this._measureFullSizeChar()),(0,eE.A)(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height),(0,eE.A)(r.fontBoundingBoxAscent)||(e.fontBoundingBoxAscent=r.fontBoundingBoxAscent),(0,eE.A)(r.fontBoundingBoxDescent)||(e.fontBoundingBoxDescent=r.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){let e={width:0,height:0},{fontSize:i,lineHeight:s}=this.textSpec;for(let s=0;s<t.length;s++){let r=["F","W"].includes(ro(t[s]))?1:.53;e.width+=r*i}return e.height=null!=s?s:i,e}_measureReduce(t,e){let{fontSize:i,lineHeight:s}=this.textSpec,r={width:0,height:0};if((0,eE.A)(t))return r;if((0,ev.A)(t)){let a=t.filter(eA.A).map(t=>t.toString());return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce((t,i)=>Math.max(t,e(i).width),0),height:a.length*((null!=s?s:i)+1)+1}}return e(t.toString())}_measureNumberChar(){if((0,eE.A)(this._numberCharSize)){let t=this._standardMethod(ru.NUMBERS_CHAR_SET);
2this._numberCharSize={width:t.width/ru.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return(0,eE.A)(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ru.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if((0,eE.A)(this._letterCharSize)){let t=this._standardMethod(ru.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ru.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return(0,eA.A)(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){(0,eA.A)(this._canvas)&&(this._canvas=null),(0,eA.A)(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function rd(t,e,i){let s=0,r=t[0];if(!r)return!1;for(let a=1;a<t.length;a++){let n=t[a];s+=rc(r.x,r.y,n.x,n.y,e,i),r=n}let a=t[0];return rp(r.x,a.x)&&rp(r.y,a.y)||(s+=rc(r.x,r.y,a.x,a.y,e,i)),0!==s}function rc(t,e,i,s,r,a){if(a>e&&a>s||a<e&&a<s||s===e)return 0;let n=(a-e)/(s-e),l=s<e?1:-1;1!==n&&0!==n||(l=s<e?.5:-.5);let o=n*(i-t)+t;return o===r?1/0:o>r?l:0}function rp(t,e){return 1e-8>Math.abs(t-e)}ru.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ru.NUMBERS_CHAR_SET="0123456789",ru.FULL_SIZE_CHAR="å";let rg=Symbol.for("CanvasFactory"),rf=Symbol.for("Context2dFactory");function rm(t){return e7.getNamed(rg,ie.global.env)(t)}let r_=Math.sqrt(3),ry=1/3;function rv(t){return t>-rC&&t<rC}let rb=[0,0],rx=[0,0],rS=[0,0];function rA(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function rk(t,e,i,s){let r=1-s;return r*(r*t+2*s*e)+s*s*i}function rM(t,e,i,s,r){let a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*s+3*a*i)}function rw(t){return(t%=id)<0&&(t+=id),t}function rT(t,e,i,s,r,a,n){if(0===r)return!1;let l=r/2,o=0;if(n>e+l&&n>s+l||n<e-l&&n<s-l||a>t+l&&a>i+l||a<t-l&&a<i-l)return!1;if(t===i)return Math.abs(a-t)<=r/2;let h=(o=(e-s)/(t-i))*a-n+(t*s-i*e)/(t-i);return h*h/(o*o+1)<=r/2*r/2}let rC=1e-4,rB=[-1,-1,-1],rE=[-1,-1];function rP(t){return Math.round(t/io*1e8)/1e8%2*io}let rO=[0,0];function rR(t,e,i,s,r){let a=t.length,n,l,o=0,h=0,u=0,d=0,c=0;for(let _=0;_<a;_++){var p,g,f,m;let a=t[_],y=0===_;6===a[0]&&_>1&&(i||(o+=rc(h,u,d,c,s,r))),y&&(h=a[1],u=a[2],d=h,c=u);let v=a[0],b=a[1],x=a[2],S=a[3],A=a[4],k=a[5],M=a[6],w=A,T=k;rO[0]=w,rO[1]=T,function(t,e){let i=rP(t[0]);i<0&&(i+=id);let s=i-t[0],r=t[1];r+=s,!e&&r-i>=id?r=i+id:e&&i-r>=id?r=i-id:!e&&i>r?r=i+(id-rP(i-r)):e&&i<r&&(r=i-(id-rP(r-i))),t[0]=i,t[1]=r}(rO,!!a[6]),w=rO[0],T=rO[1];let C=w,B=T-w,E=!!(1-!a[6]),P=(s-b)*S/S+b;switch(v){case 6:d=b,c=x,h=d,u=c;break;case 5:if(i){if(rT(h,u,b,x,e,s,r))return!0}else o+=rc(h,u,b,x,s,r)||0;h=b,u=x;break;case 2:if(i){if(p=h,g=u,0!==e&&(!(r>g+e)||!(r>x+e)||!(r>A+e)||!(r>M+e))&&(!(r<g-e)||!(r<x-e)||!(r<A-e)||!(r<M-e))&&(!(s>p+e)||!(s>b+e)||!(s>S+e)||!(s>k+e))&&(!(s<p-e)||!(s<b-e)||!(s<S-e)||!(s<k-e))&&function(t,e,i,s,r,a,n,l,o,h){let u,d,c,p,g=0,f=.005,m=1/0;rb[0]=o,rb[1]=h;for(let o=0;o<1;o+=.05)rx[0]=rM(t,i,r,n,o),rx[1]=rM(e,s,a,l,o),(c=rA(rb,rx))<m&&(g=o,m=c);m=1/0;for(let o=0;o<32&&!(f<1e-4);o++)u=g-f,d=g+f,rx[0]=rM(t,i,r,n,u),rx[1]=rM(e,s,a,l,u),c=rA(rx,rb),u>=0&&c<m?(g=u,m=c):(rS[0]=rM(t,i,r,n,d),rS[1]=rM(e,s,a,l,d),p=rA(rS,rb),d<=1&&p<m?(g=d,m=p):f*=.5);return Math.sqrt(m)}(p,g,b,x,S,A,k,M,s,r)<=e/2)return!0}else o+=function(t,e,i,s,r,a,n,l,o,h){if(h>e&&h>s&&h>a&&h>l||h<e&&h<s&&h<a&&h<l)return 0;let u=function(t,e,i,s,r,a){let n=s+3*(e-i)-t,l=3*(i-2*e+t),o=3*(e-t),h=t-r,u=l*l-3*n*o,d=l*o-9*n*h,c=o*o-3*l*h,p=0;if(rv(u)&&rv(d))if(rv(l))a[0]=0;else{let t=-o/l;t>=0&&t<=1&&(a[p++]=t)}else{let t=d*d-4*u*c;if(rv(t)){let t=d/u,e=-l/n+t,i=-t/2;e>=0&&e<=1&&(a[p++]=e),i>=0&&i<=1&&(a[p++]=i)}else if(t>0){let e=Math.sqrt(t),i=u*l+1.5*n*(-d+e),s=u*l+1.5*n*(-d-e),r=(-l-((i=i<0?-Math.pow(-i,ry):Math.pow(i,ry))+(s=s<0?-Math.pow(-s,ry):Math.pow(s,ry))))/(3*n);r>=0&&r<=1&&(a[p++]=r)}else{let t=Math.acos((2*u*l-3*n*d)/(2*Math.sqrt(u*u*u)))/3,e=Math.sqrt(u),i=Math.cos(t),s=(-l-2*e*i)/(3*n),r=(-l+e*(i+r_*Math.sin(t)))/(3*n),o=(-l+e*(i-r_*Math.sin(t)))/(3*n);s>=0&&s<=1&&(a[p++]=s),r>=0&&r<=1&&(a[p++]=r),o>=0&&o<=1&&(a[p++]=o)}}return p}(e,s,a,l,h,rB);if(0===u)return 0;let d=0,c=-1,p=0,g=0;for(let h=0;h<u;h++){let u=rB[h],f=0===u||1===u?.5:1;
2rM(t,i,r,n,u)<o||(c<0&&(c=function(t,e,i,s,r){let a=6*i-12*e+6*t,n=9*e+3*s-3*t-9*i,l=3*e-3*t,o=0;if(rv(n)){if(a>rC||a<-rC){let t=-l/a;t>=0&&t<=1&&(r[o++]=t)}}else{let t=a*a-4*n*l;if(rv(t))r[0]=-a/(2*n);else if(t>0){let e=Math.sqrt(t),i=(-a+e)/(2*n),s=(-a-e)/(2*n);i>=0&&i<=1&&(r[o++]=i),s>=0&&s<=1&&(r[o++]=s)}}return o}(e,s,a,l,rE),rE[1]<rE[0]&&c>1&&function(){let t=rE[0];rE[0]=rE[1],rE[1]=t}(),p=rM(e,s,a,l,rE[0]),c>1&&(g=rM(e,s,a,l,rE[1]))),2===c?u<rE[0]?d+=p<e?f:-f:u<rE[1]?d+=g<p?f:-f:d+=l<g?f:-f:u<rE[0]?d+=p<e?f:-f:d+=l<p?f:-f)}return d}(h,u,b,x,S,A,k,M,s,r)||0;h=k,u=M;break;case 7:if(i){if(f=h,m=u,0!==e&&(!(r>m+e)||!(r>x+e)||!(r>A+e))&&(!(r<m-e)||!(r<x-e)||!(r<A-e))&&(!(s>f+e)||!(s>b+e)||!(s>S+e))&&(!(s<f-e)||!(s<b-e)||!(s<S-e))&&function(t,e,i,s,r,a,n,l){let o=0,h=.005,u=1/0;rb[0]=n,rb[1]=l;for(let n=0;n<1;n+=.05){rx[0]=rk(t,i,r,n),rx[1]=rk(e,s,a,n);let l=rA(rb,rx);l<u&&(o=n,u=l)}u=1/0;for(let n=0;n<32&&!(h<1e-4);n++){let n=o-h,l=o+h;rx[0]=rk(t,i,r,n),rx[1]=rk(e,s,a,n);let d=rA(rx,rb);if(n>=0&&d<u)o=n,u=d;else{rS[0]=rk(t,i,r,l),rS[1]=rk(e,s,a,l);let n=rA(rS,rb);l<=1&&n<u?(o=l,u=n):h*=.5}}return Math.sqrt(u)}(f,m,b,x,S,A,s,r)<=e/2)return!0}else o+=function(t,e,i,s,r,a,n,l){let o;if(l>e&&l>s&&l>a||l<e&&l<s&&l<a)return 0;let h=function(t,e,i,s,r){let a=t-2*e+i,n=2*(e-t),l=t-s,o=0;if(rv(a)){if(n>rC||n<-rC){let t=-l/n;t>=0&&t<=1&&(r[o++]=t)}}else{let t=n*n-4*a*l;if(rv(t)){let t=-n/(2*a);t>=0&&t<=1&&(r[o++]=t)}else if(t>0){let e=Math.sqrt(t),i=(-n+e)/(2*a),s=(-n-e)/(2*a);i>=0&&i<=1&&(r[o++]=i),s>=0&&s<=1&&(r[o++]=s)}}return o}(e,s,a,l,rB);if(0===h)return 0;let u=0==(o=e+a-2*s)?.5:(e-s)/o;if(u>=0&&u<=1){let l=0,o=rk(e,s,a,u);for(let s=0;s<h;s++){let h=0===rB[s]||1===rB[s]?.5:1;rk(t,i,r,rB[s])<n||(rB[s]<u?l+=o<e?h:-h:l+=a<o?h:-h)}return l}let d=0===rB[0]||1===rB[0]?.5:1;return rk(t,i,r,rB[0])<n?0:a<e?d:-d}(h,u,b,x,S,A,s,r)||0;h=S,u=A;break;case 0:if(n=Math.cos(C)*S+b,l=Math.sin(C)*S+x,y?(d=n,c=l):o+=rc(h,u,n,l,s,r),i){if(function(t,e,i,s,r,a,n,l,o){if(0===n)return!1;let h=Math.sqrt((l-=t)*l+(o-=e)*o);if(h-n>i||h+n<i)return!1;if(Math.abs(s-r)%id<1e-4)return!0;if(a){let t=s;s=rw(r),r=rw(t)}else s=rw(s),r=rw(r);s>r&&(r+=id);let u=Math.atan2(o,l);return u<0&&(u+=id),u>=s&&u<=r||u+id>=s&&u+id<=r}(b,x,S,C,C+B,E,e,P,r))return!0}else o+=function(t,e,i,s,r,a,n,l){if((l-=e)>i||l<-i)return 0;let o=Math.sqrt(i*i-l*l);rB[0]=-o,rB[1]=o;let h=Math.abs(s-r);if(h<1e-4)return 0;if(h>=id-1e-4)return s=0,r=id,n>=rB[0]+t&&n<=rB[1]+t?a?1:-1:0;if(s>r){let t=s;s=r,r=t}s<0&&(s+=id,r+=id);let u=0;for(let e=0;e<2;e++){let i=rB[e];if(i+t>n){let t=Math.atan2(l,i),e=a?1:-1;t<0&&(t=id+t),(t>=s&&t<=r||t+id>=s&&t+id<=r)&&(t>io/2&&t<1.5*io&&(e=-e),u+=e)}}return u}(b,x,S,C,C+B,E,P,r);h=Math.cos(C+B)*S+b,u=Math.sin(C+B)*S+x;break;case 8:if(d=h=b,c=u=x,n=d+S,l=c+A,i){if(rT(d,c,n,c,e,s,r)||rT(n,c,n,l,e,s,r)||rT(n,l,d,l,e,s,r)||rT(d,l,d,c,e,s,r))return!0}else o+=rc(n,c,n,l,s,r),o+=rc(d,l,d,c,s,r);break;case 3:if(i){if(rT(h,u,d,c,e,s,r))return!0}else o+=rc(h,u,d,c,s,r);h=d,u=c}}return i||Math.abs(u-c)<rC||(o+=rc(h,u,d,c,s,r)||0),0!==o}let rI=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){let e=rm(Object.assign({nativeCanvas:ie.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}let e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){let e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=rm(Object.assign({nativeCanvas:ie.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}let e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};function rL(t,e,i=1e-10,s=1e-10){let r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(s,r)}function rD(t,e,i,s){return t>e&&!rL(t,e,i,s)}function rF(t,e,i,s){return t<e&&!rL(t,e,i,s)}let rz=Symbol.for("VWindow"),rH=Symbol.for("WindowHandlerContribution"),rj=class extends ir{get width(){if(this._handler){let t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){let t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){super(),this.hooks={onChange:new eZ(["x","y","width","height"])},this.active=()=>{let t=this.global;t.env&&!this.actived&&(e7.getNamed(rH,t.env).configure(this,t),this.actived=!0)},this._uid=eI.GenAutoIncrementId(),this.global=ie.global,this.postInit()}_nativeAddEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._handler.dispatchEvent(t)}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!=(t=this._handler.getStyle())?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);let 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)?e:this._width,y2:null!=(i=t.height)?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 Error("æä¸æ¯æ")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this.clearAllEventListeners(),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}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,r,a){this._handler.setViewBoxTransform(t,e,i,s,r,a)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){let 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(){let t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&rL(this.width,t.width())&&rL(this.height,t.height()))}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}
2getTopLeft(t){return this._handler.getTopLeft(t)}};rj=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],rj);var rV=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n},rN=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rW=function(t,e){return function(i,s){e(i,s,t)}};let rU=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=ie.global,this._textMeasureMap=new Map,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}getTextMeasureInstance(t){return t&&this._textMeasureMap.get(t)||this.textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach(t=>{t.configure(this,e)}),this.configured=!0)}tryInitCanvas(){if(!this._canvas){let t=rI.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure&&"DefaultTextMeasureContribution"!==t.id||(this._textMeasure=t),this._textMeasureMap.has(t.id)||this._textMeasureMap.set(t.id,t)}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);let r=this.global.measureTextMethod;this.global.measureTextMethod=i;let a={width:this._textMeasure.measureTextWidth(t,e),height:null!=(s=e.fontSize)?s:sz.fontSize};return this.global.measureTextMethod=r,a}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new ru(Object.assign({defaultFontParams:{fontFamily:sz.fontFamily,fontSize:sz.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ru.ALPHABET_CHAR_SET+ru.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;let s=e7.get(rz),r=t.AABBBounds,a=r.width(),n=r.height(),l=-r.x1,o=-r.y1;s.create({viewBox:{x1:l,y1:o,x2:r.x2,y2:r.y2},width:a,height:n,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});let 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;let u=s.getNativeHandler();return u.nativeCanvas?u.nativeCanvas:null}};rU=rV([ej(),rW(0,eU(eY)),rW(0,eG(rn)),rN("design:paramtypes",[Object])],rU),(hl=hS||(hS={}))[hl.transform=0]="transform",hl[hl.matrix=1]="matrix";let rG=new iL,rY=class{constructor(){this.matrix=new iL}init(t){return this.mode=hS.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=hS.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){let s=this.outSourceMatrix;if(rG.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){let{x:s,y:r}=i;this.outTargetMatrix.translate(s,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(rG.a,rG.b,rG.c,rG.d,rG.e,rG.f),this}rotateMatrix(t,e){let i=this.outSourceMatrix;if(rG.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){let{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(rG.a,rG.b,rG.c,rG.d,rG.e,rG.f),this}scale(t,e,i){return this.mode===hS.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===hS.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){let i=this.outSourceMatrix;return rG.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(rG.a,rG.b,rG.c,rG.d,rG.e,rG.f),this}translate(t,e){return this.mode===hS.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===hS.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};rY=rV([ej(),rN("design:paramtypes",[])],rY);let r$={arc:sN,area:sW,circle:sU,line:s$,path:sX,symbol:sJ,text:sQ,rect:sZ,polygon:sK,star:sq,richtext:s0,richtextIcon:s2,image:s1,group:sG,glyph:sY},rX=Object.keys(r$);function rK(t,e){Object.keys(e).forEach(i=>
2{t[i]=e[i]})}let rq={arc:Object.assign({},r$.arc),area:Object.assign({},r$.area),circle:Object.assign({},r$.circle),line:Object.assign({},r$.line),path:Object.assign({},r$.path),symbol:Object.assign({},r$.symbol),text:Object.assign({},r$.text),rect:Object.assign({},r$.rect),polygon:Object.assign({},r$.polygon),star:Object.assign({},r$.star),richtext:Object.assign({},r$.richtext),richtextIcon:Object.assign({},r$.richtextIcon),image:Object.assign({},r$.image),group:Object.assign({},r$.group),glyph:Object.assign({},r$.glyph)};class rZ{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},rX.forEach(t=>{this._defaultTheme[t]=Object.create(rq[t])}),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t||!this.dirty)return this.combinedTheme;let e={},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){let s=this.getParentWithTheme(t);if(s){let 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,eg.getInstance().warn("æªç¥é误ï¼èµ°å°ä¸åºè¯¥èµ°çåºåé")),this.dirty=!1)}return this.combinedTheme}doCombine(t){let e=this.userTheme,i=this.combinedTheme;rX.forEach(s=>{let r=Object.create(rq[s]);t&&t[s]&&rK(r,t[s]),i[s]&&rK(r,i[s]),e[s]&&rK(r,e[s]),this.combinedTheme[s]=r}
2),e.common&&rX.forEach(t=>{rK(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))})}}let rJ=new rZ;function rQ(t,e){return t.glyphHost?rQ(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):rJ.getTheme()}return null}(t)||t.attachedThemeGraphic&&rQ(t.attachedThemeGraphic)||rJ.getTheme()}let r0=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),r1=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),r2=t=>{let e=typeof t;return null!==t&&"object"===e||"function"===e};var r3=i(83564);class r5 extends eh(){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=eI.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){var i,s,r,a;return i=this,s=void 0,r=void 0,a=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(r||(r=Promise))(function(t,e){function n(t){try{o(a.next(t))}catch(t){e(t)}}function l(t){try{o(a.throw(t))}catch(t){e(t)}}function o(e){var i;e.done?t(e.value):((i=e.value)instanceof r?i:new r(function(t){t(i)})).then(n,l)}o((a=a.apply(i,s||[])).next())})}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw Error("ãNode::appendChildãä¸è½å°ç¶è¾å
ç´ append为åå
ç´ ");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("æä¸æ¯æè¯¥å½æ°"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw Error("ãNode::insertBeforeãä¸è½å°ç¶è¾å
ç´ insert为åå
ç´ ");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw 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&&eg.getInstance().warn("insertIntoKeepIdxåinsertIntoæ··ç¨å¯è½ä¼åå¨é误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw Error("ãNode::insertBeforeãä¸è½å°ç¶è¾å
ç´ insert为åå
ç´ ");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){let i;if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){let i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}this._nodeList[e]=t;for(let t=e-1;t>=0&&!(i=this._nodeList[t]);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;let s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap||!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){let 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;){let 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)}
2replaceChild(t,e){throw 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){let 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){let 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;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){let t=[],e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e)return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw Error("æä¸æ¯æ")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do e._count+=t,e=e.parent;while(null!==e)}clone(){throw Error("æä¸æ¯æ")}cloneTo(t){throw Error("æä¸æ¯æ")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){let s=ey(i,!0)&&i||r2(i)&&i.capture,r=r2(i)&&i.once,a=(0,r3.A)(e)?void 0:e;return t=s?`${t}capture`:t,e=(0,r3.A)(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){let s=ey(i,!0)&&i||r2(i)&&i.capture,r=(0,r3.A)(e)?void 0:e;t=s?`${t}capture`:t,e=(0,r3.A)(e)?e:e.handleEvent;let a=r2(i)&&i.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return r2(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class r4{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=r4.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){let e=t.graphic;if(e.stage){let i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&(0,r3.A)(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}
2stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&(0,r3.A)(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw Error("Method not implemented.")}}class r8 extends r4{constructor(t,e){super(),this.type=t,this.detail=e}}class r6{static GetImage(t,e){var i;let s=r6.cache.get(t);s?"fail"===s.loadState?ie.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):"init"===s.loadState||"loading"===s.loadState?null==(i=s.waitingMark)||i.push(e):e&&e.imageLoadSuccess(t,s.data):r6.loadImage(t,e)}static GetSvg(t,e){var i;let s=r6.cache.get(t);s?"fail"===s.loadState?ie.global.getRequestAnimationFrame()(()=>{e.imageLoadFail(t)}):"init"===s.loadState||"loading"===s.loadState?null==(i=s.waitingMark)||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},r6.cache.set(t,s),s.dataPromise=ie.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)||i.map((i,r)=>{(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=r6.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then(t=>t.data):Promise.resolve(i.data):(i={type:e,loadState:"init"},r6.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ie.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ie.global.loadBlob(t):"json"===e&&(i.dataPromise=ie.global.loadJson(t)),i.dataPromise.then(t=>t.data))}static loading(){setTimeout(()=>{if(!r6.isLoading&&r6.toLoadAueue.length){r6.isLoading=!0;let t=r6.toLoadAueue.splice(0,10),e=[];t.forEach(t=>{let{url:i,marks:s}=t,r={type:"image",loadState:"init"};if(r6.cache.set(i,r),r.dataPromise=ie.global.loadImage(i),r.dataPromise){r.waitingMark=s;let t=r.dataPromise.then(t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null==(e=r.waitingMark)||e.map((e,s)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))}),r.waitingMark&&(r.waitingMark=[])});e.push(t)}else r.loadState="fail",s.forEach(t=>t.imageLoadFail(i))}),Promise.all(e).then(()=>{r6.isLoading=!1,this.onLoadSuccessCb.forEach(t=>t()),r6.loading()}).catch(t=>{console.error(t),r6.isLoading=!1,this.onLoadSuccessCb.forEach(t=>t()),r6.loading()})}},0)}static loadImage(t,e){let i=r9(t,r6.toLoadAueue);-1!==i?r6.toLoadAueue[i].marks.push(e):r6.toLoadAueue.push({url:t,marks:[e]}),r6.loading()}static improveImageLoading(t){let e=r9(t,r6.toLoadAueue);if(-1!==e){let t=r6.toLoadAueue.splice(e,1);r6.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function r9(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return -1}r6.cache=new Map,r6.isLoading=!1,r6.toLoadAueue=[],r6.onLoadSuccessCb=[],(ho=hA||(hA={}))[ho.Top=1]="Top",ho[ho.Right=2]="Right",ho[ho.Bottom=4]="Bottom",ho[ho.Left=8]="Left",ho[ho.ALL=15]="ALL";let r7=[!1,!1,!1,!1],at=[0,0,0,0],ae=t=>t?(0,ev.A)(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(at[0]=t[0],at[2]=t[0],at[1]=t[1],at[3]=t[1],at):t:t:0,ai=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],as=[1,2,3,0,1,2,3,0];function ar(t,e,i,s){for(;t>=id;)t-=id;for(;t<0;)t+=id;for(;t>e;)e+=id;ai[0].x=i,ai[1].y=i,ai[2].x=-i,ai[3].y=-i;let r=Math.ceil(t/ih)%4,a=Math.ceil(e/ih)%4;if(s.add(ig(t)*i,iy(t)*i),s.add(ig(e)*i,iy(e)*i),r!==a||e-t>io){let t=!1;for(let e=0;e<as.length;e++)if(t||r!==as[e]){if(t&&a===as[e])break;if(t){let t=ai[as[e]];s.add(t.x,t.y)}}else{t=!0;let e=ai[r];s.add(e.x,e.y)}}}function aa(t,e,i){let{x:s,y:r}=iS(t.x,t.y,e.x,e.y,i),{x:a,y:n}=iS(t.x1,t.y1,e.x1,e.y1,i),l=new i8(s,r,a,n);return l.defined=e.defined,l}function an(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let s=[];if(t.length>e.length){s=e.map(t=>{let e=new i8(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e});for(let r=0;r<e.length;r++)s[r]=aa(t[r],e[r],i)}else{s=e.map(t=>{let e=new i8(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e});for(let r=0;r<t.length;r++)s[r]=aa(t[r],e[r],i)}return s}function al(t,e){if((0,ev.A)(t)){let i;for(let s=0;s<t.length&&void 0===i;
2s++)i=t[s][e];return i}return t[e]}class ao{constructor(t=ao.TimeOut){this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout(()=>{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)}}ao.TimeOut=1e3/60;let ah=new ao,au=(t,e)=>{let i=(0,eS.A)(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;return isNaN(i)?i:Math.max(e,i)};class ad{bounds(t,e){if(ed(t)){let i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return ed(t)?t:Math.min(t[0],t[1])}}function ac(t,e,i,s,r){return r?t.arc(i,s,e,0,iu,!1,r):t.arc(i,s,e,0,iu),!1}let ap=new class extends ad{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,r){return ac(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return ac(t,this.parseSize(e)/2+r,i,s,a)}drawToSvgPath(t,e,i,s){let r=this.parseSize(t)/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}},ag=new class extends ad{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,r){var a;return a=this.parseSize(e)/6,t.moveTo(-3*a+i,-a+s,r),t.lineTo(-a+i,-a+s,r),t.lineTo(-a+i,-3*a+s,r),t.lineTo(a+i,-3*a+s,r),t.lineTo(a+i,-a+s,r),t.lineTo(3*a+i,-a+s,r),t.lineTo(3*a+i,a+s,r),t.lineTo(a+i,a+s,r),t.lineTo(a+i,3*a+s,r),t.lineTo(-a+i,3*a+s,r),t.lineTo(-a+i,a+s,r),t.lineTo(-3*a+i,a+s,r),t.closePath(),!0}drawOffset(t,e,i,s,r,a){var n;return n=this.parseSize(e)/6,t.moveTo(-3*n+i-r,-n+s-r,a),t.lineTo(-n+i-r,-n+s-r,a),t.lineTo(-n+i-r,-3*n+s-r,a),t.lineTo(n+i+r,-3*n+s-r,a),t.lineTo(n+i+r,-n+s-r,a),t.lineTo(3*n+i+r,-n+s-r,a),t.lineTo(3*n+i+r,n+s+r,a),t.lineTo(n+i+r,n+s+r,a),t.lineTo(n+i+r,3*n+s+r,a),t.lineTo(-n+i-r,3*n+s+r,a),t.lineTo(-n+i-r,n+s+r,a),t.lineTo(-3*n+i-r,n+s+r,a),t.closePath(),!0}};function af(t,e,i,s,r){return t.moveTo(i,s-e,r),t.lineTo(e+i,s,r),t.lineTo(i,s+e,r),t.lineTo(i-e,s,r),t.closePath(),!0}let am=new class extends ad{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,r){return af(t,this.parseSize(e)/2,i,s,r)}drawFitDir(t,e,i,s,r){return af(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return af(t,this.parseSize(e)/2+r,i,s,a)}};function a_(t,e,i,s){let r=2*e;return t.rect(i-e,s-e,r,r),!1}let ay=new class extends ad{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return a_(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return a_(t,this.parseSize(e)/2+r,i,s)}};function av(t,e,i,s,r=0){return t.moveTo(i+e+2*r,e+s+r),t.lineTo(i-e-2*r,e+s+r),t.lineTo(i,s-e-2*r),t.closePath(),!0}class ab extends ad{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 av(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return av(t,this.parseSize(e)/2,i,s,r)}}let ax=new ab,aS=new class extends ab{constructor(){super(...arguments),this.type="triangle"}},aA=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ak=Math.sin(iu/10)*aA,aM=-Math.cos(iu/10)*aA;function aw(t,e,i,s){let r=ak*e,a=aM*e;t.moveTo(i,-e+s),t.lineTo(r+i,a+s);for(let n=1;n<5;++n){let l=iu*n/5,o=Math.cos(l),h=Math.sin(l);t.lineTo(h*e+i,-o*e+s),t.lineTo(o*r-h*a+i,h*r+o*a+s)}return t.closePath(),!0}let aT=new class extends ad{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 aw(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aw(t,this.parseSize(e)/2+r,i,s)}},aC=iv(3);function aB(t,e,i,s){let r=e/aC,a=r/5;return t.moveTo(0+i,-e+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,e+s),t.lineTo(-a/2+i,e+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}let aE=new class extends ad{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 aB(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aB(t,this.parseSize(e)/2+r,i,s)}};function aP(t,e,i,s){let r=2*e;return t.moveTo(i,-e+s),t.lineTo(r/3/2+i,e+s),t.lineTo(-r/3/2+i,e+s),t.closePath(),!0}let aO=new class extends ad{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return aP(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aP(t,this.parseSize(e)/2+r,i,s)}};function aR(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}let aI=new class extends ad{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return aR(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aR(t,this.parseSize(e)/2+r,i,s)}},aL=iv(3)/2,aD=1/iv(12);function aF(t,e,i,s){let r=e/2,a=e*aD,n=e*aD+e,l=-r;return t.moveTo(r+i,a+s),t.lineTo(r+i,n+s),t.lineTo(l+i,n+s),t.lineTo(-.5*r-aL*a+i,aL*r+-.5*a+s),t.lineTo(-.5*r-aL*n+i,aL*r+-.5*n+s),t.lineTo(-.5*l-aL*n+i,aL*l+-.5*n+s),t.lineTo(-.5*r
2+aL*a+i,-.5*a-aL*r+s),t.lineTo(-.5*r+aL*n+i,-.5*n-aL*r+s),t.lineTo(-.5*l+aL*n+i,-.5*n-aL*l+s),t.closePath(),!1}let az=new class extends ad{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 aF(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aF(t,this.parseSize(e)/2+r,i,s)}};function aH(t,e,i,s,r){return t.moveTo(-e+i-2*r,s),t.lineTo(e+i+r,e+s+2*r),t.lineTo(e+i+r,s-e-2*r),t.closePath(),!0}let aj=new class extends ad{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 aH(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,r){return aH(t,this.parseSize(e)/2,i,s,r)}};function aV(t,e,i,s,r=0){return t.moveTo(i-e-r,e+s+2*r),t.lineTo(e+i+2*r,s),t.lineTo(i-e-r,s-e-2*r),t.closePath(),!0}let aN=new class extends ad{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 aV(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aV(t,this.parseSize(e)/2,i,s,r)}};function aW(t,e,i,s,r=0){return t.moveTo(i-e-2*r,s-e-r),t.lineTo(i+e+2*r,s-e-r),t.lineTo(i,s+e+2*r),t.closePath(),!0}let aU=new class extends ad{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 aW(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,r){return aW(t,this.parseSize(e)/2,i,s,r)}},aG=iv(3);function aY(t,e,i,s){let r=e*aG;return t.moveTo(i,s+-r/3*2),t.lineTo(e+i,s+r),t.lineTo(i-e,s+r),t.closePath(),!0}let a$=new class extends ad{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return aY(t,this.parseSize(e)/2/aG,i,s)}drawOffset(t,e,i,s,r){return aY(t,this.parseSize(e)/2/aG+r,i,s)}};function aX(t,e,i,s){let r=2*e;return t.moveTo(e+i,s-r),t.lineTo(i-e,s),t.lineTo(e+i,r+s),!0}let aK=new class extends ad{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 aX(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return aX(t,this.parseSize(e)/4+r,i,s)}};function aq(t,e,i,s){let r=2*e;return t.moveTo(i-e,s-r),t.lineTo(i+e,s),t.lineTo(i-e,r+s),!0}let aZ=new class extends ad{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 aq(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return aq(t,this.parseSize(e)/4+r,i,s)}};function aJ(t,e,i,s){let r=2*e;return t.moveTo(i-r,s+e),t.lineTo(i,s-e),t.lineTo(i+r,s+e),!0}let aQ=new class extends ad{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 aJ(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return aJ(t,this.parseSize(e)/4+r,i,s)}};function a0(t,e,i,s){let r=2*e;return t.moveTo(i-r,s-e),t.lineTo(i,s+e),t.lineTo(i+r,s-e),!0}let a1=new class extends ad{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 a0(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,r){return a0(t,this.parseSize(e)/4+r,i,s)}};function a2(t,e,i,s,r){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}let a3=new class extends ad{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,r){return a2(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return a2(t,this.parseSize(e)/2+r,i,s,a)}drawToSvgPath(t,e,i,s){let r=this.parseSize(t)/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function a5(t,e,i,s,r){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}let a4=new class extends ad{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,r){return a5(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return a5(t,this.parseSize(e)/2+r,i,s,a)}drawToSvgPath(t,e,i,s){let r=this.parseSize(t)/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function a8(t,e,i,s,r){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}let a6=new class extends ad{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,r){return a8(t,this.parseSize(e)/2,i,s,r)}drawOffset(t,e,i,s,r,a){return a8(t,this.parseSize(e)/2+r,i,s,a)}drawToSvgPath(t,e,i,s){let r=this.parseSize(t)/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function a9(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function a7(t,e,i,s){let r=e/2;return t.rect(i-e/2,s-r/2,e,r),!1}
2let nt=new class extends ad{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 ed(e)?a7(t,e,i,s):a9(t,e,i,s)}drawWithClipRange(t,e,i,s,r,a,n){ed(e)&&(e=[e,e/2]);let l=2*(e[0]+e[1])*r,o=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}],h=0,u=o[3];t.moveTo(u.x,u.y);for(let e=0;e<o.length;e++){let i=o[e],s=Math.sqrt((i.x-u.x)*(i.x-u.x)+(i.y-u.y)*(i.y-u.y));if(h+s>l){let e=(i.x-u.x)*(l-h)/s,r=(i.y-u.y)*(l-h)/s;t.lineTo(u.x+e,u.y+r);break}t.lineTo(i.x,i.y),u=i,h+=s}return!1}drawOffset(t,e,i,s,r){return ed(e)?a7(t,e+2*r,i,s):a9(t,[e[0]+2*r,e[1]+2*r],i,s)}},ne={};[ap,ag,am,ay,a$,aS,aT,aE,aO,aI,az,aj,aN,ax,aU,aK,aZ,aQ,a1,nt,a3,a4,a6].forEach(t=>{ne[t.type]=t});let ni={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"},ns=new iJ;class nr{constructor(t,e,i=!1){this.pathStr="",this.type=t,(0,ev.A)(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,r,a,n){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach(r=>{t.beginPath(),i4(r.path.commandList,t,i,s,e,e),n&&n(r.path,r.attribute)}),!1):(i4(this.path.commandList,t,i,s,e+r,e+r),!1)}draw(t,e,i,s,r,a){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,r,a)}parseSize(t){return ed(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,r,a,n){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach(a=>{a.path.drawWithClipRange(t,e,i,s,r),n&&n(a.path,a.attribute)}),!1):(this.path.drawWithClipRange(t,e,i,s,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach(({path:i})=>{ns.x1=i.bounds.x1*t,ns.y1=i.bounds.y1*t,ns.x2=i.bounds.x2*t,ns.y2=i.bounds.y2*t,e.union(ns)})}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 na{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 nn(t,e,i,s){let r=t.indexOf(e,i);if(-1===r)throw Error(s);return r+e.length-1}function nl(t,e,i,s=">"){let r=function(t,e,i=">"){let s,r="";for(let a=e;a<t.length;a++){let e=t[a];if(s)e===s&&(s="");else if('"'===e||"'"===e)s=e;else if(e===i[0]){if(!i[1]||t[a+1]===i[1])return{data:r,index:a}}else" "===e&&(e=" ");r+=e}}(t,e+1,s);if(!r)return;let a=r.data,n=r.index,l=a.search(/\s/),o=a,h=!0;-1!==l&&(o=a.substr(0,l).replace(/\s\s*$/,""),a=a.substr(l+1));let u=o;if(i){let t=o.indexOf(":");-1!==t&&(h=(o=o.substr(t+1))!==r.data.substr(t+1))}return{tagName:o,tagExp:a,closeIndex:n,attrExpPresent:h,rawTagName:u}}let no=RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class nh{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){let s=e.tagname;"string"==typeof s&&(e.tagname=s),t.addChild(e)}buildAttributesMap(t,e,i){let s={};if(!t)return;let r=function(t,e){let i=[],s=e.exec(t);for(;s;){let r=[];r.startIndex=e.lastIndex-s[0].length;let a=s.length;for(let t=0;t<a;t++)r.push(s[t]);i.push(r),s=e.exec(t)}return i}(t,no),a=r.length;for(let t=0;t<a;t++){let e=r[t][1],i=r[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");let e=new na("!xml"),i=e,s="",r="";for(let a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){let e=nn(t,">",a,"Closing Tag is not closed."),n=r.lastIndexOf(".");r=r.substring(0,n),(i=this.tagsNodeStack.pop())&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",a=e}else if("?"===t[a+1])a=nl(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=nn(t,"--\x3e",a+4,"Comment is not closed.");else{let n=nl(t,a,!1),l=n.tagName,o=n.tagExp,h=n.attrExpPresent,u=n.closeIndex;if(l!==e.tagname&&(r+=r?"."+l:l),o.length>0&&o.lastIndexOf("/")===o.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),o=l):o=o.substr(0,o.length-1);let t=new na(l);l!==o&&h&&(t[":@"]=this.buildAttributesMap(o,r,l)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{let t=new na(l);this.tagsNodeStack.push(i),l!==o&&h&&(t[":@"]=this.buildAttributesMap(o,r,l)),this.addChild(i,t,r),i=t}s="",a=u}else s+=t[a];return e.child}}class nu{constructor(t){this.options=Object.assign({},nu.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){var e;return!!this.valid&&(e=new nh(this.options).parseXml(t),this.options,function t(e,i){let s={};for(let r=0;r<e.length;r++){let a=e[r],n=function(t){let e=Object.keys(t);for(let t=0;t<e.length;t++){let i=e[t];if(":@"!==i)return i}}(a),l="";if(l=void 0===i?n:i+"."+n,void 0!==n&&a[n]){let e=t(a[n],l);Object.keys(e).length,a[":@"]&&function(t,e){if(e){let i=Object.keys(e),s=i.length;for(let r=0;r<s;r++){let s=i[r];t[s]=e[s]}}}(e,a[":@"]),void 0!==s[n]&&s.hasOwnProperty(n)?(Array.isArray(s[n])||(s[n]=[s[n]]),s[n].push(e)):s[n]=e}}return s}(e))}}
2function nd(t,e,i,s=0){var r,a;return t.expand(e+(s/2+(i?(r=i,a=e,r?a:0):0))),t}nu.defaultOptions={};let nc=0;function np(){return nc++}(hh=hk||(hk={}))[hh.HORIZONTAL=0]="HORIZONTAL",hh[hh.VERTICAL=1]="VERTICAL";let ng=new Map;["â¦","ï¼","ï¼","â","ã","ã","ã","ã","ã","ã"].forEach(t=>ng.set(t,!0));let nf=new Map;[""].forEach(t=>nf.set(t,!0));let nm=np(),n_=np(),ny=np(),nv=np(),nb=np(),nx=np(),nS=np(),nA=np(),nk=np(),nM=np();np();let nw=np();np();let nT=np();np();let nC=np(),nB=np(),nE=Symbol.for("GraphicService"),nP=Symbol.for("GraphicCreator"),nO={"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(nO),nI={duration:200,easing:"cubicOut"};function nL(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 nD(t,e,i){let s,r,a,n,l,o,h,u,d,c,p,g,f=i[0],m=i[1],_=i[2];return e===t?(t[12]=e[0]*f+e[4]*m+e[8]*_+e[12],t[13]=e[1]*f+e[5]*m+e[9]*_+e[13],t[14]=e[2]*f+e[6]*m+e[10]*_+e[14],t[15]=e[3]*f+e[7]*m+e[11]*_+e[15]):(s=e[0],r=e[1],a=e[2],n=e[3],l=e[4],o=e[5],h=e[6],u=e[7],d=e[8],c=e[9],p=e[10],g=e[11],t[0]=s,t[1]=r,t[2]=a,t[3]=n,t[4]=l,t[5]=o,t[6]=h,t[7]=u,t[8]=d,t[9]=c,t[10]=p,t[11]=g,t[12]=s*f+l*m+d*_+e[12],t[13]=r*f+o*m+c*_+e[13],t[14]=a*f+h*m+p*_+e[14],t[15]=n*f+u*m+g*_+e[15]),t}function nF(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 nz(t,e,i){let s=e[0],r=e[1],a=e[2],n=e[3],l=e[4],o=e[5],h=e[6],u=e[7],d=e[8],c=e[9],p=e[10],g=e[11],f=e[12],m=e[13],_=e[14],y=e[15],v=i[0],b=i[1],x=i[2],S=i[3];return t[0]=v*s+b*l+x*d+S*f,t[1]=v*r+b*o+x*c+S*m,t[2]=v*a+b*h+x*p+S*_,t[3]=v*n+b*u+x*g+S*y,v=i[4],b=i[5],x=i[6],S=i[7],t[4]=v*s+b*l+x*d+S*f,t[5]=v*r+b*o+x*c+S*m,t[6]=v*a+b*h+x*p+S*_,t[7]=v*n+b*u+x*g+S*y,v=i[8],b=i[9],x=i[10],S=i[11],t[8]=v*s+b*l+x*d+S*f,t[9]=v*r+b*o+x*c+S*m,t[10]=v*a+b*h+x*p+S*_,t[11]=v*n+b*u+x*g+S*y,v=i[12],b=i[13],x=i[14],S=i[15],t[12]=v*s+b*l+x*d+S*f,t[13]=v*r+b*o+x*c+S*m,t[14]=v*a+b*h+x*p+S*_,t[15]=v*n+b*u+x*g+S*y,t}function nH(t,e,i){let s=e[0],r=e[1],a=e[2],n=i[3]*s+i[7]*r+i[11]*a+i[15];return n=n||1,t[0]=(i[0]*s+i[4]*r+i[8]*a+i[12])/n,t[1]=(i[1]*s+i[5]*r+i[9]*a+i[13])/n,t[2]=(i[2]*s+i[6]*r+i[10]*a+i[14])/n,t}function nj(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");let nV=new class{constructor(){this.pools=[]}allocate(t,e,i,s,r,a){if(!this.pools.length)return new iL(t,e,i,s,r,a);let n=this.pools.pop();return n.a=t,n.b=e,n.c=i,n.d=s,n.e=r,n.f=a,n}allocateByObj(t){if(!this.pools.length)return new iL(t.a,t.b,t.c,t.d,t.e,t.f);let e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},nN=new class t{constructor(){this.pools=[]}static identity(t){return nL(t)}allocate(){if(!this.pools.length)return nj();let e=this.pools.pop();return t.identity(e),e}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():nj();for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},nW=new iL(1,0,0,1,0,0),nU={x:0,y:0},nG=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new iL(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new iL(1,0,0,1,0,0),this.path=new sO,this._clearMatrix=new iL(1,0,0,1,0,0)}getCanvas(){throw Error("䏿¯ægetCanvas")}getContext(){throw Error("䏿¯ægetContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return nV.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new iL(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>
20&&(nV.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(nV.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){let t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){let 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,r=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,s,r,a,n=!0,l=this.dpr){this.matrix.setValue(l*t,l*e,l*i,l*s,l*r,l*a),n&&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,r,a,n=!0){this.matrix.multiply(t,e,i,s,r,a),n&&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){let 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.path.clear()}clip(t,e){}arc(t,e,i,s,r,a){this.path.arc(t,e,i,s,r,a)}arcTo(t,e,i,s,r){this.path.arcTo(t,e,i,s,r)}bezierCurveTo(t,e,i,s,r,a){this.path.bezierCurveTo(t,e,i,s,r,a)}closePath(){this.path.closePath()}ellipse(t,e,i,s,r,a,n,l){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.path.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.path.rect(t,e,i,s)}createImageData(t,e){return null}createLinearGradient(t,e,i,s){throw Error("䏿¯æcreateLinearGradient")}createPattern(t,e){throw Error("䏿¯æcreatePattern")}createRadialGradient(t,e,i,s,r,a){throw Error("䏿¯æcreateRadialGradient")}createConicGradient(t,e,i,s){return null}fill(t,e){}fillRect(t,e,i,s){this.path.rect(t,e,i,s)}clearRect(t,e,i,s){}fillText(t,e,i){}getImageData(t,e,i,s){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},nU),rR(this.path.commandList,0,!1,nU.x,nU.y)}isPointInStroke(t,e){var i;if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},nU);let s=s4(this,this.lineWidth,this.dpr);return i=this.path.commandList,rR(i,s,!0,nU.x,nU.y)}measureText(t){throw Error("䏿¯æmeasureText")}putImageData(t,e,i){throw Error("䏿¯æmeasureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,s){this.path.rect(t,e,i,s)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,s,r){}_setCommonStyle(t,e,i,s){}setStrokeStyle(t,e,i,s,r){}_setStrokeStyle(t,e,i,s){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(nW,t,e)}setClearMatrix(t,e,i,s,r,a){this._clearMatrix.setValue(t,e,i,s,r,a)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach(t=>nV.free(t)),this.stack.length=0}};nG=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],nG);let nY=new iJ,n$=new iL;new iJ;let nX=["lineWidth","scaleX","scaleY","angle","anchor","visible"],nK=["x","y"],nq=["scaleX","scaleY"],nZ=["angle"],nJ=new i8,nQ={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,anch
2or:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class n0 extends r5{static mixin(t){let e=Object.keys(t);for(let i=0;i<e.length;++i){let s=e[i];Object.defineProperty(n0.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new iJ,this._updateTag=hm.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!=(e=t.background.background)?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}getGraphicService(){var t,e;return null!=(e=null==(t=this.stage)?void 0:t.graphicService)?e:ie.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,s;let{dx:r=t.dx,dy:a=t.dy}=this.attribute;if(e&&this.parent){let t=this.parent.attribute;nJ.x=r+(null!=(i=t.scrollX)?i:0),nJ.y=a+(null!=(s=t.scrollY)?s:0)}else nJ.x=r,nJ.y=a;return nJ}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){let t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);let e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return(this._OBBBounds||(this._OBBBounds=new iQ),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp)?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid)?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds)}combindShadowAABBBounds(t){if(this.shadowRoot){let e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){let{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);let{shape:e}=t,i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),(i=this.parsePath(e))&&this.clipPathMap.set(e,i)),i}parsePath(t){var e;if(!t)return null;let i=ne[t];if(i||(i=n0.userSymbolMap[t]))return i;if(!0===((e=t=ni[t]||t).startsWith("<svg")||e.startsWith("<?xml"))){let{svg:e}=(new nu).parse(t);if(!e)return null;let i=(0,ev.A)(e.path)?e.path:[e.path];nY.clear();let s=[];i.forEach(t=>{let e=(new sO).fromString(t.d),i={};nR.forEach(e=>{t[e]&&(i[nO[e]]=t[e])}),s.push({path:e,attribute:i}),nY.union(e.bounds)});let r=1/im(nY.width(),nY.height());s.forEach(t=>t.path.transform(0,0,r,r));let a=new nr(t,s,!0);return n0.userSymbolMap[t]=a,a}let s=(new sO).fromString(t),r=1/im(s.bounds.width(),s.bounds.height());s.transform(0,0,r,r);let a=new nr(t,s);return n0.userSymbolMap[t]=a,a}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;let e=this.getGraphicTheme();this._AABBBounds.clear();let i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=i,a=ae(r);return a&&s.expand(a),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){let e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;let i=new iF(t);return i4(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){let t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){if(this._globalTransMatrix){if(this.parent){let t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(t=!0){return this._transMatrix||(this._transMatrix=new iL),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&hm.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&hm.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&hm.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&hm.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&hm.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;let i=this.attribute;return Number.isFinite((null!=(t=i.x)?t:0)+(null!=(e=i.y)?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}
2shouldUpdateShape(){return!!(this._updateTag&hm.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=hm.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===h_.GLOBAL){let i=new i8(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,s){this.setAttributes(t,e,i),this.animates&&this.animates.forEach(e=>{(e.priority!==1/0||s)&&Object.keys(t).forEach(t=>{e.preventAttr(t)})})}setAttributes(t,e=!1,i){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i))}_setAttributes(t,e=!1,i){let s=Object.keys(t);for(let e=0;e<s.length;e++){let i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(e||this.needUpdateTags(s))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,s){var r;let a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);a?this._setAttributes(a,i,s):(0,eE.A)(null==(r=this.normalAttrs)?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(i||this.needUpdateTag(t))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=nX){for(let i=0;i<e.length;i++){let s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t,e=nX){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){let e={type:hy.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=hm.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;let r={type:hy.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,nK,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));let n=this.attribute,l=n.postMatrix;return l?ie.transformUtil.fromMatrix(l,l).translate(t,e):(n.x=(null!=(i=n.x)?i:sI.x)+t,n.y=(null!=(s=n.y)?s:sI.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){let i=this.attribute;if(i.x===t&&i.y===e)return this;let s={type:hy.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,nK,s);return r?this._setAttributes(r,!1,s):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)),this}scale(t,e,i){var s,r;if(1===t&&1===e)return this;let a={type:hy.SCALE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,nq,a);n&&(t=n.scaleX,e=n.scaleY,delete n.scaleX,delete n.scaleY,this._setAttributes(n));let l=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(l.postMatrix=s=new iL),ie.transformUtil.fromMatrix(s,s).scale(t,e,i)}else l.scaleX=(null!=(s=l.scaleX)?s:sI.scaleX)*t,l.scaleY=(null!=(r=l.scaleY)?r:sI.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){let i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;let s={type:hy.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,nq,s);return r?this._setAttributes(r,!1,s):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)),this}rotate(t,e){var i;if(0===t)return this;let s={type:hy.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,nZ,s);r&&(delete r.angle,this._setAttributes(r,!1,s));let a=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(a.postMatrix=i=new iL),ie.transformUtil.fromMatrix(i,i).rotate(t,e)}else a.angle=(null!=(i=a.angle)?i:sI.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){let e=this.attribute;if(e.angle===t)return this;let i={type:hy.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,nZ,i);return s?this._setAttributes(s,!1,i):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)),this}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}
2update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!(0,eE.A)(t)||this.currentStates.includes(t))}getState(t){var e;return null==(e=this.states)?void 0:e[t]}applyStateAttrs(t,e,i,s){var r,a;if(i){let e,i=Object.keys(t),n=this.getNoWorkAnimateAttr(),l={};i.forEach(i=>{n[i]?(e||(e={}),e[i]=t[i]):l[i]=s&&void 0===t[i]?this.getDefaultAttribute(i):t[i]});let o=null!=(a=null!=(r=this.context&&this.context.stateAnimateConfig)?r:this.stateAnimateConfig)?a:nI;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:l,duration:o.duration,easing:o.easing}}]),e&&this.setAttributesAndPreventAnimate(e,!1,{type:hy.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t)}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:hy.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:hy.STATE})}updateNormalAttrs(t){let 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}
2stopStateAnimates(t="end"){this.animates&&this.animates.forEach(e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))})}getNormalAttribute(t){var e,i;let s=this.attribute[t];return this.animates&&this.animates.size?null==(e=this.finalAttribute)?void 0:e[t]:null!=s?s:null==(i=this.finalAttribute)?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){let i=(0,ev.A)(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){let 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;let r=e&&(null==(s=this.currentStates)?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if(!((null==(i=this.currentStates)?void 0:i.length)!==t.length||t.some((t,e)=>this.currentStates[e]!==t)))return;this.stateSort&&(t=t.sort(this.stateSort));let s={};t.forEach(e=>{var i;let r=this.stateProxy?this.stateProxy(e,t):null==(i=this.states)?void 0:i[e];r&&Object.assign(s,r)}),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=hm.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=hm.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=hm.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&hm.UPDATE_SHAPE_AND_BOUNDS)===hm.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=hm.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=hm.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=hm.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=hm.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=hm.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=hm.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=hm.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&hm.UPDATE_LAYOUT)}getAnchor(t,e,i){let s=[0,0],r=()=>{if(e.b)return e.b;let t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){let e=parseFloat(t[0])/100,i=r();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){let e=parseFloat(t[1])/100,i=r();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){let{x:t=sI.x,y:e=sI.y,scaleX:i=sI.scaleX,scaleY:s=sI.scaleY,angle:r=sI.angle,scaleCenter:a,anchor:n,postMatrix:l}=this.attribute,o=[0,0],h={};if(n&&r&&(o=this.getAnchor(n,h)),a&&(1!==i||1!==s)){let n=this._transMatrix;n.reset(),n.translate(o[0],o[1]),n.rotate(r),n.translate(-o[0],-o[1]),n.translate(t,e),o=this.getAnchor(a,h,!0),ie.transformUtil.fromMatrix(n,n).scale(i,s,{x:o[0],y:o[1]})}else{var u,d,c;let a,l,h,p,g,f,m,_,y,v,b,x,S,A,k,M;u=this._transMatrix,d=this._transMatrix.reset(),c=n&&o,h=d.a,p=d.b,g=d.c,f=d.d,m=d.e,_=d.f,y=ig(r),v=iy(r),c?(a=c[0],l=c[1]):(a=t,l=e),b=a-t,x=l-e,S=h*y+g*v,A=p*y+f*v,k=g*y-h*v,M=f*y-p*v,u.a=i*S,u.b=i*A,u.c=s*k,u.d=s*M,u.e=m+h*a+g*l-S*b-k*x,u.f=_+p*a+f*l-A*b-M*x}let p=this.getOffsetXY(sI);if(this._transMatrix.e+=p.x,this._transMatrix.f+=p.y,l){let t=n$.setValue(l.a,l.b,l.c,l.d,l.e,l.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);let{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){let e=t.getTimeline();
2this.animates.forEach(t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))})}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:hy.ANIMATE_END})}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!=(e=this.attribute[t])?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:ie.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map(t=>t.toJson())}}createPathProxy(t){return(0,eS.A)(t,!0)?this.pathProxy=(new sO).fromString(t):this.pathProxy=new sO,this.pathProxy}loadImage(t,e=!1){var i;if(e&&(null==t?void 0:t.background)&&(t=t.background),e&&(!t||("string"==typeof(i=t)?!(i.startsWith("<svg")||r0(i)||i.includes("/")||r1(i)):!(!i.fill&&!i.stroke)||!("string"!=typeof i.gradient||!Array.isArray(i.stops)))))return void(this.backgroundImg=!1);if(!t)return;let s=t;this.resources||(this.resources=new Map);let r={data:"init",state:null};this.resources.set(s,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(r6.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(r0(t)||t.includes("/")||r1(t))&&(r6.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):r2(t)?(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||e):r.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;let s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;let i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach(t=>{t.stop()})}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren(e=>{e.stopAnimates(t)})}release(){this.releaseStatus="released",this.stopAnimates(),ie.graphicService.onRelease(this),super.release()}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){let r=new r8(t,e);r.bubbles=!1,r.manager=null==(s=null==(i=this.stage)?void 0:i.eventSystem)?void 0:s.manager,this.dispatchEvent(r)}}toCustomPath(){var t,e,i;let s=null==(i=null==(e=(null==(t=this.stage)?void 0:t.renderService)||ie.renderService)?void 0:e.drawContribution)?void 0:i.getRenderContribution(this);if(s){let t=new nG(null,1);return s.drawShape(this,t,0,0,{},{}),t.path}return null}}n0.userSymbolMap={},n0.mixin({dispatchEvent(t){var e;if(!(t instanceof r4))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null==(e=null==t?void 0:t.manager)||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new r8(t,e))}}),(hu=hM||(hM={}))[hu.LESS_GROUP=0]="LESS_GROUP",hu[hu.MORE_GROUP=1]="MORE_GROUP";class n1 extends n0{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=nx,this._childUpdateTag=hm.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 rZ),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new rZ)}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===h_.GLOBAL){let i=new i8(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&hm.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);let t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boun
2dsMode&&e.clear(),e}doUpdateLocalMatrix(){let{x:t=sI.x,y:e=sI.y,dx:i=sI.dx,dy:s=sI.dy,scaleX:r=sI.scaleX,scaleY:a=sI.scaleY,angle:n=sI.angle,postMatrix:l}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==r||1!==a||0!==n||l)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return rQ(this).group}updateAABBBounds(t,e,i){let s=i;i=i.clone();let{width:r,height:a,path:n,clip:l=e.clip}=t;if(n&&n.length?n.forEach(t=>{i.union(t.AABBBounds)}):null!=r&&null!=a&&i.set(0,0,Math.max(0,r),Math.max(0,a)),!l){this.forEachChildren(t=>{i.union(t.AABBBounds)});let{scrollX:e=0,scrollY:s=0}=t;i.translate(e,s)}return ie.graphicService.updateTempAABBBounds(i),ie.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;let t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=hm.CLEAR_BOUNDS,this._childUpdateTag&=hm.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=hm.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&hm.UPDATE_BOUNDS||(this._childUpdateTag|=hm.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){let e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){let 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){let e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren(e=>{this.getGraphicService().onRemove(e),t&&e.isContainer&&e.removeAllChild(t)}),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t),this.forEachChildren(e=>{e.setStage(t,this.layer)}))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren(t=>{t.isContainer&&t.addUpdateGlobalPositionTag()})}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){let 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&hm.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=ie.graphicService.creator[i](e)).name=t,this.add(s)),s}clone(){return new n1(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return n1.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren(e=>{e.release(t)}),super.release()}}function n2(t){return new n1(t)}n1.NOWORK_ANIMATE_ATTR=nQ;class n3 extends n1{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 Error("æä¸æ¯æ")}get dpr(){return this._dpr}constructor(t,e,i,s){var r;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!=(r=s.zIndex)?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new rZ,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){let 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=>{ie.layerService.releaseLayer(this.stage,t.layer)}),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw Error("æä¸æ¯æ")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEac
2h(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)?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 Error("æä¸æ¯æ")}setToFrame(t){throw Error("æä¸æ¯æ")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach(t=>{ie.layerService.releaseLayer(this.stage,t.layer)})}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!=(i=e.background)?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach(t=>t(this))}}let n5=Symbol.for("TransformUtil"),n4=Symbol.for("GraphicUtil"),n8=Symbol.for("LayerService"),n6=Symbol.for("StaticLayerHandlerContribution"),n9=Symbol.for("DynamicLayerHandlerContribution"),n7=Symbol.for("VirtualLayerHandlerContribution"),lt=hw=class{static GenerateLayerId(){return`${hw.idprefix}_${hw.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=ie.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){return"static"===t?e7.get(n6):"dynamic"===t?e7.get(n9):e7.get(n7)}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;let r=this.getLayerHandler(s),a=new n3(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!=(i=e.canvasId)?i:hw.GenerateLayerId(),layerHandler:r})),n=this.layerMap.get(t)||[];return n.push(a),this.layerMap.set(t,n),this.staticLayerCountInEnv--,a}prepareStageLayer(t){let e;t.forEachChildren(t=>{let i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]})}releaseLayer(t,e){e.release();let 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 10*("browser"===this.global.env)}releaseStage(t){this.layerMap.delete(t)}};lt.idprefix="visactor_layer",lt.prefix_count=0,lt=hw=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],lt);let le=new eL(t=>{t(eQ).to(il).inSingletonScope(),t(rz).to(rj),t(n4).to(rU).inSingletonScope(),t(n5).to(rY).inSingletonScope(),t(n8).to(lt).inSingletonScope()}),li=Symbol.for("IncrementalDrawContribution"),ls=Symbol.for("ArcRender");Symbol.for("Arc3dRender");let lr=Symbol.for("AreaRender"),la=Symbol.for("CircleRender"),ln=Symbol.for("GraphicRender"),ll=Symbol.for("GroupRender"),lo=Symbol.for("LineRender"),lh=Symbol.for("PathRender"),lu=Symbol.for("PolygonRender"),ld=Symbol.for("RectRender");Symbol.for("Rect3DRender");let lc=Symbol.for("SymbolRender"),lp=Symbol.for("TextRender"),lg=Symbol.for("RichTextRender");Symbol.for("Pyramid3dRender");let lf=Symbol.for("GlyphRender"),lm=Symbol.for("ImageRender");Symbol.for("RenderSelector");let l_=Symbol.for("DrawContribution");Symbol.for("StarRender");let ly=class{constructor(t){this.drawContribution=t}
2prepare(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))}reInit(){this.drawContribution.reInit()}render(t,e){this.renderTreeRoots=t,this.drawParams=e;let i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};ly=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(hT=eU(l_),function(t,e){hT(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ly);let lv=new eL(t=>{t(it).to(ly)});Symbol.for("GraphicPicker");let lb=Symbol.for("PickerService");Symbol.for("BoundsPicker");let lx=Symbol.for("GlobalPickerService"),lS=Symbol.for("PickItemInterceptor"),lA=Symbol.for("PickServiceInterceptor"),lk=(t,e,i,s)=>{let r,a=!1,n=!1;if(e.forEachChildren(t=>!(a=t.numberType===n_)),e.forEachChildren(t=>!(n=!!t.findFace)),a){let t=e.getChildren(),l=[...t];l.sort((t,e)=>{var i,s,r,a;let n=(null!=(s=null!=(i=t.attribute.startAngle)?i:0+t.attribute.endAngle)?s:0)/2,l=(null!=(a=null!=(r=e.attribute.startAngle)?r:0+e.attribute.endAngle)?a:0)/2;for(;n<0;)n+=id;for(;l<0;)l+=id;return l-n}),l.forEach(t=>{t._next=null,t._prev=null}),e.removeAllChild(),e.update(),l.forEach(t=>{e.appendChild(t)}),s.hack_pieFace="outside",(r=i(a,n))&&r.graphic||(s.hack_pieFace="inside",r=i(a,n)),r&&r.graphic||(s.hack_pieFace="top",r=i(a,n)),e.removeAllChild(),t.forEach(t=>{t._next=null,t._prev=null}),t.forEach(t=>{e.appendChild(t)})}else if(n){let s=e.getChildren(),l=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)?s:0)[2]}).reduce((t,e)=>t+e,0),g:e}));l.sort((t,e)=>e.ave_z-t.ave_z),e.removeAllChild(),l.forEach(t=>{t.g._next=null,t.g._prev=null}),e.update(),l.forEach(t=>{e.add(t.g)}),r=i(a,n),e.removeAllChild(),s.forEach(t=>{t._next=null,t._prev=null}),e.update(),s.forEach(t=>{e.add(t)})}else r=i(a,n);return r};var lM=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};let lw=class{constructor(){this.order=1}afterPickItem(t,e,i,s,r){if(t.graphic){let e=t.graphic;for(;e.parent;)e=e.parent;e.shadowHost&&(t.params={shadowTarget:t.graphic},t.graphic=e.shadowHost)}return t}};lw=lM([ej()],lw);let lT=class{constructor(){this.order=1}afterPickItem(t,e,i,s,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,r):null}beforePickItem(t,e,i,s,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,r):null}_pickItem(t,e,i,s,r){var a;if(!t.shadowRoot)return null;let{parentMatrix:n}=r||{};if(!n)return null;let l=e.pickContext;l.highPerformanceSave();let o=null==(a=rQ(t))?void 0:a[t.type],{shadowPickMode:h=null==o?void 0:o.shadowPickMode}=t.attribute,u=t.shadowRoot,d=nV.allocateByObj(n),c=new i8(d.a*i.x+d.c*i.y+d.e,d.b*i.x+d.d*i.y+d.f),p=e.pickGroup(u,c,d,s);return l.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};lT=lM([ej()],lT);let lC=class{constructor(){this.order=1}beforePickItem(t,e,i,s,r){let a=t.baseGraphic;if(a&&a.parent){let t=new i8(i.x,i.y),r=e.pickContext;r.highPerformanceSave();let n=a.parent.globalTransMatrix;n.transformPoint(t,t);let l=a.isContainer?e.pickGroup(a,t.clone(),n,s):e.pickItem(a,t.clone(),n,s);return r.highPerformanceRestore(),l}return null}};lC=lM([ej()],lC);let lB=class{constructor(){this.order=1}beforePickItem(t,e,i,s,r){if(!t.in3dMode||s.in3dInterceptor)return null;let a=e.pickContext,n=t.stage;if(!a||!n)return null;if(s.in3dInterceptor=!0,a.save(),this.initCanvasCtx(a),a.camera=n.camera,t.isContainer){let n=lk(a,t,()=>e.pickGroup(t,i,r.parentMatrix,s),s);
2return a.camera=null,s.in3dInterceptor=!1,a.restore(),n}return a.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};lB=lM([ej()],lB);let lE=new eL((t,e,i)=>{i(lb)||(t(lx).toSelf(),t(lb).toService(lx)),t(lB).toSelf().inSingletonScope(),t(lS).toService(lB),t(lT).toSelf().inSingletonScope(),t(lS).toService(lT),t(lC).toSelf().inSingletonScope(),t(lS).toService(lC),eX(t,lS),t(lw).toSelf().inSingletonScope(),t(lA).toService(lw),eX(t,lA)});function lP(t,e=0,i=0){let s;if(!t)return{width:e,height:i};try{s=null==window?void 0:window.getComputedStyle}catch(t){s=()=>({})}let r=s(t);if(/^(\d*\.?\d+)(px)$/.exec(r.width)){let s=parseFloat(r.width)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)||t.clientWidth-1,a=parseFloat(r.height)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)||t.clientHeight-1;return{width:s<=0?e:s,height:a<=0?i:a}}return{width:e,height:i}}let lO=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();function lR(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function lI(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 lL(t,e,i){var s,r;let a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x,S,A,k,M,w,T,{x:C=i.x,y:B=i.y,z:E=i.z,dx:P=i.dx,dy:O=i.dy,dz:R=i.dz,scaleX:I=i.scaleX,scaleY:L=i.scaleY,scaleZ:D=i.scaleZ,alpha:F=i.alpha,beta:z=i.beta,angle:H=i.angle,anchor3d:j=e.attribute.anchor,anchor:V}=e.attribute,N=[0,0,0];if(j){if("string"==typeof j[0]){let t=parseFloat(j[0])/100,i=e.AABBBounds;N[0]=i.x1+(i.x2-i.x1)*t}else N[0]=j[0];if("string"==typeof j[1]){let t=parseFloat(j[1])/100,i=e.AABBBounds;N[1]=i.x1+(i.x2-i.x1)*t}else N[1]=j[1];N[2]=null!=(s=j[2])?s:0}if(nL(t),nD(t,t,[C+P,B+O,E+R]),nD(t,t,[N[0],N[1],N[2]]),a=Math.sin(z),n=Math.cos(z),l=t[4],o=t[5],h=t[6],u=t[7],d=t[8],c=t[9],p=t[10],g=t[11],t!=t&&(t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[3],t[12]=t[12],t[13]=t[13],t[14]=t[14],t[15]=t[15]),t[4]=l*n+d*a,t[5]=o*n+c*a,t[6]=h*n+p*a,t[7]=u*n+g*a,t[8]=d*n-l*a,t[9]=c*n-o*a,t[10]=p*n-h*a,t[11]=g*n-u*a,f=Math.sin(F),m=Math.cos(F),_=t[0],y=t[1],v=t[2],b=t[3],x=t[8],S=t[9],A=t[10],k=t[11],t!=t&&(t[4]=t[4],t[5]=t[5],t[6]=t[6],t[7]=t[7],t[12]=t[12],t[13]=t[13],t[14]=t[14],t[15]=t[15]),t[0]=_*m-x*f,t[1]=y*m-S*f,t[2]=v*m-A*f,t[3]=b*m-k*f,t[8]=_*f+x*m,t[9]=y*f+S*m,t[10]=v*f+A*m,t[11]=b*f+k*m,nD(t,t,[-N[0],-N[1],N[2]]),M=(r=[I,L,D])[0],w=r[1],T=r[2],t[0]=t[0]*M,t[1]=t[1]*M,t[2]=t[2]*M,t[3]=t[3]*M,t[4]=t[4]*w,t[5]=t[5]*w,t[6]=t[6]*w,t[7]=t[7]*w,t[8]=t[8]*T,t[9]=t[9]*T,t[10]=t[10]*T,t[11]=t[11]*T,t[12]=t[12],t[13]=t[13],t[14]=t[14],t[15]=t[15],H){let i,s,r,a,n,l,o,h,u,d,c=nN.allocate(),p=[0,0];
2if(V){if("string"==typeof j[0]){let t=parseFloat(j[0])/100,i=e.AABBBounds;p[0]=i.x1+(i.x2-i.x1)*t}else p[0]=j[0];if("string"==typeof j[1]){let t=parseFloat(j[1])/100,i=e.AABBBounds;p[1]=i.x1+(i.x2-i.x1)*t}else p[1]=j[1]}nD(c,c,[p[0],p[1],0]),i=Math.sin(H),s=Math.cos(H),r=c[0],a=c[1],n=c[2],l=c[3],o=c[4],h=c[5],u=c[6],d=c[7],c!=c&&(c[8]=c[8],c[9]=c[9],c[10]=c[10],c[11]=c[11],c[12]=c[12],c[13]=c[13],c[14]=c[14],c[15]=c[15]),c[0]=r*s+o*i,c[1]=a*s+h*i,c[2]=n*s+u*i,c[3]=l*s+d*i,c[4]=o*s-r*i,c[5]=h*s-a*i,c[6]=u*s-n*i,c[7]=d*s-l*i,nD(c,c,[-p[0],-p[1],0]),nz(t,t,c)}}let lD=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new eZ(["graphic"]),onSetStage:new eZ(["graphic","stage"]),onRemove:new eZ(["graphic"]),onRelease:new eZ(["graphic"]),onAddIncremental:new eZ(["graphic","group","stage"]),onClearIncremental:new eZ(["graphic","group","stage"]),beforeUpdateAABBBounds:new eZ(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new eZ(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new eZ(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new iJ,this.tempAABBBounds2=new iJ}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)}
2beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,r)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){let i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;let s=new iF(t);return i4(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){let{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){let e=ed(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=lI(a,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){let e=ed(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=lR(r,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){let i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,r){if(!e.empty()){let{scaleX:r=i.scaleX,scaleY:a=i.scaleY,stroke:n=i.stroke,shadowBlur:l=i.shadowBlur,lineWidth:o=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:u=i.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,c=this.tempAABBBounds2;if(n&&o&&(nd(d,(o+h)/Math.abs(r+a),s,u),e.union(d),d.setValue(c.x1,c.y1,c.x2,c.y2)),l){let{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:n=i.shadowOffsetY}=t;nd(d,l/Math.abs(r+a)*2,!1,u+1),d.translate(s,n),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0,n=r.transMatrix;r&&r.isContainer&&(a=1!==n.a||0!==n.b||0!==n.c||1!==n.d||0!==n.e||0!==n.f),a&&iq(e,e,n)}validCheck(t,e,i,s){if(!s||null!=t.forceBoundsHeight||null!=t.forceBoundsWidth||s.shadowRoot||s.isContainer)return!0;let{visible:r=e.visible}=t;return!(!s.valid||!r)||(i.empty()||(s.parent&&i.transformWithMatrix(s.parent.globalTransMatrix),this.clearAABBBounds(s,s.stage,i),i.clear()),!1)}updateTempAABBBounds(t){let 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}}};lD=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(hC=eU(nP),function(t,e){hC(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],lD);let lF=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){let i=this.store.get(t);return i?i(e):null}},lz=new eL(t=>{t(nE).to(lD),t(nP).toConstantValue(lF)}),lH=Symbol.for("AutoEnablePlugins"),lj=Symbol.for("PluginService");var lV=function(t,e){return function(i,s){e(i,s,t)}};let lN=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;let{pluginList:i}=e;i&&e7.isBound(lH)&&this.autoEnablePlugins.getContributions().forEach(t=>{i.includes(t.name)&&this.register(t)})}findPluginsByName(t){let 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(){this.onStartupFinishedPlugin.forEach(t=>{t.deactivate(this)}),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach(t=>{t.deactivate(this)}),this.onRegisterPlugin=[]}};lN=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),lV(0,eU(eY)),lV(0,eG(lH)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],lN);let lW=new eL(t=>{t(lj).to(lN),t(eY).toDynamicValue(({container:t})=>new e$(lH,t)).whenTargetNamed(lH)}),lU=new eL(t=>{eX(t,eJ)}),lG=new eL(t=>{t(rn).to(rl).inSingletonScope(),eX(t,rn)}),lY=class{constructor(){this.type="static",this.offscreen=!1,this.global=ie.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");let s=e.getContext().getCanvas().nativeCanvas,r=rm({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,i
2d:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){let 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)?s:"#ffffff"},e),i))}merge(t){t.forEach(t=>{let e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)})}prepare(t,e){}drawTo(t,e,i){var s;let r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!=(s=i.background)?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};lY=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],lY);let l$=new eL(t=>{t(lY).toSelf(),t(n6).toService(lY)}),lX=eW(eD);function lK(t,e,i){let s={},r=[];return t.forEachChildren(t=>{let{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],r.push(i))},i),r.sort((t,e)=>i?e-t:t-e),{childMap:s,zIdxArray:r}}function lq(t,e,i,s=!1,r=!1){let a=!1;if(r)a=!0;else{let i;t.forEachChildren((t,s)=>{let{zIndex:r=e}=t.attribute;if(0===s)i=r;else if(i!==r)return a=!0,!0;return!1},s)}if(a){let{childMap:a,zIdxArray:n}=lK(t,e,s),l=!1;for(let t=0;t<n.length&&!l;t++){let e=a[n[t]];r&&e.sort((t,e)=>{var i,r;return(s?-1:1)*((null!=(i=e.attribute.z)?i:0)-(null!=(r=t.attribute.z)?r:0))});for(let t=0;t<e.length;t++)if(i(e[t],t)){l=!0;break}}}else t.forEachChildren(i,s)}function lZ(t,e,i,s=!1){var r,a,n,l;return r=this,a=void 0,n=void 0,l=function*(){yield t.forEachChildrenAsync(i,s)},new(n||(n=Promise))(function(t,e){function i(t){try{o(l.next(t))}catch(t){e(t)}}function s(t){try{o(l.throw(t))}catch(t){e(t)}}function o(e){var r;e.done?t(e.value):((r=e.value)instanceof n?r:new n(function(t){t(r)})).then(i,s)}o((l=l.apply(r,a||[])).next())})}let lJ=Symbol.for("DrawItemInterceptor"),lQ=new iJ,l0=new iJ;class l1{constructor(){this.order=1}afterDrawItem(t,e,i,s,r){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,r),!1}beforeDrawItem(t,e,i,s,r){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,r),!1}drawItem(t,e,i,s,r){if(!t.shadowRoot)return!1;let{context:a}=i;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){lQ.copy(s.dirtyBounds),l0.copy(s.backupDirtyBounds);let e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,nV.allocate(1,0,0,1,0,0)),a.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(lQ),s.backupDirtyBounds.copy(l0)),!0}}class l2{constructor(){this.order=1}afterDrawItem(t,e,i,s,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,r),!1}drawItem(t,e,i,s,r){if(!t.attribute._debug_bounds)return!1;let{context:a}=i;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);let n=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(n.x1,n.y1,n.width(),n.height()),a.highPerformanceRestore(),!0}}let l3=class{constructor(){this.order=1,this.interceptors=[new l1,new l4,new l5,new l2]}afterDrawItem(t,e,i,s,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!t.attribute._debug_bounds&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,i,s,r))return!0;return!1}beforeDrawItem(t,e,i,s,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!t.attribute._debug_bounds&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let a=0;a<this.interceptors.length;a++)if(this.interceptors[a].beforeDrawItem&&this.interceptors[a].beforeDrawItem(t,e,i,s,r))return!0;return!1}};
2l3=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],l3);class l5{constructor(){this.order=1}beforeDrawItem(t,e,i,s,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,s,r):this.beforeSetInteractive(t,e,i,s,r))}beforeSetInteractive(t,e,i,s,r){let a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();let e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();let e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,s,r){let a=t.baseGraphic,n=!!a.stage,l=a.parent;for(;n&&l&&l.stage!==l;)n=!!l.stage,l=l.parent;if(!n){let e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(a){this.processing=!0;let{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?s.renderGroup(a,i,a.parent.globalTransMatrix):s.renderItem(a,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||((i=lF.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!=(e=i.shadowRoot)?e:i.attachShadow()}}class l4{constructor(){this.order=1}beforeDrawItem(t,e,i,s,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;let{context:a,stage:n}=e.drawParams;a.canvas,a.save(),this.initCanvasCtx(a),a.camera=n.camera;let l=a.currentMatrix;l.a/=a.dpr,l.b/=a.dpr,l.c/=a.dpr,l.d/=a.dpr,l.e/=a.dpr,l.f/=a.dpr;let o=nN.allocate();nF(o,l);let h=a.modelMatrix;return h?o&&(a.modelMatrix=nz(nN.allocate(),h,o)):a.modelMatrix=o,a.setTransform(1,0,0,1,0,0,!0),t.isContainer?lk(a,t,(e,r)=>s.renderGroup(t,i,t.parent.globalTransMatrix,!e&&r),i):s.renderItem(t,i),a.camera=null,a.restore(),a.modelMatrix!==h&&nN.free(a.modelMatrix),a.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}Symbol.for("BoundsAllocate");let l8=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new iJ)}allocate(t,e,i,s){if(!this.pools.length)return(new iJ).setValue(t,e,i,s);let r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=s,r}allocateByObj(t){if(!this.pools.length)return new iJ(t);let e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},l6=Symbol.for("ArcRenderContribution"),l9=Symbol.for("AreaRenderContribution"),l7=Symbol.for("CircleRenderContribution"),ot=Symbol.for("GroupRenderContribution"),oe=Symbol.for("ImageRenderContribution"),oi=Symbol.for("PathRenderContribution"),os=Symbol.for("PolygonRenderContribution"),or=Symbol.for("RectRenderContribution"),oa=Symbol.for("SymbolRenderContribution"),on=Symbol.for("TextRenderContribution");Symbol.for("StarRenderContribution"),Symbol.for("CommonRenderContribution");let ol=Symbol.for("InteractiveSubRenderContribution");var oo=function(t,e){return function(i,s){e(i,s,t)}};class oh{constructor(){this.time=hx.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){var p;let{background:g,backgroundOpacity:f=null!=(p=t.attribute.fillOpacity)?p:o.backgroundOpacity,opacity:m=o.opacity,backgroundMode:_=o.backgroundMode,backgroundFit:y=o.backgroundFit,backgroundKeepAspectRatio:v=o.backgroundKeepAspectRatio,backgroundScale:b=o.backgroundScale,backgroundOffsetX:x=o.backgroundOffsetX,backgroundOffsetY:S=o.backgroundOffsetY,backgroundClip:A=o.backgroundClip,backgroundPosition:k=o.backgroundPosition}=t.attribute;if(g)if(t.backgroundImg&&t.resources){let r=t.resources.get(oc(g));if(!r||"success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){let i=rQ(t.parent).group,{scrollX:s=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,r)}A&&e.clip();let a=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,o),e.globalAlpha=f*m,this.doDrawImage(e,r.data,a,{backgroundMode:_,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:b,backgroundOffsetX:x,backgroundOffsetY:S,backgroundPosition:k}
2),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,o),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s){om(t,e,i,s)}}let ou=new oh,od=new Set(["top","center","bottom"]);function oc(t){var e;return null!=(e=null==t?void 0:t.background)?e:t}let op={"no-repeat-cover":"cover","no-repeat-contain":"contain","no-repeat-fill":"fill","no-repeat-auto":"auto"};function og(t,e,i,s,r){if("number"==typeof t&&Number.isFinite(t))return t;let a=`${null!=t?t:""}`.trim().toLowerCase();if(!a||a===i)return 0;if(a===s)return e/2;if(a===r)return e;if(/^-?\d+(\.\d+)?%$/.test(a))return e*parseFloat(a)/100;let n=Number(a);return Number.isFinite(n)?n:0}function of(...t){for(let e of t)if("number"==typeof e&&Number.isFinite(e)&&e>0)return e;return null}function om(t,e,i,s){var r,a;let{backgroundMode:n,backgroundFit:l,backgroundKeepAspectRatio:o,backgroundScale:h=1,backgroundOffsetX:u=0,backgroundOffsetY:d=0,backgroundPosition:c="top-left"}=s,p=i.width(),g=i.height(),f=function(t){if(!t)return null;let e=of(t.naturalWidth,t.videoWidth,t.width),i=of(t.naturalHeight,t.videoHeight,t.height);return null==e||null==i?null:{width:e,height:i}}(e),{backgroundRepeatMode:m,backgroundSizing:_}=function({backgroundMode:t,backgroundFit:e,backgroundKeepAspectRatio:i}){let s=op[t];return s?{backgroundRepeatMode:"no-repeat",backgroundSizing:s}:{backgroundRepeatMode:t,backgroundSizing:function({backgroundFit:t,backgroundKeepAspectRatio:e}){return t?e?"cover":"fill":"auto"}({backgroundFit:e,backgroundKeepAspectRatio:i})}}({backgroundMode:n,backgroundFit:l,backgroundKeepAspectRatio:o}),y=p,v=g;if(p<=0||g<=0)return;if("no-repeat"===m){let s=null!=(r=null==f?void 0:f.width)?r:p,n=null!=(a=null==f?void 0:f.height)?a:g;if(("cover"===_||"contain"===_)&&f){let t="cover"===_?Math.max(p/f.width,g/f.height):Math.min(p/f.width,g/f.height);s=f.width*t,n=f.height*t}else"fill"===_&&(s=p,n=g);let{x:l,y:o}=function(t,e,i){let[s,r]=function(t){var e,i;let s,r;if(Array.isArray(t))return[null!=(e=t[0])?e:"left",null!=(i=t[1])?i:"top"];let a=`${null!=t?t:"top-left"}`.trim().toLowerCase().replace(/-/g," ").split(/\s+/).filter(Boolean);if(0===a.length)return["left","top"];if(1===a.length){let t=a[0];return"center"===t?["center","center"]:od.has(t)?["center",t]:[t,"center"]}let n=[];for(let t=0;t<2;t++){let e=a[t];"left"!==e&&"right"!==e?"top"!==e&&"bottom"!==e?n.push(e):r=e:s=e}return null==s&&n.length&&(s=n.shift()),null==r&&n.length&&(r=n.shift()),[null!=s?s:"left",null!=r?r:"top"]}(t);return{x:og(s,e,"left","center","right"),y:og(r,i,"top","center","bottom")}}(c,p-(s*=h),g-(n*=h));return void t.drawImage(e,i.x1+l+u,i.y1+o+d,s,n)}if(l&&"repeat"!==m&&f){let i=f.width,s=f.height;"repeat-x"===m?(y=g/s*i,v=g):"repeat-y"===m&&(v=p/i*s,y=p);let r=t.dpr,a=rI.allocate({width:y,height:v,dpr:r}),n=a.getContext("2d");n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.clearRect(0,0,y,v),n.drawImage(e,0,0,y,v),e=a.nativeCanvas),rI.free(a)}let b=t.dpr,x=t.createPattern(e,m);x.setTransform&&x.setTransform(new DOMMatrix([1/b,0,0,1/b,0,0])),t.fillStyle=x,t.translate(i.x1,i.y1),t.fillRect(0,0,p,g),t.translate(-i.x1,-i.y1)}let o_=class{constructor(t){this.subRenderContribitions=t,this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach(p=>{p.render(t,e,i,s,r,a,n,l,o,h,u,d,c)})}};o_=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),oo(0,eU(eY)),oo(0,eG(ol)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],o_);let oy=new class{constructor(){this.time=hx.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){var p,g;let{clipConfig:f}=t.attribute;if(!f)return;let m=t.getClipPath();if(!m)return;let _=!(u||d),y=t.AABBBounds,v=null!=(p=t.attribute.width)?p:y.width(),b=null!=(g=t.attribute.height)?g:y.height();_&&e.save(),e.beginPath(),!1===m.draw(e,[v,b],i+v/2,s+b/2,0)&&e.closePath(),u&&u(e,t.attribute,o,!0),_&&e.clip()}},ov=new class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){let{clipConfig:p}=t.attribute;
2p&&t.getClipPath()&&(u||d||e.restore())}};var ob=function(t,e){return function(i,s){e(i,s,t)}};let ox=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this._renderInGroup=(t,e,i,s)=>{var r;t?e.forEachChildren(t=>{i.break||(t.isContainer?this.renderGroup(t,i,s):this.renderItem(t,i))}):lq(e,sV.zIndex,t=>{i.break||(t.isContainer?this.renderGroup(t,i,s):this.renderItem(t,i))},!1,!!(null==(r=i.context)?void 0:r.camera))},this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new iZ,this.backupDirtyBounds=new iZ,this.global=ie.global,this.layerService=ie.layerService,(0,ev.A)(this.contributions)||(this.contributions=[this.contributions]),this.init()}reInit(){this.init(),this.contributions.forEach(t=>{t.reInit()})}init(){this.contributions.forEach(t=>{if(t.style){let 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){var i;this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;let{context:s,stage:r,viewBox:a,transMatrix:n}=e;if(!s)return;let l=this.dirtyBounds.setValue(0,0,a.width(),a.height());if(r.dirtyBounds&&!r.dirtyBounds.empty()){let t=iV(l,r.dirtyBounds,!1);l.x1=Math.floor(t.x1),l.y1=Math.floor(t.y1),l.x2=Math.ceil(t.x2),l.y2=Math.ceil(t.y2)}let o=s.dpr%1;(o||.5!==o)&&(l.x1=Math.floor(l.x1*s.dpr)/s.dpr,l.y1=Math.floor(l.y1*s.dpr)/s.dpr,l.x2=Math.ceil(l.x2*s.dpr)/s.dpr,l.y2=Math.ceil(l.y2*s.dpr)/s.dpr),this.backupDirtyBounds.copy(l),s.reset(!1),s.save(),s.setClearMatrix(n.a,n.b,n.c,n.d,n.e,n.f),s.clearMatrix(!1),s.translate(a.x1,a.y1,!0),s.beginPath(),s.rect(l.x1,l.y1,l.width(),l.height()),s.clip(),r.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,s,e),(null==(i=t.drawParams)?void 0:i.stage)&&t.drawParams.stage.hooks.afterClearScreen.call(t.drawParams),t.renderTreeRoots.sort((t,e)=>{var i,s;return(null!=(i=t.attribute.zIndex)?i:sV.zIndex)-(null!=(s=e.attribute.zIndex)?s:sV.zIndex)}).forEach(t=>{t.isContainer?this.renderGroup(t,e,nV.allocate(1,0,0,1,0,0)):this.renderItem(t,e)}),s.restore(),s.draw()}doRegister(){throw Error("æä¸æ¯æ")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){let t=function(t,e,i,s=!1){let r=!1;t.forEachChildren((t,e)=>{let{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return r=!0,!0;return!1},s);let a=null,n=!1;if(r){let{childMap:r,zIdxArray:l}=lK(t,i,s),o=!1;for(let t=0;t<l.length&&!o;t++){let i=r[l[t]];for(let t=0;t<i.length;t++){if(n){o=!0,a=i[t];break}i[t]._uid!==e||(n=!0)}}}else t.forEachChildren(t=>n?(a=t,!0):(t._uid===e&&(n=!0),!1),s);return a}(e,i,sV.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&&!iW(t.AABBBounds,this.dirtyBounds,!1)&&"empty"!==t.attribute.boundsMode)return;let r,a=i;if(this.useDirtyBounds){r=l8.allocateByObj(this.dirtyBounds);let e=t.transMatrix;a=nV.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(a.getInverse())}e.isGroupScroll=!(!t.attribute.scrollX&&!t.attribute.scrollY),this.renderItem(t,e,{renderInGroupParams:{skipSort:s,nextM:a},renderInGroup:this._renderInGroup}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),l8.free(r),nV.free(a))}_increaseRender(t,e){let{layer:i,stage:s}=e,{subLayers:r}=i,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(s),zIndex:r.size,group:t},r.set(t._uid,a));let n=a.layer.getNativeHandler().getContext(),l=a.drawContribution||e7.get(li);l.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:a.layer,context:n,startAtId:t._uid,break:!1})),a.drawContribution=l;let o=this._findNextGraphic(t);if(o)if(o.isContainer&&o.incremental)this._increaseRender(o,e);else{let t=r.get(o._uid);
2t||(t={layer:this.layerService.createLayer(s),zIndex:r.size},r.set(o._uid,t));let i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:t.layer,context:i,startAtId:o._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<this.InterceptorContributions.length;s++){let r=this.InterceptorContributions[s];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}let s=this.getRenderContribution(t);if(!s)return;let r,a=!1;if(e.isGroupScroll){let{scrollX:e=0,scrollY:i=0}=t.parent.attribute;a=!0,this.scrollMatrix||(this.scrollMatrix=nV.allocate(1,0,0,1,0,0)),this.scrollMatrix.translate(-e,-i)}if(a&&(r=this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)),this.useDirtyBounds&&!t.isContainer&&"empty"!==t.attribute.boundsMode&&!iW(t.AABBBounds,null!=r?r:this.dirtyBounds,!1)){if(a&&t.parent){let{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}return}let n=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=n),n?t.isContainer&&s.draw(t,this.currentRenderService,e,i):s.draw(t,this.currentRenderService,e,i),a&&t.parent){let{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){let s=this.InterceptorContributions[i];if(s.afterDrawItem&&s.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return eg.getInstance().warn("æªç¥é误ï¼ä¸åºè¯¥èµ°å°è¿é"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){let s=this.styleRenderMap.get(e.attribute.renderStyle);i=s&&s.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var s,r,a,n,l,o,h,u,d,c,p;let{clear:g,viewBox:f}=i,m=f.width(),_=f.height();if(g){e.clearRect(0,0,m,_),(null==(s=t.drawParams)?void 0:s.stage)&&t.drawParams.stage.hooks.afterClearRect.call(t.drawParams);let i=null==(r=t.drawParams)?void 0:r.stage;if(i&&(e.globalAlpha=(null!=(a=i.attribute.opacity)?a:1)*(null!=(n=i.attribute.backgroundOpacity)?n:1)),i&&i.backgroundImg&&i.resources){let t=i.resources.get(oc(g));if(t&&"success"===t.state&&t.data){let s=l8.allocate(0,0,0+m,0+_);om(e,t.data,s,{backgroundMode:null!=(l=i.attribute.backgroundMode)?l:sV.backgroundMode,backgroundFit:null!=(o=i.attribute.backgroundFit)?o:sV.backgroundFit,backgroundKeepAspectRatio:null!=(h=i.attribute.backgroundKeepAspectRatio)?h:sV.backgroundKeepAspectRatio,backgroundScale:null!=(u=i.attribute.backgroundScale)?u:sV.backgroundScale,backgroundOffsetX:null!=(d=i.attribute.backgroundOffsetX)?d:sV.backgroundOffsetX,backgroundOffsetY:null!=(c=i.attribute.backgroundOffsetY)?c:sV.backgroundOffsetY,backgroundPosition:null!=(p=i.attribute.backgroundPosition)?p:sV.backgroundPosition}),l8.free(s)}}else e.fillStyle=s8(e,g,{AABBBounds:{x1:0,y1:0,x2:0+m,y2:0+_}},0,0),e.fillRect(0,0,m,_)}}afterDraw(t,e){}};function oS(t){return(0,eA.A)(t)?(0,ev.A)(t)?t:[t]:[]}function oA(t){if(eM(t))return t[t.length-1]}ox=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),ob(0,lX(ln)),ob(1,eU(eY)),ob(1,eG(lJ)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],ox);let ok=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let r=1;r<t.length;r++){let a=t[r];(null!=(i=null==e?void 0:e(a,s))?i:a-s)>0&&(s=a)}return s},oM=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let r=1;r<t.length;r++){let a=t[r];(null!=(i=null==e?void 0:e(a,s))?i:a-s)<0&&(s=a)}return s};function ow(t,e){if(!(0,ev.A)(t)||!(0,ev.A)(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function oT(t,e=Math.random){let i,s,r=t.length;for(;r;)i=Math.floor(e()*r),s=t[--r],t[r]=t[i],t[i]=s;return t}function oC(t){if(!(0,ev.A)(t))return[t];let e=[];for(let i of t)e.push(...oC(i));return e}let oB=io/2;function oE(t,e,i,s,r,a,n=!0,l){let o;if(Array.isArray(n)&&(l=n,n=!0),s<0&&(e+=s,s=-s),r<0&&(i+=r,r=-r),ed(a,!0))o=[a=ic(a),a,a,a];else if(Array.isArray(a)){let t,e,i=a;switch(i.length){case 0:o=[0,0,0,0];break;case 1:o=[t=ic(i[0]),t,t,t];break;case 2:case 3:o=[t=ic(i[0]),e=ic(i[1]),t,e];break;default:(o=i)[0]=ic(o[0]),o[1]=ic(o[1]),o[2]=ic(o[2]),o[3]=ic(o[3])}}else o=[0,0,0,0];if(s<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,i,s,r);let[h,u,d,c]=[[e,i],[e+s,i],[e+s,i+r],[e,i+r]],p=Math.min(s/2,r/2),g=[Math.min(p,o[0]),Math.min(p,o[1]),Math.min(p,o[2]),Math.min(p,o[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],_=[u[0]-g[1],u[1]],y=[u[0],u[1]+g[1]],v=[d[0]-g[2],d[1]],b=[d[0],d[1]-g[2]],x=[c[0]+g[3],c[1]],S=[c[0],c[
21]-g[3]];if(t.moveTo(f[0],f[1]),n){if(l&&l[0]?l[0](f[0],f[1],_[0],_[1]):t.lineTo(_[0],_[1]),!ow(_,y)){l&&l[0]&&t.moveTo(_[0],_[1]);let e=_[0],i=_[1]+g[1];t.arc(e,i,g[1],-oB,0,!1)}if(l&&l[1]?l[1](y[0],y[1],b[0],b[1]):t.lineTo(b[0],b[1]),!ow(v,b)){let e=b[0]-g[2],i=b[1];l&&l[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,g[2],0,oB,!1)}if(l&&l[2]?l[2](v[0],v[1],x[0],x[1]):t.lineTo(x[0],x[1]),!ow(x,S)){let e=x[0],i=x[1]-g[3];l&&l[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,g[3],oB,io,!1)}if(l&&l[3]?l[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!ow(f,m)){let e=f[0],i=f[1]+g[0];l&&l[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],io,io+oB,!1)}}else l&&l[0]?l[0](f[0],f[1],_[0],_[1]):t.lineTo(_[0],_[1]),l&&l[1]?l[1](_[0],_[1],v[0],v[1]):t.lineTo(v[0],v[1]),l&&l[2]?l[2](v[0],v[1],x[0],x[1]):t.lineTo(x[0],x[1]),l&&l[2]?l[2](x[0],x[1],f[0],f[1]):t.lineTo(f[0],f[1]);return l||t.closePath(),t}function oP(t,e){return((0,ev.A)(t)?t.some(t=>t||void 0===t):!!t)&&e>0}function oO(t,e,i){return i&&t*e>0}function oR(t,e,i,s,r){return r&&t*e>0&&0!==i&&0!==s}function oI(t,e,i,s,r){return r?t*e>0:t*e>0&&0!==i&&0!==s}function oL(t,e,i,s,r,a,n){let l=t-i,o=e-s,h=(n?a:-a)/Math.sqrt(l*l+o*o),u=h*o,d=-h*l,c=t+u,p=e+d,g=i+u,f=s+d,m=(c+g)/2,_=(p+f)/2,y=g-c,v=f-p,b=y*y+v*v,x=r-a,S=c*f-g*p,A=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S)),k=(S*v-y*A)/b,M=(-S*y-v*A)/b,w=(S*v+y*A)/b,T=(-S*y+v*A)/b,C=k-m,B=M-_,E=w-m,P=T-_;return C*C+B*B>E*E+P*P&&(k=w,M=T),{cx:k,cy:M,x01:-u,y01:-d,x11:k*(r/x-1),y11:M*(r/x-1)}}function oD(t,e,i,s,r){let a,n,l,o,h=ic(i-e),u=t.getParsedCornerRadius(),d=(0,ev.A)(u),{outerDeltaAngle:c,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:f,innerEndAngle:m,innerStartAngle:_}=t.getParsePadAngle(e,i),y=d?u[0]:u,v=d?u[1]:u,b=d?u[2]:u,x=d?u[3]:u,S=Math.max(v,y),A=Math.max(b,x),k=S,M=A,w=r*ig(g),T=r*iy(g),C=s*ig(m),B=s*iy(m);if((A>1e-12||S>1e-12)&&(a=r*ig(f),n=r*iy(f),l=s*ig(_),o=s*iy(_),h<io)){var E,P,O,R,I;let t,e,i,h,u,d=(E=l,P=o,O=a,R=n,t=E-w,e=P-T,i=C-O,(u=(h=B-R)*t-i*e)*u<1e-12?[]:(u=(i*(T-R)-h*(w-O))/u,[w+u*t,T+u*e]));if(d){let t=w-d[0],e=T-d[1],i=a-d[0],l=n-d[1],o=1/iy(((I=(t*i+e*l)/(iv(t*t+e*e)*iv(i*i+l*l)))>1?0:I<-1?io:Math.acos(I))/2),h=iv(d[0]*d[0]+d[1]*d[1]);M=i_(A,(s-h)/(o-1)),k=i_(S,(r-h)/(o+1))}}return{outerDeltaAngle:c,xors:w,yors:T,xirs:l,yirs:o,xore:a,yore:n,xire:C,yire:B,limitedOcr:k,limitedIcr:M,outerCornerRadiusStart:y,outerCornerRadiusEnd:v,maxOuterCornerRadius:S,maxInnerCornerRadius:A,outerStartAngle:g,outerEndAngle:f,innerDeltaAngle:p,innerEndAngle:m,innerStartAngle:_,innerCornerRadiusStart:x,innerCornerRadiusEnd:b}}function oF(t,e,i,s,r,a,n){let{startAngle:l,endAngle:o}=t.getParsedAngle(),h=ic(o-l),u=o>l,d=!1;if(r<a){let t=r;r=a,a=t}if(r<=1e-12)e.moveTo(i,s);else if(h>=id-1e-12)e.moveTo(i+r*ig(l),s+r*iy(l)),e.arc(i,s,r,l,o,!u),a>1e-12&&(e.moveTo(i+a*ig(o),s+a*iy(o)),e.arc(i,s,a,o,l,u));else{let{outerDeltaAngle:h,xors:c,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:_,outerCornerRadiusEnd:y,maxOuterCornerRadius:v,xore:b,yore:x,xire:S,yire:A,outerStartAngle:k,outerEndAngle:M,limitedIcr:w,innerDeltaAngle:T,innerEndAngle:C,innerStartAngle:B,innerCornerRadiusStart:E,innerCornerRadiusEnd:P,maxInnerCornerRadius:O}=oD(t,l,o,a,r);if(h<.001)n&&(n[3]||n[1])&&e.moveTo(i+c,s+p),d=!0;else if(m>1e-12){let t=i_(_,m),a=i_(y,m),l=oL(g,f,c,p,r,t,Number(u)),o=oL(b,x,S,A,r,a,Number(u));m<v&&t===a?!n||n[0]?(e.moveTo(i+l.cx+l.x01,s+l.cy+l.y01),e.arc(i+l.cx,s+l.cy,m,ip(l.y01,l.x01),ip(o.y01,o.x01),!u)):e.moveTo(i+l.cx+m*ig(ip(o.y01,o.x01)),s+l.cy+m*iy(ip(o.y01,o.x01))):!n||n[0]?(e.moveTo(i+l.cx+l.x01,s+l.cy+l.y01),t>0&&e.arc(i+l.cx,s+l.cy,t,ip(l.y01,l.x01),ip(l.y11,l.x11),!u),e.arc(i,s,r,ip(l.cy+l.y11,l.cx+l.x11),ip(o.cy+o.y11,o.cx+o.x11),!u),a>0&&e.arc(i+o.cx,s+o.cy,a,ip(o.y11,o.x11),ip(o.y01,o.x01),!u)):a>0?e.moveTo(i+o.cx+a*ig(ip(o.y01,o.x01)),s+o.cy+a*iy(ip(o.y01,o.x01))):e.moveTo(i+b,s+r*iy(M))}else!n||n[0]?(e.moveTo(i+c,s+p),e.arc(i,s,r,k,M,!u)):e.moveTo(i+r*ig(M),s+r*iy(M));if(!(a>1e-12)||T<.001)!n||n[1]?e.lineTo(i+S,s+A):e.moveTo(i+S,s+A),d=!0;else if(w>1e-12){let t=i_(E,w),r=i_(P,w),l=oL(S,A,b,x,a,-r,Number(u)),o=oL(c,p,g,f,a,-t,Number(u));if(!n||n[1]?e.lineTo(i+l.cx+l.x01,s+l.cy+l.y01):e.moveTo(i+l.cx+l.x01,s+l.cy+l.y01),w<O&&t===r){let t=ip(o.y01,o.x01);!n||n[2]?e.arc(i+l.cx,s+l.cy,w,ip(l.y01,l.x01),t,!u):e.moveTo(i+l.cx+ig(t),s+l.cy+iy(t))}else!n||n[2]?(r>0&&e.arc(i+l.cx,s+l.cy,r,ip(l.y01,l.x01),ip(l.y11,l.x11),!u),e.arc(i,s,a,ip(l.cy+l.y11,l.cx+l.x11),ip(o.cy+o.y11,o.cx+o.x11),u),t>0&&e.arc(i+o.cx,s+o.cy,t,ip(o.y11,o.x11),ip(o.y01,o.x01),!u)):t>0?e.moveTo(i+o.cx+t*ig(ip(o.y01,o.x01)),s+o.cy+t*iy(ip(o.y01,o.x01))):e.moveTo(i+g,s+f)}else!n||n[1]?e.lineTo(i+S,s+A):e.moveTo(i+S,s+A),!n||n[2]?e.arc(i,s,a,C,B,u):e.moveTo(i+a*ig(B),s+a*iy(B)
2)}return n?n[3]&&e.lineTo(i+r*ig(l),s+r*iy(l)):e.closePath(),d}let oz=new class extends oh{constructor(){super(...arguments),this.time=hx.beforeFillStroke}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let{background:c,backgroundOpacity:p=o.backgroundOpacity,opacity:g=o.opacity,backgroundMode:f=o.backgroundMode,backgroundFit:m=o.backgroundFit,backgroundKeepAspectRatio:_=o.backgroundKeepAspectRatio,backgroundScale:y=o.backgroundScale,backgroundOffsetX:v=o.backgroundOffsetX,backgroundOffsetY:b=o.backgroundOffsetY,backgroundClip:x=o.backgroundClip,backgroundPosition:S=o.backgroundPosition}=t.attribute;if(c)if(t.backgroundImg&&t.resources){let i=t.resources.get(oc(c));if(!i||"success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);let s=t.AABBBounds;e.globalAlpha=p*g,x&&e.clip(),this.doDrawImage(e,i.data,s,{backgroundMode:f,backgroundFit:m,backgroundKeepAspectRatio:_,backgroundScale:y,backgroundOffsetX:v,backgroundOffsetY:b,backgroundPosition:S}),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.globalAlpha=p*g,e.fillStyle=c,e.fill(),e.highPerformanceRestore()}};var oH=function(t,e){return function(i,s){e(i,s,t)}};let oj=class{constructor(t){this.groupRenderContribitions=t,this.numberType=nx}reInit(){this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(oz)}drawShape(t,e,i,s,r,a,n,l,o){let{clip:h,fill:u,stroke:d,background:c}=t.attribute;if(!(h||u||d||c))return;o=null!=o?o:rQ(t,null==a?void 0:a.theme).group;let{opacity:p=o.opacity,width:g=o.width,height:f=o.height,fillOpacity:m=o.fillOpacity,strokeOpacity:_=o.strokeOpacity,cornerRadius:y=o.cornerRadius,path:v=o.path,lineWidth:b=o.lineWidth,visible:x=o.visible,fillStrokeOrder:S=o.fillStrokeOrder,cornerType:A=o.cornerType,x:k=o.x,y:M=o.y}=t.attribute,w=oR(p,m,g,f,u),T=oI(p,_,g,f),C=!(!u&&!c),B=oP(d,b);if(!t.valid||!x||!h&&(!C&&!B||!(w||T||n||l||c)))return;if(v&&v.length&&r.drawContribution){let t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,v.forEach(t=>{r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,a)}),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===y||(0,ev.A)(y)&&y.every(t=>0===t)?(e.beginPath(),e.rect(i,s,g,f)):(e.beginPath(),oE(e,i,s,g,f,y,"bevel"!==A));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(oz));let E={doFill:C,doStroke:B};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this._groupRenderContribitions.forEach(a=>{a.time===hx.beforeFillStroke&&a.drawShape(t,e,i,s,C,B,w,T,o,r,n,l,E)}),h&&e.clip();let P=()=>{E.doFill&&(n?n(e,t.attribute,o):w&&(e.setCommonStyle(t,t.attribute,k-i,M-s,o),e.fill()))},O=()=>{E.doStroke&&(l?l(e,t.attribute,o):T&&(e.setStrokeStyle(t,t.attribute,k-i,M-s,o),e.stroke()))};S?(O(),P()):(P(),O()),this._groupRenderContribitions.forEach(a=>{a.time===hx.afterFillStroke&&a.drawShape(t,e,i,s,C,B,w,T,o,r,n,l)})}draw(t,e,i,s){var r,a;let n,{context:l}=i;if(!l)return;let{clip:o,baseOpacity:h=1,drawMode:u}=t.attribute,d=l.nativeContext,c=l.canvas.nativeCanvas;if(u>0){let{x:e,y:i,width:s,height:r}=t.attribute,a=l.canvas,n=ie.global.createCanvas({width:a.width,height:a.height,dpr:1}),o=n.getContext("2d"),h=l.nativeContext.getTransform();o.setTransform(h.a,h.b,h.c,h.d,h.e,h.f),1===u&&(o.save(),o.clearRect(0,0,a.width,a.height),o.beginPath(),o.rect(e,i,s,r),o.clip(),o.drawImage(a.nativeCanvas,0,0,a.width,a.height,0,0,a.displayWidth,a.displayHeight),o.restore()),l.nativeContext=o,a.nativeCanvas=n}o?l.save():l.highPerformanceSave();let p=l.baseGlobalAlpha;l.baseGlobalAlpha*=h;let g=l.modelMatrix;if(l.camera){let e=rQ(t,null==s?void 0:s.theme).group,i=nN.allocate(),r=nN.allocate();lL(r,t,e),nz(i,g||i,r),l.modelMatrix=i,nN.free(r),l.setTransform(1,0,0,1,0,0,!0)}else l.transformFromMatrix(t.transMatrix,!0);l.beginPath(),s.skipDraw?this.drawShape(t,l,0,0,i,s,()=>!1,()=>!1):this.drawShape(t,l,0,0,i,null,null,null);let{scrollX:f,scrollY:m}=t.attribute;if((f||m)&&l.translate(f,m),s&&s.renderInGroup&&(n=s.renderInGroup(null==(r=s.renderInGroupParams)?void 0:r.skipSort,t,i,null==(a=s.renderInGroupParams)?void 0:a.nextM)),l.modelMatrix!==g&&nN.free(l.modelMatrix),l.modelMatrix=g,l.baseGlobalAlpha=p,u>0){let{x:e,y:i,width:s,height:r}=t.attribute,a=l.nativeContext,n=l.canvas.nativeCanvas;d.save(),d.setTransform(l.dpr,0,0,l.dpr,0,0,!0),1===u&&a.rect(e,i,s,r),d.drawImage(n,
20,0,n.width,n.height,0,0,l.canvas.displayWidth,l.canvas.displayHeight);let o=a.getTransform();d.setTransform(o.a,o.b,o.c,o.d,o.e,o.f),l.nativeContext=d,l.canvas.nativeCanvas=c,d.restore()}n&&n.then?n.then(()=>{o?l.restore():l.highPerformanceRestore()}):o?l.restore():l.highPerformanceRestore()}};oj=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),oH(0,eU(eY)),oH(0,eG(ot)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],oj);let oV={x:0,y:0,z:0,lastModelMatrix:null};class oN{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(oy),this.builtinContributions.push(ov),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===hx.beforeFillStroke),this._afterRenderContribitions=this._renderContribitions.filter(t=>t.time===hx.afterFillStroke))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,s,r,a,n,l,o,h,u,d,c){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,r,a,n,l,o,h,u,d,c)})}afterRenderStep(t,e,i,s,r,a,n,l,o,h,u,d,c){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,r,a,n,l,o,h,u,d,c)})}drawPathProxy(t,e,i,s,r,a,n,l){if(!t.pathProxy)return!1;let o=rQ(t,null==a?void 0:a.theme)[t.type.replace("3d","")],{fill:h=o.fill,stroke:u=o.stroke,opacity:d=o.opacity,fillOpacity:c=o.fillOpacity,lineWidth:p=o.lineWidth,strokeOpacity:g=o.strokeOpacity,visible:f=o.visible,x:m=o.x,y:_=o.y}=t.attribute,y=h&&d*c>0,v=d*g>0,b=!!h,x=oP(u,p);return!f||!b&&!x||!y&&!v&&!n&&!l||(e.beginPath(),i4(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,b,x,y,v,o,r,n,l),x&&(l?l(e,t.attribute,o):v&&(e.setStrokeStyle(t,t.attribute,i-m,s-_,o),e.stroke())),b&&(n?n(e,t.attribute,o):y&&(e.setCommonStyle(t,t.attribute,i-m,s-_,o),e.fill())),this.afterRenderStep(t,e,i,s,b,x,y,v,o,r,n,l),!0)}valid(t,e,i,s){let{fill:r=e.fill,background:a,stroke:n=e.stroke,opacity:l=e.opacity,fillOpacity:o=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:d=e.visible}=t.attribute,c=r&&l*o>0,p=l*u>0,g=!(!r&&!a),f=oP(n,h);return!(!t.valid||!d)&&!(!g&&!f)&&!!(c||p||i||s||a)&&{fVisible:c,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,s=!1){let{x:r=e.x,y:a=e.y,z:n=e.z,scaleX:l=e.scaleX,scaleY:o=e.scaleY,angle:h=e.angle,postMatrix:u}=t.attribute,d=i.modelMatrix,c=i.camera;oV.x=r,oV.y=a,oV.z=n,oV.lastModelMatrix=d;let p=c&&(s||function(t){let{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!u:1===l&&1===o&&0===h&&!u;if(p){let s=nN.allocate(),r=nN.allocate();lL(r,t,e),nz(s,d||s,r),oV.x=0,oV.y=0,oV.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),nN.free(r)}if(g&&!d){let s=t.getOffsetXY(e);oV.x+=s.x,oV.y+=s.y,oV.z=n,i.setTransformForCurrent()}else if(p)oV.x=0,oV.y=0,oV.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(c&&i.project){let s=t.getOffsetXY(e);oV.x+=s.x,oV.y+=s.y,this.transformWithoutTranslate(i,oV.x,oV.y,oV.z,l,o,h)}else i.transformFromMatrix(t.transMatrix,!0),oV.x=0,oV.y=0,oV.z=0;return oV}transformUseContext2d(t,e,i,s){let r=s.camera;if(this.camera=r,r){let e=t.AABBBounds,r=e.x2-e.x1,a=e.y2-e.y1,n=s.project(0,0,i),l=s.project(r,0,i),o=s.project(r,a,i);s.camera=null;let h=1/(0*(a-0)-r*a+0*r+(r-r)*0),u=-(0*(o.x-l.x)-0*o.x+a*l.x+(0-a)*n.x)*h,d=(0*o.y+0*(l.y-o.y)-a*l.y+(a-0)*n.y)*h,c=(0*(o.x-l.x)-r*o.x+r*l.x+(r-r)*n.x)*h,p=-(r*o.y+0*(l.y-o.y)-r*l.y+(r-r)*n.y)*h,g=(0*(a*l.x-0*o.x)+0*(r*o.x-r*l.x)+(0*r-r*a)*n.x)*h,f=(0*(a*l.y-0*o.y)+0*(r*o.y-r*l.y)+(0*r-r*a)*n.y)*h;s.setTransform(u,d,c,p,g,f,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,r,a,n){let l=t.project(e,i,s);t.translate(l.x,l.y,!1),t.scale(r,a,!1),t.rotate(n,!1),t.translate(-l.x,-l.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,r,a){let{context:n}=s;if(!n)return;let{renderable:l}=t.attribute;if(!1===l)return;n.highPerformanceSave();let{x:o,y:h,z:u,lastModelMatrix:d}=this.transform(t,e,n,i);this.z=u,this.drawPathProxy(t,n,o,h,s,r)||(this.drawShape(t,n,o,h,s,r,null,null,a),this.z=0,n.modelMatrix!==d&&nN.free(n.modelMatrix),n.modelMatrix=d),n.highPerformanceRestore()}}function oW(t,e,i,s){if(!e.p1)return;let{offsetX:r=0,offsetY:a=0,offsetZ:n=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,a+e.p1.y,r+e.p2.x,a+e.p2.y,r+e.p3.x,a+e.p3.y,n):t.lineTo(r+e.p1.x,a+e.p1.y,n);else if(e.p2&&e.p3){let[s]=sn(e,i);t.bezierCurveTo(r+s.p1.x,a+s.p1.y,r+s.p2.x,a+s.p2.y,r+s.p3.x,a+s.p3.y,n)}else{let s=e.getPointAt(i);t.lineTo(r+s.x,a+s.y,n)}}function oU(t,e,i,s,r,a,n){var l;let o=e.p0,h=s;if(i&&i.originP1===i.originP2&&(o=i.p0),e.defined)s||(t.lineTo(o.x+r,o.y+a,n),h=!s);else{let u,{originP1:d,originP2:c}=e;if(d&&!1!==d.defined&&!i?u=o:d&&!1!==c.defined&&(u=null!=(l=e.p3)?l:e.p1),s){h=!s;let i=u?u.x:e.p0.x,l=u?u.y:e.p0.y;t.moveTo(i+r,l+a,n)}else u&&(h=!s,t.lineTo(u.x+r,u.y+a,n))}return h}function oG(t,e,i,s,r){let a,{offsetX:n=0,offsetY:l=0,offsetZ:o=0,mode:h="none",drawConnect:u=!1}=r||{};if(u&&"none"===h||!e)return;let d=!0,{curves:c}=e;if(i>=1){if(u){let e,i=!0;
2c.forEach((s,r)=>{s.originP1!==s.originP2&&(i=oU(t,s,e,i,n,l,o)),e=s})}else c.forEach(e=>{e.defined?(d&&t.moveTo(e.p0.x+n,e.p0.y+l,o),oW(t,e,1,r),d=!1):d=!0});return}if(i<=0)return;"x"===s?a=hv.ROW:"y"===s?a=hv.COLUMN:"auto"===s&&(a=e.direction);let p=i*e.tryUpdateLength(a),g=0,f=!0,m=null;for(let e=0,i=c.length;e<i;e++){let i=c[e],s=i.getLength(a),h=(p-g)/s;if(g+=s,h<0)break;if(u){if(i.originP1===i.originP2){m=i;continue}f=oU(t,i,m,f,n,l,o),m=i}else{if(!i.defined){d=!0;continue}d&&t.moveTo(i.p0.x+n,i.p0.y+l,o),oW(t,i,i_(h,1),r),d=!1}}}let oY=class extends oN{constructor(){super(...arguments),this.numberType=nA}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).line;this._draw(t,r,!1,i,s)}drawSegmentItem(t,e,i,s,r,a,n,l,o,h,u,d,c,p,g){var f;if(!e)return;t.beginPath(),oG(t,e,o,h,{offsetX:u,offsetY:d,offsetZ:null!=(f=this.z)?f:0}),c.cache&&!(0,ev.A)(c.cache)&&c.cache.curves.every(t=>t.defined)&&c.attribute.curveType&&c.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(c,n,l);let{x:m=0,x:_=0}=n;return!1!==i&&(p?p(t,n,l):r&&(t.setCommonStyle(c,n,m-u,_-d,l),t.fill())),!1!==s&&(g?g(t,n,l):a&&(t.setStrokeStyle(c,n,m-u,_-d,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,r,a,n,l,o,h,u,d,c){var p;e.beginPath();let g=null!=(p=this.z)?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+n,m.y+l,g);for(let t=1;t<f.length;t++){let i=f[t];e.lineTo(i.x+n,i.y+l,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o);let{x:_=0,x:y=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,o):r&&(e.setCommonStyle(t,t.attribute,_-n,y-l,o),e.fill())),!1!==s&&(c?c(e,t.attribute,o):a&&(e.setStrokeStyle(t,t.attribute,_-n,y-l,o),e.stroke()))}drawShape(t,e,i,s,r,a,n,l){let o=rQ(t,null==a?void 0:a.theme).line,{fill:h=o.fill,stroke:u=o.stroke,fillOpacity:d=o.fillOpacity,strokeOpacity:c=o.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=o.curveTension,connectedType:_=o.connectedType}=t.attribute;if(!this.valid(t,o,n,l))return;let{curveType:y=o.curveType}=t.attribute;f&&"linear"===y&&(y="linearClosed");let{clipRange:v=o.clipRange,clipRangeByDimension:b=o.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some(t=>!1===t.defined)&&"linear"===y)return this.drawLinearLineHighPerformance(t,e,!!h,!!u,d,c,i,s,o,r,a,n,l);function x(t,e){return"none"===e?t:t.filter(t=>!1!==t.defined)}if(t.shouldUpdateShape()){let{points:e,segments:i}=t.attribute;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);let r=sP(x(t.points,_),y,{startPoint:e,curveTension:m});return s=r,r}).filter(t=>!!t),"linearClosed"===y){let e;for(let i=0;i<t.cache.length;i++){let s=t.cache[i];for(let t=0;t<s.curves.length;t++)if(s.curves[t].defined){e=s.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=sP(x(e,_),y,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){let r=t.attribute.segments.filter(t=>t.points.length);if(1===r[0].points.length&&r.shift(),1===v){let a=!1;t.cache.forEach((p,g)=>{a||(a=this.drawSegmentItem(e,p,!!h,!!u,d,c,r[g],[o,t.attribute],v,b,i,s,t,n,l))})}else{let a=v*t.cache.reduce((t,e)=>t+e.getLength(),0),p=0,g=!1;t.cache.forEach((f,m)=>{if(g)return;let _=f.getLength(),y=(a-p)/_;p+=_,y>0&&(g=this.drawSegmentItem(e,f,!!h,!!u,d,c,r[m],[o,t.attribute],i_(y,1),b,i,s,t,n,l))})}}else this.drawSegmentItem(e,t.cache,!!h,!!u,d,c,t.attribute,o,v,b,i,s,t,n,l)}};oY=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],oY);
2let o$=class extends oY{constructor(){super(...arguments),this.numberType=nA}drawShape(t,e,i,s,r,a,n,l){if(t.incremental&&r.multiGraphicOptions){let{startAtIdx:e,length:a}=r.multiGraphicOptions,{segments:o=[]}=t.attribute;if(e>o.length)return;let h=rQ(t).line,{fill:u=h.fill,stroke:d=h.stroke,opacity:c=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,_=oP(d,f);if(!t.valid||!m||!u&&!_||!(u&&c*p>0||c*g>0||n||l))return;let{context:y}=r;for(let r=e;r<e+a;r++)this.drawIncreaseSegment(t,y,o[r-1],o[r],t.attribute.segments[r],[h,t.attribute],i,s)}else super.drawShape(t,e,i,s,r,a,n,l)}drawIncreaseSegment(t,e,i,s,r,a,n,l){s&&(e.beginPath(),function(t,e,i,s){let{offsetX:r=0,offsetY:a=0}=s||{},n=e?e.points[e.points.length-1]:i.points[0];t.moveTo(n.x+r,n.y+a),i.points.forEach(e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+a):t.moveTo(e.x+r,e.y+a)})}(e.nativeContext,i,s,{offsetX:n,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,n,l,a),e.stroke())}};function oX(t,e,i,s){let{offsetX:r=0,offsetY:a=0,offsetZ:n=0}=s||{},l=!0;e.forEach(e=>{e.defined?(l&&t.moveTo(e.p0.x+r,e.p0.y+a,n),oW(t,e,1,s),l=!1):l=!0}),l=!0;for(let e=i.length-1;e>=0;e--){let o=i[e];o.defined?(l&&t.lineTo(o.p0.x+r,o.p0.y+a,n),oW(t,o,1,s),l=!1):l=!0}t.closePath()}o$=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],o$);let oK=["symbolType","size",...nX];class oq extends n0{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=nC}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let s=null;try{s=new Path2D}catch(t){return null}let r=this.getParsedPath();if(!r)return null;r.draw(s,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{size:t}=this.attribute;return(0,ev.A)(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){let{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return rQ(this).symbol}
2updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));let{tb1:r,tb2:a}=ie.graphicService.updateTempAABBBounds(i);((t,e,i)=>{let{outerBorder:s,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(s){let t=e.outerBorder,{distance:n=t.distance,lineWidth:l=t.lineWidth}=s;nd(i,n+(r+l)/2,!0,a)}})(t,e,r),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;let{lineJoin:n=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateSymbolAABBBoundsImprecise(t,e,i){let{size:s=e.size}=t;if((0,ev.A)(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{let t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){let{size:s=e.size}=t,r=this.getParsedPath();return r&&r.bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,oK)}needUpdateTag(t){return super.needUpdateTag(t,oK)}toCustomPath(){let t=this.getParsedPath();if(!t)return null;let e=this.attribute.size,i=(0,ev.A)(e)?e:[e,e];return t.path?(new sO).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new sO).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new oq(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return oq.NOWORK_ANIMATE_ATTR}}function oZ(t){return new oq(t)}oq.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},nQ);class oJ{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,s,r){let a=(t-2*e)/2,n=s.dpr,l=rI.allocate({width:t,height:t,dpr:n}),o=l.getContext("2d");if(!o)return null;o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,t,t),r(a,o);let h=s.createPattern(l.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),rI.free(l),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,id),e.fill()})}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(e,s)=>{let r=t/2;s.fillStyle=i,s.moveTo(r,r-e),s.lineTo(e+r,r),s.lineTo(r,r+e),s.lineTo(r-e,r),s.closePath(),s.fill()})}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(t,s)=>{s.fillStyle=i,s.fillRect(e,e,2*t,2*t)})}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(s,r)=>{r.fillStyle=i,r.fillRect(e,0,2*s,t)})}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(s,r)=>{r.fillStyle=i,r.fillRect(0,e,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);let r=t/2,a=-r;s.moveTo(r,a),s.lineTo(r+t,a+t),s.moveTo(-r,-a),s.lineTo(-r+t,-a+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);let r=t/2;s.moveTo(t+r,r),s.lineTo(r,r+t),s.moveTo(t-r,-r),s.lineTo(-r,-r+t),s.stroke()})}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,(t,s)=>{s.fillStyle=i,s.fillRect(e,e,t,t),s.fillRect(e+t,e+t,t,t)})}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){this.textureMap||this.initTextureMap(e,t.stage);let{texture:p=o.texture,textureColor:g=o.textureColor,textureSize:f=o.textureSize,texturePadding:m=o.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,o,g,f,m)}drawTexture(t,e,i,s,r,a,n,l,o){var h;let{textureRatio:u=a.textureRatio,textureOptions:d=null}=e.attribute,c=this.textureMap.get(t);if(!c)switch(t){case"circle":c=this.createCirclePattern(l,o,n,i);break;case"diamond":c=this.createDiamondPattern(l,o,n,i);break;case"rect":c=this.createRectPattern(l,o,n,i);break;case"vertical-line":c=this.createVerticalLinePattern(l,o,n,i);break;case"horizontal-line":c=this.createHorizontalLinePattern(l,o,n,i);break;case"bias-lr":c=this.createBiasLRLinePattern(l,o,n,i);break;case"bias-rl":c=this.createBiasRLLinePattern(l,o,n,i);break;case"grid":c=this.createGridPattern(l,o,n,i)}if(d&&d.dynamicTexture){let c,{gridConfig:p={},useNewCanvas:g}=d,f=e.AABBBounds;s=f.x1,r=f.y1;let m=i;if(g){let t=(c=rI.allocate({width:f.width(),height:f.height(),dpr:i.dpr})).getContext("2d");t.clearRect(0,0,f.width(),f.height()),s=0,r=0,i=t}if(m.save(),e.parent&&!e.transMatrix.onlyTranslate()){let{scrollX:t=0,scrollY:i=0}=e.parent.attribute;m.setTransformFromMatrix(e.parent.globalTransMatrix),m.translate(t,i,!0)}m.setCommonStyle(e,e.attribute,s,r,a),m.clip();let _=f.width(),y=f.height(),v=p.columns?p.columns:Math.ceil(_/l),b=p.rows?p.rows:Math.ceil(y/l),x=p.gutterColumn?p.gutterColumn:2*o,S=p.gutterRow?p.gutterRow:2*o;this._tempSymbolGraphic||(this._tempSymbolGraphic=oZ({}));let A=p.columns?_/p.columns:l,k=p.rows?y/p.rows:l;this._tempSymbolGraphic.setAttributes({size:[A-x,k-S],symbolType:t});let M=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<b;t++)for(let a=0;a<v;a++){let o=s+l/2+a*l,c=r+l/2+t*l;null==(h=d.beforeDynamicTexture)||h.call(d,i,t,a,b,v,u,e,f.width(),f.height()),i.beginPath(),!1===M.draw(i,Math.min(A-x,k-S),o,c,0)&&i.closePath(),i.fillStyle=n,d.dynamicTexture(i,t,a,b,v,u,e,f.width(),f.height())}g&&(m.globalAlpha=1,m.drawImage(c.nativeCanvas,0,0,c.nativeCanvas.width,c.nativeCanvas.height,f.x1,f.y1,f.width()*m.dpr,f.height()*m.dpr)),m.restore(
2)}else if(c)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,r,a),i.fillStyle=c,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,s,r,a),i.clip();let t=e.AABBBounds;(function(t,e,i,s,r,a,n){let{fill:l="orange",percent:o=.6,frequency:h=4,opacity:u,phi:d=0}=r,{amplitude:c=10}=r;c*=e<=.5?4*e-1:-4*e+3;let p=s*(1-o),g=Math.max(Math.round(i/70),2);t.beginPath(),t.moveTo(0+a,s+n),t.lineTo(0+a,p+n);let f=i/h*e,m=i/Math.PI/(2*h);for(let e=0;e<i;e+=g){let i=c*Math.sin((e+f+d)/m+d);t.lineTo(e+a,p+i+n)}t.lineTo(i+a,s+n),t.closePath(),t.fillStyle=l,isFinite(u)&&(t.globalAlpha=u),t.fill()})(i,u,t.width(),t.height(),Object.assign(Object.assign({},d||{}),{fill:n}),s+t.x1-s,r+t.y1-r),i.restore()}}}let oQ=new oJ,o0=new class extends oJ{constructor(){super(...arguments),this.time=hx.afterFillStroke}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);let{attribute:_=t.attribute}=c||{},{texture:y=null!=(p=t.attribute.texture)?p:al(o,"texture"),textureColor:v=null!=(g=t.attribute.textureColor)?g:al(o,"textureColor"),textureSize:b=null!=(f=t.attribute.textureSize)?f:al(o,"textureSize"),texturePadding:x=null!=(m=t.attribute.texturePadding)?m:al(o,"texturePadding")}=_;y&&this.drawTexture(y,t,e,i,s,o,v,b,x)}};var o1=function(t,e){return function(i,s){e(i,s,t)}};let o2=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=ny,this.builtinContributions=[o0,ou],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,r,a,n,l,o,h,u,d,c){var p,g,f;let{points:m}=t.attribute;if(m.length<2)return;e.beginPath();let _=null!=(p=this.z)?p:0,y=m[0];e.moveTo(y.x+n,y.y+l,_);for(let t=1;t<m.length;t++){let i=m[t];e.lineTo(i.x+n,i.y+l,_)}for(let t=m.length-1;t>=0;t--){let i=m[t];e.lineTo((null!=(g=i.x1)?g:i.x)+n,(null!=(f=i.y1)?f:i.y)+l,_)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,n,l,!!r,!1,i,!1,o,h,d,null,{attribute:t.attribute});let{x:v=0,x:b=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,o):r&&(e.setCommonStyle(t,t.attribute,v-n,b-l,o),e.fill())),this.afterRenderStep(t,e,n,l,!!r,!1,i,!1,o,h,d,null,{attribute:t.attribute}),(()=>{var i,r;if(s){let{stroke:s=o&&o.stroke}=t.attribute;if((0,ev.A)(s)&&(s[0]||s[2])&&!1===s[1]){if(e.beginPath(),s[0]){e.moveTo(y.x+n,y.y+l,_);for(let t=1;t<m.length;t++){let i=m[t];e.lineTo(i.x+n,i.y+l,_)}}else if(s[2]){let t=m[m.length-1];e.moveTo(t.x+n,t.y+l,_);for(let t=m.length-2;t>=0;t--){let s=m[t];e.lineTo((null!=(i=s.x1)?i:s.x)+n,(null!=(r=s.y1)?r:s.y)+l,_)}}}c?c(e,t.attribute,o):(e.setStrokeStyle(t,t.attribute,v-n,b-l,o),e.stroke())}})()}drawShape(t,e,i,s,r,a,n,l){var o,h,u,d,c,p;let g=rQ(t,null==a?void 0:a.theme).area,{fill:f=g.fill,stroke:m=g.stroke,fillOpacity:_=g.fillOpacity,z:y=g.z,strokeOpacity:v=g.strokeOpacity,curveTension:b=g.curveTension,connectedType:x=g.connectedType}=t.attribute,S=this.valid(t,g,n,l);if(!S)return;let{doFill:A}=S,k=S.doStroke&&S.sVisible,{clipRange:M=g.clipRange,closePath:w,points:T,segments:C}=t.attribute,{curveType:B=g.curveType}=t.attribute;function E(t,e){return"connect"!==e?t:t.filter(t=>!1!==t.defined)}if(w&&"linear"===B&&(B="linearClosed"),1===M&&!C&&!T.some(t=>!1===t.defined)&&"linear"===B)return this.drawLinearAreaHighPerformance(t,e,!!f,k,_,v,i,s,g,r,a,n,l);if(t.shouldUpdateShape()){if(C&&C.length){let e,i,s,r=C.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);let r=sP(E(t.points,x),B,{startPoint:e,curveTension:b});return i=r,r}).filter(t=>!!t),a=[];for(let t=C.length-1;t>=0;t--){let e=C[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!=(o=e[t].x1)?o:e[t].x,y:null!=(h=e[t].y1)?h:e[t].y});if(0!==t){let e=C[t-1].points,s=e[e.length-1];s&&i.push({x:null!=(u=s.x1)?u:s.x,y:null!=(d=s.y1)?d:s.y})}i.length>1&&(s=sP(E(i,x),"stepBefore"===B?"stepAfter":"stepAfter"===B?"stepBefore":B,{curveTension:b}),a.unshift(s))}t.cacheArea=a.map((t,e)=>({top:r[e],bottom:t}))}else{if(!T||!T.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{let e=E(T,x),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!=(c=e[t].x1)?c:e[t].x,y:null!=(p=e[t].y1)?p:e[t].y});t.cacheArea={top:sP(e,B,{curveTension:b}),bottom:sP(i,"stepBefore"===B?"stepAfter":"stepAfter"===B?"stepBefore":B,{curveTension:b})}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){let a=t.attribute.segments.filter(t=>t.points.length);if(1===a[0].points.length&&a.shift(),1===M){let o=!1;t.cacheArea.forEach((h,u)=>{o||(o=this.drawSegmentItem(e,h,A,_,k,v,a[u],[g,t.attribute],M,i,s,y,t,r,n,l))})}else{let o=M*t.cacheArea.reduce((t,e)=>t+e.top.getLength(),0),h=0,u=!1;t.cacheArea.forEach((d,c)=>{if(u)return;let p=d.top.getLength(),f=(o-h)/p;h+=p,f>0&&(u=this.drawSegmentItem(e,d,A,_,k,v,a[c],[g,t.attribute],i_(f,1),i,s,y,t,r,n,l))})}}else this.drawSegmentItem(e,t.cacheArea,A,_,k,v,t.attribute,g,M,i,s,y,t,r,n,l)}
2draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).area;this._draw(t,r,!1,i,s)}drawSegmentItem(t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f){return this._drawSegmentItem(t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f)}_drawSegmentItem(t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f){if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;t.beginPath();let{points:m,segments:_}=c.attribute,y,v,b=hv.ROW;if(_){let t=_[_.length-1];v=_[0].points[0],y=t.points[t.points.length-1]}else v=m[0],y=m[m.length-1];let x=ic(y.x-v.x),S=ic(y.y-v.y);(function(t,e,i,s){var r;let{top:a,bottom:n}=e;if(a.curves.length!==n.curves.length)return;if(i>=1){let e=[],i=[],r=!0;for(let l=0,o=a.curves.length;l<o;l++){let h=a.curves[l];r!==h.defined?(r?(oX(t,e,i,s),e.length=0,i.length=0):(e.push(h),i.push(n.curves[o-l-1])),r=!r):r&&(e.push(h),i.push(n.curves[o-l-1]))}return oX(t,e,i,s)}if(i<=0)return;let{direction:l}=s||{},{curves:o}=a,h=null!=(r=o[o.length-1].p3)?r:o[o.length-1].p1,u=ic(h.x-o[0].p0.x),d=ic(h.y-o[0].p0.y);l=null!=l?l:u>d?hv.ROW:hv.COLUMN,Number.isFinite(u)||(l=hv.COLUMN),Number.isFinite(d)||(l=hv.ROW);let c=i*(l===hv.ROW?u:d),p=0,g=!0,f=[],m=[];for(let e=0,i=a.curves.length;e<i;e++){let r=a.curves[e],o=r.getLength(l),h=(c-p)/o;if(h<0)break;p+=o;let u=null,d=null;g!==r.defined?(g?(oX(t,f,m,s),f.length=0,m.length=0):(u=r,d=n.curves[i-e-1]),g=!g):g&&(u=r,d=n.curves[i-e-1]),u&&d&&(h<1&&(u=u.p2&&u.p3?sn(u,h)[0]:i7(u,h)[0],d=d.p2&&d.p3?sn(d,1-h)[1]:i7(d,1-h)[1]),u.defined=g,d.defined=g,f.push(u),m.push(d)),u=null,d=null}oX(t,f,m,s)})(t,e,o,{offsetX:h,offsetY:u,offsetZ:d,direction:b=null==y.x1?hv.ROW:null==y.y1?hv.COLUMN:Number.isFinite(x+S)?x>S?hv.ROW:hv.COLUMN:hv.ROW}),this.beforeRenderStep(c,t,h,u,!!s,!1,i,!1,l,p,g,null,{attribute:n}),t.setShadowBlendStyle&&t.setShadowBlendStyle(c,n,l);let{x:A=0,x:k=0}=n;return!1!==i&&(g?g(t,n,l):s&&(t.setCommonStyle(c,n,A-h,k-u,l),t.fill())),this.afterRenderStep(c,t,h,u,!!s,!1,i,!1,l,p,g,null,{attribute:n}),(()=>{if(!1!==r)if(f)f(t,n,l);else{let{stroke:i=l&&l[1]&&l[1].stroke}=n;(0,ev.A)(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),oG(t,i[0]?e.top:e.bottom,o,b===hv.ROW?"x":"y",{offsetX:h,offsetY:u,offsetZ:d})),t.setStrokeStyle(c,n,A-h,k-u,l),t.stroke()}})(),!1}};o2=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),o1(0,eU(eY)),o1(0,eG(l9)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],o2);let o3=class extends o2{constructor(){super(...arguments),this.numberType=ny}drawShape(t,e,i,s,r,a,n){if(t.incremental&&r.multiGraphicOptions){let{startAtIdx:a,length:l}=r.multiGraphicOptions,{segments:o=[]}=t.attribute;if(a>o.length)return;let h=rQ(t).area,{fill:u=h.fill,fillOpacity:d=h.fillOpacity,opacity:c=h.opacity,visible:p=h.visible}=t.attribute;if(t.valid&&p&&u&&(u&&c*d>0||n))for(let r=a;r<a+l;r++)this.drawIncreaseSegment(t,e,o[r-1],o[r],t.attribute.segments[r],[h,t.attribute],i,s)}else super.drawShape(t,e,i,s,r,a,n)}drawIncreaseSegment(t,e,i,s,r,a,n,l){s&&(e.beginPath(),function(t,e,i,s){let{offsetX:r=0,offsetY:a=0}=s||{},{points:n}=i,l=[],o=0;for(let t=0;t<n.length;t++)!1===n[t].defined&&(o+1!==t&&l.slice(o,t),o=t);l.push(n),l.forEach((i,s)=>{var n,l,o,h;let u=e&&0===s?e.points[e.points.length-1]:i[0];
2t.moveTo(u.x+r,u.y+a),i.forEach(e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+a):t.moveTo(e.x+r,e.y+a)});for(let e=i.length-1;e>=0;e--){let s=i[e];t.lineTo(null!=(n=s.x1)?n:s.x,null!=(l=s.y1)?l:s.y)}t.lineTo(null!=(o=u.x1)?o:u.x,null!=(h=u.y1)?h:u.y),t.closePath()})}(e.camera?e:e.nativeContext,i,s,{offsetX:n,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,n,l,a),e.fill())}};o3=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],o3);var o5,o4,o8,o6,o9,o7,ht,he,hi,hs,hr,ha,hn,hl,ho,hh,hu,hd,hc,hp,hg,hf,hm,h_,hy,hv,hb,hx,hS,hA,hk,hM,hw,hT,hC,hB,hE=function(t,e){return function(i,s){e(i,s,t)}},hP=function(t,e,i,s){return new(i||(i=Promise))(function(r,a){function n(t){try{o(s.next(t))}catch(t){a(t)}}function l(t){try{o(s.throw(t))}catch(t){a(t)}}function o(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(n,l)}o((s=s.apply(t,e||[])).next())})};(dC=hB||(hB={}))[dC.NORMAL=0]="NORMAL",dC[dC.STOP=1]="STOP";let hO=class extends ox{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=hB.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new eZ([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return hP(this,void 0,void 0,function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);let i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;let{context:s,viewBox:r}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(r.x1,r.y1,!0),s.save(),t.renderTreeRoots.sort((t,e)=>{var i,s;return(null!=(i=t.attribute.zIndex)?i:sV.zIndex)-(null!=(s=e.attribute.zIndex)?s:sV.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 hP(this,void 0,void 0,function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)})}_renderIncrementalGroup(t,e){return hP(this,void 0,void 0,function*(){this.count=t.count,yield new Promise(i=>{this.renderItem(t,e,{drawingCb:()=>hP(this,void 0,void 0,function*(){if(2!==t.count)yield lZ(t,sV.zIndex,(i,s)=>{if(this.status===hB.STOP)return!0;if(i.isContainer||s<this.currentIdx)return!1;let r=this.currFrameStartAt+t.incremental;return s<r&&(this.currentIdx=s+1,this.renderItem(i,e)),s===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())}),i(!1);else{let s=t.getChildAt(0);if(s.incremental&&s.attribute.segments)for(s.incrementalAt||(s.incrementalAt=0);s.incrementalAt<s.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:s.incrementalAt,length:s.incremental},this.renderItem(s,e),s.incrementalAt+=s.incremental,yield this.waitToNextFrame();else this.renderItem(s,e);i(!1)}})})}),this.hooks.completeDraw.call()})}waitToNextFrame(){return hP(this,void 0,void 0,function*(){return new Promise(t=>{this.global.getRequestAnimationFrame()(()=>{t(!1)})})})}checkForDraw(t){return hP(this,void 0,void 0,function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e})}forceStop(){return hP(this,void 0,void 0,function*(){this.rendering&&(this.status=hB.STOP,yield new Promise(t=>{this.hooks.completeDraw.tap("stopCb",()=>{this.status=hB.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 hP(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:()=>hP(this,void 0,void 0,function*(){yield lZ(t,sV.zIndex,t=>hP(this,void 0,void 0,function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})),i(!1)})})}))})}};
2hO=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),hE(0,lX(ln)),hE(1,eU(o$)),hE(2,eU(o3)),hE(3,eU(eY)),hE(3,eG(lJ)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],hO);let hR=new eL(t=>{t(oh).toSelf().inSingletonScope(),t(oJ).toSelf().inSingletonScope(),t(l_).to(ox),t(li).to(hO),t(ll).to(oj).inSingletonScope(),t(ln).toService(ll),eX(t,ot),t(o_).toSelf().inSingletonScope(),eX(t,ol),eX(t,ln),t(l3).toSelf().inSingletonScope(),t(lJ).toService(l3),eX(t,lJ)});function hI(){hI.__loaded||(hI.__loaded=!0,e7.load(le),e7.load(lz),e7.load(lv),e7.load(lE),e7.load(lW),e7.load(lU),e7.load(lG),e7.load(l$),e7.load(hR))}hI.__loaded=!1,hI();let hL=e7.get(eQ);function hD(t){return function(e){return(0,ev.A)(t)?t.reduce((t,e)=>null==t?void 0:t[e],e):null==e?void 0:e[t]}}function hF(t,...e){return(0,r3.A)(t)?t(...e):t}ie.global=hL,ie.graphicUtil=e7.get(n4),ie.transformUtil=e7.get(n5),ie.graphicService=e7.get(nE),ie.layerService=e7.get(n8);let hz=0;function hH(){return hz>=9999999&&(hz=0),hz++}function hj(t){return null!=t&&""!==t&&(!!ed(t)||+t==+t)}function hV(t){return!(!t||0===t.length)&&!(0,eE.A)(t[0])&&!(0,eE.A)(t[0].dataId)&&(0,ev.A)(t[0].fields)}function hN(t){switch(t){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function hW(t){return!!(0,eS.A)(t)&&!!t.endsWith("%")&&hj(t.substring(0,t.length-1))}function hU(t,e,i,s=0){var r,a;return ed(t)?t:hW(t)?Number(t.substring(0,t.length-1))*e/100:(0,r3.A)(t)?t(i):r2(t)?e*(null!=(r=t.percent)?r:0)+(null!=(a=t.offset)?a:0):s}function hG(t,e,i){var s,r,a,n;let l={top:0,bottom:0,left:0,right:0};return Object.values(t).every(t=>ed(t))?(l.top=null!=(s=t.top)?s:0,l.right=null!=(r=t.right)?r:0,l.bottom=null!=(a=t.bottom)?a:0,l.left=null!=(n=t.left)?n:0):[{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach(e=>{e.orients.forEach(s=>{l[s]=hU(t[s],e.size,i)})}),l}function hY(t){let e={};return(0,ev.A)(t)?((0,eE.A)(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),(0,eE.A)(t[1])||(e.left=e.right=t[1]),(0,eE.A)(t[2])||(e.bottom=t[2]),(0,eE.A)(t[3])||(e.left=t[3]),e):ed(t)||hW(t)||(0,r3.A)(t)||r2(t)&&("percent"in t||"offset"in t)?(e.top=e.left=e.bottom=e.right=t,e):r2(t)?e=Object.assign({},t):e}function h$(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}let hX=(t,e)=>{let i=Number(t),s=t.toString();return isNaN(i)&&"%"===s[s.length-1]?e*(Number(s.slice(0,s.length-1))/100):i};function hK(){if(null==o)try{let t=document.createElement("canvas"),e=t.getContext("2d");(o=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke))&&(o=!!document.createElement)}catch(t){o=!1}let t=ie.global&&ie.global.env;return t?"browser"===t:o}let hq=hK(),hZ=hq&&globalThis?globalThis.document:void 0;function hJ(t){return("desktop-browser"===t||"mobile-browser"===t)&&hq}function hQ(t){return h0(t)||"mobile-browser"===t}function h0(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}let h1=(t,...e)=>h5.silent?null:eg.getInstance().info(`[VChart log]: ${t}`,...e),h2=(t,e)=>((0,r3.A)(h5.warnHandler)&&h5.warnHandler.call(null,t,e),e?eg.getInstance().warn(`[VChart warn]: ${t}`,e):eg.getInstance().warn(`[VChart warn]: ${t}`)),h3=(t,e,i)=>{if(!h5.silent){if(!(0,r3.A)(h5.errorHandler))throw Error(t);h5.errorHandler.call(null,t,e)}},h5={silent:!1,warnHandler:!1,errorHandler:!1},h4=function(t,e,i){return t<e?e:t>i?i:t};function h8(t,e,i){let s=(1-Math.abs(2*(i/=100)-1))*(e/=100),r=s*(1-Math.abs(t/60%2-1)),a=i-s/2,n=0,l=0,o=0;return 0<=t&&t<60?(n=s,l=r,o=0):60<=t&&t<120?(n=r,l=s,o=0):120<=t&&t<180?(n=0,l=s,o=r):180<=t&&t<240?(n=0,l=r,o=s):240<=t&&t<300?(n=r,l=0,o=s):300<=t&&t<360&&(n=s,l=0,o=r),{r:n=Math.round(255*(n+a)),g:l=Math.round(255*(l+a)),b:o=Math.round(255*(o+a))}}
2function h6(t,e,i){t/=255;let s=Math.min(t,e/=255,i/=255),r=Math.max(t,e,i),a=r-s,n=0,l=0,o=0;return(n=Math.round(60*(n=0===a?0:r===t?(e-i)/a%6:r===e?(i-t)/a+2:(t-e)/a+4)))<0&&(n+=360),o=(r+s)/2,{h:n,s:l=+(100*(l=0===a?0:a/(1-Math.abs(2*o-1)))).toFixed(1),l:o=+(100*o).toFixed(1)}}let h9=/^#([0-9a-f]{3,8})$/,h7={transparent:0xffffff00},ut={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function ue(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ui(t){return ed(t)?new ul(t>>16,t>>8&255,255&t,1):(0,ev.A)(t)?new ul(t[0],t[1],t[2]):new ul(255,255,255)}function us(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}
2function ur(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let ua=(t,e)=>{let i=h9.exec(t);if(e||i){let t=parseInt(i[1],16),e=i[1].length;return 3===e?new ul((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?ui(t):8===e?new ul(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class un{static Brighter(t,e=1){return 1===e?t:new un(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new un(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){let i=t instanceof un?t:new un(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if((0,eA.A)(h7[t])){var e;return ed(e=h7[t])?new ul(e>>>24,e>>>16&255,e>>>8&255,255&e):(0,ev.A)(e)?new ul(e[0],e[1],e[2],e[3]):new ul(255,255,255,1)}if((0,eA.A)(ut[t]))return ui(ut[t]);let i=`${t}`.trim().toLowerCase(),s=ua(i);if(void 0!==s)return s;if(/^(rgb|RGB|rgba|RGBA)/.test(i)){let t=i.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new ul(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(i)){let t=i.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),e=h8(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new ul(e.r,e.g,e.b,parseFloat(t[3]))}}constructor(t){const e=un.parseColorString(t);e?this.color=e:(console.warn(`Warn: ä¼ å
¥${t}æ æ³è§£æä¸ºColor`),this.color=new ul(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){let{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){let{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){let{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){let s=this.color.opacity,r=h6(this.color.r,this.color.g,this.color.b),a=h8((0,eE.A)(t)?r.h:h4(t,0,360),(0,eE.A)(e)?r.s:e>=0&&e<=1?100*e:e,(0,eE.A)(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new ul(a.r,a.g,a.b,s),this}setRGB(t,e,i){return(0,eE.A)(t)||(this.color.r=t),(0,eE.A)(e)||(this.color.g=e),(0,eE.A)(i)||(this.color.b=i),this}setHex(t){let e=ua(`${t}`.trim().toLowerCase(),!0);return null!=e?e:this}setColorName(t){let e=ut[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){let t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))}clone(){return new un(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){let 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=us(t.color.r),this.color.g=us(t.color.g),this.color.b=us(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ur(t.color.r),this.color.g=ur(t.color.g),this.color.b=ur(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class ul{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)),(0,eA.A)(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${ue(this.r)+ue(this.g)+ue(this.b)+(1===this.opacity?"":ue(255*this.opacity))}`}formatRgb(){let t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){let t=this.opacity,{h:e,s:i,l:s}=h6(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}function uo(t){var e,i;let{type:s}=t;return s===dD.sankey?null!=(e=t.direction)?e:"horizontal":null!=(i=t.direction)?i:"vertical"}(dB=dD||(dD={})).area="area",dB.line="line",dB.bar="bar",dB.rangeColumn="rangeColumn",dB.rangeArea="rangeArea",dB.dot="dot",dB.geo="geo",dB.link="link",dB.map="map",dB.pie="pie",dB.radar="radar",dB.rose="rose",dB.scatter="scatter",dB.circularProgress="circularProgress",dB.wordCloud="wordCloud",dB.funnel="funnel",dB.linearProgress="linearProgress",dB.boxPlot="boxPlot",dB.sankey="sankey",dB.gaugePointer="gaugePointer",dB.gauge="gauge",dB.treemap="treemap",dB.sunburst="sunburst",dB.circlePacking="circlePacking",dB.waterfall="waterfall",dB.heatmap="heatmap",dB.correlation="correlation",dB.liquid="liquid",dB.venn="venn",dB.mosaic="mosaic",dB.pictogram="pictogram",(dE=dF||(dF={})).label="label",dE.point="point",dE.line="line",dE.area="area",dE.bar="bar",dE.boxPlot="boxPlot",dE.outlier="outlier",dE.circlePacking="circlePacking",dE.group="group",dE.gridBackgroun
2d="gridBackground",dE.grid="grid",dE.dot="dot",dE.title="title",dE.subTitle="subTitle",dE.symbol="symbol",dE.funnel="funnel",dE.transform="transform",dE.transformLabel="transformLabel",dE.outerLabel="outerLabel",dE.outerLabelLine="outerLabelLine",dE.pin="pin",dE.pinBackground="pinBackground",dE.pointer="pointer",dE.segment="segment",dE.track="track",dE.cell="cell",dE.cellBackground="cellBackground",dE.link="link",dE.arrow="arrow",dE.pie="pie",dE.labelLine="labelLine",dE.progress="progress",dE.minLabel="minLabel",dE.maxLabel="maxLabel",dE.rose="rose",dE.node="node",dE.sunburst="sunburst",dE.nonLeaf="nonLeaf",dE.leaf="leaf",dE.nonLeafLabel="nonLeafLabel",dE.leaderLine="leaderLine",dE.stackLabel="stackLabel",dE.word="word",dE.fillingWord="fillingWord",dE.wordMask="wordMask",dE.nodePoint="nodePoint",dE.ripplePoint="ripplePoint",dE.centerPoint="centerPoint",dE.centerLabel="centerLabel",dE.barBackground="barBackground",dE.lineLabel="lineLabel",dE.areaLabel="areaLabel",dE.liquidGroup="liquidGroup",dE.liquid="liquid",dE.liquidBackground="liquidBackground",dE.liquidOutline="liquidOutline",dE.circle="circle",dE.overlap="overlap",dE.overlapLabel="overlapLabel";let uh={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},uu={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function ud(t,e){if(!t)return[];let i=u_(t,e);if(!i||(0,ev.A)(i))return null!=i?i:[];if(r2(i)){let{dataScheme:s}=i;return s?um(s)?s.map(i=>Object.assign(Object.assign({},i),{scheme:i.scheme.map(i=>uf(i)?up(t,i,e):i).filter(eA.A)})):s.map(i=>uf(i)?up(t,i,e):i).filter(eA.A):[]}return[]}function uc(t,e){var i,s;return um(t)?null!=(s=null==(i=t.find(t=>
2(0,eA.A)(t.isAvailable)?(0,r3.A)(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!(0,eA.A)(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength))?void 0:i.scheme)?s:t[t.length-1].scheme:t}function up(t,e,i){var s;let r,a=u_(t,i);if(!a)return;let{palette:n}=a;if(r2(n)&&(r=null!=(s=function(t,e){let i=uh[e];if(i&&t[i])return t[i];if(t[e])return t[e];let s=uu[e];return s?t[s]:void 0}(n,e.key))?s:e.default),!r)return;if((0,eE.A)(e.a)&&(0,eE.A)(e.l)||!(0,eS.A)(r))return r;let l=new un(r);if((0,eA.A)(e.l)){let{r:t,g:i,b:s}=l.color,{h:r,s:a}=h6(t,i,s),n=h8(r,a,e.l),o=new un(`rgb(${n.r}, ${n.g}, ${n.b})`);o.setOpacity(l.color.opacity),l=o}return(0,eA.A)(e.a)&&l.setOpacity(e.a),l.toRGBA()}let ug=(t,e)=>{if(e&&uf(t)){let i=up(e,t);if(i)return i}return t};function uf(t){return t&&"palette"===t.type&&!!t.key}function um(t){return!(!(0,ev.A)(t)||0===t.length)&&t.every(t=>(0,eA.A)(t.scheme))}function u_(t,e){var i,s;let r,{type:a}=null!=e?e:{};if(!e||(0,eE.A)(a))r=null==t?void 0:t.default;else{let n=uo(e);r=null!=(s=null!=(i=null==t?void 0:t[`${a}_${n}`])?i:null==t?void 0:t[a])?s:null==t?void 0:t.default}return r}function uy(t,...e){let i=-1,s=e.length;for(;++i<s;)eT(t,e[i],!0,!0);return t}var uv={},ub={};function ux(t){return Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function uS(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 uA(t,e){var i=t+"",s=i.length;return s<e?Array(e-s+1).join(0)+i:i}function uk(t){var e=RegExp('["'+t+"\n\r]"),i=t.charCodeAt(0);function s(t,e){var s,r=[],a=t.length,n=0,l=0,o=a<=0,h=!1;function u(){if(o)return ub;if(h)return h=!1,uv;var e,s,r=n;if(34===t.charCodeAt(r)){for(;n++<a&&34!==t.charCodeAt(n)||34===t.charCodeAt(++n););return(e=n)>=a?o=!0:10===(s=t.charCodeAt(n++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(n)&&++n),t.slice(r+1,e-1).replace(/""/g,'"')}for(;n<a;){if(10===(s=t.charCodeAt(e=n++)))h=!0;else if(13===s)h=!0,10===t.charCodeAt(n)&&++n;else if(s!==i)continue;return t.slice(r,e)}return o=!0,t.slice(r,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(s=u())!==ub;){for(var d=[];s!==uv&&s!==ub;)d.push(s),s=u();e&&null==(d=e(d,l++))||r.push(d)}return r}function r(e,i){return e.map(function(e){return i.map(function(t){return n(e[t])}).join(t)})}function a(e){return e.map(n).join(t)}function n(t){var i,s,r,a,n,l;return null==t?"":t instanceof Date?(s=(i=t).getUTCHours(),r=i.getUTCMinutes(),a=i.getUTCSeconds(),n=i.getUTCMilliseconds(),isNaN(i)?"Invalid Date":((l=i.getUTCFullYear())<0?"-"+uA(-l,6):l>9999?"+"+uA(l,6):uA(l,4))+"-"+uA(i.getUTCMonth()+1,2)+"-"+uA(i.getUTCDate(),2)+(n?"T"+uA(s,2)+":"+uA(r,2)+":"+uA(a,2)+"."+uA(n,3)+"Z":a?"T"+uA(s,2)+":"+uA(r,2)+":"+uA(a,2)+"Z":r||s?"T"+uA(s,2)+":"+uA(r,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var i,r,a=s(t,function(t,s){var a;if(i)return i(t,s-1);r=t,i=e?(a=ux(t),function(i,s){return e(a(i),s,t)}):ux(t)});return a.columns=r||[],a},parseRows:s,format:function(e,i){return null==i&&(i=uS(e)),[i.map(n).join(t)].concat(r(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=uS(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:n}}var uM=uk(","),uw=uM.parse;uM.parseRows,uM.format,uM.formatBody,uM.formatRows,uM.formatRow,uM.formatValue;var uT=uk(" "),uC=uT.parse;uT.parseRows,uT.format,uT.formatBody,uT.formatRows,uT.formatRow,uT.formatValue,(dP=dz||(dz={})).DSV="dsv",dP.TREE="tree",dP.GEO="geo",dP.BYTE="bytejson",dP.HEX="hex",dP.GRAPH="graph",dP.TABLE="table",dP.GEO_GRATICULE="geo-graticule";let uB=function(t,...e){return function(t,...e){t||(t={});let i=-1,s=e.length;for(;++i<s;){var r=t,a=e[i];if(r2(a)&&r!==a)for(let t in a)!function t(e,i,s){let r=i[s];if(void 0===r)e[s]=null;else if(r2(r))for(let i in r2(e[s])||(e[s]={}),r)t(e[s],r,i);else e[s]=r}(r,a,t)}return t}(ek(t),...e)},uE={delimiter:","};class uP{static registerChart(t,e){uP._charts[t]=e}static registerSeries(t,e){uP._series[t]=e}
2static registerComponent(t,e,i,s){uP._components[t]={cmp:e,alwaysCheck:i,createOrder:null!=s?s:0}}static registerGraphicComponent(t,e){uP._graphicComponents[t]=e}static createGraphicComponent(t,e,i){let s=uP._graphicComponents[t];return s?s(e,i):null}static registerMark(t,e){uP._marks[t]=e}static registerRegion(t,e){uP._regions[t]=e}static registerTransform(t,e){uP.transforms[t]=e}static registerGrammarTransform(t,e){uP._grammarTransforms[t]=e}static getGrammarTransform(t){return uP._grammarTransforms[t]}static registerLayout(t,e){uP._layout[t]=e}static registerAnimation(t,e){uP._animations[t]=e}static registerImplement(t,e){uP._implements[t]=e}static registerChartPlugin(t,e){uP._chartPlugin[t]=e}static registerVChartPlugin(t,e){uP._vChartPlugin[t]=e}static registerComponentPlugin(t,e){uP._componentPlugin[t]=e}static createChart(t,e,i){return uP._charts[t]?new(0,uP._charts[t])(e,i):null}static getChart(t){return uP._charts[t]}static createChartSpecTransformer(t,e){if(!uP._charts[t])return null;let i=uP._charts[t];return new(0,i.transformerConstructor)(Object.assign({seriesType:i.seriesType},e))}
2static createRegion(t,e,i){return uP._regions[t]?new(0,uP._regions[t])(e,i):null}static createRegionSpecTransformer(t,e){return uP._regions[t]?new(0,uP._regions[t].transformerConstructor)(e):null}static createSeries(t,e,i){return uP._series[t]?new(0,uP._series[t])(e,i):null}static createSeriesSpecTransformer(t,e){return uP._series[t]?new(0,uP._series[t].transformerConstructor)(e):null}static createMark(t,e,i){if(!uP._marks[t])return null;let s=new(0,uP._marks[t])(e,i);return"group"===s.type&&s.setMarkConfig({interactive:!1}),s}static getComponents(){return Object.values(uP._components)}static getComponentInKey(t){return uP._components[t].cmp}static getLayout(){return Object.values(uP._layout)}static getLayoutInKey(t){return uP._layout[t]}static getSeries(){return Object.values(uP._series)}static getSeriesInType(t){return uP._series[t]}static getRegionInType(t){return uP._regions[t]}static getAnimationInKey(t){return uP._animations[t]}static getImplementInKey(t){return uP._implements[t]}static getSeriesMarkMap(t){return uP._series[t]?uP._series[t].mark:{}}static getSeriesBuiltInTheme(t){for(let e in uP._series){let i=uP._series[e];if(i&&i.builtInTheme&&i.builtInTheme[t])return i.builtInTheme[t]}return null}static getComponentBuiltInTheme(t){for(let e in uP._components){let i=uP._components[e];if(i&&i.cmp&&i.cmp.builtInTheme&&i.cmp.builtInTheme[t])return i.cmp.builtInTheme[t]}return null}static getChartPlugins(){return Object.values(uP._chartPlugin)}static getVChartPlugins(){return Object.values(uP._vChartPlugin)}static getComponentPlugins(){return Object.values(uP._componentPlugin)}static getComponentPluginInType(t){return uP._componentPlugin[t]}static registerFormatter(t){this._formatter=t}static getFormatter(){return this._formatter}static createInteractionTrigger(t,e){let i=uP._interactionTriggers[t];return i?new i(e):null}static hasInteractionTrigger(t){return!!uP._interactionTriggers[t]}static getComposedEvent(t){return uP._composedEventMap[t]}}function uO(t,...e){return uy(uR(t),...e.map(uR))}function uR(t){var e,i;if(!t)return t;let s=((i=t.colorScheme)&&(i=Object.keys(i).reduce((t,e)=>{let s=i[e];return t[e]=(0,ev.A)(s)?{dataScheme:s}:s,t},{})),i);return Object.assign({},t,{colorScheme:s,token:null!=(e=t.token)?e:{},series:Object.assign({},t.series)})}uP._charts={},uP._series={},uP._components={},uP._graphicComponents={},uP._marks={},uP._regions={},uP._animations={},uP._implements={},uP._chartPlugin={},uP._vChartPlugin={},uP._componentPlugin={},uP.transforms={fields:eO,filter:(t,e)=>{let{callback:i}=e;return i&&(t=t.filter(i)),t},fold:(t,e)=>{let{fields:i,key:s,value:r,retains:a}=e,n=[];for(let e=0;e<t.length;e++)i.forEach(l=>{let o={};if(o[s]=l,o[r]=t[e][l],a)a.forEach(i=>{o[i]=t[e][i]});else for(let s in t[e])-1===i.indexOf(s)&&(o[s]=t[e][s]);n.push(o)});return n}},uP.dataParser={csv:(t,e={},i)=>(i.type=dz.DSV,uw(t)),dsv:(t,e={},i)=>{i.type=dz.DSV;let{delimiter:s}=uB(uE,e);if(!(0,eS.A)(s))throw TypeError("Invalid delimiter: must be a string!");return uk(s).parse(t)},tsv:(t,e={},i)=>(i.type=dz.DSV,uC(t))},uP._layout={},uP._grammarTransforms={},uP._stageEventPlugins={},uP.registerStageEventPlugin=(t,e)=>{uP._stageEventPlugins[t]=e},uP.getStageEventPlugin=t=>uP._stageEventPlugins[t],uP._interactionTriggers={},uP.registerInteractionTrigger=(t,e)=>{uP._interactionTriggers[t]=e},uP._composedEventMap={},uP.registerComposedEvent=(t,e)=>{uP._composedEventMap[t]=e},uP._tooltipProcessors={},uP.registerTooltipProcessor=(t,e)=>{uP._tooltipProcessors[t]=e},uP.createTooltipProcessor=(t,e)=>{let i=uP._tooltipProcessors[t];return i?new i(e):null};var uI=i(90647);let uL={default:{dataScheme:uI.M,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)",axisMarkerBackgroun
2dColor:"#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"}}},uD={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%"},uF={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:uL,token:uD,component:{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}}},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}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},animationThreshold:2e3},uz={[uF.name]:uF},uH=uF.name,uj=new Map(Object.keys(uz).map(t=>[t,uz[t]])),uV=new Map,uN=new Map(Object.keys(uz).map(t=>[t,t===uH])),uW=(t,e)=>{if(!t)return;let i=uG(e);uj.set(t,i),uN.set(t,!0)},uU=(t=uH)=>(uN.has(t)&&!uN.get(t)&&uW(t,uj.get(t)),uj.get(t)),uG=t=>{var e;return uO({},uU(null!=(e=t.type)?e:uH),t)};class uY{static registerInstance(t){uY.instances.set(t.id,t)}static unregisterInstance(t){uY.instances.delete(t.id)}static getInstance(t){return uY.instances.get(t)}static instanceExist(t){return uY.instances.has(t)}static forEach(t,e=[],i){let s=oS(e);return uY.instances.forEach((e,i,r)=>{s.includes(i)||t(e,i,r)},i)}}uY.instances=new Map;class u${static registerTheme(t,e){uW(t,e)}static getTheme(t,e=!1){return uU(t)}static removeTheme(t){return uj.delete(t)&&uV.delete(t)&&uN.delete(t)}static themeExist(t){return!!(0,eS.A)(t)&&uj.has(t)}static getDefaultTheme(){return u$.themes.get(uH)}static setCurrentTheme(t){u$.themeExist(t)&&(u$._currentThemeName=t,uY.forEach(e=>null==e?void 0:e.setCurrentTheme(t)))}static getCurrentTheme(t=!1){return u$.getTheme(u$._currentThemeName,t)}static getCurrentThemeName(){return u$._currentThemeName}}function uX(t){return(0,eS.A)(t)?u$.themeExist(t)?u$.getTheme(t):{}:r2(t)?t:{}}u$.themes=uj,u$._currentThemeName=uH;class uK{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){let s="function"==typeof e?{query:null,callback:e}:{query:e,callback:i},r=uP.getComposedEvent(t);if(r){let e=new r(this._eventDispatcher,this._mode);e.register(t,s),this._composedEventMap.set(s.callback,{eventType:t,event:e})}else this._eventDispatcher.register(t,s);return this}off(t,e,i){var s,r;let a=null!=i?i:e;if(uP.getComposedEvent(t))if(a)null==(s=this._composedEventMap.get(a))||s.event.unregister(),this._composedEventMap.delete(a);else for(let e of this._composedEventMap.entries())e[1].eventType===t&&(null==(r=this._composedEventMap.get(e[0]))||r.event.unregister(),this._composedEventMap.delete(e[0]));else if(a){let i={callback:a,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()}}(dO=dH||(dH={})).BEFORE_EVALUATE_DATA="beforeEvaluateData",dO.AFTER_EVALUATE_DATA="after
2EvaluateData",dO.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",dO.AFTER_EVALUATE_SCALE="afterEvaluateScale",dO.BEFORE_PARSE_VIEW="beforeParseView",dO.AFTER_PARSE_VIEW="afterParseView",dO.BEFORE_TRANSFORM="beforeTransform",dO.AFTER_TRANSFORM="afterTransform",dO.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",dO.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",dO.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",dO.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",dO.BEFORE_STAGE_RESIZE="beforeStageResize",dO.AFTER_STAGE_RESIZE="afterStageResize",dO.BEFORE_VRENDER_DRAW="beforeVRenderDraw",dO.AFTER_VRENDER_DRAW="afterVRenderDraw",dO.BEFORE_MARK_JOIN="beforeMarkJoin",dO.AFTER_MARK_JOIN="afterMarkJoin",dO.BEFORE_MARK_UPDATE="beforeMarkUpdate",dO.AFTER_MARK_UPDATE="afterMarkUpdate",dO.BEFORE_MARK_STATE="beforeMarkState",dO.AFTER_MARK_STATE="afterMarkState",dO.BEFORE_MARK_ENCODE="beforeMarkEncode",dO.AFTER_MARK_ENCODE="afterMarkEncode",dO.BEFORE_DO_LAYOUT="beforeDoLayout",dO.AFTER_DO_LAYOUT="afterDoLayout",dO.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",dO.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",dO.BEFORE_DO_RENDER="beforeDoRender",dO.AFTER_DO_RENDER="afterDoRender",dO.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",dO.AFTER_MARK_RENDER_END="afterMarkRenderEnd",dO.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",dO.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",dO.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",dO.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",dO.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",dO.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",dO.AFTER_ELEMENT_UPDATE_DATA="after
2ElementUpdateData",dO.BEFORE_ELEMENT_STATE="beforeElementState",dO.AFTER_ELEMENT_STATE="afterElementState",dO.BEFORE_ELEMENT_ENCODE="beforeElementEncode",dO.AFTER_ELEMENT_ENCODE="afterElementEncode",dO.ANIMATION_START="animationStart",dO.ANIMATION_END="animationEnd",dO.ELEMENT_ANIMATION_START="elementAnimationStart",dO.ELEMENT_ANIMATION_END="elementAnimationEnd",dO.ALL_ANIMATION_START="allAnimationStart",dO.ALL_ANIMATION_END="allAnimationEnd";let uq=["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"];(dR=dj||(dj={})).initialized="initialized",dR.rendered="rendered",dR.renderFinished="renderFinished",dR.animationFinished="animationFinished",dR.regionSeriesDataFilterOver="regionSeriesDataFilterOver",dR.afterInitData="afterInitData",dR.afterInitEvent="afterInitEvent",dR.afterInitMark="afterInitMark",dR.rawDataUpdate="rawDataUpdate",dR.viewDataFilterOver="viewDataFilterOver",dR.viewDataUpdate="viewDataUpdate",dR.viewDataStatisticsUpdate="viewDataStatisticsUpdate",dR.markDeltaYUpdate="markDeltaYUpdate",dR.viewDataLabelUpdate="viewDataLabelUpdate",dR.scaleDomainUpdate="scaleDomainUpdate",dR.scaleRawDomainUpdate="scaleRawDomainUpdate",dR.scaleUpdate="scaleUpdate",dR.dataZoomChange="dataZoomChange",dR.drill="drill",dR.layoutStart="layoutStart",dR.layoutEnd="layoutEnd",dR.layoutRectUpdate="layoutRectUpdate",dR.playerPlay="playerPlay",dR.playerPause="playerPause",dR.playerEnd="playerEnd",dR.playerChange="playerChange",dR.playerForward="playerForward",dR.playerBackward="playerBackward",dR.scrollBarChange="scrollBarChange",dR.brushStart="brushStart",dR.brushChange="brushChange",dR.brushEnd="brushEnd",dR.brushClear="brushClear",dR.brushActive="brushActive",dR.legendSelectedDataChange="legendSelectedDataChange",dR.legendFilter="legendFilter",dR.legendItemClick="legendItemClick",dR.legendItemHover="legendItemHover",dR.legendItemUnHover="legendItemUnHover",dR.tooltipShow="tooltipShow",dR.tooltipHide="tooltipHide",dR.tooltipRelease="tooltipRelease",dR.afterResize="afterResize",dR.afterRender="afterRender",dR.afterLayout="afterLayout",dR.afterMarkLayoutEnd="afterMarkLayoutEnd",dR.afterWordcloudShapeDraw="afterWordcloudShapeDraw",(dI=dV||(dV={})).chart="chart",dI.window="window",dI.canvas="canvas",(dL=dN||(dN={})).vchart="vchart",dL.chart="chart",dL.model="model",dL.mark="mark";let uZ=[dN.mark,dN.model,dN.chart,dN.vchart];class uJ{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(dN.vchart,[]),this._levelNodes.set(dN.chart,[]),this._levelNodes.set(dN.model,[]),this._levelNodes.set(dN.mark,[])}addHandler(t,e){var i;let s={level:e,handler:t};return null==(i=this._levelNodes.get(e))||i.push(s),this._map.set(t.callback,s),this}removeHandler(t){let e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);let 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.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()}}let uQ=(t,e,i)=>{let s=(0,eS.A)(e)?e.split("."):e;for(let e=0;e<s.length;e++)t=t?t[s[e]]:void 0;return void 0===t?i:t},u0=!1;try{u0="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){u0=!1}u0=!1;let u1=function(t,e,i){let s,r,a,n,l,o,h=0,u=!1,d=!1,c=!0,p=!e&&0!==e&&u0;if("function"!=typeof t)throw TypeError("Expected a function");function g(e){let i=s,a=r;return s=r=void 0,h=e,n=t.apply(a,i)}function f(t,e){return p?(cancelAnimationFrame(l),requestAnimationFrame(t)):setTimeout(t,e)}function m(t){let i=t-o;return void 0===o||i>=e||i<0||d&&t-h>=a}function _(){let t,i,s=Date.now();if(m(s))return y(s);l=f(_,(t=s-h,i=e-(s-o),d?Math.min(i,a-t):i))}function y(t){return l=void 0,c&&s?g(t):(s=r=void 0,n)}function v(...t){let i=Date.now(),a=m(i);if(s=t,r=this,o=i,a){if(void 0===l){var c;return h=c=o,l=f(_,e),u?g(c):n}if(d)return l=f(_,e),g(o)}return void 0===l&&(l=f(_,e)),n}return e=+e||0,r2(i)&&(u=!!i.leading,(d="maxWait"in i)&&(a=Math.max(eP(i.maxWait)?i.maxWait:0,e)),c="trailing"in i?!!i.trailing:c),v.cancel=function(){void 0!==l&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(l),h=0,s=o=r=l=void 0},v.flush=function(){return void 0===l?n:y(Date.now())},v.pending=function(){return void 0!==l},v}
2,u2=function(t,e,i){let s=!0,r=!0;if("function"!=typeof t)throw TypeError("Expected a function");return r2(i)&&(s="leading"in i?!!i.leading:s,r="trailing"in i?!!i.trailing:r),u1(t,e,{leading:s,trailing:r,maxWait:e})},u3=t=>{if(!t||!t.context)return null;let{data:e,markType:i}=t.context;return"line"===i||"area"===i?e:null==e?void 0:e[0]},u5=(t,e)=>{let i=t.getAttributes(!0),s={};return Object.keys(e).forEach(t=>{i[t]!==e[t]&&(s[t]=e[t])}),s},u4={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 u8{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;let i=this.globalInstance.getChart(),s=(0,eA.A)(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,r=(0,eA.A)(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,a=uQ(t.event,"target"),n=t.datum;s&&"component"===s.modelType&&(n=null!=(e=s.getDatum(a))?e:n);let l={event:t.event,item:t.item,source:t.source,datum:n,chart:i,model:s,mark:null!=r?r:void 0,node:a};this.dispatch(t.type,l)},this._onDelegateInteractionEvent=t=>{let e=this.globalInstance.getChart(),i=t.event,s=null;i.graphics&&(s=i.graphics);let r={event:t.event,chart:e,graphics:s,datums:s&&s.map(t=>u3(t))};this.dispatch(t.type,r)},this.globalInstance=t,this._compiler=e}register(t,e){var i,s,r,a,n;this._parseQuery(e);let l=this.getEventBubble((null==(i=e.filter)?void 0:i.source)||dV.chart),o=this.getEventListeners((null==(s=e.filter)?void 0:s.source)||dV.chart);if(l.get(t)||l.set(t,new uJ),l.get(t).addHandler(e,null==(r=e.filter)?void 0:r.level),this._isValidEvent(t)&&!o.has(t)){let i=this._onDelegate.bind(this);this._compiler.addEventListener(null==(a=e.filter)?void 0:a.source,t,i),o.set(t,i)}else if(this._isInteractionEvent(t)&&!o.has(t)){let i=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null==(n=e.filter)?void 0:n.source,t,i),o.set(t,i)}return this}unregister(t,e){var i,s,r,a;let n=!1,l=this.getEventBubble((null==(i=null==e?void 0:e.filter)?void 0:i.source)||dV.chart),o=this.getEventListeners((null==(s=null==e?void 0:e.filter)?void 0:s.source)||dV.chart);if(e){let i=l.get(t);null==i||i.removeHandler(e),0===(null==i?void 0:i.getCount())&&(null==i||i.release(),l.delete(t),n=!0),(null==(r=null==e?void 0:e.wrappedCallback)?void 0:r.cancel)&&e.wrappedCallback.cancel()}else{let e=l.get(t);null==e||e.release(),l.delete(t),n=!0}if(n&&this._isValidEvent(t)){let i=o.get(t);this._compiler.removeEventListener((null==(a=null==e?void 0:e.filter)?void 0:a.source)||dV.chart,t,i),o.delete(t)}return this}dispatch(t,e,i){let s=this.getEventBubble(e.source||dV.chart).get(t);if(!s)return this;let r=!1;if(i){let a=s.getHandlers(i);r=this._invoke(a,t,e)}else{let i=0;for(;!r&&i<uZ.length;)r=this._invoke(s.getHandlers(uZ[i]),t,e),i++}return this}prevent(t,e){return["canvas","chart","window"].forEach(i=>{let s=this.getEventBubble(i).get(t);s&&s.getAllHandlers().forEach(t=>{e?uZ.indexOf(t.filter.level)<uZ.indexOf(e.level)&&t.callback!==e.handler&&s.preventHandler(t):s.preventHandler(t)})}),this}allow(t){return["canvas","chart","window"].forEach(e=>{let i=this.getEventBubble(e).get(t);i&&i.getAllHandlers().forEach(t=>i.allowHandler(t))}),this}clear(){[dV.chart,dV.window,dV.canvas].forEach(t=>{let e=this.getEventListeners(t);for(let i of e.entries())this._compiler.removeEventListener(t,i[0],i[1]);e.clear()}),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach(t=>{for(let e of t.values())e.release();t.clear()})}release(){this.clear(),this.globalInstance=null,this._compiler=null}_filter(t,e,i){var s,r,a;if((0,r3.A)(t.filter)&&!t.filter(i)||t.nodeName&&uQ(i,"node.name")!==t.nodeName||t.markName&&(null==(s=null==i?void 0:i.mark)?void 0:s.name)!==t.markName)return!1;let n=null==(r=i.model)?void 0:r.type;return u4[n]&&(n=u4[n]),(!t.type||n===t.type)&&!("mark"===t.level&&!t.type&&!(null==i?void 0:i.mark))&&!("model"===t.level&&!t.type&&!(null==i?void 0:i.model))&&(!(0,eA.A)(t.userId)||(null==(a=i.model)?void 0:a.userId)===t.userId)}_invoke(t,e,i){return t.map(t=>{var s,r,a;let n=t.filter;if(!t.prevented&&(!t.query||this._filter(n,e,i))){let e=(t.wrappedCallback||t.callback).call(null,Object.assign({},i)),n=null!=e?e:null==(s=t.query)?void 0:s.consume;return n&&(null==(r=i.event)||r.stopPropagation(),null==(a=i.event)||a.preventDefault()),!!n}}).some(t=>!0===t)}
2_getQueryLevel(t){return t?t.level?t.level:(0,eA.A)(t.id)?dN.model:dN.vchart:dN.vchart}_parseQuery(t){var e;let i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=u2(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=u1(t.callback,i.debounce));let s=this._getQueryLevel(i),r=null,a=dV.chart,n=null,l=null,o=null;return(null==i?void 0:i.nodeName)&&(n=i.nodeName),(null==i?void 0:i.markName)&&(l=i.markName),(null==i?void 0:i.type)&&(s===dN.model||s===dN.mark)&&(r=i.type),(null==i?void 0:i.source)&&(a=i.source),(0,eA.A)(null==i?void 0:i.id)&&(o=null==i?void 0:i.id,s=dN.model),t.filter={level:s,markName:l,type:r,source:a,nodeName:n,userId:o,filter:null!=(e=null==i?void 0:i.filter)?e:null},t}getEventBubble(t){switch(t){case dV.chart:return this._viewBubbles;case dV.window:return this._windowBubbles;case dV.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case dV.chart:return this._viewListeners;case dV.window:return this._windowListeners;case dV.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return uq.includes(t)||Object.values(dH).includes(t)}_isInteractionEvent(t){let e;return t&&(e=t.split(":")[0])&&uP.hasInteractionTrigger(e)}}function u6(t){return t}function u9(t,e){t&&dt.hasOwnProperty(t.type)&&dt[t.type](t,e)}var u7={Feature:function(t,e){u9(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,s=-1,r=i.length;++s<r;)u9(i[s].geometry,e)}},dt={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var i=t.coordinates,s=-1,r=i.length;++s<r;)t=i[s],e.point(t[0],t[1],t[2])},LineString:function(t,e){de(t.coordinates,e,0)},MultiLineString:function(t,e){for(var i=t.coordinates,s=-1,r=i.length;++s<r;)de(i[s],e,0)},Polygon:function(t,e){di(t.coordinates,e)},MultiPolygon:function(t,e){for(var i=t.coordinates,s=-1,r=i.length;++s<r;)di(i[s],e)},GeometryCollection:function(t,e){for(var i=t.geometries,s=-1,r=i.length;++s<r;)u9(i[s],e)}};function de(t,e,i){var s,r=-1,a=t.length-i;for(e.lineStart();++r<a;)s=t[r],e.point(s[0],s[1],s[2]);e.lineEnd()}function di(t,e){var i=-1,s=t.length;for(e.polygonStart();++i<s;)de(t[i],e,1);e.polygonEnd()}function ds(t,e){t&&u7.hasOwnProperty(t.type)?u7[t.type](t,e):u9(t,e)}function dr(){this.reset()}dr.prototype={constructor:dr,reset:function(){this.s=this.t=0},add:function(t){dn(da,t,this.t),dn(this,da.s,this.s),this.s?this.t+=da.t:this.s=da.t},valueOf:function(){return this.s}};var da=new dr;function dn(t,e,i){var s=t.s=e+i,r=s-e;t.t=e-(s-r)+(i-r)}var dl=Math.PI,dh=dl/2,du=dl/4,dd=2*dl,dc=180/dl,dp=dl/180,dg=Math.abs,df=Math.atan,dm=Math.atan2,d_=Math.cos,dy=Math.exp,dv=Math.log,db=Math.pow,dx=Math.sin,dS=Math.sign||function(t){return t>0?1:t<0?-1:0},dA=Math.sqrt,dk=Math.tan;function dM(t){return t>1?0:t<-1?dl:Math.acos(t)}function dw(t){return t>1?dh:t<-1?-dh:Math.asin(t)}function dT(){}var dC,dB,dE,dP,dO,dR,dI,dL,dD,dF,dz,dH,dj,dV,dN,dW,dU,dG,dY,d$=new dr,dX=new dr,dK={point:dT,lineStart:dT,lineEnd:dT,polygonStart:function(){dK.lineStart=dq,dK.lineEnd=dQ},polygonEnd:function(){dK.lineStart=dK.lineEnd=dK.point=dT,d$.add(dg(dX)),dX.reset()},result:function(){var t=d$/2;return d$.reset(),t}};function dq(){dK.point=dZ}function dZ(t,e){dK.point=dJ,dW=dG=t,dU=dY=e}function dJ(t,e){dX.add(dY*t-dG*e),dG=t,dY=e}function dQ(){dJ(dW,dU)}var d0=1/0,d1=1/0,d2=-1/0,d3=d2;let d5={point:function(t,e){t<d0&&(d0=t),t>d2&&(d2=t),e<d1&&(d1=e),e>d3&&(d3=e)},lineStart:dT,lineEnd:dT,polygonStart:dT,polygonEnd:dT,result:function(){var t=[[d0,d1],[d2,d3]];return d2=d3=-(d1=d0=1/0),t}};var d4,d8,d6,d9,d7=0,ct=0,ce=0,ci=0,cs=0,cr=0,ca=0,cn=0,cl=0,co={point:ch,lineStart:cu,lineEnd:cp,polygonStart:function(){co.lineStart=cg,co.lineEnd=cf},polygonEnd:function(){co.point=ch,co.lineStart=cu,co.lineEnd=cp},result:function(){var t=cl?[ca/cl,cn/cl]:cr?[ci/cr,cs/cr]:ce?[d7/ce,ct/ce]:[NaN,NaN];return d7=ct=ce=ci=cs=cr=ca=cn=cl=0,t}};function ch(t,e){d7+=t,ct+=e,++ce}function cu(){co.point=cd}function cd(t,e){co.point=cc,ch(d6=t,d9=e)}function cc(t,e){var i=t-d6,s=e-d9,r=dA(i*i+s*s);ci+=r*(d6+t)/2,cs+=r*(d9+e)/2,cr+=r,ch(d6=t,d9=e)}function cp(){co.point=ch}function cg(){co.point=cm}function cf(){c_(d4,d8)}function cm(t,e){co.point=c_,ch(d4=d6=t,d8=d9=e)}function c_(t,e){var i=t-d6,s=e-d9,r=dA(i*i+s*s);ci+=r*(d6+t)/2,cs+=r*(d9+e)/2,cr+=r,ca+=(r=d9*t-d6*e)*(d6+t),cn+=r*(d9+e),cl+=3*r,ch(d6=t,d9=e)}function cy(t){this._context=t}cy.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,dd)}},result:dT};var cv,cb,cx,cS,cA,ck=new dr,cM={point:dT,lineStart:function(){cM.point=cw},lineEnd:function(){cv&&cT(cb,cx),cM.point=dT},polygonStart:function(){cv=!0},polygonEnd:function(){cv=null},result:function(){var t=+ck;return ck.reset(),t}};function cw(t,e){cM.point=cT,cb=cS=t,cx=cA=e}function cT(t,e){cS-=t,cA-=e,ck.add(dA(cS*cS+cA*cA)),cS=t,cA=e}function cC(){this._string=[]}function cB(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function cE(t,e){var i,s,r=4.5;function a(t){return t&&("function"==typeof r&&s.pointRadius(+r.apply(this,arguments)),ds(t,i(s))),s.result()}return a.area=function(t){return ds(t,i(dK)),dK.result()},a.measure=function(t){return ds(t,i(cM)),cM.result()},a.bounds=function(t){return ds(t,i(d5)),d5.result()},a.centroid=function(t){return ds(t,i(co)),co.result()},a.projection=function(e){return arguments.length?(i=null==e?(t=null,u6):(t=e).stream,a):t},a.context=function(t){return arguments.length?(s=null==t?(e=null,new cC):new cy(e=t),"function"!=typeof r&&s.pointRadius(r),a):e},a.pointRadius=function(t){return arguments.length?(r="function"==typeof t?t:(s.pointRadius(+t),+t),a):r},a.projection(t).context(e)}function cP(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=function t(e){var i={};return e&&Object.keys(e).forEach(function(s){var r=e[s];"object"==typeof r?null===r?i[s]=null:Array.isArray(r)?i[s]=r.map(function(t){return t}):i[s]=t(r):i[s]=r}),i}(t.properties),e.geometry=cO(t.geometry),e}function cO(t){var e={type:t.type};return(t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type)?e.geometries=t.geometries.map(function(t){return cO(t)}):e.coordinates=function t(e){return"object"!=typeof e[0]?e.slice():e.map(function(e){return t(e)})}(t.coordinates),e}cC.prototype={_radius:4.5,_circle:cB(4.5),pointRadius:function(t){return(t*=1)!==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=cB(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(!this._string.length)return null;var t=this._string.join("");return this._string=[],t}};let cR=function(t){if(!t)throw Error("geojson is required");switch(t.type){case"Feature":return cP(t);case"FeatureCollection":var e,i;return i={type:"FeatureCollection"},Object.keys(e=t).forEach(function(t){switch(t){case"type":case"features":return;default:i[t]=e[t]}}),i.features=e.features.map(function(t){return cP(t)}),i;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return cO(t);default:throw Error("unknown GeoJSON type")}};function cI(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 Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function cL(t){for(var e,i,s=cI(t),r=0,a=1;a<s.length;)e=i||s[0],r+=((i=s[a])[0]-e[0])*(i[1]+e[1]),a++;return r>0}function cD(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 cF(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 cz(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i<t.features.length&&!1!==e(t.features[i],i);i++);}function cH(t,e){var i,s,r,a,n,l,o,h,u,d,c=0,p="FeatureCollection"===t.type,g="Feature"===t.type,f=p?t.features.length:1;for(i=0;i<f;i++){for(l=p?t.features[i].geometry:g?t.geometry:t,h=p?t.features[i].properties:g?t.properties:{},u=p?t.features[i].bbox:g?t.bbox:void 0,d=p?t.features[i].id:g?t.id:void 0,n=(o=!!l&&"GeometryCollection"===l.type)?l.geometries.length:1,r=0;r<n;r++){if(null===(a=o?l.geometries[r]:l)){if(!1===e(null,c,h,u,d))return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(a,c,h,u,d))return!1;break;case"GeometryCollection":for(s=0;s<a.geometries.length;s++)if(!1===e(a.geometries[s],c,h,u,d))return!1;break;default:throw Error("Unknown Geometry Type")}}c++}}function cj(t,e){switch("Feature"===t.type?t.geometry.type:t.type){case"GeometryCollection":return cH(t,function(t){cj(t,e)}),t;case"LineString":return cV(cI(t),e),t;case"Polygon":return cN(cI(t),e),t;case"MultiLineString":return cI(t).forEach(function(t){cV(t,e)}),t;case"MultiPolygon":return cI(t).forEach(function(t){cN(t,e)}),t;case"Point":case"MultiPoint":return t}}function cV(t,e){cL(t)===e&&t.reverse()}function cN(t,e){cL(t[0])!==e&&t[0].reverse();for(var i=1;i<t.length;i++)cL(t[i])===e&&t[i].reverse()}let cW=function(t,e){if((e=e||{}
2).constructor!==Object)throw Error("options is invalid");var i=e.reverse||!1,s=e.mutate||!1;if(!t)throw Error("<geojson> is required");if("boolean"!=typeof i)throw Error("<reverse> must be a boolean");if("boolean"!=typeof s)throw Error("<mutate> must be a boolean");!1===s&&(t=cR(t));var r=[];switch(t.type){case"GeometryCollection":return cH(t,function(t){cj(t,i)}),t;case"FeatureCollection":return cz(t,function(t){cz(cj(t,i),function(t){r.push(t)})}),cF(r)}return cj(t,i)},cU=function(t){if(!t)throw Error("geojson is required");var e,i=[];return e=function(t){i.push(t)},cH(t,function(t,i,s,r,a){var n,l=null===t?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":if(!1===e(cD(t,s,{bbox:r,id:a})))return!1;return}switch(l){case"MultiPoint":n="Point";break;case"MultiLineString":n="LineString";break;case"MultiPolygon":n="Polygon"}for(var o=0;o<t.coordinates.length;o++)if(!1===e(cD({type:n,coordinates:t.coordinates[o]},s)))return!1}),cF(i)},cG=cE(),cY={centroid:!1,name:!1,bbox:!1,rewind:!1},c$=t=>{if(t.geometry.type.startsWith("Multi")){let e=cU(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},cX=(t,e={},i)=>{i.type=dz.GEO;let{centroid:s,name:r,bbox:a,rewind:n}=uB(cY,e);if(Array.isArray(t)){let e;return e=[],t.forEach(t=>{"FeatureCollection"===t.type?t.features.forEach(t=>{e.push(c$(t))}):e.push(c$(t))}),e}let l=t.features;return n&&(l=cW(t,{reverse:!r2(n)||n.reverse}).features),l.forEach(t=>{if(s){let e=cG.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){let e=cG.bounds(t);t.bbox=e}}),t.features=l,t};function cK(t){return t}function cq(t,e){var i=e.id,s=e.bbox,r=null==e.properties?{}:e.properties,a=function(t,e){var i=function(t){if(null==t)return cK;var e,i,s=t.scale[0],r=t.scale[1],a=t.translate[0],n=t.translate[1];return function(t,l){l||(e=i=0);var o=2,h=t.length,u=Array(h);for(u[0]=(e+=t[0])*s+a,u[1]=(i+=t[1])*r+n;o<h;)u[o]=t[o],++o;return u}}(t.transform),s=t.arcs;function r(t){return i(t)}function a(t){for(var e=[],r=0,a=t.length;r<a;++r)!function(t,e){e.length&&e.pop();for(var r=s[t<0?~t:t],a=0,n=r.length;a<n;++a)e.push(i(r[a],a));t<0&&function(t,e){for(var i,s=t.length,r=s-e;r<--s;)i=t[r],t[r++]=t[s],t[s]=i}(e,n)}(t[r],e);return e.length<2&&e.push(e[0]),e}function n(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function l(t){return t.map(n)}return function t(e){var i,s=e.type;switch(s){case"GeometryCollection":return{type:s,geometries:e.geometries.map(t)};case"Point":i=r(e.coordinates);break;case"MultiPoint":i=e.coordinates.map(r);break;case"LineString":i=a(e.arcs);break;case"MultiLineString":i=e.arcs.map(a);break;case"Polygon":i=l(e.arcs);break;case"MultiPolygon":i=e.arcs.map(l);break;default:return null}return{type:s,coordinates:i}}(e)}(t,e);return null==i&&null==s?{type:"Feature",properties:r,geometry:a}:null==s?{type:"Feature",id:i,properties:r,geometry:a}:{type:"Feature",id:i,bbox:s,properties:r,geometry:a}}let cZ={},cJ=(t,e,i)=>{var s;i.type=dz.GEO;let r=uB(cY,cZ,e),{object:a}=r;if(!(0,eS.A)(a))throw TypeError("Invalid object: must be a string!");return cX(("string"==typeof(s=t.objects[a])&&(s=t.objects[s]),"GeometryCollection"===s.type?{type:"FeatureCollection",features:s.geometries.map(function(e){return cq(t,e)})}:cq(t,s)),r,i)};var cQ=i(51271),c0=i.n(cQ);let c1={tolerance:.01},c2=(t,e)=>{let{tolerance:i}=uB(c1,e);return c0()(t,i)};function c3(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function c5(t,e,i){t.getParser(e)||t.registerParser(e,i)}let c4=new Map;function c8(t,e,i={type:"geojson",centroid:!0}){c4.has(t)&&h2(`map type of '${t}' already exists, will be overwritten.`),h||(c5(h=new e_,"geojson",cX),c5(h,"topojson",cJ),c3(h,"simplify",c2));let s=new eR(h),r=eB({},{centroid:!0,simplify:!1},i);"topojson"===i.type?s.parse(e,{type:"topojson",options:r}):s.parse(e,{type:"geojson",options:r});let{simplify:a}=i;!0===a?s.transform({type:"simplify"}):r2(a)&&s.transform({type:"simplify",options:a}),c4.set(t,s)}function c6(t){c4.has(t)?c4.delete(t):h2(`map type of '${t}' does not exists.`)}function c9(t,e=!1){let i=e;return t.latestData instanceof eR&&(i=!1),i?ek(t.latestData):t.latestData&&t.latestData.slice()}let c7=(t,e)=>0===t.length?[]:1===t.length?c9(t[0],null==e?void 0:e.deep):t.map(t=>c9(t,null==e?void 0:e.deep));function pt(t,e,i){c3(e=e instanceof e_?e:t.dataSet,"copyDataView",c7);let s=new eR(e,i);return s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView",level:D.copyDataView}),s}function pe(t,e,i=[]){let s;if(t instanceof eR)return t;let{id:r,values:a=[],fromDataIndex:n,fromDataId:l,transforms:o=[]}=t,h=t.parser?ek(t.parser):{clone:!0},u=ek(t.fields);h.clone=!1!==h.clone;let d=i.find(t=>t.name===r);if(d)s=d;else{let t={name:r};
2if(u&&(t.fields=u),s=new eR(e,t),"string"==typeof l){let t=i.find(t=>t.name===l);if(!t)return h2(`no data matches fromDataId ${l}`),null;s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView"})}else if("number"==typeof n){let t=i[n];if(!t)return h2(`no data matches fromDataIndex ${n}`),null;s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView"})}else Array.isArray(a)?s.parse(a,h):(0,eS.A)(a)&&(!h||["csv","dsv","tsv"].includes(h.type))?s.parse(a,null!=h?h:{type:"csv"}):(s.parse([]),h2("values should be array"));o&&o.length&&o.forEach(t=>{e.getTransform(t.type)&&s.transform(t)})}return s}function pi(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}(m=D||(D={}))[m.copyDataView=-10]="copyDataView",m[m.treemapFilter=-8]="treemapFilter",m[m.treemapFlatten=-7]="treemapFlatten",m[m.dotObjFlat=-7]="dotObjFlat",m[m.linkDotInfo=-7]="linkDotInfo",m[m.sankeyLayout=-7]="sankeyLayout",m[m.dataZoomFilter=-6]="dataZoomFilter",m[m.legendFilter=-5]="legendFilter",(_=F||(F={})).appear="appear",_.disappear="disappear",_.enter="enter",_.update="update",_.state="state",_.exit="exit",_.normal="normal",_.none="none",(y=z||(z={})).before="before",y.layouting="layouting",y.reevaluate="reevaluate",y.after="after";let ps=Object.prototype.hasOwnProperty,pr=t=>void 0===t;class pa extends r4{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,r,a,n,l,o,h,u,d,c,p,g){throw Error("Method not implemented.")}}class pn extends pa{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 Error("getPredictedEvents is not supported!")}clone(){var t,e,i;let s=new pn(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)||t.copyPointerData(this,s),null==(e=this.manager)||e.copyMouseData(this,s),null==(i=this.manager)||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();let r=this.composedDetailPath();
2return s.detailPath=r&&r.slice(),s.type=this.type,s}}class pl extends pa{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;let s=new pl(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)||t.copyWheelData(this,s),null==(e=this.manager)||e.copyMouseData(this,s),null==(i=this.manager)||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();let r=this.composedDetailPath();return s.detailPath=r&&r.slice(),s.type=this.type,s}}pl.DOM_DELTA_PIXEL=0,pl.DOM_DELTA_LINE=1,pl.DOM_DELTA_PAGE=2;let po="object"==typeof performance&&performance.now?performance:Date;function ph(t){return"mouse"===t||"pen"===t}class pu{constructor(t,e){this.dispatch=new(eh()),this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(ph(i.pointerType)){let 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 pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let r=this.createPointerEvent(t,t.type,e),a=ph(r.pointerType),n=this.trackingData(t.pointerId),l=this.findMountedTarget(n.overTargets);if(n.overTargets&&l&&l!==this.rootTarget&&l!==r.target){let e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,l||void 0);if(this.dispatchEvent(i,"pointerout"),a&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(l)){let e=this.createPointerEvent(t,"pointerleave",l||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),a&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(l!==r.target){let e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),a&&this.dispatchEvent(i,"mouseover");let s=null==l?void 0:l.parent;for(;s&&s!==this.rootTarget.parent&&s!==r.target;)s=s.parent;if(!s||s===this.rootTarget.parent){let t=this.clonePointerEvent(r,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target,i=new Set,s=l;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==l&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&this.dispatchEvent(r,"touchmove"),a&&(this.dispatchEvent(r,"mousemove"),this.cursorTarget=r.target,this.cursor=(null==(s=null==(i=r.target)?void 0:i.attribute)?void 0:s.cursor)||this.rootTarget.getCursor()),n.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let r=this.trackingData(t.pointerId),a=this.createPointerEvent(t,t.type,e),n=ph(a.pointerType);this.dispatchEvent(a,"pointerover"),n&&this.dispatchEvent(a,"mouseover"),"mouse"===a.pointerType&&(this.cursorTarget=a.target,this.cursor=(null==(s=null==(i=a.target)?void 0:i.attribute)?void 0:s.cursor)||this.rootTarget.getCursor());let l=this.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==this.rootTarget.parent;)l.currentTarget=l.target,this.notifyTarget(l),n&&this.notifyTarget(l,"mouseenter"),l.target=l.target.parent;r.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(l)},this.onPointerOut=(t,e)=>{if(!(t instanceof pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.trackingData(t.pointerId);if(i.overTargets){let e=ph(t.pointerType),s=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");let a=this.createPointerEvent(t,"pointerleave",s||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),e&&this.notifyTarget(a,"mouseleave"),a.target=a.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(a)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let s=po.now(),r=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if(ph(r.pointerType)){let t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}let a=this.trackingData(t.pointerId),n=this.findMountedTarget(a.pressTargetsByButton[t.button]),l=n;if(n&&!r.composedPath().includes(n)){let e=n;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if(ph(r.pointerType)){let t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete a.pressTargetsByButton[t.button],l=e}if(l){let e=this.clonePointerEvent(r,"click");e.target=l,e.path=[],e.detailPath=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});let n=a.clicksByButton[t.button];n.target===e.target&&s-n.timeStamp<(null!=(i=this._config.clickInterval)?i:200)?++n.clickCount:n.clickCount=1,n.target=e.target,n.timeStamp=s,e.detail=n.clickCount,ph(e.pointerType)?(this.dispatchEvent(e,"click"),2===n.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this._config.supp
2ortsTouchEvents&&(this.dispatchEvent(e,"tap"),2===n.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(r)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof pn))return void eg.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");let i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):ph(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof pl))return void eg.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");let 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,r,a,n,l;let o;if(!this.rootTarget)return;let h=this.mappingTable[t.type],u=`${t.canvasX}-${t.canvasY}`;if((null==(e=this._prePointTargetCache)?void 0:e[u])&&(null==(s=null==(i=this._prePointTargetCache)?void 0:i[u])?void 0:s.stage)&&(null==(a=null==(r=this._prePointTargetCache)?void 0:r[u])?void 0:a.stage.renderCount)===(null==(n=this._prePointTargetCache)?void 0:n.stageRenderCount)?o=this._prePointTargetCache[u]:(o=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[u]:o,stageRenderCount:null!=(l=null==o?void 0:o.stage.renderCount)?l:-1})),h)for(let e=0,i=h.length;e<i;e++)h[e].fn(t,o);else eg.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;let i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let s=0,r=i.length-1;s<r;s++)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){let e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw 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;let 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<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var s,r;let a=this.allocateEvent(pn);return this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t,a.target=i||this.pickTarget(null!=(s=a.viewX)?s:a.global.x,null!=(r=a.viewY)?r:a.global.y,a),"string"==typeof e&&(a.type=e),a}createWheelEvent(t,e){var i,s;let r=this.allocateEvent(pl);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!=(i=r.viewX)?i:r.global.x,null!=(s=r.viewY)?s:r.global.y,r),r}clonePointerEvent(t,e){let i=this.allocateEvent(pn);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();let s=t.composedDetailPath();return i.detailPath=s&&s.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof pn&&e instanceof pn&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.t
2iltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof pa&&e instanceof pa&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach(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=po.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,[]);let i=(null==(e=this.eventPool.get(t))?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 Error("It is illegal to free an event not managed by this EventManager!");let i=t.constructor;this.eventPool.has(i)||(this.eventPool.get(i).forEach(e=>{e.eventPhase=t.NONE,e.currentTarget=null,e.path=[],e.detailPath=[],e.target=null}),this.eventPool.set(i,[])),null==(e=this.eventPool.get(i))||e.push(t)}notifyListeners(t,e){let 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,r=i.length;s<r&&!t.propagationImmediatelyStopped;s++)i[s].once&&t.currentTarget.removeEventListener(e,i[s].fn,{once:!0}),i[s].fn.call(i[s].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){let i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let s=0,r=i.length;s<r&&!t.propagationImmediatelyStopped;s++)i[s].fn.call(i[s].context,t,e)}pickTarget(t,e,i){let s,r=this.rootTarget.pick(t,e);return s=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),s}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}let pd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class pc{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(!t.cancelable&&"cancelable"in t||t.preventDefault());for(let t=0,i=e.length;t<i;t++){let i=e[t],s=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(s)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType||this.isEventOutsideOfTargetElement(t))return;let e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){let i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t<s;t++){let s=this.bootstrapEvent(this.rootPointerEvent,i[t]);s.type+=e,this.manager.mapEvent(s)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;let e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){let i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=t=>{let e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:r,autoPreventDefault:a=!1,clickInterval:n,supportsTouchEvents:l=r.supportsTouchEvents,supportsPointerEvents:o=r.supp
2ortsPointerEvents}=t;this.manager=new pu(s,{clickInterval:n,supportsTouchEvents:l}),this.globalObj=r,this.supportsPointerEvents=o,this.supportsTouchEvents=l,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=a,this.eventsAdded=!1,this.rootPointerEvent=new pn,this.rootWheelEvent=new pl,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){let i,s;if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");let{applyStyles:r,domElement:a}=this;if(this.currentCursor===t)return;this.currentCursor=t;let n=this.cursorStyles[t];n?"string"==typeof n&&r?a.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&r&&Object.assign(a.style,n):r&&(0,eS.A)(t)&&(i=this.cursorStyles,s=t,!(null!=i&&ps.call(i,s)))&&(a.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;let{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.addEventListener("pointermove",this.onPointerMove,!0),t.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.addEventListener("mousemove",this.onPointerMove,!0),t.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;let{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.removeEventListener("pointermove",this.onPointerMove,!0),t.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.removeEventListener("mousemove",this.onPointerMove,!0),t.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;let s=null==(e=this.globalObj)?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let r=0,a=0;if(t.changedTouches){let e=null!=(i=t.changedTouches[0])?i:{};r=e.clientX||0,a=e.clientY||0}else r=t.clientX||0,a=t.clientY||0;let n=this.domElement.getBoundingClientRect();return{x:r-n.left,y:a-n.top}}normalizeToPointerData(t){let e=[];
2if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i<s;i++){let s=t.changedTouches[i];pr(s.button)&&(s.button=0),pr(s.buttons)&&(s.buttons=1),pr(s.isPrimary)&&(s.isPrimary=1===t.touches.length&&"touchstart"===t.type),pr(s.width)&&(s.width=s.radiusX||1),pr(s.height)&&(s.height=s.radiusY||1),pr(s.tiltX)&&(s.tiltX=0),pr(s.tiltY)&&(s.tiltY=0),pr(s.pointerType)&&(s.pointerType="touch"),pr(s.pointerId)&&(s.pointerId=s.identifier||0),pr(s.pressure)&&(s.pressure=s.force||.5),pr(s.twist)&&(s.twist=0),pr(s.tangentialPressure)&&(s.tangentialPressure=0),pr(s.layerX)&&(s.layerX=s.offsetX=s.clientX),pr(s.layerY)&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=t.type,e.push(s)}else this.globalObj.supportsMouseEvents&&(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof PointerEvent)||(pr(t.isPrimary)&&(t.isPrimary=!0),pr(t.width)&&(t.width=1),pr(t.height)&&(t.height=1),pr(t.tiltX)&&(t.tiltX=0),pr(t.tiltY)&&(t.tiltY=0),pr(t.pointerType)&&(t.pointerType="mouse"),pr(t.pointerId)&&(t.pointerId=1),pr(t.pressure)&&(t.pressure=.5),pr(t.twist)&&(t.twist=0),pr(t.tangentialPressure)&&(t.tangentialPressure=0),t.isNormalized=!0),e.push(t);return e}normalizeWheelEvent(t){let e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;let{x:i,y:s}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=s,e.global.x=i,e.global.y=s,e.offset.x=i,e.offset.y=s;let{x:r,y:a}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=a,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);let{x:i,y:s}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=s,t.global.x=i,t.global.y=s,t.offset.x=i,t.offset.y=s;let{x:r,y:a}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=a,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=pd[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=po.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){let e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),s=i.width(),r=i.height();return!(e.x<s&&e.y<r&&e.x>0&&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 pp{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=eI.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;let e=this.pluginService.stage;e&&(e.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),e.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),e.graphicService.hooks.onRemove.tap(this.key,this.handleChange))}deactivate(t){let e=t=>t.filter(t=>t.name!==this.key),i=this.pluginService.stage;i&&(i.graphicService.hooks.onAttributeUpdate.taps=e(i.graphicService.hooks.onAttributeUpdate.taps),i.graphicService.hooks.onSetStage.taps=e(i.graphicService.hooks.onSetStage.taps),i.graphicService.hooks.onRemove.ta
2ps=e(i.graphicService.hooks.onRemove.taps))}}class pg{constructor(){this.name="AutoRefreshPlugin",this.activeEvent="onRegister",this._uid=eI.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,this.dpr=ie.global.devicePixelRatio,this.refresh()}refresh(){this._refreshByMediaQuery()||this._refreshByRaf()}_refreshByRaf(){let t=ie.global.getRequestAnimationFrame();this.rafId=t(()=>{ie.global.devicePixelRatio!==this.dpr&&(this.dpr=ie.global.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0)),this.refresh()})}_refreshByMediaQuery(){try{let t=`(resolution: ${window.devicePixelRatio}dppx)`,e=()=>{window.devicePixelRatio!==this.dpr&&(this.dpr=window.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0))},i=matchMedia(t);i&&i.addEventListener("change",e),this.autoRefreshCbs||(this.autoRefreshCbs=[]),this.autoRefreshCbs.push(()=>{i&&i.removeEventListener("change",e)})}catch(t){return!1}return!0}deactivate(t){var e;let i=ie.global.getCancelAnimationFrame();i&&this.rafId&&i(this.rafId),null==(e=this.autoRefreshCbs)||e.forEach(t=>{t()}),this.autoRefreshCbs=void 0}}class pf{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=eI.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t;let e=this.pluginService.stage;e&&(e.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))}),e.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){let e=this.pluginService.stage;e&&(e.graphicService.hooks.onAddIncremental.taps=e.graphicService.hooks.onAddIncremental.taps.filter(t=>t.name!==this.key),e.graphicService.hooks.onClearIncremental.taps=e.graphicService.hooks.onClearIncremental.taps.filter(t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,ie.global.getRequestAnimationFrame()(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){let t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach(e=>{let i=e.layer;if(!i||!e.layer.subLayers)return;let 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())}}let pm=new iJ;class p_{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=eI.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()});let e=this.pluginService.stage;e&&(e.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&&(pm.setValue(s.x1,s.y1,s.x2,s.y2),e.dirty(pm,t.parent&&t.parent.globalTransMatrix)))}),e.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(t,e,i,s,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(s.globalAABBBounds))}),e.graphicService.hooks.clearAABBBounds.tap(this.key,(t,e,i)=>{e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(i)}),e.graphicService.hooks.onRemove.tap(this.key,t=>{let e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){let e=this.pluginService.stage;e&&(e.graphicService.hooks.beforeUpdateAABBBounds.taps=e.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(t=>t.name!==this.key),e.graphicService.hooks.afterUpdateAABBBounds.taps=e.graphicService.hooks.afterUpdateAABBBounds.taps.filter(t=>t.name!==this.key),e.graphicService.hooks.clearAABBBounds.taps=e.graphicService.hooks.clearAABBBounds.taps.filter(t=>t.name!==this.key),e.hooks.afterRender.taps=e.hooks.afterRender.taps.filter(t=>
2t.name!==this.key),e.graphicService.hooks.onRemove.taps=e.graphicService.hooks.onRemove.taps.filter(t=>t.name!==this.key))}}class py{static registerPlugin(t,e){py._pluginClasses[t]=e}static getPlugin(t){return py._pluginClasses[t]}}py._pluginClasses={};let pv="white";class pb extends n1{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){let e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){let 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)?t:pv}set background(t){this._background=t,this.syncBackgroundImage(t)}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}get ticker(){return this._ticker}set ticker(t){t.bindStage(this),this._ticker&&this._ticker.removeListener("tick",this.afterTickCb),t.addTimeline(this.timeline),this._ticker=t,this._ticker.on("tick",this.afterTickCb)}syncBackgroundImage(t){var e;let i=null!=(e=null==t?void 0:t.background)?e:t;this.backgroundImg=!1,this.isImageBackgroundSource(i)&&this.loadImage(i,!0)}isImageBackgroundSource(t){return!!t&&("string"==typeof t?t.startsWith("<svg")||r0(t)||t.includes("/")||r1(t):!!r2(t)&&("string"!=typeof t.gradient||!Array.isArray(t.stops)))}constructor(t={}){var e,i;super({}),this.tickedBeforeRender=!0,this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){let 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._beforeRenderList.forEach(e=>e(t))},this.afterClearScreen=t=>{this._afterClearScreen&&this._afterClearScreen(t)},this.afterClearRect=t=>{this._afterClearRect&&this._afterClearRect(t)},this.afterRender=t=>{this.renderCount++,this._afterRenderList.forEach(e=>e(t)),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach(e=>e(t)),this._afterNextRenderCbs=null,this.tickedBeforeRender=!1},this.afterTickCb=()=>{this.tickedBeforeRender=!0,"rendering"!==this.state&&this.renderNextFrame()},this.params=t,this.theme=new rZ,this.hooks={beforeRender:new eZ(["stage"]),afterRender:new eZ(["stage"]),afterClearScreen:new eZ(["stage"]),afterClearRect:new eZ(["stage"])},this.global=ie.global,!this.global.env&&hK()&&this.global.setEnv("browser"),this.window=e7.get(rz),this.renderService=e7.get(it),this.pluginService=e7.get(lj),this.layerService=e7.get(n8),this.graphicService=e7.get(nE),this.pluginService.active(this,t),this._beforeRenderList=[],this._afterRenderList=[],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)?e:pv,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(),t.autoRefresh&&this.enableAutoRefresh(),!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),t.beforeRender&&this._beforeRenderList.push(t.beforeRender),t.afterRe
2nder&&this._afterRenderList.push(t.afterRender),this.hooks.afterClearScreen.tap("constructor",this.afterClearScreen),this.hooks.afterClearRect.tap("constructor",this.afterClearRect),this._afterClearScreen=t.afterClearScreen,this._afterClearRect=t.afterClearRect,this.supportInteractiveLayer=!1!==t.interactiveLayer,t.optimize||(t.optimize={tickRenderMode:"effect"}),this.optmize(t.optimize),t.background&&this.syncBackgroundImage(this._background),this.initAnimate(t),this.rafId=null!=(i=t.rafId)?i:Math.floor(6*Math.random())}initAnimate(t){var e;this.createTicker&&this.createTimeline&&(this._ticker=t.ticker||this.createTicker(this),this._ticker.bindStage(this),"performance"===(null==(e=this.params.optimize)?void 0:e.tickRenderMode)&&this._ticker.setFPS(30),this.timeline=this.createTimeline(),this._ticker.addTimeline(this.timeline),this._ticker.on("tick",this.afterTickCb))}startAnimate(){this._ticker&&this.timeline&&(this._ticker.start(),this.timeline.resume())}pauseRender(t=-1){this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new pc(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():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(),this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){let{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:s=0,beta:r=0,camera:a,fieldRatio:n=1,fieldDepth:l}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:s,beta:r,camera:a,fieldRatio:n,fieldDepth:l})}set3dOptions(t){var e,i,s,r,a,n;this.option3d=t;let{light:l,center:o,camera:h,alpha:u,beta:d,fieldRatio:c,fieldDepth:p}=this.get3dOptions(t),{dir:g=[1,1,-1],color:f="white",ambient:m}=l,_=(null!=(e=o.x)?e:this.width/2)+(null!=(i=o.dx)?i:0),y=(null!=(s=o.y)?s:this.height/2)+(null!=(r=o.dy)?r:0),v=[_,y,(null!=(a=o.z)?a:0)+(null!=(n=o.dz)?n:0)],b=0,x=0,S=0;h||(b=Math.sin(u)+_,x=Math.sin(d)+y,S=Math.cos(u)*Math.cos(d)*1);let A=py.getPlugin("DirectionalLight");A&&(this.light=new A(g,f,m));let k={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:c,fieldDepth:p,viewParams:{pos:[b,x,S],center:v,up:[0,1,0]}};if(this.camera)this.camera.params=k;else{let t=py.getPlugin("OrthoCamera");t&&(this.camera=new t(k))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRenderList.push(t)}removeBeforeRender(t){this._beforeRenderList=this._beforeRenderList.filter(e=>e!==t)}setAfterRender(t){this._afterRenderList.push(t)}removeAfterRender(t){this._afterRenderList=this._afterRenderList.filter(e=>e!==t)}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;let t=py.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 pp))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableAutoRefresh(){this.autoRefresh||"node"===this.global.env||(this.autoRefresh=!0,this.pluginService.register(new pg))}disableAutoRefresh(){this.autoRefresh&&(this.autoRefresh=!1,this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new pf))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach(t=>{this.pluginService.unRegister(t)}))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new iZ;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new p_,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;let t=py.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;let e=py.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;let e=py.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(){let t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw Error("æä¸æ¯æ")}createLayer(t,e){if("released"===this.releaseStatus)return;let i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){let 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.startAnimate();let 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){let t=this.window.getContext().nativeContext;this.forEachChildren((e,i)=>{if(i>0){let i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}})}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEac
2h(t=>{this.nextFrameRenderLayerSet.add(t)}),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getSpecifiedRequestAnimationFrame(this.rafId)(()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1}))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.startAnimate();let 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){let i=[];for(let e=0;e<t.length;e++){let s=t[e];"virtual"===s.layerMode&&(s=s.getNativeHandler().mainHandler.layer),i.includes(s)||i.push(s)}i.forEach(t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({render
2Service: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,r){let a=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(a=!1)):(this.viewBox.setValue(t,e,t+i,e+s),!1===r&&(a=!1)),this.forEachChildren(t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())}),a&&this.render()}setDpr(t,e=!0){this.forEachChildren(e=>{e.setDpr(t)}),e&&this.render()}setOrigin(t,e){throw Error("æä¸æ¯æ")}export(t){throw Error("æä¸æ¯æ")}pick(t,e){if("released"===this.releaseStatus)return;let i=this.getPickerService().pick(this.children,new i8(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}setToFrame(t){throw Error("æä¸æ¯æ")}release(){var t,e,i;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(),null==(t=this._ticker)||t.remTimeline(null==this?void 0:this.timeline),null==(e=this._ticker)||e.removeListener("tick",this.afterTickCb),this.params.ticker||null==(i=this._ticker)||i.release(),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;let i=e7.get(rz),s=e?-e.x1:0,r=e?-e.y1:0,a=e?e.x2:this.viewWidth,n=e?e.y2:this.viewHeight,l=e?e.width():this.viewWidth,o=e?e.height():this.viewHeight;return i.create({viewBox:{x1:s,y1:r,x2:a,y2:n},width:l,height:o,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if("released"===this.releaseStatus)return;let 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){let e=this.global.mapToCanvasPoint(t,this.window);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=e7.get(lb)),this.pickerService}reInit(){this.renderService.reInit(),this.pickerService.reInit()}}var px=i(75024);px.H;let pS=`${px.H}_DEFAULT_DATA_INDEX`,pA=`${px.H}_DEFAULT_DATA_KEY`,pk=`${px.H}_DEFAULT_DATA_SERIES_FIELD`,pM=`${px.H}_DEFAULT_SERIES_STYLE_NAME`,pw=`${px.H}_STACK_KEY`,pT=`${px.H}_STACK_START`,pC=`${px.H}_STACK_END`,pB=`${px.H}_STACK_START_PERCENT`,pE=`${px.H}_STACK_END_PERCENT`,pP=`${px.H}_STACK_START_OffsetSilhouette`,pO=`${px.H}_STACK_END_OffsetSilhouette`,pR=`${px.H}_STACK_TOTAL`,pI=`${px.H}
2_STACK_TOTAL_PERCENT`,pL=`${px.H}_STACK_TOTAL_TOP`,pD=`${px.H}_STACK_TOTAL_BOTTOM`;px.H,px.H,px.H,px.H;let pF=`${px.H}_SEGMENT_START`,pz=`${px.H}_SEGMENT_END`,pH=`${px.H}_KEY`,pj=`${px.H}_MAP_LOOK_UP_KEY`,pV=["line","area","trail"];function pN(t,e,i){let s=new Map;if(!t||0===t.length)return{keys:[],data:s};if(!e)return s.set(pH,i?t.slice().sort(i):t.slice()),{keys:[pH],data:s};if(1===t.length){let i=e(t[0],0);return s.set(i,[t[0]]),{keys:[i],data:s}}let r=new Set;return t.forEach((t,i)=>{var a;let n=e(t,i),l=null!=(a=s.get(n))?a:[];l.push(t),s.set(n,l),r.add(n)}),i&&r.forEach(t=>{s.get(t).sort(i)}),{keys:Array.from(r),data:s}}let pW=(t,e,i={})=>(t&&Object.keys(t).forEach(s=>{i[s]=t[s](e)}),i);function pU(t,e,i,s,r){let a=t=>{if(!s&&t&&(!i||i(t))){let i=e.call(null,t);if(r&&i)return i}if("group"===t.type){let e=t.getMarks();if(e)for(let t=0;t<e.length;t++){let i=a(e[t]);if(i&&r)return i}}if(s&&t&&(!i||i(t))){let i=e.call(null,t);if(i&&r)return i}};return a(t)}function pG(t){let e=[];return t.forEach(t=>{pU(t,t=>{"group"!==t.type&&"component"!==t.type&&e.push(t)})}),e}function pY(t,e,i,s){let r=pN(t,t=>i(t)),a=pN(e,t=>s(t)),n=t,l=e,o=[];return a.keys.forEach(t=>{if(!(0,eE.A)(t)){let e=r.data.get(t),i=a.data.get(t);e&&i&&(o.push({prev:e,next:i}),n=n.filter(t=>!e.includes(t)),l=l.filter(t=>!i.includes(t)))}}),{prev:n,next:l,update:o}}let p$=`${px.H}_BuiltIn_CallBack_Disappear`;(v=H||(H={})).render="render",v.disappear="disappear";class pX{get stateAnimationConfig(){return this._stateAnimationConfig}getRootGroup(){return this._rootGroup}getOption(){return this._option}constructor(t,e){this._count=0,this._rootMarks=[],this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._compileChart=null,this.handleLayoutEnd=()=>{var t,e;null==(e=null==(t=this._compileChart)?void 0:t.getEvent())||e.emit(dj.afterMarkLayoutEnd,{chart:this._compileChart})},this.handleStageRender=()=>{var t,e;null==(e=null==(t=this._compileChart)?void 0:t.getEvent())||e.emit(dj.afterRender,{chart:this._compileChart})},this._handleAfterNextRender=()=>{var t,e,i,s;this._stage&&!this._option.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._compileChart&&(null==(t=this._compileChart.getEvent())||t.emit(dj.renderFinished,{chart:this._compileChart,vchart:null==(e=this._compileChart.getOption())?void 0:e.globalInstance})),null==(s=null==(i=this._option.performanceHook)?void 0:i.afterVRenderDraw)||s.call(i,this._compileChart.getOption().globalInstance)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach(t=>{t.isDoingProgressive()&&t.renderProgressive()}),this.doPreProgressive()},this._container=t,this._option=e}getChart(){return this._compileChart}getCanvas(){var t;return null==(t=this._stage)?void 0:t.window.getNativeHandler().nativeCanvas}getStage(){return this._stage}initView(){var t,e,i,s;if(this._released||(this.isInited=!0,this._stage))return;let{autoRefreshDpr:r,dpr:a,mode:n,modeParams:l,gestureConfig:o,interactive:h,clickInterval:u,autoPreventDefault:d,background:c}=this._option;hL.setEnv(function(t){switch(t){case hd["desktop-browser"]:case hd["mobile-browser"]:break;case hd.node:case hd.worker:return"node";case hd.miniApp:case hd["desktop-miniApp"]:return"feishu";case hd.lynx:return"lynx";case hd.wx:return"wx";case hd.tt:return"tt";case hd.harmony:return"harmony"}return"browser"}(n),null!=l?l:{}),this._stage=null!=(t=this._option.stage)?t:new pb(Object.assign({background:c,width:this._width,height:this._height,container:null!=(e=this._container.dom)?e:null,canvas:null!=(i=this._container.canvas)?i:null,dpr:a,viewBox:this._option.viewBox,canvasControled:this._option.canvasControled,beforeRender:t=>{var e,i,s;null==(e=this._compileChart)||e.onBeforeRender(),null==(s=(i=this._option).beforeRender)||s.call(i,t)},afterRender:this._option.afterRender,disableDirtyBounds:!0,autoRender:!0,ticker:this._option.ticker,pluginList:this._option.pluginList,enableHtmlAttribute:this._option.enableHtmlAttribute,optimize:this._option.optimize,supportsTouchEvents:this._option.supportsTouchEvents,supportsPointerEvents:this._option.supportsPointerEvents,event:{clickInterval:u,autoPreventDefault:d},ReactDOM:this._option.ReactDOM,autoRefresh:(0,eA.A)(r)?r:!(0,eA.A)(a)},null!=(s=this._option.renderHooks)?s:{})),this._stage.enableIncrementalAutoRender(),this._stage.setTheme({symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}});let p=n2({x:0,y:0,width:this._width,height:this._height});p.name="root",this._stage.defaultLayer.appendChild(p),this._rootGroup=p;let g=((0,eA.A)(o)?o:hQ(n))&&!1!==h&&uP.getStageEventPlugin("gesture");g&&(this._gestureController=new g(this._stage,r2(o)?o:{}
2)),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==h&&this._viewListeners.forEach(t=>{})}getLayoutState(){return this._layoutState}updateLayoutTag(){this._layoutState=z.before}_setCanvasStyle(){if(this._stage&&this._container.dom&&!(0,eS.A)(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";let t=this.getCanvas();t&&(t.style.display="block")}}compile(t,e){if(this._released)return;let{chart:i}=t;this._compileChart=i,this.initView(),this._stage&&("render"!==(null==e?void 0:e.actionSource)&&this._cachedMarks&&(this.reuseOrMorphing(e.morphConfig),this._cachedMarks=null),i.compile(),i.afterCompile())}clearNextRender(){return!!this._nextRafId&&(hL.getSpecifiedCancelAnimationFrame(10)(this._nextRafId),this._nextRafId=null,!0)}clear(t){let{chart:e}=t;this.clearNextRender(),e.clear()}renderNextTick(t){this._released||(this._nextRafId&&this.clearNextRender(),this._nextRafId=hL.getSpecifiedRequestAnimationFrame(10)(()=>{this._nextRafId=null,this.render(t)}))}_commitedAll(){return this._rootMarks.some(t=>pU(t,t=>t.commit()))}_hasCommitedMark(){return this._rootMarks.some(t=>pU(t,t=>t.isCommited(),null,null,!0))}_doRender(t){var e,i,s,r,a,n;null==(i=null==(e=this._option.performanceHook)?void 0:e.beforeDoRender)||i.call(e,this._compileChart.getOption().globalInstance),this._stage&&(this._rootMarks.forEach(t=>{pU(t,t=>{t.needClear&&(this._progressiveMarks||t.runAnimation(),t.clearExitGraphics(),t.needClear=!1)},null,!0)}),null==(r=null==(s=this._option.performanceHook)?void 0:s.beforeVRenderDraw)||r.call(s,this._compileChart.getOption().globalInstance),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this._handleAfterNextRender),t&&(this._stage.render(),null==(n=null==(a=this._option.performanceHook)?void 0:a.afterVRenderDraw)||n.call(a,this._compileChart.getOption().globalInstance)))}renderMarks(){var t;this._hasCommitedMark()&&(h1(`--- start of renderMarks(${this._count}) ---`),this.clearProgressive(),this._rootMarks.forEach(t=>{t.render()}),this._layoutState===z.before&&(this._layoutState=z.layouting,null==(t=this._compileChart)||t.onLayout(),this._layoutState=z.reevaluate,this._hasCommitedMark()&&this._rootMarks.forEach(t=>{t.render()}),this.handleLayoutEnd()),this.findProgressiveMarks(),this.updateStateAnimation(),this._doRender(!0),this.doPreProgressive(),h1(`--- start of renderMarks(${this._count}) ---`),this._count++)}reuseOrMorphing(t={}){var e,i;let s,r,a,n,l,o,h,{reuse:u=!0,morph:d=!0,morphAll:c=!1,animation:p={},enableExitAnimation:g=!1}=t,f=pG(this._rootMarks),{update:m,exit:_}=(e=this._cachedMarks,i={morph:d,morphAll:c,reuse:u},s={enter:[],exit:[],update:[]},r=[],a=[],e.forEach(t=>{i.morph&&t.getMarkConfig().morph||i.morphAll||i.reuse?r.push(t):s.exit.push({prev:[t]})}),f.forEach(t=>{i.morph&&t.getMarkConfig().morph||i.morphAll||i.reuse?a.push(t):s.enter.push({next:[t]})}),r=(n=pY(r,a,t=>t.getMarkConfig().morphKey,t=>t.getMarkConfig().morphKey)).prev,a=n.next,s.update=s.update.concat(n.update),r=(l=pY(r,a,t=>`${t.getUserId()}`,t=>`${t.getUserId()}`)).prev,a=l.next,s.update=s.update.concat(l.update),o=pN(r,t=>{var e,i;return null==(i=null==(e=t.group)?void 0:e.id)?void 0:i.call(e)}),Object.keys(h=pN(a,t=>{var e,i;return null==(i=null==(e=t.group)?void 0:e.id)?void 0:i.call(e)})).forEach(t=>{let e=o.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t<Math.max(e.length,i.length);t+=1){let r=e[t],a=i[t];r&&a?s.update.push({prev:[r],next:[a]}):r?s.exit.push({prev:[r]}):a&&s.enter.push({next:[a]})}r=r.filter(t=>!e.includes(t)),a=a.filter(t=>!i.includes(t))}}),r.forEach(t=>s.exit.push({prev:[t]})),a.forEach(t=>s.enter.push({next:[t]})),s);m.forEach(({prev:t,next:e})=>
2{if(u&&1===t.length&&1===e.length&&t[0].type===e[0].type)e[0].reuse(t[0]);else{let i=t.filter(t=>t.getMarkConfig().morph)[0];i&&e.forEach(t=>{t.getMarkConfig().morph&&t.prepareMorph(i)})}}),_.forEach(({prev:t})=>{t.forEach(t=>{t.removeProduct()})})}render(t){if(this._released||(this.clearNextRender(),this.initView(),!this._stage))return;let{width:e,height:i}=this._rootGroup.attribute;this._width===e&&this._height===i||this._rootGroup.setAttributes({width:this._width,height:this._height}),this.renderMarks(),this.clearNextRender()&&this.renderMarks()}setStageAnimationConfig(t){let e={};Object.keys(t).forEach(i=>{let s=t[i];(0,ev.A)(s)?e[i]="disappear"===i?s.map(t=>{var e;return"function"==typeof(e=t.callBack)&&/^class\s/.test(e.toString())?Object.assign(Object.assign({},t),{custom:t.callBack}):Object.assign(Object.assign({},t),{type:p$,customParameters:{callBack:t.callBack}})}):s.map(t=>{var e;let i=null!=(e=t.options)?e:{};return Object.assign(Object.assign({},t),{options:(...t)=>Object.assign({},"function"==typeof i?i(...t):i)})}):e[i]=Object.assign({},t[i])}),this._stateAnimationConfig=e}updateStateAnimation(){let t=[];this._rootMarks.forEach(e=>{pU(e,e=>{t.push(e)})});let e=t.map(t=>t.getAnimationState()),i=e.every(t=>t===F.appear)?F.appear:e.every(t=>t===F.disappear)?F.disappear:F.none;this._stage.context||(this._stage.context={}),this._stage.context.animationState=i}updateViewBox(t,e=!0){if(!this._stage)return;let i=this._stage.viewBox;!t||i&&i.x1===t.x1&&i.y1===t.y1&&i.x2===t.x2&&i.y2===t.y2||this._stage.setViewBox(t,e)}resize(t,e,i=!0){if(!this._stage)return;let s=this._width!==t||this._height!==e;this._width=t,this._height=e,s&&(this._stage.resize(t,e),this._commitedAll(),i&&this.render({morph:!1}))}setBackground(t){this._stage&&(this._stage.background=t)}setSize(t,e){this._width=t,this._height=e,this._stage}setViewBox(t,e=!0){this.updateViewBox(t,e)}addEventListener(t,e,i){var s,r;if(!1!==this._option.interactive){if(t===dV.chart){let r=this.getRootGroup(),a=(function(s){var a;let n=s.target,l=null;n&&(l=(0,eA.A)(n.context)?n:((t,e)=>{let i=e;for(;(null==i?void 0:i.parent)&&i.parent!==t;)if((i=i.parent).context)return i;return null})(r,n));let o=null!=(a=null==l?void 0:l.context)?a:{},h=(0,eA.A)(o.markId)?o.markId:null,u=(0,eA.A)(o.modelId)?o.modelId:null,d=(0,eA.A)(o.modelUserId)?o.modelUserId:null,c=(0,eA.A)(o.markUserId)?o.markUserId:null,p={event:s,type:e,source:t,item:l,datum:u3(l),markId:h,modelId:u,markUserId:c,modelUserId:d};i.call(null,p)}).bind(this);this._viewListeners.set(i,{type:e,callback:a}),null==(s=this._stage)||s.addEventListener(e,a)}else if(t===dV.window){let s=(function(s){i.call(null,{event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null})}).bind(this);this._windowListeners.set(i,{type:e,callback:s});let r=this._getGlobalThis();null==r||r.addEventListener(e,s)}else if(t===dV.canvas){let s=(function(s){i.call(null,{event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null})}).bind(this);this._canvasListeners.set(i,{type:e,callback:s});let a=null==(r=this.getStage())?void 0:r.window;null==a||a.addEventListener(e,s)}}}removeEventListener(t,e,i){var s,r,a,n,l;if(!1!==this._option.interactive){if(t===dV.chart){let t=null==(s=this._viewListeners.get(i))?void 0:s.callback;t&&(null==(r=this._stage)||r.removeEventListener(e,t)),this._viewListeners.delete(i)}else if(t===dV.window){let t=this._getGlobalThis(),s=null==(a=this._windowListeners.get(i))?void 0:a.callback;
2s&&(null==t||t.removeEventListener(e,s)),this._windowListeners.delete(i)}else if(t===dV.canvas){let t=null==(n=this.getStage())?void 0:n.window,s=null==(l=this._canvasListeners.get(i))?void 0:l.callback;t&&s&&(null==t||t.removeEventListener(e,s)),this._canvasListeners.delete(i)}}}releaseEvent(){let 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.releaseGrammar(!0),this._stage!==(null==(t=this._option)?void 0:t.stage)&&this._stage.release(),this._stage=null,this.isInited=!1,this._compileChart=null,this._released=!0}releaseGrammar(t=!1){t?this._rootMarks.forEach(t=>{pU(t,t=>{t.removeProduct()},null,!0)}):this._cachedMarks=pG(this._rootMarks),this._rootMarks=[]}addRootMark(t){this._rootMarks.includes(t)||this._rootMarks.push(t)}getRootMarks(){return this._rootMarks}removeRootMark(t){let e=this._rootMarks.findIndex(e=>e===t);return e>=0&&(this._rootMarks.splice(e,1),!0)}_getGlobalThis(){var t;return hJ(this._option.mode)?globalThis:null==(t=this.getStage())?void 0:t.window}_combineIncrementalLayers(){this._stage&&(function(t){var e,i,s,r;return e=this,i=void 0,s=void 0,r=function*(){let e=[],i=t.getChildren();yield new Promise(t=>{ie.global.getRequestAnimationFrame()(()=>{t(null)})}
2),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||(s=Promise))(function(t,a){function n(t){try{o(r.next(t))}catch(t){a(t)}}function l(t){try{o(r.throw(t))}catch(t){a(t)}}function o(e){var i;e.done?t(e.value):((i=e.value)instanceof s?i:new s(function(t){t(i)})).then(n,l)}o((r=r.apply(e,i||[])).next())})})(this._stage).then(()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()})}findProgressiveMarks(){let t=[];return this._rootMarks.forEach(e=>{pU(e,e=>{e.isProgressive()&&t.push(e)})}),t.length?(this._progressiveMarks=t,this._combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some(t=>t.isDoingProgressive())){let t=hL.getSpecifiedRequestAnimationFrame(10);this._progressiveRafId=t(this.handleProgressiveFrame)}else this._progressiveMarks&&this._progressiveMarks.every(t=>t.canAnimateAfterProgressive())?this._progressiveMarks.forEach(t=>{t.runAnimation(),t.clearExitGraphics()}):this._progressiveMarks&&(this._progressiveMarks=null)}clearProgressive(){this._progressiveRafId&&hL.getSpecifiedCancelAnimationFrame(10)(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach(t=>{t.clearProgressive()}),this._progressiveMarks=null)}}let pK=Object.prototype,pq=function(t){let e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pK)},pZ=Object.prototype.hasOwnProperty,pJ=function(t){if((0,eE.A)(t))return!0;if(eM(t))return!t.length;let e=({}).toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Map"===e||"Set"===e)return!t.size;if(pq(t))return!Object.keys(t).length;for(let e in t)if(pZ.call(t,e))return!1;return!0},pQ={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}},p0={poptip:eB({},pQ)};function p1(){p1.__loaded||(p1.__loaded=!0,lF.RegisterGraphicCreator("group",n2))}p1.__loaded=!1;class p2{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,s){if(t.xOffset="left"===e||"start"===e?0:"center"===e?-(t.width/2):"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=-(t.height/2);else if("alphabetic"===i){let e=.79;if(1===s.length){let t=s[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=-(t.height*e)}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,s,r="",a,n){let{lineWidth:l,suffixPosition:o="end",measureMode:h=hg.actualBounding,keepCenterInLine:u=!1}=null!=n?n:{};t=t.map(t=>t.toString());let d=[],c=[0,0];if("number"==typeof l&&l!==1/0){let e;for(let i=0,s=t.length;i<s;i++){let s=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h),n=t[i].toString();if(s.width>l){let s=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,l,r,a,o);n=s.str,e=s.width}else e=s.width;d.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}c[0]=l}else{let e,i,s=0;for(let r=0,a=t.length;r<a;r++){i=t[r];let a=this.textMeasure.measureTextPixelADscentAndWidth(t[r],this.textOptions,h);s=Math.max(s,e=a.width),d.push({str:i,width:e,ascent:a.ascent,descent:a.descent,keepCenterInLine:u})}c[0]=s}c[1]=d.length*s,c[0]=d.reduce((t,e)=>Math.max(t,e.width),0);let p={xOffset:0,yOffset:0,width:c[0],height:c[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,e,i,s)}layoutWithBBox(t,e,i,s,r){let a=[0,0],n=e.length*r;"top"===s||("middle"===s?a[1]=(t.height-n)/2:"bottom"===s&&(a[1]=t.height-n));for(let n=0;n<e.length;n++)this.lineOffset(t,e[n],i,s,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:s}}lineOffset(t,e,i,s,r,a){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+a[1],!e.keepCenterInLine){let t=e.ascent+e.descent+0;if(t<r-0&&("bottom"===s?e.topOffset+=(r-t)/2:"top"===s&&(e.topOffset-=(r-t)/2)),"alphabetic"===s){let t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+a[1]}}return a[1]+=r,e}}let p3=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...nX];class p5 extends n0{get font(){let t=this.getGraphicTheme();return this._font||(this._font=rh(this.attribute,t)),this._font}get clipedText(){var t;let e=this.attribute,i=this.getGraphicTheme();return Number.isFinite(this.getMaxWidth(i))?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!=(t=e.text)?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;let i=this.getGraphicTheme(),s=this.attribute;if(!Number.isFinite(this.getMaxWidth(i)))return!1;let{text:r}=this.attribute;if(this.tryUpdateAABBBounds(),null==(e=null==(t=this.cache)?void 0:t.layoutData)?void 0:e.lines){let t="";
2return this.cache.layoutData.lines.forEach(e=>{t+=e.str}),(Array.isArray(r)?r.join(""):r).toString()!==t}return"vertical"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map(t=>t.text).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=nB,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{text:t}=this.attribute;return(0,ev.A)(t)?!t.every(t=>null==t||""===t):null!=t&&""!==t}getGraphicTheme(){return rQ(this).text}doUpdateOBBBounds(){let t=this.getGraphicTheme();this._OBBBounds.clear();let e=this.attribute,{angle:i=t.angle}=e;if(!i){let t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new p5({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));let s=this.obbText.AABBBounds,{x:r,y:a}=e,n={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},l=iY(n,i,{x:r,y:a});return this._OBBBounds.copy(s),this._OBBBounds.translate(l.x-n.x,l.y-n.y),this._OBBBounds.angle=i,this._OBBBounds}
2updateAABBBounds(t,e,i){let{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);let{tb1:r}=ie.graphicService.updateTempAABBBounds(i),{scaleX:a=e.scaleX,scaleY:n=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;return l&&(nd(r,l/Math.abs(a+n),!0,o),i.union(r)),ie.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ie.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,iq(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);let e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){let t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){let e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:s=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e,i;let s=this.getGraphicTheme(),r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:n=s.textAlign,textBaseline:l=s.textBaseline,fontSize:o=s.fontSize,fontWeight:h=s.fontWeight,ellipsis:u=s.ellipsis,maxLineWidth:d,stroke:c=s.stroke,wrap:p=s.wrap,measureMode:g=s.measureMode,lineWidth:f=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:_=s.suffixPosition,ignoreBuf:y=s.ignoreBuf,keepCenterInLine:v=s.keepCenterInLine}=r,b=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(r,s,b);if("normal"===m||p)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null==(e=this.cache)?void 0:e.layoutData)){let t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(f/2),this._AABBBounds}let S=new p2(a,{fontSize:o,fontWeight:h,fontFamily:a,lineHeight:x},ie.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null==(i=this.stage)?void 0:i.textMeasureId))).GetLayoutByLines(t,n,l,x,!0===u?s.ellipsis:u||void 0,!1,{lineWidth:d,suffixPosition:_,measureMode:g,keepCenterInLine:v}),{bbox:A}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(A.xOffset,A.yOffset,A.xOffset+A.width,A.yOffset+A.height),c&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,s,r;let a=this.getGraphicTheme(),{fontFamily:n=a.fontFamily,textAlign:l=a.textAlign,textBaseline:o=a.textBaseline,fontSize:h=a.fontSize,ellipsis:u=a.ellipsis,maxLineWidth:d,stroke:c=a.stroke,lineWidth:p=a.lineWidth,wordBreak:g=a.wordBreak,fontWeight:f=a.fontWeight,ignoreBuf:m=a.ignoreBuf,measureMode:_=a.measureMode,suffixPosition:y=a.suffixPosition,heightLimit:v=0,lineClamp:b,keepCenterInLine:x=a.keepCenterInLine}=this.attribute,S=m?0:this.guessLineHeightBuf(h),A=this.getLineHeight(this.attribute,a,S);if(!this.shouldUpdateShape()&&(null==(e=this.cache)?void 0:e.layoutData)){let t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}let k=ie.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null==(i=this.stage)?void 0:i.textMeasureId)),M={fontSize:h,fontWeight:f,fontFamily:n,lineHeight:A},w=new p2(n,M,k),T=(0,ev.A)(t)?t.map(t=>t.toString()):[t.toString()],C=[],B=[0,0],E=1/0;if(v>0&&(E=Math.max(Math.floor(v/A),1)),b&&(E=Math.min(E,b)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<T.length;t++){let e=T[t],i=!0;if(t===E-1){let i=k.clipTextWithSuffix(e,M,d,u,!1,y,t!==T.length-1),s=k.measureTextPixelADscentAndWidth(i.str,M,_);C.push({str:i.str,width:i.width,ascent:s.ascent,descent:s.descent,keepCenterInLine:x});break}let a=k.clipText(e,M,d,"break-all"!==g,"keep-all"===g);if(""!==e&&""===a.str||a.wordBreaked){if(u){let t=k.clipTextWithSuffix(e,M,d,u,!1,y);a.str=null!=(s=t.str)?s:"",a.width=null!=(r=t.width)?r:0}else a.str="",a.width=0;i=!1}let n=k.measureTextPixelADscentAndWidth(a.str,M,_);C.push({str:a.str,width:a.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:x});let l=a.str.length;if(a.wordBreaked&&(""===e||""!==a.str)&&(i=!0,l=a.wordBreaked),a.str.length===e.length);else if(i){let i=e.substring(l);"keep-all"===g&&(i=i.replace(/^\s+/g,"")),T.splice(t+1,0,i)}}let t=0;
2C.forEach(e=>{t=Math.max(t,e.width)}),B[0]=t}else{let t,e,i=0;for(let s=0,r=T.length;s<r;s++){if(s===E-1){let t=k.clipTextWithSuffix(T[s],M,d,u,!1,y),e=k.measureTextPixelADscentAndWidth(t.str,M,_);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:x}),i=Math.max(i,t.width);break}e=T[s],i=Math.max(i,t=k.measureTextWidth(e,M));let r=k.measureTextPixelADscentAndWidth(e,M,_);C.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:x})}B[0]=i}B[1]=C.length*A;let P={xOffset:0,yOffset:0,width:B[0],height:B[1]};w.LayoutBBox(P,l,o,C);let O=w.layoutWithBBox(P,C,l,o,A);return this.cache.layoutData=O,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,s;let r,a=this.getGraphicTheme(),n=ie.graphicUtil.getTextMeasureInstance(this.textMeasureId||(null==(e=this.stage)?void 0:e.textMeasureId)),l=this.attribute,{maxLineWidth:o=a.maxLineWidth,ellipsis:h=a.ellipsis,fontFamily:u=a.fontFamily,fontSize:d=a.fontSize,fontWeight:c=a.fontWeight,stroke:p=a.stroke,lineWidth:g=a.lineWidth,verticalMode:f=a.verticalMode,suffixPosition:m=a.suffixPosition}=l,_=this.getLineHeight(l,a,0),{textAlign:y=a.textAlign,textBaseline:v=a.textBaseline}=l;if(!f){let t=y;y=null!=(i=p5.baselineMapAlign[v])?i:"left",v=null!=(s=p5.alignMapBaseline[t])?s:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach(t=>{r=im(t.reduce((t,e)=>t+e.width,0),r)});let t=lR(y,r),e=this.cache.verticalList.length*_,i=lI(v,e,d);return this._AABBBounds.set(i,t,i+e,t+r),p&&this._AABBBounds.expand(g/2),this._AABBBounds}let b=t.map(t=>(function(t){let e=[],i=0,s="";for(let r=0;r<t.length;r++)!function(t){if(ng.has(t))return!0;if(nf.has(t))return!1;let e=!1;return 256>t.codePointAt(0)&&(e=!0),e}(t[r])?(i&&(e.push({text:s,direction:hk.VERTICAL}),s="",i=0),e.push({text:t[r],direction:hk.HORIZONTAL})):i?s+=t[r]:(i=1,s=t[r]);return s&&e.push({text:s,direction:hk.VERTICAL}),e})(t.toString()));b.forEach((t,e)=>{if(Number.isFinite(o))if(h){let i=!0===h?a.ellipsis:h,s=n.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:c,fontFamily:u},o,i,!1,m);b[e]=s.verticalList,r=s.width}else{let i=n.clipTextVertical(t,{fontSize:d,fontWeight:c,fontFamily:u},o,!1);b[e]=i.verticalList,r=i.width}else r=0,t.forEach(t=>{let e=t.direction===hk.HORIZONTAL?d:n.measureTextWidth(t.text,{fontSize:d,fontWeight:c,fontFamily:u});r+=e,t.width=e})}),this.cache.verticalList=b,this.clearUpdateShapeTag(),this.cache.verticalList.forEach(t=>{r=im(t.reduce((t,e)=>t+e.width,0),r)});let x=lR(y,r),S=this.cache.verticalList.length*_,A=lI(v,S,d);return this._AABBBounds.set(A,x,A+S,x+r),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,i;let s=this.attribute;return null!=(i=null!=(e=s.maxLineWidth)?e:s.maxWidth)?i:t.maxWidth}getLineHeight(t,e,i){var s;return null!=(s=au(t.lineHeight,t.fontSize||e.fontSize))?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=p3){return super.needUpdateTags(t,e)}needUpdateTag(t,e=p3){return super.needUpdateTag(t,e)}_interpolate(t,e,i,s,r){"text"===t&&(r.text=s)}clone(){return new p5(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return p5.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return p5.baselineMapAlign}getAlignMapBaseline(){return p5.alignMapBaseline}}function p4(t){return new p5(t)}function p8(t){return u||(u=lF.CreateGraphic("text",{})),u.initAttributes(t),u.AABBBounds}p5.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},nQ),p5.baselineMapAlign={top:"left",bottom:"right",middle:"center"},p5.alignMapBaseline={left:"top",right:"bottom",center:"middle"};let p6=new class extends oh{constructor(){super(...arguments),this.time=hx.beforeFillStroke}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){var c,p,g,f,m,_,y,v,b,x;let S,{backgroundOpacity:A=o.backgroundOpacity,opacity:k=o.opacity,backgroundMode:M=o.backgroundMode,backgroundFit:w=o.backgroundFit,backgroundKeepAspectRatio:T=o.backgroundKeepAspectRatio,backgroundScale:C=o.backgroundScale,backgroundOffsetX:B=o.backgroundOffsetX,backgroundOffsetY:E=o.backgroundOffsetY,backgroundPosition:P=o.backgroundPosition,backgroundClip:O=o.backgroundClip,backgroundCornerRadius:R=o.backgroundCornerRadius}=t.attribute,I,{background:L}=t.attribute;if(!L)return;let D=()=>
2{"richtext"===t.type&&(e.restore(),e.save(),I&&e.setTransformFromMatrix(I,!0,1))};"richtext"===t.type&&(I=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());let F=r2(L)&&L.background?L:null,z=t.transMatrix.onlyTranslate();if(F){let e=t.AABBBounds,i=(null!=(c=F.x)?c:e.x1)+(null!=(p=F.dx)?p:0),s=(null!=(g=F.y)?g:e.y1)+(null!=(f=F.dy)?f:0),r=null!=(m=F.width)?m:e.width(),a=null!=(_=F.height)?_:e.height();if(S=l8.allocate(i,s,i+r,s+a),L=F.background,!z){let t=S.width(),e=S.height();S.set((null!=(y=F.x)?y:0)+(null!=(v=F.dx)?v:0),(null!=(b=F.y)?b:0)+(null!=(x=F.dy)?x:0),t,e)}}else S=t.AABBBounds,z||(S=p8(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){let i=t.resources.get(L);if(!i||"success"!==i.state||!i.data)return void D();e.highPerformanceSave(),z&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.globalAlpha=A*k,O&&(e.beginPath(),R?oE(e,S.x1,S.y1,S.width(),S.height(),R,!0):e.rect(S.x1,S.y1,S.width(),S.height()),e.clip()),this.doDrawImage(e,i.data,S,{backgroundMode:M,backgroundFit:w,backgroundKeepAspectRatio:T,backgroundScale:C,backgroundOffsetX:B,backgroundOffsetY:E,backgroundPosition:P}),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,o),e.globalAlpha=A*k,e.fillStyle=L,R?(oE(e,S.x1,S.y1,S.width(),S.height(),R,!0),e.fill()):e.fillRect(S.x1,S.y1,S.width(),S.height()),e.highPerformanceRestore();F&&l8.free(S),D()}};var p9=function(t,e){return function(i,s){e(i,s,t)}};let p7=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nB,this.builtinContributions=[p6],this.init(t)}drawShape(t,e,i,s,r,a,n,l){var o,h,u;let d=rQ(t,null==a?void 0:a.theme).text,{text:c,underline:p=d.underline,lineThrough:g=d.lineThrough,keepDirIn3d:f=d.keepDirIn3d,direction:m=d.direction,fontSize:_=d.fontSize,verticalMode:y=d.verticalMode,x:v=d.x,y:b=d.y}=t.attribute,x=null!=(o=au(t.attribute.lineHeight,_))?o:_,S=this.valid(t,d,n,l);if(!S)return;let{fVisible:A,sVisible:k,doFill:M,doStroke:w}=S,T=!f,C=this.z||0;if(e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,s,M,w,A,k,d,r,n,l),T&&this.transformUseContext2d(t,d,C,e),e.setTextStyleWithoutAlignBaseline(t.attribute,d,C),"horizontal"===m){let{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();let{xOffset:a,yOffset:o}=r.bbox;w&&(l?l(e,t.attribute,d):k&&(e.setStrokeStyle(t,t.attribute,v-i,b-s,d),r.lines.forEach(t=>{e.strokeText(t.str,(t.leftOffset||0)+a+i,(t.topOffset||0)+o+s,C)}))),M&&(n?n(e,t.attribute,d):A&&(e.setCommonStyle(t,t.attribute,v-i,b-s,d),r.lines.forEach(r=>{e.fillText(r.str,(r.leftOffset||0)+a+i,(r.topOffset||0)+o+s,C),this.drawUnderLine(p,g,t,(r.leftOffset||0)+a+i,(r.topOffset||0)+o+s,r.descent,(r.descent-r.ascent)/2,C,d,e,{width:r.width})})))}else{let{textAlign:r=d.textAlign,textBaseline:a=d.textBaseline}=t.attribute;if(!y){let e=r;r=null!=(h=t.getBaselineMapAlign()[a])?h:"left",a=null!=(u=t.getAlignMapBaseline()[e])?u:"top"}t.tryUpdateAABBBounds();let{verticalList:o}=t.cache;e.textAlign="left",e.textBaseline="top";let c=x*o.length,p=0;o.forEach(t=>{p=im(t.reduce((t,e)=>t+(e.width||0),0),p)});let g=0,f=0;"bottom"===a?f=-c:"middle"===a&&(f=-c/2),"center"===r?g-=p/2:"right"===r&&(g-=p),o.forEach((a,o)=>{let h=a.reduce((t,e)=>t+(e.width||0),0),u=p-h,m=g;"center"===r?m+=u/2:"right"===r&&(m+=u),a.forEach(r=>{let{text:a,width:h,direction:u}=r;((r,a,o,h)=>{let u=i+a,c=s+o;if(h){e.highPerformanceSave(),u+=_;let t=nV.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,c),e.transformFromMatrix(t,!0),nV.free(t)}w&&(l?l(e,t.attribute,d):k&&(e.setStrokeStyle(t,t.attribute,v-i,b-s,d),e.strokeText(r,u,c,C))),M&&(n?n(e,t.attribute,d):A&&(e.setCommonStyle(t,t.attribute,v-i,b-s,d),e.fillText(r,u,c,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())})(a,c-(o+1)*x+f,m,u),m+=h})})}T&&this.restoreTransformUseContext2d(t,d,C,e),this.afterRenderStep(t,e,i,s,M,w,A,k,d,r,n,l)}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).text,{keepDirIn3d:a=r.keepDirIn3d}=t.attribute;this._draw(t,r,!a,i,s)}drawUnderLine(t,e,i,s,r,a,n,l,o,h,u){if(e+t<=0)return;let{textAlign:d=o.textAlign,fill:c=o.fill,opacity:p=o.opacity,underlineOffset:g=o.underlineOffset,underlineDash:f=o.underlineDash,fillOpacity:m=o.fillOpacity}=i.attribute,_=!(0,eE.A)(u),y=_?u.width:i.clipedWidth,v=_?0:lR(d,y),b={lineWidth:0,stroke:c,opacity:p,strokeOpacity:m};if(t){b.lineWidth=t,h.setStrokeStyle(i,b,s,r,o),f&&h.setLineDash(f),h.beginPath();let e=r+a+g;h.moveTo(s+v,e,l),h.lineTo(s+v+y,e,l),h.stroke()}if(e){b.lineWidth=e,h.setStrokeStyle(i,b,s,r,o),h.beginPath();let t=r+n;h.moveTo(s+v,t,l),h.lineTo(s+v+y,t,l),h.stroke()}}};
2p7=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),p9(0,eU(eY)),p9(0,eG(on)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],p7);let gt=!1,ge=new eL(t=>{gt||(gt=!0,t(lp).to(p7).inSingletonScope(),t(ln).toService(lp),t(on).toService(o_),eX(t,on))}),gi=hK(),gs=Symbol.for("MathPickerContribution"),gr=Symbol.for("MathArcPicker"),ga=Symbol.for("MathAreaPicker"),gn=Symbol.for("MathCirclePicker"),gl=Symbol.for("MathImagePicker"),go=Symbol.for("MathLinePicker"),gh=Symbol.for("MathPathPicker"),gu=Symbol.for("MathRectPicker"),gd=Symbol.for("MathSymbolPicker"),gc=Symbol.for("MathTextPicker"),gp=Symbol.for("MathPolygonPicker"),gg=Symbol.for("MathGlyphPicker"),gf=Symbol.for("CanvasArcPicker");Symbol.for("CanvasArc3dPicker");let gm=Symbol.for("CanvasAreaPicker"),g_=Symbol.for("CanvasCirclePicker"),gy=Symbol.for("CanvasImagePicker");Symbol.for("CanvasGifImagePicker");let gv=Symbol.for("CanvasLinePicker");Symbol.for("CanvasLottiePicker");let gb=Symbol.for("CanvasPathPicker"),gx=Symbol.for("CanvasRectPicker");Symbol.for("CanvasRect3dPicker");let gS=Symbol.for("CanvasSymbolPicker"),gA=Symbol.for("CanvasTextPicker"),gk=Symbol.for("CanvasPolygonPicker");Symbol.for("CanvasPyramid3dPicker");let gM=Symbol.for("CanvasRichTextPicker"),gw=Symbol.for("CanvasGlyphPicker"),gT=Symbol.for("CanvasGroupPicker");Symbol.for("CanvasStarPicker");let gC=Symbol.for("CanvasPickerContribution");class gB extends oN{contains(t,e,i){let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=t.getGraphicTheme();s.highPerformanceSave();let{x:a,y:n,z:l,lastModelMatrix:o}=this.transform(t,r,s),h=e;if(s.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,n,i,null,(t,e,i)=>!!u||(u=t.isPointInPath(h.x,h.y))),this.canvasRenderer.z=0,s.modelMatrix!==o&&nN.free(s.modelMatrix),s.modelMatrix=o,s.highPerformanceRestore(),u}}let gE=class extends gB{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=nB}contains(t,e,i){let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=t.AABBBounds;if(!s.camera)return!!r.containsPoint(e);s.highPerformanceSave();let a=t.getGraphicTheme(),{keepDirIn3d:n=a.keepDirIn3d}=t.attribute,{x:l,y:o,z:h,lastModelMatrix:u}=this.transform(t,a,s,!n);this.canvasRenderer.z=h;let d=e;if(s.camera){d=e.clone();let 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}let c=!1;return this.canvasRenderer.drawShape(t,s,l,o,{},null,(e,i,s)=>{if(c)return!0;let{fontSize:r=a.fontSize,textBaseline:n=a.textBaseline,textAlign:u=a.textAlign}=t.attribute,p=t.AABBBounds,g=p.height(),f=p.width(),m=lI(n,g,r),_=lR(u,f);return e.rect(_+l,m+o,f,g,h),c=e.isPointInPath(d.x,d.y)},(t,e,i)=>c),this.canvasRenderer.z=0,s.modelMatrix!==u&&nN.free(s.modelMatrix),s.modelMatrix=u,s.highPerformanceRestore(),c}};gE=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(b=eU(lp),function(t,e){b(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gE);let gP=!1,gO=new eL((t,e,i,s)=>{gP||(gP=!0,t(gA).to(gE).inSingletonScope(),t(gC).toService(gA))}),gR=class{constructor(){this.type="text",this.numberType=nB}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};gR=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],gR);let gI=!1,gL=new eL((t,e,i,s)=>{gI||(gI=!0,t(gc).to(gR).inSingletonScope(),t(gs).toService(gc))});function gD(){gD.__loaded||(gD.__loaded=!0,lF.RegisterGraphicCreator("text",p4),e7.load(ge),e7.load(gi?gO:gL))}gD.__loaded=!1;let gF=new class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let c=t.getParsedPath();if(!c)return;let{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;let{size:_=o.size,opacity:y=o.opacity,x:v=o.x,y:b=o.y,scaleX:x=o.scaleX,scaleY:S=o.scaleY,keepStrokeScale:A=o.keepStrokeScale}=t.attribute,k=(r,a)=>{let n=!(!r||!r.stroke),{distance:l=o[a].distance}=r,h=A?l:s4(e,l,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,_,i,s,("outerBorder"===a?1:-1)*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),d)d(e,r,o[a]);else if(n){let n=o[a].opacity;
2o[a].opacity=y,e.setStrokeStyle(t,r,(v-i)/x,(b-s)/S,o[a]),o[a].opacity=n,e.stroke()}};f&&k(p,"outerBorder"),m&&k(g,"innerBorder")}},gz=new class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){let{clipRange:p=o.clipRange,x:g=o.x,y:f=o.y,z:m=o.z,size:_=o.size,scaleX:y=o.scaleX,scaleY:v=o.scaleY}=t.attribute,b=t.getParsedPath();b&&p<1&&p>0&&(e.beginPath(),b.drawWithClipRange&&b.drawWithClipRange(e,_,i,s,p,m,(r,a)=>{var n,h,u,c;if(t._parsedPath.svgCache){let e=Object.assign({},a);e.fill=null!=(n=a.fill)?n:t.attribute.fill,e.opacity=null!=(h=a.opacity)?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!=(u=a.stroke)?u:t.attribute.stroke,e.lineWidth=null!=(c=a.lineWidth)?c:t.attribute.lineWidth,a=e}a.stroke&&(d?d(e,t.attribute,o):l&&(e.setStrokeStyle(t,a,(g-i)/y,(f-s)/v,o),e.stroke()))}),a&&!b.isSvg&&(d?d(e,t.attribute,o):l&&(e.setStrokeStyle(t,t.attribute,(g-i)/y,(f-s)/v,o),e.stroke())))}};var gH=function(t,e){return function(i,s){e(i,s,t)}};let gj=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nC,this.builtinContributions=[gF,ou,oQ,gz],this.init(t)}drawShape(t,e,i,s,r,a,n,l,o){var h;o=null!=o?o:rQ(t,null==a?void 0:a.theme).symbol;let{size:u=o.size,x:d=o.x,y:c=o.y,scaleX:p=o.scaleX,scaleY:g=o.scaleY,fillStrokeOrder:f=o.fillStrokeOrder,clipRange:m=o.clipRange}=t.attribute,_=this.valid(t,o,n,l);if(!_)return;let{fVisible:y,sVisible:v,doFill:b,doStroke:x}=_,S=t.getParsedPath();if(!S)return;let{keepDirIn3d:A=o.keepDirIn3d}=t.attribute,k=null!=(h=this.z)?h:0;e.beginPath();let M=i,w=s,T=k,C=e.camera;if(A&&C&&e.project){let t=e.project(i,s,k);e.camera=null,(0,ev.A)(u)&&(u[0],u[1]),M=t.x,w=t.y,T=void 0}!1===S.draw(e,u,M,w,T,(r,a)=>{var h,u,_,y;if(t._parsedPath.svgCache){let e=Object.assign({},a);e.fill=null!=(h=a.fill)?h:t.attribute.fill,e.opacity=null!=(u=a.opacity)?u:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!=(_=a.stroke)?_:t.attribute.stroke,e.lineWidth=null!=(y=a.lineWidth)?y:t.attribute.lineWidth,a=e}let b=()=>{a.fill&&(n?n(e,t.attribute,o):(e.setCommonStyle(t,a,d-i,c-s,o),e.fill()))},x=()=>{a.stroke&&(l?l(e,t.attribute,o):v&&m>=1&&(e.setStrokeStyle(t,a,(d-i)/p,(c-s)/g,o),e.stroke()))};f?(x(),b()):(b(),x())})&&e.closePath(),e.camera=C,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,b,x,y,v,o,r,n,l),f?(this._runStroke(t,e,i,s,o,x,v,d,c,S,m,p,g,l),this._runFill(t,e,i,s,o,b,y,d,c,S,n)):(this._runFill(t,e,i,s,o,b,y,d,c,S,n),this._runStroke(t,e,i,s,o,x,v,d,c,S,m,p,g,l)),this.afterRenderStep(t,e,i,s,b,x,y,v,o,r,n,l)}_runFill(t,e,i,s,r,a,n,l,o,h,u){a&&!h.isSvg&&(u?u(e,t.attribute,r):n&&(e.setCommonStyle(t,t.attribute,l-i,o-s,r),e.fill()))}_runStroke(t,e,i,s,r,a,n,l,o,h,u,d,c,p){a&&!h.isSvg&&(p?p(e,t.attribute,r):n&&u>=1&&(e.setStrokeStyle(t,t.attribute,(l-i)/d,(o-s)/c,r),e.stroke()))}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).symbol;this._draw(t,r,!1,i,s)}};gj=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),gH(0,eU(eY)),gH(0,eG(oa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gj);let gV=!1,gN=new eL(t=>{gV||(gV=!0,t(gj).toSelf().inSingletonScope(),t(lc).to(gj).inSingletonScope(),t(ln).toService(lc),t(oa).toService(o_),eX(t,oa))}),gW=class extends gB{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=nC}contains(t,e,i){let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();let a=t.getGraphicTheme(),{x:n,y:l,z:o,lastModelMatrix:h}=this.transform(t,a,s),u=e;if(s.camera){u=e.clone();let i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=o;let d=!1;return this.canvasRenderer.drawShape(t,s,n,l,{},null,(t,e,i)=>
2!!d||(d=t.isPointInPath(u.x,u.y)),(t,e,i)=>{if(d)return!0;let r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=e.keepStrokeScale||i.keepStrokeScale?r+a:s4(s,r+a,s.dpr),d=t.isPointInStroke(u.x,u.y)}),this.canvasRenderer.z=0,s.modelMatrix!==h&&nN.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),d}};gW=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(x=eU(lc),function(t,e){x(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gW);let gU=!1,gG=new eL((t,e,i,s)=>{gU||(gU=!0,t(gS).to(gW).inSingletonScope(),t(gC).toService(gS))});class gY{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode||!this.canvasRenderer)return!0;let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=t.getGraphicTheme();s.highPerformanceSave();let{x:a=r.x,y:n=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(r);a+=e.x,n+=e.y,s.setTransformForCurrent()}else a=0,n=0,s.transformFromMatrix(t.transMatrix,!0);let l=!1,o=!1;return this.canvasRenderer.drawShape(t,s,a,n,{},null,(t,i,s,r)=>!(!l&&!o)||(l=t.isPointInPath(e.x,e.y),o=r||o,l),(t,i,r,a)=>{if(l||o)return!0;let n=i.lineWidth||r.lineWidth,h=i.pickStrokeBuffer||r.pickStrokeBuffer;return s.lineWidth=i.keepStrokeScale||r.keepStrokeScale?n+h:s4(s,n+h,s.dpr),l=t.isPointInStroke(e.x,e.y),o=a||o,l}),s.highPerformanceRestore(),l}}let g$=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=nC}};g$=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(S=eU(lc),function(t,e){S(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],g$);let gX=!1,gK=new eL((t,e,i,s)=>{gX||(gX=!0,t(gd).to(g$).inSingletonScope(),t(gs).toService(gd))});function gq(){gq.__loaded||(gq.__loaded=!0,lF.RegisterGraphicCreator("symbol",oZ),e7.load(gN),e7.load(gi?gG:gK))}gq.__loaded=!1;let gZ=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=(0,eE.A)(t.width)?t.x1-t.x:t.width,i=(0,eE.A)(t.height)?t.y1-t.y:t.height,s=0,r=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:r,width:e,height:i}},gJ=(t,e,i)=>{let{outerBorder:s,shadowBlur:r=e.shadowBlur}=t;if(s){let t=e.outerBorder,{distance:a=t.distance,lineWidth:n=t.lineWidth}=s;i.expand(a+(r+n)/2)}return i},gQ=["width","x1","y1","height","cornerRadius",...nX];class g0 extends n0{constructor(t){super(t),this.type="rect",this.numberType=nw}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return rQ(this).rect}
2updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t,{x1:r,y1:a,x:n,y:l}=t;e=null!=e?e:r-n,s=null!=s?s:a-l,(isFinite(e)||isFinite(s)||isFinite(n)||isFinite(l))&&i.set(0,0,e||0,s||0)}let{tb1:s,tb2:r}=ie.graphicService.updateTempAABBBounds(i);return gJ(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ie.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,gQ)}needUpdateTag(t){return super.needUpdateTag(t,gQ)}toCustomPath(){let t=super.toCustomPath();if(t)return t;let{x:e,y:i,width:s,height:r}=gZ(this.attribute);return(t=new sO).moveTo(e,i),t.rect(e,i,s,r),t}clone(){return new g0(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return g0.NOWORK_ANIMATE_ATTR}}function g1(t){return new g0(t)}g0.NOWORK_ANIMATE_ATTR=nQ;var g2=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class g3{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{cornerRadius:m=o.cornerRadius,cornerType:_=o.cornerType,opacity:y=o.opacity,x:v=o.x,y:b=o.y,scaleX:x=o.scaleX,scaleY:S=o.scaleY,x1:A,y1:k,keepStrokeScale:M=o.keepStrokeScale}=t.attribute,{width:w,height:T}=t.attribute;w=(null!=w?w:A-i)||0,T=(null!=T?T:k-s)||0;let C=(r,a)=>{let n=!(!r||!r.stroke),l="outerBorder"===a?-1:1,{distance:h=o[a].distance}=r,u=M?h:s4(e,h,e.dpr),c=i+l*u,p=s+l*u,g=2*u;if(0===m||(0,ev.A)(m)&&m.every(t=>0===t)?(e.beginPath(),e.rect(c,p,w-l*g,T-l*g)):(e.beginPath(),oE(e,c,p,w-l*g,T-l*g,m,"bevel"!==_)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),d)d(e,r,o[a]);else if(n){let n=o[a].opacity;
2o[a].opacity=y,e.setStrokeStyle(t,r,(v-i)/x,(b-s)/S,o[a]),o[a].opacity=n,e.stroke()}};g&&C(c,"outerBorder"),f&&C(p,"innerBorder")}}let g5=class{constructor(){this.time=hx.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d,c){let{stroke:p=o.stroke}=t.attribute;Array.isArray(p)&&p.some(t=>!1===t)&&(c.doStroke=!1)}};g5=g2([ej()],g5);let g4=class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let{x1:c,y1:p,x:g=o.x,y:f=o.y,stroke:m=o.stroke,cornerRadius:_=o.cornerRadius,cornerType:y=o.cornerType}=t.attribute,{width:v,height:b}=t.attribute;if(v=(null!=v?v:c-g)||0,b=(null!=b?b:p-f)||0,Array.isArray(m)&&m.some(t=>!1===t)){if(e.setStrokeStyle(t,t.attribute,i,s,o),!(0===_||(0,ev.A)(_)&&_.every(t=>0===t))){let r,a=0;return oE(e,i,s,v,b,_,"bevel"!==y,[,,,,].fill(0).map((n,l)=>(n,h,u,d)=>{m[l]&&(a===l-1&&m[l]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[l]}),i,s,o),e.beginPath(),e.moveTo(n,h),r=m[l]),a=l,e.lineTo(u,d),e.stroke(),3===l&&e.beginPath())})),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),m[0]?e.lineTo(i+v,s):e.moveTo(i+v,s),m[1]?e.lineTo(i+v,s+b):e.moveTo(i+v,s+b),m[2]?e.lineTo(i,s+b):e.moveTo(i,s+b),m[3]){let t=m[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};g4=g2([ej()],g4);let g8=new g3;var g6=function(t,e){return function(i,s){e(i,s,t)}};let g9=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=nw,this.builtinContributions=[g8,ou,oQ],this.init(t)}drawShape(t,e,i,s,r,a,n,l,o){o=null!=o?o:rQ(t,null==a?void 0:a.theme).rect;let{fill:h=o.fill,background:u,stroke:d=o.stroke,cornerRadius:c=o.cornerRadius,cornerType:p=o.cornerType,opacity:g=o.opacity,fillOpacity:f=o.fillOpacity,lineWidth:m=o.lineWidth,strokeOpacity:_=o.strokeOpacity,visible:y=o.visible,x1:v,y1:b,x:x=o.x,y:S=o.y,fillStrokeOrder:A=o.fillStrokeOrder,drawStrokeWhenZeroWH:k=o.drawStrokeWhenZeroWH}=t.attribute,{width:M,height:w}=t.attribute,T=oR(g,f,M=(null!=M?M:v-x)||0,w=(null!=w?w:b-S)||0,h),C=oI(g,_,M,w,k),B=!(!h&&!u),E=oP(d,m);if(!t.valid||!y||!B&&!E||!(T||C||n||l||u))return;0===c||(0,ev.A)(c)&&c.every(t=>0===t)?(e.beginPath(),e.rect(i,s,M,w)):(e.beginPath(),oE(e,i,s,M,w,c,"bevel"!==p));let P={doFill:B,doStroke:E};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,B,E,T,C,o,r,n,l,P),A?(this._runStroke(t,e,i,s,o,P,C,x,S,l),this._runFill(t,e,i,s,o,P,T,x,S,n)):(this._runFill(t,e,i,s,o,P,T,x,S,n),this._runStroke(t,e,i,s,o,P,C,x,S,l)),this.afterRenderStep(t,e,i,s,B,E,T,C,o,r,n,l)}_runFill(t,e,i,s,r,a,n,l,o,h){a.doFill&&(h?h(e,t.attribute,r):n&&(e.setCommonStyle(t,t.attribute,l-i,o-s,r),e.fill()))}_runStroke(t,e,i,s,r,a,n,l,o,h){a.doStroke&&(h?h(e,t.attribute,r):n&&(e.setStrokeStyle(t,t.attribute,l-i,o-s,r),e.stroke()))}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).rect;this._draw(t,r,!1,i,s,r)}};g9=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),g6(0,eU(eY)),g6(0,eG(or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],g9);let g7=!1,ft=new eL(t=>{g7||(g7=!0,t(g9).toSelf().inSingletonScope(),t(ld).to(g9).inSingletonScope(),t(ln).toService(ld),t(g4).toSelf(),t(g5).toSelf(),t(or).toService(g4),t(or).toService(g5),t(or).toService(o_),eX(t,or))}),fe=new iJ;class fi{constructor(){this.type="rect",this.numberType=nw}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=t.getGraphicTheme(),{cornerRadius:a=r.cornerRadius}=t.attribute,{x:n=r.x,y:l=r.y}=t.attribute;s.highPerformanceSave();let o=!0;if(t.transMatrix.onlyTranslate()){let e=t.getOffsetXY(r);n+=e.x,l+=e.y,s.setTransformForCurrent()}else n=0,l=0,o=!1,s.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!o||t.shadowRoot||ed(a,!0)&&0!==a||(0,ev.A)(a)&&a.some(t=>0!==t))h=!1,this.canvasRenderer.drawShape(t,s,n,l,{},null,(t,i,s)=>!!h||(h=t.isPointInPath(e.x,e.y)),(t,i,r)=>{if(h)return!0;let a=i.lineWidth||r.lineWidth,n=i.pickStrokeBuffer||r.pickStrokeBuffer;return s.lineWidth=i.keepStrokeScale||r.keepStrokeScale?a+n:s4(s,a+n,s.dpr),h=t.isPointInStroke(e.x,e.y)});else{let{fill:i=r.fill,stroke:s=r.stroke,lineWidth:a=r.lineWidth}=t.attribute;if(i)h=!0;else if(s){let i=t.AABBBounds;fe.setValue(i.x1,i.y1,i.x2,i.y2),fe.expand(-a/2),h=!fe.containsPoint(e)}}return s.highPerformanceRestore(),h}}let fs=class extends fi{constructor(t){super(),this.canvasRenderer=t}};
2fs=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(A=eU(ld),function(t,e){A(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fs);let fr=!1,fa=new eL((t,e,i,s)=>{fr||(fr=!0,t(gx).to(fs).inSingletonScope(),t(gC).toService(gx))}),fn=class extends fi{constructor(t){super(),this.canvasRenderer=t}};fn=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(k=eU(ld),function(t,e){k(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fn);let fl=!1,fo=new eL((t,e,i,s)=>{fl||(fl=!0,t(gu).to(fn).inSingletonScope(),t(gs).toService(gu))});function fh(){fh.__loaded||(fh.__loaded=!0,lF.RegisterGraphicCreator("rect",g1),e7.load(ft),e7.load(gi?fa:fo))}function fu(t){t.crosshair=oS(t.crosshair||{}).map(e=>uy({["horizontal"===t.direction?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},e))}function fd(t,e,i){var s;let{width:r,height:a}=t;if((0,eA.A)(r)&&(0,eA.A)(a))return{width:r,height:a};let n=i.width,l=i.height,o=e.container,h=e.canvas;if(o){let{width:t,height:e}=lP(o,i.width,i.height);n=t,l=e}else if(h&&hJ(e.mode)){let{width:t,height:e}=lP((0,eS.A)(h)?hL.getElementById(h):h,i.width,i.height);n=t,l=e}else if(h0(e.mode)&&(null==(s=e.modeParams)?void 0:s.domref)){let t=e.modeParams.domref;n=t.width,l=t.height}return{width:n=null!=r?r:n,height:l=null!=a?a:l}}function fc(t,...e){let 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 fp(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}}fh.__loaded=!1,(M=j||(j={}))[M.SeriesGroup=0]="SeriesGroup",M[M.Axis_Grid=50]="Axis_Grid",M[M.CrossHair_Grid=100]="CrossHair_Grid",M[M.Region=450]="Region",M[M.Mark=300]="Mark",M[M.Node=400]="Node",M[M.Axis=100]="Axis",M[M.MarkLine=500]="MarkLine",M[M.MarkArea=100]="MarkArea",M[M.MarkPoint=500]="MarkPoint",M[M.DataZoom=500]="DataZoom",M[M.ScrollBar=500]="ScrollBar",M[M.Player=500]="Player",M[M.Legend=500]="Legend",M[M.CrossHair=500]="CrossHair",M[M.Indicator=500]="Indicator",M[M.Title=500]="Title",M[M.Label=500]="Label",M[M.Brush=500]="Brush",M[M.CustomMark=500]="CustomMark",M[M.Interaction=700]="Interaction",(w=V||(V={}))[w.Indicator=10]="Indicator",w[w.Region=20]="Region",w[w.Axis=30]="Axis",w[w.DataZoom=40]="DataZoom",w[w.Player=40]="Player",w[w.ScrollBar=40]="ScrollBar",w[w.Legend=50]="Legend",w[w.Title=70]="Title",w[w.CustomMark=70]="CustomMark",(T=N||(N={}))[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";class fg{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){(0,eE.A)(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,eB({},fg.defaultMarkInfo,e)))}removeMark(t){let 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()}
2forEach(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){let e=oS(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]))}}fg.defaultMarkInfo={};class ff{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getStage(){var t;return null==(t=this.getCompiler())?void 0:t.getStage()}release(){this._option=null,this.getCompiler=null}}class fm{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);let s=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(s.spec,e,i),s}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){let i=this._theme;if(this._shouldMergeThemeToSpec()){let s=this._getDefaultSpecFromChart(e),r=t=>uy({},i,s,t);return(0,ev.A)(t)?{spec:t.map(t=>r(t)),theme:i}:{spec:r(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}let f_=(t,e,i)=>{if((0,eE.A)(e))return t;let s=e[0];return(0,eE.A)(s)?t:1===e.length?(t[s]=i,t):((0,eE.A)(t[s])&&("number"==typeof e[1]?t[s]=[]:t[s]={}),f_(t[s],e.slice(1),i))};var fy=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class fv extends ff{getSpec(){return this._spec||{}}getSpecPath(){var t;return null==(t=this._option)?void 0:t.specPath}getSpecInfoPath(){var t,e,i;return null!=(e=null==(t=this._option)?void 0:t.specInfoPath)?e:null==(i=this._option)?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.getMarks())?e:[]}getMarkNameMap(){var t;return null==(t=this._marks)?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.theme}constructor(t,e){var i;super(e),this.transformerConstructor=fm,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this.specKey="",this._marks=new fg,this._lastLayoutRect=null,this.id=hH(),this.userId=t.id,this._spec=t,this.effect={},this.event=new uK(e.eventDispatcher,e.mode),null==(i=e.map)||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.visible)}onLayoutStart(t,e){var i;null==(i=this._layout)||i.onLayoutStart(t,e)}onLayoutEnd(){var t;null==(t=this._layout)||t.onLayoutEnd(),this.getMarks().forEach(t=>t.commit(!1,!0))}onEvaluateEnd(t){}onBeforeRender(){}onDataUpdate(){}beforeRelease(){}clear(){this.getMarks().forEach(t=>{var e;return null==(e=t.clear)?void 0:e.call(t)})}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach(t=>t.release()),null==(t=this._data)||t.release(),this._data=null,this._marks.clear(),super.release()}updateSpec(t){var e;let i=this._compareSpec(t,this._spec);return(i.reRender||i.reMake||i.reCompile)&&(null==(e=this._layout)||e.setWillLayoutTag()),this._spec=t,i}_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)||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,s){(0,eA.A)(t)&&(0,eA.A)(e)&&t.setStyle(this._convertMarkStyle(e),i,s)}initMarkStyleWithSpec(t,e){if(!(0,eA.A)(t)||!(0,eA.A)(e))return;let{style:i,state:s}=e,r=Object.assign({},e);i&&(r.style=this._convertMarkStyle(i)),s&&(r.state={}
2,Object.keys(s).forEach(t=>{r.state[t]=this._convertMarkStyle(s[t])})),t.initStyleWithSpec(r)}stateKeyToSignalName(t,e){let i=`${px.H}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;null==(t=this._data)||t.compile()}compileMarks(t){this.getMarks().forEach(e=>{e.compile({group:t})})}_createMark(t,e={},i){let{type:s,name:r}=t,{parent:a}=e,n=fy(e,["parent"]),l=uP.createMark(s,r,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},n));return a?a.addMark(l):this.getCompiler().addRootMark(l),l&&(l.created(),i&&l.setMarkConfig(i)),l}_getDataIdKey(){}getColorScheme(){var t,e;return null==(e=(t=this._option).getTheme)?void 0:e.call(t,"colorScheme")}getSpecInfo(){var t,e,i,s,r=null!=(i=null==(e=(t=this._option).getSpecInfo)?void 0:e.call(t))?i:{},a=this.getSpecInfoPath();return(0,eE.A)(a)?void 0:uQ(r,a,s)}getSpecIndex(){let t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;let e=Number(t[t.length-1]);return isNaN(e)?0:e}updateAnimateStateCallback(t){this._aniamtionStateCallback=t}getAnimationStateCallback(){return this._aniamtionStateCallback}}class fb{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}get lastComputeRect(){return this._lastComputeRect}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}get willLayoutTag(){return this._willLayoutTag}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=V.Region,this._willLayoutTag=!0,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.call(t)}_setLayoutAttributeFromSpec(t,e){var i,s,r,a;if(this._spec&&!1!==this._spec.visible){let n=hG(hY(t.padding),e,e);this._option.transformLayoutPadding&&(n=this._option.transformLayoutPadding(n)),this.layoutPaddingLeft=n.left,this.layoutPaddingRight=n.right,this.layoutPaddingTop=n.top,this.layoutPaddingBottom=n.bottom,this._minHeight=(0,eE.A)(t.minHeight)?null!=(i=this._minHeight)?i:null:hU(t.minHeight,e.height,e),this._maxHeight=(0,eE.A)(t.maxHeight)?null!=(s=this._maxHeight)?s:null:hU(t.maxHeight,e.height,e),this._minWidth=(0,eE.A)(t.minWidth)?null!=(r=this._minWidth)?r:null:hU(t.minWidth,e.width,e),this._maxWidth=(0,eE.A)(t.maxWidth)?null!=(a=this._maxWidth)?a:null:hU(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:hU(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:hU(t.height,e.height,e)},{height:9}),(0,eE.A)(t.offsetX)||(this.layoutOffsetX=hU(t.offsetX,e.width,e)),(0,eE.A)(t.offsetY)||(this.layoutOffsetY=hU(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,s,r,a;this._spec=t,this.layoutType=null!=(i=t.layoutType)?i:this.layoutType,this.layoutLevel=null!=(s=t.layoutLevel)?s:this.layoutLevel,this.layoutOrient=null!=(r=t.orient)?r:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!=(a=t.clip)?a:this.layoutClip}onLayoutStart(t,e){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(){}_getAbsoluteSpecValue(t){let e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach(i=>
2{(0,eE.A)(this._spec[i])||(e[i]=hU(this._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))}),e}absoluteLayoutInRect(t){let{top:e,bottom:i,left:s,right:r}=this._getAbsoluteSpecValue(t),a={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};(0,eE.A)(s)||(a.width-=s),(0,eE.A)(r)||(a.width-=r),(0,eE.A)(e)||(a.height-=e),(0,eE.A)(i)||(a.height-=i),this.setLayoutRect(a);let{width:n,height:l}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:n,height:l});let o={x:t.x,y:t.y};!0===this._spec.center?(o.x=t.x+.5*t.width-.5*n,o.y=t.y+.5*t.height-.5*l):((0,eE.A)(s)?(0,eE.A)(r)||(o.x=t.x+t.width-this.layoutPaddingRight-r-n):o.x=t.x+s+this.layoutPaddingLeft,(0,eE.A)(e)?(0,eE.A)(i)||(o.y=t.y+t.height-this.layoutPaddingBottom-i-l):o.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(o)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),eP(t.x)&&(this._layoutStartPoint.x=t.x),eP(t.y)&&(this._layoutStartPoint.y=t.y),null==(i=(e=this._model).afterSetLayoutStartPoint)||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var s,r,a,n;eP(t)&&(null!=(s=null==i?void 0:i.width)?s:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=null!=(r=null==i?void 0:i.width)?r:0),eP(e)&&(null!=(a=null==i?void 0:i.height)?a:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=null!=(n=null==i?void 0:i.height)?n: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}){let 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){let e=Object.assign({},t);return this._layoutRectLevelMap.width<9?((0,eE.A)(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),(0,eE.A)(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?((0,eE.A)(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),(0,eE.A)(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;let 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(e?{width:Math.ceil(Math.min(e.x2-e.x1,t.width)),height:Math.ceil(Math.min(e.y2-e.y1,t.height))}:{width:0,height:0});return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}setWillLayoutTag(){this._willLayoutTag=!0}clearWillLayoutTag(){this._willLayoutTag=!1}}class fx extends fv{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,this._transformLayoutPadding=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 fb(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition,transformLayoutPadding:this._transformLayoutPadding}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e){this._isLayout=!0,super.onLayoutStart(t,e)}onLayoutEnd(){super.onLayoutEnd(),this.updateLayoutAttribute();let t=this.getLayoutRect();!this._forceLayoutTag&&(0,ex.n)(this._lastLayoutRect,t)||(this._lastLayoutRect=Object.assign({},t)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t,e;this._isLayout||(null==(t=this._layout)||t.setWillLayoutTag(),this._forceLayoutTag=!0,null==(e=this._option.globalInstance.getChart())||e.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=eB(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=eB(this._layoutRect,t)}getLastComputeOutBounds(){var t;return null==(t=this._layout)?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i,s,r;super.setAttrFromSpec(),this.layoutClip=null!=(t=this._spec.clip)?t:this.layoutClip,this.layoutZIndex=null!=(e=this._spec.zIndex)?e:this.layoutZIndex,this.layoutType=null!=(i=this._spec.layoutType)?i:this.layoutType,this._orient=null!=(s=this._spec.orient)?s:this._orient,this.layoutLevel=null!=(r=this._spec.layoutLevel)?r:this.layoutLevel}}class fS extends fm{_initTheme(t,e){return{spec:t,theme:this._theme}}}class fA extends fx{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=fS,this.modelType="region",this.specKey="region",this.type=fA.type,this._series=[],this.layoutType="region",this.layoutZIndex=j.Region,this.seriesDataFilterOver=()=>
2{this.event.emit(dj.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)?i:"cartesian"}_getClipDefaultValue(){var t,e,i,s;let r=this._option.getChart().getSpec(),a=null==(e=null==(t=r.dataZoom)?void 0:t.some)?void 0:e.call(t,t=>{var e;return"axis"===(null!=(e=t.filterMode)?e:"filter")}),n=null==(s=null==(i=r.scrollBar)?void 0:i.some)?void 0:s.call(i,t=>{var e;return"axis"===(null!=(e=t.filterMode)?e:"axis")});return!(!a&&!n)||this._layout.layoutClip}created(){var t,e;this.initLayout(),super.created();let i=null!=(t=this._spec.clip)?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._spec.roam&&this._groupMark.setMarkConfig({interactive:!0}),this._interactionMark=this._createGroupMark("regionInteractionGroup",(null!=(e=this.userId)?e:this.type)+"_interaction",j.Interaction),pJ(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"},{parent:this._groupMark}),i&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"},{parent:this._groupMark})),[this._backgroundMark,this._foregroundMark].forEach(t=>{t&&(t.created(),this.setMarkStyle(t,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",N.Built_In),this._groupMark.addMark(t))}),this._backgroundMark&&this._backgroundMark.setMarkConfig({zIndex:j.SeriesGroup-1}),this._foregroundMark&&this._foregroundMark.setMarkConfig({zIndex:j.Mark+1}))}_createGroupMark(t,e,i){var s,r;let a=this._createMark({type:"group",name:t});a.setUserId(e),a.setMarkConfig({zIndex:i});let n=null!=(s=this._spec.clip)?s:this._getClipDefaultValue();return this.setMarkStyle(a,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:n},"normal",N.Built_In),this.setMarkStyle(a,{cornerRadius:null==(r=this._spec.style)?void 0:r.cornerRadius},"normal",N.User_Mark),this._marks.addMark(a),a}init(t){super.init(t),this.initMark(),this.initSeriesDataflow()}
2initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:+(null!=(t=this._spec.style)&&!!t.fill)},this._spec.style),"normal",N.User_Mark),(null!=(e=this._spec.clip)?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",N.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0,pickable:!1}),"normal",N.User_Mark)}_compareSpec(t,e){let i=super._compareSpec(t,e);return(0,ex.n)(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;let 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||oS(t.userId).includes(e.userId))&&(!(0,eA.A)(t.specIndex)||oS(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.call(e))?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})}initSeriesDataflow(){let t=this._series.map(t=>{var e;return null!=(e=t.getViewDataFilter())?e:t.getViewData()}).filter(t=>!!t);this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}compileMarks(t){this.getMarks().forEach(e=>{e.compile({group:t,context:{model:this}})})}compile(){this.compileMarks()}onLayoutEnd(){this._series.forEach(t=>t.onLayoutEnd()),super.onLayoutEnd()}}function fk(t){let e=[],i=[],s=[];return t.forEach(t=>{(0,eE.A)(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 fM(t,e,i){e?t.forEach(t=>{let e=oA(t),s=(i-(e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y))/2;t.forEach(t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+s})})}):t.forEach(t=>{let e=oA(t),s=(i-(e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x))/2;t.forEach(t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+s,y:t.getLayoutStartPoint().y})})})}function fw(t,e,i,s){let r;t.forEach((t,a)=>{t.length>1&&(r=i[a],t.forEach(t=>{if(!t.alignSelf||"start"===t.alignSelf)return;let i=t.getLayoutStartPoint(),a="middle"===t.alignSelf?.5:1,n=e?r-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):r-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+s*n*a,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+s*n*a})}))})}function fT(t,e,i,s,r,a){if(t.length){let n=0,l="right"===r,o=l?-1:1,h=l?e.rightCurrent:e.leftCurrent,u=e.topCurrent,d=[],c=[],p=[];t.forEach(t=>{let{rect:s}=fP(t,e,a),r=s.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=s.width+t.layoutPaddingLeft+t.layoutPaddingRight,f=l?-s.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:h+t.layoutOffsetX+f,y:u+t.layoutOffsetY+t.layoutPaddingTop}),(u+=r)>i&&c.length?(p.push(n),h+=o*n,n=g,u=e.topCurrent+r,t.setLayoutStartPosition({x:h+t.layoutOffsetX+f,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),d.push(c),c=[t]):(n=Math.max(n,g),c.push(t))}),p.push(n),d.push(c),fw(d,!0,p,o),s&&fM(d,!0,i),l?e.rightCurrent=h+o*n:e.leftCurrent=h+o*n}}function fC(t,e,i,s,r){if(t.length){let i=0,a="right"===s,n=a?-1:1,l=a?e.rightCurrent:e.leftCurrent,o=e.bottomCurrent,h=[],u=[],d=[];t.forEach(t=>{let{rect:s}=fP(t,e,r),c=s.height+t.layoutPaddingTop+t.layoutPaddingBottom,p=s.width+t.layoutPaddingLeft+t.layoutPaddingRight,g=a?-s.width-t.layoutPaddingRight:t.layoutPaddingLeft;o<c&&u.length?(d.push(i),l+=n*i,i=p,o=e.bottomCurrent,t.setLayoutStartPosition({x:l+t.layoutOffsetX+g,y:o+t.layoutOffsetY-s.height-t.layoutPaddingBottom}),h.push(u),u=[t]):(t.setLayoutStartPosition({x:l+t.layoutOffsetX+g,y:o+t.layoutOffsetY-s.height-t.layoutPaddingBottom}),i=Math.max(i,p),o-=c,u.push(t))}),d.push(i),h.push(u),fw(h,!0,d,n),a?e.rightCurrent=l+n*i:e.leftCurrent=l+n*i}}function fB(t,e,i,s,r,a){if(t.length){let n="top"===r,l=n?1:-1,o=0,h=e.leftCurrent,u=n?e.topCurrent:e.bottomCurrent,d=[],c=[],p=[];t.forEach(t=>{let{rect:s}=fP(t,e,a),r=s.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=s.width+t.layoutPaddingLeft+t.layoutPaddingRight,f=n?t.layoutPaddingTop:-s.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:h+t.layoutOffsetX+t.layoutPaddingLeft,y:u+t.layoutOffsetY+f}),(h+=g)>i&&c.length?(p.push(o),h=e.leftCurrent+g,u+=l*o,o=r,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:u+t.layoutOffsetY+f}),d.push(c),c=[t]):(o=Math.max(o,r),c.push(t))}),p.push(o),d.push(c),fw(d,!1,p,l),s&&fM(d,!1,i),n?e.topCurrent=u+l*o:e.bottomCurrent=u+l*o}}function fE(t,e,i,s,r){if(t.length){let i="top"===s,a=i?1:-1,n=0,l=e.rightCurrent,o=i?e.topCurrent:e.bottomCurrent,h=[],u=[],d=[];t.forEach(t=>{let{layoutTag:s,layoutRect:d,rect:c}=fP(t,e,r),p=c.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=c.width+t.layoutPaddingLeft+t.layoutPaddingRight,f=i?t.layoutPaddingTop:-c.height-t.layoutPaddingBottom;l<g&&u.length?(l=e.rightCurrent,o+=a*n,n=p,t.setLayoutStartPosition({x:e.rightCurrent+t.layoutOffsetX-c.width-t.layoutPaddingRight,y:o+t.layoutOffsetY+f}),h.push(u),u=[t]):(u.push(t),t.setLayoutStartPosition({x:l+t.layoutOffsetX-c.width-t.layoutPaddingRight,y:o+t.layoutOffsetY+f}),n=Math.max(n,p),l-=g)}),d.push(n),h.push(u),fw(h,!1,d,a),i?e.topCurrent=o+a*n:e.bottomCurrent=o+a*n}}function fP(t,e,i,s=!0){let r,a,n="recomputeHeight",l="recomputeWidth",o="width";"top"!==t.layoutOrient&&"bottom"!==t.layoutOrient||(n="recomputeWidth",l="recomputeHeight",o="height");let h=!(!t.willLayoutTag&&!1===i[n]);if(h){let n=Object.assign({},t.getLayoutRect()),u=t.lastComputeRect;
2r=e.getItemComputeLayoutRect(t),!t.willLayoutTag&&(0,ex.n)(r,u)?(h=!1,a=t.getLayoutRect()):(a=t.computeBoundsInRect(r),(0,ex.n)(n[o],a[o])?h=!1:(s&&t.setLayoutRect(a),i[l]=!0))}else r=t.getLastComputeOutBounds(),a=t.getLayoutRect();return{layoutRect:r,rect:a,layoutTag:h}}fA.type="region",fA.transformerConstructor=fS,fA.specKey="region";class fO{constructor(t,e){this.leftCurrent=0,this.topCurrent=0,this.rightCurrent=0,this.bottomCurrent=0,this.recomputeWidth=!1,this.recomputeHeight=!1,this._onError=null==e?void 0:e.onError}_layoutInit(t,e,i,s){this._chartLayoutRect=i,this._chartViewBox=s,this.leftCurrent=i.x,this.topCurrent=i.y,this.rightCurrent=i.x+i.width,this.bottomCurrent=i.height+i.y,this.recomputeWidth=!1,this.recomputeHeight=!1,e.sort((t,e)=>e.layoutLevel-t.layoutLevel)}_layoutNormalItems(t,e){this.layoutNormalInlineItems(t.filter(t=>"normal-inline"===t.layoutType),e),this.layoutNormalItems(t.filter(t=>"normal"===t.layoutType),e)}_groupItems(t){let e=t.filter(t=>"region"===t.layoutType),i=t.filter(t=>"region-relative"===t.layoutType),s=t.filter(t=>"region-relative-overlap"===t.layoutType),r=i.concat(s),a={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=>{a[t.layoutOrient].items.push(t)}),{regionItems:e,relativeItems:i,relativeOverlapItems:s,allRelatives:r,overlapItems:a}}layoutItems(t,e,i,s){var r,a,n;this._layoutInit(t,e,i,s);let l={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight},o=null!=(n=null==(a=null==(r=null==t?void 0:t.getSpec())?void 0:r.layout)?void 0:a.secondLayoutLeftRight)&&n;this._layoutNormalItems(e,l);let h={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:u,relativeItems:d,relativeOverlapItems:c,allRelatives:p,overlapItems:g}=this._groupItems(e);this.layoutRegionItems(u,d,c,g,l,o),this._processAutoIndent(u,d,c,g,p,h,l,o),this.layoutAbsoluteItems(e.filter(t=>"absolute"===t.layoutType)),e.forEach(t=>{t.clearWillLayoutTag()})}_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}}},r,a,n,l=!1){if(r.some(t=>t.autoIndent)){let{top:o,bottom:h,left:u,right:d}=this._checkAutoIndent(r,a);(o||h||u||d)&&(this.topCurrent=a.top+o,this.bottomCurrent=a.bottom-h,this.leftCurrent=a.left+u,this.rightCurrent=a.right-d,this.layoutRegionItems(t,e,i,s,n,l))}}layoutNormalItems(t,e){t.forEach(t=>{let{rect:i}=fP(t,this,e);"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,e){let i=t.filter(t=>"left"===t.layoutOrient),s=t.filter(t=>"right"===t.layoutOrient),r=t.filter(t=>"top"===t.layoutOrient),a=t.filter(t=>"bottom"===t.layoutOrient),n=this._chartLayoutRect.width+this._chartLayoutRect.x,l=this._chartLayoutRect.height+this._chartLayoutRect.y;return i.length&&function(t,e,i,s){let{startItems:r,middleItems:a,endItems:n}=fk(t);r.length&&fT(r,e,i,!1,"left",s),a.length&&fT(a,e,i,!0,"left",s),n.length&&fC(n,e,i,"left",s
2)}(i,this,l,e),r.length&&function(t,e,i,s){let{startItems:r,middleItems:a,endItems:n}=fk(t);r.length&&fB(r,e,i,!1,"top",s),a.length&&fB(a,e,i,!0,"top",s),n.length&&fE(n,e,i,"top",s)}(r,this,n,e),s.length&&function(t,e,i,s){let{startItems:r,middleItems:a,endItems:n}=fk(t);r.length&&fT(r,e,i,!1,"right",s),a.length&&fT(a,e,i,!0,"right",s),n.length&&fC(n,e,i,"right",s)}(s,this,l,e),a.length&&function(t,e,i,s){let{startItems:r,middleItems:a,endItems:n}=fk(t);r.length&&fB(r,e,i,!1,"bottom",s),a.length&&fB(a,e,i,!0,"bottom",s),n.length&&fE(n,e,i,"bottom",s)}(a,this,n,e),!0}_layoutRelativeOverlap(t,e,i){e.items.forEach(t=>{let{rect:s}=fP(t,this,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=>{(0,ex.n)(i.getLayoutRect(),e.rect)||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){let{rect:i}=fP(t,this,e,!1);"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){let s=Math.max(Math.min(e,...t.map(t=>{var e;return null!=(e=t.maxWidth)?e:Number.MAX_VALUE})),0),r=Math.max(Math.min(i,...t.map(t=>{var e;return null!=(e=t.maxHeight)?e:Number.MAX_VALUE})),0);return t.forEach(t=>{let e=s-t.layoutPaddingLeft-t.layoutPaddingRight,i=r-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:r,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}}},r,a=!1){let n=this.leftCurrent,l=this.rightCurrent,o=this.rightCurrent-this.leftCurrent,h=this.bottomCurrent-this.topCurrent;e.filter(t=>"left"===t.layoutOrient||"right"===t.layoutOrient).forEach(t=>{this._layoutRelativeItem(t,r)}),this._layoutRelativeOverlap("left",s.left,r),this._layoutRelativeOverlap("right",s.right,r),o=this.rightCurrent-this.leftCurrent,e.filter(t=>"top"===t.layoutOrient||"bottom"===t.layoutOrient).forEach(t=>{this._layoutRelativeItem(t,r)}),this._layoutRelativeOverlap("top",s.top,r),this._layoutRelativeOverlap("bottom",s.bottom,r),h=this.bottomCurrent-this.topCurrent,a&&(this.leftCurrent=n,this.rightCurrent=l,e.filter(t=>"left"===t.layoutOrient||"right"===t.layoutOrient).forEach(t=>{this._layoutRelativeItem(t,r)}),o=this.rightCurrent-this.leftCurrent);let{regionWidth:u,regionHeight:d}=this._layoutRegionItem(t,o,h);e.concat(i).forEach(e=>{if(["left","right"].includes(e.layoutOrient)){let 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+u-o})}else if(["top","bottom"].includes(e.layoutOrient)){let 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+d-h})}})}layoutAbsoluteItems(t){t.forEach(t=>{t.willLayoutTag&&t.absoluteLayoutInRect(this._chartLayoutRect)})}filterRegionsWithID(t,e){var i;let s=t.find(t=>t.getModelId()===e);return s||(null!=(i=this._onError)?i:h3)("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){let i={top:0,left:0,bottom:0,right:0};return t.forEach(t=>{if(!t.getModelVisible()||!t.autoIndent)return;let s="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds(),a=this._getOutInLayout(r,t,e);s?(i.top=Math.max(i.top,a.top),i.bottom=Math.max(i.bottom,a.bottom)):(i.left=Math.max(i.left,a.left),i.right=Math.max(i.right,a.right))}),i}_getOutInLayout(t,e,i){let{x:s,y:r}=e.getLayoutStartPoint(),{width:a,height:n}=e.getLayoutRect();return{left:i.left-(s-t.x1),right:s+a+t.x2-i.right,top:i.top-(r-t.y1),bottom:r+n+t.y2-i.bottom}}}fO.type="base",(C=W||(W={})).enter="enter",C.update="update",C.exit="exit",C.unChange="unChange",(B=U||(U={})).STATE_NORMAL="normal",B.STATE_HOVER="hover",B.STATE_HOVER_REVERSE="hover_reverse",B.STATE_DIMENSION_HOVER="dimension_hover",B.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",B.STATE_
2SELECTED="selected",B.STATE_SELECTED_REVERSE="selected_reverse",B.STATE_SANKEY_EMPHASIS="selected",B.STATE_SANKEY_EMPHASIS_REVERSE="blur",B.STATE_HIGHLIGHT="highlight",B.STATE_BLUR="blur",B.STATE_ACTIVE="active",(E=G||(G={})).STATE_HOVER_REVERSE="hover_reverse",E.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",E.STATE_SELECTED_REVERSE="selected_reverse",(P=Y||(Y={})).Identity="identity",P.Linear="linear",P.Log="log",P.Pow="pow",P.Sqrt="sqrt",P.Symlog="symlog",P.Time="time",P.Quantile="quantile",P.Quantize="quantize",P.Threshold="threshold",P.Ordinal="ordinal",P.Point="point",P.Band="band";let fR={};function fI(t){switch(t){case Y.Linear:case Y.Log:case Y.Pow:case Y.Sqrt:case Y.Symlog:case Y.Time:return!0;default:return!1}}function fL(t){switch(t){case Y.Ordinal:case Y.Point:case Y.Band:return!0;default:return!1}}function fD(t,e,i){(0,eA.A)(e)||(e=t,t=0),(0,eA.A)(i)||(i=1);let s=-1,r=0|Math.max(0,Math.ceil((e-t)/i)),a=Array(r);for(;++s<r;)a[s]=t+s*i;return a}Object.values(Y).forEach(t=>{fR[t]=!0});let fF=t=>{let e=null,i=null;return(...s)=>(e&&s.every((t,i)=>t===e[i])||(e=s,i=t(...s)),i)};function fz(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function fH(t,e,i=0,s){for((0,eE.A)(s)&&(s=t.length);i<s;){let r=i+s>>>1;fz(t[r],e)>0?s=r:i=r+1}return i}let fj=(t,e)=>fV(0,t.length,i=>e(t[i])),fV=(t,e,i)=>{let s=t,r=e;for(;s<r;){let t=Math.floor((s+r)/2);i(t)>=0?r=t:s=t+1}return s};function fN(t){return t}let fW=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),fU=t=>t<0?-t*t:t*t,fG=t=>-Math.log(-t),fY=t=>-Math.exp(-t),f$=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,fX=t=>10===t?f$:t===Math.E?Math.exp:e=>Math.pow(t,e),fK=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),fq=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),fZ=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function fJ(t,e){if(t=Number(t),e=Number(e)-t)return i=>(i-t)/e;let i=Number.isNaN(e)?NaN:.5;return()=>i}function fQ(t,e,i){let s,r,a=t[0],n=t[1],l=e[0],o=e[1];return n<a?(s=fJ(n,a),r=i(o,l)):(s=fJ(a,n),r=i(l,o)),t=>r(s(t))}function f0(t,e,i){let s;return s=1===t?t+2*i:t-e+2*i,t?s>0?s:1:0}function f1(t,e,i,s){return 1===i&&(i=0),f0(t,i,s)*(e/(1-i))}function f2(t,e){let i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}function f3(t,e,i){let s=Math.min(t.length,e.length)-1,r=Array(s),a=Array(s),n=-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++n<s;)r[n]=fJ(t[n],t[n+1]),a[n]=i(e[n],e[n+1]);return function(e){let i=fH(t,e,1,s)-1;return a[i](r[i](e))}}let f5=(t,e=!1)=>{let i=Math.floor(Math.log10(t)),s=t/Math.pow(10,i);return(e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10)*Math.pow(10,i)},f4=Math.sqrt(50),f8=Math.sqrt(10),f6=Math.sqrt(2),f9=fF((t,e,i,s)=>{let r,a,n,l,o=-1;if(i*=1,(t*=1)==(e*=1)||5e-324>=Math.abs(t-e)&&i>0)return[t];if((r=e<t)&&(a=t,t=e,e=a),!isFinite(l=mi(t,e,i).step))return[];if(l>0){let i=Math.round(t/l),s=Math.round(e/l);for(i*l<t&&++i,s*l>e&&--s,n=Array(a=s-i+1);++o<a;)n[o]=(i+o)*l}else if(l<0&&(null==s?void 0:s.noDecimals)){l=1;let i=Math.ceil(t),s=Math.floor(e);if(!(i<=s))return[];for(n=Array(a=s-i+1);++o<a;)n[o]=i+o}else{let i=Math.round(t*(l=-l)),s=Math.round(e*l);for(i/l<t&&++i,s/l>e&&--s,n=Array(a=s-i+1);++o<a;)n[o]=(i+o)/l}return r&&n.reverse(),n}),f7=(t,e,i)=>{let s,r,a=-1;if(i>0){let n=Math.floor(t/i),l=Math.ceil(e/i);for((n+1)*i<t&&++n,(l-1)*i>e&&--l,r=Array(s=l-n+1);++a<s;)r[a]=(n+a)*i}else{let n=Math.floor(t*(i=-i)),l=Math.ceil(e*i);for((n+1)/i<t&&++n,(l-1)/i>e&&--l,r=Array(s=l-n+1);++a<s;)r[a]=(n+a)/i}return r},mt=fF((t,e,i,s)=>{let r,a,n;if(i*=1,(t*=1)==(e*=1)||5e-324>=Math.abs(t-e)&&i>0){var l,o,h;let e,r,a,n;return l=t,o=i,h=null==s?void 0:s.noDecimals,e=1,r=l,a=Math.floor((o-1)/2),n=Math.abs(l),l>=0&&l<=5e-324?r=0:l<0&&l>=-5e-324?r=-(o-1):!h&&n<1?e=me(n).step:(h||n>1)&&(r=Math.floor(l)-a*e),e>0?(l>0?r=Math.max(r,0):l<0&&(r=Math.min(r,-(o-1)*e)),fD(0,o).map(t=>r+t*e)):l>0?f7(0,-(o-1)/e,e):f7((o-1)/e,0,e)}(r=e<t)&&(n=t,t=e,e=n);let u=mi(t,e,i),d=u.step;if(!isFinite(d))return[];if(d>0){let s=1,{power:r,gap:n}=u,l=10===n?2*10**r:+(10**r);for(;s<=5&&(a=f7(t,e,d)).length>i+1&&i>2;)d+=l,s+=1;i>
22&&a.length<i-1&&(a=((t,e,i)=>{let s,r=t[0],a=t[t.length-1],n=e-t.length;if(a<=0){let e=[];for(s=n;s>=1;s--)e.push(r-s*i);return e.concat(t)}if(r>=0){for(s=1;s<=n;s++)t.push(a+s*i);return t}let l=[],o=[];for(s=1;s<=n;s++)s%2==0?l=[r-Math.floor(s/2)*i].concat(l):o.push(a+Math.ceil(s/2)*i);return l.concat(t).concat(o)})(a,i,d))}else(null==s?void 0:s.noDecimals)&&d<0&&(d=1),a=f7(t,e,d);return r&&a.reverse(),a}),me=t=>{let e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e,s=1;return i>=f4?s=10:i>=f8?s=5:i>=f6&&(s=2),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function mi(t,e,i){return me((e-t)/Math.max(0,i))}function ms(t,e,i){let s;if(i*=1,(t*=1)==(e*=1)&&i>0)return[t];if(i<=0||0==(s=(e-t)/Math.max(1,i-1))||!isFinite(s))return[];let r=Array(i);for(let e=0;e<i;e++)r[e]=t+e*s;return r}function mr(t,e,i){let s,r,a=-1;if(i*=1,(r=(e*=1)<(t*=1))&&(s=t,t=e,e=s),!isFinite(i)||e-t<=i)return[t];let n=Math.floor((e-t)/i+1),l=Array(n);for(;++a<n;)l[a]=t+a*i;return r&&l.reverse(),l}function ma(t,e=10){let i,s,r=0,a=t.length-1,n=t[r],l=t[a],o=10;for(l<n&&(s=n,n=l,l=s,s=r,r=a,a=s);o-- >0;){if((s=mi(n,l,e).step)===i)return t[r]=n,t[a]=l,t;if(s>0)n=Math.floor(n/s)*s,l=Math.ceil(l/s)*s;else{if(!(s<0))break;n=Math.ceil(n*s)/s,l=Math.floor(l*s)/s}i=s}}function mn(t,e){let i=ed(e.forceMin),s=ed(e.forceMax),r=null,a=[],n=null,l=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?a[0]=e.forceMin:ed(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(a[0]=e.min),s?a[1]=e.forceMax:ed(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(a[1]=e.max),ed(a[0])&&ed(a[1])?((n=t.slice())[0]=a[0],n[n.length-1]=a[1]):r=ed(a[0])||ed(a[1])?ed(a[0])?"max":"min":"all",{niceType:r,niceDomain:n,niceMinMax:a,domainValidator:l}}let ml=(t,e,i)=>1>Math.abs(e-t)?+i.toFixed(1):Math.round(+i),mo=fF((t,e,i,s,r,a,n)=>{let l=t,o=e,h=o<l;h&&([l,o]=[o,l]);let u,d,c=r(l),p=r(o),g=[];if(!(s%1)&&p-c<i){if(c=Math.floor(c),p=Math.ceil(p),l>0){for(;c<=p;++c)for(u=1;u<s;++u)if(!((d=c<0?u/a(-c):u*a(c))<l)){if(d>o)break;g.push(d)}}else for(;c<=p;++c)for(u=s-1;u>=1;--u)if(!((d=c>0?u/a(-c):u*a(c))<l)){if(d>o)break;g.push(d)}2*g.length<i&&(g=mt(l,o,i))}else g=mt(c,p,Math.min(p-c,i)).map(a);return g=g.filter(t=>0!==t),(null==n?void 0:n.noDecimals)&&(g=Array.from(new Set(g.map(t=>Math.floor(t))))),h?g.reverse():g}),mh=fF((t,e,i,s,r,a)=>{let n=[],l={},o=r(t),h=r(e),u=[];if(Number.isInteger(s))u=mt(o,h,i);else{let t=(h-o)/(i-1);for(let e=0;e<i;e++)u.push(o+e*t)}return u.forEach(i=>{var r;let o,h,d=a(i),c=Number.isInteger(s)?ml(t,e,d):ml(t,e,f5(d)),p=ml(t,e,((r=[t,e])[0]<r[1]?(o=r[0],h=r[1]):(o=r[1],h=r[0]),Math.min(Math.max(c,o),h)));l[p]||isNaN(p)||!(u.length>1)||(l[p]=1,n.push(p))}),n}),mu=fF((t,e,i,s,r)=>ms(s(t),s(e),i).map(t=>f5(r(t))));fF((t,e,i,s,r)=>mr(s(t),s(e),i).map(t=>f5(r(t))));class md{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:(0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=f2(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):(0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return(0,eE.A)(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&((0,eE.A)(this._rangeFactorEnd)||1===this._rangeFactorEnd)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t,this._rangeFactorEnd=null!=(i=this._rangeFactorEnd)?i:1)),this)}rangeFactorEnd(t,e){var i;return(0,eE.A)(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0===t&&((0,eE.A)(this._rangeFactorStart)||0===this._rangeFactorStart)?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorEnd=t,this._rangeFactorStart=null!=(i=this._rangeFactorStart)?i:0)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);let{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,r=this.range(),a=r[0],n=r[r.length-1],l=Math.min(a,n),o=Math.max(a,n),h=h4(null!=(t=this._fishEyeOptions.focus)?t:0,l,o),u=(0,eE.A)(s)?(o-l)*i:s,d=Math.exp(e);d=d/(d-1)*u;let c=e/u;this._fishEyeTransform=t=>{let e=Math.abs(t-h);return e>=u?t:e<=1e-6?h:h+(t-h)*(d*(1-Math.exp(-e*c))/e*.75+.25)}}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])?i:e}}function mc(t,e){let i=t.r,s=e.r,r=t.g,a=e.g,n=t.b,l=e.b,o=t.opacity,h=e.opacity;return t=>new ul(Math.round(i*(1-t)+s*t),Math.round(r*(1-t)+a*t),Math.round(n*(1-t)+l*t),o*(1-t)+h*t)}function mp(t,e){return i=>t*(1-i)+e*i}function mg(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}RegExp(/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g.source,"g");let{Zr:mf}=en;function mm(t,e){let i,s,r,a,n=typeof e;if((0,eE.A)(e)||"boolean"===n)return()=>e;if("number"===n)return mp(t,e);if("string"===n){if(i=un.parseColorString(e)){let e=mf(un.parseColorString(t),i);return t=>e(t).formatRgb()}return mp(Number(t),Number(e))}return e instanceof ul?mf(t,e):e instanceof un?mf(t.color,e.color):e instanceof Date?(s=t.valueOf(),r=e.valueOf(),a=new Date,t=>(a.setTime(s*(1-t)+r*t),a)):mp(Number(t),Number(e))}function m_(t){return Number(t)}function my(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}class mv extends md{constructor(t=fN,e=fN){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=fN,this._piecewise=fQ,this._interpolate=mm}calculateVisibleDomain(t){var e;return(0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!=(e=this._niceDomain)?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(Number.isNaN(t=Number(t))||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!=(e=this._niceDomain)?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));let 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)?e:this._domain).map(this.transformer),mp)),this._clamp(this.untransformer(this._input(t)))}
2domain(t,e){var i;if(!t)return(null!=(i=this._niceDomain)?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;let s=Array.from(t,m_);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();let i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){let i=Array.from(t);return this._range=i,this._interpolate=mg,this.rescale(e)}rescale(t){var e;if(t)return this;let i=null!=(e=this._niceDomain)?e:this._domain,s=i.length,r=this._range.length,a=Math.min(s,r);if(s&&s<r&&this._forceAlign){let t=r-s+1,e=i[s-1],n=s>=2?(e-i[s-2])/t:0;for(let r=1;r<=t;r++)i[s-2+r]=e-n*(t-r);a=r}return this._autoClamp&&(this._clamp=my(i[0],i[a-1])),this._piecewise=a>2?f3:fQ,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:fN),this.rescale(i)):this._clamp!==fN}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){let 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(0,eE.A)(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return(0,eE.A)(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class mb extends mv{constructor(){super(...arguments),this.type=Y.Linear}clone(){var t;let e=new mb;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null==(t=this._niceDomain)?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(t=10,e){let i=this.calculateVisibleDomain(this._range);return f9(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if((0,r3.A)(null==e?void 0:e.customTicks))return e.customTicks(this,t);if((0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);let s=null!=(i=this._niceDomain)?i:this._domain,r=this._domain,a=s[0],n=s[s.length-1],l=mt(r[0],r[r.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==a||l[l.length-1]!==n)&&this._niceType){let t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==a?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==n&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){let e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter(t=>t>=e&&t<=i)}}return l}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return ms(e[0],e[e.length-1],t)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return mr(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;let r=this._domain,a=[];if(e){let t=mn(r,e);if(a=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){let e=ma(r.slice(),t);"min"===this._niceType?e[e.length-1]=null!=(i=a[1])?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!=(s=a[0])?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";let e=this._domain[this._domain.length-1],i=ma(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";let e=this._domain[0],i=ma(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}
2let mx=Symbol("implicit");class mS extends md{specified(t){var e;return t?(this._specified=Object.assign(null!=(e=this._specified)?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=Y.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=mx}clone(){let t=(new mS).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return(0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){let e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==mx)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}let r=this._ordinalRange[(s-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();for(let e of(this._domain=[],this._index=new Map,t)){let t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();let e=Array.from(t);return this._ordinalRange=e,this}index(t){var e;return this._index&&null!=(e=this._index.get(`${t}`))?e:-1}}function mA(t,e,i,s){let r=[],a=t;for(;a<=e;)r.push(a),a+=i;return s&&r.reverse(),r}function mk(t,e,i,s){let r,a;if(e=Math.floor(+e),t=Math.floor(+t),!(i=Math.floor(+i)))return[];if(t===e)return[t];if(r=e<t){let i=t;t=e,e=i}let n=my(1,e-t+1)(i);if(a=Math.floor((e-t+1)/n),!s)for(;Math.ceil((e-t+1)/a)>i&&n>1;)n-=1,a=Math.floor((e-t)/n);return mA(t,e,a,r)}class mM extends mS{constructor(t){super(),this.type=Y.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;let i=this._calculateWholeRange(this._range,e),s=super.domain().length,r=i[1]<i[0],a=i[Number(r)-0],n=i[1-Number(r)],l=f0(s,this._paddingInner,this._paddingOuter);return this._step=(n-a)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),a+=(n-a-this._step*(s-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(a=Math.round(a),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:r,start:r?h4(a+this._step*(s-1),i[1],i[0]):h4(a,i[0],i[1]),min:r?i[1]:i[0],max:n,count:s},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;let e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==mx)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}let{count:r,start:a,reverse:n,min:l,max:o}=this._bandRangeState,h=a+(s-1)%r*(n?-1:1)*this._step;return h4(this._fishEyeTransform?this._fishEyeTransform(h):h,l,o)}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){var i,s,r,a,n;let e,l,o;if((0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&2===t.length){let i=f2(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(i[1]-i[0])}else e=Math.abs(t[1]-t[0]);let h=(i=super.domain().length,s=e,r=this._paddingInner,a=this._paddingOuter,n=this._round,l=s/Math.max(1,f0(i,r,a)||1),n&&(l=Math.floor(l)),o=l*(1-r),n&&(o=Math.round(o)),o);h<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):h>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=h,this._isFixed=!1)}if(this.isBandwidthFixed()){let i=f1(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((0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)){let r=this._rangeFactorStart+s<=1,a=this._rangeFactorEnd-s>=0;if("rangeFactorStart"===e&&r?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&a?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?r?this._rangeFactorEnd=this._rangeFactorStart+s:a?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):a?this._rangeFactorStart=this._rangeFactorEnd-s:r?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1),i>0){let e=t[0]-i*this._rangeFactorStart;this._wholeRange=[e,e+i]}else{let e=t[1]+i*(1-this._rangeFactorEnd);this._wholeRange=[e-i,e]}}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){let t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){let e=this._domain;if((0,eA.A)(this._rangeFactorStart)&&(0,eA.A)(this._rangeFactorEnd)&&e.length){let 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=[m_(t[0]),m_(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[m_(t[0]),m_(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return -1===t?e:mk(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){let e=this.calculateVisibleDomain(this._range);return mk(0,e.length-1,t,!0).filter(t=>t<e.length).map(t=>e[t])}stepTicks(t){let e=this.calculateVisibleDomain(this._range);
2return(function(t,e,i){let s;if(i=my(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),s=e<t){let i=t;t=e,e=i}return mA(t,e,i,s)})(0,e.length-1,t).map(t=>e[t])}_getInvertIndex(t){let e=0,i=this.step()/2,s=this.bandwidth()/2,r=this._domain.length,a=this.range(),n=a[0]>a[a.length-1];for(e=0;e<r;e++){let a=this.scale(this._domain[e])+s;if(0===e&&(!n&&!rD(t,a+i)||n&&!rF(t,a-i))||e===r-1||!rF(t,a-i)&&!rD(t,a+i))break}return e>=0&&e<=r-1?e:r-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(0,eE.A)(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return(0,eE.A)(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&&ed(this._userBandwidth)}clone(){var t,e,i;return new mM(!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)?t:"auto",!0).maxBandwidth(null!=(e=this._maxBandwidth)?e:"auto",!0).minBandwidth(null!=(i=this._maxBandwidth)?i:"auto")}}class mw extends mS{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(!um(this._range))return void super.range(this._range);let t=uc(this._range,this._domain);super.range(t)}}let mT={linear:mb,band:mM,point:class extends mM{constructor(t){super(!1),this.type=Y.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},ordinal:mS,threshold:class t{constructor(){this.type=Y.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!(0,eE.A)(t)&&eP(+t)?this._range[fH(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){let 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 t).domain(this._domain).range(this._range).unknown(this._unknown)}},colorOrdinal:mw};function mC(t){let e=mT[t];return e?new e:null}function mB(t,e,i){if(!e)return t;let s=e.range(),r=i&&e._calculateWholeRange?e._calculateWholeRange(s):e.range();return Math.min(Math.max(Math.min(r[0],r[r.length-1]),t),Math.max(r[0],r[r.length-1]))}function mE(t,e,i){if(!e)return!0;let s=e.range(),r=(i&&e._calculateWholeRange?e._calculateWholeRange(s):e.range()).map(t=>e.invert(t)),a=Math.min(r[0],r[r.length-1]),n=Math.max(r[0],r[r.length-1]);return Array.isArray(t)?t.every(t=>t>=a&&t<=n):t>=a&&t<=n}function mP(t){return(0,eA.A)(null==t?void 0:t.field)&&(0,eA.A)(null==t?void 0:t.scale)}let mO=["linear","radial","conical"],mR={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}},mI={};
2Object.values(U).forEach(t=>{mI[t]=!0}),U.STATE_HOVER,U.STATE_HOVER_REVERSE,U.STATE_SELECTED,U.STATE_SELECTED_REVERSE,U.STATE_DIMENSION_HOVER,U.STATE_DIMENSION_HOVER_REVERSE;class mL extends ff{compile(){}getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),this.initStateMap()}initStateMap(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}updateState(t,e){if(t&&(eB(this._stateMap,t),!e))return this.getCompiler().renderNextTick()}}class mD extends mL{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;i<this._stateInfoList.length;i++){let s=this._stateInfoList[i].level;if(s&&s>t.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){let 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 for(let i in e.fields=e.fields||{},t.fields){let s=t.fields[i];e.fields[i]=e.fields[i]||{};let r=e.fields[i];(0,eA.A)(s.domain)&&(r.domain=s.domain),(0,eA.A)(s.type)&&(r.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:{}})})}clearAllStateInfo(){this._stateInfoList=[]}_isMultiMark(){var t;return!this._mark||(t=this._mark.type,pV.includes(t))}checkOneState(t,e,i){var s;let r=!1,a=!1;if((0,eA.A)(i.datums)&&i.datums.length>0)r=this.checkDatumState(i,e),a=!0;else if(i.items)r=null!=(s=this.checkItemsState(i,t))&&s,a=!0;else if(i.fields)r=this.checkFieldsState(i,e,t),a=!0;else if(!r&&i.filter){let s={mark:this._mark,renderNode:t,type:this._mark.type};r=i.filter(null==e?void 0:e[0],s),a=!0}return a?r?"in":"out":"skip"}checkState(t,e){var i;let s=(null!=(i=t.context.states)?i:[]).filter(t=>!!mI[t]).map(t=>[t,10]);for(let i=0;i<this._stateInfoList.length;i++){let r=this._stateInfoList[i],a=this.checkOneState(t,e,r);"skip"!==a&&"in"===a&&s.push([r.stateValue,r.level])}return s.map(t=>t[0])}checkDatumState(t,e){let i=!1,s=e[0];if((0,ev.A)(t.datums)){let e=this._isMultiMark(),r=t.datumKeys||Object.keys(t.datums[0]).filter(t=>!t.startsWith(px.H));i=t.datums.some(t=>e&&(0,ev.A)(null==t?void 0:t.items)?r.every(e=>{var i,r;return(null==(r=null==(i=null==t?void 0:t.items)?void 0:i[0])?void 0:r[e])===(null==s?void 0:s[e])}):r.every(e=>(null==t?void 0:t[e])===(null==s?void 0:s[e])))}else if(r2(t.datums)){let e=t.datumKeys||Object.keys(t.datums).filter(t=>!t.startsWith(px.H)),r=this._isMultiMark();i=e.every(e=>{var i,a;return r?(null==(i=t.datums.items)?void 0:i[0][e])===s[e]:(null==(a=t.datums)?void 0:a[e])===s[e]})}else i=e===t.datums;return i}checkItemsState(t,e){var i;return null==(i=t.items)?void 0:i.includes(e)}checkFieldsState(t,e,i){var s;let r=!0;for(let a in t.fields){let n=t.fields[a],l=n.type,o=n.domain,h=null==(s=e[0])?void 0:s[a];if(fI(l)&&o.length>1){if(this.checkLinearFieldState(o,a,e,i)){r=!1;break}r=!0}else{if(!o.some(t=>t===h)){r=!1;break}r=!0}}return r}checkLinearFieldState(t,e,i,s){var r;let a=this._isMultiMark()?null==(r=i[0])?void 0:r[e]:i[e];return a<t[0]||a>t[t.length-1]}release(){}}class mF extends ff{constructor(){super(...arguments),this.id=hH(),this._compiledProductId=null}getProductId(){var t;return null!=(t=this._compiledProductId)?t:this.generateProductId()}compile(t){this._compileProduct(t)}setTransform(t){this._transform=t}runTransforms(t,e){if(!t||!t.length)return e;let i=e;return t.forEach(t=>{var e;i=null==(e=uP.getGrammarTransform(t.type))?void 0:e.transform(t,i)}),i}}class mz extends mF{getProduct(){return this._product||(this._product=this.runTransforms(this._transform,this.getLatestData())),this._product}getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return null==(t=this._data)?void 0:t.latestData}constructor(t,e){super(t),this._data=null,this._data=e}removeProduct(){this._product=null,this._prevProduct=null,this._compiledProductId=null}release(){this.removeProduct(),super.release(),this._data=null}addRelatedMark(t){this._relatedMarks||(this._relatedMarks={}),this._relatedMarks[t.id]=t}updateData(t){if(this._compileProduct(),this._relatedMarks){let e=!1;
2if(Object.keys(this._relatedMarks).forEach(t=>{this._relatedMarks[t]&&(e=!0,this._relatedMarks[t].commit())}),!t&&e)return this.getCompiler().renderNextTick()}}_compileProduct(){this._prevProduct=this._product,this._product=null}generateProductId(){var t;return`${null==(t=this.getDataView())?void 0:t.name}`}}(O=$||($={}))[O.Color255=0]="Color255",O[O.Color1=1]="Color1";class mH{static Get(t,e=$.Color1,i=[0,0,0,1]){if(e===$.Color1){let e=mH.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;let s=un.parseColorString(t);if(s){let e=[s.r/255,s.g/255,s.b/255,s.opacity];mH.store1[t]=e,mH.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}let s=mH.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;let r=un.parseColorString(t);return r&&(mH.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],mH.store255[t]=[r.r,r.g,r.b,r.opacity],i[0]=r.r,i[1]=r.g,i[2]=r.b,i[3]=r.opacity),i}static Set(t,e,i){if(e===$.Color1)mH.store1[t]||(mH.store1[t]=i,mH.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]);else{if(mH.store255[t])return;mH.store255[t]=i,mH.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function mj(t,e=!1){return Array.isArray(t)&&ed(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 mV(t,e,i,s,r){return Array.isArray(t)&&!ed(t[0])||Array.isArray(e)&&!ed(e[0])?[,,,,].fill(0).map((r,a)=>{var n,l;return mN((0,ev.A)(t)?null!=(n=t[a])?n:t[0]:t,(0,ev.A)(e)?null!=(l=e[a])?l:e[0]:e,i,s)}):mN(t,e,i,s,r)}function mN(t,e,i,s,r){var a,n,l,o,h,u,d,c,p,g,f,m;if(!t||!e)return t&&mj(t)||e&&mj(e)||!1;let _,y,v=!1,b=!1;if(Array.isArray(t)?_=t:"string"==typeof t?_=mH.Get(t,$.Color255):v=!0,Array.isArray(e)?y=e:"string"==typeof e?y=mH.Get(e,$.Color255):b=!0,v!==b){let a=v?t:e,n=v?e:t,l=Object.assign(Object.assign({},a),{stops:a.stops.map(t=>Object.assign(Object.assign({},t),{color:mj(n)}))});return v?mV(a,l,i,s,r):mV(l,a,i,s,r)}if(v){if(t.gradient===e.gradient){let s=t.stops,r=e.stops;if(s.length!==r.length)return!1;if("linear"===t.gradient){let s,r;return a=t,n=e,l=i,s=a.stops,r=n.stops,{gradient:"linear",x0:a.x0+(n.x0-a.x0)*l,x1:a.x1+(n.x1-a.x1)*l,y0:a.y0+(n.y0-a.y0)*l,y1:a.y1+(n.y1-a.y1)*l,stops:Array(s.length).fill(0).map((t,e)=>({color:mY(s[e].color,r[e].color,l),offset:s[e].offset+(r[e].offset-s[e].offset)*l}))}}if("radial"===t.gradient){let s,r;return o=t,h=e,u=i,s=o.stops,r=h.stops,{gradient:"radial",x0:o.x0+(h.x0-o.x0)*u,x1:o.x1+(h.x1-o.x1)*u,y0:o.y0+(h.y0-o.y0)*u,y1:o.y1+(h.y1-o.y1)*u,r0:o.r0+(h.r0-o.r0)*u,r1:o.r1+(h.r1-o.r1)*u,stops:Array(s.length).fill(0).map((t,e)=>({color:mY(s[e].color,r[e].color,u),offset:s[e].offset+(r[e].offset-s[e].offset)*u}))}}if("conical"===t.gradient){let s,r;return d=t,c=e,p=i,s=d.stops,r=c.stops,{gradient:"conical",startAngle:d.startAngle+(c.startAngle-d.startAngle)*p,endAngle:d.endAngle+(c.endAngle-d.endAngle)*p,x:d.x+(c.x-d.x)*p,y:d.y+(c.y-d.y)*p,stops:Array(s.length).fill(0).map((t,e)=>({color:mY(s[e].color,r[e].color,p),offset:s[e].offset+(r[e].offset-s[e].offset)*p}))}}}return!1}return r&&r(_,y),mj((g=_,f=y,m=i,[g[0]+(f[0]-g[0])*m,g[1]+(f[1]-g[1])*m,g[2]+(f[2]-g[2])*m,g[3]+(f[3]-g[3])*m]),s)}function mW(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}mH.store255={},mH.store1={};let mU=[0,0,0,0],mG=[0,0,0,0];function mY(t,e,i){return mH.Get(t,$.Color255,mU),mH.Get(e,$.Color255,mG),`rgba(${Math.round(mU[0]+(mG[0]-mU[0])*i)},${Math.round(mU[1]+(mG[1]-mU[1])*i)},${Math.round(mU[2]+(mG[2]-mU[2])*i)},${mU[3]+(mG[3]-mU[3])*i})`}function m$(t,e,i,s,r,a){let n=(e-t)*r+t,l=(i-e)*r+e,o=(s-i)*r+i,h=(l-n)*r+n,u=(o-l)*r+l,d=(u-h)*r+h;a[0]=t,a[1]=n,a[2]=h,a[3]=d,a[4]=d,a[5]=u,a[6]=o,a[7]=s}function mX(t,e){let i=t||e,s=i.length,r=i[s-2],a=i[s-1],n=[];for(let t=0;t<e.length;t+=2)n[t]=r,n[t+1]=a;return n}function mK(t){let e=0,i=0,s=0,r=t.length;for(let a=0,n=r-2;a<r;n=a,a+=2){let r=t[n],l=t[n+1],o=t[a],h=t[a+1],u=r*h-o*l;e+=u,i+=(r+o)*u,s+=(l+h)*u}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,s/e/3,e]}function mq(t){let e=new sO,i=t.toString();if(!i)return[];e.fromString(i);let s=e.tryBuildCurves();if(!s||0===s.length)return[];let r=[],a=null;a=[];let n=0,l=0,o=0,h=0,u=!0;for(let t=0;t<s.length;t++){let e=s[t];if(u&&(n=e.p0.x,l=e.p0.y,o=n,h=l,a=[n,l],r.push(a),u=!1),e.p1&&e.p2&&e.p3)a.push(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y),o=e.p3.x,h=e.p3.y;else if(e.p1&&e.p2){let t=e.p1.x,i=e.p1.y,s=e.p2.x,r=e.p2.y;a.push(o+2/3*(t-o),h+2/3*(i-h),s+2/3*(t-s),r+2/3*(i-r),s,r),o=s,h=r}else if(e.p1){let t=e.p1.x,i=e.p1.y;1e-10>Math.abs(o-t)&&1e-10>Math.abs(h-i)||a.push(o,h,t,i,t,i),o=t,h=i}if(s.length,t<s.length-1){let e=s[t+1];(Math.abs(o-e.p0.x)>1e-10||Math.abs(h-e.p0.y)>1e-10)&&(u=!0)}}let d=r.filter(t=>t.length>2);return 1===d.length?[d[0]]:d}function mZ(t,e){for(let i=0;i<t.length;i++){let s=t[i];for(let t=0;t<s.length;t+=2){let i=s[t],r=s[t+1],a={x:i,y:r};e.transformPoint({x:i,y:r},a),s[t]=a.x,s[t+1]=a.y}}}function mJ(t,e,i){let s,r,a=t/e;t>=e?(r=Math.ceil(Math.sqrt(i*a)),0===(s=Math.floor(i/r))&&(s=1,r=i)):(s=Math.ceil(Math.sqrt(i/a)),0===(r=Math.floor(i/s))&&(r=1,s=i));let n=[];for(let t=0;t<s;t++)n.push(r);let l=i-s*r;if(l>0)for(let t=0;t<l;t+=r)t+r<l?n.push(r):n.push(l-t);return n}let mQ=(t,e)=>{let i=t.filter(t=>!1!==t.defined&&ed(t.x)&&ed(t.y));if(0===i.length)return[];if(1===i.length)return Array(e).fill(0).map(t=>i[0]);let s=[];if(e<=i.length){let t=i.length/e,r=0,a=0;for(;r<e;)s.push(i[Math.floor(a)]),a+=t,r++;return s}let r=e-i.length,a=1/(r/(i.length-1)+1),n=0;for(let e=0,i=t.length;e<i;e++)if(s.push(t[e]),e<i-1){let i=a,l=t[e].x,o=t[e].y,h=t[e+1].x,u=t[e+1].y;for(;i<1&&n<r;)s.push({x:l+(h-l)*i,y:o+(u-o)*i}),i+=a,n+=1}return s},m0=t=>t.map(t=>({x:t.x,y:t.y}
2)),m1=(t,e,i)=>{let s=t.length,r=[];for(let l=0;l<s;l++){var a,n;let o=t[l],h=l===s-1?t[0]:t[l+1],u=ij([e.x,e.y],[i.x,i.y],[o.x,o.y],[h.x,h.y]);u&&"boolean"!=typeof u&&r.push({dot:(a=[u[0]-e.x,u[1]-e.x],n=[i.x-e.x,i.y-e.x],a[0]*n[1]-a[1]*n[0]),point:{x:u[0],y:u[1]},edgeIndex:l})}if(r.length<2)return[m0(t),m0(t)];r.sort((t,e)=>t.dot-e.dot);let l=r[0],o=r[r.length-1];l.edgeIndex>o.edgeIndex&&([l,o]=[o,l]);let h=l.point,u=o.point,d=[{x:h.x,y:h.y}];for(let e=l.edgeIndex+1;e<=o.edgeIndex;e++)d.push({x:t[e].x,y:t[e].y});d.push({x:u.x,y:u.y});let c=[{x:u.x,y:u.y}];for(let e=o.edgeIndex+1,i=l.edgeIndex+s;e<=i;e++){let i=t[e%s];c.push({x:i.x,y:i.y})}return c.push({x:h.x,y:h.y}),[d,c]},m2=(t,e,i)=>{if(1===e)i.push({points:t});else{let s=Math.floor(e/2),r=(t=>{let e=new iZ;t.forEach(t=>{e.add(t.x,t.y)});let i=e.width(),s=e.height();if(i>=s){let s=e.x1+i/2;return m1(t,{x:s,y:e.y1},{x:s,y:e.y2})}let r=e.y1+s/2;return m1(t,{x:e.x1,y:r},{x:e.x2,y:r})})(t);m2(r[0],s,i),m2(r[1],e-s,i)}};(R=X||(X={})).wait="wait",R.from="from",R.to="to",R.customAnimate="customAnimate",(I=K||(K={}))[I.INITIAL=0]="INITIAL",I[I.RUNNING=1]="RUNNING",I[I.PAUSED=2]="PAUSED",I[I.END=3]="END";class m3{static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(-(e*t)+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-m3.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*m3.bounceIn(2*t):.5*m3.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;let s=e/id*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*id/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;let s=e/id*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*id/e)+1}}static getElasticInOut(t,e){return function(i){let s=e/id*Math.asin(1/t);return(i*=2)<1?-(t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*id/e)*.5):t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*id/e)*.5+1}}static registerFunc(t,e){m3[t]=e}}m3.quadIn=m3.getPowIn(2),m3.quadOut=m3.getPowOut(2),m3.quadInOut=m3.getPowInOut(2),m3.cubicIn=m3.getPowIn(3),m3.cubicOut=m3.getPowOut(3),m3.cubicInOut=m3.getPowInOut(3),m3.quartIn=m3.getPowIn(4),m3.quartOut=m3.getPowOut(4),m3.quartInOut=m3.getPowInOut(4),m3.quintIn=m3.getPowIn(5),m3.quintOut=m3.getPowOut(5),m3.quintInOut=m3.getPowInOut(5),m3.backIn=m3.getBackIn(1.7),m3.backOut=m3.getBackOut(1.7),m3.backInOut=m3.getBackInOut(1.7),m3.elasticIn=m3.getElasticIn(1,.3),m3.elasticOut=m3.getElasticOut(1,.3),m3.elasticInOut=m3.getElasticInOut(1,.3*1.5),m3.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),m3.easeOutElastic=t=>{let e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},m3.easeInOutElastic=t=>{let e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)m3[`flicker${t}`]=e=>(function(t,e){let i=1/e,s=1;for(;t>i;)t-=i,s*=-1;let r=s*t/i;return r>0?r:1+r})(e,t);for(let t=2;t<10;t++)m3[`aIn${t}`]=e=>t*e*e+(1-t)*e;let m5=new class{constructor(){this.opacity=(t,e,i,s,r,a)=>{a.attribute.opacity=e+(i-e)*s},this.baseOpacity=(t,e,i,s,r,a)=>{a.attribute.baseOpacity=e+(i-e)*s},this.fillOpacity=(t,e,i,s,r,a)=>{a.attribute.fillOpacity=e+(i-e)*s},this.strokeOpacity=(t,e,i,s,r,a)=>{a.attribute.strokeOpacity=e+(i-e)*s},this.zIndex=(t,e,i,s,r,a)=>{a.attribute.zIndex=e+(i-e)*s},this.backgroundOpacity=(t,e,i,s,r,a)=>{a.attribute.backgroundOpacity=e+(i-e)*s},this.shadowOffsetX=(t,e,i,s,r,a)=>{a.attribute.shadowOffsetX=e+(i-e)*s},this.shadowOffsetY=(t,e,i,s,r,a)=>{a.attribute.shadowOffsetY=e+(i-e)*s},this.shadowBlur=(t,e,i,s,r,a)=>{a.attribute.shadowBlur=e+(i-e)*s},this.fill=(t,e,i,s,r,a)=>{a.attribute.fill=mV(e,i,s,!1)},this.fillPure=(t,e,i,s,r,a)=>{a.attribute.fill=r.fromParsedProps.fill?mW(r.fromParsedProps.fill,r.toParsedProps.fill,s):r.toParsedProps.fill},this.stroke=(t,e,i,s,r,a)=>{a.attribute.stroke=mV(e,i,s,!1)},this.strokePure=(t,e,i,s,r,a)=>{a.attribute.stroke=r.fromParsedProps.stroke?mW(r.fromParsedProps.stroke,r.toParsedProps.stroke,s):r.toParsedProps.stroke},this.width=(t,e,i,s,r,a)=>{a.attribute.width=e+(i-e)*s,a.addUpdateBoundTag()},this.height=(t,e,i,s,r,a)=>{a.attribute.height=e+(i-e)*s,a.addUpdateBoundTag()},this.x=(t,e,i,s,r,a)=>{a.attribute.x=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.y=(t,e,i,s,r,a)=>{a.attribute.y=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.dx=(t,e,i,s,r,a)=>{a.attribute.dx=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.dy=(t,e,i,s,r,a)=>{a.attribute.dy=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.angle=(t,e,i,s,r,a)=>{a.attribute.angle=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()}
2,this.scaleX=(t,e,i,s,r,a)=>{a.attribute.scaleX=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.scaleY=(t,e,i,s,r,a)=>{a.attribute.scaleY=e+(i-e)*s,a.addUpdateBoundTag(),a.addUpdatePositionTag()},this.lineWidth=(t,e,i,s,r,a)=>{a.attribute.lineWidth=e+(i-e)*s,a.addUpdateBoundTag()},this.startAngle=(t,e,i,s,r,a)=>{a.attribute.startAngle=e+(i-e)*s,a.addUpdateBoundTag()},this.endAngle=(t,e,i,s,r,a)=>{a.attribute.endAngle=e+(i-e)*s,a.addUpdateBoundTag()},this.radius=(t,e,i,s,r,a)=>{a.attribute.radius=e+(i-e)*s,a.addUpdateBoundTag()},this.outerRadius=(t,e,i,s,r,a)=>{a.attribute.outerRadius=e+(i-e)*s,a.addUpdateBoundTag()},this.innerRadius=(t,e,i,s,r,a)=>{a.attribute.innerRadius=e+(i-e)*s,a.addUpdateBoundTag()},this.size=(t,e,i,s,r,a)=>{a.attribute.size=e+(i-e)*s,a.addUpdateBoundTag()},this.points=(t,e,i,s,r,a)=>{a.attribute.points=an(e,i,s),a.addUpdateBoundTag()}}};function m4(t,e,i,s,r,a){if(Number.isFinite(i)&&Number.isFinite(e))return a.attribute[t]=e+(i-e)*s,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){let r=[],n=!0;for(let t=0;t<i.length;t++){let a=e[t],l=a+(i[t]-a)*s;if(!Number.isFinite(l)){n=!1;break}r.push(l)}return n&&(a.attribute[t]=r),!0}return!1}function m8(){}class m6{constructor(t,e,i,s){var r;this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=s?"function"==typeof s?s:null!=(r=m3[s])?r:m3.linear:m3.linear,"wait"===t&&(this.onUpdate=m8),this.id=eI.GenAutoIncrementId(),this.syncAttributeUpdate=m8}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t,e=!0){this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;let t=[];this.propKeys.forEach(e=>{if("fill"===e||"stroke"===e){let i=this.fromProps[e],s=this.props[e];if((0,eS.A)(i)&&(0,eS.A)(s)){let r=mH.Get(i,$.Color255),a=mH.Get(s,$.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=r,this.toParsedProps[e]=a,t.push(m5["fill"===e?"fillPure":"strokePure"])}else m5[e]?t.push(m5[e]):t.push(m4)}else m5[e]?t.push(m5[e]):t.push(m4)}),this.interpolateUpdateFunctions=t}setStartTime(t,e=!0){this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();let t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach(e=>{var i;this.fromProps[e]=null!=(i=this.fromProps[e])?i:t[e]}),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){let t=this.animate;
2this.target.animates.forEach(e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;let i=e.getStartProps();this.propKeys.forEach(t=>{null!=i[t]&&e.preventAttr(t)})})}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];let i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null==(e=this.interpolateUpdateFunctions)||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach(t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)})}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;let s=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;let i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],s,this,this.target)}),this.onUpdate(t,s,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}release(){}}class m9 extends m6{constructor(t,e,i,s){super(t,e,i,s)}onStart(){super.onStart();let t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class m7 extends m6{constructor(t,e,i,s,r){super("customAnimate",e,i,s),this.type="customAnimate",this.customFrom=t,this.params=r,this.from=t,this.to=e}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;let s=this.easing(e);this.onUpdate(t,s,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class _t extends m7{completeBind(t){this.setStartTime(0),this._animator&&this._animator.start(),this.setDuration(t.getDuration())}stop(){this._animator&&this._animator.stop()}}class _e extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r),this.willCallBeforeStageRender=!0,this.willCallAfterStageRender=!0,this.checkStatusAfterRender=!0,this._beforeStageRender=()=>{if(!this.willCallBeforeStageRender)return;this.willCallBeforeStageRender=!1;let t=this.target.stage,e=t.window.getContext().canvas.nativeCanvas,i=this.beforeStageRender(t,e);i&&this.renderToStage(t,i)},this._afterStageRender=()=>{if(!this.willCallAfterStageRender)return;this.willCallAfterStageRender=!1;let t=this.target.stage,e=t.window.getContext().canvas.nativeCanvas,i=this.afterStageRender(t,e);i&&this.renderToStage(t,i),this.checkStatusAfterRender&&this.animate.status===K.END&&this.animate.timeline.removeAnimate(this.animate)},this.props={}}beforeStageRender(t,e){return!1}afterStageRender(t,e){return!1}onFirstRun(){super.onFirstRun(),this.target.stage.setBeforeRender(this._beforeStageRender),this.target.stage.setAfterRender(this._afterStageRender),this.target.stage.disableDirtyBounds()}stop(){super.stop(),this.target.stage.removeBeforeRender(this._beforeStageRender),this.target.stage.removeAfterRender(this._afterStageRender)}onUpdate(t,e,i){super.onUpdate(t,e,i),this.willCallBeforeStageRender=!0,this.willCallAfterStageRender=!0}renderToStage(t,e){let i=t.window.getContext().canvas.nativeCanvas,s=i.getContext("2d");return!!s&&(s.clearRect(0,0,i.width,i.height),s.drawImage(e,0,0),i)}}let _i="quadInOut",_s=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],_r=(t,e,i)=>{t.forEach(t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){let s=mV(t.from,t.to,i,!1);s&&(e[t.key]=s)}})},_a=(t,e,i)=>{let s=[],r=[];e.clear();for(let a=0;a<t.length;a++){let n=t[a],l=n.from,o=n.to,h=n.rotation*i,u=n.fromCp,d=n.toCp,c=Math.sin(h),p=Math.cos(h);r[0]=u[0]+(d[0]-u[0])*i,r[1]=u[1]+(d[1]-u[1])*i;for(let t=0;t<l.length;t+=2){let e=l[t],a=l[t+1],n=e*(1-i)+o[t]*i,h=a*(1-i)+o[t+1]*i;s[t]=n*p-h*c+r[0],s[t+1]=n*c+h*p+r[1]}let g=s[0],f=s[1];e.moveTo(g,f);for(let t=2;t<l.length;t+=6){let i=s[t],r=s[t+1],a=s[t+2],n=s[t+3],l=s[t+4],o=s[t+5];g===i&&f===r&&a===l&&n===o?e.lineTo(l,o):e.bezierCurveTo(i,r,a,n,l,o),g=l,f=o}}},_n=(t,e,i)=>{let s=t?mq(t):[],r=mq(e);i&&s&&(i.fromTransform&&mZ(s,i.fromTransform.clone().getInverse()),mZ(s,i.toTransfrom));let[a,n]=function(t,e){let i,s,r=[],a=[];for(let n=0;n<Math.max(t.length,e.length);n++){let l,o,h=t[n],u=e[n];h?u?([l,o]=function(t,e){let i=t.length,s=e.length;if(i===s)return[t,e];let r=[],a=[],n=i<s?t:e,l=Math.min(i,s),o=Math.abs(s-i)/6,h=Math.ceil(o/((l-2)/6)),u=[n[0],n[1]],d=o;for(let t=2;t<l;t+=6){let e=n[t-2],i=n[t-1],s=n[t],l=n[t+1],o=n[t+2],c=n[t+3],p=n[t+4],g=n[t+5];if(d<=0){u.push(s,l,o,c,p,g);continue}let f=Math.min(d,h)+1;for(let t=1;t<=f;t++){let n=t/f;m$(e,s,o,p,n,r),m$(i,l,c,g,n,a),e=r[3],i=a[3],u.push(r[1],a[1],r[2],a[2],e,i),s=r[5],l=a[5],o=r[6],c=a[6]}d-=f-1}return n===t?[u,e]:[t,u]}(h,u),i=l,s=o):(o=mX(s,h),l=h):(l=mX(i,u),o=u),r.push(l),a.push(o)}return[r,a]}(s,r);
2return t?function(t,e,i){let s,r=[];for(let a=0;a<t.length;a++){let n=t[a],l=e[a],o=mK(n),h=mK(l);null==s&&(s=o[2]<0!=h[2]<0);let u=[],d=[],c=0,p=1/0,g=[],f=n.length;s&&(n=function(t){let e=[],i=t.length;for(let s=0;s<i;s+=2)e[s]=t[i-s-2],e[s+1]=t[i-s-1];return e}(n));let m=6*function(t,e,i,s){let r=(t.length-2)/6,a=1/0,n=0,l=t.length,o=l-2;for(let h=0;h<r;h++){let r=6*h,u=0;for(let a=0;a<l;a+=2){let n=0===a?r:(r+a-2)%o+2,l=t[n]-i[0],h=t[n+1]-i[1],d=e[a]-s[0]-l,c=e[a+1]-s[1]-h;u+=d*d+c*c}u<a&&(a=u,n=h)}return n}(n,l,o,h),_=f-2;for(let t=0;t<_;t+=2){let e=(m+t)%_+2;u[t+2]=n[e]-o[0],u[t+3]=n[e+1]-o[1]}u[0]=n[m]-o[0],u[1]=n[m+1]-o[1];{let t=i/10;for(let e=-i/2;e<=i/2;e+=t){let t=Math.sin(e),i=Math.cos(e),s=0;for(let e=0;e<n.length;e+=2){let r=u[e],a=u[e+1],n=l[e]-h[0],o=l[e+1]-h[1],d=n*i-o*t,c=n*t+o*i;g[e]=d,g[e+1]=c;let p=d-r,f=c-a;s+=p*p+f*f}if(s<p){p=s,c=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}r.push({from:u,to:d,fromCp:o,toCp:h,rotation:-c})}return r}(a,n,Math.PI):n.map((t,e)=>({from:a[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0}))},_l=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],_o=(t,e)=>{if(!t||!e)return null;let i=[],s=!1;return Object.keys(t).forEach(r=>{if(!_l.includes(r))return;let a=e[r];if(!(0,eE.A)(a)&&!(0,eE.A)(t[r])&&a!==t[r]){if("fill"===r||"stroke"===r){let e=t=>"string"==typeof t?mH.Get(t,$.Color255):t;i.push({from:(0,ev.A)(t[r])?t[r].map(e):e(t[r]),to:(0,ev.A)(a)?a.map(e):e(a),key:r})}else i.push({from:t[r],to:a,key:r});s=!0}}),s?i:null};class _h extends m7{constructor(t,e,i){super({},{},e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){let s=this.target,r="function"==typeof s.pathProxy?s.pathProxy(s.attribute):s.pathProxy;_a(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&_r(this.otherAttrs,i,e),this.target.setAttributes(i),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}let _u=(t,e,i,s)=>{var r,a,n;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let l=null==t?void 0:t.globalTransMatrix;s&&l&&(l=s.clone().multiply(l.a,l.b,l.c,l.d,l.e,l.f));let o=_n(null==(r=null==t?void 0:t.toCustomPath)?void 0:r.call(t),e.toCustomPath(),{fromTransform:l,toTransfrom:e.globalTransMatrix}),h=_o(null==t?void 0:t.attribute,e.attribute),u=e.animate(i);(null==i?void 0:i.delay)&&u.wait(i.delay);let d=new _h({morphingData:o,otherAttrs:h},null!=(a=null==i?void 0:i.duration)?a:1e3,null!=(n=null==i?void 0:i.easing)?n:_i);return u.play(d),u};class _d extends m7{constructor(t,e,i){super({},{},e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.createPathProxy()}),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren(t=>{t.pathProxy=null})}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren((t,i)=>{var s;_a(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null==(s=this.otherAttrs)?void 0:s[i])&&this.otherAttrs[i].length&&_r(this.otherAttrs[i],t.attribute,e)}),t&&(this.clearPathProxy(),this.morphingData=null)}}let _c=t=>{let e={};return Object.keys(t).forEach(i=>{_s.includes(i)||(e[i]=t[i])}),e},_p=(t,e,i)=>{let s=_c(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:s}),e.forEach(t=>{t.setAttributes({pickable:!1}),r.appendChild(t)});else{let a=t.AABBBounds,n=a.width(),l=a.height();r.setTheme({rect:s}),Array(i).fill(0).forEach(t=>{let i=ie.graphicService.creator.rect({x:0,y:0,width:n,height:l,pickable:!1});r.appendChild(i),e.push(i)})}},_g=(t,e,i)=>{let s=[],r=i?null:_c(t.attribute),a=t.toCustomPath();for(let t=0;t<e;t++){let t={path:(new sO).fromCustomPath2D(a)};s.push(ie.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&_p(t,s,e),s},_f=(t,e,i)=>{let s=[],r=i?null:_c(t.attribute);if("rect"===t.type)((t,e)=>{let{width:i,height:s}=gZ(t.attribute),r=mJ(i,s,e),a=[],n=s/r.length;for(let t=0,e=r.length;t<e;t++){let e=r[t],s=i/e;for(let i=0;i<e;i++)a.push({x:0+i*s,y:0+t*n,width:s,height:n})}return a})(t,e).forEach(t=>{s.push(ie.graphicService.creator.rect(i?t:Object.assign({},r,t)))});else if("arc"===t.type)((t,e)=>{let i=t.getParsedAngle(),s=i.startAngle,r=i.endAngle,a=t.getComputedAttribute("innerRadius"),n=t.getComputedAttribute("outerRadius"),l=Math.abs(s-r),o=Math.abs(n-a),h=mJ(l*(a+n)/2,o,e),u=[],d=o/h.length,c=n>=a?1:-1,p=r>=s?1:-1;for(let t=0,e=h.length;t<e;t++){let e=h[t],i=l/e;for(let r=0;r<e;r++)u.push({innerRadius:n-d*t*c,outerRadius:n-d*(t+1)*c,startAngle:s+i*r*p,endAngle:s+i*(r+1)*p})}return u})(t,e).forEach(t=>{s.push(ie.graphicService.creator.arc(i?t:Object.assign({},r,t)))});else if("circle"===t.type)((t,e)=>{let i=t.getComputedAttribute("startAngle"),s=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),a=Math.abs(i-s),n=mJ(a*r,r,e),l=[],o=a/n[0],h=r/n.length,u=s>=i?1:-1;for(let t=0,e=n.length;t<e;t++)for(let e=0,s=n[t];e<s;e++)l.push({innerRadius:h*t,outerRadius:h*(t+1),startAngle:i+o*e*u,endAngle:i+o*(e+1)*u});return l})(t,e).forEach(t=>{s.push(ie.graphicService.creator.arc(i?t:Object.assign({},r,t)))});else if("line"===t.type){let a,n,l=(n=(a=t.attribute).points)?mQ(n,e):a.segments?mQ(a.segments.reduce((t,e)=>{var i;return t.concat(null!=(i=e.points)?i:[])},[]),e):[],o={size:10,symbolType:"circle"};l.forEach(t=>{s.push(ie.graphicService.creator.symbol(i?Object.assign({},t,o):Object.assign({},r,t,o)))})}else"polygon"===t.type?((t,e)=>{let i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:m0(i)}];let s=[];return m2(i,e,s),s})(t,e).forEach(t=>{s.push(ie.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}):"area"===t.type?((t,e)=>{var i,s;let r=t.attribute,a=r.points,n=r.segments;a||(a=n.reduce((t,e)=>{var i;return t.concat(null!=(i=e.points)?i:[])},[]));let l=a.filter(t=>!1!==t.defined&&ed(t.x)&&ed(t.y));if(!l.length)return[];let o=[];l.forEach(t=>{o.push({x:t.x,y:t.y})});for(let t=l.length-1;t>=0;t--){let e=l[t];o.push({x:null!=(i=e.x1)?i:e.x,y:null!=(s=e.y1)?s:e.y})}let h=[];return m2(o,e,h),h})(t,e).forEach(t=>{s.push(ie.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}):"path"===t.type&&((t,e)=>{let i=mq(t.getParsedPathShape());if(!i.length||e<0)return[];let s=i.length;if(i.length>=e){let t=[],r=Math.floor(i.length/e);for(let a=0;a<e;a++){let n=i.slice(a*r,a===e-1?s:(a+1)*r);t.push({path:function(t){let e=new sO;for(let i=0;i<t.length;i++){let s=t[i];if(s.length>2){e.moveTo(s[0],s[1]);for(let t=2;t<s.length;t+=6)e.bezierCurveTo(s[t],s[t+1],s[t+2],s[t+3],s[t+4],s[t+5])}}return e}(n)})}return t}let r=[],a=Math.floor(e/s),n=e;for(let t=0;t<s;t++){let e=[];for(let s=2,r=i[t].length;s<r;s+=2)e.push({x:i[0][s],y:i[0][s+1]});m2(e,t===s-1?n:a,r),n-=a}return r})(t,e).forEach(t=>{"path"in t?s.push(ie.graphicService.creator.path(i?t:Object.assign({},r,t))):s.push(ie.graphicService.creator.polygon(i?t:Object.assign({},r,t)))});return i&&_p(t,s,e),s},_m=(t,e,i,s)=>"function"==typeof t?t(e,i,s):t,__=(t,e,i,s,r)=>{var a,n,l,o;let h,u,d,c,p,g={prev:t.map(t=>{var e,i;return null==(i=null==(e=t.context)?void 0:e.data)?void 0:i[0]}),next:e.map(t=>{var e,i;return null==(i=null==(e=t.context)?void 0:e.data)?void 0:i[0]})},f={prev:t.slice(),next:e.slice()},m=null!=(a=i.animation)?a:{},_=m.easing,y=_m(m.delay,r,g,f),v=_m(m.duration,r,g,f),b=_m(m.oneByOne,r,g,f),x=_m(m.splitPath,r,g,f),S=eP(b)&&b>0?t=>ed(b)?t*b:!0===b?t*v:0:void 0;1!==t.length&&0!==t.length||1!==e.length?1===t.length&&e.length>1?(n=t[0],l={delay:y,duration:v,easing:_,onEnd:s,individualDelay:S,splitPath:x},(h=e.filter(t=>
2t&&t.toCustomPath&&t.valid)).length||__DEV__&&console.error(h," is not validate"),n.valid&&n.toCustomPath||__DEV__&&console.error(n," is not validate"),u=("clone"===(null==l?void 0:l.splitPath)?_g:null!=(o=null==l?void 0:l.splitPath)?o:_f)(n,h.length,!1),d=null==l?void 0:l.onEnd,c=h.length,p=()=>{0==--c&&d&&d()},h.forEach((t,e)=>{var i;let s=u[e],r=(null!=(i=null==l?void 0:l.delay)?i:0)+((null==l?void 0:l.individualDelay)?l.individualDelay(e,h.length,s,t):0);_u(s,t,Object.assign({},l,{onEnd:p,delay:r}),n.globalTransMatrix)})):t.length>1&&1===e.length&&((t,e,i)=>{var s,r,a;let n=t.filter(t=>t.toCustomPath&&t.valid);n.length||__DEV__&&console.error(t," is not validate"),e.valid&&e.toCustomPath||__DEV__&&console.error(e," is not validate");let l=("clone"===(null==i?void 0:i.splitPath)?_g:null!=(s=null==i?void 0:i.splitPath)?s:_f)(e,n.length,!0),o=e.attribute;e.setAttribute("visible",!1);let h=n.map((t,e)=>_n(t.toCustomPath(),l[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:l[e].globalTransMatrix})),u=n.map((t,e)=>_o(t.attribute,o));if(null==i?void 0:i.individualDelay){let s=i.onEnd,r=n.length,a=()=>{0==--r&&(e.setAttributes({visible:!0,ratio:null},!1,{type:hy.ANIMATE_END}),e.detachShadow(),s&&s())};l.forEach((e,s)=>{var r,l,o;let d=(null!=(r=i.delay)?r:0)+i.individualDelay(s,n.length,t[s],e),c=e.animate(Object.assign({},i,{onEnd:a}));c.wait(d),c.play(new _h({morphingData:h[s],saveOnEnd:!0,otherAttrs:u[s]},null!=(l=i.duration)?l:1e3,null!=(o=i.easing)?o:_i))})}else{let t=null==i?void 0:i.onEnd,s=i?Object.assign({},i):{};s.onEnd=()=>{e.setAttribute("visible",!0,!1,{type:hy.ANIMATE_END}),e.detachShadow(),t&&t()};let n=e.animate(s);(null==i?void 0:i.delay)&&n.wait(i.delay),n.play(new _d({morphingData:h,otherAttrs:u},null!=(r=null==i?void 0:i.duration)?r:1e3,null!=(a=null==i?void 0:i.easing)?a:_i))}})(t,e[0],{delay:y,duration:v,easing:_,onEnd:s,individualDelay:S,splitPath:x}):_u(t[0],e[0],{delay:y,duration:v,easing:_,onEnd:s})},_y=(t,e)=>{let i=Math.floor(t.length/e);return Array(e).fill(0).map((s,r)=>t.slice(i*r,r===e-1?t.length:i*(r+1)))},_v=t=>{let e=t.getMarkConfig();(0,eA.A)(e.morphElementKey)&&t.getGraphics().forEach(t=>{var i,s;let r=null==(s=null==(i=t.context)?void 0:i.data)?void 0:s[0];r&&(t.context.morphKey=r[e.morphElementKey])})};var _b=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class _x extends mF{commit(t,e){e&&this.getMarks().length>0&&this.getMarks().forEach(t=>t.commit(!1,e)),this._isCommited=!0,t&&this.getCompiler().renderNextTick()}uncommit(){this._isCommited=!1}isCommited(){return this._isCommited}getMarkConfig(){return this._markConfig}setMarkConfig(t){Object.keys(t).forEach(e=>{this._markConfig[e]=t[e]})}getVisible(){return this._visible}setVisible(t){this._visible=t}getUserId(){return this._userId}setUserId(t){(0,eA.A)(t)&&(this._userId=t)}getDataView(){var t;return null==(t=this._data)?void 0:t.getDataView()}setDataView(t){(0,eE.A)(this._data)&&this.initMarkData(this._option),this._data.setDataView(t)}getData(){return this._data}setData(t){this._data=t,t&&t.addRelatedMark(this)}hasState(t){return t in this.state.getStateMap()}getState(t){return this.state.getStateMap()[t]}getAnimationConfig(){return this._animationConfig}setAnimationConfig(t){let e="group"===this.type?{selfOnly:!0}:{},i=t=>{var i;let s=null!=(i=t.options)?i:{};return Object.assign(Object.assign(Object.assign({},e),t),{options:(t,e,i)=>{var r,a;let n="function"==typeof s?s(t,e,i):s;if(e&&e.context&&e.context.compiler&&(0,eA.A)(e.context.modelId)){let t=null==(r=e.context.compiler.getChart())?void 0:r.getModelById(e.context.modelId);return Object.assign(Object.assign({},n),{layoutRect:null==(a=null==t?void 0:t.getLayoutRect)?void 0:a.call(t)})}return Object.assign({},n)}})},s={};Object.keys(t).forEach(e=>{let r=t[e];(0,ev.A)(r)?s[e]=r.map(i):(0,eA.A)(r)&&(s[e]=i(r))}),this._animationConfig=s}disableAnimationByState(t){let e=oS(t);this._disabledAnimationStates=[...new Set([...this._disabledAnimationStates,...e])]}enableAnimationByState(t){let e=oS(t);this._disabledAnimationStates=this._disabledAnimationStates.filter(t=>!e.includes(t))}setSkipBeforeLayouted(t){this._skipBeforeLayouted=t}setGroupKey(t){this._groupKey=t}getProduct(){return this._product}initMarkData(t){this._data=new mz(t),this._data.addRelatedMark(this)}_compileProduct(t){this.commit(),this._context=null==t?void 0:t.context;let e=this.getProduct();if(this._visible){if((0,eA.A)(e))t.group&&e.parent!==t.group&&t.group.appendChild(e);else{if(!this.getCompiler().isInited)return;this._initProduct(null==t?void 0:t.group)}(0,eE.A)(this._product)||(this.compileData(),this.compileState(),this.compileEncode())}else(0,eA.A)(e)&&this.removeProduct()}_initProduct(t){var e;if(!this.getStage())return;let i=this.getProductId();this._product=n2("group"!==this.type?{pickable:!1,zIndex:this._markConfig.zIndex,overflow:this._markConfig.overflow}:{}),this._product.name=i,this._product.mark=this,(null!=t?t:null==(e=this.getCompiler())?void 0:e.getRootGroup()).appendChild(this._product),this._compiledProductId=i}generateProductId(){return this._userId?`${this._userId}`:`${this.name}_${this.id}`}layout(t){}compileData(){(0,eE.A)(this._data)||this._data.compile()}compileEncode(){}compileState(){}compileAnimation(){}compileContext(t){this._context=Object.assign({markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},t)}getContext(){return this._context}compileTransform(){}updateState(t,e){return this.commit(),this.state.updateState(t,e)}getMarks(){return[]}runAnimationByState(t){}stopAnimationByState(t){}pauseAnimationByState(t){}resumeAnimationByState(t){}removeProduct(){this._product&&this._product.parent&&this._product.parent.removeChild(this._product),this._product=null,this._compiledProductId=null}release(){this.state.release(),super.release(),this._lastMark=null}setSimpleStyle(t){this._simpleStyle=t}getSimpleStyle(){return this._simpleStyle}constructor(t,e){var i;super(e),this.type=void 0,this.name="mark",this._markConfig={zIndex:j.Mark,morph:!1},this._visible=!0,this.stateStyle={},this._unCompileChannel={},this._disabledAnimationStates=[],this._skipBeforeLayouted=!1,this._extensionChannel={},this._computeExChannel={},this._graphicMap=new Map,this._graphics=[],this._getEncoderOfStyle=(t,e)=>{if(e&&t){let i={};
2return Object.keys(e).forEach(e=>{this._unCompileChannel[e]||(i[e]=this._computeAttribute(e,t))}),i}return null},this._setGraphicFromMarkConfig=t=>{let{setCustomizedShape:e,graphicName:i}=this._markConfig;e&&(t.pathProxy=i=>e(t.context.data,i,new sO)),i&&((0,r3.A)(i)?t.name=i(t):t.name=i)},this._setStateOfGraphic=(t,e)=>{t.clearStates(),t.stateProxy=null,t.context.diffState!==W.enter&&t.context.diffState!==W.update||(t.stateProxy=(e,i)=>{var s;return this._runEncoderOfGraphic(null==(s=this._encoderOfState)?void 0:s[e],t)},t.context.states&&t.useStates(t.context.states,e))},this.name=t,this.model=e.model,this.key=e.key,this.state=new mD(e,this),this._attributeContext=e.attributeContext,null==(i=e.map)||i.set(this.id,this)}created(){this._initStyle()}initStyleWithSpec(t){t&&((0,eA.A)(t.id)&&(this._userId=t.id),ey(t.interactive)&&(this._markConfig.interactive=t.interactive),(0,eA.A)(t.zIndex)&&(this._markConfig.zIndex=t.zIndex),ey(t.visible)&&this.setVisible(t.visible),this._markConfig.setCustomizedShape=t.customShape,this._stateSort=t.stateSort,this._initSpecStyle(t))}_transformStyleValue(t,e){if(t.scale){let i=t.scale,s=i.range();return i.range(s.map(e)),t}return"function"==typeof t?(...i)=>e(t(...i)):e(t)}convertAngleToRadian(t){return this._transformStyleValue(t,iC)}isUserLevel(t){return[N.User_Mark,N.User_Series,N.User_Chart,N.User_SeriesStyle].includes(t)}setStyle(t,e="normal",i=0){if((0,eE.A)(t))return;void 0===this.stateStyle[e]&&(this.stateStyle[e]={});let s=this.isUserLevel(i);Object.keys(t).forEach(r=>{let a=t[r];(0,eE.A)(a)||(a=this._filterAttribute(r,a,e,i,s),this.setAttribute(r,a,e,i))})}getStyle(t,e="normal"){var i;return null==(i=this.stateStyle[e][t])?void 0:i.style}_filterAttribute(t,e,i,s,r){let a=this._styleConvert(e);if(r)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=>{var e;return e=this._option.model.direction,"monotone"===t?"horizontal"===e?"monotoneY":"monotoneX":t})}return a}setReferer(t,e,i){var s;if(t)if(e&&i){let r=null!=(s=this.stateStyle[i])?s:{[e]:{}};this.stateStyle[i][e]=Object.assign(Object.assign({},r[e]),{referer:t})}else Object.entries(this.stateStyle).forEach(([e,i])=>{Object.entries(i).forEach(([i,s])=>{this.stateStyle[e][i].referer=t})})}setPostProcess(t,e,i="normal"){var s;(null==(s=this.stateStyle[i])?void 0:s[t])&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal"){return this._computeAttribute(t,i)(e)}getAttributesOfState(t,e="normal"){let i=this.stateStyle[e];if(i){let s={};
2return Object.keys(i).forEach(i=>{this._unCompileChannel[i]||(s[i]=this._computeAttribute(i,e)(t))}),s}}setAttribute(t,e,i="normal",s=0){var r;void 0===this.stateStyle[i]&&(this.stateStyle[i]={}),void 0===this.stateStyle[i][t]&&(this.stateStyle[i][t]={level:s,style:e,referer:void 0});let a=null==(r=this.stateStyle[i][t])?void 0:r.level;(0,eA.A)(a)&&a<=s&&uy(this.stateStyle[i][t],{style:e,level:s}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach(t=>{void 0===this.stateStyle[i][t]&&(this.stateStyle[i][t]=this.stateStyle.normal[t])})}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(fR[t.type]||t.scale){let e=function(t,e){var i,s;if("scale"in t&&t.scale)return(0,eS.A)(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;let r=mC(t.type);return r&&(i=r,s=t,i&&s&&(s.domain&&i.domain(s.domain),s.range&&i.range(s.range),s.specified&&i.specified&&i.specified(s.specified),s.clamp&&i.clamp&&i.clamp(s.clamp))),r}(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[t];s||(s=this.stateStyle.normal[t]);let r=this._computeStateAttribute(s,t,e),a=(0,r3.A)(null==s?void 0:s.postProcess),n=t in this._computeExChannel;if(a&&n){let i=this._computeExChannel[t];return a=>{let n=r(a);return n=s.postProcess(n,a,this._attributeContext,this.getDataView()),i(t,a,e,n)}}if(a)return t=>s.postProcess(r(t),t,this._attributeContext,this.getDataView());if(n){let i=this._computeExChannel[t];return s=>i(t,s,e,r(s))}return r}_computeStateAttribute(t,e,i){var s;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?e=>t.style(e,this._attributeContext,{mark:this},this.getDataView()):mO.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):fR[null==(s=t.style.scale)?void 0:s.type]?e=>{let i=e;return"series"===this.model.modelType&&this.model.getMarkData&&(i=this.model.getMarkData(e)),t.style.scale.scale(i[t.style.field])}:e=>t.style:e=>t.style:t=>{}}_initStyle(){let t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t){t.style&&this.setStyle(t.style,"normal",N.User_Mark);let e=t.state;e&&Object.keys(e).forEach(t=>{let i=e[t];if("style"in i){let e=i.style,s={stateValue:t};"level"in i&&(s.level=i.level),"filter"in i&&(s=(0,r3.A)(i.filter)?Object.assign({filter:i.filter},s):Object.assign(Object.assign({},i.filter),s)),this.state.addStateInfo(s),this.setStyle(e,t,N.User_Mark)}else this.setStyle(i,t,N.User_Mark)})}_computeGradientAttr(t){var e,i,s,r,a;let{gradient:n,scale:l,field:o}=t,h=_b(t,["gradient","scale","field"]),u=l,d=o;if(!(l&&o||"series"!==this.model.modelType)){let{scale:t,field:e}=this.model.getColorAttribute();l||(u=t),d||(d=e)}let c=uc(ud(this.model.getColorScheme(),"series"===this.model.modelType?null==(i=(e=this.model).getSpec)?void 0:i.call(e):void 0),null!=(a=null==(r=null==(s=this.model)?void 0:s.getDefaultColorDomain)?void 0:r.call(s))?a:[]),p=Object.assign(Object.assign({},mR[n]),h);return t=>{let e={},i=this.getDataView();return Object.keys(p).forEach(s=>{let r=p[s];"stops"===s?e.stops=r.map(e=>{let{opacity:s,color:r,offset:a}=e,n=null!=r?r:null==u?void 0:u.scale(t[d]);return(0,r3.A)(r)&&(n=r(t,this._attributeContext,i)),(0,eA.A)(s)&&(n=un.SetOpacity(n,s)),{offset:(0,r3.A)(a)?a(t,this._attributeContext,i):a,color:n||c[0]}}):(0,r3.A)(r)?e[s]=r(t,this._attributeContext,i):e[s]=r}),e.gradient=n,e}}_computeBorderAttr(t){let{scale:e,field:i}=t,s=_b(t,["scale","field"]);return t=>{var r,a,n;let l={};if(Object.keys(s).forEach(e=>{let i=s[e];(0,r3.A)(i)?l[e]=i(t,this._attributeContext,this.getDataView()):l[e]=i}),"stroke"in l)mO.includes(null==(n=s.stroke)?void 0:n.gradient)&&(l.stroke=this._computeGradientAttr(s.stroke)(t));else{let s=uc(ud(this.model.getColorScheme(),"series"===this.model.modelType?null==(a=(r=this.model).getSpec)?void 0:a.call(r):void 0),this.model.getDefaultColorDomain()),n=e,o=i;
2if(!(e&&i||"series"!==this.model.modelType)){let{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}}_getDataByKey(t){return pN(t,(t,e)=>{var i;return`${this._groupKeyGetter(t)}_${null!=(i=this._keyGetter(t))?i:e}`})}_getCommonContext(){return{compiler:this.getCompiler(),markType:this.type,markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId}}prepareMorph(t){this._lastMark=t}reuse(t){this.type===t.type&&(this._product=t.getProduct(),this._product&&(this._product.clearStates(),this._graphics=t.getGraphics(),this._graphics.forEach(t=>{t.clearStates()}),this._graphicMap=t._graphicMap,this._graphicMap.forEach(t=>{t.context=Object.assign(Object.assign({},t.context),this._getCommonContext())}),this._dataByKey=t._dataByKey,this._prevDataByKey=t._prevDataByKey,this.needClear=t.needClear))}_parseProgressiveContext(t){let e=this._markConfig.progressiveStep>0&&this._markConfig.progressiveThreshold>0&&this._markConfig.progressiveStep<this._markConfig.progressiveThreshold,i=this._markConfig.large&&this._markConfig.largeThreshold>0&&t.length>=this._markConfig.largeThreshold;if(e){let e=this._dataByGroup;return e&&e.keys&&e.keys.some(t=>e.data.get(t).length>this._markConfig.progressiveThreshold)?{large:i,progressive:{data:t,step:this._markConfig.progressiveStep,currentIndex:0,totalStep:e.keys.reduce((t,i)=>Math.max(Math.ceil(e.data.get(i).length/this._markConfig.progressiveStep),t),1),groupedData:e.data}}:{large:i}}return{large:i}}getGraphics(){return this._graphics}_createGraphic(t={}){return uP.createGraphicComponent(this.type,t)}_runGroupData(t){this._keyGetter=(0,r3.A)(this.key)?this.key:(0,eA.A)(this.key)?t=>null==t?void 0:t[this.key]:t=>null==t?void 0:t[pA],this._groupKeyGetter=(0,eA.A)(this._groupKey)?t=>`${null==t?void 0:t[this._groupKey]}`:()=>"key",this._dataByGroup=pN(t,this._groupKeyGetter)}getAnimationState(){let t=this._graphics.map(t=>t.context.animationState),e=t.every(t=>t===F.appear)?F.appear:t.every(t=>t===F.disappear)?F.disappear:t[0];return null!=e?e:F.none}createAnimationStateList(t,e){var i;let s=e[t];return s&&Array.isArray(s)&&(s=1===s.length?s[0]:s),Array.isArray(s)?s.map((t,e)=>{var i;return Object.assign(Object.assign({},t),{priority:null!=(i=t.priority)?i:1/0})}):s?Object.assign(Object.assign({},s),{priority:"normal"===t?null!=(i=s.priority)?i:1/0:s.priority}):s}tryRunMorphing(t){if(this._lastMark){t.forEach(t=>{"appear"!==t.context.animationState&&"enter"!==t.context.animationState||t.setAttributes(t.getAttributes(!0))});let e=((t,e,i={})=>{let s=[],r=[];t.forEach(t=>{_v(t),s.push(...t.getGraphics())}),e.forEach(t=>{_v(t),r.push(...t.getGraphics())});let a=t=>{var e,i,s;return null!=(i=null==(e=t.context)?void 0:e.morphKey)?i:null==(s=t.context)?void 0:s.key},n=new Map,l=new Map;if(s.forEach(t=>{let e=a(t);e&&(n.has(e)||n.set(e,[]),n.get(e).push(t))}),r.forEach(t=>{let e=a(t);e&&(l.has(e)||l.set(e,[]),l.get(e).push(t))}),n.size!==l.size||!Array.from(n.keys()).every(t=>l.has(t)))return!1;let o=[...new Set([...n.keys()].filter(t=>l.has(t)))],h=[...l.keys()].filter(t=>!n.has(t)),u=0,d=()=>{0==(u-=1)&&e.forEach(t=>{})};return h.forEach(t=>{__([],l.get(t),i,d,{}),u+=1}),o.forEach(t=>{let e=n.get(t),s=l.get(t),r=Math.min(e.length,s.length);if(r>0){let t=_y(e,r),a=_y(s,r);for(let e=0;e<r;e++)__(t[e],a[e],i,d,{}),u+=1}}),0===u&&d(),!0})([this._lastMark],[this],{});return this._lastMark=null,e}return!1}_runStateAnimation(t){var e,i;if(!this._animationConfig||0===t.length||this.tryRunMorphing(t))return;let s=this.getAnimationConfig();if(null!=(e=this._markConfig.useSequentialAnimation)&&e&&this._runSequentialAnimations)return void this._runSequentialAnimations(t);let r=t.every(t=>"appear"===t.context.animationState),a=this.createAnimationStateList("appear",s);if(r&&this._product){let t=a?["appear"]:[],e=a?[{name:"appear",animation:a}]:[];if(s.normal){t.push("normal");let i={name:"normal",animation:this.createAnimationStateList("normal",s)};e.push(i)}this._product.applyAnimationState(t,e)}let n=!1;if(t.forEach(t=>{let e=t.context.animationState;if("appear"===e)return;let i=s[e];if(i&&i.length>0){let s=i.map((t,i)=>({name:`${e}_${i}`,animation:t}));
2s.forEach(e=>{e.animation.customParameters=t.context});let r=[e];t.applyAnimationState(r,[1===s.length?s[0]:s])}"enter"===e&&s.normal&&(n=!0)}),n&&this._product&&(null==(i=s.normal)?void 0:i.length)){this._product.stopAnimationState("normal","start");let t={name:"normal",animation:this.createAnimationStateList("normal",s)};this._product.applyAnimationState(["normal"],[t])}}_setAnimationState(t){var e,i,s;let r=(("component"===this.type?this.model.getAnimationStateCallback():null==(s=null==(i=(e=this.model).getRegion)?void 0:i.call(e))?void 0:s.getAnimationStateCallback())||(t=>{var e;let i=null==(e=t.context)?void 0:e.diffState;return i===F.exit?F.exit:i===F.update?F.update:F.appear}))(t);t.context.animationState=null!=r?r:t.context.diffState,t.context.animationState===W.exit&&(t.context.reusing=!0,t.animates&&t.animates.forEach(t=>t.stop()))}_runJoin(t){let e=this._getDataByKey(t),i=this._prevDataByKey,s=[],r=new Set(this._graphics.filter(t=>t.context.diffState===W.enter)),a=(t,e,i)=>{var a,n,l,o,h,u,d,c,p;let g,f;return(0,eE.A)(e)?(g=this._graphicMap.get(t))&&(f=W.exit):(0,eE.A)(i)?(g=this._graphicMap.has(t)?this._graphicMap.get(t):{},f=W.enter,g.isExiting=!1,this._graphicMap.set(t,g),s.push(g)):(g=this._graphicMap.get(t))&&(f=W.update,s.push(g)),g&&(r.delete(g),g.context=Object.assign(Object.assign({},this._getCommonContext()),{diffState:f,reusing:null==(a=g.context)?void 0:a.reusing,originalFieldX:null==(n=g.context)?void 0:n.originalFieldX,originalFieldY:null==(l=g.context)?void 0:l.originalFieldY,fieldX:null==(o=g.context)?void 0:o.fieldX,fieldY:null==(h=g.context)?void 0:h.fieldY,data:null!=e?e:null==(u=g.context)?void 0:u.data,uniqueKey:t,key:e?this._keyGetter(e[0]):null==(d=g.context)?void 0:d.key,groupKey:e?this._groupKeyGetter(e[0]):null==(c=g.context)?void 0:c.groupKey,indexKey:"__VCHART_DEFAULT_DATA_INDEX",stateAnimateConfig:null==(p=this.getAnimationConfig())?void 0:p.state}),this._setAnimationState(g)),g};if(i&&e){let t=new Map(i.data);e.keys.forEach(i=>{a(i,e.data.get(i),t.get(i)),t.delete(i)}),i.keys.forEach(e=>{t.has(e)&&a(e,null,t.get(e))})}else e?e.keys.forEach(t=>{let i=a(t,e.data.get(t),null);i&&(i.context.animationState=F.appear)}):i&&i.keys.forEach(t=>{a(t,null,i.data.get(t)).context.animationState=F.disappear});r.forEach(t=>{this._graphicMap.delete(t.context.uniqueKey),t.parent&&t.parent.removeChild(t),t.release()});let n=s.length;s.forEach((t,e)=>{t.context.graphicCount=n,t.context.graphicIndex=e,t.stateSort=this._stateSort}),this._dataByKey=e,this._graphics=s,this.needClear=!0}_runEncoderOfGraphic(t,e,i={}){return pW(t,e.context.data[0],i)}_runGroupEncoder(t){if(!this._dataByGroup)return null;let e={};return this._dataByGroup.keys.forEach(i=>{e[i]=pW(t,this._dataByGroup.data.get(i)[0])}),this._attrsByGroup=e,e}_transformGraphicAttributes(t,e,i){return Object.assign(Object.assign({},i),e)}_separateNormalStyle(t){let e={},i={};return Object.keys(t).forEach(s=>{var r,a,n,l;let o;this._unCompileChannel[s]||(this._option.noSeparateStyle||(r=this._groupKey,o=null==(a=t[s])?void 0:a.style,n=s,l=o,("fill"===n||"stroke"===n)&&(null==l?void 0:l.gradient)&&(null==l?void 0:l.stops)||(0,r3.A)(o)||!(!(null==o?void 0:o.scale)||o.field===r))?e[s]=t[s]:i[s]=t[s])}),{updateStyles:e,groupStyles:i}}_addProgressiveGraphic(t,e){t.incrementalAppendChild(e)}_runEncoder(t,e){var i;let s=e?null:this._runGroupEncoder(null==(i=this._encoderOfState)?void 0:i.group);t.forEach((t,e)=>{var i,r;let a=this._runEncoderOfGraphic(null==(i=this._encoderOfState)?void 0:i.update,t);null==(r=t.currentStates)||r.forEach(e=>{var i;let s=this._runEncoderOfGraphic(null==(i=this._encoderOfState)?void 0:i[e],t);a=Object.assign(Object.assign({},a),s)}),(0,eE.A)(this._markConfig.interactive)||(a.pickable=this._markConfig.interactive);let n=this._transformGraphicAttributes(t,a,null==s?void 0:s[t.context.groupKey]);t.context.finalAttrs=n})}_runApplyGraphic(t){let e=this.hasAnimation();t.forEach((i,s)=>{var r,a,n;let l=i.context.finalAttrs,o=this.hasAnimationByState(i.context.animationState);if(i.setAttributes){let t=u5(i,l);i.context.diffAttrs=t,i.context.reusing?(i.context.lastAttrs=i.attribute,i.initAttributes({}),i.context.reusing=!1):o||(e?i.setAttributesAndPreventAnimate(t):i.setAttributes(t)),(null==(n=this.renderContext)?void 0:n.progressive)||!this._product||i.parent===this._product||this._product.appendChild(i),e&&i.setFinalAttributes(l)}else{let n=i;i=this._createGraphic(l),e&&(null==(r=i.setFinalAttributes)||r.call(i,l)),i.context=n.context,i.context.diffAttrs=l,i.stateSort=this._stateSort;let o=this._graphics===t?s:s+this._graphics.length-t.length;if(o>=0&&(this._graphics[o]=i),null==(a=this.renderContext)?void 0:a.progressive){let t=this._dataByGroup?this._dataByGroup.keys.indexOf(i.context.groupKey):0,e=t>=0?this._product.getChildAt(t):null;e&&this._addProgressiveGraphic(e,i)}else this._product.appendChild(i),this._graphicMap.set(i.context.uniqueKey,i)}this._setStateOfGraphic(i,o),this._setGraphicFromMarkConfig(i)})}_updateEncoderByState(){let t={};
2Object.keys(this.stateStyle).forEach(e=>{if(e===U.STATE_NORMAL){let{groupStyles:i,updateStyles:s}=this._separateNormalStyle(this.stateStyle[e]);t.group=this._getEncoderOfStyle(e,i),t.update=this._getEncoderOfStyle(e,s)}else t[e]=this._getEncoderOfStyle(e,this.stateStyle[e])}),this._encoderOfState=t}_runState(t){t.forEach(t=>{var e;let i=[...(null!=(e=t.currentStates)?e:[]).filter(t=>!this.state.getStateInfo(t)),...this.state.checkState(t,t.context.data)];this._stateSort&&i.length&&i.sort(this._stateSort),t.context.states=i})}_getAttrsFromConfig(t={}){let{zIndex:e,clip:i,clipPath:s,overflow:r}=this._markConfig;if((0,eE.A)(e)||(t.zIndex=e),(0,eE.A)(i)||(t.clip=i),!(0,eE.A)(s)){let e=(0,ev.A)(s)?s:s(this._graphics);e&&e.length||(t.clip=!1),t.path=e}return(0,eE.A)(r)||(t.overflow=r),t}_updateAttrsOfGroup(){var t;let e=this._getAttrsFromConfig();null==(t=this._product)||t.setAttributes(e),this._markConfig.support3d&&this._product&&this._product.setMode("3d")}_runBeforeTransform(t){var e;let i=null==(e=this._transform)?void 0:e.filter(t=>{if(t.type){let e=uP.getGrammarTransform(t.type);return e&&(!e.runType||"beforeJoin"===e.runType)}return!1});return this.runTransforms(i,t)}_runEncoderTransform(t,e){var i;let s=null==(i=this._transform)?void 0:i.filter(t=>{if(t.type){let i=uP.getGrammarTransform(t.type);return i&&"afterEncode"===i.runType&&!!i.canProgressive===e}return!1});return this.runTransforms(s,t)}renderInner(){var t,e,i;let s;this._updateEncoderByState();let r=null!=(e=null==(t=this._data)?void 0:t.getProduct())?e:[{}],a=this._runBeforeTransform(r);if(null==a?void 0:a.progressive){this.renderContext={beforeTransformProgressive:a.progressive};let t=a.progressive;if(t.canAnimate&&t.canAnimate()&&t.unfinished())return void this._updateAttrsOfGroup();s=t.output()}else s=oS(a),this._runGroupData(s),this.renderContext=this._parseProgressiveContext(s);(null==(i=this.renderContext)?void 0:i.progressive)?(this._graphicMap.clear(),this._runProgressiveStep()):(this._runJoin(s),this._runState(this._graphics),this._runEncoder(this._graphics),this._runEncoderTransform(this._graphics,!1),this._runApplyGraphic(this._graphics)),this._updateAttrsOfGroup()}render(){this.isCommited()&&(!this.getVisible()||this._skipBeforeLayouted&&this.getCompiler().getLayoutState()===z.before||(this._product||this._initProduct(),h1(`render mark: ${this.getProductId()}, type is ${this.type}`),this.renderInner()),this.uncommit())}updateMarkState(t){if(!this._product)return;let e=this.state.getStateInfo(t);this._graphics.forEach(i=>{"in"===this.state.checkOneState(i,i.context.data,e)?i.addState(t,!0,this.hasAnimationByState("state")):i.removeState(t,this.hasAnimationByState("state"))})}clearExitGraphics(){this._prevDataByKey=this._dataByKey;let t=(t,e)=>{this._graphicMap.delete(e),t.parent&&t.parent.removeChild(t),t.release&&t.release()};this._graphicMap.forEach((e,i)=>{if(e.context.diffState===W.exit&&!e.isExiting)if(e.context.animationState===W.exit&&this.hasAnimationByState("exit")){e.isExiting=!0;let s=this.getAnimationConfig();if(s.exit&&s.exit.length){let r=s.exit.map((t,i)=>({name:`exit_${i}`,animation:Object.assign(Object.assign({},t),{customParameters:e.context})}));e.applyAnimationState(["exit"],[1===r.length?r[0]:r],()=>{t(e,i)})}}else t(e,i)})}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}canAnimateAfterProgressive(){var t,e;return this.renderContext&&this.renderContext.beforeTransformProgressive&&(null==(e=(t=this.renderContext.beforeTransformProgressive).canAnimate)?void 0:e.call(t))}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex<this.renderContext.progressive.totalStep||this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.unfinished())}clearProgressive(){this.renderContext&&this.renderContext.progressive&&(this._graphics=[],this._product.children.forEach(t=>{t.incrementalClearChild()}),this._product.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}_runBeforeProgressive(){var t;let e=this.renderContext.beforeTransformProgressive;e.progressiveRun();let i=e.output();if(null==(t=e.canAnimate)?void 0:t.call(e)){if(e.unfinished())return;this._runGroupData(i),this._runJoin(i),this._runState(this._graphics),this._runEncoder(this._graphics),this._runApplyGra
2phic(this._graphics)}}_runProgressiveJoin(){let t=this.renderContext.progressive.currentIndex,e=[],i={};return this._dataByGroup.keys.forEach(s=>{let r=this.renderContext.progressive.groupedData.get(s),a=this.renderContext.progressive.step,n=r.slice(t*a,(t+1)*a),l=[];n.forEach((i,r)=>{let n=this._keyGetter(i),o={context:Object.assign(Object.assign({},this._getCommonContext()),{diffState:W.enter,data:[i],uniqueKey:`${s}_${null!=n?n:t*a+r}`,key:n,groupKey:s})};l.push(o),e.push(o)}),i[s]=l}),{graphicsByGroup:i,graphics:e,needUpdate:!0}}_createIncrementalGraphics(){this._product.removeAllChild(),this._dataByGroup.keys.forEach(t=>{let e=n2({pickable:!1,zIndex:this._markConfig.zIndex});e.incremental=this.renderContext.progressive.step,this._product.appendChild(e)})}_setCommonAttributesToTheme(t){var e,i,s;if(this._attrsByGroup&&t){let r=t.parent;r&&(null==(e=this._attrsByGroup)?void 0:e[null==(i=t.context)?void 0:i.groupKey])&&r.setTheme({common:this._attrsByGroup[null==(s=t.context)?void 0:s.groupKey]})}}_runProgressiveEncoder(t){0===this.renderContext.progressive.currentIndex?this._runEncoder(t):this._runEncoder(t,!0)}_runProgressiveApplyGraphic(t){0===this.renderContext.progressive.currentIndex?(this._runApplyGraphic(t),this._setCommonAttributesToTheme(t[0])):this._runApplyGraphic(t)}_runProgressiveStep(){let{graphics:t,graphicsByGroup:e,needUpdate:i}=this._runProgressiveJoin();0===this.renderContext.progressive.currentIndex?(this._createIncrementalGraphics(),this._graphics=t):i&&t.forEach(t=>{this._graphics.push(t)}),this._runState(t),Object.keys(e).forEach(t=>{this._runProgressiveEncoder(e[t])}),this._runEncoderTransform(this._graphics,!0),Object.keys(e).forEach(t=>{this._runProgressiveApplyGraphic(e[t])}),this.renderContext.progressive.currentIndex+=1}renderProgressive(){var t;(null==(t=this.renderContext)?void 0:t.beforeTransformProgressive)?this._runBeforeProgressive():this.renderContext.progressive&&this._runProgressiveStep()}hasAnimationByState(t){if(!t||!this._animationConfig||!this._animationConfig[t]||this._disabledAnimationStates.includes(t))return!1;let e=this._animationConfig[t];return e.length>0||r2(e)}hasAnimation(){return!!this._animationConfig&&Object.keys(this._animationConfig).length>0}runAnimation(){this._runStateAnimation(this.getGraphics())}clearBeforeReInit(){this.state.clearAllStateInfo(),this.uncommit(),this.stateStyle={},this.getGraphics().forEach(t=>{t.clearStates()})}}class _S extends n1{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()){let 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){let 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 _A(t){return new _S(t)}function _k(){_k.__loaded||(_k.__loaded=!0,lF.RegisterGraphicCreator("shadowRoot",_A))}_k.__loaded=!1;class _M extends _x{constructor(){super(...arguments),this.type=_M.type,this._marks=[],this._diffState=W.enter}getMarks(){return this._marks}isMarkExist(t){return void 0!==this._marks.find(e=>e.id===t.id)}addMark(t){return this.isMarkExist(t)?(h2("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){let e=this._marks.findIndex(e=>e.id===t.id||e.name===t.name);return -1===e?(h2("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)}getMarkInUserId(t){let e;return pU(this,t=>{e=t},e=>e.getUserId()===t,null,!0),e}getMarkInName(t){return this._marks.filter(e=>e.name===t)}_compileProduct(t){super._compileProduct(t),this.getMarks().forEac
2h(t=>{t.compile({group:this._product})})}_getAttrsFromConfig(t={}){let e=super._getAttrsFromConfig(t);return(0,eE.A)(this._markConfig.interactive)||(e.pickable=this._markConfig.interactive),t}getGraphics(){return[this._product]}renderInner(){var t;if(!this._product)return;let e=null!=(t=this._simpleStyle)?t:this.getAttributesOfState({});this._product.context=Object.assign(Object.assign(Object.assign({},this._product.context),this._getCommonContext()),{diffState:this._diffState}),this._setAnimationState(this._product);let i=this._getAttrsFromConfig(e);if(this._product.context.diffState===W.update){let t=this.hasAnimation(),e=u5(this._product,i);this._product.context.diffAttrs=e,this.hasAnimationByState(this._product.context.animationState)||(t?this._product.setAttributesAndPreventAnimate(e):this._product.setAttributes(e)),t&&this._product.setFinalAttributes(i)}else this._product.setAttributes(i);this.needClear=!0}clearExitGraphics(){this._diffState=W.update}render(){this._isCommited&&(h1(`render mark: ${this.getProductId()}, type is ${this.type}`),this.renderInner(),this.uncommit()),this.getMarks().forEach(t=>{t.render()})}release(){super.release(),this.removeProduct()}}_M.type="group";let _w=()=>{_k(),p1(),uP.registerMark(_M.type,_M)},_T=-.5*Math.PI,_C=1.5*Math.PI,_B="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";(L=q||(q={})).selected="selected",L.selectedReverse="selected_reverse",L.hover="hover",L.hoverReverse="hover_reverse";let _E={[q.selectedReverse]:{},[q.selected]:{},[q.hover]:{},[q.hoverReverse]:{}},_P={container:"",width:30,height:30,style:{}},_O="scrollDrag",_R=(t,e,i,s)=>new ru(Object.assign({defaultFontParams:Object.assign({fontFamily:_B,fontSize:14},s),getTextBounds:i?void 0:p8,specialCharSet:"-/: .,@%'\"~"+ru.ALPHABET_CHAR_SET+ru.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function _I(t,e,i={}){if(!t)return{width:0,height:0};let s=p8({text:t,fontFamily:e.fontFamily||i.fontFamily||_B,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 _L(t,e="type"){var i,s;return r2(t.text)&&"type"in t.text?null!=(i=t.text.type)?i:"text":e in t&&null!=(s=t[e])?s:"text"}function _D(t){var e,i;return(0,eA.A)(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!=(e=t.width)?e:0,t.height=null!=(i=t.height)?i:0,t.textConfig=t.text.text||t.text,t}function _F(t,e="type"){let i=_L(t,e);return"rich"===i?lF.richtext(_D(t)):("html"===i?t=function(t){let{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){let{text:e,_originText:i}=t,{text:s}=e;return t.react=s,t.text=i,t.renderable=!1,t}(t)),lF.text(t))}function _z(t,e,i,s,r){"right"===t?"center"===i?e.setAttribute("x",s-r/2):"right"===i||"end"===i?e.setAttribute("x",s):e.setAttribute("x",s-r):"center"===i?e.setAttribute("x",s+r/2):"right"===i||"end"===i?e.setAttribute("x",s+r):e.setAttribute("x",s)}class _H{static instance(){return _H.instance_||(_H.instance_=new _H),_H.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)}}class _j{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}set nativeCanvas(t){this._nativeCanvas=t}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=500,height:r=500,dpr:a=1,x:n,y:l,id:o,canvasControled:h=!0}=t;this._x=null!=n?n:0,this._y=null!=l?l:0,this._pixelWidth=s*a,this._pixelHeight=r*a,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=r,this._dpr=a,this._nativeCanvas=i,this._id=null!=(e=i.id)?e:o,o&&(i.id=o),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}
2readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw Error("ææªå®ç°")}transferToImageBitmap(){throw Error("ææªå®ç°")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}_j.env="browser";class _V{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){let{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:s=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let a=0,n=e=>{a++,t.delete(e)},l=Date.now();return t.forEach((t,e)=>{if(t.timestamp.length<r)return n(e);let i=0;for(;l-t.timestamp[t.timestamp.length-1-i]<s&&!(++i>=r););if(i<r)return n(e);for(;l-t.timestamp[0]>s;)t.timestamp.shift()}),a}addLimitedTimestamp(t,e,i){let{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){let{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){let{L_TIME:i=this.L_TIME}=e,s=Date.now();for(;s-t.timestamp[0]>i;)t.timestamp.shift()}}class _N{static GetCanvas(){try{return _N.canvas||(_N.canvas=ie.global.createCanvas({})),_N.canvas}catch(t){return null}}static GetCtx(){if(!_N.ctx){let t=_N.GetCanvas();_N.ctx=t.getContext("2d")}return _N.ctx}}class _W extends _V{static getInstance(){return _W._instance||(_W._instance=new _W),_W._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=_N.GetCanvas(),s=_N.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw Error("è·åctxåçé误");const r=s.createLinearGradient(0,0,e,0);t.forEach(t=>{r.addColorStop(t[0],t[1])}),s.fillStyle=r,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){let 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,r=[],a=100){let n=`${t}${e}${i}${s}`;r.forEach(t=>n+=t.join()),n+=a;let l=this.dataMap.get(n);return l||(l={data:new _W(r,a),timestamp:[]},this.addLimitedTimestamp(l,Date.now(),{}),this.dataMap.set(n,l)),this.clearCache(this.dataMap,this.cacheParams),l.data}}class _U{static GetSize(t){for(let e=0;e<_U.ImageSize.length;e++)if(_U.ImageSize[e]>=t)return _U.ImageSize[e];return t}static Get(t,e,i,s,r,a,n){let l=_U.GenKey(t,e,i,s,r),o=_U.cache[l];if(!o||0===o.length)return null;for(let t=0;t<o.length;t++)if(o[t].width>=a&&o[t].height>=n)return o[t].pattern;return null}static Set(t,e,i,s,r,a,n,l){let o=_U.GenKey(t,e,i,s,r);_U.cache[o]?_U.cache[o].push({width:n,height:l,pattern:a}):_U.cache[o]=[{width:n,height:l,pattern:a}]}static GenKey(t,e,i,s,r){return`${e},${i},${s},${r},${t.join()}`}}_U.cache={},_U.ImageSize=[20,40,80,160,320,640,1280,2560];let _G=[0,0,0],_Y=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){t!==this._font&&(this._font=t,this.nativeContext.font=t)}get font(){var t;return null!=(t=this._font)?t: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){!!this._inuse!==t&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):(this.nativeContext.restore(
2),this._font=""))}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},sL),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},sF),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},sz),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw Error("åçé误ï¼è·å2dä¸ä¸æå¤±è´¥");this.nativeContext=i,this.canvas=t,this.matrix=new iL(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new iL(1,0,0,1,0,0),this._clearMatrix=new iL(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(t=!0){this.stack.length&&eg.getInstance().warn("å¯è½åå¨bugï¼matrixæ²¡ææ¸
空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new iL(1,0,0,1,0,0),this.stack.length=0,t&&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 nV.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&&(nV.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0)),this.font="",this._clearFilterStyle=!1,this._clearShadowStyle=!1}highPerformanceRestore(){this.stack.length>0&&(nV.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){let t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){let 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,r=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,s,r,a,n=!0,l=this.dpr){this.matrix.setValue(l*t,l*e,l*i,l*s,l*r,l*a),n&&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,r,a,n=!0){this.matrix.multiply(t,e,i,s,r,a),n&&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){let 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,r,a,n){if(n=n||0,this.camera){let l=[];((t,e,i,s,r,a,n,l)=>{if(l)for(;i>e;)i-=id;else for(;i<e;)i+=id;let o=io/3*(i>e?1:-1),h=e,u=h;for(;u!==i;){let e=4*Math.tan(Math.abs((u=o>0?Math.min(u+o,i):Math.max(u+o,i))-h)/4)/3,l=u<h?-1:1,d=Math.cos(h),c=Math.sin(h),p=Math.cos(u),g=Math.sin(u),f=d*a+s,m=c*n+r,_=p*a+s,y=g*n+r,v=a*e*l,b=n*e*l;t.push([f-v*c,m+b*d,_+v*g,y-b*p,_,y]),h=u}})(l,s,r,t,e,i,i,a);for(let t=0;t<l.length;++t){let e=l[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],n)}}else this.nativeContext.arc(t,e,Math.max(0,i),s,r,a)}arcTo(t,e,i,s,r){this.nativeContext.arcTo(t,e,i,s,r)}bezierCurveTo(t,e,i,s,r,a,n){if(n=n||0,this.camera){let l=n,o=n;this.modelMatrix&&(nH(_G,[t,e,n],this.modelMatrix),t=_G[0],e=_G[1],l=_G[2],nH(_G,[i,s,n],this.modelMatrix),i=_G[0],s=_G[1],o=_G[2],nH(_G,[r,a,n],this.modelMatrix),r=_G[0],a=_G[1],n=_G[2]);let h=this.camera.vp(r,a,n);r=h.x,a=h.y,t=(h=this.camera.vp(t,e,l)).x,e=h.y,i=(h=this.camera.vp(i,s,o)).x,s=h.y}this.nativeContext.bezierCurveTo(t,e,i,s,r,a)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,s,r,a,n,l){null==l?this.nativeContext.ellipse(t,e,i,s,r,a,n):this.nativeContext.ellipse(t,e,i,s,r,a,n,l)}
2lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(nH(_G,[t,e,i],this.modelMatrix),t=_G[0],e=_G[1],i=_G[2]);let s=this.camera.vp(t,e,i);t=s.x,e=s.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(nH(_G,[t,e,i],this.modelMatrix),t=_G[0],e=_G[1],i=_G[2]);let s=this.camera.vp(t,e,i);t=s.x,e=s.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,s,r){if(r=r||0,this.camera){let a=r;this.modelMatrix&&(nH(_G,[t,e,r],this.modelMatrix),t=_G[0],e=_G[1],a=_G[2],nH(_G,[i,s,r],this.modelMatrix),i=_G[0],s=_G[1],r=_G[2]);let n=this.camera.vp(i,s,r);i=n.x,s=n.y,t=(n=this.camera.vp(t,e,a)).x,e=n.y}this.nativeContext.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+s,r),this.lineTo(t,e+s,r),this.closePath()):this.nativeContext.rect(t,e,i,s)}createImageData(){let t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,s){return isFinite(t+e+i+s)||(t=0,e=0,i=0,s=0),this.nativeContext.createLinearGradient(t,e,i,s)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,s,r,a){return this.nativeContext.createRadialGradient(t,e,i,s,r,a)}createConicGradient(t,e,i,s){if(this.nativeContext.createConicGradient&&.001>Math.abs(s-i-2*Math.PI))return this.nativeContext.createConicGradient(i,t,e);let r,a=!1,n=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),a=!0},GetPattern(l,o,h){return a&&(h||(h=s-i),r=function(t,e,i,s,r,a,n,l,o){let h=Math.floor(180*r/Math.PI),u=_N.GetCanvas(),d=_N.GetCtx();if(!d)return null;let c=_U.GetSize(l),p=_U.GetSize(o),g=_U.Get(e,i,s,a,n,c,p);if(g)return g;let f=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(s,2),Math.pow(c-i,2)+Math.pow(s,2)),Math.max(Math.pow(c-i,2)+Math.pow(p-s,2),Math.pow(i,2)+Math.pow(p-s,2)))),m=h+1,_=r/Math.max(1,m-1),y=_W.getInstance().GetOrCreate(i,s,c,p,e,m),v=2*Math.PI*f/360;u.width=c,u.height=p,d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,c,p),d.translate(i,s),d.rotate(a);for(let t=0,e=m-1;t<e&&!(a+t*_>n);t++){let e=y.getColor(t);d.beginPath(),d.rotate(_),d.moveTo(0,0),d.lineTo(f,-2*v),d.lineTo(f,0),d.fillStyle=e,d.closePath(),d.fill()}let b=d.getImageData(0,0,c,p);return u.width=b.width,u.height=b.height,d.putImageData(b,0,0),(g=t.createPattern(u,"no-repeat"))&&_U.Set(e,i,s,a,n,g,c,p),g}(n,this.stops,t,e,h,i,s,l,o),a=!1),r}}}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&&(nH(_G,[t,e,i],this.modelMatrix),t=_G[0],e=_G[1],i=_G[2]);let 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&&(nH(_G,[t,e,i],this.modelMatrix),t=_G[0],e=_G[1],i=_G[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(nH(_G,[e,i,s],this.modelMatrix),e=_G[0],i=_G[1],s=_G[2]);let 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=ie.global.measureTextMethod){var i,s;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=ie.graphicUtil.createTextMeasureInstance({},{},()=>this.canvas.nativeCanvas));let r=null!=(i=this.fontFamily)?i:sz.fontFamily,a=null!=(s=this.fontSize)?s:sz.fontSize;return this.mathTextMeasure.textSpec.fontFamily===r&&this.mathTextMeasure.textSpec.fontSize===a||(this.mathTextMeasure.textSpec.fontFamily=r,this.mathTextMeasure.textSpec.fontSize=a,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}
2putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){let 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&&(nH(_G,[e,i,s],this.modelMatrix),e=_G[0],i=_G[1],s=_G[2]);let t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){let 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,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,s,r[0]);let a=Object.create(r[0]);return r.forEach((t,e)=>{0!==e&&Object.assign(a,t)}),this._setCommonStyle(t,e,i,s,a)}return this._setCommonStyle(t,e,i,s,r)}_setCommonStyle(t,e,i,s,r){let a=this.nativeContext;r||(r=this.fillAttributes);let{fillOpacity:n=r.fillOpacity,opacity:l=r.opacity,fill:o=r.fill}=e;a.globalAlpha=n*l*this.baseGlobalAlpha,n>1e-12&&l>1e-12&&(a.fillStyle=s8(this,o,t,i,s))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);let 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){let s=this.nativeContext;i||(i=this.fillAttributes);let{opacity:r=i.opacity,shadowBlur:a=i.shadowBlur,shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:o=i.blur,globalCompositeOperation:h=i.globalCompositeOperation}=e;if(!(r<=1e-12)){if(n||l||a){let{shadowColor:t=i.shadowColor,shadowOffsetX:r=i.shadowOffsetX,shadowOffsetY:n=i.shadowOffsetY}=e;s.shadowBlur=a*this.dpr,s.shadowColor=t,s.shadowOffsetX=r*this.dpr,s.shadowOffsetY=n*this.dpr,this._clearShadowStyle=!0}else this._clearShadowStyle&&(s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0);o?(s.filter=`blur(${o}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(s.filter="blur(0px)",this._clearFilterStyle=!1),h?(s.globalCompositeOperation=h,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(s.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1)}}setStrokeStyle(t,e,i,s,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,s,r[0]);let a=Object.create(r[0]);return r.forEach((t,e)=>{0!==e&&Object.assign(a,t)}),this._setStrokeStyle(t,e,i,s,a)}return this._setStrokeStyle(t,e,i,s,r)}_setStrokeStyle(t,e,i,s,r){let a=this.nativeContext;r||(r=this.strokeAttributes);let{strokeOpacity:n=r.strokeOpacity,opacity:l=r.opacity}=e;if(a.globalAlpha=n*l*this.baseGlobalAlpha,n>1e-12&&l>1e-12){let{lineWidth:n=r.lineWidth,stroke:l=r.stroke,lineJoin:o=r.lineJoin,lineDash:h=r.lineDash,lineDashOffset:u=r.lineDashOffset,lineCap:d=r.lineCap,miterLimit:c=r.miterLimit,keepStrokeScale:p=r.keepStrokeScale}=e;a.lineWidth=p?n:s4(this,n,this.dpr),a.strokeStyle=s8(this,l,t,i,s),a.lineJoin=o,h&&(a.setLineDash(h),a.lineDashOffset=u),a.lineCap=d,a.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){let s=this.nativeContext;e||(e=this.textAttributes);let{scaleIn3d:r=e.scaleIn3d}=t;t.font?this.font=t.font:this.font=rh(t,e,r&&this.camera&&this.camera.getProjectionScale(i));let{fontFamily:a=e.fontFamily,fontSize:n=e.fontSize}=t;this.fontFamily=a,this.fontSize=n,s.textAlign="left",s.textBaseline="alphabetic"}setTextStyle(t,e,i){var s,r;let a=this.nativeContext;e||(e=this.textAttributes),t.font?this.font=t.font:this.font=rh(t,e,this.camera&&this.camera.getProjectionScale(i));let{fontFamily:n=e.fontFamily,fontSize:l=e.fontSize}=t;this.fontFamily=n,this.fontSize=l,a.textAlign=null!=(s=t.textAlign)?s:e.textAlign,a.textBaseline=null!=(r=t.textBaseline)?r:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}
2setClearMatrix(t,e,i,s,r,a){this._clearMatrix.setValue(t,e,i,s,r,a)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach(t=>nV.free(t)),this.stack.length=0}};_Y.env="browser",_Y=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],_Y);let _$=class extends _j{constructor(t){super(t)}init(t){let{container:e}=t;if("string"==typeof e){let t=ie.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new _Y(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;let{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(){let 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;let{width:e=this._displayWidth,height:i=this._displayHeight,dpr:s=this._dpr,x:r=this._x,y:a=this._y}=t,{nativeCanvas:n}=this;n.width=e*s,n.height=i*s,n.style&&this.setCanvasStyle(n,r,a,e,i),t.id&&(n.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,s,r){this.controled&&(t.style.width=`${s}px`,t.style.height=`${r}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 _X(t,e){return new eL(i=>{i(rg).toDynamicValue(()=>e=>new t(e)).whenTargetNamed(t.env),i(rf).toDynamicValue(()=>(t,i)=>new e(t,i)).whenTargetNamed(e.env)})}_$.env="browser";let _K=_X(_$=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_$),_Y);var _q=function(t,e){return function(i,s){e(i,s,t)}};let _Z=class{constructor(t,e){this.pickItemInterceptorContributions=t,this.pickServiceInterceptorContributions=e,this.type="default",this.global=ie.global}reInit(){this._init()}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((t,e)=>t.order-e.order),this.pickerServiceInterceptorContributions=this.pickServiceInterceptorContributions.getContributions().sort((t,e)=>t.order-e.order)}pick(t,e,i){let s,r={graphic:null,group:null};i.pickerService=this;let a=i.bounds.width(),n=i.bounds.height();if(!(new iJ).setValue(0,0,a,n).containsPoint(e))return r;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);let l=new iL(1,0,0,1,0,0);for(let a=t.length-1;a>=0&&!(r=t[a].isContainer?this.pickGroup(t[a],e,l,i):this.pickItem(t[a],e,l,i)).graphic;a--)s||(s=r.group);if(r.graphic||(r.group=s),this.pickContext&&(this.pickContext.inuse=!1),this.pickerServiceInterceptorContributions.length)for(let t=0;t<this.pickerServiceInterceptorContributions.length;t++){let s=this.pickerServiceInterceptorContributions[t];s.afterPickItem&&(r=s.afterPickItem(r,this,e,i,{parentMatrix:l}))}return r}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.graphic)}
2pickGroup(t,e,i,s){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;let a=s.pickContext,n=a.modelMatrix;if(a.camera){let e=t.transMatrix,i=nN.allocate();(nF(i,e),n)?i&&(a.modelMatrix=nz(nN.allocate(),n,i),nN.free(i)):(nF(i,t.globalTransMatrix),a.modelMatrix=i)}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){let l=this.InterceptorContributions[r];if(l.beforePickItem){let r=l.beforePickItem(t,this,e,s,{parentMatrix:i});if(r)return a.modelMatrix!==n&&nN.free(a.modelMatrix),a.modelMatrix=n,r}}let l=t.transMatrix,o=nV.allocateByObj(i),h=new i8(e.x,e.y);o.transformPoint(h,h);let u=t.AABBBounds.containsPoint(h);if(!u&&!t.stage.camera)return r;let d=this.pickItem(t,h.clone(),i,s);d&&d.graphic&&(r.graphic=d.graphic,r.params=d.params);let c=!1!==t.attribute.pickable&&u;return o.multiply(l.a,l.b,l.c,l.d,l.e,l.f),!1===t.attribute.childrenPickable||d&&d.graphic||lq(t,sV.zIndex,a=>{if(a.isContainer){let i=new i8(e.x,e.y),n=rQ(t).group,{scrollX:l=n.scrollX,scrollY:h=n.scrollY}=t.attribute;i.x-=l,i.y-=h,r=this.pickGroup(a,i,o,s)}else{let n=new i8(e.x,e.y);o.transformPoint(n,n);let l=rQ(t).group,{scrollX:h=l.scrollX,scrollY:u=l.scrollY}=t.attribute;n.x-=h,n.y-=u;let d=this.pickItem(a,n,i,s);d&&d.graphic&&(r.graphic=d.graphic,r.params=d.params)}return!!r.graphic||!!r.group},!0,!!a.camera),a.modelMatrix!==n&&nN.free(a.modelMatrix),a.modelMatrix=n,r.graphic||r.group||!c||t.stage.camera||(r.group=t),nV.free(o),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};_Z=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),_q(0,eU(eY)),_q(0,eG(lS)),_q(1,eU(eY)),_q(1,eG(lA)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object])],_Z);var _J=function(t,e){return function(i,s){e(i,s,t)}};let _Q=class extends _Z{constructor(t,e,i,s){super(i,s),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.pickServiceInterceptorContributions=s,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=rI.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 r=0;r<this.InterceptorContributions.length;r++){let a=this.InterceptorContributions[r];if(a.beforePickItem){let r=a.beforePickItem(t,this,e,s,{parentMatrix:i});if(r)return r}}let r=this.pickerMap.get(t.numberType);if(!r)return null;let a=r.contains(t,e,s),n=a?t:null,l={graphic:n,params:a};if(n)return l;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){let a=this.InterceptorContributions[r];if(a.afterPickItem){let r=a.afterPickItem(t,this,e,s,{parentMatrix:i});if(r)return r}}return l}};_Q=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),_J(0,eU(eY)),_J(0,eG(gC)),_J(1,eU(l_)),_J(2,eU(eY)),_J(2,eG(lS)),_J(3,eU(eY)),_J(3,eG(lA)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object,Object])],_Q);let _0=class{constructor(){this.type="group",this.numberType=nx}contains(t,e,i){return!1}};_0=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],_0);let _1=new eL((t,e,i,s)=>{_1.__vloaded||(_1.__vloaded=!0,t(gT).to(_0).inSingletonScope(),t(gC).toService(gT),eX(t,gC))});_1.__vloaded=!1;let _2=new eL((t,e,i,s)=>{i(_Q)||t(_Q).toSelf().inSingletonScope(),i(lb)?s(lb).toService(_Q):t(lb).toService(_Q)}),_3=class{constructor(){this._uid=eI.GenAutoIncrementId(),this.viewBox=new iJ,this.modelMatrix=new iL(1,
20,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){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,r,a){this.modelMatrix.setValue(t,e,i,s,r,a)}getViewBoxTransform(){return this.modelMatrix}};_3=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],_3);let _5=Z=class extends _3{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Z.idprefix}_${Z.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=ie.global,this.viewBox=new iJ,this.modelMatrix=new iL(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){let 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);let 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){let e,i=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw Error("åçé误ï¼containerIdå¯è½ä¼ å
¥æè¯¯");t.offscreen?e=null:e.appendChild(i);let s={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,container:e,id:Z.GenerateCanvasId(),canvasControled:!0};this.canvas=new _$(s)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(!(i=this.global.getElementById(t.canvas)))throw Error("canvasId 忰䏿£ç¡®ï¼è¯·ç¡®è®¤canvasåå¨å¹¶æå
¥dom")}else i=t.canvas;if(!i)throw Error("åçé误ï¼ä¼ å
¥çcanvas䏿£ç¡®");let s=t.width,r=t.height;if(null==s||null==r||!t.canvasControled){let t=i.getBoundingClientRect();s=t.width,r=t.height}let a=t.dpr;null==a&&(a=null!=(e=i.getContext("2d").pixelRatio)?e:i.width/s),this.canvas=new _$({width:s,height:r,dpr:a,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)?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){let 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){let e=this.viewBox,i=this.getContext(),s=this.getDpr();
2i.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)}};_5.env="browser",_5.idprefix="visactor_window",_5.prefix_count=0,_5=Z=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],_5);let _4=new eL(t=>{t(_5).toSelf(),t(rH).toDynamicValue(t=>t.container.get(_5)).whenTargetNamed(_5.env)}),_8=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new iJ}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){let 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}}loadFont(t,e,i){var s,r,a,n;return s=this,r=void 0,n=function*(){return{loadState:"fail"}},new(a=void 0,a=Promise)(function(t,e){function i(t){try{o(n.next(t))}catch(t){e(t)}}function l(t){try{o(n.throw(t))}catch(t){e(t)}}function o(e){var s;e.done?t(e.value):((s=e.value)instanceof a?s:new a(function(t){t(s)})).then(i,l)}o((n=n.apply(s,r||[])).next())})}isMacOS(){return!1}copyToClipBoard(t){return Promise.resolve(null)}};_8=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],_8);class _6{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 _9(t,e=!1){let i=document.createElement("img");if(ie.global.isImageAnonymous&&(i.crossOrigin="anonymous"),e){let 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(Error("å 载失败"))}})}let _7=class extends _8{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 r=0,a=0,n=0,l=0;if(t.changedTouches){let e=null!=(i=t.changedTouches[0])?i:{};r=e.clientX||0,a=e.clientY||0,n=r,l=a}else r=t.clientX||0,a=t.clientY||0,n=t.offsetX||0,l=t.offsetY||0;if(e){let t,i,n=r,l=a,o=e.getBoundingClientRect(),h=null==(s=e.getNativeHandler)?void 0:s.call(e).nativeCanvas;return h&&(t=o.width/h.offsetWidth,i=o.height/h.offsetHeight),{x:(n-o.left)/(eP(t)?t:1),y:(l-o.top)/(eP(i)?i:1)}}return{x:n,y:l}}getNativeAABBBounds(t){let e=t;return("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild).lastChild&&(e=e.lastChild.firstChild),e.getBoundingClientRect)?new _6(e.getBoundingClientRect()):new iJ}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){let{width:i,height:s,style:r}=e;return r&&((0,eS.A)(r)?t.setAttribute("style",r):Object.keys(r).forEach(e
2=>{t.style[e]=r[e]})),null!=i&&(t.style.width=`${i}px`),null!=s&&(t.style.height=`${s}px`),!0}createDom(t){let{tagName:e="div",parent:i}=t,s=document.createElement(e);if(this.updateDom(s,t),i){let t=(0,eS.A)(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(s)}return s}loadImage(t){return _9(t,!1).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}loadSvg(t){return _9(t,!0).then(t=>({data:t,loadState:"success"})).catch(()=>({data:null,loadState:"fail"}))}createCanvas(t){var e,i;let s=document.createElement("canvas");t.id&&(s.id=null!=(e=t.id)?e:eI.GenAutoIncrementId().toString());let r=null!=(i=t.dpr)?i:window.devicePixelRatio;return t.width&&t.height&&(s.style.width=`${t.width}px`,s.style.height=`${t.height}px`,s.width=t.width*r,s.height=t.height*r),s}createOffscreenCanvas(t){var e;let i=null!=(e=t.dpr)?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.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(){}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,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,s+=r.offsetLeft,r=r.offsetParent;return{top:i,left:s}}loadFont(t,e,i){var s,r,a,n;return s=this,r=void 0,a=void 0,n=function*(){return new FontFace(t,(0,eS.A)(e)?`url(${e})`:e,i).load().then(function(t){return document.fonts.add(t),{loadState:"success"}}).catch(function(t){return console.error("Failed to load font:",t),{loadState:"fail"}})},new(a||(a=Promise))(function(t,e){function i(t){try{o(n.next(t))}catch(t){e(t)}}function l(t){try{o(n.throw(t))}catch(t){e(t)}}function o(e){var s;e.done?t(e.value):((s=e.value)instanceof a?s:new a(function(t){t(s)})).then(i,l)}o((n=n.apply(s,r||[])).next())})}isMacOS(){if(void 0===this._isMacOS)try{this._isMacOS=navigator.platform.toUpperCase().indexOf("MAC")>=0}catch(t){this._isMacOS=!1}return this._isMacOS}copyToClipBoard(t){return navigator.clipboard.writeText(t).then(()=>{}).catch(t=>{})}};_7=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],_7);let yt=new eL(t=>{yt.isBrowserBound||(yt.isBrowserBound=!0,t(_7).toSelf().inSingletonScope(),t(eJ).toService(_7))});function ye(t,e=!0){ye.__loaded||(ye.__loaded=!0,t.load(yt),t.load(_K),t.load(_4),e&&(t.load(_1),t.load(_2)))}yt.isBrowserBound=!1,ye.__loaded=!1;let yi=class extends _Y{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw Error("åçé误ï¼è·å2dä¸ä¸æå¤±è´¥");this.nativeContext=i,this.canvas=t,this.matrix=new iL(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};yi.env="node",yi=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],yi);let ys=class extends _j{constructor(t){super(t)}init(){this._context=new yi(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&(0,r3.A)(this._nativeCanvas.release)&&this._nativeCanvas.release()}};ys.env="node";
2let yr=_X(ys=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ys),yi),ya=class extends _3{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){let e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:eI.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new ys(i)}createWindowByCanvas(t){var e;let i=t.canvas,s=null!=(e=t.dpr)?e:1,r=t.width,a=t.height;null!=r&&null!=a&&t.canvasControled||(r=i.width/s,a=i.height/s),this.canvas=new ys({width:r,height:a,dpr:s,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}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){}};ya.env="node",ya=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(J=eU(eQ),function(t,e){J(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ya);let yn=new eL(t=>{t(ya).toSelf(),t(rH).toDynamicValue(t=>t.container.get(ya)).whenTargetNamed(ya.env)}),yl=class extends _8{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){let 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){let{loadImage:e}=this.pkg;return e?e(t).then(t=>({loadState:t?"success":"fail",data:t})).catch(()=>({loadState:"fail",data:null})):Promise.reject(Error("node-canvas loadImage could not be found!"))}loadSvg(t){let e=this.pkg.Resvg;if(!e)return Promise.reject(Error("@resvg/resvg-js svgParser could not be found!"));let 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 ah.call(t)}}getCancelAnimationFrame(){return t=>{ah.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};yl=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],yl);let yo=new eL(t=>{yo.isNodeBound||(yo.isNodeBound=!0,t(yl).toSelf().inSingletonScope(),t(eJ).toService(yl))});function yh(t,e=!0){yh.__loaded||(yh.__loaded=!0,t.load(yo),t.load(yr),t.load(yn))}yo.isNodeBound=!1,yh.__loaded=!1;let yu=["animationThreshold","colorScheme","name","padding"],yd={name:"dark",colorScheme:{default:{dataScheme:uI.M,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroun
2dColor:"#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 yc{constructor(){this.id=hH(),this._plugins=[]}add(t){if(!t||0===t.length)return null;let e=[];return t.forEach(t=>{this._plugins.find(e=>e.id===t.id)?h2("ä¸è¦é夿·»å ç¸åçplugin"):(this._plugins.push(t),e.push(t),t.onAdd&&t.onAdd(this))}),e}load(t){let 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){let 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){let e=this.get(t);e&&e.clear(this)}clearAll(){this._plugins.forEach(t=>{var e;null==(e=t.clear)||e.call(t,this)})}}class yp extends yc{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)})}onAfterInitChart(t,e){this._plugins.forEach(i=>{i.onAfterInitChart&&i.onAfterInitChart(this,t,e)})}releaseAll(){super.releaseAll(),this.globalInstance=null}}function yg(t,e,i=!0){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){let s=Object.getOwnPropertyNames(e);for(let r=0;r<s.length;r++){let a=s[r];"constructor"!==a&&(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}}else{var s=t,r=e,a=i;let n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);let e=[];for(let i in t)t.hasOwnProperty(i)&&e.push(i);return e}(r);for(let t=0;t<n.length;t++){let e=n[t];(a?null!=r[e]:null==s[e])&&(s[e]=r[e])}}}class yf{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return yf.instance||(yf.instance=new yf),yf.instance}registerDefaultTransitions(){this.registerTransition("appear","*",()=>({allowTransition:!0,stopOriginalTransition:!1})),this.registerTransition("appear","appear",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("appear","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("appear","exit",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("normal","*",()=>({allowTransition:!0,stopOriginalTransition:!1})),this.registerTransition("normal","normal",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("normal","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("normal","exit",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("exit","*",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("exit","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("exit","enter",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("exit","exit",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("enter","*",()=>({allowTransition:!0,stopOriginalTransition:!1})),this.registerTransition("enter","enter",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("enter","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("enter","exit",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("disappear","*",()=>({allowTransition:!1,stopOriginalTransition:!1})),this.registerTransition("disappear","appear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("update","*",()=>({allowTransition:!0,stopOriginalTransition:!1})),this.registerTransition("update","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("update","exit",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("state","*",()=>({allowTransition:!0,stopOriginalTransition:!1})),this.registerTransition("state","disappear",()=>({allowTransition:!0,stopOriginalTransition:!0})),this.registerTransition("state","exit",()=>({allowTransition:!0,stopOriginalTransition:!0}))}isTransitionAllowed(t,e,i){var s,r,a,n;let l=null==(s=this.transitions.get(t))?void 0:s.get(e);return l||(l=null==(r=this.transitions.get(t))?void 0:r.get("*"))||(l=null==(a=this.transitions.get("*"))?void 0:a.get(e))||(l=null==(n=this.transitions.get("*"))?void 0:n.get("*"))?l(i,t):{allowTransition:!0,stopOriginalTransition:!0}}
2registerTransition(t,e,i){let s=this.transitions.get(t);s||(s=new Map,this.transitions.set(t,s)),s.set(e,i)}}function ym(t){if(!t||!(0,r3.A)(t))return 0;let e=Function.prototype.toString.call(t);if(/^class\s/.test(e))return 1;if(!t.prototype)return 2;if(t.prototype.constructor===t){let e=Object.getOwnPropertyDescriptor(t,"prototype");if(e&&!e.writable||Object.getOwnPropertyNames(t.prototype).length>1)return 1}return 2}yf.getInstance();class y_{static registerBuiltInAnimate(t,e){y_.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}get started(){return this._started}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach(t=>{t()})}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach(t=>{t()})}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd(()=>{this._activeCount--;let e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())})}parseParams(t,e,i){var s,r;let a=this.resolveValue(t.totalTime,i,void 0),n=this.resolveValue(t.startTime,i,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=n,l.totalTime=a;let o=this.resolveValue(t.oneByOne,i,!1);if(e){let t=l.timeSlices;(0,ev.A)(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map(t=>{let s=this.resolveValue(t.delay,i,0),r=this.resolveValue(t.delayAfter,i,0),a=this.resolveValue(t.duration,i,300);return e+=s+a+r,Object.assign(Object.assign({},t),{delay:s,delayAfter:r,duration:a})});let s=0;o&&(s="number"==typeof o?o:o?e:0),l.oneByOneDelay=s;let r=1;if(a){let t=e+s*(this._target.count-2);r=a?a/t:1}l.timeSlices=l.timeSlices.map(t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*r,delayAfter:t.delayAfter*r,duration:t.duration*r,effects:e.map(t=>{var e,i;let s=null!=(e=t.custom)?e:y_.builtInAnimateMap[null!=(i=t.type)?i:"fromTo"],r=ym(s);return Object.assign(Object.assign({},t),{custom:s,customType:r})})})}),l.oneByOneDelay=s*r,l.startTime=n*r}else{let e=this.resolveValue(t.delay,i,0),h=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300),d=0;o&&(d="number"==typeof o?o:o?e+h+u:0),l.oneByOneDelay=d,l.custom=null!=(s=t.custom)?s:y_.builtInAnimateMap[null!=(r=t.type)?r:"fromTo"];let c=ym(l.custom);l.customType=c;let p=e+h+u+d*(this._target.count-2),g=eP(a)?a/p:1;l.delay=e*g,l.delayAfter=h*g,l.duration=u*g,l.oneByOneDelay=d*g,l.startTime=n}return l}execute(t){Array.isArray(t)?t.forEach(t=>this._execute(t)):this._execute(t)}_execute(t){let e;if(t.selfOnly)return this._executeItem(t,this._target,0,1);let i="timeSlices"in t;i&&t.partitioner&&(e=(null!=e?e:this._target.getChildren()).filter(e=>{var i,s;return t.partitioner(null==(s=null==(i=e.context)?void 0:i.data)?void 0:s[0],e,{})})),i&&t.sort&&(e=null!=e?e:this._target.getChildren()).sort((e,i)=>{var s,r,a,n;return t.sort(null==(r=null==(s=e.context)?void 0:s.data)?void 0:r[0],null==(n=null==(a=i.context)?void 0:a.data)?void 0:n[0],e,i,{})});let s=i?(e,s,r)=>{let a=this.parseParams(t,i,e),n=this.executeTimelineItem(a,e,s,r);n&&this._trackAnimation(n)}:(e,s,r)=>{let a=this.parseParams(t,i,e),n=this.executeTypeConfigItem(a,e,s,r);n&&this._trackAnimation(n)};e?e.forEach((t,i)=>s(t,i,e.length)):this._target.count<=1?s(this._target,0,1):this._target.forEachChildren((t,e)=>s(t,e,this._target.count-1))}executeTypeConfigItem(t,e,i,s){var r,a,n,l,o,h,u,d;let{type:c="fromTo",channel:p,customParameters:g,easing:f="linear",delay:m=0,delayAfter:_=0,duration:y=300,startTime:v=0,oneByOneDelay:b=0,loop:x,bounce:S,priority:A=0,options:k,custom:M,customType:w,controlOptions:T}=t,C=e.animate();C.priority=A;let B=(0,r3.A)(m)?m(null==(a=null==(r=e.context)?void 0:r.data)?void 0:a[0],e,{}):m,E=null==(l=null==(n=e.context)?void 0:n.data)?void 0:l[0],P=null==(o=e.context)?void 0:o.indexKey;E&&P&&(i=null!=(h=E[P])?h:i),C.startAt(v);let O=i*b+B;O>0&&C.wait(O);let R=null,I=t.to,L=t.from;I||(R||(R=this.createPropsFromChannel(p,e)),I=R.props),L||(R||(R=this.createPropsFromChannel(p,e)),L=R.from),R.attrOutChannel&&e.setAttributes(R.attrOutChannel),this._handleRunAnimate(C,M,w,L,I,y,f,g,T,k,c,e);let D=0;b&&(D=b*(s-i-1));let F=(0,r3.A)(_)?_(null==(d=null==(u=e.context)?void 0:u.data)?void 0:d[0],e,{}):_;return F>0&&(D+=F),D>0&&C.wait(D),x&&x>0&&C.loop(x),S&&C.bounce(!0),C}_handleRunAnimate(t,e,i,s,r,a,n,l,o,h,u,d){var c,p,g,f,m,_,y,v;if(e&&i){i=ym(e);let u=this.resolveValue(l,d);"function"==typeof u&&(u=u(null==(p=null==(c=d.context)?void 0:c.data)?void 0:p[0],d,{})),u=Object.assign({width:(null==(g=d.stage)?void 0:g.width)||0,height:(null==(f=d.stage)?void 0:f.height)||0,group:this._target.parent},u);let b=(0,r3.A)(h)?h.call(null,null!=(_=u&&(null==(m=u.data)?void 0:m[0]))?_:null==(v=null==(y=d.context)?void 0:y.data)?void 0:v[0],d,u):h;u.options=b,u.controlOptions=o,1===i?this.createCustomAnimation(t,e,s,r,a,n,u):2===i&&this.createCustomInterpolatorAnimation(t,e,r,a,n,u)}else"to"===u?t.to(r,a,n):"from"===u&&t.from(r,a,n)}executeTimelineItem(t,e,i,s){var r,a,n,l;let{timeSlices:o,startTime:h=0,loop:u,bounce:d,oneByOneDelay:c,priority:p,controlOptions:g}=t,f=null==(a=null==(r=e.context)?void 0:r.data)?void 0:a[0],m=null==(n=e.context)?void 0:n.indexKey;f&&m&&(i=null!=(l=f[m])?l:i);let _=e.animate();return _.priority=p,_.startAt(h),_.wait(i*c),u&&u>
20&&_.loop(u),d&&_.bounce(!0),(Array.isArray(o)?o:[o]).forEach(t=>{this.applyTimeSliceToAnimate(t,_,e,g)}),c&&_.wait(c*(s-i-1)),_}applyTimeSliceToAnimate(t,e,i,s){var r,a,n,l;let{effects:o,duration:h=300,delay:u=0,delayAfter:d=0}=t,c=(0,r3.A)(u)?u(null==(a=null==(r=i.context)?void 0:r.data)?void 0:a[0],i,{}):u,p=(0,r3.A)(d)?d(null==(l=null==(n=i.context)?void 0:n.data)?void 0:l[0],i,{}):d;c>0&&e.wait(c),(Array.isArray(o)?o:[o]).forEach(t=>{var r;let{type:a="fromTo",channel:n,customParameters:l,easing:o="linear",options:u}=t,d=null,c=t.to,p=t.from;c||(d||(d=this.createPropsFromChannel(n,i)),c=d.props),p||(d||(d=this.createPropsFromChannel(n,i)),p=d.from),d.attrOutChannel&&i.setAttributes(d.attrOutChannel);let g=null!=(r=t.custom)?r:y_.builtInAnimateMap[a],f=t.custom?t.customType:ym(g);this._handleRunAnimate(e,g,f,p,c,h,o,l,s,u,a,i)}),p>0&&e.wait(p)}createCustomInterpolatorAnimation(t,e,i,s,r,a){let n={};Object.keys(i).forEach(e=>{n[e]=t.target.getComputedAttribute(e)}),t.interpolateUpdateFunction=(i,s,r,n,l)=>{e(r,i,s,n,l,t.target,a)},t.to(i,s,r)}createCustomAnimation(t,e,i,s,r,a,n){let l=new e(i,s,r,a,n);t.play(l)}createPropsFromChannel(t,e){var i;let s={},r=null;if(!t)return{from:r,props:s,attrOutChannel:null};let a={},n=!1,l=null==(i=e.context)?void 0:i.diffAttrs;if(Array.isArray(t)&&(t=t.reduce((t,e)=>(void 0===l[e]||(t[e]={to:l[e]}),t),{})),Object.keys(t).forEach(i=>{var a,n,l,o;let h=t[i];void 0!==h.to&&("function"==typeof h.to?s[i]=h.to(null==(n=null==(a=e.context)?void 0:a.data)?void 0:n[0],e,{}):s[i]=h.to),void 0!==h.from&&(r||(r={}),"function"==typeof h.from?r[i]=h.from(null==(o=null==(l=e.context)?void 0:l.data)?void 0:o[0],e,{}):r[i]=h.from)}),l)for(let t in l){let e=l[t];void 0!==e&&(s.hasOwnProperty(t)||(a[t]=e,n=!0))}return{from:r,props:s,attrOutChannel:n?a:null}}resolveValue(t,e,i){var s,r;return void 0===t?i:"function"==typeof t&&e?t(null==(r=null==(s=e.context)?void 0:s.data)?void 0:r[0],e,{}):t}executeItem(t,e,i=0,s=1){return Array.isArray(t)?t.map(t=>this._executeItem(t,e,i,s)).filter(Boolean):[this._executeItem(t,e,i,s)].filter(Boolean)}_executeItem(t,e,i=0,s=1){if(!e)return null;let r="timeSlices"in t,a=null,n=this.parseParams(t,r);return(a=r?this.executeTimelineItem(n,e,i,s):this.executeTypeConfigItem(n,e,i,s))&&this._trackAnimation(a),a}stop(t,e=!0){for(;this._animates.length>0;){let i=this._animates.pop();!1===e&&(i.status=K.END),null==i||i.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,e&&this.onEnd())}}y_.builtInAnimateMap={};let yy="appear",yv="disappear",yb="update",yx="highlight",yS="unhighlight";class yA{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null==(t=this.states)||t.clear()}}class yk{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){let s=yf.getInstance(),r=[],a=[];if(this.stateList&&this.stateList.length?t.forEach((t,i)=>{let n={allowTransition:!0};this.stateList.forEach(e=>{let i=s.isTransitionAllowed(e.state,t,this.graphic);n.allowTransition=n.allowTransition&&i.allowTransition}),n.allowTransition&&(a.push({state:t,animationConfig:(0,ev.A)(e[i])?e[i].map(t=>t.animation):e[i].animation,executor:new y_(this.graphic)}),this.stateList.forEach(e=>{s.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&r.push(e)}))}):t.forEach((t,i)=>{a.push({state:t,animationConfig:(0,ev.A)(e[i])?e[i].map(t=>t.animation):e[i].animation,executor:new y_(this.graphic)})}),r.forEach(t=>{t.executor.stop(null,!1)}),a.length){a[0].executor.execute(a[0].animationConfig);for(let t=0;t<a.length;t++){let e=a[t+1],s=a[t];s.executor.onEnd(()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter(t=>t!==s),t===a.length-1&&i&&i(!1)})}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter(t=>!r.includes(t)):this.stateList=[],this.stateList.push(...a)}applyAppearState(t,e){this.applyState([yy],[{name:yy,animation:t}],e)}applyDisappearState(t,e){this.applyState([yv],[{name:yv,animation:t}],e)}applyUpdateState(t,e){this.applyState([yb],[{name:yb,animation:t}],e)}applyHighlightState(t,e){this.applyState([yx],[{name:yx,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([yS],[{name:yS,animation:t}],e)}stopState(t,e){var i;let s=null==(i=this.stateList)?void 0:i.find(e=>e.state===t);s&&s.executor.stop(e)}clearState(){var t;null==(t=this.stateList)||t.forEach(t=>{t.executor.stop(null,!1)}),this.stateList=null}reApplyState(t){var e;let i=null==(e=this.stateList)?void 0:e.find(e=>e.state===t);if(i&&i.executor.started){let t=this.stateList.slice();i.executor.stop(),this.stateList=t,i.executor.execute(i.animationConfig)}}}class yM{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new yk(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new yA(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e,i=!1){return this._getAnimationStateManager(this).stopState(t,e),i&&this.isContainer&&this.forEachChildren(s=>{s.stopAnimationState(t,e,i)}),this}clearAnimationStates(){let t=this._animationStateManager;return t&&t.clearState(),this}reApplyAnimationState(t,e=!1){let i=this._animationStateManager;return i&&i.reApplyState(t),e&&this.isContainer&&this.forEachChildren(i=>{i.reApplyAnimationState(t,e)}),this}static extend(t){return(new yM)._getAnimationStateManager(t),t}}class yw extends eh(){get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this._animationEndFlag=!0,this.id=eI.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){let s=e.next;t(e.animate,i),i++,e=s}}addAnimate(t){let e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;
2this._animationEndFlag&&(this._animationEndFlag=!1,this.emit("animationStart"));let e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate((t,i)=>{t.status===K.END?this.removeAnimate(t,!0):t.status!==K.RUNNING&&t.status!==K.INITIAL||t.advance(e)}),0===this._animateCount&&(this._animationEndFlag=!0,this.emit("animationEnd"))}clear(){this.forEachAccessAnimate(t=>{t.release()}),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t,e=!0){let i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach(t=>t()),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate(t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())})}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}let yT=new yw;yT.isGlobal=!0;class yC{constructor(t=eI.GenAutoIncrementId(),e=yT,i){this.id=t,this.status=K.INITIAL,this._timeline=e,e.addAnimate(this),this.slience
2=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.animates||(this.target.animates=new Map),this.target.animates.set(this.id,this),this.onRemove(()=>{this.stop(),this.target.animates.delete(this.id)}),this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t,e=300,i="linear"){let s=new m6(X.to,t,e,i);return s.bind(this.target,this),this.updateStepAfterAppend(s),this}wait(t){let e=new m9(X.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?this._lastStep.append(t):this._firstStep=t,this._lastStep=t,this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach(e=>{var i;t.props[e]=null!=(i=t.props[e])?i:this._endProps[e]}),t.propKeys.forEach(e=>{this._endProps[e]=t.props[e]}))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach(e=>{var i;t.props[e]=null!=(i=t.props[e])?i:this._endProps[e]}),t.propKeys.forEach(e=>{this._endProps[e]=t.props[e]}),t=t.next}from(t,e=300,i="linear"){let s=new m6(X.from,t,e,i);return this._firstStep?this._lastStep.append(s):this._firstStep=s,this._lastStep=s,this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===K.RUNNING&&(this.status=K.PAUSED)}resume(){this.status===K.PAUSED&&(this.status=K.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null==(e=this._onStart)||e.forEach(t=>t()),Object.keys(this._endProps).forEach(t=>{this._startProps[t]=this.target.getComputedAttribute(t)}))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null==(e=this._onEnd)||e.forEach(t=>t())}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null==(e=this._onRemove)||e.forEach(t=>t())}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach(t=>this._preventAttrs.add(t))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null==(e=this._lastStep)||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,s,r,a){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==K.END&&this.onEnd(),this.status=K.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=K.END,this._onRemove&&this._onRemove.forEach(t=>t()),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[],this.forEachStep(t=>{t.release()})}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach(t=>{let i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)}),this.startAt(e)}after(t){if(!t)return this;let e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t&&this.startAt(t.getStartTime()),this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,s;if(this.status===K.END)return void console.warn("aaa å¨ç»å·²ç»ç»æï¼ä¸è½æ¨è¿");let r=this.currentTime+t;if(r<this._startTime)return void(this.currentTime=r);if(r>=this._startTime+this._totalDuration)return null==(e=this._lastStep)||e.onUpdate(!0,1,{}),null==(i=this._lastStep)||i.onEnd(),this.onEnd(),void(this.status=K.END);this.status=K.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=r;let a=r-this._startTime,n=!1,l=!1;if(this._loopCount>0){a=(r-this._startTime)%this._duration;let t=Math.floor((r-this._startTime)/this._duration);n=t>this._currentLoop,this._currentLoop=t,(l=this._bounce&&t%2==1)&&(a=this._duration-a)}n&&!l&&this.target.setAttributes(this._startProps);let o=null;if(this._lastStep===this._firstStep)o=this._firstStep;else{let t=this._firstStep;for(;t;){let e=t.getStartTime(),i=t.getDuration();if(a>=e&&a<=e+i){o=t;break}t=t.next}}if(!o)return;o!==this.lastRunStep&&(null==(s=this.lastRunStep)||s.onEnd()),this.lastRunStep=o;let h=(a-o.getStartTime())/o.getDuration(),u=h>=1;o.update(u,h,{}),u&&(o.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.get
2StartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}forEachStep(t){let e=this._firstStep;for(;e;)t(e),e=e.next}}(Q=tM||(tM={}))[Q.INITIAL=0]="INITIAL",Q[Q.RUNNING=1]="RUNNING",Q[Q.PAUSE=2]="PAUSE";let yB=new is;class yE{constructor(){this.released=!1}tick(t,e){yB.addAnimationFrameCb(()=>{if(!this.released)return e(this)})}release(){this.released=!0}getTime(){return Date.now()}}class yP extends eh(){constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{let{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;let s=t.getTime();this._lastTickTime=s,this.lastFrameTime<0&&(this.lastFrameTime=s-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));let r=s-this.lastFrameTime,a=this.checkSkip(r);return a||(this._handlerTick(r),this.lastFrameTime=s,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!a},this._handlerTick=t=>{this.status===tM.RUNNING&&(this.tickCounts++,this.timelines.forEach(e=>{e.tick(t)}),this.emit("tick",t))},this._handleGraphTick=()=>{this.initHandler(!1)},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=tM.INITIAL,ie.global.hooks.onSetEnv.tap("graph-ticker",this._handleGraphTick),ie.global.env&&this.initHandler(!1)}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter(e=>e!==t)}getTimelines(){return this.timelines}initHandler(t=!1){this.setupTickHandler(t)}setupTickHandler(t=!1){if(!t&&this.tickerHandler)return!0;let e=new yE;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=e,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,t=>this.handleTick(t,{once:!0}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,t=>{this.handleTick(t,{once:!0})})}pause(){return this.status!==tM.INITIAL&&(this.status=tM.PAUSE,!0)}resume(){return this.status!==tM.INITIAL&&(this.status=tM.RUNNING,!0)}ifCanStop(){return!!(this.autoStop&&(!this.timelines.length||this.timelines.every(t=>!t.isRunning())))||!1}start(t=!1){return!(this.status===tM.RUNNING||!this.tickerHandler||!t&&(this.status===tM.PAUSE||this.ifCanStop()))&&(this.status=tM.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0)}stop(){this.status=tM.INITIAL,this.setupTickHandler(!0),this.lastFrameTime=-1}trySyncTickStatus(){this.status===tM.INITIAL&&this.timelines.some(t=>t.isRunning())?this.start():this.status===tM.RUNNING&&this.timelines.every(t=>!t.isRunning())&&this.stop()}release(){var t;this.stop(),this.timelines=[],null==(t=this.tickerHandler)||t.release(),this.tickerHandler=null,this.lastFrameTime=-1,ie.global.hooks.onSetEnv.unTap("graph-ticker",this._handleGraphTick)}checkSkip(t){var e,i,s;return"performance"!==(null==(s=null==(i=null==(e=this.stage)?void 0:e.params)?void 0:i.optimize)?void 0:s.tickRenderMode)&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class yO{getAttributes(t=!1){return t&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,s;let r=new yC(null==t?void 0:t.id,null!=(i=null!=(e=null==t?void 0:t.timeline)?e:this.stage&&this.stage.getTimeline())?i:yT,null==t?void 0:t.slience);if(r.bind(this),t){let{onStart:e,onEnd:i,onRemove:s}=t;null!=e&&r.onStart(e),null!=i&&r.onEnd(i),null!=s&&r.onRemove(s)}return null==(s=this.stage)||s.ticker.start(),r}createTimeline(){return new yw}createTicker(t){return new yP(t)}setFinalAttributes(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttributes(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new y_(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach(t=>{this._animateExecutor.execute(t)}),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t,e=!1){return!e&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}
2pauseAnimation(t=!1){this.animates&&this.animates.forEach(t=>t.pause()),t&&this.isContainer&&this.forEachChildren(e=>{e.pauseAnimation(t)})}resumeAnimation(t=!1){this.animates&&this.animates.forEach(t=>t.resume()),t&&this.isContainer&&this.forEachChildren(e=>{e.resumeAnimation(t)})}stopAnimation(t=!1){this.animates&&this.animates.forEach(t=>t.stop()),t&&this.isContainer&&this.forEachChildren(e=>{e.stopAnimation(t)})}}function yR(){yg(n0,yM),yg(n0,yO)}let yI=(t,e)=>{let 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"},yL=(t,e)=>{let i=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);return Math.sqrt(i*i+s*s)};class yD extends eh(){constructor(t,e={}){var i,s,r,a,n,l,o,h,u,d;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.startTime=po.now();let{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){let{x:s,y:r}=e[t],a={x:s,y:r};i[t]=a}if(1!==i.length)this.startDistance=yL(i[0],i[1]),this.center=(t=>{let e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,s=0,r=0;for(;r<e;)i+=t[r].x,s+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(s/e)}})([i[0],i[1]]);else{let t=e[0];this.pressTimeout=setTimeout(()=>{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.pressTimeout=null},this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();let{startPoints:e,cachedEvents:i}=this;if(!e.length)return;let s=t.clone(),{x:r,y:a,pointerId:n}=s;for(let t=0,e=i.length;t<e;t++)if(n===i[t].pointerId){i[t]=s;break}let l={x:r,y:a},o=i.map(t=>({x:t.x,y:t.y})),h=po.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=l,1===e.length){let t=e[0],i=r-t.x,n=a-t.y,h=this.direction||yI(t,l);this.direction=h;let u=this.getEventType(l);return s.direction=h,s.deltaX=i,s.deltaY=n,s.points=o,this.triggerStartEvent(u,s),void this.triggerEvent(u,s)}let{startDistance:u}=this;s.scale=yL(o[0],o[1])/u,s.center=this.center,s.points=o,this.triggerStartEvent("pinch",s),this.triggerEvent("pinch",s)},this.onEnd=t=>{let e=t.clone(),{cachedEvents:i,startPoints:s}=this;if(e.points=i.map(t=>({x:t.x,y:t.y})),this.triggerEndEvent(e),1===i.length){let i=po.now(),r=this.lastMoveTime;if(i-r<100){let t=r-(this.prevMoveTime||this.startTime);if(t>0){let i=this.prevMovePoint||s[0],r=this.lastMovePoint||s[0],a=yL(i,r),n=a/t;if(n>this.config.swipe.velocity&&a>this.config.swipe.threshold)return e.velocity=n,e.direction=yI(i,r),this.triggerEvent("swipe",e),this.cachedEvents=[],this.startPoints=[],void this.reset()}}i-this.startTime<this.config.press.time&&(i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0))}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),s.splice(t,1);break}this.reset(),i.length>0&&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.time)?s:251,threshold:null!=(a=null==(r=null==e?void 0:e.press)?void 0:r.threshold)?a:9},swipe:{threshold:null!=(l=null==(n=null==e?void 0:e.swipe)?void 0:n.threshold)?l:10,velocity:null!=(h=null==(o=null==e?void 0:e.swipe)?void 0:o.velocity)?h:.3},tap:{interval:null!=(d=null==(u=null==e?void 0:e.tap)?void 0:u.interval)?d:300}},this.initEvents()}initEvents(){let{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerleave",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){let{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerleave",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd)
2)}release(){this.removeEvents(),this.element=null}getEventType(t){let e,{eventType:i,startTime:s,startPoints:r}=this;return"press"===i?i:(e=po.now()-s>this.config.press.time&&yL(r[0],t)<this.config.press.threshold?"press":"pan",this.eventType=e,e)}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){let{emitThrottles:i}=this,s={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,s);i.push(s)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);let{throttleTimer:i,emitThrottles:s}=this;i||(this.throttleTimer=ie.global.getRequestAnimationFrame()(()=>{ie.global.getCancelAnimationFrame()(this.throttleTimer),this.throttleTimer=null;for(let t=0,e=s.length;t<e;t++){let{type:e,ev:i}=s[t];this.emitEvent(e,i)}this.emitThrottles.length=0}))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){let e=this.processEvent;Object.keys(e).forEach(i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]})}emitEvent(t,e){if(!this.element)return;let i=this.element._events;this._callListeners(t,e,i["*"]),this._callListeners(t,e,i[t]),this.emit(t,e)}_callListeners(t,e,i){if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let s=0,r=i.length;s<r&&!e.propagationImmediatelyStopped;s++)i[s].fn.call(i[s].context,e,t)}}class yF extends m7{constructor(t,e,i,s,r){super(null,{},i,s,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){super.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:hy.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:hy.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;let 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:hy.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class yz extends yF{constructor(t,e,i,s,r){var a,n,l,o,h,u,d,c,p,g,f,m;let _,y;const v=null!=(n=null==(a=null==r?void 0:r.group)?void 0:a.attribute)?n:{},b=null!=(l=v.width)?l:0,x=null!=(o=v.height)?o:0,S=null!=(h=null==r?void 0:r.animationType)?h:"in",A=null!=(u=null==r?void 0:r.startAngle)?u:0,k=null!=(d=null==r?void 0:r.orient)?d:"clockwise";let M=0,w=0;"anticlockwise"===k?(w="in"===S?A+2*Math.PI:A,w=A+2*Math.PI):(M=A,w="out"===S?A+2*Math.PI:A);const T=ie.graphicService.creator.arc({x:null!=(p=null==(c=null==r?void 0:r.center)?void 0:c.x)?p:b/2,y:null!=(f=null==(g=null==r?void 0:r.center)?void 0:g.y)?f:x/2,outerRadius:null!=(m=null==r?void 0:r.radius)?m:(b+x)/2,innerRadius:0,startAngle:M,endAngle:w,fill:!0});"anticlockwise"===k?(_={startAngle:A+2*Math.PI},y={startAngle:A}):(_={endAngle:A},y={endAngle:A+2*Math.PI}),super("in"===S?_:y,"in"===S?y:_,i,s,{group:null==r?void 0:r.group,clipGraphic:T})}}class yH extends yF{constructor(t,e,i,s,r){var a,n,l,o,h,u,d,c,p;const g=null!=(n=null==(a=null==r?void 0:r.group)?void 0:a.attribute)?n:{},f=null!=(o=null!=(l=null==r?void 0:r.width)?l:g.width)?o:0,m=null!=(u=null!=(h=null==r?void 0:r.height)?h:g.height)?u:0,_=null!=(d=null==r?void 0:r.animationType)?d:"in",y=null!=(c=null==r?void 0:r.direction)?c:"x",v=null!=(p=null==r?void 0:r.orient)?p:"positive",b=ie.graphicService.creator.rect({x:0,y:0,width:"in"===_&&"x"===y?0:f,height:"in"===_&&"y"===y?0:m,fill:!0});let x={},S={};"y"===y?"negative"===v?(x={y:m,height:0},S={y:0,height:m}):(x={height:0},S={height:m}):"negative"===v?(x={x:f,width:0},S={x:0,width:f}):(x={width:0},S={width:f}),super("in"===_?x:S,"in"===_?S:x,i,s,{group:null==r?void 0:r.group,clipGraphic:b})}}class yj extends m7{constructor(t,e,i,s,r){var a,n;super(t,e,i,s,r),this.newPointAnimateType=null!=(a=null==r?void 0:r.newPointAnimateType)?a:"grow",this.clipRangeByDimension=null!=(n=null==r?void 0:r.clipRangeByDimension)?n:"x"}getPoints(t,e=!1){if(t.points)return t.points;if(t.segments){let i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map(t=>{var s,r;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!=(r=null==(s=t.points)?void 0:s.length)?r:0)}),i}return[]}onBind(){super.onBind();let{points:t,segments:e}=this.target.attribute,{points:i,segments:s}=this.target.getFinalAttribute();this.from={points:t,segments:e},this.to={points:i,segments:s},this.props=this.to;let r=this.getPoints(this.from),a=this.getPoints(this.to,!0);this.fromPoints=r?Array.isArray(r)?r:[r]:[],this.toPoints=a?Array.isArray(a)?a:[a]:[];let n=new Map;
2this.fromPoints.forEach(t=>{t.context&&n.set(t.context,t)});let l,o,h=1/0,u=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(n.has(this.toPoints[t].context)){h=t,l=n.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(n.has(this.toPoints[t].context)){u=t,o=n.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(u)?(this.clipRange=this.toPoints[u][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],1===this.clipRange&&(this.shrinkClipRange=this.toPoints[u][this.clipRangeByDimension]/this.fromPoints[this.fromPoints.length-1][this.clipRangeByDimension]),eP(this.clipRange)?this.clipRange=h4(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let d=this.toPoints[0];this.interpolatePoints=this.toPoints.map((t,e)=>{let i=n.get(t.context);return i?(d=i,[i,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:e<h&&l?[l,t]:e>u&&o?[o,t]:[d,t]}),this.points=this.interpolatePoints.map(t=>{let e=t[0],i=t[1],s=new i8(e.x,e.y,e.x1,e.y1);return s.defined=i.defined,s.context=i.context,s})}onFirstRun(){let t=this.target.attribute.clipRange;eP(t*this.clipRange)&&(this.clipRange*=t)}onUpdate(t,e,i){if(t)return Object.keys(this.to).forEach(t=>{this.target.attribute[t]=this.to[t]}),this.target.addUpdatePositionTag(),void this.target.addUpdateShapeAndBoundsTag();if(this.points=this.points.map((t,i)=>{let s=aa(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s}),this.clipRange){if(this.shrinkClipRange)return void(t?(i.points=this.toPoints,i.clipRange=1):(i.points=this.fromPoints,i.clipRange=this.clipRange-(this.clipRange-this.shrinkClipRange)*e));this.target.setAttributes({clipRange:this.clipRange+(1-this.clipRange)*e})}if(this.segmentsCache&&this.to.segments){let t=0,e=this.to.segments.map((e,i)=>{let s=t+this.segmentsCache[i],r=this.points.slice(t,s);return t=s,Object.assign(Object.assign({},e),{points:r})});this.target.attribute.segments=e}else this.target.attribute.points=this.points;this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class yV extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r,a,n,l,o,h,u;let d,c;super.onBind();let p=this.target.getFinalAttribute(),g=null!=(t=this.target.attribute)?t:{};switch(null==(e=this.params)?void 0:e.direction){case"x":d={scaleX:null!=(i=g.scaleX)?i:0},c={scaleX:null!=(s=null==p?void 0:p.scaleX)?s:1},this._updateFunction=this.updateX;break;case"y":d={scaleY:null!=(r=g.scaleY)?r:0},c={scaleY:null!=(a=null==p?void 0:p.scaleY)?a:1},this._updateFunction=this.updateY;break;default:d={scaleX:null!=(n=g.scaleX)?n:0,scaleY:null!=(l=g.scaleY)?l:0},c={scaleX:null!=(o=null==p?void 0:p.scaleX)?o:1,scaleY:null!=(h=null==p?void 0:p.scaleY)?h:1},this._updateFunction=this.updateXY}let f=this.target.getFinalAttribute();f&&this.target.setAttributes(f),this.props=c,this.from=d,this.to=c,!1!==(null==(u=this.params.controlOptions)?void 0:u.immediatelyApply)&&this.target.setAttributes(d)}onEnd(t){super.onEnd(t)}updateX(t){this.target.attribute.scaleX=this.from.scaleX+(this.to.scaleX-this.from.scaleX)*t}updateY(t){this.target.attribute.scaleY=this.from.scaleY+(this.to.scaleY-this.from.scaleY)*t}updateXY(t){this.updateX(t),this.updateY(t)}deleteSelfAttr(t){delete this.props[t],this.fromProps&&delete this.fromProps[t];let e=this.propKeys.indexOf(t);-1!==e&&this.propKeys.splice(e,1),this.propKeys&&this.propKeys.length>1?this._updateFunction=this.updateXY:"scaleX"===this.propKeys[0]?this._updateFunction=this.updateX:"scaleY"===this.propKeys[0]?this._updateFunction=this.updateY:this._updateFunction=null}onUpdate(t,e,i){this._updateFunction&&(this._updateFunction(e),this.target.addUpdatePositionTag(),this.target.addUpdateBoundTag())}}class yN extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r;let a,n;super.onBind();let l=this.target.attribute;switch(null==(t=this.params)?void 0:t.direction){case"x":a={scaleX:null!=(e=null==l?void 0:l.scaleX)?e:1},n={scaleX:0};break;case"y":a={scaleY:null!=(i=null==l?void 0:l.scaleY)?i:1},n={scaleY:0};break;default:a={scaleX:null!=(s=null==l?void 0:l.scaleX)?s:1,scaleY:null!=(r=null==l?void 0:l.scaleY)?r:1},n={scaleX:0,scaleY:0}}this.props=n,this.from=a,this.to=n}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateBoundTag()}}class yW extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i;super.onBind();let s=this.target.getFinalAttribute(),r=null!=(t=this.target.attribute)?t:{},a={},n=null!=(e=this.from)?e:{};this.keys.forEach(t=>{var e,i,l;a[t]=null!=(e=null==s?void 0:s[t])?e:1,n[t]=null!=(l=null!=(i=n[t])?i:r[t])?l:0});let l=this.target.getFinalAttribute();l&&this.target.setAttributes(l),this.props=a,this.propKeys=this.keys,this.from=n,this.to=a,!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(n)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class yU extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){super.onBind();let t=this.target.attribute,e={},i={};this.keys.forEach(s=>{var r;e[s]=0,i[s]=null!=(r=t[s])?r:1}),this.props=e,this.propKeys=this.keys,this.from=i,this.to=e,Object.assign(this.target.attribute,i),this.target.addUpdatePositionTag(),this.target.addUpdateBoundTag()}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class yG extends yW{constructor(t,e,i,s,r){super(t,e,i,s,r),this.keys=["opacity","fillOpacity","strokeOpacity"],this.from={opacity:0,fillOpacity:0,strokeOpacity:0}}}class yY extends yU{constructor(t,e,i,s,r){super(t,e,i,s,r),this.keys=["opacity","fillOpacity","strokeOpacity"]}}class y$ extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}
2onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class yX extends y${onBind(){var t;super.onBind();let{from:e,to:i}=((t,e,i)=>{var s,r,a,n;let{offset:l=0,orient:o,direction:h,point:u,excludeChannels:d=[],layoutRect:c={}}=null!=e?e:{},p=0,g=0;"negative"===o&&(p=null!=(s=c.width)?s:t.stage.viewWidth,g=null!=(r=c.height)?r:t.stage.viewHeight),p+=l,g+=l;let f=(0,r3.A)(u)?u.call(null,null==(n=null==(a=t.context)?void 0:a.data)?void 0:n[0],t,i):u,m=t.getGraphicAttribute("x"),_=t.getGraphicAttribute("y"),y=d.includes("x")?m:f&&eP(f.x)?f.x:p,v=d.includes("y")?_:f&&eP(f.y)?f.y:g;switch(h){case"x":return{from:{x:d.includes("x")?m:y},to:{x:m}};case"y":return{from:{y:v},to:{y:_}};default:return{from:{x:y,y:v},to:{x:m,y:_}}}})(this.target,this.params.options,this.params);this.props=i,this.propKeys=Object.keys(i).filter(t=>null!=i[t]),this.from=e,this.to=i;let s=this.target.getFinalAttribute();s&&this.target.setAttributes(s),!1!==(null==(t=this.params.controlOptions)?void 0:t.immediatelyApply)&&this.target.setAttributes(e)}}class yK extends y${onBind(){super.onBind();let{from:t,to:e}=((t,e,i)=>{var s,r,a,n;let{offset:l=0,orient:o,direction:h,point:u}=null!=e?e:{},d=i.group?i.group.AABBBounds:null,c=null!=(s=d.width())?s:i.width,p=null!=(r=d.height())?r:i.height,g=(0,r3.A)(u)?u.call(null,null==(n=null==(a=t.context)?void 0:a.data)?void 0:n[0],t,i):u,f=g&&eP(g.x)?g.x:("negative"===o?c:0)+l,m=g&&eP(g.y)?g.y:("negative"===o?p:0)+l;switch(h){case"x":return{from:{x:t.getGraphicAttribute("x")},to:{x:f}};case"y":return{from:{y:t.getGraphicAttribute("y")},to:{y:m}};default:return{from:{x:t.getGraphicAttribute("x"),y:t.getGraphicAttribute("y")},to:{x:f,y:m}}}})(this.target,this.params.options,this.params);this.props=e,this.propKeys=Object.keys(e).filter(t=>null!=e[t]),this.from=t,this.to=e}}class yq extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class yZ extends yq{onBind(){var t,e,i,s;let r;super.onBind();let{from:a,to:n}=(e=this.target,i=this.params.options,r=null!=(s=e.getFinalAttribute().angle)?s:0,{from:{angle:rL(r/(2*Math.PI),0)?Math.round(r/(2*Math.PI))*Math.PI*2:eP(null==i?void 0:i.angle)?i.angle:"anticlockwise"===(null==i?void 0:i.orient)?Math.ceil(r/(2*Math.PI))*Math.PI*2:Math.floor(r/(2*Math.PI))*Math.PI*2},to:{angle:r}});this.props=n,this.propKeys=["angle"],this.from=a,this.to=n;let l=this.target.getFinalAttribute();l&&this.target.setAttributes(l),!1!==(null==(t=this.params.controlOptions)?void 0:t.immediatelyApply)&&this.target.setAttributes(a)}}class yJ extends yq{onBind(){var t,e,i;let s,r;super.onBind();let{from:a,to:n}=(t=this.target,e=this.params.options,s=null!=(i=t.getFinalAttribute().angle)?i:0,r=0,r=rL(s/(2*Math.PI),0)?Math.round(s/(2*Math.PI))*Math.PI*2:eP(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(s/(2*Math.PI))*Math.PI*2:Math.floor(s/(2*Math.PI))*Math.PI*2,{from:{angle:s},to:{angle:r}});this.props=n,this.propKeys=["angle"],this.from=a,this.to=n}}class yQ extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e;super.onBind();let{diffAttrs:i={}}=null!=(t=this.target.context)?t:{},{options:s}=this.params;i=Object.assign({},i),(null==(e=null==s?void 0:s.excludeChannels)?void 0:e.length)&&s.excludeChannels.forEach(t=>{delete i[t]}),this.props=i}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;let s=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;let i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],s,this,this.target)}),this.onUpdate(t,s,i)}}class y0 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;let s=this.easing(e);
2this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;let i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],s,this,this.target)}),this.onUpdate(t,s,i),this.syncAttributeUpdate()}}class y1 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r),this.from=null!=t?t:{}}onBind(){var t,e;super.onBind(),Object.keys(this.from).forEach(t=>{null==this.props[t]&&(this.props[t]=this.target.getGraphicAttribute(t))});let i=this.target.getFinalAttribute();"appear"===(null==(t=this.target.context)?void 0:t.animationState)&&i&&this.target.setAttributes(i),!1!==(null==(e=this.params.controlOptions)?void 0:e.immediatelyApply)&&this.target.setAttributes(this.from)}onFirstRun(){this.from=Object.assign(Object.assign({},this.getLastProps()),this.from);let t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach(e=>{var i;this.from[e]=null!=(i=this.from[e])?i:t[e]}),this.target.setAttributes(this.from)}deleteSelfAttr(t){super.deleteSelfAttr(t),delete this.from[t]}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;let s=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.from,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;let i=this.propKeys[e];t(i,this.from[i],this.props[i],s,this,this.target)}),this.onUpdate(t,s,i),this.syncAttributeUpdate()}}class y2 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r,a,n,l,o,h;let u,d,c,p,g;super.onBind();let{from:f,to:m}=(s=this.target,r=this.params.options,a=this.params,!1!==(null!=(n=null==r?void 0:r.overall)&&n)?(c=(d=s.getFinalAttribute()).y,p=d.y1,g=d.height,r&&"negative"===r.orient?ed(r.overall)?u=r.overall:a.group?(u=null!=(h=null!=(l=a.groupHeight)?l:null==(o=r.layoutRect)?void 0:o.height)?h:a.group.getBounds().height(),a.groupHeight=u):u=a.height:u=ed(null==r?void 0:r.overall)?r.overall:0,{from:{y:u,y1:(0,eE.A)(p)?void 0:u,height:(0,eE.A)(g)?void 0:0},to:{y:c,y1:p,height:g}}):function(t,e){let i=t.getFinalAttribute(),s=i.y,r=i.y1,a=i.height;if(e&&"negative"===e.orient){let t=(0,eA.A)(a)?Math.max(s,s+a):Math.max(s,r);return{from:{y:t,y1:(0,eE.A)(r)?void 0:t,height:(0,eE.A)(a)?void 0:0},to:{y:s,y1:r,height:a}}}let n=(0,eA.A)(a)?Math.min(s,s+a):Math.min(s,r);return{from:{y:n,y1:(0,eE.A)(r)?void 0:n,height:(0,eE.A)(a)?void 0:0},to:{y:s,y1:r,height:a}}}(s,r)),_=null!=(e=null==(t=this.target.context)?void 0:t.lastAttrs)?e:f;this.props=m,this.propKeys=Object.keys(m).filter(t=>null!=m[t]),this.from=_,this.to=m;let y=this.target.getFinalAttribute();y&&this.target.setAttributes(y),!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(_)}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y3 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r,a,n;let l,o,h,u;super.onBind();let{from:d,to:c}=(t=this.target,e=this.params.options,i=this.params,!1!==(null!=(s=null==e?void 0:e.overall)&&s)?(h=(o=t.getFinalAttribute()).y1,u=o.height,e&&"negative"===e.orient?ed(e.overall)?l=e.overall:i.group?(l=null!=(n=null!=(r=i.groupHeight)?r:null==(a=e.layoutRect)?void 0:a.height)?n:i.group.getBounds().height(),i.groupHeight=l):l=i.height:l=ed(null==e?void 0:e.overall)?e.overall:0,{to:{y:l,y1:(0,eE.A)(h)?void 0:l,height:(0,eE.A)(u)?void 0:0}}):function(t,e){let i=t.getFinalAttribute(),s=i.y,r=i.y1,a=i.height;if(e&&"negative"===e.orient){let t=(0,eA.A)(a)?Math.max(s,s+a):Math.max(s,r);return{to:{y:t,y1:(0,eE.A)(r)?void 0:t,height:(0,eE.A)(a)?void 0:0}}}let n=(0,eA.A)(a)?Math.min(s,s+a):Math.min(s,r);return{to:{y:n,y1:(0,eE.A)(r)?void 0:n,height:(0,eE.A)(a)?void 0:0}}}(t,e));this.props=c,this.propKeys=Object.keys(c).filter(t=>null!=c[t]),this.from=null!=d?d:this.target.attribute,this.to=c}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y5 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r,a,n,l;let o,h,u,d,c;super.onBind();let{from:p,to:g}=(s=this.target,r=this.params.options,a=this.params,!1!==(null!=(n=null==r?void 0:r.overall)&&n)?(u=(h=s.getFinalAttribute()).x,d=h.x1,c=h.width,r&&"negative"===r.orient?ed(r.overall)?o=r.overall:a.group?(o=null!=(l=a.groupWidth)?l:a.group.getBounds().width(),a.groupWidth=o):o=a.width:o=ed(null==r?void 0:r.overall)?null==r?void 0:r.overall:0,{from:{x:o,x1:(0,eE.A)(d)?void 0:o,width:(0,eE.A)(c)?void 0:0},to:{x:u,x1:d,width:c}}):function(t,e){let i=t.getFinalAttribute(),s=i.x,r=i.x1,a=i.width;if(e&&"negative"===e.orient){let t=(0,eA.A)(a)?Math.max(s,s+a):Math.max(s,r);return{from:{x:t,x1:(0,eE.A)(r)?void 0:t,width:(0,eE.A)(a)?void 0:0},to:{x:s,x1:r,width:a}}}let n=(0,eA.A)(a)?Math.min(s,s+a):Math.min(s,r);return{from:{x:n,x1:(0,eE.A)(r)?void 0:n,width:(0,eE.A)(a)?void 0:0},to:{x:s,x1:r,width:a}}}(s,r)),f=null!=(e=null==(t=this.target.context)?void 0:t.lastAttrs)?e:p;this.props=g,this.propKeys=Object.keys(g).filter(t=>null!=g[t]),this.from=f,this.to=g;let m=this.target.getFinalAttribute();m&&this.target.setAttributes(m),!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(f)}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y4 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i,s,r;let a,n,l,o;
2super.onBind();let{from:h,to:u}=(t=this.target,e=this.params.options,i=this.params,!1!==(null!=(s=null==e?void 0:e.overall)&&s)?(l=(n=t.getFinalAttribute()).x1,o=n.width,e&&"negative"===e.orient?ed(e.overall)?a=e.overall:i.group?(a=null!=(r=i.groupWidth)?r:i.group.getBounds().width(),i.groupWidth=a):a=i.width:a=ed(null==e?void 0:e.overall)?e.overall:0,{to:{x:a,x1:(0,eE.A)(l)?void 0:a,width:(0,eE.A)(o)?void 0:0}}):function(t,e){let i=t.getFinalAttribute(),s=i.x,r=i.x1,a=i.width;if(e&&"negative"===e.orient){let t=(0,eA.A)(a)?Math.max(s,s+a):Math.max(s,r);return{to:{x:t,x1:(0,eE.A)(r)?void 0:t,width:(0,eE.A)(a)?void 0:0}}}let n=(0,eA.A)(a)?Math.min(s,s+a):Math.min(s,r);return{to:{x:n,x1:(0,eE.A)(r)?void 0:n,width:(0,eE.A)(a)?void 0:0}}}(t,e));this.props=u,this.propKeys=Object.keys(u).filter(t=>null!=u[t]),this.from=null!=h?h:this.target.attribute,this.to=u}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y8 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t,e,i;super.onBind();let{from:s,to:r}=((t,e,i)=>{let s=t.getFinalAttribute();switch(null==e?void 0:e.direction){case"x":{let t=s.x,e=s.x1,i=s.width;return{from:(0,eA.A)(i)?{x:t+i/2,x1:void 0,width:0}:{x:(t+e)/2,x1:(t+e)/2,width:void 0},to:{x:t,x1:e,width:i}}}case"y":{let t=s.y,e=s.y1,i=s.height;return{from:(0,eA.A)(i)?{y:t+i/2,y1:void 0,height:0}:{y:(t+e)/2,y1:(t+e)/2,height:void 0},to:{y:t,y1:e,height:i}}}default:{let t=s.x,e=s.x1,i=s.width,r=s.y,a=s.y1,n=s.height,l={};return(0,eA.A)(i)?(l.x=t+i/2,l.width=0,l.x1=void 0):(l.x=(t+e)/2,l.x1=(t+e)/2,l.width=void 0),(0,eA.A)(n)?(l.y=r+n/2,l.height=0,l.y1=void 0):(l.y=(r+a)/2,l.y1=(r+a)/2,l.height=void 0),{from:l,to:{x:t,y:r,x1:e,y1:a,width:i,height:n}}}}})(this.target,this.params.options,this.params),a=null!=(e=null==(t=this.target.context)?void 0:t.lastAttrs)?e:s;this.props=r,this.propKeys=Object.keys(r).filter(t=>null!=r[t]),this.from=a,this.to=r;let n=this.target.getFinalAttribute();n&&this.target.setAttributes(n),!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(a)}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y6 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){super.onBind();let{from:t,to:e}=((t,e,i)=>{let s=t.attribute;switch(null==e?void 0:e.direction){case"x":{let t=s.x,e=s.x1,i=s.width;return{to:(0,eA.A)(i)?{x:t+i/2,x1:void 0,width:0}:{x:(t+e)/2,x1:(t+e)/2,width:void 0}}}case"y":{let t=s.y,e=s.y1,i=s.height;return{to:(0,eA.A)(i)?{y:t+i/2,y1:void 0,height:0}:{y:(t+e)/2,y1:(t+e)/2,height:void 0}}}default:{let t=s.x,e=s.y,i=s.x1,r=s.y1,a=s.width,n=s.height,l={};return(0,eA.A)(a)?(l.x=t+a/2,l.width=0,l.x1=void 0):(l.x=(t+i)/2,l.x1=(t+i)/2,l.width=void 0),(0,eA.A)(n)?(l.y=e+n/2,l.height=0,l.y1=void 0):(l.y=(e+r)/2,l.y1=(e+r)/2,l.height=void 0),{to:l}}}})(this.target,this.params.options,this.params);this.props=e,this.propKeys=Object.keys(e).filter(t=>null!=e[t]),this.from=null!=t?t:this.target.attribute,this.to=e}onEnd(t){super.onEnd(t)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y9 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class y7 extends y9{onBind(){var t,e,i,s,r,a;let n,l,o;super.onBind();let{from:h,to:u}=(s=this.target,r=this.params.options,this.params,!1!==(null!=(a=null==r?void 0:r.overall)&&a)?(n=s.getFinalAttribute(),{from:{innerRadius:l=ed(null==r?void 0:r.overall)?r.overall:0,outerRadius:l},to:{innerRadius:null==n?void 0:n.innerRadius,outerRadius:null==n?void 0:n.outerRadius}}):(o=s.getFinalAttribute(),r&&"inside"===r.orient?{from:{innerRadius:null==o?void 0:o.outerRadius},to:{innerRadius:null==o?void 0:o.innerRadius}}:{from:{outerRadius:null==o?void 0:o.innerRadius},to:{outerRadius:null==o?void 0:o.outerRadius}})),d=null!=(e=null==(t=this.target.context)?void 0:t.lastAttrs)?e:h;this.props=u,this.propKeys=Object.keys(u).filter(t=>null!=u[t]),this.from=d,this.to=u;let c=this.target.getFinalAttribute();c&&this.target.setAttributes(c),!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(d)}}class vt extends y9{onBind(){var t,e,i;let s,r,a;super.onBind();let{to:n}=(t=this.target,e=this.params.options,this.params,!1!==(null!=(i=null==e?void 0:e.overall)&&i)?(s=t.getFinalAttribute(),r=ed(null==e?void 0:e.overall)?e.overall:0,{from:{innerRadius:null==s?void 0:s.innerRadius,outerRadius:null==s?void 0:s.outerRadius},to:{innerRadius:r,outerRadius:r}}):(a=t.getFinalAttribute(),e&&"inside"===e.orient?{from:{innerRadius:null==a?void 0:a.innerRadius},to:{innerRadius:null==a?void 0:a.outerRadius}}:{from:{outerRadius:null==a?void 0:a.outerRadius},to:{outerRadius:null==a?void 0:a.innerRadius}}));this.props=n,this.propKeys=Object.keys(n).filter(t=>null!=n[t]),this.from=this.target.attribute,this.to=n}}class ve extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}determineUpdateFunction(){this.propKeys?this.propKeys&&this.propKeys.length>1?this._updateFunction=this.updateAngle:"startAngle"===this.propKeys[0]?this._updateFunction=this.updateStartAngle:"endAngle"===this.propKeys[0]?this._updateFunction=this.updateEndAngle:this.valid=!1:this.valid=!1}deleteSelfAttr(t){delete this.props[t],this.fromProps&&delete this.fromProps[t];let e=this.propKeys.indexOf(t);-1!==e&&this.propKeys.splice(e,1),this.propKeys&&this.propKeys.length>1?this._updateFunction=this.updateAngle:"startAngle"===this.propKeys[0]?this._updateFunction=this.updateStartAngle:"endAngle"===this.propKeys[0]?this._updateFunction=this.updateEndAngle:this._updateFunction=null}updateStartAngle(t){this.target.attribute.startAngle=this.from.startAngle+(this.to.startAngle-this.from.startAngle)*t}updateEndAngle(t){this.target.attribute.endAngle=this.from.endAngle+(this.to.endAngle-this.from.endAngle)*t}updateAngle(t){this.updateStartAngle(t),this.updateEndAngle(t)}
2onUpdate(t,e,i){this._updateFunction&&(this._updateFunction(e),this.target.addUpdateShapeAndBoundsTag())}}class vi extends ve{onBind(){var t,e,i,s,r,a;let n;super.onBind();let{from:l,to:o}=(s=this.target,r=this.params.options,this.params,!1!==(null!=(a=null==r?void 0:r.overall)&&a)?((t,e,i)=>{let s=t.getFinalAttribute();if(e&&"anticlockwise"===e.orient){let t=ed(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t,endAngle:t},to:{startAngle:null==s?void 0:s.startAngle,endAngle:null==s?void 0:s.endAngle}}}let r=ed(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:r,endAngle:r},to:{startAngle:null==s?void 0:s.startAngle,endAngle:null==s?void 0:s.endAngle}}})(s,r):(n=s.getFinalAttribute(),r&&"anticlockwise"===r.orient?{from:{startAngle:null==n?void 0:n.endAngle},to:{startAngle:null==n?void 0:n.startAngle}}:{from:{endAngle:null==n?void 0:n.startAngle},to:{endAngle:null==n?void 0:n.endAngle}})),h=null!=(e=null==(t=this.target.context)?void 0:t.lastAttrs)?e:l;this.props=o,this.propKeys=Object.keys(o).filter(t=>null!=o[t]),this.from=h,this.to=o;let u=this.target.getFinalAttribute();u&&this.target.setAttributes(u),!1!==(null==(i=this.params.controlOptions)?void 0:i.immediatelyApply)&&this.target.setAttributes(h),this.determineUpdateFunction()}}class vs extends ve{onBind(){var t,e,i;let s;super.onBind();let{from:r,to:a}=(t=this.target,e=this.params.options,this.params,!1!==(null!=(i=null==e?void 0:e.overall)&&i)?((t,e,i)=>{let s=t.attribute;if(e&&"anticlockwise"===e.orient){let t=ed(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:s.startAngle,endAngle:s.endAngle},to:{startAngle:t,endAngle:t}}}let r=ed(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:s.startAngle,endAngle:s.endAngle},to:{startAngle:r,endAngle:r}}})(t,e):(s=t.attribute,e&&"anticlockwise"===e.orient?{from:{startAngle:s.startAngle},to:{startAngle:null==s?void 0:s.endAngle}}:{from:{endAngle:s.endAngle},to:{endAngle:null==s?void 0:s.startAngle}}));this.props=a,this.propKeys=Object.keys(a).filter(t=>null!=a[t]),this.from=null!=r?r:this.target.attribute,this.to=a,this.determineUpdateFunction()}}let vr=(t,e,i)=>{let s=t.getFinalAttribute().points,r={x:0,y:0};return s.forEach(t=>{r.x+=t.x,r.y+=t.y}),r.x/=s.length,r.y/=s.length,e&&e.center&&(eP(e.center.x)&&(r.x=e.center.x),eP(e.center.y)&&(r.y=e.center.y)),"area"===t.type&&(r.x1=r.x,r.y1=r.y),s.map(t=>Object.assign({},t,r))};class va extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onUpdate(t,e,i){var s,r;let a=null==(s=this.from)?void 0:s.points,n=null==(r=this.to)?void 0:r.points;a&&n&&(this.target.attribute.points=a.map((t,i)=>aa(a[i],n[i],e)),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag())}}class vn extends va{onBind(){var t,e,i;if(super.onBind(),["area","line","polygon"].includes(this.target.type)){let s,{from:r,to:a}=(e=this.target,i=this.params.options,this.params,s=e.getFinalAttribute(),{from:{points:vr(e,i)},to:{points:s.points}});this.props=a,this.propKeys=Object.keys(a).filter(t=>null!=a[t]),this.from=r,this.to=a;let n=this.target.getFinalAttribute();n&&this.target.setAttributes(n),!1!==(null==(t=this.params.controlOptions)?void 0:t.immediatelyApply)&&this.target.setAttributes(r)}else this.valid=!1}}class vl extends va{onBind(){var t,e;if(super.onBind(),["area","line"].includes(this.target.type)){let i=this.target.getFinalAttribute(),{from:s,to:r}=(t=this.target,e=this.params.options,this.params,{from:{points:t.getFinalAttribute().points},to:{points:vr(t,e)}});this.props=r,this.propKeys=Object.keys(r).filter(t=>null!=r[t]),this.from=s||i,this.to=r}else this.valid=!1}}let vo=(t,e,i)=>t.getFinalAttribute().points.map(i=>{if(e&&"negative"===e.orient){let e=t.stage.viewWidth;return t.parent.parent.parent&&(e=t.parent.parent.parent.AABBBounds.width()),Object.assign(Object.assign({},i),{x:e,y:i.y,x1:e,y1:i.y1,defined:!1!==i.defined})}return Object.assign(Object.assign({},i),{x:0,y:i.y,x1:0,y1:i.y1,defined:!1!==i.defined})});class vh extends va{onBind(){var t,e,i;if(super.onBind(),["area","line","polygon"].includes(this.target.type)){let s,{from:r,to:a}=(e=this.target,i=this.params.options,this.params,s=e.getFinalAttribute(),{from:{points:vo(e,i)},to:{points:s.points}});this.props=a,this.propKeys=Object.keys(a).filter(t=>null!=a[t]),this.from=r,this.to=a;let n=this.target.getFinalAttribute();n&&this.target.setAttributes(n),!1!==(null==(t=this.params.controlOptions)?void 0:t.immediatelyApply)&&this.target.setAttributes(r)}else this.valid=!1}}class vu extends va{onBind(){var t,e;if(super.onBind(),["area","line"].includes(this.target.type)){let i=this.target.getFinalAttribute(),{from:s,to:r}=(t=this.target,e=this.params.options,this.params,{from:{points:t.getFinalAttribute().points},to:{points:vo(t,e)}});this.props=r,this.propKeys=Object.keys(r).filter(t=>null!=r[t]),this.from=s||i,this.to=r}else this.valid=!1}}let vd=(t,e,i)=>t.getFinalAttribute().points.map(i=>{if(e&&"negative"===e.orient){let e=t.stage.viewHeight;return t.parent.parent.parent&&(e=t.parent.parent.parent.AABBBounds.height()),Object.assign(Object.assign({},i),{x:i.x,y:e,x1:i.x1,y1:e,defined:!1!==i.defined})}return Object.assign(Object.assign({},i),{x:i.x,y:0,x1:i.x1,y1:0,defined:!1!==i.defined})});class vc extends va{onBind(){var t,e,i;if(super.onBind(),["area","line","polygon"].includes(this.target.type)){let s,{from:r,to:a}=(e=this.target,i=this.params.options,this.params,s=e.getFinalAttribute(),{from:{points:vd(e,i)},to:{points:s.points}});this.props=a,this.propKeys=Object.keys(a).filter(t=>null!=a[t]),this.from=r,this.to=a;let n=this.target.getFinalAttribute();n&&this.target.setAttributes(n),!1!==(null==(t=this.params.controlOptions)?void 0:t.immediatelyApply)&&this.target.setAttributes(r)}else this.valid=!1}}class vp extends va{onBind(){var t,e;if(super.onBind(),["area","line","polygon"].includes(this.target.type)){let{from:i,to:s}=(t=this.target,e=this.params.options,this.params,{from:{points:t.getFinalAttribute().points},to:{points:vd(t,e)}});this.props=s,this.propKeys=Object.keys(s).filter(t=>null!=s[t]),this.from=null!=i?i:this.target.attribute,this.to=s}else this.valid=!1}}class vg extends yW{constructor(t,e,i,s,r){super(t,e,i,s,r),this.keys=["clipRange"],this.from={clipRange:0}}onFirstRun(){var t;super.onFirstRun();let{clipDimension:e}=(null==(t=this.params)?void 0:t.options)||{};e&&(this.target.attribute.clipRangeByDimension=e)}}class vf extends yU{constructor(t,e,i,s,r){super(t,e,i,s,r),this.keys=["clipRange"]}}let vm={type:"fadeIn"};
2class v_ extends _e{constructor(t,e,i,s,r){super(t,e,i,s,r),this.currentAnimationRatio=0,this.animationTime=0}onUpdate(t,e,i){super.onUpdate(t,e,i),this.currentAnimationRatio=e,this.animationTime=e*Math.PI*2}getAnimationTime(){return this.currentAnimationRatio>0?this.animationTime:Date.now()/1e3}afterStageRender(t,e){var i,s;return null==(s=null==(i=this.params)?void 0:i.callBack)?void 0:s.call(i,t,e,this.currentAnimationRatio,this.animationTime)}}let vy={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"}},vv={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"}},vb={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"}},vx=()=>{uP.registerAnimation("scaleInOut",()=>vv)},vS=()=>{uP.registerAnimation("fadeInOut",()=>vb)},vA=(t,e)=>({appear:function(t,e){switch(e){case"grow":return{type:"horizontal"===t.direction?"growPointsXIn":"growPointsYIn",options:{orient:"horizontal"===t.direction?"positive":"negative"}};case"fadeIn":return vm;default:return{type:"clipIn",options:{clipDimension:"horizontal"===t.direction?"y":"x"}}}}
2(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined","segments"]}},{channel:["points","segments"],custom:yj,duration:vy.update.duration,easing:vy.update.easing,customParameters:{clipRangeByDimension:"horizontal"===t.direction?"y":"x"}}]}),vk=()=>{uP.registerAnimation("line",vA)},vM=()=>{y_.registerBuiltInAnimate("growPointsIn",vn),y_.registerBuiltInAnimate("growPointsOut",vl),y_.registerBuiltInAnimate("growPointsXIn",vh),y_.registerBuiltInAnimate("growPointsXOut",vu),y_.registerBuiltInAnimate("growPointsYIn",vc),y_.registerBuiltInAnimate("growPointsYOut",vp),y_.registerBuiltInAnimate("clipIn",vg),y_.registerBuiltInAnimate("clipOut",vf)},vw=(t,e)=>{if(!e||!e.length)return[];let i=[];return t.markIds?e.filter(e=>{t.markIds.includes(e.getProductId())&&i.push(e)}):t.markNames?e.forEach(e=>{t.markNames.includes(e.name)&&i.push(e)}):e.forEach(t=>{i.push(t)}),i},vT=t=>t.filterField?e=>{var i;return null==(i=u3(e))?void 0:i[t.filterField]}:e=>e.context[t.filterType],vC={highlightState:U.STATE_HIGHLIGHT,blurState:U.STATE_BLUR,trigger:"pointerover",triggerOff:"pointerout"};class vB{constructor(t){this._markSet=new fg,this.options=t,t.marks&&t.marks.length&&t.marks.forEach(t=>{this.registerMark(t)})}getMarks(){return this._markSet.getMarks()}getMarksByState(t){if(this._markIdByState&&this._markSet){let e=this._markIdByState[t];return e?this.getMarks().filter(t=>t&&e.includes(t.id)):[]}return[]}registerMark(t){(0,ev.A)(t)?t.forEach(t=>{this._markSet.addMark(t)}):this._markSet.addMark(t)}updateMarkIdByState(t){this._markIdByState=((t,e)=>{if(!e||!t)return null;let i={};return t.forEach(t=>{let s=t.stateStyle;s&&e.forEach(e=>{e&&s[e]&&(i[e]||(i[e]=[]),i[e].push(t.id))})}),i})(this.getMarks(),t)}getMarkIdByState(){var t;return null!=(t=this._markIdByState)?t:{}}isGraphicInStateMark(t,e){var i;let s=this.getMarkIdByState();return s&&s[e]&&s[e].includes(null==(i=t.context)?void 0:i.markId)}isGraphicInMark(t){var e;return!!this._markSet.getMarkInId(null==(e=t.context)?void 0:e.markId)}getStartState(){return null}getResetState(){return null}init(){let t=this.getEvents();t&&this.options.event&&t.forEach(t=>{t.type&&t.handler&&((0,ev.A)(t.type)?t.type.forEach(e=>{e&&"none"!==e&&this.options.event.on(e,t.handler)}):"none"!==t.type&&this.options.event.on(t.type,t.handler))})}release(){let t=this.getEvents();t&&this.options.event&&(null!=t?t:[]).forEach(t=>{t.type&&t.handler&&((0,ev.A)(t.type)?t.type.forEach(e=>{e&&"none"!==e&&this.options.event.on(e,t.handler)}):"none"!==t.type&&this.options.event.off(t.type,t.handler))})}start(t,e){}reset(t,e){}dispatchEvent(t,e){this.options.event&&(this.options.event.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))}}let vE={highlightState:U.STATE_HIGHLIGHT,blurState:U.STATE_BLUR,trigger:"pointerover",triggerOff:"pointerout"};class vP extends vB{constructor(t){super(t),this.type="element-highlight",this.resetAll=t=>{let{highlightState:e,blurState:i,interaction:s}=this.options;this._lastGraphic&&(s.clearAllStatesOfTrigger(this,e,i),this.dispatchEvent("reset",Object.assign({graphics:[this._lastGraphic],options:this.options},t)),this._lastGraphic=null,s.setStatedGraphics(this,[]))},this.handleStart=t=>{this.start(t.item,t)},this.handleReset=t=>{let{interaction:e}=this.options,i=e.getStatedGraphics(this);if(!i||!i.length)return;let s=t.item,r=s&&this._markSet.getMarkInId(s.context.markId);(this._resetType.includes("view")&&!r||this._resetType.includes("self")&&r)&&this.resetAll(t)},this.options=Object.assign({},vE,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){let t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}],i=t;return(0,eS.A)(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}start(t,e){if(t&&this._markSet.getMarkInId(t.context.markId)){let{highlightState:i,blurState:s,interaction:r}=this.options;if(this._lastGraphic===t)return;let a=r.updateStates(this,[t],r.getStatedGraphics(this),i,s);r.setStatedGraphics(this,a),this._lastGraphic=t,this.dispatchEvent("start",Object.assign({graphics:a,options:this.options},e))}else this._lastGraphic&&"view"===this._resetType&&this.resetAll(e)}reset(t,e){t?this._markSet.getMarkInId(t.context.markId)&&t.removeState([this.options.highlightState,this.options.blurState]):this.resetAll(e)}}vP.type="element-highlight",vP.defaultOptions=vE;
2let vO={state:U.STATE_SELECTED,trigger:"click"};class vR extends vB{constructor(t){super(t),this.type="element-select",this._resetType=[],this.resetAll=t=>{let{state:e,reverseState:i,interaction:s}=this.options,r=s.getStatedGraphics(this);r&&r.length&&(s.clearAllStatesOfTrigger(this,e,i),this.dispatchEvent("reset",Object.assign({graphics:r,options:this.options},t)),s.setStatedGraphics(this,[]))},this.handleStart=t=>{this.start(t.item,t)},this.handleReset=t=>{let{interaction:e}=this.options,i=e.getStatedGraphics(this);if(!i||!i.length)return;let s=t.item,r=s&&this._markSet.getMarkInId(s.context.markId);(this._resetType.includes("view")&&!r||this._resetType.includes("self")&&r)&&this.resetAll(t)},this.options=Object.assign({},vO,t),this.updateMarkIdByState([this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getResetState(){return this.options.reverseState}getEvents(){let t,e,i,s=this.options.triggerOff,r=this.options.trigger,a=[{type:r,handler:this.handleStart}],{eventNames:n,resetType:l}=(t=oS(s),e=[],i=[],t.forEach(t=>{"empty"===t?e.push("view"):(0,eS.A)(t)&&"none"!==t?t.includes("view:")?(i.push(t.replace("view:","")),e.push("view")):(i.push(t),e.push("self")):ed(t)&&e.push("timeout")}),{eventNames:i,resetType:e});return n.forEach(t=>
2{t&&((0,ev.A)(r)?!r.includes(t):t!==r)&&a.push({type:t,handler:this.handleReset})}),this._resetType=l,a}start(t,e){let{state:i,reverseState:s,isMultiple:r,interaction:a}=this.options,n=a.getStatedGraphics(this);if(t&&this._markSet.getMarkInId(t.context.markId))if(t.hasState(i)){if(this._resetType.includes("self")){let r=n&&n.filter(e=>e!==t);r&&r.length?a.setStatedGraphics(this,a.updateStates(this,r,n,i,s)):this.resetAll(e)}}else{this._timer&&clearTimeout(this._timer),t.addState(i,!0);let l=this.options.interaction.updateStates(this,r&&n?[...n,t]:[t],n,i,s);a.setStatedGraphics(this,l),this.dispatchEvent("start",Object.assign({graphics:l,options:this.options},e)),this._resetType.includes("timeout")&&(this._timer=setTimeout(()=>{this.resetAll(e)},this.options.triggerOff))}else this._resetType.includes("view")&&n&&n.length&&this.resetAll(e)}reset(t,e){t?this._markSet.getMarkInId(t.context.markId)&&t.removeState([this.options.state,this.options.reverseState]):this.resetAll(e)}}vR.type="element-select",vR.defaultOptions=vO;class vI extends yc{constructor(t){super(),this.globalInstance=t}onInit(){this._plugins.forEach(t=>{t.onInit&&t.onInit(this)})}releaseAll(){super.releaseAll(),this.globalInstance=null}}var vL=function(t,e,i,s){return new(i||(i=Promise))(function(r,a){function n(t){try{o(s.next(t))}catch(t){a(t)}}function l(t){try{o(s.throw(t))}catch(t){a(t)}}function o(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(n,l)}o((s=s.apply(t,e||[])).next())})},vD=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class vF{static useRegisters(t){t.forEach(t=>{"function"==typeof t?t():console.error("Invalid function:",t)})}static useChart(t){t.forEach(t=>uP.registerChart(t.type,t))}static useSeries(t){t.forEach(t=>uP.registerSeries(t.type,t))}static useComponent(t){t.forEach(t=>uP.registerComponent(t.type,t))}static useMark(t){t.forEach(t=>{var e;return uP.registerMark(null!=(e=t.constructorType)?e:t.type,t)})}static useLayout(t){t.forEach(t=>uP.registerLayout(t.type,t))}static registerDataSetTransform(t,e){uP.registerTransform(t,e)}static registerFunction(t,e){t&&e&&_H.instance().registerFunction(t,e)}static unregisterFunction(t){t&&_H.instance().unregisterFunction(t)}static getFunction(t){return t?_H.instance().getFunction(t):null}static getFunctionList(){return _H.instance().getFunctionNameList()}static registerMap(t,e,i){let s=uP.getImplementInKey("registerMap");s&&s(t,e,i)}static unregisterMap(t){let e=uP.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return c4.get(t)}static registerSVG(t,e,i){let s=uP.getImplementInKey("registerSVG");s&&s(t,e,i)}static unregisterSVG(t){let e=uP.getImplementInKey("unregisterSVG");e&&e(t)}static hideTooltip(t=[]){uY.forEach(t=>{var e;return null==(e=null==t?void 0:t.hideTooltip)?void 0:e.call(t)},t)}static getLogger(){return eg.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}get event(){return this._event}getDataSet(){return this._dataSet}constructor(t,e){var i,s,r,a,n,l,o,h,u;this.id=hH(),this._userEvents=[],this._autoSize=!0,this._option={mode:hd["desktop-browser"],onError:t=>{throw Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._renderState=H.render,this._disableDimensionHoverEvent=!1,this._doResize=()=>{let{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)||e.render(t.morphConfig),this._updateAnimateState(!1),this._afterRender()),this},this._updateSpec=(t,e=!1,i)=>{var s;this._reSetRenderState();let r=this._spec,a={changeBackground:!1,reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(!this._setNewSpec(t,e))return;if((0,ex.n)(r.theme,this._spec.theme)?(0,ex.n)(this._spec.background,r.background)||(a.reMake=!0,a.changeBackgroun
2d=!0):a.changeTheme=!0,a.reSize=this._shouldChartResize(r),this._spec.type!==r.type)return null==(s=this._compiler)||s.updateLayoutTag(),a.reMake=!0,a.reTransformSpec=!0,a.change=!0,a.changeTheme=!0,a;this._initChartSpec(this._spec,"updateSpec");let n=fc(this._chart.updateSpec(this._spec),a);return i?Object.assign(Object.assign({},n),i):n},this.getTheme=(...t)=>{if(!this._currentTheme||!t||!t.length)return;this._cachedProcessedTheme||(this._cachedProcessedTheme={});let e=t.join(".");if(this._cachedProcessedTheme[e])return this._cachedProcessedTheme[e];let i=this._currentTheme;return t.forEach((e,s)=>{if(1!==s||"series"!==t[0]&&"component"!==t[0])i=null==i?void 0:i[e];else{let s="series"===t[0]?uP.getSeriesBuiltInTheme(e):uP.getComponentBuiltInTheme(e);i=i?uy({},s,i[e]):s}s===t.length-1&&(0,eA.A)(i)&&(i=function t(e,i,s){if(!e)return e;i||(i=e.colorScheme),s||(s=e.token);let r={};return Object.keys(e).forEach(a=>{var n;let l=e[a];yu.includes(a)?r[a]=l:(0,ew.A)(l)?uf(l)?r[a]=ug(l,i):l&&"token"===l.type&&l.key?r[a]=(n=s)&&l.key in n?n[l.key]:l.default:r[a]=t(l,i,s):r[a]=l}),r}({[e]:i},this._currentTheme.colorScheme,this._currentTheme.token)[e])}),this._cachedProcessedTheme[e]=i,i},function t(e,i=!1){if(null===e||"object"!=typeof e)return e;for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(void 0===e[s]){delete e[s];continue}i&&t(e[s],i)}}(e),this._option=Object.assign(Object.assign({},this._option),e),(null==e?void 0:e.optimize)&&(this._option.optimize=Object.assign(Object.assign({},this._option.optimize),e.optimize)),this._onError=null==(i=this._option)?void 0:i.onError;const d=this._option,{dom:c,renderCanvas:p,mode:g,stage:f,poptip:m}=d,_=vD(d,["dom","renderCanvas","mode","stage","poptip"]),y=hJ(g);if(y?ye(e7):"node"===g&&yh(e7),y&&c&&(this._container=(0,eS.A)(c)?hL.getElementById(c):c),p&&(this._canvas=p),f&&(this._stage=f),"node"!==g&&!this._container&&!this._canvas&&!this._stage)return void(null==(s=this._option)||s.onError("please specify container or renderCanvas!"));this._viewBox=this._option.viewBox,this._currentThemeName=u$.getCurrentThemeName(),this._setNewSpec(t),this._updateCurrentTheme(),this._currentSize=this.getCurrentSize();const v=[];!1!==m&&v.push("poptipForText"),"sankey"===t.type&&v.push("scrollbar");const b=new eg(null!=(r=this._option.logLevel)?r:hp.Error);eg.setInstance(b),(null==(a=this._option)?void 0:a.onError)&&b.addErrorHandler((...t)=>{var e,i;null==(i=null==(e=this._option)?void 0:e.onError)||i.call(e,...t)}),this._compiler=new pX({dom:null!=(n=this._container)?n:"none",canvas:p},Object.assign(Object.assign({mode:this._option.mode,stage:f,pluginList:v},_),{background:this._getBackground(),onError:this._onError})),this._compiler.setSize(this._currentSize.width,this._currentSize.height),this._eventDispatcher=new u8(this,this._compiler),this._event=new uK(this._eventDispatcher,g),this._compiler.initView(),this._compiler.updateLayoutTag(),this._setFontFamilyTheme(this.getTheme("fontFamily")),this._initDataSet(this._option.dataSet),this._autoSize=!!y&&(null==(o=null!=(l=t.autoFit)?l:this._option.autoFit)||o),this._bindResizeEvent(),this._bindViewEvent(),this._initChartPlugin(),uY.registerInstance(this),null==(u=null==(h=this._option.performanceHook)?void 0:h.afterCreateVChart)||u.call(h,this)}_setNewSpec(t,e){return!!t&&((0,eS.A)(t)&&(t=JSON.parse(t)),e&&this._originalSpec&&(t=uy({},this._originalSpec,t)),this._originalSpec=t,this._spec=this._getSpecFromOriginalSpec(),!0)}_getSpecFromOriginalSpec(){var t;let e=function t(e,i={data:t=>t}){if(!e)return e;if(e.constructor===Object){let s={};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(i[r]){s[r]=i[r](e[r]);continue}s[r]=t(e[r],i)}return s}return(0,ev.A)(e)?e.map(e=>t(e,i)):e}(this._originalSpec);return e.data=null!=(t=e.data)?t:[],e}_initChartSpec(t,e){var i,s;vF.getFunctionList()&&vF.getFunctionList().length&&(t=function t(e,i){if(!e)return e;if((0,ew.A)(e)){let s={};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if((0,eS.A)(e[r])&&i.getFunction(e[r])){s[r]=i.getFunction(e[r]);continue}s[r]=t(e[r],i)}return s}return(0,ev.A)(e)?e.map(e=>t(e,i)):e}(t,vF)),this._spec=t,this._chartSpecTransformer||(this._chartSpecTransformer=uP.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),null==(i=this._chartSpecTransformer)||i.transformSpec(this._spec),this._chartPluginApply("onAfterChartSpecTransform",this._spec,e),this._specInfo=null==(s=this._chartSpecTransformer)?void 0:s.transformModelSpec(this._spec),this._chartPluginApply("onAfterModelSpecTransform",this._spec,this._specInfo,e)}_updateSpecInfo(){var t;this._chartSpecTransformer||(this._chartSpecTransformer=uP.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),this._specInfo=null==(t=this._chartSpecTransformer)?void 0:t.createSpecInfo(this._spec)}_initChart(t){var e,i,s;if(!this._compiler)return void(null==(e=this._option)||e.onError("compiler is not initialized"));if(this._chart)return void(null==(i=this._option)||i.onError("chart is already initialized"));let r=uP.createChart(t.type,t,this._getChartOption(t.type));r?(this._chart=r,this._chart.setCanvasRect(this._currentSize.width,this._currentSize.height),this._chart.created(this._chartSpecTransformer),this._chart.init(),this._event.emit(dj.initialized,{chart:r,vchart:this})):null==(s=this._option)||s.onError("init chart fail")}_releaseData(){this._dataSet&&(this._dataSet.dataViewMap={},this._dataSet=null)}_bindViewEvent(){var t,e;this._compiler&&(null==(e=null==(t=this._compiler.getStage())?void 0:t.getTimeline())||e.on("animationEnd",()=>{this._event.emit(dj.animationFinished,{chart:this._chart,vchart:this})}))}_bindResizeEvent(){var t,e;if(this._autoSize){if(this._onResize=u2(this._doResize,null!=(t=this._option.resizeDelay)?t:100),this._container){let t=window.ResizeObserver;t&&(this._observer=new t(this._onResize),null==(e=this._observer)||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 fd(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.width)?e:500,height:null!=(s=null==(i=this._currentSize)?void 0:i.height)?s:500})}_initDataSet(t){for(let e in this._dataSet=t instanceof e_?t:new e_,c5(this._dataSet,"dataview",eb),c5(this._dataSet,"array",el),c3(this._dataSet,"copyDataView",c7),uP.transforms)c3(this._dataSet,e,uP.transforms[e]);for(let t in uP.dataParser)c5(this._dataSet,t,uP.dataParser[t])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return(0,r3.A)(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,r,a,n,l,o;if(t.reMake&&(this._releaseData(),this._initDataSet(),null==(i=this._chart)||i.release(),this._chart=null),t.reTransformSpec&&(this._chartSpecTransformer=null),t.changeTheme?(this._setCurrentTheme(
2),this._setFontFamilyTheme(this.getTheme("fontFamily"))):t.changeBackground&&(null==(s=this._compiler)||s.setBackground(this._getBackground())),t.reMake?(null==(r=this._compiler)||r.releaseGrammar(!0),this._userEvents.forEach(t=>{var e;return null==(e=this._event)?void 0:e.on(t.eType,t.query,t.handler)})):t.reCompile&&(null==(a=this._compiler)||a.clear({chart:this._chart,vChart:this}),null==(n=this._compiler)||n.compile({chart:this._chart,vChart:this})),t.reSize){let{width:t,height:e}=this.getCurrentSize();this._currentSize={width:t,height:e},null==(l=this._chart)||l.onResize(t,e,!1),null==(o=this._compiler)||o.resize(t,e,!1)}}_beforeRender(t={}){var e,i,s,r,a,n,l,o;if(this._isReleased)return!1;if(this._chart)return!0;let{transformSpec:h,actionSource:u}=t;return h&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,u),null==(i=null==(e=this._option.performanceHook)?void 0:e.beforeInitializeChart)||i.call(e,this),this._initChart(this._spec),null==(r=null==(s=this._option.performanceHook)?void 0:s.afterInitializeChart)||r.call(s,this),!(!this._chart||!this._compiler)&&(this._chartPluginApply("onAfterInitChart",this._spec,u),null==(n=null==(a=this._option.performanceHook)?void 0:a.beforeCompileToVGrammar)||n.call(a,this),this._compiler.compile({chart:this._chart,vChart:this},t),null==(o=null==(l=this._option.performanceHook)?void 0:l.afterCompileToVGrammar)||o.call(l,this),!0)}_afterRender(){return!this._isReleased&&(this._event.emit(dj.rendered,{chart:this._chart,vchart:this}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return vL(this,void 0,void 0,function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})})}_renderAsync(t={}){return vL(this,void 0,void 0,function*(){return this._renderSync(t)})}_updateAnimateState(t){var e,i;if(this.isAnimationEnable()){let s=e=>{var i;let s=null==(i=e.context)?void 0:i.diffState;return t?"exit"===s?F.none:F.appear:s};null==(e=this._chart)||e.getAllRegions().forEach(t=>{t.updateAnimateStateCallback(s)}),null==(i=this._chart)||i.getAllComponents().forEach(t=>{t.updateAnimateStateCallback(s)})}}release(){var t,e,i,s;(null==(t=this._onResize)?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null==(e=this._chart)||e.release(),null==(i=this._eventDispatcher)||i.release(),null==(s=this._compiler)||s.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._cachedProcessedTheme=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,uY.unregisterInstance(this)}updateData(t,e,i,s){return vL(this,void 0,void 0,function*(){return this.updateDataSync(t,e,i,s)})}_updateDataById(t,e,i){let 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):(0,ev.A)(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}updateDataInBatches(t){return vL(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._spec.data=oS(this._spec.data),t.forEach(({id:t,data:e,options:i})=>{this._updateDataById(t,e,i)})),this})}updateDataSync(t,e,i,s){return this._reSetRenderState(),(0,eE.A)(this._dataSet)||(this._chart?(this._chart.updateData(t,e,!0,i),(null==s?void 0:s.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._compiler.render()):(this._spec.data=oS(this._spec.data),this._updateDataById(t,e,i))),this}updateFullDataSync(t,e=!0,i){if(this._reSetRenderState(),this._chart)return this._chart.updateFullData(t),e&&((null==i?void 0:i.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._compiler.render()),this;let s=oS(this._spec.data);return oS(t).forEach(t=>{let{id:e,values:i,parser:r,fields:a}=t,n=s.find(t=>t.name===e);if(n)n instanceof eR?(n.setFields(ek(a)),n.parse(i,ek(r))):(n.values=i,(0,eA.A)(r)&&(n.parser=r),(0,eA.A)(a)&&(n.fields=a));else{let e=pe(t,this._dataSet,s);(0,ev.A)(this._spec.data)&&this._spec.data.push(e)}}),this}updateFullData(t,e=!0){return vL(this,void 0,void 0,function*(){return this.updateFullDataSync(t,e)})}updateSpec(t,e=!1,i,s){return vL(this,void 0,void 0,function*(){let r=this._updateSpec(t,e,s);return r&&(yield this.updateCustomConfigAndRerender(r,!1,{morphConfig:i,transformSpec:r.reTransformSpec,actionSource:"updateSpec"})),this})}updateSpecSync(t,e=!1,i,s){let r=this._updateSpec(t,e,s);return r&&this.updateCustomConfigAndRerender(r,!0,{morphConfig:i,transformSpec:r.reTransformSpec,actionSource:"updateSpec"}),this}updateSpecAndRecompile(t,e=!1,i={}){let s=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(s,Object.assign({actionSource:"updateSpecAndRecompile"},i))}updateModelSpec(t,e,i=!1,s){return vL(this,void 0,void 0,function*(){return this.updateModelSpecSync(t,e,i,s)})}updateModelSpecSync(t,e,i=!1,s){var r,a;if(!e||!this._spec)return this;if((0,eS.A)(e)&&(e=JSON.parse(e)),(0,r3.A)(t)||(r=this._spec,a=e,Object.keys(r).forEach(e
2=>{if(r2(t))t.type===e&&((0,ev.A)(r[e])?r[e].length>=t.index&&(r[e][t.index]=i?uy({},r[e][t.index],a):a):r[e]=i?uy({},r[e],a):a);else if((0,ev.A)(r[e])){let s=r[e].findIndex(e=>e.id===t);s>=0&&(r[e][s]=i?uy({},r[e][s],a):a)}else r.id===t&&(r[e]=i?uy({},r[e],a):a)})),this._chart){let r=this._chart.getModelInFilter(t);if(r)return this._updateModelSpec(r,e,!0,i,s)}return this}_updateModelSpec(t,e,i=!1,s=!1,r){s&&(e=uy({},t.getSpec(),e));let a=t.updateSpec(e);return t.reInit(e),(a.change||a.reCompile||a.reMake||a.reSize||a.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(a,i,{morphConfig:r,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){return vL(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)||s.call(i,t,e),this._afterResize()):this}_beforeResize(t,e){var i,s,r,a;if(!this._chart||!this._compiler)return!1;let n=this._chart.getCanvasRect();return(!n||n.width!==t||n.height!==e)&&(this._chartPluginApply("onBeforeResize",t,e),null==(s=null==(i=this._option.performanceHook)?void 0:i.beforeResizeWithUpdate)||s.call(i,this),this._chart.onResize(t,e,!1),null==(a=null==(r=this._option.performanceHook)?void 0:r.afterResizeWithUpdate)||a.call(r,this),!0)}_afterResize(){return this._isReleased||this._event.emit(dj.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}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)||s.on(t,e,i))}off(t,e){var i;if(this._userEvents&&0!==this._userEvents.length)if(e){let s=this._userEvents.findIndex(i=>i.eType===t&&i.handler===e);s>=0&&(this._userEvents.splice(s,1),null==(i=this._event)||i.off(t,e))}else this._userEvents.forEach(e=>{var i;e.eType===t&&(null==(i=this._event)||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,r;let a,n=this._option.theme,l=null==(e=this._spec)?void 0:e.theme,o=null==(i=this._spec)?void 0:i.type;t&&(this._currentThemeName=t);let h=(t,e)=>{var i;return(null==(i=e.chart)?void 0:i[t])&&(e=uO({},e,e.chart[t])),e};if(pJ(n)&&pJ(l))a=uX(this._currentThemeName),this._currentTheme=h(o,a);else{let t=uO({},uX(r2(l)&&l.type?l.type:r2(n)&&n.type?n.type:this._currentThemeName),uX(n),uX(l));this._currentTheme=h(o,t)}this._cachedProcessedTheme=null,r=this.getTheme("component","poptip"),eB(p0.poptip,pQ,r),null==(s=this._compiler)||s.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let s=!1;(0,eE.A)(this._spec.width)?(0,eE.A)(t.width)||(this._spec.width=t.width):this._spec.width!==t.width&&(s=!0),(0,eE.A)(this._spec.height)?(0,eE.A)(t.height)||(this._spec.height=t.height):this._spec.height!==t.height&&(s=!0);let r=this._autoSize;return this._autoSize=!!hJ(this._option.mode)&&(null==(i=null!=(e=this._spec.autoFit)?e:this._option.autoFit)||i),this._autoSize!==r&&(s=!0),s}_getBackground(){return("string"==typeof this._spec.background||r2(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this.getTheme("background")||this._option.background}getCurrentTheme(){return uX(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){return vL(this,void 0,void 0,function*(){return this.setCurrentThemeSync(t)})}setCurrentThemeSync(t){if(!u$.themeExist(t))return this;let e=this._setCurrentTheme(t);return this._setFontFamilyTheme(this.getTheme("fontFamily")),this.updateCustomConfigAndRerender(e,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null==(e=this._chart)||e.setCurrentTheme(
2),{change:!0,reMake:!1}}_setFontFamilyTheme(t){var e;t&&(null==(e=this.getStage())||e.setTheme({text:{fontFamily:t},richtext:{fontFamily:t}}))}_getTooltipComponent(){var t;return null==(t=this._chart)?void 0:t.getComponentsByType(hc.tooltip)[0]}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;let s=this._getTooltipComponent();s&&(null==(i=null==(e=s.tooltipHandler)?void 0:e.release)||i.call(e),s.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return null==(t=this._context)?void 0:t.tooltipHandler}getTooltipHandler(){let t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;let s=this._getTooltipComponent();return null!=(i=(0,eA.A)(t)&&"none"!==(null==s?void 0:s.showTooltip(t,e)))&&i}hideTooltip(){var t;let e=this._getTooltipComponent();return null!=(t=null==e?void 0:e.hideTooltip())&&t}getLegendDataById(t){var e;let i=null==(e=this._chart)?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;let i=null==(e=this._chart)?void 0:e.getComponentsByType(hc.discreteLegend);return i&&i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;let i=null==(e=this._chart)?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;let i=null==(e=this._chart)?void 0:e.getComponentsByType(hc.discreteLegend);return i&&i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;let s=null==(i=this._chart)?void 0:i.getComponentByUserId(t);s&&s.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;let s=null==(i=this._chart)?void 0:i.getComponentsByType(hc.discreteLegend);s&&s[t]&&s[t].setSelectedData(e)}getDataURL(){var t;return vL(this,void 0,void 0,function*(){let e=this.getStage();if(this._chart&&e){e.render();let t=this._chart.getCanvas();return yield function(t,e){var i,s,r,a,n;return s=this,r=void 0,a=void 0,n=function*(){if(!t)return"";try{if(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)return new Promise(e=>{t.convertToBlob().then(t=>{let i=new FileReader;i.readAsDataURL(t),i.onload=()=>{e(i.result)}})})}catch(t){(null!=(i=null==e?void 0:e.onError)?i:h3)(`getCanvasDataURL error : ${t.toString()}`)}return t.toDataURL()},new(a||(a=Promise))(function(t,e){function i(t){try{o(n.next(t))}catch(t){e(t)}}function l(t){try{o(n.throw(t))}catch(t){e(t)}}function o(e){var s;e.done?t(e.value):((s=e.value)instanceof a?s:new a(function(t){t(s)})).then(i,l)}o((n=n.apply(s,r||[])).next())})}(t,{onError:this._onError})}return null==(t=this._option)||t.onError(ReferenceError("render is not defined")),null})}exportImg(t){var e,i;return vL(this,void 0,void 0,function*(){if(!hJ(this._option.mode))return void(null==(e=this._option)||e.onError(TypeError("non-browser environment can not export img")));let s=yield this.getDataURL();s?function(t="vchart",e){let 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)||i.onError(ReferenceError("render is not defined"))})}exportCanvas(){var t;let e=this.getStage();if(this._chart&&e)return e.toCanvas();null==(t=this._option)||t.onError(ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if("node"!==this._option.mode)return void(null==(t=this._option)||t.onError(TypeError("getImageBuffer() now only support node environment.")));let i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null==(e=this._option)||e.onError(ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,null==(e=this._chart)||e.setLayout(t)}reLayout(){var t,e,i;null==(t=this._chart)||t.resetLayoutItemTag(),null==(e=this._chart)||e.setLayoutTag(!0,null,!1),null==(i=this._compiler)||i.render()}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return null==(t=this._compiler)?void 0:t.getCanvas()}getContainer(){var t;let e;return(0,eA.A)(this._container)?this._container:(e=(0,eS.A)(this._canvas)?hL.getElementById(this._canvas):this._canvas,(0,eA.A)(e)?e.parentElement:null==(t=this.getCanvas())?void 0:t.parentElement)}getComponents(){return this._chart.getAllComponents()}getScale(t){var e;let i=null==(e=this._chart)?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.setDimensionIndex(t,e)}disableDimensionHoverEvent(t){return void 0!==t&&(this._disableDimensionHoverEvent=t),this._disableDimensionHoverEvent}disableCrossHair(t=!0){this.getChart().getComponentsByKey("crosshair").forEach(e
2=>e.enable=!t)}disableTooltip(t=!0){this.getChart().getComponentsByKey("tooltip").forEach(e=>e.enable=!t)}showCrosshair(t){var e;null==(e=this._chart)||e.showCrosshair(t)}stopAnimation(){var t;null==(t=this.getStage())||t.stopAnimation(!0)}reRunNormalAnimation(){var t;null==(t=this.getStage())||t.reApplyAnimationState("normal",!0)}pauseAnimation(){var t;null==(t=this.getStage())||t.pauseAnimation(!0)}resumeAnimation(){var t;null==(t=this.getStage())||t.resumeAnimation(!0)}convertDatumToPosition(t,e={},i=!1,s){var r;let a;if(!this._chart||pJ(t))return null;let{seriesId:n,seriesIndex:l=0}=e;if((0,eA.A)(n)?a=this._chart.getSeriesInUserId(n):(0,eA.A)(l)&&(a=null==(r=this._chart.getSeriesInIndex([l]))?void 0:r[0]),a){let e,r=Object.keys(t),n=a.getViewData().latestData.find(e=>r.every(i=>e[i]==t[i])),l=a.getRegion().getLayoutStartPoint();return(e=n?a.dataToPosition(n,s):a.dataToPosition(t,s))?h$(e,l,i):null}return null}convertValueToPosition(t,e,i=!1){var s,r;let a;if(!this._chart||(0,eE.A)(t)||pJ(e))return null;if(!(0,ev.A)(t)){let r,{axisId:a,axisIndex:n}=e;if((0,eA.A)(a)?r=this._chart.getComponentsByKey("axes").find(t=>t.userId===a):(0,eA.A)(n)&&(r=null==(s=this._chart.getComponentsByKey("axes"))?void 0:s[n]),!r)return h2("Please check whether the `axisId` or `axisIndex` is set!"),null;let l=null==r?void 0:r.valueToPosition(t);if(i){let t=r.getLayoutStartPoint(),e=r.getOrient();return l+("bottom"===e||"top"===e?t.x:t.y)}return l}let{seriesId:n,seriesIndex:l}=e;return(0,eA.A)(n)?a=this._chart.getSeriesInUserId(n):(0,eA.A)(l)&&(a=null==(r=this._chart.getSeriesInIndex([l]))?void 0:r[0]),a?h$(a.valueToPosition(t[0],t[1]),a.getRegion().getLayoutStartPoint(),i):(h2("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return _H.instance().getFunction(t)}registerFunction(t,e){t&&e&&_H.instance().registerFunction(t,e)}unregisterFunction(t){t&&_H.instance().unregisterFunction(t)}getFunctionList(){return _H.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}updateIndicatorDataById(t,e){var i;let s=null==(i=this._chart)?void 0:i.getComponentByUserId(t);s&&s.updateDatum(e)}updateIndicatorDataByIndex(t=0,e){var i;let s=null==(i=this._chart)?void 0:i.getComponentsByType(hc.indicator);s&&s[t]&&s[t].updateDatum(e)}geoZoomByIndex(t=0,e,i){this._geoZoomByQuery({regionIndex:t},e,i)}geoZoomById(t,e,i){this._geoZoomByQuery({regionId:t},e,i)}_geoZoomByQuery(t,e,i){var s,r;let a=null==(s=this._chart)?void 0:s.getRegionsInQuerier(t)[0],n=null==(r=this._chart)?void 0:r.getComponentsByType(hc.geoCoordinate),l=null==n?void 0:n.find(t=>{var e;return null==(e=t.getRegions())?void 0:e.includes(a)});l&&l.dispatchZoom(e,i)}_initChartPlugin(){let t=uP.getChartPlugins();t.length>0&&(this._chartPlugin=new yp(this),this._chartPlugin.load(t.map(t=>new t)),this._chartPluginApply("onInit",this._spec));let e=uP.getVChartPlugins();e.length>0&&(this._vChartPlugin=new vI(this),this._vChartPlugin.load(e.map(t=>new t)),this._vChartPlugin.onInit())}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}_getMode(){return this._option.mode||hd["desktop-browser"]}isAnimationEnable(){return"animation"in this._option?!!this._option.animation:!1!==this._spec.animation}_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,viewBox:this._viewBox,getTheme:this.getTheme,getSpecInfo:()=>{var t;return null!=(t=this._specInfo)?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent,componentShowContent:this._option.componentShowContent}}runDisappearAnimation(){this._renderState=H.disappear,this.getStage().eventSystem.pauseTriggerEvent(),this.getStage().applyAnimationState(["disappear"],[{name:"disappear",animation:this._compiler.stateAnimationConfig.disappear}])}_reSetRenderState(){var t,e;this._renderState=H.render,null==(e=null==(t=this.getStage())?void 0:t.eventSystem)||e.resumeTriggerEvent()}}function vz(t,e,i=m_){let 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);let r=(s-1)*e,a=Math.floor(r),n=i(t[a],a,t);return n+(i(t[a+1],a+1,t)-n)*(r-a)}function vH(t,e){let{n:i,X:s,Sxx:r,SSE:a}=e,n=i>2?a/(i-2):0;return{seMean:r>0?Math.sqrt(n*(1/i+(t-s)*(t-s)/r)):Math.sqrt(n/i),sePred:Math.sqrt(n*(1+1/i+(r>0?(t-s)*(t-s)/r:0)))}}function vj(t,e){let i=[];return t.forEach(t=>{let s=+t[e];eP(s)&&i.push(s)}),0===i.length?null:oM(i)}function vV(t,e){let i=[];return t.forEach(t=>{let s=+t[e];eP(s)&&i.push(s)}),0===i.length?null:ok(i)}function vN(t,e){return t.reduce((t,i)=>{let s=e?+i[e]:+i;return eP(s)&&(t+=s),t},0)}function vW(t,e){let i=0,s=0;return t.forEach(t=>{let r=e?+t[e]:+t;eP(r)&&(i+=r,s++)}),i/s}function vU(t,e){let i=vW(t,e);return t.length<=1?0:t.reduce((t,s)=>t+(e?+s[e]:s-i)**2,0)/(t.length-1)}function vG(t,e){let i=vY(t),s=vY(e),r=Math.asin((t.x*e.y-e.x*t.y)/i/s),a=Math.acos((t.x*e.x+t.y*e.y)/i/s);return r<0?-a:a}function vY(t,e={x:0,y:0}){return i6.distancePP(t,e)}function v$(t){return eP(t.x)&&eP(t.y)}function vX(t,e){for(let i=0;i<e.length;i++){let s=e[i],r=function(t,e){return t.find(t=>t.key===e)}(t,s.key);r?r.operations=[...new Set(r.operations.concat(s.operations))]:t.push(s)}return t}function vK(t,e){var i;if(!t)return null!=e?e:null;let s=t.getFields();return s&&s[e]?null!=(i=s[e].alias)?i:e:null!=e?e:null}function vq(t,e,i){let s=t.getStackSort(),r={},a=null;return s&&(a={}
2,t.getSeries().forEach(t=>{let e=t.getSeriesField();if(e){let i=t.getRawDataStatisticsByField(e);i.values&&(a[e]||(a[e]={lastIndex:0,sort:{}}),i.values.forEach((t,i)=>{t in a[e].sort||(a[e].sort[t]=a[e].lastIndex,a[e].lastIndex++)}))}})),t.getSeries().forEach(t=>{var s;let n=t.getStackData(),l=t.getStackValue(),o=t.getStackValueField(),h=!i||i(t);n&&o&&h&&(r[l]=null!=(s=r[l])?s:{groupField:n.groupField,nodes:{}},function t(e,i,s,r,a,n,l){var o;if("values"in i)if(a&&i.values.forEach(t=>t[pC]=function(t){if(eP(t))return t;let e=+t;return eP(e)?e:0}(t[r])),s.series.push({s:e,values:i.values}),n){let t=e.getSeriesField();i.values.forEach(i=>{s.sortDatums.push({series:e,datum:i,index:t?n[t].sort[i[t]]:0})})}else s.values.push(...i.values);else for(let h in i.nodes){let u=l?`${l}_${h}`:h;s.nodes[h]||(s.nodes[h]={values:[],series:[],nodes:{},sortDatums:[],key:u},(0,eA.A)(null==(o=i.nodes[h])?void 0:o.groupField)&&(s.nodes[h].groupField=i.nodes[h].groupField)),t(e,i.nodes[h],s.nodes[h],r,a,n,u)}}(t,n,r[l],o,e,a))}),s?function t(e,i){var s;for(let r in e)(null==(s=e[r].sortDatums)?void 0:s.length)?(e[r].sortDatums.sort((t,e)=>t.index-e.index),e[r].values=e[r].sortDatums.map(t=>t.datum)):t(e[r].nodes,i);return e}(r,a):r}function vZ(t,e){if("values"in t&&t.values.length){let i=vN(t.values,e),s=vV(t.values,pE);t.values.forEach(t=>{t[pR]=i,t[pI]=s})}else for(let i in t.nodes)vZ(t.nodes[i],e)}vF.InstanceManager=uY,vF.ThemeManager=u$,vF.globalConfig={uniqueTooltip:!0},vF.Utils={measureText:(t,e,i,s)=>_R(e,i,s,{fontFamily:uD.fontFamily,fontSize:uD.fontSize}).measure(t)},vF.vglobal=hL,uP.registerRegion("region",fA),uP.registerLayout("base",fO),_w(),uP.registerStageEventPlugin("gesture",yD),uP.registerInteractionTrigger(vP.type,vP),uP.registerInteractionTrigger(vR.type,vR),uW(yd.name,yd);let vJ=(t,e)=>{let i=e.beforeCall();return t&&t.forEach((t,s)=>e.call(t,s,i)),i.keyMap&&(i.keyMap.clear(),i.keyMap=null),t};class vQ{static getInstance(){return vQ.instance||(vQ.instance=new vQ),vQ.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.formatPerio
2d,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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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)=>{let 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){let 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){let 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 RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}pad(t,e,i){let s=t<0?"-":"",r=(s?-t:t)+"",a=r.length;return s+(a<i?Array(i-a+1).join(e)+r:r)}parseSpecifier(t,e,i,s){let r,a,n=0,l=e.length,o=i.length;for(;n<l;){if(s>=o)return -1;if(37===(r=e.charCodeAt(n++))){if(r=e.charAt(n++),!(a=this.parses[r in this.pads?e.charAt(n++):r])||(s=a(t,i,s))<0)return -1}else if(r!==i.charCodeAt(s++))return -1}return s}newParse(t,e){let i=this;return function(s){let r=i.newDate(1900,void 0,1);return i.parseSpecifier(r,t,s+="",0)!==s.length?null:"Q"in r?new Date(r.Q):"s"in r?new Date(1e3*r.s+("L"in r?r.L:0)):(!e||"Z"in r||(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,i.utcDate(r)):i.localDate(r))}}newFormat(t,e){let i=this;return function(s){let r,a,n=[],l=-1,o=0,h=t.length;for(s instanceof Date||(s=new Date(+s));++l<h;)37===t.charCodeAt(l)&&(n.push(t.slice(o,l)),(a=i.pads[r=t.charAt(++l)])?r=t.charAt(++l):a="e"===r?" ":"0",n.push(r=(0,e[r])(s,a)),o=l+1);return n.push(t.slice(o,l)),n.join("")}}getFullTimeStamp(t){let e=parseInt(t+"",10);return 10===String(e).length?1e3*e:e}}function v0(t,e){return e("component",t)}function v1(t,e,i,s){if(t)return{formatFunc:t,args:[i,s]};let r=uP.getFormatter();return e&&r?{formatFunc:r,args:[i,s,e]}:{}}let v2=(t,e,i,s)=>{if((0,eE.A)(t[e]))return;let r=(0,ev.A)(t[e]),a=r?t[e]:[t[e]],n=[];return a.forEach((t,a)=>{t&&(!s||s(t))&&n.push({spec:t,specPath:r?[e,a]:[e],specInfoPath:["component",e,a],type:i})}),n},v3=(t,e,i,s)=>{let r;if(r=(0,r3.A)(t)?t(e,i):(0,ew.A)(t)&&(0,eA.A)(t.field)?uQ(e,t.field):t,s){let{formatFunc:i,args:a}=v1(void 0,s,t,e);i&&a&&(r=i(...a))}return r},v5=(t,e,i)=>(0,eE.A)(t)?t:(0,r3.A)(t)?t(e,i):t;var v4=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let v8=(t,e)=>!e||!1!==e.visible&&(!e[t]||!1!==e[t].visible)&&!(e.activeType&&!((0,ev.A)(e.activeType)?e.activeType.includes(t):e.activeType===t));function v6(t,e,i,s,r,a){let n=e=>{if(e){let n={datum:r}
2,l=(0,eE.A)(e.key)&&(0,eE.A)(e.value)&&!pJ(e)?Object.assign(Object.assign(Object.assign({},s),i),e):Object.assign(Object.assign({},s),e),{key:o,keyFormatter:h,keyTimeFormat:u,keyTimeFormatMode:d,value:c,valueFormatter:p,valueTimeFormat:g,valueTimeFormatMode:f}=l,m=v4(l,["key","keyFormatter","keyTimeFormat","keyTimeFormatMode","value","valueFormatter","valueTimeFormat","valueTimeFormatMode"]);n.key=v7(v3(o,r,a,h),u,d),n.value=v7(v3(c,r,a,p),g,f),Object.keys(m).forEach(t=>{n[t]=v3(l[t],r,a)}),!1!==n.visible&&((0,eA.A)(n.key)||(0,eA.A)(n.value))&&t.push(n)}};(0,ev.A)(e)?e.forEach(t=>{n(t)}):n(e)}function v9(t,e,i,s,r,a,n){(0,r3.A)(e)?v6(t,e(r,n),i,s,a,n):e&&v6(t,e,i,s,a,n)}let v7=(t,e,i)=>{if(!e&&!i)return"object"!=typeof t?null==t?void 0:t.toString():t;let s=vQ.getInstance();return e=e||"%Y%m%d",("local"===(i=i||"local")?s.timeFormat:s.timeUTCFormat)(e,t)};class bt{constructor(t){this.activeTriggerSet={mark:new Set,group:new Set},this.ignoreTriggerSet={mark:new Set},this._getSeriesCacheInfo=()=>{var t,e,i;let{series:s}=this,r=s.getSeriesField();return{seriesFields:(0,eA.A)(r)?oS(r):null!=(t=s.getSeriesKeys())?t:[],dimensionFields:null!=(e=s.getDimensionField())?e:[],measureFields:null!=(i=s.getMeasureField())?i:[],type:s.type}},this._getDimensionData=t=>{let{dimensionFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getMeasureData=t=>{let{measureFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getSeriesFieldData=t=>{let{dimensionFields:e,seriesFields:i}=this._seriesCacheInfo;if((0,eA.A)(i[0])&&(null==t?void 0:t[i[0]]))return null==t?void 0:t[i[0]];let 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(let i of oS(e)){let e=null==(s=this.series.getSeriesStyle(t))?void 0:s(i);if((0,eA.A)(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))?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)=>{let{seriesFields:i}=this._seriesCacheInfo,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;let e=null==(t=this.series.getSpec())?void 0:t.tooltip;this.spec=e,this._seriesCacheInfo=this._getSeriesCacheInfo()}getShapeAttrs(t,e,i){var s,r,a,n,l,o,h,u,d,c,p,g;let f=e?"content":"title",m=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},null==(s=null==i?void 0:i.style)?void 0:s.shape),null==i?void 0:i[t]),null==(r=null==i?void 0:i[t])?void 0:r[f]),null==(a=this.spec)?void 0:a[t]),null==(l=null==(n=this.spec)?void 0:n[t])?void 0:l[f]);return{shapeType:null!=(o=m.shapeType)?o:this.shapeTypeCallback,shapeFill:null!=(u=null!=(h=m.shapeFill)?h:m.shapeColor)?u:this.shapeColorCallback,shapeStroke:null!=(d=m.shapeStroke)?d:this.shapeStrokeCallback,shapeHollow:null!=(c=m.shapeHollow)&&c,shapeLineWidth:m.shapeLineWidth,shapeSize:null!=(p=m.shapeSize)?p:m.size,hasShape:null!=(g=m.hasShape)?g:this.getHasShape(e)}}enableByType(t){return!0}getDefaultContentList(t){return[this.getDefaultContentPattern(t)]}getContentList(t,e,i,s,r,a){var n;return function(t,e,i,s,r,a){if(r&&r.length){let n=[];return r.forEach(r=>{(0,ev.A)(t)?t.forEach(t=>{v9(n,t,e,i,s,r,a)}):(0,r3.A)(t)?v9(n,t,e,i,s,r,a):t&&v6(n,t,e,i,r,a)}),n}return null}(null!=(n=null==e?void 0:e.content)?n:this.getDefaultContentList(t),this.getDefaultContentPattern(t),i,s,r,a)}getTitleResult(t,e,i,s,r){let a=(0,r3.A)(e)?e(s,r):e;if(a?(0,eE.A)(a.value)&&(a=Object.assign(Object.assign({},this.getDefaultTitlePattern(t)),a)):a=this.getDefaultTitlePattern(t),a&&!1!==a.visible){let t=function(t){var e;
2for(let{data:i}of(null==(e=t[0])?void 0:e.series)?[{data:t,value:""}]:t)for(let{datum:t}of i)for(let e of null!=t?t:[])if(e)return e}(s),e={visible:v3(a.visible,t,r),value:v7(v3(a.value,t,r,a.valueFormatter),a.valueTimeFormat,a.valueTimeFormatMode),valueStyle:v3(a.valueStyle,t,r),hasShape:a.hasShape};return Object.keys(i).forEach(s=>{e[s]=v3(i[s],t,r)}),e}return{hasShape:!1,visible:!1}}getTooltipData(t,e,i,s,r){var a,n;let l;if(!(this.enableByType(t)&&v8(t,this.spec)&&("dimension"!==t||s&&s.length)))return null;let o=null!=(n=null==(a=this.spec)?void 0:a[t])?n:null==e?void 0:e[t],h=this.getShapeAttrs(t,!0,e),u=this.getShapeAttrs(t,!1,e);return"dimension"===t?(l=[],this.getContentList(t,o,h,i,s,r).forEach(t=>{l.push(t)})):l=this.getContentList(t,o,h,i,s,r),{visible:!0,activeType:t,data:i,title:this.getTitleResult(t,null==o?void 0:o.title,u,i,r),content:l}}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}}}let be={min:t=>t.length?oM(t.map(t=>+t)):0,max:t=>t.length?ok(t.map(t=>+t)):0,"array-min":t=>t.length?oM(t.map(t=>+t)):0,"array-max":t=>t.length?ok(t.map(t=>+t)):0,values:t=>{let e={},i=[];for(let s of t)e[s]||(i.push(s),e[s]=1);return i}},bi=(t,e)=>{var i,s;let r=e.fields;if((0,r3.A)(r)&&(r=r()),!(null==r?void 0:r.length)||!(null==t?void 0:t.length))return{};r=vX([],r);let a="parser"===e.target?"parserData":"latestData";return bs(t[0][a]?t[0][a]:t||[],r,null==(s=(i=t[0]).getFields)?void 0:s.call(i))},bs=(t,e,i)=>{let s={},r=[],a=[];return e.forEach(e=>{let n=e.key;s[n]={};let l=null==i?void 0:i[n],o=e.operations,h=o.some(t=>"min"===t||"max"===t||"allValid"===t),u=!0;r.length=0,t&&t.forEach(t=>{t&&r.push(t[n])});let d=r.length;if(h){a.length=0,r.forEach((t,e)=>{hj(t)&&a.push(t)});let t=r;r=a,a=t,u=r.length===d}else r=o.some(t=>"array-min"===t||"array-max"===t)?r.reduce((t,e)=>(e&&e.forEach(e=>{hj(e)&&t.push(e)}),t),[]):r.filter(t=>void 0!==t);e.filter&&(r=r.filter(e.filter)),o.forEach(t=>{if(e.customize)s[n][t]=e.customize;else{if(l&&!0===l.lockStatisticsByDomain&&!(0,eE.A)(l.domain)){if("values"===t)return void(s[n][t]=l.domain.slice())}else if("allValid"===t)return;s[n][t]=be[t](r),"array-max"===t&&(s[n].max=s[n][t]),"array-min"===t&&(s[n].min=s[n][t])}}),h&&(s[n].allValid=u)}),s},br=(t,e)=>{let{config:i}=e;if(!i)return t;let{invalidType:s,checkField:r}=i();return"zero"!==s||r&&r.length&&t.forEach(t=>{r.forEach(e=>{hj(t[e])||(t[e]=0)})}),t},ba=`${px.H}_HIERARCHY_DEPTH`,bn=`${px.H}_HIERARCHY_ROOT`,bl=`${px.H}_HIERARCHY_ROOT_INDEX`;function bo(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function bh(t,e,i){t&&(i.needDefaultSeriesField&&(t[pk]=i.defaultSeriesField),t[pS]=e,t[pA]=i.getKey(t,e,i))}function bu(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function bd(t,e,i,s=0,r,a){void 0===a&&(a=e),bh(t,e,i),t[ba]=s,t[bn]=r||t[i.categoryField],t[bl]=a,t.children&&t.children.length&&t.children.forEach((e,s)=>bd(e,s,i,t[ba]+1,t[bn],a))}let bc={label:{name:"label",type:"text"}},bp=`${px.H}_rect_x`,bg=`${px.H}_rect_x1`,bf=`${px.H}_rect_y`,bm=`${px.H}_rect_y1`,b_={data:!0},by={invalidType:!0,animation:!0,animationAppear:!0,animationEnter:!0,animationUpdate:!0,animationExit:!0,animationNormal:!0},bv=[...Object.keys(vy),"normal"];function bb(t={},e,i){let s={};for(let r=0;r<bv.length;r++){let a,n,l=bv[r],o=e?e[l]:void 0;if(!1!==o){if("normal"===l){o&&(s.normal=o);continue}if("state"===l){!1!==o&&(s.state=null!=o?o:vy.state);continue}("update"===l||o||t[l])&&((a=(0,ev.A)(t[l])?t[l]:[Object.assign(Object.assign({},vy[l]),t[l])],"exit"===l&&a.forEach(t=>{t.controlOptions={stopWhenStateChange:!0}}),o)?(n=(0,ev.A)(o)?o.map((t,e)=>{var s;let r=t;return bM(r)&&delete r.type,r.oneByOne&&(r=bS(r,null!=(s=null==i?void 0:i.dataIndex)?s:bA,
2null==i?void 0:i.dataCount)),r}):a.map((t,e)=>{var s;let r=uy({},a[e],o);return bM(r)&&delete r.type,r.oneByOne&&(r=bS(r,null!=(s=null==i?void 0:i.dataIndex)?s:bA,null==i?void 0:i.dataCount)),r}),s[l]=n):s[l]=a)}}return s}function bx(t,e,i){var s,r,a,n,l,o;let h={};return(0,eA.A)(e.animationAppear)&&(h.appear=null!=(s=e.animationAppear[t])?s:e.animationAppear),(0,eA.A)(e.animationDisappear)&&(h.disappear=null!=(r=e.animationDisappear[t])?r:e.animationDisappear),(0,eA.A)(e.animationEnter)&&(h.enter=null!=(a=e.animationEnter[t])?a:e.animationEnter),(0,eA.A)(e.animationExit)&&(h.exit=null!=(n=e.animationExit[t])?n:e.animationExit),(0,eA.A)(e.animationUpdate)&&(h.update=null!=(l=e.animationUpdate[t])?l:e.animationUpdate),(0,eA.A)(e.animationState)&&(h.state=null!=(o=e.animationState[t])?o:e.animationState),e.animationNormal&&e.animationNormal[t]&&(h.normal=e.animationNormal[t]),function(t,e){if(!t)return t;let i=["custom","customParameters"];return function t(e,i,s=[]){if((0,ev.A)(e))e.forEach((r,a)=>{e[a]=i(e[a],a),t(e[a],i,s)});else if(r2(e)&&"function"!=typeof e)for(let r in e)s.includes(r)||(e[r]=i(e[r],r),t(e[r],i,s))}(t=ek(t,null,i),t=>{var i;return(0,r3.A)(t)&&(null==(i=t.prototype)?void 0:i.constructor)!==t?(...i)=>t(...i,e):t},i),t}(h,i)}function bS(t,e,i){let{oneByOne:s,duration:r,delay:a,delayAfter:n}=t;return t.delay=(t,i,n)=>{let l=e(t,n),o=(0,r3.A)(r)?r(t,i,n):eP(r)?r:0,h=(0,r3.A)(a)?a(t,i,n):eP(a)?a:0,u=(0,r3.A)(s)?s(t,i,n):s;return!1===u?h:h+l*(o+(u=!0===u?0:u))},t.delayAfter=(t,a,l)=>{let o=e(t,l),h=(0,r3.A)(r)?r(t,a,l):eP(r)?r:0,u=(0,r3.A)(n)?n(t,a,l):eP(n)?n:0,d=(0,r3.A)(s)?s(t,a,l):s;return!1===d?u:(d=!0===d?0:d,u+((i?i():a.parent.count-1)-o)*(h+d))},delete t.oneByOne,t}function bA(t,e){var i;return null!=(i=null==t?void 0:t[pS])?i:e.context.graphicIndex}function bk(t,e){var i,s,r,a,n;if(!1===t.animation||!1===(null==(i=t.morph)?void 0:i.enable))return!1;let l=!1!==(null!=(r=null==(s=t.animationAppear)?void 0:s[e])?r:t.animationAppear),o=!1!==(null!=(n=null==(a=t.animationUpdate)?void 0:a[e])?n:t.animationUpdate);return!(!l||!o)}function bM(t){return!(0,eA.A)(t.timeSlices)&&(0,eA.A)(t.channel)}function bw(t){var e,i,s,r,a,n;let l=t.getSpec();if(!1===l.animation||!1===(null==(i=null==(e=t.getOption())?void 0:e.globalInstance)?void 0:i.isAnimationEnable()))return!1;let o=null!=(s=l.animationThreshold)?s:Number.MAX_SAFE_INTEGER;return null==(r=t.getMarks())||r.forEach(t=>{let e=t.getMarkConfig();e&&(e.large&&e.largeThreshold&&(o=Math.min(o,e.largeThreshold)),e.progressiveThreshold&&(o=Math.min(o,e.progressiveThreshold)))}),!((null==(n=null==(a=t.getRawData())?void 0:a.latestData)?void 0:n.length)>=o)}class bT extends fm{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=oS(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,r;let a=uo(t),n=null==(i=this._option)?void 0:i.getTheme,l=this._option.type,o=uP.getSeriesMarkMap(l)?function(t,e,i){let s=uP.getSeriesMarkMap(e);if(!s)return t;let r={};return Object.values(s).forEach(({type:e,name:s})=>{r[s]=uy({},i("mark",oS(e)[0]),i("markByName",s),null==t?void 0:t[s])}),Object.assign(Object.assign({},t),r)}(n("series",l),l,n):{},h=n("series",`${l}_${a}`),u=(null!=(r=null!=(s=this.stack)?s:null==h?void 0:h.stack)?r:null==o?void 0:o.stack)?n("series",`${l}_stack`):void 0;return uy({},o,h,u)}transformSpec(t,e,i){this._transformStack(t);let 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){ey(t.stack)&&(this.stack=t.stack),ey(t.percent)&&(this.stack=t.percent||this.stack),(0,eE.A)(this.stack)&&this._supportStack&&t.seriesField&&(this.stack=!0)}_addMarkLabelSpec(t,e,i="label",s="initLabelMarkStyle",r=!0,a){t&&oS(t[i]).forEach(i=>{var n,l,o;if(i&&i.visible){let{animation:h=!0,animationUpdate:u=!0,animationEnter:d=!0,animationExit:c=!0}=i,{animationUpdate:p=!0,animationEnter:g=!0,animationExit:f=!0}=t,m=!!(null!=(o=null!=(l=null==(n=this._option.globalInstance)?void 0:n.isAnimationEnable())?l:t.animation)?o:i.animation)&&!!r;this.addLabelSpec((0,r3.A)(e)?e(i):e,Object.assign(Object.assign({},i),{animation:!!m&&h,animationUpdate:!!(m&&p&&u)&&p,animationEnter:!!(m&&g&&d)&&g,animationExit:!!(m&&g&&c)&&f,getStyleHandler:t=>{var e;
2return null==(e=t[s])?void 0:e.bind(t)}}),a)}})}_getDefaultSpecFromChart(t){var e;let i=null!=(e=super._getDefaultSpecFromChart(t))?e:{},{outerRadius:s,innerRadius:r,direction:a}=t;return(0,eA.A)(s)&&(i.outerRadius=s),(0,eA.A)(r)&&(i.innerRadius=r),(0,eA.A)(a)&&(i.direction=a),Object.keys(i).length>0?i:void 0}_mergeThemeToSpec(t,e){let i=this._theme;if(this._shouldMergeThemeToSpec()){let s=this._getDefaultSpecFromChart(e),r=t=>{let e=uy({},i,s,t),r=i.label;return r&&r2(r)&&(0,ev.A)(e.label)&&(e.label=e.label.map(t=>uy({},r,t))),e};return(0,ev.A)(t)?{spec:t.map(t=>r(t)),theme:i}:{spec:r(t),theme:i}}return{spec:t,theme:i}}}class bC extends fv{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.getDataView()}getViewDataProductId(){var t;return null==(t=this._data)?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){(0,eA.A)(t)&&(this._seriesField=t)}getGroups(){return this._groups}getStack(){var t;return null==(t=this.getSpecInfo())?void 0:t.stack}getStackValue(){var t;return null!=(t=this._spec.stackValue)?t:`${px.H}_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())||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=bT,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)?t:this._region.getLayoutRect().width,height:null!=(e=this._layoutRect.height)?e:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this.layoutZIndex=j.SeriesGroup,this._invalidType="break",this._region=e.region,this._dataSet=e.dataSet,(null==(i=this._spec)?void 0:i.name)&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(dj.afterInitData,{model:this}),this.initRootMark(),this.initMark();let t=bw(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this.afterInitMark(),this.initEvent(),this.event.emit(dj.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.scale(e)},seriesColor:t=>{var e;return(0,eE.A)(t)&&(t=this.getSeriesKeys()[0]),null==(e=this._option.globalScale.getScale("color"))?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),(0,eA.A)(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.dataSet)&&(c3(this._rawData.dataSet,"invalidTravel",br),null==(e=this._rawData)||e.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getInvalidCheckFields()})}},!1))}initData(){var t,e,i;let s=null!=(t=this._spec.data)?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(s&&(this._rawData=pe(s,this._dataSet,this._option.sourceDataList)),null==(i=null==(e=this._rawData)?void 0:e.target)||i.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this.get
2Stack()&&(this._viewDataFilter=pt(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));let t=pt(this.getStack()?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new mz(this._option,t),this.getStack()&&this._viewDataFilter.target.removeListener("change",t.reRunAllTransform)}this.initInvalidDataTransform()}initGroups(){let t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,s,r;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]||e&&((0,eE.A)(this._rawStatisticsCache[t].min)||(0,eE.A)(this._rawStatisticsCache[t].max))||!e&&(0,eE.A)(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[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){let i=null==(s=this._rawData.getFields())?void 0:s[t];if(i&&i.lockStatisticsByDomain&&i.domain)this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=oM(i.domain),this._rawStatisticsCache[t].max=ok(i.domain)):this._rawStatisticsCache[t].values=i.domain;else{let i=bs(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t];this._rawStatisticsCache[t]=eB(null!=(r=this._rawStatisticsCache[t])?r:{},i)}}}return this._rawStatisticsCache[t]}_statisticViewData(){c3(this._dataSet,"dimensionStatistics",bi);let t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new eR(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{let t=this.getStatisticFields();return this._seriesField&&vX(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){c3(this._dataSet,"dimensionStatistics",bi);let s=new eR(this._dataSet,{name:t});return s.parse([e],{type:"dataview"}),s.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var t;let s=vX(this.getStatisticFields(),null!=(t=null==i?void 0:i(e.name))?t:[]);return this._seriesField&&vX(s,[{key:this._seriesField,operations:["values"]}]),s},target:"latest"}},!1),s}createdStackData(){let t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new eR(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(0,eE.A)(t)?(t,e,i)=>{if(!1===this._spec.animation){let i=this._noAnimationDataKey(t,e);if(void 0!==i)return i}let{keyMap:s}=i,r=this._getSeriesDataKey(t);return void 0===s.get(r)?(s.set(r,0),r):(s.set(r,s.get(r)+1),`${r}_${s.get(r)}`)}:(0,eS.A)(t)?e=>e[t]:(0,ev.A)(t)&&t.every(t=>(0,eS.A)(t))?e=>t.map(t=>e[t]).join("-"):(0,r3.A)(t)?(e,i)=>t(e,i):(null==(e=this._option)||e.onError(`invalid dataKey: ${t}`),(t,e)=>{})}_addDataIndexAndKey(){var t;(null==(t=this._rawData)?void 0:t.dataSet)&&(c3(this._rawData.dataSet,"addVChartProperty",vJ),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;null==(e=this._rawDataStatistics)||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(dj.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(dj.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(dj.viewDataUpdate,{model:this}),null==(e=this._data)||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(dj.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||(0,eE.A)(e)?null:t[e]}getDatumPositionValues(t,e){return!t||(0,eE.A)(e)?[]:(0,eS.A)(e)?[t[e]]:e.map(e=>t[e])}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e,i;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:null==(e=(t=this._region).getGroupMark)?void 0:e.call(t),dataView:!1}),this._rootMark.setMarkConfig({zIndex:null!=(i=this._spec.zIndex)?i:this.layoutZIndex})}_getExtensionMarkNamePrefix(){return`${this.type}_${this.id}_extensionMark`}_initExtensionMark(t){var e;this._spec.extensionMark&&(null==(e=this._spec.extensionMark)||e.forEach((e,i)=>{this._createExtensionMark(e,null,this._getExtensionMarkNamePrefix(),i,t)}))}_createExtensionMark(t,e,i,s,r){var a;let n=this._createMark({type:t.type,name:(0,eA.A)(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,componentType:t.componentType,key:t.dataKey});
2if(n){if((0,eA.A)(t.id)&&n.setUserId(t.id),r.hasAnimation&&!1!==t.animation){let e=bb({},bx(t.type,t,this._markAttributeContext));n.setAnimationConfig(e)}if("group"===t.type&&(i=`${i}_${s}`,null==(a=t.children)||a.forEach((t,e)=>{this._createExtensionMark(t,n,i,e,r)})),!(0,eE.A)(t.dataId)||!(0,eE.A)(t.dataIndex)){let e=this._option.getSeriesData(t.dataId,t.dataIndex);e===this._rawData?n.setData(this._data):(n.setDataView(e),e.target.addListener("change",()=>{n.getData().updateData()}))}}}_updateExtensionMarkSpec(){var t;null==(t=this._spec.extensionMark)||t.forEach((t,e)=>{let i=this._marks.getMarkWithInfo({name:(0,eA.A)(t.name)?`${t.name}`:`${this._getExtensionMarkNamePrefix()}_${e}`});i&&(this.initMarkStyleWithSpec(i,t),i.commit(!1,!0))})}getStackData(){var t;return null==(t=this._viewStackData)?void 0:t.latestData}_parseDefaultInteractionConfig(t){var e;if(!(null==t?void 0:t.length))return[];let i=(e=this._option.mode)===hd["desktop-browser"]||e===hd["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"pointertap"}}:hQ(e)||h0(e)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"tap"}}:null,s=Object.assign({},null==i?void 0:i.hover),r=Object.assign({},null==i?void 0:i.select),a=this._spec.hover;ey(a)?s.enable=a:r2(a)&&(s.enable=!0,s=uy(s,a));let n=this._spec.select;ey(n)?r.enable=n:r2(n)&&(r.enable=!0,r=uy(r,n));let l=[{trigger:{type:"dimension-hover"},marks:t}];if(s.enable){let e=vw(s,t);e.length&&l.push({trigger:this._defaultHoverConfig(s),marks:e})}if(r.enable){let e=vw(r,t);e.length&&l.push({trigger:this._defaultSelectConfig(r),marks:e})}return l}_defaultHoverConfig(t){return{type:"element-highlight",trigger:t.trigger,triggerOff:t.triggerOff,blurState:U.STATE_HOVER_REVERSE,highlightState:U.STATE_HOVER}}_defaultSelectConfig(t){let e="multiple"===t.mode,i=(0,eA.A)(t.triggerOff)?t.triggerOff:e?["empty"]:["empty",t.trigger];return{type:"element-select",trigger:t.trigger,triggerOff:i,reverseState:U.STATE_SELECTED_REVERSE,state:U.STATE_SELECTED,isMultiple:e}}_parseInteractionConfig(t){let{interactions:e}=this._spec,i=this._parseDefaultInteractionConfig(t);return e&&e.length&&e.forEach(t=>{let e=vw(t,this.getMarks());e.length&&i.push({trigger:t,marks:e})}),i}getInteractionTriggers(){if(!0!==this._option.disableTriggerEvent){let t=this.getMarksWithoutRoot();return this._parseInteractionConfig(t)}return[]}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;let e=this._spec.seriesStyle;if(!e||!e.length)return;let i=null!=(t=this._seriesField)?t:pk;this.getMarksWithoutRoot().forEach(t=>{let s={},r={},a={};e.forEach(e=>{var i;let n=null==(i=e[t.name])?void 0:i.style;n&&(s[e.name]=!0,a[e.name]=a[e.name]||{},Object.keys(n).forEach(t=>{r[t]=!0,a[e.name][t]=n[t]}))}),t.state.addStateInfo({stateValue:pM,level:-1,filter:t=>Array.isArray(t)?0!==t.length&&!0===s[t[0][i]]:!0===s[t[i]]});let n={};Object.keys(r).forEach(e=>{n[e]=s=>{var r,n;let l;if(Array.isArray(s)){if(0===s.length)return;l=null==(r=a[s[0][i]])?void 0:r[e]}return l=null==(n=a[s[i]])?void 0:n[e],(0,eA.A)(l)?l:t.getAttribute(e,s)}}),this.setMarkStyle(t,n,pM,N.User_SeriesStyle)})}afterInitMark(){this.event.emit(dj.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField),this.getMarks().forEach(t=>{var e,i;(null==(i=null==(e=t.stateStyle)?void 0:e.normal)?void 0:i.lineWidth)&&t.setAttribute("stroke",this.getColorAttribute(),"normal",N.Base_Series)})}getMarksWithoutRoot(){return this.getMarks().filter(t=>{var e;return!(null==(e=t.name)?void 0:e.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.getDataView())||e.target.addListener("change",this.viewDataUpdate.bind(this)),null==(i=this._viewDataStatistics)||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent()}initTooltip(){this._tooltipHelper=new bt(this)}_compareExtensionMarksSpec(t,e,i){t.length!==e.length||e.some((e,i)=>e.type!==t[i].type||e.id!==t[i].id||e.name!==t[i].name)?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)=>!(0,ex.n)(e,t[i]))&&(i.reCompile=!0)}_compareSpec(t,e,i){let s=super._compareSpec(t,e),r=Object.keys(e||{}).sort(),a=Object.keys(t||{}).sort();if(!(0,ex.n)(r,a))return s.reMake=!0,s;let n=Object.assign(Object.assign(Object.assign(Object.assign({},b_),by),i),{extensionMark:!0,label:!0,totalLabel:!0});return this._compareExtensionMarksSpec(oS(t.extensionMark),oS(e.extensionMark),s),s.reMake||this._compareLabelSpec(oS(t.label),oS(e.label),s),s.reMake||this._compareLabelSpec(oS(t.totalLabel),oS(e.totalLabel),s),s.reMake||(!s.reCompile&&this._marks.getMarks().some(i=>{var s,r;return n[i.name]=!0,(null==(s=e[i.name])?void 0:s.visible)!==(null==(r=t[i.name])?void 0:r.visible)})&&(s.reCompile=!0),!s.reCompile&&r.some(i=>by[i]&&!(0,ex.n)(t[i],e[i]))&&(s.reCompile=!0),r.some(i=>!n[i]&&!(0,ex.n)(t[i],e[i]))&&(s.reMake=!0)),s}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof eR||pi(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);let e=this.getMarksWithoutRoot();e.forEach(t=>{t.clearBeforeReInit(),this._spec[t.name]&&this.initMarkStyleWithSpec(t,this._spec[t.name])}),this.initMarkStyle(),e.forEach(t=>{t.commit(!1)}),this._updateExtensionMarkSpec(),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec(),bw(this)&&this.initAnimation()}onEvaluateEnd(t){this._data.updateData()}release(){var t,e;super.release(),this._viewDataMap.clear();let i=null==(e=null==(t=this._rawData)?void 0:t.transformsArr)?void 0:e.findIndex(t=>
2"addVChartProperty"===t.type);i>=0&&this._rawData.transformsArr.splice(i,1),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){eP(t.x)&&(this._layoutStartPoint.x=t.x),eP(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){eP(t)&&(this._layoutRect.width=t),eP(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?null!=(e=null==(t=this.getRawDataStatisticsByField(this._seriesField))?void 0:t.values)?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.getAttribute(e,t))?s:void 0}}_getSeriesInfo(t,e){let 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.values)?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo(null!=(t=this._seriesField)?t:pk,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;let i=this.getDefaultColorDomain(),s=this._getDataScheme();return null==(e=(t=(new mw).domain(i)).range)?void 0:e.call(t,s)}_getDataScheme(){return ud(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?null==(e=null==(t=this.getViewDataStatistics())?void 0:t.latestData[this._seriesField])?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:null!=(t=this._option.globalScale.getScale("color"))?t:this._getDefaultColorScale(),field:null!=(e=this._seriesField)?e:pk}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={},i={}){var s,r,a,n,l;let{key:o,groupKey:h,skipBeforeLayouted:u,themeSpec:d={},markSpec:c,dataView:p,parent:g,isSeriesMark:f,noSeparateStyle:m=!1}=e,_=super._createMark(t,{key:null!=o?o:this._getDataIdKey(),seriesId:this.id,attributeContext:this._markAttributeContext,componentType:e.componentType,noSeparateStyle:m,parent:!1!==g?null!=g?g:this._rootMark:null});if((0,eA.A)(_)){let e=this.getSpec()||{};this._marks.addMark(_,{name:t.name}),f&&(this._seriesMark=_),(0,eE.A)(p)?_.setData(this._data):!1!==p&&_.setDataView(p),_.setSkipBeforeLayouted(!1!==u),(0,eE.A)(h)||_.setGroupKey(h);let o=Object.assign(Object.assign({},i),{progressiveStep:e.progressiveStep,progressiveThreshold:e.progressiveThreshold,large:e.large,largeThreshold:e.largeThreshold,morph:null!=(s=i.morph)&&s,useSequentialAnimation:e.useSequentialAnimation,support3d:null!=(r=i.support3d)?r:e.support3d||!!e.zField,morphKey:(null==(a=e.morph)?void 0:a.morphKey)||`${this.getSpecIndex()}_${this.getMarks().length}`,morphElementKey:null!=(l=null==(n=e.morph)?void 0:n.morphElementKey)?l:i.morphElementKey});_.setMarkConfig(o),this.initMarkStyleWithSpec(_,uy({},d,c||e[_.name]))}return _}_getDataIdKey(){var t;return null!=(t=super._getDataIdKey())?t:pA}_getSeriesDataKey(t){let e="";if(!t)return e;let i=this.getDimensionField();e=i.map(e=>t[e]).join("_");let s=this.getSeriesField();return s&&!i.includes(s)&&(e+=`_${t[s]}`),e}addViewDataFilter(t){var e,i;null==(i=null!=(e=this._viewDataFilter)?e:this.getViewData())||i.transform(t,!1)}reFilterViewData(){var t,e;null==(e=null!=(t=this._viewDataFilter)?t:this.getViewData())||e.reRunAllTransform()}reTransformViewData(){var t,e;null==(e=null==(t=this._data)?void 0:t.getDataView())||e.reRunAllTransform()}fillData(){var t;null==(t=this.getRawData())||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==pC&&t!==pE&&t!==pT&&t!==pB||(t=this.getStackValueField()),null!=(e=vK(this.getRawData(),t))?e:t}_getInvalidConnectType(){return"zero"===this._invalidType?"zero":"link"===this._invalidType?"connect":"none"}_getInvalidDefined(t){let e=this.getInvalidCheckFields();return!e.length||e.every(e=>hj(t[e]))}_getRelatedComponentSpecInfo(t){var e;let i=this.getSpecIndex(),s=null==(e=this._option.getSpecInfo().component[t])?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.latestData)&&((null==(s=e.values)?void 0:s.length)?t(e):e.nodes&&Object.values(e.nodes).forEac
2h(e=>{this._forEachStackGroup(t,e)}))}isDatumInViewData(t){if(!t)return!1;let 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())?i:pk]}}function bB(t,e,i){let s=t.getScale(0),r="isInverse"in t&&t.isInverse();fI(s.type)?i.sort((t,i)=>(t[e]-i[e])*(r?-1:1)):i.sort((t,i)=>(s.index(t[e])-s.index(i[e]))*(r?-1:1))}function bE(t){return{dataIndex:e=>{var i,s;let r="horizontal"===t.direction?t.fieldY[0]:t.fieldX[0],a=null==e?void 0:e[r],n="horizontal"===t.direction?t.scaleY:t.scaleX;return(null!=(s=null==(i=null==n?void 0:n.domain)?void 0:i.call(n))?s:[]).indexOf(a)||0},dataCount:()=>{var e,i,s;let r="horizontal"===t.direction?t.scaleY:t.scaleX;return null!=(s=(null!=(i=null==(e=null==r?void 0:r.domain)?void 0:e.call(r))?i:[]).length)?s:0}}}bC.mark=bc,bC.transformerConstructor=bT;class bP extends bC{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.bind(this)},this._setPositionXEncoder=t=>{this._positionXEncoder=t.bind(this)},this._getPositionYEncoder=()=>{var t;return null==(t=this._positionYEncoder)?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=oS(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=oS(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&oS(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(){let 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=>{let s={key:i,operations:[]},r=e.axisHelper.getScale(0);fI(r.type)?(s.operations=["max","min"],"log"===r.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;let i=null==(t="horizontal"===this.direction?this.getXAxisHelper():this.getYAxisHelper())?void 0:t.getAxisId();return null!=(e=this._spec.stackValue)?e:`${px.H}_series_${this.type}_${i}`}getStackValueField(){return"horizontal"===this.direction?oS(this._spec.xField)[0]:oS(this._spec.yField)[0]}setValueFieldToStack(){"horizontal"===this.direction?(this.setFieldX(pC),this.setFieldX2(pT)):(this.setFieldY(pC),this.setFieldY2(pT))}setValueFieldToPercent(){"horizontal"===this.direction?(this.setFieldX(pE),this.setFieldX2(pB)):(this.setFieldY(pE),this.setFieldY2(pB))}setValueFieldToStackOffsetSilhouette(){"horizontal"===this.direction?(this.setFieldX(pO),this.setFieldX2(pP)):(this.setFieldY(pO),this.setFieldY2(pP))}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=oS(this._spec.xField),this._specYField=oS(this._spec.yField),(0,eA.A)(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2(null==(t=this._spec)?void 0:t.x2Field),this.setFieldY2(null==(e=this._spec)?void 0:e.y2Field),this.get
2Stack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent(),this.getStackOffsetSilhouette()&&this.setValueFieldToStackOffsetSilhouette(),(0,eA.A)(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.call(e,t))?s:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,s;return null!=(s=null==(i=(e=this.getYAxisHelper()).getBandwidth)?void 0:i.call(e,t))?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(oS(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,r,a){let n=r();if(n)return n(t);if(!e)return a(t=>NaN),NaN;let l=(e.getFields?e.getFields():i).slice(0,s);return l&&0!==l.length?(e.isContinuous?a(t=>(this._scaleConfig.datum=t,e.valueToPosition(this.getDatumPositionValue(t,l[0]),this._scaleConfig))):a(t=>(this._scaleConfig.datum=t,e.dataToPosition(oS(this.getDatumPositionValues(t,l)),this._scaleConfig))),r()(t)):(a(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 NaN;let{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):NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):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 NaN;let{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return NaN;let{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(dj.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null==(e="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper)?void 0:e.getAxisId())}},()=>{this._sortDataInAxisDomain()})}_sortDataInAxisDomain(){var t,e,i;(null==(e=null==(t=this.getViewData())?void 0:t.latestData)?void 0:e.length)&&(bB("horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,"horizontal"===this._direction?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),null==(i=this._data)||i.updateData(!0))}getInvalidCheckFields(){let t=[];return this._xAxisHelper&&this._xAxisHelper.isContinuous&&this._xAxisHelper.getAxisType()!==hc.geoCoordinate&&(this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._specXField).forEac
2h(e=>{t.push(e)}),this._yAxisHelper&&this._yAxisHelper.isContinuous&&this._yAxisHelper.getAxisType()!==hc.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)}}let bO="monotone";(tt=tw||(tw={})).dimensionHover="dimensionHover",tt.dimensionClick="dimensionClick";let bR={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}};class bI{addSamplingCompile(){if(this._spec.sampling){let{width:t,height:e}=this._region.getLayoutRect(),i=this._fieldY,s=this._fieldX;this._data&&this._data.setTransform([{type:"dataSampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?s[0]:i[0],groupBy:this._seriesField,mode:this._spec.sampling}])}}addOverlapCompile(){var t;if(this._spec.markOverlap){let e=[];e.push({type:"symbolOverlap",direction:"horizontal"===this._direction&&"cartesian"===this.coordinate?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),null==(t=this._symbolMark)||t.setTransform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t){return this._lineMark=this._createMark(bR.line,{groupKey:this._seriesField,isSeriesMark:null==t||t},{morphElementKey:this.getDimensionField()[0]}),this._lineMark}initLineMarkStyle(t,e){var i,s;let r=this._lineMark;if(r){if(this.setMarkStyle(r,{stroke:this.getColorAttribute()},"normal",N.Series),"zero"!==this._invalidType&&this.setMarkStyle(r,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",N.Series),this.event.on(dj.viewDataStatisticsUpdate,{filter:t=>t.model===this},()=>{this.encodeDefined(r,"defined")}),"polar"===this.coordinate)this.setMarkStyle(r,{lineJoin:"bevel",curveType:"linear",closePath:!0},"normal",N.Series);else{let a=null!=e?e:null==(s=null==(i=this.getSpec().line)?void 0:i.style)?void 0:s.curveType;this.setMarkStyle(r,{curveType:a===bO?"horizontal"===t?"monotoneY":"monotoneX":a},"normal",N.Built_In)}this.setMarkStyle(r,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",N.Series)}return r}_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){let 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){if(!1!==(this._spec.point||{}).visible&&(this._symbolMark=this._createMark(bR.point,{groupKey:this._seriesField,isSeriesMark:!!t},{morph:bk(this._spec,bR.point.name),morphElementKey:this.getDimensionField()[0]})),!0===this._spec.activePoint){let t=new eR(this._option.dataSet,{name:`${px.H}_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()},{morph:!1}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){let t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){for(let e in this._symbolActiveMark.setVisible(!0),this.event.on(tw.dimensionHover,this._dimensionTrigger.bind(this)),this._symbolMark.stateStyle)for(let i in this._symbolActiveMark.stateStyle[e]={},this._symbolMark.stateStyle[e])"visible"!==i&&(this._symbolActiveMark.stateStyle[e][i]={style:null,level:N.Series,referer:t});this._symbolActiveMark.state.changeStateInfo({stateValue:U.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",N.Series),this.setMarkStyle(t,{x:t=>"zero"===this._invalidType||this._getInvalidDefined(t)?this.dataToPositionX(t):NaN,y:t=>"zero"===this._invalidType||this._getInvalidDefined(t)?this.dataToPositionY(t):NaN,z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",N.Series))}_initSymbolActiveMarkAlone(){var t,e;let i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(null==(e=null==(t=this._spec[bR.point.name])?void 0:t.state)?void 0:e.dimension_hover)&&(i.setVisible(!0),this.event.on(tw.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,uy({},this._spec[bR.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:U.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&("symbol"!==(null==(e=t.getTarget())?void 0:e.type)&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>
2t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",N.Series),this.event.on(dj.viewDataStatisticsUpdate,{filter:t=>t.model===this},()=>{this.encodeDefined(t,"visible")}))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>{var e;return null!=(e=t[this.getSeriesField()])?e:this.getSeriesKeys()[0]},z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,s,r,a;if(!t)return;let n=this._isFieldAllValid();if("zero"===this._invalidType||n){if(!0===(null==(s=null==(i=t.stateStyle.normal)?void 0:i[e])?void 0:s.style))return;this.setMarkStyle(t,{[e]:!0},"normal",N.Series)}else{if(!0!==(null==(a=null==(r=t.stateStyle.normal)?void 0:r[e])?void 0:a.style))return;this.setMarkStyle(t,{[e]:this._getInvalidDefined.bind(this)},"normal",N.Series)}t.compileEncode()}_isFieldAllValid(){let t=this.getViewDataStatistics(),e=this.getStackValueField();return!!(t&&t.latestData&&e)&&t.latestData[e]&&t.latestData[e].allValid}}let bL=Object.assign(Object.assign({},bc),bR),bD=(t,e)=>{if(t===e)return!0;if(typeof t!=typeof e||(0,eS.A)(t))return!1;if((0,ev.A)(t))return t.length===e.length&&t.every((t,i)=>bD(t,e[i]));if(t.gradient!==e.gradient)return!1;let 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;let r=null!=(i=t&&t.length)?i:0;return r===(null!=(s=e&&e.length)?s:0)&&0!==r&&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])},bF=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"];class bz extends _x{constructor(){super(...arguments),this._segmentStyleKeys=[],this._isValidPointChannel=t=>["x","y","defined"].includes(t)}_getSegmentAttributes(){return bF}initStyleWithSpec(t){this._segmentStyleKeys=[],super.initStyleWithSpec(t)}setStyle(t,e="normal",i=0){if((0,eE.A)(t))return;void 0===this.stateStyle[e]&&(this.stateStyle[e]={});let s=this._getIgnoreAttributes(),r=this._getSegmentAttributes(),a=this.isUserLevel(i);Object.keys(t).forEach(n=>{let l=t[n];if((0,eE.A)(l)||s.includes(n))return;a&&r.includes(n)&&(fR[null==l?void 0:l.type]||(null==l?void 0:l.scale)||(0,r3.A)(l))&&(this._segmentStyleKeys.includes(n)||this._segmentStyleKeys.push(n));let o=this._filterAttribute(n,l,e,i,a);this.setAttribute(n,o,e,i)})}_getLineSegments(t,e){if(!this._segmentStyleKeys||!this._segmentStyleKeys.length)return null;let i=[],s=null;return t.forEach((t,e)=>{s&&this._segmentStyleKeys.every(e=>{var i,r;return i=s[e],r=t[e],!(!(0,eE.A)(i)||!(0,eE.A)(r))||!(0,eE.A)(i)&&!(0,eE.A)(r)&&("lineDash"===e?i.length===r.length&&i.join("-")===r.join("-"):"stroke"===e||"fill"===e?bD(i,r):i===r)})||(i.length&&(i[i.length-1].endIndex=e),s=t,i.push({attrs:s,startIndex:e}))}),i.length>=2?i.map(t=>Object.assign(Object.assign({},t.attrs),{points:e.slice(t.startIndex,(0,eE.A)(t.endIndex)?e.length:t.endIndex)})):null}_getPrevPoints(t){let{points:e,segments:i}=t.attribute;return null!=e?e:i?i.reduce((t,e)=>(e.points&&e.points.forEach(e=>{t.push(e)}),t),[]):null}_runPointsEncoder(t,e,i={}){var s,r,a;let n=e.context.data,l=[],o=[],h={},u=null==(s=this.renderContext)?void 0:s.progressive,d=u&&0===u.currentIndex;if(n.forEach((e,i)=>{var s;o[i]={},l[i]={},Object.keys(t).forEach(s=>{this._isValidPointChannel(s)?o[i][s]=t[s](e):this._segmentStyleKeys.includes(s)&&!u?l[i][s]=t[s](e):0!==i||u&&!d||(h[s]=t[s](e))}),o[i].context=null!=(s=this._keyGetter(e))?s:i}),u){let t=null!=(a=null==(r=e.attribute)?void 0:r.segments)?a:[];return t.push({points:o}),d?Object.assign(Object.assign({},h),{segments:t}):{segments:t}}if(this._segmentStyleKeys&&this._segmentStyleKeys.length){let t=this._getLineSegments(l,o);if(t)return Object.assign(Object.assign(Object.assign({},h),l[0]),{segments:t,points:null})}return Object.assign(Object.assign(Object.assign({},h),l[0]),{points:o,segments:null})}_runEncoderOfGraphic(t,e,i={}){let s=e.context.data;return t&&Object.keys(t).some(this._isValidPointChannel)&&s&&s.length?this._runPointsEncoder(t,e,i):super._runEncoderOfGraphic(t,e,
2i)}_getDataByKey(t){return this._dataByGroup}_runProgressiveJoin(){let t=this.renderContext.progressive.currentIndex,e=[];this._dataByGroup.keys.forEach((i,s)=>{let r=this.renderContext.progressive.groupedData.get(i),a=this.renderContext.progressive.step,n=r.slice(t*a,(t+1)*a);if(0===t){let t={context:Object.assign(Object.assign({},this._getCommonContext()),{diffState:W.enter,data:n,uniqueKey:i,key:i,groupKey:i})};e.push(t)}else this._graphics[s].context.data=n});let i=0===t?e:this._graphics;return{graphicsByGroup:{[pA]:i},graphics:i,needUpdate:!1}}_setCommonAttributesToTheme(t){}_addProgressiveGraphic(t,e){e.incremental=1,t.appendChild(e)}}let bH=["segments","points","curveType","curveTension",...nX];class bj extends n0{constructor(t={}){super(t),this.type="line",this.numberType=nA}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;let{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&!(t.length<=1)}_interpolate(t,e,i,s,r){"points"===t&&(r.points=an(i,s,e))}getGraphicTheme(){return rQ(this).line}
2updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ie.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;let{lineJoin:s=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){let{points:r=e.points,connectedType:a}=t;return r.forEach(t=>{!1===t.defined&&"connect"!==a||i.add(t.x,t.y)}),i}updateLineAABBBoundsBySegments(t,e,i,s){let{segments:r=e.segments,connectedType:a}=t;return r.forEach(t=>{t.points.forEach(t=>{!1===t.defined&&"connect"!==a||i.add(t.x,t.y)})}),i}needUpdateTags(t){return super.needUpdateTags(t,bH)}needUpdateTag(t){return super.needUpdateTag(t,bH)}toCustomPath(){let t=super.toCustomPath();if(t)return t;let e=this.attribute;t=new sO;let i=e.segments,s=e=>{if(e&&e.length){let i=!0;e.forEach(e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)})}};return i&&i.length?i.forEach(t=>{s(t.points)}):e.points&&s(e.points),t}clone(){return new bj(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bj.NOWORK_ANIMATE_ATTR}}function bV(t){return new bj(t)}bj.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nQ);let bN=!1,bW=new eL(t=>{bN||(bN=!0,t(oY).toSelf().inSingletonScope(),t(o$).toSelf().inSingletonScope(),t(lo).to(oY).inSingletonScope(),t(ln).toService(lo))});class bU extends oN{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();let r=t.getGraphicTheme(),{x:a,y:n,z:l,lastModelMatrix:o}=this.transform(t,r,s),h=e;if(s.camera){h=e.clone();let i=t.parent.globalTransMatrix;h.x=i.a*e.x+i.c*e.y+i.e,h.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,n,{},null,t=>!!u||(u=t.isPointInPath(h.x,h.y)),(t,e,i)=>{if(u)return!0;let r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=e.keepStrokeScale||i.keepStrokeScale?r+a:s4(s,r+a,s.dpr),u=t.isPointInStroke(h.x,h.y)}),this.canvasRenderer.z=0,s.modelMatrix!==o&&nN.free(s.modelMatrix),s.modelMatrix=o,s.highPerformanceRestore(),u}}let bG=class extends bU{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=nA}};bG=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(te=eU(lo),function(t,e){te(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bG);let bY=!1,b$=new eL((t,e,i,s)=>{bY||(bY=!0,t(gv).to(bG).inSingletonScope(),t(gC).toService(gv))}),bX=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=nA}};bX=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(ti=eU(lo),function(t,e){ti(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bX);let bK=!1,bq=new eL((t,e,i,s)=>{bK||(bK=!0,t(go).to(bX).inSingletonScope(),t(gs).toService(go))});function bZ(){bZ.__loaded||(bZ.__loaded=!0,lF.RegisterGraphicCreator("line",bV),e7.load(bW),e7.load(gi?b$:bq))}bZ.__loaded=!1;let bJ=["#ffffff","#000000"];function bQ(t,e,i,s,r,a){if("string"!=typeof t||"string"!=typeof e)return t;let n=new un(t).toHex(),l=new un(e).toHex();return b0(n,l,i,s,a)?n:function(t,e,i,s,r,a){let n=[];for(let l of(r&&(r instanceof Array?n.push(...r):n.push(r)),n.push(...bJ),n))if(t!==l&&b0(l,e,i,s,a))return l}(n,l,i,s,r,a)}function b0(t,e,i,s,r){if("lightness"===r){let i=un.getColorBrightness(new un(e));return .5>un.getColorBrightness(new un(t))?i>=.5:i<.5}return s?b1(t,e)>s:"largeText"===i?b1(t,e)>3:b1(t,e)>4.5}function b1(t,e){let i=b2(t),s=b2(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function b2(t){let e=function(t){let e="",i="",s="",r=+("#"===t[0]);for(let a=r;a<t.length;a++)"#"!==t[a]&&(a<r+2?e+=t[a]:a<r+4?i+=t[a]:a<r+6&&(s+=t[a]));return[parseInt(e,16),parseInt(i,16),parseInt(s,16)]}(t),i=e[0]/255,s=e[1]/255,r=e[2]/255;return .2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))}function b3(t,e,i,s){let r;switch(t){case"base":r=e;break;case"invertBase":r=i;break;case"similarBase":r=s}return r}function b5(t,e){t.forEachChildren(t=>{let i=e(t);t.isContainer&&!i&&b5(t,e)})}let b4=t=>!(0,eE.A)(t)&&!1!==t.visible;function b8(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function b6(t,e,i){return Math.abs(t-e)<i}function b9(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}let b7=new Uint32Array(33),xt=new Uint32Array(33);xt[0]=0,b7[0]=~xt[0];for(let t=1;t<=32;++t)xt[t]=xt[t-1]<<1|1,b7[t]=~xt[t];function xe(t,e,i={top:0,left:0,right:0,bottom:0}){let{top:s=0,left:r=0,right:a=0,bottom:n=0}=i,l=Math.max(1,Math.sqrt(t*e/1e6)),o=~~((t+r+a+l)/l),h=~~((e+s+n+l)/l),u=t=>~~(t/l);return u.bitmap=()=>{var t,e;let i;return{array:i=new Uint32Array(~~(((t=o)*(e=h)+32)/32)),get:(e,s)=>{let r=s*t+e;return i[r>>>5]&1<<(31&r)}
2,set:(e,s)=>{let r=s*t+e;i[r>>>5]|=1<<(31&r)},clear:(e,s)=>{let r=s*t+e;i[r>>>5]&=~(1<<(31&r))},getRange:({x1:s,y1:r,x2:a,y2:n})=>{if(a<0||n<0||s>t||r>e)return!0;let l,o,h,u,d=n;for(;d>=r;--d)if(l=d*t+s,o=d*t+a,(h=l>>>5)==(u=o>>>5)){if(i[h]&b7[31&l]&xt[1+(31&o)])return!0}else{if(i[h]&b7[31&l]||i[u]&xt[1+(31&o)])return!0;for(let t=h+1;t<u;++t)if(i[t])return!0}return!1},setRange:({x1:s,y1:r,x2:a,y2:n})=>{var l,o,h,u;let d,c,p,g,f;if(!(a<0)&&!(n<0)&&!(s>t)&&!(r>e))for(;r<=n;++r)if(d=r*t+s,c=r*t+a,(p=d>>>5)==(g=c>>>5))l=b7[31&d]&xt[1+(31&c)],i[p]|=l;else for(o=b7[31&d],i[p]|=o,h=xt[1+(31&c)],i[g]|=h,f=p+1;f<g;++f)u=f,i[u]|=0xffffffff},clearRange:({x1:e,y1:s,x2:r,y2:a})=>{var n,l,o,h;let u,d,c,p,g;for(;s<=a;++s)if(u=s*t+e,d=s*t+r,(c=u>>>5)==(p=d>>>5))n=xt[31&u]|b7[1+(31&d)],i[c]&=n;else for(l=xt[31&u],i[c]&=l,o=b7[1+(31&d)],i[p]&=o,g=c+1;g<p;++g)h=g,i[h]&=0},outOfBounds:({x1:i,y1:s,x2:r,y2:a})=>i<0||s<0||a>=e||r>=t,toImageData:s=>{let r=s.createImageData(t,e),a=r.data;for(let s=0;s<e;++s)for(let e=0;e<t;++e){let r=s*t+e,n=4*r,l=i[r>>>5]&1<<(31&r);a[n+0]=255*l,a[n+1]=255*l,a[n+2]=255*l,a[n+3]=31}return r}}},u.x=t=>~~((t+r)/l),u.y=t=>~~((t+s)/l),u.ratio=l,u.padding=i,u.width=t,u.height=e,u}function xi(t,e){let{x1:i,x2:s,y1:r,y2:a}=e,{top:n=0,left:l=0,right:o=0,bottom:h=0}=t.padding,u=h4(i,-l,t.width+o),d=h4(s,-l,t.width+o),c=h4(r,-n,t.height+h),p=h4(a,-n,t.height+h);return{x1:t.x(u),x2:t.x(d),y1:t.y(c),y2:t.y(p)}}function xs(t,e,i=!1){return i?xi(t,e):{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}function xr(t,e,i,s=!0,r=0){let a=i;r>0&&(a={x1:i.x1-r,x2:i.x2+r,y1:i.y1-r,y2:i.y2+r}),a=xs(t,a);let n=e.outOfBounds(a);return(!s||!n)&&(n&&(a=xi(t,a)),!e.getRange(a))}function xa(t,e,i,s=[],r=!0,a=0,n=!1){var l,o,h,u;let d,c=s.filter(t=>(0,eA.A)(t)),p=null!=(l=i.attribute.x)?l:0,g=null!=(o=i.attribute.y)?o:0,f=i.AABBBounds,m={x1:f.x1,x2:f.x2,y1:f.y1,y2:f.y2};for(let i=0;i<c.length;i++){let s=c[i];d=s;let n=(null!=(h=s.x)?h:p)-p,l=(null!=(u=s.y)?u:g)-g;if(m.x1=f.x1+n,m.x2=f.x2+n,m.y1=f.y1+l,m.y2=f.y2+l,xr(t,e,m,r,a))return e.setRange(xs(t,m,!0)),s}return n&&d&&i.setAttributes(d),!1}let xn=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],xl=["top","inside-top","inside"];function xo(t,e,i,s={}){let{x1:r,x2:a,y1:n,y2:l}=t.AABBBounds,{top:o=0,left:h=0,right:u=0,bottom:d=0}=s,c=Math.min(r,a),p=Math.max(r,a),g=Math.min(n,l),f=Math.max(n,l),m=e+u,_=i+d,y=0,v=0;return c<0-h?y=-c:p>m&&(y=m-p),g<0-o?v=-g:f>_&&(v=_-f),{dx:y,dy:v}}let xh={mode:"same-time",duration:300,easing:"linear"};function xu(t){return 3===t||4===t}let xd=t=>{if(!t||!t.attribute)return[];let{points:e,segments:i}=t.attribute;if(i&&i.length){let t=[];return i.forEach(e=>{e.points.forEach(e=>{t.push(e)})}),t}return e};function xc(t,e,i,s,r,a){return Math.abs(e/t)<a/r?{x:i+(t>0?r:-r),y:s+e*r/Math.abs(t)}:{x:i+t*a/Math.abs(e),y:s+(e>0?a:-a)}}class xp{constructor(t,e,i,s,r,a,n,l,o,h,u,d,c,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=r,this.wordBreak=a,this.verticalDirection=n,this.lines=[],this.globalAlign=l,this.globalBaseline=o,this.layoutDirection=h,this.directionKey=s6[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=d,this.singleLine=c,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){let{width:i,height:s}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0,a=this.isHeightMax?Math.min(this.height,s):this.height||s||0;a=Math.min(a,s);let n=0;switch(this.globalBaseline){case"top":n=0;break;case"middle":n=-a/2;break;case"bottom":n=-a}let l=0;"right"===this.globalAlign||"end"===this.globalAlign?l=-r:"center"===this.globalAlign&&(l=-r/2);let o=this[this.directionKey.height];this.singleLine&&(o=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=o&&0!==o)for(let i=0;i<this.lines.length;i++){let{top:s,height:r}=this.lines[i];if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+o)break;let a=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+o&&(a=!0,h=!0),this.lines[i].draw(t,a,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+n,this.ellipsis,e)}else{let i=Math.floor((o-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=i:n+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+n,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){let{top:s,height:r}=this.lines[i],a=o-this.lines[i].top-this.lines[i].height;if(0===o)this.lines[i].draw(t,!1,l,a+n,this.ellipsis,e);else{if(a+r>this[this.directionKey.top]+o||a<this[this.directionKey.top])return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]&&(s=!0,h=!0),this.lines[i].draw(t,s,l,a+n,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[i].height+this.lines[i].top);let{top:s,height:r}=this.lines[i];if(0===o)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+n,this.ellipsis,e);else{if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+o)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]+o&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+n,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){let s=this.lines[i];s.actualWidth>t&&(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,{width:i,height:s}=this.getRawActualSize();this.width;let r=this.height||s||0;r=Math.min(r,s);let a=this[this.directionKey.height];if(this.singleLine&&(a=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=a&&0!==a)for(let i=0;i<this.lines.length;i++){let{top:s,height:r}=this.lines[i];if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+a);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a){let s=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(s);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{this.actualHeight;for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){let{top:s,height:r}=this.lines[i],n=a-this.lines[i].top-this.lines[i].height;if(0===a)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+r>this[this.directionKey.top]+a||n<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&n-this.lines[i+1].height<this[this.directionKey.top]){let s=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(s);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){let{top:s,height:r}=this.lines[i];if(0===a)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+a);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a){let s=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(s);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function xg(t,e,i,s){let r=Math.round(t),a=Math.round(i),n=Math.round(e),l=Math.round(s);return{left:t>r?r:r-.5,top:i>a?a:a-.5,right:n>e?n:n+.5,bottom:l>s?l:l+.5}}class xf{constructor(t,e,i,s){var r,a;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=s;const n=au(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:l,height:o,descent:h,width:u}=rr(t,i,this.ascentDescentMode);let d=0,c=0,p=0;this.height>o&&(c=Math.ceil(d=(this.height-o)/2),p=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=o-d):"bottom"===this.textBaseline?(this.ascent=o-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=l+c,this.descent=h+p),this.length=t.length,this.width=u||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!=(r=i.dx)?r:0,this.dy=null!=(a=i.dy)?a: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(){let{width:t}=rr(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}
2drawBackground(t,e,i,s,r,a,n){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let l=e+i,o=this.text,h=this.left+s;l+=this.top;let u=this.direction;if(this.verticalEllipsis)o=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)o+=this.ellipsisStr,"right"!==a&&"end"!==a||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){let t=ri(o,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,o.length-1);if(o=o.slice(0,t)+this.ellipsisStr,"right"===a||"end"===a)if("vertical"===u);else{let{width:e}=rr(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}return Object.assign(Object.assign({},xg(h,h+(this.widthOrigin||this.width),e,e+n)),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,s,r,a,n){var l;let o=e+i,h=this.text,u=this.left+s+(null!=(l=this.space)?l:0)/2;o+=this.top;let d=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,d="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==a&&"end"!==a||(u-=this.ellipsisWidth);else if("replace"===this.ellipsis){let t=ri(h,("vertical"===d?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t)+this.ellipsisStr,"right"===a||"end"===a)if("vertical"===d);else{let{width:e}=rr(this.text.slice(t),this.character,this.ascentDescentMode);u-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":o-=this.ascent*(1/3);break;case"sub":o+=this.descent/2}"vertical"===d&&(t.save(),t.rotateAbout(Math.PI/2,u,o),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(u,o),u=0,o=0);let{lineWidth:c=1}=this.character;if(this.character.stroke&&c&&t.strokeText(h,u+this.dx,o+this.dy),this.character.fill&&t.fillText(h,u+this.dx,o+this.dy),this.character.fill){if(this.character.lineThrough||this.character.underline){if(this.character.underline){let e=1+o,i=xg(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+o,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){let e=1+o-this.ascent/2,i=xg(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+o-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){let e=1+o,i=xg(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+o,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){let e=1+o-this.ascent/2,i=xg(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+o-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}"vertical"===d&&t.restore()}getWidthWithEllips(t){let e=this.text,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){let t=ri(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t)+this.ellipsisStr;let{width:s}=rr(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-s}return i}}let xm=["width","height","image","imageMode","imagePosition","imageScale","imageOffsetX","imageOffsetY",...nX];class x_ extends n0{constructor(t){super(t),this.type="image",this.numberType=nS,this.loadImage(this.attribute.image)}getImageElement(){let{image:t}=this.attribute;if(!t||!this.resources)return null;let e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!=(t=this.attribute.repeatX)?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!=(t=this.attribute.repeatY)?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))}
2imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,()=>{this.successCallback&&this.successCallback()}),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,()=>{this.failCallback&&this.failCallback()})}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return rQ(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{maxWidth:s=e.maxWidth,maxHeight:r=e.maxHeight}=t,{width:a,height:n}=t;if(null==a||null==n){let t=this.getImageElement();if(t){let e=t.width,i=t.height;if(null!=a)n=i/e*a;else if(null!=n)a=e/i*n;else{let t=e/i;t>s/r?(a=s,n=s/t):(n=r,a=r*t)}}else a=s,n=r}this._actualWidth=a,this._actualHeight=n,i.set(0,0,a,n)}let{tb1:s,tb2:r}=ie.graphicService.updateTempAABBBounds(i);return gJ(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ie.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return s1[t]}needUpdateTags(t){return super.needUpdateTags(t,xm)}needUpdateTag(t){return super.needUpdateTag(t,xm)}clone(){return new x_(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return x_.NOWORK_ANIMATE_ATTR}}function xy(t){return new x_(t)}x_.NOWORK_ANIMATE_ATTR=Object.assign({image:1,imageMode:1,repeatX:1,repeatY:1},nQ);class xv extends x_{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=ae(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if((0,ev.A)(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){let t=ae(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)?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!=(t=this.attribute.height)?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();let{width:t=s1.width,height:e=s1.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute;return this._AABBBounds.expand([0,(i-t)/2*2,(s-e)/2*2,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class xb{constructor(t,e,i,s,r,a,n,l){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=r,this.top=i-s,this.paragraphs=a.map(t=>t),this.textAlign=(this.paragraphs[0]instanceof xv?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=n,this.directionKey=s6[this.direction],this.actualWidth=0;let o=0;this.paragraphs.forEach((t,e)=>{if(0===e&&t instanceof xf){let e=rt.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],o=Math.max(t[this.directionKey.height],o)}),this.height=o,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(e,l)}calcOffset(t,e){let i=this.directionKey,s=this.height,r=this.left,a=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map(function(t){t instanceof xv?(t["_"+i.x]=r,r+=t[i.width]+a,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?s-t.height:(s-t.height)/2):(t[i.left]=r,r+=t[i.width]+a)})}draw(t,e,i,s,r,a){if(r&&(e||this.paragraphs.some(t=>t.overflow))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){let 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--){let i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof xv)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}let a=!0===r?"...":r||"";i.ellipsisStr=a;let{width:n}=rr(a,i.character,i.ascentDescentMode),l=n||0;if(l<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(l<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=l,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}let n="",l=-1,o=[],h=[o];this.paragraphs.forEach((e,r)=>{if(e instanceof xv)return;
2let a=e.drawBackground(t,s,this.ascent,i,0===r,this.textAlign,this.height);a&&(n===a.fillStyle&&l===a.globalAlpha||(o=[],h.push(o),n=a.fillStyle,l=a.globalAlpha),o.push(a))}),h.forEach(e=>{if(0===e.length)return;let i=e[0],s=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,s.right-i.left,s.bottom-i.top)}),this.paragraphs.forEach((e,r)=>{if(e instanceof xv)return e.setAttributes({x:i+e._x,y:s+e._y}),void a(e,t,i+e._x,s+e._y,this.ascent);let n={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){let i=e&&e.stroke||!1;if(!i)return t.globalAlpha=0;let{strokeOpacity:s=1,opacity:r=1}=e;t.globalAlpha=s*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,re(t,e)})(t,e.character),function(t,e,i){let s=e&&e.fill||!0;if(!s)return t.globalAlpha=0;let{fillOpacity:r=1,opacity:a=1}=e;t.globalAlpha=r*a,t.fillStyle=i?s8(t,s,{AABBBounds:i}):s,re(t,e)}(t,e.character,n),e.draw(t,s,this.ascent,i,0===r,this.textAlign,this.height)})}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){let s=this.paragraphs[i];if(s instanceof xv)break;let{width:r}=rr(t,s.character,s.ascentDescentMode),a=r||0;if(a<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=a;break}if(a<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=a,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.forEach((t,e)=>{i+=t instanceof xv?t.width:t.getWidthWithEllips(this.direction)}),i}}class xx{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=s6[this.direction]}store(t){if(t instanceof xv){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;let t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new xb(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 xv?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){let i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=ri(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==r){let i,s,[a,n]=(i=t.text.slice(0,r),s=t.text.slice(r),[new xf(i,t.newLine,t.character,t.ascentDescentMode),new xf(s,!0,t.character,t.ascentDescentMode)]);this.store(a),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let xS=!1;try{xS=Intl&&"function"==typeof Intl.Segmenter}catch(t){xS=!1}let xA=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...nX];class xk extends n0{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=nT,this.onBeforeAttributeUpdate=(t,e,i)=>{for(let i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;let s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!=(t=this.attribute.width)?t:s0.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!=(t=this.attribute.height)?t:s0.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)?t:s0.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!=(t=this.attribute.wordBreak)?t:s0.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!=(t=this.attribute.verticalDirection)?t:s0.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!=(t=this.attribute.textAlign)?t:s0.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!=(t=this.attribute.textBaseline)?t:s0.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!=(t=this.attribute.textConfig)?t:s0.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return rQ(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every(t=>t.paragraphs.every(t=>!(t.text&&(0,eS.A)(t.text)&&xk.splitText(t.text).length>1))):t.every(t=>t.isComposing||!(t.text&&(0,eS.A)(t.text)&&xk.splitText(t.text).length>1))}static splitText(t){if(xS){let e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(let{segment:s}of e.segment(t))i.push(s);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){let e=[];return t.forEach(t=>{let i=xk.splitText(t.text.toString());if((0,eS.A)(t.text)&&i.length>1)for(let s=0;s<i.length;s++){let r=i[s];e.push(Object.assign(Object.assign({},t),{text:r}))}else e.push(t)}),e}
2updateAABBBounds(t,e,i){var s,r,a,n;let{width:l=e.width,height:o=e.height,maxWidth:h=e.maxWidth,maxHeight:u=e.maxHeight,textAlign:d=e.textAlign,textBaseline:c=null!=(r=null!=(s=t.textBaseline)?s:e.textBaseline)?r:"top",editOptions:p}=t;if(l>0&&o>0)i.set(0,0,l,o);else{let{width:t,height:e}=this.getFrameCache().getActualSize(),s=l||t||0,r=o||e||0;r="number"==typeof u&&r>u?u:r||0,s="number"==typeof h&&s>h?h:s||0,i.set(0,0,s,r)}!p||!p.keepHeightWhileEmpty||i.height()||(null==(a=t.textConfig)?void 0:a.length)||(i.y2=i.y1+(null!=(n=t.fontSize)?n:12),i.x2=i.x1+2);let g=0;switch(c){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(d){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return o||("middle"===this.verticalDirection?g-=i.height()/2:"bottom"===this.verticalDirection&&(g-=i.height())),i.translate(f,g),ie.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ie.graphicService.updateHTMLTextAABBBounds(t,e,
2i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ie.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,xA)}needUpdateTag(t){return super.needUpdateTag(t,xA)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){let t=this.getFrameCache();if(t.actualHeight>t.height)return!0;let{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){let i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){let e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){let{fill:e,stroke:i,fontSize:s,fontFamily:r,fontStyle:a,fontWeight:n,lineWidth:l,opacity:o,fillOpacity:h,lineHeight:u,strokeOpacity:d,upgradeAttrs:c}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:s,fontFamily:r,fontStyle:a,fontWeight:n,lineWidth:l,opacity:o,fillOpacity:h,strokeOpacity:d},t);return(null==c?void 0:c.lineHeight)&&(p.lineHeight=u),p}doUpdateFrameCache(t){var e;let{maxWidth:i,maxHeight:s,width:r,height:a,ellipsis:n,wordBreak:l,verticalDirection:o,textAlign:h,textBaseline:u,layoutDirection:d,singleLine:c,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,_=m&&m.multiBreakLine,{textConfig:y=[]}=this.attribute;g&&y.length>0&&!xk.AllSingleCharacter(y)&&(y=xk.TransformTextConfig2SingleCharacter(y),this.attribute.textConfig=y);let v=[],b=null!=t?t:y;for(let t=0;t<b.length;t++)if("image"in b[t]){let e=this.combinedStyleToCharacter(b[t]);e.lineWidth=void 0;let i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)v.push(i);else{let t=new xv(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null==(t=this.stage)||t.renderNextFrame()},t.richtextId=e.id,v.push(t)}}else{let e=this.combinedStyleToCharacter(b[t]);if(ed(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){let i=e.text.split("\n");for(let s=0;s<i.length;s++)if(0===s)v.push(new xf(i[s],!1,e,f));else if(i[s]||t===b.length-1)v.push(new xf(i[s],!0,e,f));else{let e=this.combinedStyleToCharacter(b[t+1]);v.push(new xf(i[s],!0,e,f))}}else e.text&&v.push(new xf(e.text,!1,e,f))}let x="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof s&&Number.isFinite(s)&&s>0,A="number"==typeof r&&Number.isFinite(r)&&r>0&&(!x||r<=i),k="number"==typeof a&&Number.isFinite(a)&&a>0&&(!S||a<=s),M=new xp(0,0,(A?r:x?i:0)||0,(k?a:S?s:0)||0,n,l,o,h,u,d||"horizontal",!A&&x,!k&&S,c||!1,null==(e=this._frameCache)?void 0:e.icons),w=new xx(M);if(w.newLine=_,p){let t=0,e=!1;for(let i=0;i<v.length;i++){let s=v[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,s.newLine||M.lines[M.lines.length-1].paragraphs.push(s)):w.deal(s,!0),M.lines.length!==t&&(t=M.lines.length,w.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,M.lines[M.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,w.lineWidth=0),w.send()}}else for(let t=0;t<v.length;t++)w.deal(v[t]);if(w.send(),!("horizontal"===M.layoutDirection?A:k)){let t=M.getActualSizeWidthEllipsis(),e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?x:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:s)),M.lines.forEach(function(t){t.calcOffset(e,!1)})}_&&M.lines.forEach(t=>{let e=t.paragraphs;t.paragraphs=t.paragraphs.filter(t=>""!==t.text),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))}),this._frameCache=M}clone(){return new xk(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=>{let 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,r,a;t?(null==(e=this._currentHoverIcon)||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null==(i=this.stage)||i.setCursor(t.attribute.cursor),null==(s=this.stage)||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null==(r=this.stage)||r.setCursor(),null==(a=this.stage)||a.renderNextFrame())}pickIcon(t){let e,i=this.getFrameCache(),{e:s,f:r}=this.globalTransMatrix;return i.icons.forEach((i,a)=>{var n,l;let o=i.AABBBounds.clone();o.translate(i._marginArray[3],i._marginArray[0]),o.containsPoint({x:t.x-s,y:t.y-r})&&((e=i).globalX=(null!=(n=e.attribute.x)?n:0)+s+i._marginArray[3],e.globalY=(null!=(l=e.attribute.y
2)?l:0)+r+i._marginArray[0])}),e}getNoWorkAnimateAttr(){return xk.NOWORK_ANIMATE_ATTR}}function xM(t){return new xk(t)}xk.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},nQ);let xw=class extends oN{constructor(){super(),this.numberType=nT,this.builtinContributions=[p6],this.init()}drawShape(t,e,i,s,r){let a=rQ(t).richtext,{strokeOpacity:n=a.strokeOpacity,opacity:l=a.opacity,fillOpacity:o=a.fillOpacity,visible:h=a.visible}=t.attribute;if(!t.valid||!h)return;let u=l*o>0,d=l*n>0;u&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),e.translate(i,s),this.beforeRenderStep(t,e,i,s,u,d,u,d,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,u,d,u,d,a,r))}drawIcon(t,e,i,s,r){var a;let n=rQ(t).richtextIcon,{width:l=n.width,height:o=n.height,opacity:h=n.opacity,image:u,backgroundFill:d=n.backgroundFill,backgroundFillOpacity:c=n.backgroundFillOpacity,backgroundStroke:p=n.backgroundStroke,backgroundStrokeOpacity:g=n.backgroundStrokeOpacity,backgroundRadius:f=n.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:_=l,backgroundHeight:y=o}=t.attribute;if(m&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){let t=(_-l)/2,r=(y-o)/2;0===f?(e.beginPath(),e.rect(i-t,s-r,_,y)):(e.beginPath(),oE(e,i-t,s-r,_,y,f,!0)),d&&(e.globalAlpha=c,e.fillStyle=d,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}let v=u&&(null==(a=null==t?void 0:t.resources)?void 0:a.get(u));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,s,l,o))}draw(t,e,i){let s=rQ(t).richtext;this._draw(t,s,!1,i)}};xw=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],xw);let xT=!1,xC=new eL(t=>{xT||(xT=!0,t(lg).to(xw).inSingletonScope(),t(ln).toService(lg))}),xB=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=nT}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};xB=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(ts=eU(lg),function(t,e){ts(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],xB);let xE=!1,xP=new eL((t,e,i,s)=>{xE||(xE=!0,t(gM).to(xB).inSingletonScope(),t(gC).toService(gM))}),xO=class{constructor(){this.type="image",this.numberType=nS}contains(t,e,i){let{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};xO=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],xO);let xR=!1,xI=new eL((t,e,i,s)=>{xR||(xR=!0,t(gl).to(xO).inSingletonScope(),t(xO).toService(gl))});function xL(){xL.__loaded||(xL.__loaded=!0,lF.RegisterGraphicCreator("richtext",xM),e7.load(xC),e7.load(gi?xP:xI))}xL.__loaded=!1;class xD{constructor(t){this.tasks=[],this.started=!1,this.completed=0,this.totalDuration=0,this.onStartCallbacks=[],this.onEndCallbacks=[],this.onUpdateCallbacks=[],this.component=t}animate(t,e){return this.started?console.warn("Cannot add animations after animation has started"):this.tasks.push({graphic:t,config:e}),this}onStart(t){return this.onStartCallbacks.push(t),this}onEnd(t){return this.onEndCallbacks.push(t),this}onUpdate(t){return this.onUpdateCallbacks.push(t),this}start(){return this.started?console.warn("Animation has already started"):(this.started=!0,this.completed=0,this.onStartCallbacks.forEach(t=>t()),0===this.tasks.length?setTimeout(()=>{this.onEndCallbacks.forEach(t=>t())},0):this.tasks.forEach(t=>{let e=new y_(t.graphic);e.onEnd(()=>{this.completed++,this.completed===this.tasks.length&&this.onEndCallbacks.forEach(t=>t())});let i=e.executeItem(t.config,t.graphic);
2t.animate=i,i.forEach(t=>{this.totalDuration=Math.max(this.totalDuration,t.getStartTime()+t.getDuration())})})),this}deleteSelfAttr(t){this.tasks.forEach(e=>{e.animate&&e.animate.forEach(e=>e.preventAttr(t))})}stop(t){return this.tasks.forEach(e=>{e.animate&&e.animate.forEach(e=>e.stop(t))}),this.started&&this.completed!==this.tasks.length&&(this.onEndCallbacks.forEach(t=>t()),this.completed=this.tasks.length),this}getDuration(){return this.totalDuration}}function xF(t){return new xD(t)}var xz=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let xH=(t,e)=>Math.ceil(t)>Math.floor(e),xj=([t,e],[i,s])=>s>t&&e>i,xV=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class xN extends n1{constructor(t,e){super(t),this._skipRenderAttributes=xV,(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,s){let r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(r)return this._setAttributes(r,i);(0,ew.A)(this.attribute[t])&&(0,ew.A)(e)&&!(0,r3.A)(this.attribute[t])&&!(0,r3.A)(e)?eB(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(i||this.needUpdateTag(t))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){let i=Object.keys(t);this._mergeAttributes(t,i),i.every(t=>this._skipRenderAttributes.includes(t))||this.render(),this.valid=this.isValid(),!this.updateShapeAndBoundsTagSetted()&&(e||this.needUpdateTags(i))?this.addUpdateShapeAndBoundsTag():this.addUpdateBoundTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){(0,eE.A)(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){let s=e[i];!(0,ew.A)(this.attribute[s])||(0,r3.A)(this.attribute[s])||(0,r3.A)(t[s])?this.attribute[s]=t[s]:eB(this.attribute[s],t[s])}}bindEvents(){}_getNodeId(t){var e;return`${null!=(e=this.id)?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;let s=new r8(t,e);s.manager=null==(i=this.stage)?void 0:i.eventSystem.manager,this.dispatchEvent(s)}eventPosToStagePos(t){var e,i;let s={x:0,y:0},r=null!=(i=null==(e=this.stage)?void 0:e.eventPointTransform(t))?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(r,s),s}}class xW extends xN{_prepareAnimate(t){if(!1!==this.attribute.animation){let{animation:e,animationEnter:i,animationExit:s,animationUpdate:r}=this.attribute,a=r2(e)?e:{};this._animationConfig={enter:!1!==i&&eB({},t,a,null!=i?i:{}),exit:!1!==s&&eB({},t,a,null!=s?s:{}),update:!1!==r&&((0,ev.A)(r)?r:eB({},t,a,null!=r?r:{}))}}else this._animationConfig={enter:!1,exit:!1,update:!1}}}var xU=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};p1(),gD(),xL(),bZ(),y_.registerBuiltInAnimate("increaseCount",class t extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r),this.formatTemplate=null,this.decimalLength=null==r?void 0:r.decimalLength,(null==r?void 0:r.formatTemplate)&&r.formatTemplate.includes("{{var}}")&&(this.formatTemplate=r.formatTemplate)}onFirstRun(){var t,e,i;let s=this.getLastProps(),r=this.getEndProps(),a=null!=(t=s.text)?t:0,n=null!=(e=r.text)?e:0;this.valid=!0;let l=0,o=0,h="",u="",d=0;if("number"==typeof a)l=a,d=Math.max(d,(a.toString().split(".")[1]||"").length);else{if("string"!=typeof a)return void(this.valid=!1);if(a.endsWith("%")){h="%";let t=a.substring(0,a.length-1).replace(/,/g,"");if(isNaN(l=parseFloat(t)/100))return void(this.valid=!1);d=Math.max(d,(t.split(".")[1]||"").length+2)}else{let t=a.replace(/,/g,"");if(isNaN(l=parseFloat(t)))return void(this.valid=!1);a.includes(",")&&(h=","),d=Math.max(d,(t.split(".")[1]||"").length)}}if("number"==typeof n)o=n,d=Math.max(d,(n.toString().split(".")[1]||"").length);else{if("string"!=typeof n)return void(this.valid=!1);if(n.endsWith("%")){u="%";let t=n.substring(0,n.length-1).replace(/,/g,"");if(isNaN(o=parseFloat(t)/100))return void(this.valid=!1);d=Math.max(d,(t.split(".")[1]||"").length+2)}else{let t=n.replace(/,/g,"");if(isNaN(o=parseFloat(t)))return void(this.valid=!1);n.includes(",")&&(u=","),d=Math.max(d,(t.split(".")[1]||"").length)}}if(null==(i=this.params)?void 0:i.format){switch(this.params.format){case"percent":this.format="%";break;case"thousandth":this.format=",";break;case"none":this.format="";break;default:this.format=u||h}"%"===this.format&&"%"!==u&&"%"!==h&&void 0===this.decimalLength&&(this.decimalLength=2),"%"===this.format||"%"!==u&&"%"!==h||(l*=100,o*=100)}else this.format=u||h;this.fromNumber=l,this.toNumber=o,void 0===this.decimalLength&&(this.decimalLength=d)}onEnd(t){super.onEnd(t),t||this.props&&this.target.setAttributes(this.props)}onUpdate(t,e,i){if(!this.valid)return;let s=this.fromNumber+(this.toNumber-this.fromNumber)*e,r="",a=this.format,n=("%"===a?100*s:s).toFixed(this.decimalLength),l,o=n;if(parseFloat(n)===Math.floor(parseFloat(n))&&(o=Math.floor(parseFloat(n))),"%"===a)l=`${o}%`;
2else if(","===a){let t=o.toString().split(".");t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),l=t.join(".")}else l=o;r=this.formatTemplate?this.formatTemplate.replace("{{var}}",l.toString()):l,this.target.setAttribute("text",r)}}),y_.registerBuiltInAnimate("labelUpdate",class t extends _t{onBind(){let t=xF(this.target);this._animator=t;let e=this.duration,i=this.easing,{prevText:s,curText:r,prevLabelLine:a,curLabelLine:n,increaseEffect:l=!0}=this.params,o={};for(let t in r.attribute)s.attribute[t]!==r.attribute[t]&&(o[t]=r.attribute[t]);let{text:h}=o,u=xz(o,["text"]);t.animate(s,{type:"to",to:u,duration:e,easing:i}),!1!==l&&t.animate(s,{type:"increaseCount",to:{text:r.attribute.text},duration:e,easing:i}),a&&t.animate(a,{type:"to",to:n.attribute,duration:e,easing:i}),this.completeBind(t)}tryPreventConflict(){}}),y_.registerBuiltInAnimate("labelEnter",class t extends _t{onBind(){let t=xF(this.target);this._animator=t;let e=this.duration,i=this.easing,{relatedGraphic:s,relatedGraphics:r,config:a}=this.params,{mode:n,type:l="fadeIn"}=a,o=this.target,h=0;
2"after"===n?s.animates&&s.animates.forEach(t=>{h=Math.max(h,t.getStartTime()+t.getTotalDuration())}):"after-all"===n?r&&r.forEach(t=>{t.animates&&t.animates.forEach(t=>{h=Math.max(h,t.getStartTime()+t.getTotalDuration())})}):s.animates&&s.animates.forEach(t=>{h=Math.max(h,t.getStartTime())}),t.animate(o,Object.assign(Object.assign({},a),{duration:e,easing:i,startTime:h,type:l})),this.completeBind(t)}tryPreventConflict(){}});class xG extends xW{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){const{data:i}=t,s=xU(t,["data"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({data:i},eB({},xG.defaultAttributes,s))),this.name="label",this._onHover=t=>{let e=t.target;e===this._lastHover||pJ(e.states)||(e.addState(q.hover,!0),b5(this,t=>{t===e||pJ(t.states)||t.addState(q.hoverReverse,!0)}),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(b5(this,t=>{pJ(t.states)||(t.removeState(q.hoverReverse),t.removeState(q.hover))}),this._lastHover=null)},this._onClick=t=>{let e=t.target;this._lastSelect===e&&e.hasState("selected")?(this._lastSelect=null,b5(this,t=>{pJ(t.states)||(t.removeState(q.selectedReverse),t.removeState(q.selected))})):pJ(e.states)||(e.addState(q.selected,!0),b5(this,t=>{t===e||pJ(t.states)||t.addState(q.selectedReverse,!0)}),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,s,r,a;if((null==(e=t.detail)?void 0:e.type)===hy.STATE||(null==(i=t.detail)?void 0:i.type)===hy.ANIMATE_UPDATE&&(null==(s=t.detail.animationState)?void 0:s.isFirstFrameOfStep)){let e=null!=(a=null==(r=t.target)?void 0:r.currentStates)?a:[],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||iW(t,e,!0))return;let i=Math.min(t.x1,t.x2),s=Math.min(t.y1,t.y2),r=Math.min(e.x1,e.x2),a=Math.min(e.y1,e.y2),n=Math.abs(t.x2-i)/2,l=Math.abs(t.y2-s)/2,o=Math.abs(e.x2-r)/2,h=Math.abs(e.y2-a)/2,u=i+n,d=s+l,c=r+o,p=a+h,g=c-u,f=p-d;return[xc(g,f,u,d,n,l),xc(-g,-f,c,p,o,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds)}_createLabelLine(t,e){let i=this._getLabelLinePoints(t,e);if(i){let s=lF.line({points:i}),{line:r={}}=t.attribute;if(r.customShape){let i=r.customShape;s.pathProxy=s=>i({text:t,baseMark:e},s,new sO)}return e&&e.getAttributes(!0).fill&&s.setAttribute("stroke",e.getAttributes(!0).fill),this.attribute.line&&!pJ(this.attribute.line.style)&&s.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(s),s}}render(){if(this._prepare(),(0,eE.A)(this._idToGraphic)||this._isCollectionBase&&(0,eE.A)(this._idToPoint))return;let t=[];!1!==this._enableAnimation&&this._baseMarks.forEach(e=>{t.push(e.attribute),e.initAttributes(e.getAttributes(!0))});let{overlap:e,smartInvert:i,dataFilter:s,customLayoutFunc:r,customOverlapFunc:a}=this.attribute,n=this.attribute.data;if((0,r3.A)(s)&&(n=s(n)),n&&n.length){let t=new Set;n=n.filter(e=>!t.has(e.id)&&t.add(e.id))}let l=this._initText(n);l=(0,r3.A)(r)?r(n,l,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null,this):this._layout(l);let o=[],h=l;if(!ey(e)&&(0,r3.A)(null==e?void 0:e.filterBeforeOverlap)){let t=this.getRelatedGraphic.bind(this);l.forEach(i=>{e.filterBeforeOverlap(i,t,this)?h.push(i):o.push(i)})}(0,r3.A)(a)?l=a(h,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null,this).concat(o):!1!==e&&(l=this._overlapping(h).concat(o)),(0,r3.A)(this.attribute.onAfterOverlapping)&&this.attribute.onAfterOverlapping(l,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null,this),l&&l.length&&l.forEach(t=>{this._bindEvent(t),this._setStatesOfText(t)}),!1!==i&&this._smartInvert(l),this._renderLabels(l),!1!==this._enableAnimation&&this._baseMarks.forEach((e,i)=>{e.initAttributes(t[i])})}_bindEvent(t){if(this.attribute.disableTriggerEvent||!t)return;let{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;let e=this.attribute.state;e&&!pJ(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;let e=this.attribute.labelLineState;e&&!pJ(e)&&(t.states=e)}_createLabelText(t){var e,i;return _F(Object.assign(Object.assign({},null==(i=null==(e=this.stage)?void 0:e.getTheme())?void 0:i.text),t),"textType")}_prepare(){var t,e;let i=[];if(((0,r3.A)(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];let i=t.find(t=>t.name===e,!0);return i?i.getChildren():[]}
2(this.getRootNode(),this.attribute.baseMarkGroupName)).forEach(t=>{"willRelease"!==t.releaseStatus&&i.push(t)}),null==(t=this._idToGraphic)||t.clear(),null==(e=this._idToPoint)||e.clear(),this._baseMarks=i,this._isCollectionBase="line-data"===this.attribute.type,!i||0===i.length)return;let{data:s}=this.attribute;if(s&&0!==s.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e<i.length;e++){let r=i[e],a=xd(r);if(a&&a.length)for(let e=0;e<a.length;e++){let i=s[t];i&&a[e]&&((0,eA.A)(i.id)||(i.id=`vrender-component-${this.name}-${t}`),this._idToPoint.set(i.id,a[e]),this._idToGraphic.set(i.id,r)),t++}}}else for(let t=0;t<i.length;t++){let e=s[t],r=i[t];e&&r&&((0,eA.A)(e.id)||(e.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(e.id,r))}this._prepareAnimate(xh)}}getRelatedGraphic(t){return this._idToGraphic.get(t.id)}_initText(t=[]){let{textStyle:e={}}=this.attribute,i=[];for(let s=0;s<t.length;s++){let r=t[s],a=this.getRelatedGraphic(r);if(!a)continue;let n=a.getAttributes(!0),l=Object.assign(Object.assign({fill:this._isCollectionBase?(0,ev.A)(n.stroke)?n.stroke.find(t=>!!t&&!0!==t):n.stroke:n.fill},e),r),o=this._createLabelText(l);i.push(o)}return i}_layout(t){let{position:e,offset:i}=this.attribute;for(let s=0;s<t.length;s++){let r=t[s];if(!r)return[];let a=r.attribute,n=this.getRelatedGraphic(a);if(!n)continue;r.attachedThemeGraphic=this;let l=this.getGraphicBounds(r);r.attachedThemeGraphic=null;let o=(0,r3.A)(e)?e(a):e,h=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(a.id),o):this.getGraphicBounds(n,{x:a.x,y:a.y},o),u=this.labeling(l,h,o,i);u&&r.setAttributes(u)}return t}_overlapping(t){var e,i,s;if(0===t.length)return[];let r=r2(this.attribute.overlap)?this.attribute.overlap:{},a=this.getBaseMarkGroup(),n=null!=(e=r.size)?e:{width:null!=(i=null==a?void 0:a.AABBBounds.width())?i:0,height:null!=(s=null==a?void 0:a.AABBBounds.height())?s:0};if(0===n.width||0===n.height)return t;let{strategy:l,priority:o}=r,h=this._bmpTool||xe(n.width,n.height),u=this._bitmap||h.bitmap();return o&&(t=t.sort((t,e)=>o(e.attribute.data)-o(t.attribute.data))),"shiftY"===(null==l?void 0:l.type)?this._overlapGlobal(t,r,h,u):this._overlapByStrategy(t,r,h,u)}_overlapGlobal(t,e,i,s){let r=t.filter(t=>t.attribute.visible&&0!==t.attribute.opacity&&this.isMarkInsideRect(this.getRelatedGraphic(t.attribute),i)),{clampForce:a=!0,hideOnHit:n=!0,hideOnOverflow:l=!1,overlapPadding:o,strategy:h}=e;if(a||l)for(let e=0;e<r.length;e++){let s=t[e],{dx:r=0,dy:a=0}=xo(s,i.width,i.height,i.padding);0===r&&0===a||(l?s.setAttributes({visible:!1}):(s.setAttributes({x:s.attribute.x+r,y:s.attribute.y+a}),s._isClamped=!0))}r=function(t,e){let{maxY:i=Number.MAX_VALUE,labelling:s,globalShiftY:r={enable:!0,maxIterations:10,maxError:.1,padding:1}}=e,a=t.length;if(a<=1)return t;let n=new Map,l=new Map,o=t=>l.get(t).y1Initial,h=t=>l.get(t).height,u=t=>l.get(t).y1,d=t=>l.get(t).x,c=t=>l.get(t).x1,p=t=>l.get(t).x2,g=t=>l.get(t).attempts,f=(t,e)=>{l.get(t).y1=e},m=(t,e)=>{l.get(t).attempts=e};for(let e of(t.sort((t,e)=>t.attribute.x-e.attribute.x),t)){let{y1:t,y2:i,x1:s,x2:r}=e.AABBBounds,{x:a,y:o}=e.attribute;l.set(e,{y1Initial:t,y1:t,y2:i,y:o,height:i-t,x1:s,x2:r,x:a,attempts:0});let h=!1;for(let[t,i]of n){let{start:l,end:o}=t;if(s>=l&&r<=o)i.push(e),h=!0;else if(rL(a,d(i[0]),void 0,5)){let a={start:Math.min(l,s),end:Math.max(o,r)};i.push(e),n.set(a,i),n.delete(t),h=!0}else if(function(t,e){let[i,s]=t,[r,a]=e;return Math.max(0,Math.min(s,a)-Math.max(i,r))}([l,o],[s,r])/(o-l)>.5){let a={start:Math.min(l,s),end:Math.max(o,r)};i.push(e),n.set(a,i),n.delete(t),h=!0}if(h)break}h||n.set({start:s,end:r},[e])}for(let t of n.values())t.sort((t,e)=>o(t)-o(e)),function(t){for(let e=t.length-1;e>=0;e--){let r=t[e],a=t[e-1],n=t[e+1];if(a&&xH(u(a)+h(a),u(r))||0===u(r)&&r._isClamped){let{y:t}=s(r);n&&xH(t+h(r)/2,u(n))||t+h(r)/2<=i&&f(r,u(r)+t-l.get(r).y)}}}(t);if(!1!==r.enable){let{maxIterations:e=10,maxError:s=.1,padding:n=1,maxAttempts:l=1e3,deltaYTolerance:d=Number.MAX_VALUE}=r;for(let r=0;r<e;r++){t.sort((t,e)=>o(t)-o(e));let e=0;for(let s=0;s<a-1;s++){let r=t[s];if(g(r)>=l)continue;let a,_=s+1;for(;(a=t[_])&&!xj([c(r),p(r)],[c(a),p(a)]);)_+=1;if(a){let t=u(r),s=h(r),l=u(a),c=l-(t+s);if(c<n){let s=(n-c)/2;if(e=Math.max(e,s),t+s+h(a)>i){let e=t-(n-c);Math.abs(o(r)-e)<=d&&(f(r,e),m(r,g(r)+1))}else if(t-s<0){let t=l+(n-c);Math.abs(o(a)-t)<=d&&(f(a,t),m(a,g(a)+1))}else{let e=t-s,i=o(r)-e,n=l+s,h=o(a)-n;
2Math.abs(i)<=d&&Math.abs(h)<=d&&(f(r,e),f(a,n),m(r,g(r)+1),m(a,g(a)+1))}}}}if(e<s)break}}for(let e of t){let t=e.attribute.y+u(e)-o(e);e.setAttribute("y",t)}let _=[];t.sort((t,e)=>t.attribute.x-e.attribute.x);let y=0,v=t.length-1;for(;y<=v;)y===v?_.push(t[y]):(_.push(t[y]),_.push(t[v])),y++,v--;return _}(r,Object.assign(Object.assign({maxY:i.height},h),{labelling:t=>{let e=this.getRelatedGraphic(t.attribute),i=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t.attribute.id)):this.getGraphicBounds(e,t);return this.labeling(t.AABBBounds,i,"bottom",this.attribute.offset)}}));for(let t=0;t<r.length;t++){let e=r[t],h=e.AABBBounds,u=xs(i,h,!0);if(xr(i,s,h,a||l,o))s.setRange(u);else{if(l){if(this._processHideOnOverflow(e,i))continue}else if(a&&this._processClampForce(e,i,s,o))continue;n?e.setAttributes({visible:!1}):s.setRange(u)}}return r}_processHideOnOverflow(t,e){let{dy:i=0,dx:s=0}=xo(t,e.width,e.height,e.padding);return 0===s&&0===i||(t.setAttributes({visible:!1}),!1)}_processClampForce(t,e,i,s=0){let{dy:r=0,dx:a=0}=xo(t,e.width,e.height,e.padding);if(0===a&&0===r){if(xr(e,i,t.AABBBounds,!1,s))return i.setRange(xs(e,t.AABBBounds,!0)),!0}else if(xr(e,i,{x1:t.AABBBounds.x1+a,x2:t.AABBBounds.x2+a,y1:t.AABBBounds.y1+r,y2:t.AABBBounds.y2+r}))return t.setAttributes({x:t.attribute.x+a,y:t.attribute.y+r}),i.setRange(xs(e,t.AABBBounds,!0)),!0;return!1}_overlapByStrategy(t,e,i,s){var r;let{avoidBaseMark:a,strategy:n=[],hideOnHit:l=!0,clampForce:o=!0,avoidMarks:h=[],overlapPadding:u,hideOnOverflow:d=!1}=e,c=[],p=n.some(t=>"bound"===t.type);a&&(null==(r=this._baseMarks)||r.forEach(t=>{t.AABBBounds&&s.setRange(xs(i,t.AABBBounds,!0))})),h.length>0&&h.forEach(t=>{(0,eS.A)(t)?(function(t,e){if(!e)return[];let 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(xs(i,t.AABBBounds,!0))}):t.AABBBounds&&s.setRange(xs(i,t.AABBBounds,!0))});for(let e=0;e<t.length;e++){if(!1===t[e].attribute.visible)continue;let r=t[e],a=this.getRelatedGraphic(r.attribute);if(r.update(),!this.isMarkInsideRect(a,i))continue;if(xr(i,s,r.AABBBounds,o||d,u)&&(!p||p&&a&&a.AABBBounds&&this._canPlaceInside(r.AABBBounds,a.AABBBounds))){s.setRange(xs(i,r.AABBBounds,!0)),c.push(r);continue}let h=!1;for(let l=0;l<n.length;l++)if(!1!==(h=function(t,e,i,s,r,a,n){var l,o;let h=null==(l=s.overlap)?void 0:l.clampForce,u=null==(o=s.overlap)?void 0:o.overlapPadding;if("bound"===i.type||"position"===i.type){if((0,r3.A)(n)){let l=(((0,r3.A)(i.position)?i.position(r.attribute):i.position)||("rect"===s.type?xl:xn)).map(t=>n(r.AABBBounds,a,t,s.offset));return xa(t,e,r,l,h,u,!1===i.restorePosition)}return!1}if("moveY"===i.type){let s=(i.offset?(0,r3.A)(i.offset)?i.offset(r.attribute):i.offset:[]).map(t=>({x:r.attribute.x,y:r.attribute.y+t}));return xa(t,e,r,s,h,u)}if("moveX"===i.type){let s=(i.offset?(0,r3.A)(i.offset)?i.offset(r.attribute):i.offset:[]).map(t=>({x:r.attribute.x+t,y:r.attribute.y}));return xa(t,e,r,s,h,u)}return!1}(i,s,n[l],this.attribute,r,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[e].attribute.id)):this.getGraphicBounds(a,t[e].attribute),this.labeling))&&(r.setAttributes({x:h.x,y:h.y}),!d||this._processHideOnOverflow(r,i))){c.push(r);break}if(!h){if(d&&!this._processHideOnOverflow(r,i))continue;if(o&&this._processClampForce(r,i,s,u)){c.push(r);continue}}h||l||c.push(r)}return c}isMarkInsideRect(t,e){let{left:i,right:s,top:r,bottom:a}=e.padding,n={x1:-i,x2:e.width+s,y1:-r,y2:e.height+a},l=t.AABBBounds;if(0!==l.width()&&0!==l.height())return iW(t.AABBBounds,n,!0);let{attribute:o}=t;if("rect"===t.type){let{x:t,x1:e,y:i,y1:s}=o;return iU({x:null!=t?t:e,y:null!=i?i:s},n,!0)}return"x"in o&&"y"in o&&iU({x:o.x,y:o.y},n,!0)}getBaseMarkGroup(){let{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find(e=>e.name===t,!0)}getGraphicBounds(t,e={},i){var s;if(t){if(!1!==t.attribute.visible){if(null==(s=t.context)?void 0:s.animationState){let e=t.clone();return Object.assign(e.attribute,t.getAttributes(!0)),e.AABBBounds}return t.AABBBounds}let{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}if(e&&i&&"inside-middle"===i){let{x:t,y:i,x1:s=t,y1:r=i}=e;return{x1:(t+s)/2,x2:(t+s)/2,y1:(i+r)/2,y2:(i+r)/2}}let{x:r,y:a}=e;return{x1:r,x2:r,y1:a,y2:a}}_renderLabels(t){var e;let{syncState:i}=this.attribute,s=new Map,r=this._graphicToText||new Map,a=[],n=[],{visible:l}=null!=(e=this.attribute.line)?e:{};t&&t.forEach((t,e)=>{var o;let h,u=this.getRelatedGraphic(t.attribute),d=this._isCollectionBase?t.attribute.id:u,c=(null==r?void 0:r.get(d))?"update":"enter";l&&(h=this._createLabelLine(t,u));let p=h?{text:t,labelLine:h}:{text:t};if(i&&this.updateStatesOfLabels([p],null!=(o=u.currentStates)?o:[]),"enter"
2===c)a.push(t),s.set(d,p),this._addLabel(p,a,n,e);else if("update"===c){let t=r.get(d);r.delete(d),s.set(d,t),this._updateLabel(t,p)}}),this._removeLabel(r),this._graphicToText=s}runEnterAnimation(t,e){if(!1===this._enableAnimation||!this._animationConfig.enter)return;let i=this.getRelatedGraphic(t.attribute),{enter:s}=this._animationConfig;[t,e].filter(Boolean).forEach(e=>{var r;null==(r=e.setFinalAttributes)||r.call(e,e.attribute),e.applyAnimationState(["enter"],[{name:"enter",animation:Object.assign(Object.assign({},s),{type:"labelEnter",selfOnly:!0,customParameters:{relatedGraphic:i,relatedGraphics:this._idToGraphic,config:Object.assign(Object.assign({},s),{type:e===t?s.type:"fadeIn"})}})}])})}_runUpdateAnimation(t,e){let{text:i,labelLine:s}=t,{text:r,labelLine:a}=e;i.applyAnimationState(["update"],[{name:"update",animation:{type:"labelUpdate",customParameters:Object.assign(Object.assign({},this._animationConfig.update),{prevText:i,curText:r,prevLabelLine:s,curLabelLine:a})}}])}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t&&t.on("afterStateUpdate",this._handleRelatedGraphicSetState)}_addLabel(t,e,i,s){let{text:r,labelLine:a}=t,n=this.getRelatedGraphic(r.attribute);this._syncStateWithRelatedGraphic(n),r&&this.add(r),a&&this.add(a),this.runEnterAnimation(r,a)}_updateLabel(t,e){let{text:i,labelLine:s}=t,{text:r,labelLine:a}=e;!1===this._enableAnimation||!1===this._animationConfig.update?(t.text.setAttributes(r.attribute),s&&a&&t.labelLine.setAttributes(a.attribute)):this._runUpdateAnimation(t,e)}_removeLabel(t){let e=t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)};!1!==this._enableAnimation&&!1!==this._animationConfig.exit?t.forEach(t=>{var i;t.text.applyAnimationState(["exit"],[{name:"exit",animation:Object.assign(Object.assign({},this._animationConfig.exit),{type:"fadeOut"})}],()=>{e(t)}),null==(i=t.labelLine)||i.applyAnimationState(["exit"],[{name:"exit",animation:Object.assign(Object.assign({},this._animationConfig.exit),{type:"fadeOut"})}],()=>{})}):t.forEach(t=>{e(t)})}updateStatesOfLabels(t,e){t.forEach(t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))})}_smartInvert(t){var e,i,s,r,a,n,l;let o=r2(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:h,contrastRatiosThreshold:u,alternativeColors:d,mode:c,interactInvertType:p}=o,g=null!=(e=o.fillStrategy)?e:"invertBase",f=null!=(i=o.strokeStrategy)?i:"base",m=null!=(s=o.brightColor)?s:"#ffffff",_=null!=(r=o.darkColor)?r:"#000000",y=null!=(a=o.outsideEnable)&&a;if("null"!==g||"null"!==f)for(let e=0;e<t.length;e++){let i=t[e];if(!i)continue;let s=this.getRelatedGraphic(i.attribute),r=s.getAttributes(!0).fill,a=s.getAttributes(!0).fillOpacity,o=i.attribute.fill;if(r2(r)&&r.gradient){let t=null==(l=null==(n=r.stops)?void 0:n[0])?void 0:l.color;t&&(r=t,o=t)}let v=bQ(o,r,h,u,d,c),b=b0(v,m)?m:_,x=this._canPlaceInside(i.AABBBounds,s.AABBBounds),S=!x&&i.AABBBounds&&s.AABBBounds&&s.AABBBounds.intersects(i.AABBBounds);if(x||y||S&&"inside"===p){let t=b3(g,r,v,b);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth||0===i.attribute.strokeOpacity)continue;if("background"===p)i.setAttributes({stroke:!1});else{let t=b3(f,r,v,b);t&&i.setAttributes({stroke:t})}}else if(S&&"none"!==p){if("background"===p){let t=b3(g,r,v,b);t&&i.setAttributes({fill:t}),i.setAttributes({stroke:!1,background:r,backgroundOpacity:a});continue}if(0===i.attribute.lineWidth||0===i.attribute.strokeOpacity)continue;if(i.attribute.stroke){i.setAttributes({fill:bQ(i.attribute.fill,i.attribute.stroke,h,u,d,c)});continue}let t=b3(g,r,v,b);t&&i.setAttributes({fill:t});let e=b3(f,r,v,b);e&&i.setAttributes({stroke:e})}!1===x&&"background"===p&&i.setAttributes({background:null})}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}xG.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-2,-1,-2,-1]},offset:0,pickable:!1};let xY={},x$=(t,e)=>{xY[t]=e},xX=t=>xY[t];var xK=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class xq extends xG{constructor(t,e){const{data:i}=t,s=xK(t,["data"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({data:i},eB({},xq.defaultAttributes,s))),this.name="line-label"}getGraphicBounds(t,e={},i="end"){if(!t||"line"!==t.type&&"area"!==t.type)return super.getGraphicBounds(t,e);let s=t.attribute.points,r=t.attribute.segments;!s&&r&&r.length&&(s=r.reduce((t,e)=>{var i;return t.concat(null!=(i=e.points)?i:[])},[])),s&&0!==s.length||(s=[e]);let a="start"===i?0:s.length-1;return s[a]?{x1:s[a].x,x2:s[a].x,y1:s[a].y,y2:s[a].y}:void 0}
2labeling(t,e,i="end",s=0){return function(t,e,i="end",s=0){if(!t||!e)return{x:1/0,y:1/0};let{x1:r,x2:a}=t,n=Math.abs(a-r),l=e.x1,o=l;return"end"===i?o=l+n/2+s:"start"===i&&(o=l-n/2-s),{x:o,y:e.y1}}(t,e,i,s)}}xq.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};let xZ=()=>{x$("line",xq),x$("area",xq)};var xJ=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class xQ extends xG{constructor(t,e){const{data:i}=t,s=xJ(t,["data"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({data:i},eB({},xQ.defaultAttributes,s))),this.name="symbol-label"}labeling(t,e,i="top",s=0){return((t,e,i="top",s=0)=>{if(!t)return;let{x1:r,y1:a,x2:n,y2:l}=t,o=Math.abs(n-r),h=Math.abs(l-a),u=(e.x1+e.x2)/2,d=(e.y1+e.y2)/2,c=0,p=0,g=0,f=0;e&&(g=Math.abs(e.x1-e.x2)/2,f=Math.abs(e.y1-e.y2)/2);let m={"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":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(m[i]*(Math.PI/180)),p=Math.cos(m[i]*(Math.PI/180));break;case"center":c=0,p=0}return{x:u+c*(s+g)+o/2*Math.sign(c),y:d+p*(s+f)+h/2*Math.sign(p)}})(t,e,i,s)}}xQ.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};let x0=()=>{x$("symbol",xQ),x$("line-data",xQ)};class x1 extends bz{constructor(){super(...arguments),this.type=x1.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return(null==(t=this.model)?void 0:t.type)===dD.radar&&"polar"===(null==(e=this.model)?void 0:e.coordinate)?[]:["fill","fillOpacity"]}}x1.type="line";let x2=()=>{uP.registerMark(x1.type,x1),_k(),bZ(),xZ(),x0(),vM(),uP.registerGraphicComponent("line",bV)};class x3 extends _x{constructor(){super(...arguments),this.type=x3.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}_transformGraphicAttributes(t,e,i){var s,r,a;let n=super._transformGraphicAttributes(t,e,i),l=null!=(r=null!=(s=n.shape)?s:n.symbolType)?r:null==(a=t.attribute)?void 0:a.symbolType;return(0,eE.A)(l)?n.symbolType="circle":n.symbolType=l,n}}x3.type="symbol";let x5=()=>{uP.registerMark(x3.type,x3),_k(),gq(),x0(),uP.registerGraphicComponent("symbol",oZ)};class x4 extends bT{_transformLabelSpec(t){var e,i,s;!1!==(null==(e=t.point)?void 0:e.visible)&&!1!==(null==(s=null==(i=t.point)?void 0:i.style)?void 0:s.visible)?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}function x8(t,e,i){let s=!1;if(e&&(0,r3.A)(e)){for(let r of t)for(let t of r.getSeries(i))if(s=!!e.call(null,t))return s}return s}function x6(t,e){let i=[];for(let s of t)for(let t of s.getSeries(e))i.push(t);return i}let x9=(t,e)=>{for(let i=0;i<t.length;i++){let s=t[i].getSeries();for(let t=0;t<s.length;t++){let i=s[t];if(e&&i&&i.coordinate===e||!e&&i)return i}}return null};function x7(t){return"bottom"===t||"top"===t}function St(t){return"left"===t||"right"===t}function Se(t){return"z"===t}function Si(t,e){return hN(t.orient)||e&&e.includes(t.orient)?t.orient:"left"}function Ss(t){return"top"===t||"bottom"===t?"horizontal":"vertical"}function Sr(t,e){var i,s;let r=null!=(i=t.type)?i:(s=t.orient,e?x7(s)?"linear":"band":x7(s)?"band":"linear");return{axisType:r,componentName:`${hc.cartesianAxis}-${r}`}}let Sa=(t,e,i)=>{var s;let r=null!=(s="band"===e?v0("axisBand",i):["linear","log","symlog"].includes(e)?v0("axisLinear",i):{})?s:{},a=x7(t)?v0("axisX",i):St(t)?v0("axisY",i):v0("axisZ",i);return uy({},v0("axis",i),r,a)};function Sn(t){return t.length>=2&&eP(t[0])&&eP(oA(t))&&oA(t)>=t[0]}function Sl(t,e){var i;let s=oA(e)-e[0],r=oA(e)*e[0]<0,a=e[0]<=0?0-e[0]:0,n=oA(e)>0?oA(e)-0:0;0===s?e[0]<0?(a=1,n=0):e[0]>0&&(a=0,n=1):(a/=s,n/=s);let l=t.getDomainSpec(),o={total:s,negative:a,positive:n,includeZero:r,domain:e,extendable_min:!eP(l.min),extendable_max:!eP(l.max)};if(null==(i=t._break)?void 0:i.scope){let i,s,r=e.findIndex(t=>t>=0);0===r?(i=t._break.scope[r],s=[e[0],e[1]],o.positive=1,o.negative=0):0>=oA(e)?(o.positive=0,o.negative=1,s=[e[e.length-2],e[e.length-1]]):(i=t._break.scope[r
2-1],s=[e[r-1],e[r]],o.negative=i[0]+(0-s[0])/(s[1]-s[0])*(i[1]-i[0]),o.positive=1-o.negative),o.break=!0,o.extendable_max=!1,o.extendable_min=!1,o.domain=s}return o}function So(t,e){let{positive:i,negative:s,extendable_min:r,extendable_max:a,domain:n}=t,{positive:l,negative:o,extendable_min:h,extendable_max:u,domain:d}=e;if(l>0){if(!h)return!1;let t=s/i;a&&(t=s/Math.max(i,l),n[1]=-n[0]/t),d[0]=-d[1]*t}else if(o>0){if(!u)return!1;let t=i/s;r&&(t=i/Math.max(s,s),n[0]=-n[1]/t),d[1]=-d[0]*t}return!0}function Sh(t,e){let{extendable_min:i,extendable_max:s,domain:r}=t,{positive:a,negative:n,domain:l}=e;return(0!==a||0!==n)&&!(a>0&&!s)&&!(n>0&&!i)&&(r[0]=l[0],r[1]=l[1],!0)}function Su(t,e){let{positive:i,negative:s,extendable_max:r,domain:a}=t,{positive:n,negative:l,extendable_min:o,domain:h}=e;if(r&&o){let t=Math.max(s,l)/Math.max(i,n);a[1]=-a[0]/t,h[0]=-h[1]*t}else if(o)h[0]=-h[1]*(s/i);else{if(!r)return!1;a[1]=-a[0]/(l/n)}return!0}function Sd(t,e){let{extendable_min:i,domain:s}=t,{extendable_max:r,domain:a}=e;return!(!i||!r)&&(s[0]=-s[1],a[1]=-a[0],!0)}let Sc=t=>t.map((t,e)=>({index:e,value:t})),Sp=(t,e,i=0)=>{let s=new iJ(t).expand(i/2),r=new iJ(e).expand(i/2);return s.intersects(r)},Sg=(t,e,i,s)=>i<t?Math.max(t-e/2,i):i>t?Math.min(t-e/2,i-e):i<s?i:i-e,Sf=(t,e,i)=>{var s,r,a;let{labelStyle:n,axisOrientType:l,labelFlush:o,labelFormatter:h,startAngle:u=0}=i,d=null!=(s=n.angle)?s:0;"vertical"===n.direction&&(d+=iC(90));let c=["bottom","top"].includes(l),p=["left","right"].includes(l),g=1,f=0;c||(p?(g=0,f=1):u&&(g=Math.cos(u),f=-Math.sin(u)));let m=_R(n),_=t.range(),y=[];for(let i=0;i<e.length;i++){let s=e[i],l=h?h(s):`${s}`;if((0,ew.A)(l)){y=void 0;break}let{width:u,height:v}=m.quickMeasure(l),b=Math.max(u,12),x=Math.max(v,12),S=t.scale(s),A=g*S,k=f*S,M,w,T=A,C=k;o&&c&&0===i?T=Sg(A,b,_[0],_[_.length-1]):o&&c&&i===e.length-1?T=Sg(A,b,_[_.length-1],_[0]):M=null!=(r=n.textAlign)?r:"center","right"===M?T-=b:"center"===M&&(T-=b/2),o&&p&&0===i?C=Sg(k,x,_[0],_[_.length-1]):o&&p&&i===e.length-1?C=Sg(k,x,_[_.length-1],_[0]):w=null!=(a=n.textBaseline)?a:"middle","bottom"===w?C-=x:"middle"===w&&(C-=x/2);let B=(new iJ).set(T,C,T+b,C+x);d&&B.rotate(d,A,k),y.push(B)}return y},Sm=(t,e)=>{var i,s,r,a,n;if(!t)return t;let l=null==(i=null==e?void 0:e.targetAxis)?void 0:i.call(e);if(!l)return t;let o=null==(s=null==e?void 0:e.currentAxis)?void 0:s.call(e);if(!o)return t;let h=null==(r=o.getTickData())?void 0:r.getDataView();if(!h||!h.transformsArr.find(t=>t.type.includes("ticks")))return t;let u=o.getScale();if(!u)return t;let d=null==(n=null==(a=l.getTickData())?void 0:a.getDataView())?void 0:n.latestData;if(!(null==d?void 0:d.length))return t;let c=l.getScale();if(!c)return t;let p=c.domain(),g=oA(p)-p[0];if(0===g)return t;let f=u.domain(),m=oA(f)-f[0];return 0===g?t:Sc(d.map(t=>{var e,i,s;let r,a;return e=t.value,i=p[0],s=f[0],r=iT(e,i),a=Math.max(iM(g),iM(r)),Math.round(r*10**a)/Math.round(g*10**a)*m+s}))};class S_{constructor(t){this.id=hH(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}release(){this.service=null}}class Sy extends S_{constructor(){super(Sy.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!fI(t.getScale().type))return!1;let e=t.getSpec().sync;return!!(null==e?void 0:e.axisId)&&e}_getTargetAxis(t,e){let i=t.getOption().getChart().getComponentByUserId(e.axisId);return(null==i?void 0:i.type.startsWith("cartesianAxis"))?i:null}onInit(t,e){let i=this._checkEnableSync(e);if(!i||!i.zeroAlign)return;let s=this._getTargetAxis(e,i);s&&e.event.on(dj.scaleDomainUpdate,{filter:({model:t})=>t.id===e.id||t.id===s.id},()=>{((t,e)=>{var i,s,r,a;let n=t.getScale(),l=e.getScale();if(!n||!l)return;let o=null!=(s=null==(i=t.getDomainAfterSpec)?void 0:i.call(t))?s:[0,1],h=null!=(a=null==(r=e.getDomainAfterSpec)?void 0:r.call(e))?a:[0,1];if(!(o&&h&&Sn(o)&&Sn(h)))return;let u=Sl(t,o),d=Sl(e,h);if(!0===u.break&&!0===d.break)return;let{positive:c,negative:p,extendable_min:g,extendable_max:f,includeZero:m}=u,{positive:_,negative:y,extendable_min:v,extendable_max:b,includeZero:x}=d;if(0===c&&0===p){if(!Sh(u,d))return}else if(0===_&&0===y){if(!Sh(d,u))return}else if(m||x)if(m&&!x){if(!So(u,d))return}else if(x&&!m){if(!So(d,u))return}else{if(p===y)return;if(p>y){if(!Su(u,d))return}else if(!Su(d,u))return}else{if(0===p&&0===_){if(!Sd(u,d))return}else if(0===y&&0===c&&!Sd(d,u))return;if(0===p&&0===y)if(0===o[0]&&h[0]>0){if(!v)return;h[0]=0}else{if(!(0===h[0]&&o[0]>0)||!g)return;o[0]=0}if(0===c&&0===_)if(0===o[1]&&h[1]>0){if(!b)return;h[1]=0}else{if(!(0===h[1]&&o[1]>0)||!f)return;o[1]=0}}n.domain(o),l.domain(h)})(s,e)})}onDidCompile(t,e){var i;let s=this._checkEnableSync(e);if(!s)return;let r=this._getTargetAxis(e,s);if(r&&s.tickAlign){c3(e.getOption().dataSet,"tickAlign",Sm);let t=null==(i=r.getTickData())?void 0:i.getDataView();t&&t.target.addListener("change",()=>{var t,i;null==(i=null==(t=e.getTickData())?void 0:t.getDataView())||i.reRunAllTransform({skipEqual:!0})}),e.addTransformToTickData({type:"tickAlign",options:{targetAxis:()=>r,currentAxis:()=>e},level:Number.MAX_SAFE_INTEGER},!1)}}}function Sv(t={}){let e=Object.assign({},t);if((0,r3.A)(t.style)?e.style=(e,i,s,r)=>SS(t.style(e,i,s,r)):pJ(t.style)||(e.style=SS(t.style)),!pJ(t.state)){let i={};
2Object.keys(t.state).forEach(e=>{(0,r3.A)(t.state[e])?i[e]=(i,s,r,a)=>SS(t.state[e](i,s,r,a)):pJ(t.state[e])||(i[e]=SS(t.state[e]))}),e.state=i}return e}function Sb(t){if(pJ(t))return null;let e={};return Object.keys(t).forEach(i=>{(0,r3.A)(t[i])?e[i]=(e,s,r,a)=>SS(t[i](e,s,r,a)):pJ(t[i])||(e[i]=SS(t[i]))}),e}function Sx(t,e){if(pJ(t))return null;let i={};return Object.keys(t).forEach(s=>{(0,r3.A)(t[s])?i[s]=t[s](e):i[s]=t[s]}),SS(i)}function SS(t){return(null==t?void 0:t.angle)?Object.assign(Object.assign({},t),{angle:iC(t.angle)}):t}Sy.pluginType="component",Sy.type="AxisSyncPlugin";let SA={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function Sk(t){let e=0;return uQ(t,"tick.visible")&&(e+=uQ(t,"tick.tickSize")),uQ(t,"label.visible")&&(e+=uQ(t,"label.space")),e}function SM(t,e){var i,s,r,a,n,l;return{min:null!=(r=null!=(i=t.min)?i:null==(s=t.range)?void 0:s.min)?r:null==e?void 0:e.min,max:null!=(l=null!=(a=t.max)?a:null==(n=t.range)?void 0:n.max)?l:null==e?void 0:e.max}}function Sw(t){let e=null==t?void 0:t.orient;return"top"===e||"bottom"===e||"left"===e||"right"===e||"z"===e}let ST=t=>"band"===t||"ordinal"===t||"point"===t;function SC(t,e){return{id:t,label:t,value:e,rawValue:t}}function SB(t,e,i){return i||!t||t.getAxisId()===e.getAxisId()}class SE extends yc{constructor(t){super(),this.component=t}releaseAll(){super.releaseAll(),this.component=null}}let SP=(t,e,i,s)=>{let r=t();if(ed(r))return r;if((0,r3.A)(r))return r(e(),i());let a=e();if("auto"===r&&a.width>0&&a.height>0){let{startAngle:t=0,endAngle:e=2*Math.PI}=s();return function(t,e,i,s){let{x:r,y:a}=e,n=function(t,e){let 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];let s=iR(Math.min(t,e)),r=s+i,a=[s,r],n=Math.floor(s/Math.PI)*Math.PI/2;for(;n<r;)n>s&&a.push(n),n+=Math.PI/2;return a}(i,s),{width:l,height:o}=t,h=[];return n.forEach(t=>{let e=Math.sin(t),i=Math.cos(t);1===e?h.push(o-a):-1===e?h.push(a):1===i?h.push(l-r):-1===i?h.push(r):(e>0?h.push(Math.abs((o-a)/e)):h.push(Math.abs(a/e)),i>0?h.push(Math.abs((l-r)/i)):h.push(Math.abs(r/i)))}),Math.min.apply(null,h)}(a,i(),t,e)}return Math.min(a.width/2,a.height/2)},SO=(t,e,i)=>{var s;let r=null!=(s="band"===e?v0("axisBand",i):"linear"===e?v0("axisLinear",i):{})?s:{},a=v0("angle"===t?"axisAngle":"axisRadius",i);return uy({},v0("axis",i),r,a)};class SR extends fm{getTheme(t,e){var i,s,r,a=this.type,n=this._option.getTheme;switch(a){case hc.cartesianBandAxis:return Sa(Si(t,["z"]),"band",n);case hc.cartesianLinearAxis:return Sa(Si(t,["z"]),"linear",n);case hc.cartesianLogAxis:return Sa(Si(t,["z"]),"log",n);case hc.cartesianSymlogAxis:return Sa(Si(t,["z"]),"symlog",n);case hc.cartesianAxis:case hc.cartesianTimeAxis:return Sa(Si(t),void 0,n);case hc.polarBandAxis:return SO(t.orient,"band",n);case hc.polarLinearAxis:return SO(t.orient,"linear",n);case hc.polarAxis:return SO(t.orient,void 0,n);case hc.cartesianCrosshair:return((t,e)=>{var i,s;let r,a=oS(null!=(i=e.axes)?i:[]),{bandField:n,linearField:l,xField:o,yField:h,trigger:u,triggerOff:d}=null!=(s=v0(hc.crosshair,t))?s:{},c=a.find(t=>x7(t.orient));r=(0,eA.A)(c)?uy({},ST(c.type)?n:l,o):o;let p=a.find(t=>St(t.orient));return{xField:r,yField:(0,eA.A)(p)?uy({},fL(p.type)?n:l,h):h,trigger:u,triggerOff:d}})(n,e);case hc.polarCrosshair:return((t,e)=>{var i,s;let r,a=oS(null!=(i=e.axes)?i:[]),{bandField:n,linearField:l,categoryField:o,valueField:h,trigger:u,triggerOff:d}=null!=(s=v0(hc.crosshair,t))?s:{},c=a.find(t=>"angle"===t.orient);r=(0,eA.A)(c)?uy({},ST(c.type)?n:l,o):o;let p=a.find(t=>"radius"===t.orient);return{categoryField:r,valueField:(0,eA.A)(p)?uy({},fL(p.type)?n:l,h):h,trigger:u,triggerOff:d}})(n,e);case hc.colorLegend:case hc.sizeLegend:case hc.discreteLegend:case hc.dataZoom:case hc.scrollBar:let l,o,h;return i=t,s=v0(a,n),l=null!=(r=i.orient)?r:s.orient,o=s[Ss(l)],h=uy({},s,o),delete h.horizontal,delete h.vertical,h;default:return v0(a,n)}}_mergeThemeToSpec(t,e){let{spec:i,theme:s}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:s}}_adjustPadding(t){let{padding:e,noOuterPadding:i=!0,orient:s}=t;i&&e&&s&&(t.padding=Object.assign(Object.assign({},hY(e)),{[s]:0}))}}var SI=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class SL extends fx{constructor(){super(...arguments),this.name="component",this.modelType="component",this.transformerConstructor=SR,this._delegateEvent=(t,e,i,s=null,r=null)=>{var a,n;e instanceof r8||this.event.emit(i,{model:this,node:t,event:e,item:s,datum:r,source:dV.chart,chart:null==(n=null==(a=this._option)?void 0:a.globalInstance)?void 0:n.getChart()},"model")}}static createComponent(t,e){let{spec:i}=t,s=SI(t,["spec"]);return new this(i,Object.assign(Object.assign({},e),s))}getRegions(){return this._regions}created(){super.created(),this.initLayout(),this.pluginService=new SE(this)}initLayout(){var t;super.initLayout(),this._regions=null!=(t=this._regions)?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map(t=>null==t?void 0:t.id))}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEac
2h(e=>t(e))}getContainer(){var t;return this._container||(this._container=null==(t=this._option)?void 0:t.globalInstance.getStage().find(t=>"root"===t.name,!0)),this._container}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some(i=>!(0,ex.n)(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)||t.releaseAll(),this.pluginService=null}clear(){var t;let e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach(t=>{var e;t&&(t.release(!0),null==(e=this.getContainer())||e.removeChild(t),t=null)}),this._container=null,null==(t=this.pluginService)||t.clearAll()}compile(){this.compileMarks(),this.reAppendComponents()}compileMarks(t){this.getMarks().forEach(e=>{e.compile({group:t,context:{model:this}})})}reAppendComponents(){let t=this._getNeedClearVRenderComponents();t&&t.length&&t.forEach(t=>{var e;t&&!t.stage&&(null==(e=this.getContainer())||e.appendChild(t))})}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}getDatum(t){}}SL.transformerConstructor=SR,(tr=tT||(tT={})).lineAxis="lineAxis",tr.circleAxis="circleAxis",(ta=tC||(tC={})).lineAxisGrid="lineAxisGrid",ta.circleAxisGrid="circleAxisGrid";var SD=i(23017);class SF extends _x{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_getDefaultStyle(){return{}}getComponent(){return this._component}clearComponent(){this._component&&(this._component.parent&&this._component.parent.removeChild(this._component),this._component=null)}_getAttrsFromConfig(t={}){let e=super._getAttrsFromConfig(t);return(0,eE.A)(this._markConfig.interactive)||(e.pickable=this._markConfig.interactive),t}setAttributeTransform(t){this._attributesTransform=t}renderInner(){var t;let e=null!=(t=this._simpleStyle)?t:this.getAttributesOfState({}),i=this._getAttrsFromConfig(e);this._attributesTransform&&(i=this._attributesTransform(i)),this._animationConfig&&(i=Object.assign(Object.assign({},i),{animation:!0,animationAppear:this._animationConfig.appear?Array.isArray(this._animationConfig.appear)?this._animationConfig.appear[0]:this._animationConfig.appear:void 0,animationEnter:this._animationConfig.enter?Array.isArray(this._animationConfig.enter)?this._animationConfig.enter[0]:this._animationConfig.enter:void 0,animationUpdate:this._animationConfig.update?Array.isArray(this._animationConfig.update)?this._animationConfig.update[0]:this._animationConfig.update:void 0,animationExit:this._animationConfig.exit?Array.isArray(this._animationConfig.exit)?this._animationConfig.exit[0]:this._animationConfig.exit:void 0})),this._component?this._component.setAttributes(i):(this._component=uP.createGraphicComponent(this._componentType,i,{mode:this._mode,skipDefault:this._markConfig.skipTheme}),this._component&&this._product.appendChild(this._component)),this._component&&(this._component.context=this._getCommonContext()),this._markConfig.support3d&&this._product&&this._product.setMode("3d"),this.model.event.emit(dH.AFTER_ELEMENT_ENCODE,{mark:this,model:this.model}),this.needClear=!0}release(){super.release(),this.removeProduct()}}SF.type="component";let Sz=()=>{uP.registerMark(SF.type,SF)};(tn=tB||(tB={})).innerView="inner-view",tn.axisContainer="axis-container",tn.labelContainer="axis-label-container",tn.tickContainer="axis-tick-container",tn.tick="axis-tick",tn.subTick="axis-sub-tick",tn.label="axis-label",tn.title="axis-title",tn.labelHoverOnAxis="axis-label-hover-on-axis",tn.gridContainer="axis-grid-container",tn.grid="axis-grid",tn.gridRegion="axis-grid-region",tn.line="axis-line",tn.background="axis-background",tn.axisLabelBackground="axis-label-background",tn.axisBreak="axis-break",tn.axisBreakSymbol="axis-break-symbol",(tl=tE||(tE={}
2)).selected="selected",tl.selectedReverse="selected_reverse",tl.hover="hover",tl.hoverReverse="hover_reverse";let SH={[tE.selectedReverse]:{},[tE.selected]:{},[tE.hover]:{},[tE.hoverReverse]:{}},Sj=t=>t;var SV=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class SN extends SL{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(t=0){return this._tickData[t]}getVisible(){return this._visible}get visible(){return this._visible}getInverse(){return this._inverse}getCoordinateType(){return this._coordinateType}constructor(t,e){var i,s;super(t,e),this.specKey="axes",this._scales=[],this._tickData=[],this._visible=!0,this._specVisible=!0,this._hideWhenEmpty=!1,this._tick=void 0,this._onTickDataChange=t=>{this._forceLayout(),null==t||t.updateData()},this._specVisible=null==(i=t.visible)||i,this._hideWhenEmpty=null!=(s=t.hideWhenEmpty)&&s,this._visible=this._specVisible,this._coordinateType="none"}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._specVisible=null==(t=this._spec.visible)||t,this._hideWhenEmpty=null!=(e=this._spec.hideWhenEmpty)&&e,this._visible=this._specVisible,this._scale&&this._refreshVisibilityByData()}getVRenderComponents(){var t,e;return[null==(t=this._axisMark)?void 0:t.getProduct(),null==(e=this._gridMark)?void 0:e.getProduct()].filter(eA.A)}created(){var t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this._refreshVisibilityByData(),this._shouldComputeTickData()&&this._initData(),this._specVisible){let v=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:"angle"===this.getOrient()?tT.circleAxis:tT.lineAxis,mode:this._spec.mode},{skipTheme:!0});if(this._updateTickDataMarks(v),this._axisMark=v,v.setMarkConfig({zIndex:this.layoutZIndex}),(0,eA.A)(this._spec.id)&&v.setUserId(this._spec.id),v.setMarkConfig({interactive:null!=(t=this._spec.interactive)?t:this.getDefaultInteractive()}),this._marks.addMark(v),null==(e=this._spec.grid)?void 0:e.visible){let t=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:"angle"===this.getOrient()?tC.circleAxisGrid:tC.lineAxisGrid,mode:this._spec.mode},{skipTheme:!0});this._updateTickDataMarks(t),t.setMarkConfig({zIndex:null!=(n=null!=(r=null==(s=null==(i=this._spec.grid)?void 0:i.style)?void 0:s.zIndex)?r:null==(a=this._spec.grid)?void 0:a.zIndex)?n:j.Axis_Grid,interactive:!1}),this._marks.addMark(t),this._gridMark=t}if(this._syncComponentVisibility(),(null==(l=this._option.globalInstance)?void 0:l.isAnimationEnable())&&!1!==uQ(this._option.getChart().getSpec(),"animation")&&!0===this._spec.animation){let t=bb(null==(o=uP.getAnimationInKey("axis"))?void 0:o(),{appear:null!=(u=null!=(h=this._spec.animationAppear)?h:uQ(this._option.getChart().getSpec(),"animationAppear.axis"))?u:uQ(this._option.getChart().getSpec(),"animationAppear"),disappear:null!=(c=null!=(d=this._spec.animationDisappear)?d:uQ(this._option.getChart().getSpec(),"animationDisappear.axis"))?c:uQ(this._option.getChart().getSpec(),"animationDisappear"),enter:null!=(g=null!=(p=this._spec.animationEnter)?p:uQ(this._option.getChart().getSpec(),"animationEnter.axis"))?g:uQ(this._option.getChart().getSpec(),"animationEnter"),exit:null!=(m=null!=(f=this._spec.animationExit)?f:uQ(this._option.getChart().getSpec(),"animationExit.axis"))?m:uQ(this._option.getChart().getSpec(),"animationExit"),update:null!=(y=null!=(_=this._spec.animationUpdate)?_:uQ(this._option.getChart().getSpec(),"animationUpdate.axis"))?y:uQ(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._specVisible&&(this.getVisible()||this._spec.forceInitTick||this._hideWhenEmpty)}_initData(){let t=this._initTickDataSet(this._tickTransformOption()),e=new mz(this._option,t);this._tickData=[e],t.target.addListener("change",()=>{this._onTickDataChange(e)}
2)}collectData(t,e){let i=[];return this._regions&&x8(this._regions,s=>{var r;let a=this.collectSeriesField(t,s);if(a=(0,ev.A)(a)?fI(this._scale.type)?a:[a[0]]:[a],t||(this._dataFieldText=s.getFieldAlias(a[0])),a){let t=s.getViewData();if(e)a.forEach(t=>{i.push(s.getRawDataStatisticsByField(t,!!fI(this._scale.type)))});else if(t&&t.latestData&&t.latestData.length){let e=null==(r=s.getViewDataStatistics)?void 0:r.call(s),n=this.type===hc.cartesianLinearAxis&&this._spec.breaks&&this._spec.breaks.length;a.forEach(s=>{var r;(null==(r=null==e?void 0:e.latestData)?void 0:r[s])&&(n?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 x8(this._regions,e=>{var i;(0,ev.A)(null==(i=e.getViewDataStatistics())?void 0:i.latestData)&&(t=!1)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){let{seriesId:t,seriesIndex:e,regionId:i,regionIndex:s}=this._spec;(0,eA.A)(t)&&(this._seriesUserId=oS(t)),(0,eA.A)(i)&&(this._regionUserId=oS(i)),(0,eA.A)(e)&&(this._seriesIndex=oS(e)),(0,eA.A)(s)&&(this._regionIndex=oS(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(dj.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));let t=x6(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()}),x8(this._regions,t=>{t.event.on(dj.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},()=>{this._clearRawDomain()})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_hasCollectedSeriesData(){return this.collectData(0).length>0}_refreshVisibilityByData(){let t=this._specVisible&&(!this._hideWhenEmpty||this._hasCollectedSeriesData()),e=this._visible!==t;return this._visible=t,(this._axisMark||this._gridMark)&&this._syncComponentVisibility(),e&&this._forceLayout(),e}_syncComponentVisibility(){var t,e,i,s,r,a,n,l,o,h,u,d;null==(t=this._axisMark)||t.setVisible(this._visible),null==(e=this._gridMark)||e.setVisible(this._visible&&!1!==(null==(i=this._spec.grid)?void 0:i.visible)),null==(n=null==(a=null==(r=null==(s=this._axisMark)?void 0:s.getComponent)?void 0:r.call(s))?void 0:a.setAttributes)||n.call(a,{visibleAll:this._visible}),null==(u=null==(h=null==(o=null==(l=this._gridMark)?void 0:l.getComponent)?void 0:o.call(l))?void 0:h.setAttributes)||u.call(h,{visibleAll:this._visible&&!1!==(null==(d=this._spec.grid)?void 0:d.visible)})}_clearRawDomain(){}onLayoutEnd(){this.updateScaleRange(),this.event.emit(dj.scaleUpdate,{model:this,value:"range"}),super.onLayoutEnd()}computeData(t){"force"!==t||this._tickData&&this._tickData.length?!this._tickData||!this._tickData.length||"force"!==t&&(0,ex.n)(this._scale.range(),[0,1])||this._tickData.forEach(t=>{t.getDataView().reRunAllTransform({skipEqual:!0})}):x8(this._regions,t=>{var e;null==(e=t.getViewData())||e.reRunAllTransform()},{userId:this._seriesUserId,specIndex:this._seriesIndex})}_updateTickDataMarks(t){this._tickData&&this._tickData.forEach(e=>{e.addRelatedMark(t)})}initScales(){this._scales=[this._scale];let t=[];if(x8(this._regions,e=>{let i=e.getGroups();i&&t.push(i)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),0!==t.length){let e=ok(t.map(t=>t.fields.length));for(let t=1;t<e;t++){let t=this._scale.clone();this._scales.push(t)}}}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(i.reRender=!0,(null==e?void 0:e.type)!==(null==t?void 0:t.type)||(null==e?void 0:e.visible)!==(null==t?void 0:t.visible)?i.reMake=!0:i.reMake=["grid","subGrid","tick","subTick","label","domainLine","title"].some(i=>{var s,r;return(null==(s=null==e?void 0:e[i])?void 0:s.visible)!==(null==(r=null==t?void 0:t[i])?void 0:r.visible)})),i}_getAxisAttributes(){var t;let e=this._spec,i={orient:this.getOrient(),select:!0!==this._option.disableTriggerEvent&&e.select,hover:!0!==this._option.disableTriggerEvent&&e.hover};if((e.domainLine&&e.domainLine.visible?((t=Sv(t=e.domainLine)).startSymbol=Sv(t.startSymbol),t.endSymbol=Sv(t.endSymbol),i.line=t):i.line={visible:!1},e.label&&e.label.visible)?(i.label=(0,SD.A)(e.label,["style","formatMethod","state"]),e.label.style&&(i.label.style=(0,r3.A)(e.label.style)?(t,
2i,s,r)=>{var a;let n=e.label.style(t.rawValue,i,t,s,r);return SS(uy({},null==(a=this._theme.label)?void 0:a.style,n))}:SS(e.label.style)),(e.label.formatMethod||e.label.formatter)&&(i.label.formatMethod=this._getLabelFormatMethod()),e.label.state&&(i.label.state=function(t){if(pJ(t))return null;let e={};return Object.keys(t).forEach(i=>{(0,r3.A)(t[i])?e[i]=(e,s,r,a)=>SS(t[i](e.rawValue,s,e,r,a)):pJ(t[i])||(e[i]=SS(t[i]))}),e}(e.label.state)),(0,r3.A)(e.label.dataFilter)&&(i.label.dataFilter=(t,i)=>e.label.dataFilter(t,i,{vchart:this._option.globalInstance}))):i.label={visible:!1},e.tick&&e.tick.visible?(i.tick={visible:e.tick.visible,length:e.tick.tickSize,inside:e.tick.inside,alignWithLabel:e.tick.alignWithLabel,dataFilter:(0,r3.A)(e.tick.dataFilter)?t=>e.tick.dataFilter(t,{vchart:this._option.globalInstance}):void 0},e.tick.style&&(i.tick.style=(0,r3.A)(e.tick.style)?(t,i,s,r)=>{var a;let n=e.tick.style(t,i,s,r);return SS(uy({},null==(a=this._theme.tick)?void 0:a.style,n))}:SS(e.tick.style)),e.tick.state&&(i.tick.state=Sb(e.tick.state))):i.tick={visible:!1},e.subTick&&e.subTick.visible?(i.subTick={visible:e.subTick.visible,length:e.subTick.tickSize,inside:e.subTick.inside,count:e.subTick.tickCount},e.subTick.style&&(i.subTick.style=(0,r3.A)(e.subTick.style)?(t,i,s,r)=>{var a;let n=e.subTick.style(t,i,s,r);return SS(uy({},null==(a=this._theme.subTick)?void 0:a.style,n))}:SS(e.subTick.style)),e.subTick.state&&(i.subTick.state=Sb(e.subTick.state))):i.subTick={visible:!1},e.title&&e.title.visible){let t=e.title,{autoRotate:s,angle:r,style:a={},background:n,state:l,shape:o}=t,h=SV(t,["autoRotate","angle","style","background","state","shape"]),u,d=r;"left"!==e.orient&&"right"!==e.orient||s&&(0,eE.A)(d)&&(d="left"===e.orient?-90:90,u=SA[e.orient]),i.title=Object.assign(Object.assign({},h),{autoRotate:!1,angle:d?iC(d):null,textStyle:uy({},u,SS(a)),pickable:!1!==a.pickable,childrenPickable:!1!==a.pickable,state:{}}),o&&o.visible?(i.title.shape=Object.assign(Object.assign({},o),{style:SS(o.style)}),o.state&&(i.title.state.shape=Sb(o.state))):i.title.shape={visible:!1},n&&n.visible?(i.title.background=Object.assign(Object.assign({},n),{style:SS(n.style)}),n.state&&(i.title.state.background=Sb(n.state))):i.title.background={visible:!1},l&&(i.title.state.text=Sb(l))}else i.title={visible:!1};return e.background&&e.background.visible?(i.panel={visible:!0},e.background.style&&(i.panel.style=SS(e.background.style)),e.background.state&&(i.panel.state=Sb(e.background.state))):i.panel={visible:!1},i}_getGridAttributes(){let t=this._spec;return{alternateColor:hF(t.grid.alternateColor),alignWithLabel:t.grid.alignWithLabel,style:(0,r3.A)(t.grid.style)?(e,i)=>{var s,r;let a=t.grid.style(null==(s=e.datum)?void 0:s.rawValue,i,e.datum);return SS(uy({},null==(r=this._theme.grid)?void 0:r.style,a))}:SS(t.grid.style),subGrid:!1===t.subGrid.visible?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:hF(t.subGrid.alternateColor),style:SS(t.subGrid.style)}}}_getLabelFormatMethod(){let{formatMethod:t,formatter:e}=this._spec.label,{formatFunc:i}=v1(t,e);return i?(t,s,r)=>i(s.rawValue,s,e):null}_initTickDataSet(t,e=0){c5(this._option.dataSet,"scale",Sj);let i=this.registerTicksTransform();return new eR(this._option.dataSet,{name:`${this.type}_${this.id}_ticks_${e}`}).parse(this._scales[e],{type:"scale"}).transform({type:i,options:t},!1)}_tickTransformOption(){let t=this._tick||{},e=this._spec.label||{},{tickCount:i,forceTickCount:s,tickStep:r,tickMode:a}=t,{style:n,formatMethod:l,minGap:o}=e;return{sampling:!1!==this._spec.sampling,tickCount:i,forceTickCount:s,tickStep:r,tickMode:a,axisOrientType:this._orient,coordinateType:this._coordinateType,labelStyle:n,labelFormatter:l,labelGap:o}}addTransformToTickData(t,e){this._tickData.forEach(i=>{var s;null==(s=null==i?void 0:i.getDataView())||s.transform(t,e)})}dataToPosition(t){return this._scale.scale(t)}getDatum(t){var e;return t&&t.name===tB.label?t.data:this._axisMark?null==(e=this._axisMark.getComponent())?void 0:e.attribute.items:void 0}scaleRangeFactor(t,e,i){return this._onTickDataChange(this.getTickData()),this.get
2Scale().rangeFactor(t,e,i)}scaleRangeFactorEnd(t,e,i){return this._onTickDataChange(this.getTickData()),this.getScale().rangeFactorEnd(t,e)}scaleRangeFactorStart(t,e,i){return this._onTickDataChange(this.getTickData()),this.getScale().rangeFactorStart(t,e)}}SN.specKey="axes";let SW=()=>{Sz(),uP.registerAnimation("axis",()=>({appear:{type:"fadeIn"},enter:{type:"fadeIn"},update:{type:"update"},exit:{type:"fadeOut"}}))};var SU=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let SG=[Sy];class SY extends SN{getOrient(){return this._orient}getDefaultInteractive(){return!0}set autoIndentOnce(t){this._autoIndentOnce=t}getScales(){return this._scales}getInnerOffset(){return this._innerOffset}constructor(t,e){super(t,e),this.type=hc.cartesianAxis,this.name=hc.cartesianAxis,this._defaultBandPosition=.5,this._defaultBandInnerPadding=.1,this._defaultBandOuterPadding=.3,this.layoutType="region-relative",this.layoutZIndex=j.Axis,this.layoutLevel=V.Axis,this._orient="left",this._autoIndentOnce=!1,this._hasAutoIndent=!1,this._scales=[],this._tick=void 0,this._layoutCac
2he={width:0,height:0,_lastComputeOutBounds:{x1:0,x2:0,y1:0,y2:0}},this._innerOffset={top:0,bottom:0,left:0,right:0},this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),x8(this._regions,t=>{let e=this.getOrient();x7(e)?SB(t.getXAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):St(e)?SB(t.getYAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper()):Se(e)&&SB(t.getZAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&t.setZAxisHelper(this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{let{x:e,y:i}=t;return eP(e)&&(e+=Number("left"===this._orient)*this.getLayoutRect().width),eP(i)&&(i+=Number("top"===this._orient)*this.getLayoutRect().height),{x:e,y:i}},this._transformLayoutRect=t=>{if(!this._visible)return t;let 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._layoutCac
2heProcessing(t))},this._transformLayoutPadding=t=>("left"===this.layoutOrient||"right"===this.layoutOrient?(t.top=0,t.bottom=0):"top"!==this.layoutOrient&&"bottom"!==this.layoutOrient||(t.left=0,t.right=0),t),this._updateAxisLayout=()=>{if(!this._visible)return void this._syncComponentVisibility();let t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,s=SU(e,["grid"]),r=uy({x:t.x,y:t.y},this._axisStyle,s);this._axisMark.setSimpleStyle(r),this._gridMark&&this._gridMark.setSimpleStyle(uy({x:t.x,y:t.y},this._getGridAttributes(),i)),this._syncComponentVisibility()},this._fixAxisOnZero=()=>{let{onZero:t,visible:e}=this._spec.domainLine;if(this.visible&&t&&!1!==e){let{onZeroAxisId:t,onZeroAxisIndex:e}=this._spec.domainLine,i=this._option.getComponentsByKey("axes"),s=x7(this.getOrient()),r=t=>{var e;return(s?!x7(t.getOrient()):x7(t.getOrient()))&&fI(t.getScale().type)&&(t.getTickData()?null==(e=t.getTickData().getLatestData())?void 0:e.find(t=>0===t.value):t.getScale().domain()[0]<=0&&oA(t.getScale().domain())>=0)},a=i.filter(t=>r(t));if(a.length){let n;if((0,eA.A)(t))n=a.find(e=>e.id===t);else if((0,eA.A)(e)){let t=i[e];r(t)&&(n=t)}else n=a[0];if(n){let t=this._axisMark,e=n.valueToPosition(0);s?t.setSimpleStyle(Object.assign(Object.assign({},t.getSimpleStyle()),{line:Object.assign(Object.assign({},this._axisStyle.line),{dy:"bottom"===this._orient?-((n.getInverse()?n.getScale().range()[1]:n.getScale().range()[0])-e):e})})):t.setSimpleStyle(Object.assign(Object.assign({},t.getSimpleStyle()),{line:Object.assign(Object.assign({},this._axisStyle.line),{dx:"left"===this._orient?e:-((n.getInverse()?n.getScale().range()[0]:n.getScale().range()[1])-e)})}))}}}},this._orient=Si(t,["z"]),Se(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet,this._coordinateType="cartesian"}static getSpecInfo(t){let e=t[this.specKey];if(!e)return null;let i="horizontal"===t.direction;if(!(0,ev.A)(e)){if(!Sw(e))return null;let{axisType:t,componentName:s}=Sr(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]){let t=e.filter(t=>"bottom"===t.orient)[0],i=e.filter(t=>St(t.orient))[0];s=3===e.length&&t&&i}let r=e.map((t,e)=>({spec:t,index:e}));s||(r=r.filter(({spec:t})=>"z"!==t.orient));let a=[];return r.forEach(({spec:t,index:e})=>{if(!Sw(t))return;let{axisType:s,componentName:r}=Sr(t,i);t.type=s,a.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r})}),a}static createComponent(t,e){let{spec:i}=t,s=SU(t,["spec"]),r=uP.getComponentInKey(s.type);return r?new r(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}getNewScaleRange(){let{width:t,height:e}=this.getLayoutRect(),{left:i,right:s,top:r,bottom:a}=this._innerOffset,n=[];return x7(this.getOrient())?eP(t)&&(n=this._inverse?[t-s,i]:[i,t-s]):Se(this.getOrient())?eP(t)&&(n=this._inverse?[t-s,i]:[i,t-s],this._scale.range(n)):eP(e)&&(n=this._inverse?[r,e-a]:[e-a,r]),n}updateScaleRange(){let t=!1,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)||e.load(SG.map(t=>new t)),this.callPlugin(t=>{this.pluginService&&t.onInit&&t.onInit(this.pluginService,this)})}setAttrFromSpec(){var t,e,i;let s;if(super.setAttrFromSpec(),this._specVisible){x7(this.getOrient())?pr(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):pr(this._spec.maxWidth)&&(this._spec.maxWidth="30%");let 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;let r=null==(t=this._option.getChart())?void 0:t.getSpec();this._inverse=(e=this._spec,i="horizontal"===(null==r?void 0:r.direction),s=e.inverse,i&&!x7(e.orient)&&(s=!(0,eA.A)(e.inverse)||!e.inverse),s)}onLayoutStart(t,e){if(super.onLayoutStart(t,e),!Se(this.getOrient())&&this._spec.innerOffset){let t=this._spec;St(this.getOrient())?["top","bottom"].forEach(i=>
2{this._innerOffset[i]=hU(t.innerOffset[i],e.height,e)}):["left","right"].forEach(i=>{this._innerOffset[i]=hU(t.innerOffset[i],e.width,e)})}}getSeriesStatisticsField(t){let e;return e=x7(this.getOrient())?t.fieldX:Se(this.getOrient())?t.fieldZ:t.fieldY,fI(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.noDecimals,labelLastVisible:null==(e=this._spec.label)?void 0:e.lastVisible,labelFirstVisible:null==(i=this._spec.label)?void 0:i.firstVisible,labelFlush:null==(s=this._spec.label)?void 0:s.flush})}axisHelper(){return{isContinuous:fI(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;(null==(t=this._axisMark)?void 0:t.getProduct())&&this.event.on(dH.AFTER_ELEMENT_ENCODE,({mark:t})=>{if(t===this._axisMark&&!1===this._isLayout&&(x7(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)){let{x:t,y:e}=this.getLayoutStartPoint(),i=x7(this._orient)?{x:ok(this._scale.range())+t,y:e}:{x:t,y:oM(this._scale.range())+e};this._unitText.setAttributes(i)}}),this.callPlugin(t=>{this.pluginService&&t.onDidCompile&&t.onDidCompile(this.pluginService,this)})}collectScale(){let t=[];return x8(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;return t>0?null==(s=null==(i=e.getGroups())?void 0:i.fields)?void 0:s[t]:x7(this.getOrient())?e.getSpec().x2Field?[...e.fieldX,e.fieldX2]:e.fieldX:Se(this.getOrient())?e.fieldZ:e.getSpec().y2Field?[...e.fieldY,e.fieldY2]:e.fieldY}updateSeriesScale(){let t=this.getOrient();x8(this._regions,e=>{x7(t)?SB(e.getXAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):St(t)?SB(e.getYAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):Se(t)&&SB(e.getZAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(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=x7(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&(0,ev.A)(null==(e=this.getTickData())?void 0:e.getLatestData())||this.computeData("range");let s={skipLayout:!1},r=x7(this.getOrient());this.pluginService&&(r?this.callPlugin(t=>{t.onWillLayoutHorizontal&&t.onWillLayoutHorizontal(this.pluginService,s,this)}):this.callPlugin(t=>{t.onWillLayoutVertical&&t.onWillLayoutVertical(this.pluginService,s,this)}));let a=this._axisMark.getProduct(),n=!1;if(!s.skipLayout){let t=this._getUpdateAttribute(!0),e=this._axisMark.getComponent(),s=uy(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,t,{line:{visible:!1}}),a=null==e?void 0:e.getBoundsWithoutRender(s);a&&!a.empty()||(a=(new iZ).set(s.x,s.y,s.x,s.y)),n=!0,this._latestBounds=a,i=this._appendAxisUnit(a,r)}return n||(this._latestBounds=a.AABBBounds),i}positionToData(t,e){let i=x7(this.getOrient());e&&(t-=i?this.getLayoutStartPoint().x:this.getLayoutStartPoint().y),this._innerOffset&&(t=i?h4(t,this._innerOffset.left,this.getLayoutRect().width-this._innerOffset.right):h4(t,this._innerOffset.top,this.getLayoutRect().height-this._innerOffset.bottom));let s=this._scale.range();return(t-s[0])*(t-oA(s))>0?null:this._scale.invert(t)}_getTitleLimit(t){var e,i,s,r,a;let n=this._spec.title;if(n.visible&&(0,eE.A)(null==(e=n.style)?void 0:e.maxLineWidth)){let e=null!=(a=null!=(s=null==(i=this._axisStyle.title)?void 0:i.angle)?s:null==(r=n.style)?void 0:r.angle)?a:0;
2if(t){let t=this.getLayoutRect().width,i=Math.abs(Math.cos(e));return i<1e-6?1/0:t/i}let l=this.getLayoutRect().height,o=Math.abs(Math.sin(e));return o<1e-6?1/0:l/o}return null}_getUpdateAttribute(t){let e=0,i=0;if(!t){let t=(t=>{let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,r=i+t[0].getLayoutRect().height;for(let a=1;a<t.length;a++){let n=t[a],{x:l,y:o}=n.getLayoutStartPoint(),{width:h,height:u}=n.getLayoutRect();e=Math.min(e,l),s=Math.max(s,h+l),i=Math.min(i,o),r=Math.max(r,u+o)}return{width:Math.abs(s-e),height:Math.abs(r-i)}})(this.getRegions());i=t.width,e=t.height}let{width:s,height:r}=this.getLayoutRect(),a=x7(this._orient),n=St(this._orient),l={x:0,y:0},o=e,h=s;a?l={x:s,y:0}:n&&(l={x:0,y:r},o=i,h=r);let u=this.getLabelItems(h),d={start:{x:0,y:0},end:l,title:{text:this._spec.title.text||this._dataFieldText,maxWidth:this._getTitleLimit(a)},items:u,scale:this._scale.clone(),maxWidth:this._layout.maxWidth,minWidth:this._layout.minWidth,width:this._spec.width?this.getLayoutRect().width:void 0};t||(d.grid={type:"line",start:{x:0,y:0},end:l,items:u[0],verticalFactor:this._axisStyle.verticalFactor,length:o});let c=a?this.layout.minHeight:this.layout.minWidth;return(a&&9===this._layout.layoutRectLevelMap.height||n&&9===this._layout.layoutRectLevelMap.width)&&(c=this._verticalLimitSize),d.verticalLimitSize=this._verticalLimitSize,d.verticalMinSize=c,d.label={overflowLimitLength:this._getLabelOverflowLimit(a)},this._afterUpdateAttribute?this._afterUpdateAttribute(d,t):d}getLabelItems(t){var e;let i=null==(e=this.getTickData())?void 0:e.getLatestData();return i&&i.length?[i.map(e=>{let i=this._getNormalizedValue([e.value],t);return SC(e.value,i)}).filter(t=>{let{value:e,rawValue:i}=t,s=this._scale.domain();return"log"===this.getSpec().type?e>=0&&e<=1:fI(this._scale.type)?i>=s[0]&&i<=oA(s):s.includes(i)})]:[]}initEvent(){super.initEvent(),this._specVisible&&(this.event.on(dj.layoutEnd,this._updateAxisLayout),this.event.on(dj.layoutEnd,this._fixAxisOnZero),this.event.on(dj.layoutRectUpdate,()=>{this._clearLayoutCache()}))}_getNormalizedValue(t,e){return 0===e?0:this.dataToPosition(t)/e}_layoutCacheProcessing(t){return["width","height"].forEach(e=>
2{t[e]<this._layoutCache[e]?t[e]=this._layoutCache[e]:this._layoutCache[e]=t[e]}),this._autoIndentOnce&&this._hasAutoIndent?["x1","x2","y1","y2"].forEach(t=>{this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]}):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach(t=>{this.layout.getLastComputeOutBounds()[t]<this._layoutCache._lastComputeOutBounds[t]?this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]:this._layoutCache._lastComputeOutBounds[t]=this.layout.getLastComputeOutBounds()[t]})),t}reInit(t){super.reInit(t),this._clearLayoutCache()}_clearLayoutCache(){this._hasAutoIndent=!1,this._layoutCache.width=0,this._layoutCache.height=0,this._layoutCache._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0}}onDataUpdate(){this._clearLayoutCache()}_appendAxisUnit(t,e){var i;if(this._spec.unit&&this._spec.unit.visible){let s,r,{text:a,style:n}=this._spec.unit,{x:l,y:o}=this.getLayoutStartPoint();e?(s={x:ok(this._scale.range())+l,y:o},r={textAlign:"left",textBaseline:"middle"}):(s={x:l,y:oM(this._scale.range())+o},r={textAlign:"left"===this._orient?"left":"right",textBaseline:"bottom"}),r=Object.assign(Object.assign(Object.assign({},r),n),{x:s.x,y:s.y,text:a}),this._unitText?this._unitText.setAttributes(r):(this._unitText=p4(r),this._unitText.name="axis-unit",null==(i=this.getContainer())||i.add(this._unitText));let h=this._unitText.AABBBounds;e?(t.x2+=h.x2>t.x2?h.x2-t.x2:0,t.y2+=h.y2>t.y2?h.y2-t.y2:0):(t.x1+=h.x1<t.x1?h.x1-t.x1:0,t.y1+=h.y1<t.y1?h.y1-t.y1:0)}return t}_getNeedClearVRenderComponents(){return this._unitText?[this._unitText]:[]}_getLabelOverflowLimit(t){var e,i;if(t&&!1!==(null==(e=this._spec.label)?void 0:e.visible)&&!0===(null==(i=this._spec.label)?void 0:i.autoLimit)){let t=this._option.getComponentsByKey("axes"),e=this.getRegions(),i=t.filter(t=>{let i=t.getOrient();return("left"===i||"right"===i)&&t.getRegions().some(t=>e.includes(t))}),s=0,r=0,a=this.getLayoutStartPoint().x,n=a+this.getLayoutRect().width;return i.forEach(t=>{let e=t.getLayoutStartPoint().x;if("left"===t.getOrient()&&e===a){let e=t.getLayoutRect().width;s=Math.max(s,e)}else if(e===n){let e=t.getLayoutRect().width;r=Math.max(r,e)}}),{left:s,right:r}}}}SY.type=hc.cartesianAxis,SY.specKey="axes";class S${constructor(){this._rawDomainIndex=[],this._rawDomain=[]}_initData(){var t;if(this._spec.showAllGroupLayers&&this._scales.length>1)for(let e=0;e<this._scales.length;e++){let i=(null!=(t=this._spec.layers)?t:[])[this._scales.length-1-e]||{};if(!1!==i.visible&&0!==i.tickCount&&0!==i.forceTickCount){let t=this._initTickDataSet(Object.assign(Object.assign({},this._tickTransformOption()),i),e),s=new mz(this._option,t);this._tickData.push(s),t.target.addListener("change",()=>{this._onTickDataChange(s)}),this._tickDataMap||(this._tickDataMap={}),this._tickDataMap[e]=s}}else{let t=this._initTickDataSet(this._tickTransformOption()),e=new mz(this._option,t);t.target.addListener("change",()=>{this._onTickDataChange(e)}),this._tickData=[e],this._tickDataMap={0:e}}}_updateData(){var t,e,i;let s=this.registerTicksTransform();if(this._spec.showAllGroupLayers&&this._scales.length>1){let e=null!=(t=this._spec.layers)?t:[];Object.keys(this._tickDataMap).forEach(t=>{let i=e[this._scales.length-1-t]||{},r=this._tickDataMap[t],a=null==r?void 0:r.getDataView().transformsArr.find(t=>t.type===s);a&&(a.options=Object.assign(Object.assign({},this._tickTransformOption()),i))})}else{let t=null==(i=null==(e=this._tickData)?void 0:e[0])?void 0:i.getDataView().transformsArr.find(t=>t.type===s);t&&(t.options=this._tickTransformOption())}}getRawDomain(){return this._rawDomain}dataToPosition(t,e={}){var i,s;if(0===t.length||0===this._scales.length)return 0;let{position:r,bandScale:a}=this.getPosition(t);return r+a.bandwidth()*(null!=(s=null!=(i=e.bandPosition)?i:this._spec.bandPosition)?s:this._defaultBandPosition)}valueToPosition(t){return this._scale.scale(t)}updateGroupScaleRange(){let t=this._scale;this._scales.forEach((e,i)=>{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{let s=Math.min(t.length,this._scales.length);for(let i=0;i<s;i++)e+=this._scales[i].scale(t[i]);i=this._scales[s-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,s;let{bandPadding:r,paddingInner:a,paddingOuter:n}=this._spec,l=(0,ev.A)(r),o=(0,ev.A)(a),h=(0,ev.A)(n);for(let u=0;u<this._scales.length;u++){let d=l?r[u]:r,c=o?a[u]:a,p=h?n[u]:n;this._scales[u].paddingInner(null!=(i=null!=c?c:d)?i:t,!0).paddingOuter(null!=(s=null!=p?p:d)?s:e,!0)}}computeBandDomain(t){if(!t.length)return[];if(1===t.length)return t[0].values;let e=new Set;for(let i=0;i<t.length;i++)for(let s=0;s<t[i].values.length;s++)e.add(t[i].values[s]);return Array.from(e)}updateScaleDomain(){var t;
2if(!this.isSeriesDataEnable())return;(null==(t=this._rawDomainIndex)?void 0:t.length)||!this._scales.length||this._updateRawDomain();let e=this._spec.domain;for(let t=0;t<this._scales.length;t++)if(e&&e.length&&0===t)this._scales[t].domain(e);else{let e=this.collectData(t),i=this.computeBandDomain(e);this._scales[t].domain(i.sort((e,i)=>this._rawDomainIndex[t][e]-this._rawDomainIndex[t][i]))}this.transformScaleDomain(),this._refreshVisibilityByData(),this.event.emit(dj.scaleDomainUpdate,{model:this}),this.event.emit(dj.scaleUpdate,{model:this,value:"domain"})}getLabelItems(t){let e=[],i=[];return(this._spec.showAllGroupLayers?this._scales:[this._scales[0]]).forEach((s,r)=>{var a;let n=this._tickDataMap[r],l=null==(a=null==n?void 0:n.getLatestData())?void 0:a.length,o=l?n.getLatestData().map(t=>t.value):s.domain();if(o&&o.length)if(i&&i.length){let s=[],r=[];i.forEach(e=>{o.forEach(i=>{let a=oS(e).concat(i);if(r.push(a),l){let e=SC(i,this._getNormalizedValue(a,t));s.push(e)}})}),l&&e.push(s.filter(t=>t.value>=0&&t.value<=1)),i=r}else o.forEach(t=>{i.push(t)}),l&&e.push(n.getLatestData().map(e=>SC(e.value,this._getNormalizedValue([e.value],t))).filter(t=>t.value>=0&&t.value<=1))}),e.reverse()}_updateRawDomain(){this._rawDomainIndex=[],this._rawDomain=[];let t=this._spec.domain;for(let e=0;e<this._scales.length;e++)if(t&&t.length&&0===e)this._scales[e].domain(t);else{let t=this.collectData(e,!0),i=this.computeBandDomain(t);this._rawDomainIndex[e]={},this._rawDomain[e]=i,i.forEach((t,i)=>this._rawDomainIndex[e][t]=i)}this.event.emit(dj.scaleRawDomainUpdate,{model:this})}_clearRawDomain(){this._rawDomainIndex=[],this._rawDomain=[]}}let SX=(t,e,i,s)=>{let r=Sf(t,e,i);return r&&r.map(t=>
2s?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])},SK=(t,e,i=0)=>Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2,Sq=(t,e)=>t[1]<e[0]?e[0]-t[1]:e[1]<t[0]?t[0]-e[1]:0,SZ=(t,e)=>{var i;let s,r=t.domain();if(!r.length)return[];let{tickCount:a,forceTickCount:n,tickStep:l,labelGap:o=4,axisOrientType:h,labelStyle:u}=e,d=["bottom","top","z"].includes(h),c=t.range(),p=t.calculateWholeRangeSize();if(p<2)return e.labelLastVisible?Sc([r[r.length-1]]):Sc([r[0]]);if((0,eA.A)(l))s=t.stepTicks(l);else if((0,eA.A)(n))s=t.forceTicks(n);else if((0,eA.A)(a)){let e=(0,r3.A)(a)?a({axisLength:p,labelStyle:u}):a;s=t.ticks(e)}else if(e.sampling){let a=(null!=(i=e.labelStyle.fontSize)?i:12)+2,n=oM(c),l=ok(c);if(r.length<=p/a){let i=SX(t,r,e,d);if(i){let a=Math.min(...i.map(t=>t[2])),h=(l-n)/r.length,u=SJ(r,i,o,e.labelLastVisible,Math.floor(a/h),!1);s=t.stepTicks(u.step),e.labelLastVisible&&(u.delCount&&(s=s.slice(0,s.length-u.delCount)),s.push(r[r.length-1]))}}else{let i=SX(t,[r[0],r[Math.floor(r.length/2)],r[r.length-1]],e,d);if(i){let a=null;i.forEach(t=>{a?a[2]<t[2]&&(a=t):a=t});let h=l-n-o>0?Math.ceil(r.length*(o+a[2])/(l-n-o)):r.length-1;s=t.stepTicks(h),!e.labelLastVisible||s.length&&s[s.length-1]===r[r.length-1]||(s.length&&Math.abs(t.scale(s[s.length-1])-t.scale(r[r.length-1]))<a[2]&&(s=s.slice(0,-1)),s.push(r[r.length-1]))}}}return(0,eE.A)(s)&&(s=t.domain()),Sc(s)},SJ=(t,e,i,s,r,a)=>{let n=0,l=0,o=-1,h=Number.MAX_VALUE,u=s=>{let r=!0,a=0;do a+s<t.length&&SK(e[a],e[a+s],i)&&(r=!1),a+=s;while(r&&a<t.length)return r},d=fV(r,t.length,t=>u(t)?1:-1),c=d;do if(!(c>d)||a||u(c)){if(!s){l=c;break}{let s=t.length-1,r,a=0;r=t.length%c>0?t.length-t.length%c+c:t.length;do{if((r-=c)!==s&&!SK(e[r],e[s],i))break;a++}while(r>0)if(r===s){l=c,n=a;break}{let i=Math.floor(t.length/c)-a+1;if(i<o)break;{o=i;let t=Sq(e[r],e[s]),u=r-c>=0?Sq(e[r-c],e[r]):t,d=Math.abs(t-u);if(d<h&&(h=d,l=c,n=a),t<=u)break}}}c++}else c++;while(c<=t.length)return{step:l,delCount:n}},SQ=(t,e)=>{let{x1:i,x2:s,y1:r,y2:a}=t,n=Math.abs(s-i),l=Math.abs(a-r),o=(i+s)/2,h=(r+a)/2,u=0,d=0;switch(e){case"top":case"inside-top":d=-.5;break;case"bottom":case"inside-bottom":d=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,d=-.5;break;case"top-left":u=-.5,d=-.5;break;case"bottom-right":u=.5,d=.5;break;case"bottom-left":u=-.5,d=.5}return{x:o+=u*n,y:h+=d*l}},S0=(t,e)=>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2);function S1(t,e){return[t[0]*e,t[1]*e]}function S2(t){let[e,i]=t;return Math.sqrt(e*e+i*i)}function S3(t,e,i){let s=function(t,e){let[i,s]=t,[r,a]=e,n=Math.sqrt((i*i+s*s)*(r*r+a*a));return Math.acos(Math.min(Math.max(n&&(i*r+s*a)/n,-1),1))}(t,e),r=iA(t,e)>=0;return i?r?2*Math.PI-s:s:r?s:2*Math.PI-s}let S5={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}},labelHoverOnAxis:{visible:!1,space:7,padding:2,position:0,autoRotate:!1,textStyle:{fontSize:12,fill:"red",fontWeight:"normal",fillOpacity:1},background:{visible:!0,style:{cornerRadius:2,fill:"black"}}},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}}},S4={size:8,stroke:"#000",lineWidth:1,zIndex:1},S8=Math.sin(Math.PI/10);function S6(t,e=S8){let i=!(0,eE.A)(t)&&0!==t,s=i?Math.cos(t):1;return i&&Math.abs(s)<=e}function S9(t,e=S8){let i=!(0,eE.A)(t)&&0!==t,s=i?Math.sin(t):0;return!i||Math.abs(s)<=e}function S7(t){let e={};return b5(t,t=>{"group"!==t.type&&t.id&&(e[t.id]=t)}),e}function At(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function Ae(t,e,i,s=!1,r=!1){let a=[e.x-i.x,e.y-i.y];return S1(a,(s?-1:1)*(r?-1:1)*t/S2(a))}function Ai(t,e,i,s,r){let a=[],n=r-s;for(let r=0;r<e;r++){let l=s+r*n/e;a.push(iE(t,i,l))}return a}function As(t,e){let i="";return 0===t.length||(t.forEach((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`}),e&&(i+="Z")),i}function Ar(t,e,i){var s;if(S9(null==(s=t.attribute)?void 0:s.angle,Number.EPSILON))return i>S0(t.AABBBounds,e.AABBBounds);let r=t.OBBBounds,a=e.OBBBounds;return!r||!a||r.empty()||a.empty()?i>S0(t.AABBBounds,e.AABBBounds):r.intersects(a)||i>((t,e)=>{let i=[{x:Math.cos(t.angle),y:Math.sin(t.angle)},{x:-Math.sin(t.angle),y:Math.cos(t.angle)},{x:Math.cos(e.angle),y:Math.sin(t.angle)},{x:-Math.sin(e.angle),y:Math.cos(t.angle)}];function s(t,e,i){let s=t.getRotatedCorners().map(t=>t.x*e+t.y*i);return{min:Math.min(...s),max:Math.max(...s)}}let r=0;for(let a of i){let i=s(t,a.x,a.y),n=s(e,a.x,a.y);
2r=Math.max(r,i.max<n.min?n.min-i.max:n.max<i.min?i.min-n.max:0)}return r})(r,a)}function Aa(t,e){for(let i,s=1,r=t.length,a=t[0];s<r;a=i,++s)if(Ar(a,i=t[s],e))return!0;return!1}function An(t,e,i,s){let r="";if(!t||0===e.length)return r;let a=e[0],n=i6.distancePP(t,a),l=+!i;return s?r+=`M${t.x},${t.y-n}A${n},${n},0,0,${l},${t.x},${t.y+n}A${n},${n},0,0,${l},${t.x},${t.y-n}Z`:e.forEach((t,e)=>{0===e?r=`M${t.x},${t.y}`:r+=`A${n},${n},0,0,${l},${t.x},${t.y}`}),r}class Al extends xN{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&S7(this._innerView),this.removeAllChild(!0),this._innerView=lF.group({x:0,y:0,pickable:!1}),this.add(this._innerView);let{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 At(t,this.getVerticalVector(e,i,t))}_transformItems(t){let e=[];return t.forEach(t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!=(i=t.id)?i:t.label}))}),e}_renderGrid(t){let{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){let i=eB({},this.attribute,this.getGridAttribute(t)),{type:s,items:r,style:a,closed:n,alternateColor:l,depth:o=0}=i,h=t?`${tB.grid}-sub`:`${tB.grid}`;if(r.forEach((t,i)=>{let{id:r,points:l}=t,u="";if("line"===s||"polygon"===s)u=As(l,!!n);else if("circle"===s){let{center:t}=this.attribute;u=An(t,l,!1,!!n)}let d=lF.path(Object.assign({path:u,z:o},(0,r3.A)(a)?eB({},this.skipDefault?null:Al.defaultAttributes.style,a(t,i)):a));d.name=`${h}-line`,d.id=this._getNodeId(`${h}-path-${r}`),e.add(d)}),o&&"line"===s&&r.forEach((t,i)=>{let{id:s,points:r}=t,l=[];l.push(r[0]);let u=r[1].x-r[0].x,d=r[1].y-r[0].y,c=o/Math.sqrt(u*u+d*d);l.push({x:r[0].x+u*c,y:r[0].y+d*c});let p=As(l,!!n),g=ic(l[0].x-l[1].x),f=ic(l[0].y-l[1].y),m=lF.path(Object.assign({path:p,z:0,alpha:g>f?(r[1].x-r[0].x>0?-1:1)*io/2:0,beta:g<f?-io/2:0,anchor3d:g>f?[l[0].x,0]:[0,l[0].y]},(0,r3.A)(a)?eB({},this.skipDefault?null:Al.defaultAttributes.style,a(t,i)):a));m.name=`${h}-line`,m.id=this._getNodeId(`${h}-path-${s}`),e.add(m)}),r.length>1&&l){let t=(0,ev.A)(l)?l:[l,"transparent"],s=e=>t[e%t.length],a=this.attribute.items,n=a[0],o=a[a.length-1],u=!rL(n.value,0)&&!rL(o.value,0),d=!rL(n.value,1)&&!rL(o.value,1),c=[],p=n.value>o.value;(p&&d||!p&&u)&&c.push(this.getGridPointsByValue(+!!p)),r.forEach(t=>{c.push(t.points)}),(p&&u||!p&&d)&&c.push(this.getGridPointsByValue(+!p));for(let t=0;t<c.length-1;t++){let r=function(t,e,i){let{type:s,closed:r}=i,a=e.slice(0).reverse(),n="",l="";if("line"===s&&i.smoothLink&&i.center){let e=t[0],s=a[0],o=i.center;n=As(t,!!r),l=As(a,!!r);let h=i6.distancePP(s,o),u=i6.distancePP(e,o);n+=`A${h},${h},0,0,1,${s.x},${s.y}L${s.x},${s.y}`,l+=`A${u},${u},0,0,0,${e.x},${e.y}`}else if("circle"===s){let{center:e}=i;n=An(e,t,!1,!!r),l=An(e,a,!0,!!r)}else"line"!==s&&"polygon"!==s||(n=As(t,!!r),l=As(a,!!r));return r?n+=l:(n+=l="L"+l.substring(1),n+="Z"),n}(c[t],c[t+1],i),a=lF.path({path:r,fill:s(t)});a.name=`${h}-region`,a.id=this._getNodeId(`${h}-region-${t}`),e.add(a)}}}_getNodeId(t){return`${this.id}-${t}`}_parseTickSegment(){let t=1;return this.data.length>=2&&(t=this.data[1].value-this.data[0].value),t}_getPointsOfSubGrid(t,e){let i=this.data.length,s=[];return i>=2&&this.data.forEach(i=>{let r=i.value;if(!e){let e=i.value-t/2;if(this.isInValidValue(e))return;r=e}s.push({value:r})}),s}release(){super.release(),this._prevInnerView=null,this._innerView=null}}Al.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class Ao{isInValidValue(t){return t<0||t>1}getTickCoord(t){let{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){let{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){var s;let r,{verticalFactor:a=1}=this.attribute,n=((r=S2(s=this.getRelativeVector()))>0&&(r=1/r),[s[0]*r,s[1]*r]);return S1([n[1],-1*n[0]],t*(e?1:-1)*a)}}let Ah=["radius","startAngle","endAngle",...nX];class Au extends n0{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=nv}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{startAngle:t,endAngle:e,radius:i}=this.attribute;
2return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return rQ(this).circle}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));let{tb1:r,tb2:a}=ie.graphicService.updateTempAABBBounds(i);return gJ(t,e,r),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ie.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){let{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){let{startAngle:s=e.startAngle,endAngle:r=e.endAngle,radius:a=e.radius}=t;return r-s>id-1e-12?i.set(-a,-a,a,a):ar(s,r,a,i),i}needUpdateTags(t){return super.needUpdateTags(t,Ah)}needUpdateTag(t){return super.needUpdateTag(t,Ah)}toCustomPath(){var t,e,i;let s=super.toCustomPath();if(s)return s;let r=this.attribute,a=null!=(t=r.radius)?t:this.getDefaultAttribute("radius"),n=null!=(e=r.startAngle)?e:this.getDefaultAttribute("startAngle"),l=null!=(i=r.endAngle)?i:this.getDefaultAttribute("endAngle");return(s=new sO).arc(0,0,a,n,l),s}clone(){return new Au(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Au.NOWORK_ANIMATE_ATTR}}function Ad(t){return new Au(t)}Au.NOWORK_ANIMATE_ATTR=nQ;let Ac=new class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{radius:m=o.radius,startAngle:_=o.startAngle,endAngle:y=o.endAngle,opacity:v=o.opacity,x:b=o.x,y:x=o.y,scaleX:S=o.scaleX,scaleY:A=o.scaleY,keepStrokeScale:k=o.keepStrokeScale}=t.attribute,M=(r,a)=>{let n=!(!r||!r.stroke),{distance:l=o[a].distance}=r,h=k?l:s4(e,l,e.dpr);if(e.beginPath(),e.arc(i,s,m+("outerBorder"===a?1:-1)*h,_,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),d)d(e,r,o[a]);else if(n){let n=o[a].opacity;o[a].opacity=v,e.setStrokeStyle(t,r,(b-i)/S,(x-s)/A,o[a]),o[a].opacity=n,e.stroke()}};g&&M(c,"outerBorder"),f&&M(p,"innerBorder")}};var Ap=function(t,e){return function(i,s){e(i,s,t)}};let Ag=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nv,this.builtinContributions=[Ac,ou,oQ],this.init(t)}drawShape(t,e,i,s,r,a,n,l){let o=rQ(t,null==a?void 0:a.theme).circle,{radius:h=o.radius,startAngle:u=o.startAngle,endAngle:d=o.endAngle,x:c=o.x,y:p=o.y,fillStrokeOrder:g=o.fillStrokeOrder}=t.attribute,f=this.valid(t,o,n,l);if(!f)return;let{fVisible:m,sVisible:_,doFill:y,doStroke:v}=f;e.beginPath(),e.arc(i,s,h,u,d),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,y,v,m,_,o,r,n,l);let b=()=>{y&&(n?n(e,t.attribute,o):m&&(e.setCommonStyle(t,t.attribute,c-i,p-s,o),e.fill()))},x=()=>{v&&(l?l(e,t.attribute,o):_&&(e.setStrokeStyle(t,t.attribute,c-i,p-s,o),e.stroke()))};g?(x(),b()):(b(),x()),this.afterRenderStep(t,e,i,s,y,v,m,_,o,r,n,l)}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).circle;this._draw(t,r,!1,i,s)}};Ag=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),Ap(0,eU(eY)),Ap(0,eG(l7)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ag);let Af=!1,Am=new eL(t=>{Af||(Af=!0,t(Ag).toSelf().inSingletonScope(),t(la).to(Ag).inSingletonScope(),t(ln).toService(la),t(l7).toService(o_),eX(t,l7))}),A_=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=nv}};A_=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(to=eU(la),function(t,e){to(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],A_);let Ay=!1,Av=new eL((t,e,i,s)=>{Ay||(Ay=!0,t(g_).to(A_).inSingletonScope(),t(gC).toService(g_))}),Ab=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=nv}};
2Ab=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(th=eU(la),function(t,e){th(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ab);let Ax=!1,AS=new eL((t,e,i,s)=>{Ax||(Ax=!0,t(gn).to(Ab).inSingletonScope(),t(gs).toService(gn))});function AA(){AA.__loaded||(AA.__loaded=!0,lF.RegisterGraphicCreator("circle",Ad),e7.load(Am),e7.load(gi?Av:AS))}AA.__loaded=!1;let Ak=["path","customPath",...nX];class AM extends n0{constructor(t){super(t),this.type="path",this.numberType=nk}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){let t=this.getGraphicTheme();if(!this.valid)return t.path;let e=this.attribute;return e.path instanceof sO?e.path:((0,eE.A)(this.cache)&&this.doUpdatePathShape(),this.cache instanceof sO?this.cache:t.path)}getGraphicTheme(){return rQ(this).path}
2updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let t=this.getParsedPathShape();i.union(t.getBounds())}let{tb1:s,tb2:r}=ie.graphicService.updateTempAABBBounds(i);gJ(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;let{lineJoin:a=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){let t=this.attribute;(0,eS.A)(t.path,!0)?this.cache=(new sO).fromString(t.path):t.customPath&&(this.cache=new sO,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Ak)}needUpdateTag(t){return super.needUpdateTag(t,Ak)}toCustomPath(){return(new sO).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new AM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return AM.NOWORK_ANIMATE_ATTR}}function Aw(t){return new AM(t)}AM.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},nQ);var AT=function(t,e){return function(i,s){e(i,s,t)}};let AC=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nk,this.builtinContributions=[ou,oQ],this.init(t)}drawShape(t,e,i,s,r,a,n,l){var o,h,u;let d=null!=(o=this.tempTheme)?o:rQ(t,null==a?void 0:a.theme).path,{x:c=d.x,y:p=d.y,fillStrokeOrder:g=d.fillStrokeOrder}=t.attribute,f=null!=(h=this.z)?h:0,m=this.valid(t,d,n,l);if(!m)return;let{fVisible:_,sVisible:y,doFill:v,doStroke:b}=m;(e.beginPath(),t.pathShape)?i4(t.pathShape.commandList,e,i,s,1,1,f):i4((null!=(u=t.attribute.path)?u:d.path).commandList,e,i,s,1,1,f),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,s,v,b,_,y,d,r,n,l);let x=()=>{b&&(l?l(e,t.attribute,d):y&&(e.setStrokeStyle(t,t.attribute,c-i,p-s,d),e.stroke()))},S=()=>{v&&(n?n(e,t.attribute,d):_&&(e.setCommonStyle(t,t.attribute,c-i,p-s,d),e.fill()))};g?(x(),S()):(S(),x()),this.afterRenderStep(t,e,i,s,v,b,_,y,d,r,n,l)}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,s),this.tempTheme=null}};AC=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),AT(0,eU(eY)),AT(0,eG(oi)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AC);let AB=!1,AE=new eL(t=>{AB||(AB=!0,t(AC).toSelf().inSingletonScope(),t(lh).to(AC).inSingletonScope(),t(ln).toService(lh),t(oi).toService(o_),eX(t,oi))}),AP=class extends bU{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=nk}};AP=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tu=eU(lh),function(t,e){tu(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AP);let AO=!1,AR=new eL((t,e,i,s)=>{AO||(AO=!0,t(gb).to(AP).inSingletonScope(),t(gC).toService(gb))}),AI=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=nk}};AI=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(td=eU(lh),function(t,e){td(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AI);let AL=!1,AD=new eL((t,e,i,s)=>{AL||(AL=!0,t(gh).to(AI).inSingletonScope(),t(gs).toService(gh))});function AF(){AF.__loaded||(AF.__loaded=!0,lF.RegisterGraphicCreator("path",Aw),e7.load(AE),e7.load(gi?AR:AD))}AF.__loaded=!1;class Az extends _t{onBind(){var t;let e=xF(this.target);this._animator=e;let i=this.duration,s=this.easing,{config:r,lastScale:a,getTickCoord:n}=this.params,l=1,o=this.target.data;if(a&&n&&o){l=.7;let t=n(a.scale(o.rawValue)),r=this.target.attribute.x,h=this.target.attribute.y;this.target.setAttributes({x:t.x,y:t.y}),e.animate(this.target,{type:"to",to:{x:r,y:h},duration:i,easing:s})}e.animate(this.target,{type:null!=(t=r.type)?t:"fadeIn",to:r.to,duration:i*l,easing:s}),this.completeBind(e)}}class AH extends _t{onBind(){let t=xF(this.target);this._animator=t;let e=this.duration,i=this.easing,{config:s,diffAttrs:r}=this.params;t.animate(this.target,{type:"to",to:Object.assign({},r),duration:e,easing:i,customParameters:{diffAttrs:Object.assign({},r)}}),this.completeBind(t)}deleteSelfAttr(t){super.deleteSelfAttr(t),this._animator.deleteSelfAttr(t)}tryPreventConflict(){}}function Aj(){p1(),bZ(),xL(),gD(),y_.registerBuiltInAnimate("axisEnter",Az),y_.registerBuiltInAnimate("axisUpdate",AH)}p1(),AF();class AV extends Al{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Al.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){let{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){let{center:t,sides:s=6,startAngle:r=_T,endAngle:a=_C}=this.attribute,n=i6.distancePP(t,e);i=Ai(t,s,n,r,a)}return i}getGridPointsByValue(t){let e=this.getTickCoord(t);return this._getGridPoint(this.attribute.type,e)}getGridAttribute(t){let{type:e,alignWithLabel:i=!0}=this.attribute,s=this._parseTickSegment(),r,a=[];if(t){r=eB({},this.attribute,this.attribute.subGrid);let t=[],{count:e=4}=r;if(this.data.length>=2){let r=this._getPointsOfSubGrid(s,i);for(let i=0;i<r.length-1;i++){let s=r[i],a=r[i+1];t.push({id:`sub-${i}-0`,points:this.getGridPointsByValue(s.value),datum:{}});for(let r=0;r<e;r++){let n=(r+1)/(e+1),l=(1-n)*s.value+n*a.value;t.push({id:`sub-${i}-${r+1}`,points:this.getGridPointsByValue(l),datum:{}})}i===r.length-2&&t.push({id:`sub-${i}-${e+1}`,points:this.getGridPointsByValue(a.value),datum:{}})}a=t}}else{r=this.attribute;let t=[];this.data.forEach(r=>{let{point:a}=r;if(!i){let t=r.value-s/2;if(this.isInValidValue(t))return;a=this.getTickCoord(t)}t.push({id:r.label,datum:r,points:this._getGridPoint(e,a)})}),a=t}return Object.assign(Object.assign({},r),{items:a})}}function AN(t){if(eP(t))return[t,t,t,t];if((0,ev.A)(t)){let e=t.length;if(1===e){let e=t[0];return[e,e,e,e]}if(2===e){let[e,i]=t;return[e,i,e,i]}if(3===e){let[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(r2(t)){let{top:e=0,right:i=0,bottom:s=0,left:r=0}=t;return[e,i,s,r]}return[0,0,0,0]}yg(AV,Ao);let AW=["points","cornerRadius",...nX];class AU extends n0{constructor(t){super(t),this.type="polygon",this.numberType=nM}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return rQ(this).polygon}
2updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ie.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;let{lineJoin:s=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){let{points:s=e.points}=t;return s.forEach(t=>{i.add(t.x,t.y)}),i}_interpolate(t,e,i,s,r){"points"===t&&(r.points=an(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,AW)}needUpdateTag(t){return super.needUpdateTag(t,AW)}toCustomPath(){let t=super.toCustomPath();if(t)return t;let e=this.attribute.points;return t=new sO,e.forEach((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)}),t.closePath(),t}clone(){return new AU(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return AU.NOWORK_ANIMATE_ATTR}}function AG(t){return new AU(t)}function AY(t,e,i,s){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+s);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+s)}}function A$(t,e){return Math.sqrt(t*t+e*e)}function AX(t,e,i,s,r){let a=e/i;return{x:t.x-s*a,y:t.y-r*a}}AU.NOWORK_ANIMATE_ATTR=nQ;var AK=function(t,e){return function(i,s){e(i,s,t)}};let Aq=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nM,this.builtinContributions=[ou,oQ],this.init(t)}drawShape(t,e,i,s,r,a,n,l){let o=rQ(t,null==a?void 0:a.theme).polygon,{points:h=o.points,cornerRadius:u=o.cornerRadius,x:d=o.x,y:c=o.y,closePath:p=o.closePath,fillStrokeOrder:g=o.fillStrokeOrder}=t.attribute,f=this.valid(t,o,n,l);if(!f)return;let{fVisible:m,sVisible:_,doFill:y,doStroke:v}=f;e.beginPath(),u<=0||(0,ev.A)(u)&&u.every(t=>0===t)?AY(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,r,a=!0){var n;if(e.length<3)return AY(t,e,i,s);let l=0,o=e.length-1;a||(l+=1,o-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let a=l;a<=o;a++){let l=e[0===a?o:(a-1)%e.length],h=e[a%e.length],u=e[(a+1)%e.length],d=h.x-l.x,c=h.y-l.y,p=h.x-u.x,g=h.y-u.y,f=Math.abs(Math.tan((Math.atan2(c,d)-Math.atan2(g,p))/2)),m=Array.isArray(r)?null!=(n=r[a%e.length])?n:0:r,_=m/f,y=A$(d,c),v=A$(p,g),b=Math.min(y,v);_>b&&(_=b,m=b*f);let x=AX(h,_,y,d,c),S=AX(h,_,v,p,g),A=2*h.x-x.x-S.x,k=2*h.y-x.y-S.y,M=A$(A,k),w=AX(h,A$(_,m),M,A,k),T=Math.atan2(x.y-w.y,x.x-w.x),C=Math.atan2(S.y-w.y,S.x-w.x),B=C-T;B<0&&(T=C,B=-B),B>Math.PI&&(B-=Math.PI),0===a?t.moveTo(x.x+i,x.y+s):t.lineTo(x.x+i,x.y+s),B&&t.arcTo(h.x+i,h.y+s,S.x+i,S.y+s,m),t.lineTo(S.x+i,S.y+s)}a||t.lineTo(e[o+1].x+i,e[o+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,u,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,y,v,m,_,o,r,n,l);let b=()=>{y&&(n?n(e,t.attribute,o):m&&(e.setCommonStyle(t,t.attribute,d-i,c-s,o),e.fill()))},x=()=>{v&&(l?l(e,t.attribute,o):_&&(e.setStrokeStyle(t,t.attribute,d-i,c-s,o),e.stroke()))};g?(x(),b()):(b(),x()),this.afterRenderStep(t,e,i,s,y,v,m,_,o,r,n,l)}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).polygon;this._draw(t,r,!1,i,s)}};Aq=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),AK(0,eU(eY)),AK(0,eG(os)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Aq);let AZ=!1,AJ=new eL(t=>{AZ||(AZ=!0,t(lu).to(Aq).inSingletonScope(),t(ln).toService(lu),t(os).toService(o_),eX(t,os))}),AQ=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=nM}};AQ=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tc=eU(lu),function(t,e){tc(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],AQ);let A0=!1,A1=new eL((t,e,i,s)=>{A0||(A0=!0,t(gk).to(AQ).inSingletonScope(),t(gC).toService(gk))}),A2=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=nM}};
2A2=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tp=eU(lu),function(t,e){tp(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],A2);let A3=!1,A5=new eL((t,e,i,s)=>{A3||(A3=!0,t(gp).to(A2).inSingletonScope(),t(gs).toService(gp))});function A4(){A4.__loaded||(A4.__loaded=!0,lF.RegisterGraphicCreator("polygon",AG),e7.load(AJ),e7.load(gi?A1:A5))}A4.__loaded=!1;let A8=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...nX];class A6 extends n0{constructor(t){super(t),this.type="arc",this.numberType=nm}isValid(){return super.isValid()&&this._isValid()}_isValid(){let{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){let t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute,{outerRadius:r=t.outerRadius,innerRadius:a=t.innerRadius}=this.attribute;if(r+=s,a-=i,0===e||"0%"===e)return 0;let n=Math.abs(r-a),l=t=>Math.min(ed(t,!0)?t:n*parseFloat(t)/100,n/2);if((0,ev.A)(e)){let t=e.map(t=>l(t)||0);return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return l(e)}getParsedAngle(){let t=this.getGraphicTheme(),{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute,{cap:s=t.cap}=this.attribute,r=i-e>=0?1:-1,a=i-e;if(i=(e=((t=0)=>{if(t<0)for(;t<-iu;)t+=iu;else if(t>0)for(;t>iu;)t-=iu;return t})(e))+a,s&&ic(a)<id-1e-12){let a=1,n=1;s.length&&(a=Number(s[0]),n=Number(s[1]));let{outerRadius:l=t.outerRadius,innerRadius:o=t.innerRadius}=this.attribute,{outerPadding:h=t.outerPadding,innerPadding:u=t.innerPadding}=this.attribute,d=Math.abs((l+=h)-(o-=u))/2,c=d/l;if(d>1e-12&&l>1e-12)return{startAngle:e-r*c*a,endAngle:i+r*c*n,sc:r*c*a,ec:r*c*n}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){let i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:a=i.padAngle}=this.attribute,{outerRadius:n=i.outerRadius,innerRadius:l=i.innerRadius}=this.attribute;n+=r,l-=s;let{padRadius:o=iv(n*n+l*l)}=this.attribute,h=ic(e-t),u=t,d=e,c=t,p=e,g=a/2,f=h,m=h;if(g>1e-12&&o>1e-12){let i=e>t?1:-1,s=ix(Number(o)/l*iy(g)),r=ix(Number(o)/n*iy(g));return(f-=2*s)>1e-12?(s*=i,c+=s,p-=s):(f=0,c=p=(t+e)/2),(m-=2*r)>1e-12?(r*=i,u+=r,d-=r):(m=0,u=d=(t+e)/2),{outerStartAngle:u,outerEndAngle:d,innerStartAngle:c,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:d,innerStartAngle:c,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return rQ(this).arc}
2updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));let{tb1:r,tb2:a}=ie.graphicService.updateTempAABBBounds(i);gJ(t,e,r),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2),this.setWidthHeightWithoutTransform(i);let{lineJoin:n=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:r=e.innerRadius}=t,{outerPadding:a=e.outerPadding,innerPadding:n=e.innerPadding}=t;return(s+=a)<(r-=n)&&(s=r),i.set(-s,-s,s,s),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:r=e.innerRadius}=t,{outerPadding:a=e.outerPadding,innerPadding:n=e.innerPadding}=t;if((s+=a)<(r-=n)){let t=s;s=r,r=t}let{endAngle:l=e.endAngle,startAngle:o=e.startAngle}=t;if(o>l){let t=o;o=l,l=t}return s<=1e-12?i.set(0,0,0,0):Math.abs(l-o)>id-1e-12?i.set(-s,-s,s,s):(ar(o,l,s,i),ar(o,l,r,i)),i}needUpdateTags(t){return super.needUpdateTags(t,A8)}needUpdateTag(t){return super.needUpdateTag(t,A8)}toCustomPath(){var t,e,i,s;let r=super.toCustomPath();if(r)return r;let a=this.attribute,{startAngle:n,endAngle:l}=this.getParsedAngle(),o=(null!=(t=a.innerRadius)?t:0)-(null!=(e=a.innerPadding)?e:0),h=(null!=(i=a.outerRadius)?i:0)-(null!=(s=a.outerPadding)?s:0),u=ic(l-n),d=l>n;if(h<o){let t=h;h=o,o=t}if(r=new sO,h<=1e-12)r.moveTo(0,0);else if(u>=id-1e-12)r.moveTo(0+h*ig(n),0+h*iy(n)),r.arc(0,0,h,n,l,!d),o>1e-12&&(r.moveTo(0+o*ig(l),0+o*iy(l)),r.arc(0,0,o,l,n,d));else{let t=h*ig(n),e=h*iy(n),i=o*ig(l),s=o*iy(l);r.moveTo(0+t,0+e),r.arc(0,0,h,n,l,!d),r.lineTo(0+i,0+s),r.arc(0,0,o,l,n,d),r.closePath()}return r}clone(){return new A6(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return A6.NOWORK_ANIMATE_ATTR}}function A9(t){return new A6(t)}A6.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},nQ);let A7=new class{constructor(){this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){let{outerBorder:c,innerBorder:p}=t.attribute,g=c&&!1!==c.visible,f=p&&!1!==p.visible;if(!g&&!f)return;let{innerPadding:m=o.innerPadding,outerPadding:_=o.outerPadding,startAngle:y=o.startAngle,endAngle:v=o.endAngle,opacity:b=o.opacity,x:x=o.x,y:S=o.y,scaleX:A=o.scaleX,scaleY:k=o.scaleY,keepStrokeScale:M=o.keepStrokeScale}=t.attribute,{innerRadius:w=o.innerRadius,outerRadius:T=o.outerRadius}=t.attribute;T+=_,w-=m;let C=(r,a)=>{let n=!(!r||!r.stroke),{distance:l=o[a].distance}=r,h=M?l:s4(e,l,e.dpr),u=l/T,c="outerBorder"===a?1:-1;if(t.setAttributes({outerRadius:T+c*h,innerRadius:w-c*h,startAngle:y-c*u,endAngle:v+c*u}),e.beginPath(),oF(t,e,i,s,T+c*h,w-c*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),d)d(e,r,o[a]);else if(n){let n=o[a].opacity;o[a].opacity=b,e.setStrokeStyle(t,r,(x-i)/A,(S-s)/k,o[a]),o[a].opacity=n,e.stroke()}};g&&C(c,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:T,innerRadius:w,startAngle:y,endAngle:v})}};var kt=function(t,e){return function(i,s){e(i,s,t)}};let ke=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nm,this.builtinContributions=[A7,ou,oQ],this.init(t)}drawArcTailCapPath(t,e,i,s,r,a,n,l){let o=l-n,h=t.getParsedAngle(),u=h.startAngle,d=h.endAngle;ic((d=l)-u);let c=d>u,p=!1;if(r<a){let t=r;r=a,a=t}let{outerDeltaAngle:g,xors:f,yors:m,xirs:_,yirs:y,limitedOcr:v,outerCornerRadiusStart:b,outerCornerRadiusEnd:x,maxOuterCornerRadius:S,xore:A,yore:k,xire:M,yire:w,limitedIcr:T,innerDeltaAngle:C,innerStartAngle:B,innerCornerRadiusStart:E,innerCornerRadiusEnd:P,maxInnerCornerRadius:O}=oD(t,u,d,a,r);if(v>1e-12){let t=i_(b,v),a=i_(x,v),n=oL(_,y,f,m,r,t,Number(c)),l=oL(A,k,M,w,r,a,Number(c));if(v<S&&t===a)e.moveTo(i+n.cx+n.x01,s+n.cy+n.y01),e.arc(i+n.cx,s+n.cy,v,ip(n.y01,n.x01),ip(l.y01,l.x01),!c);else{let t=d-o-.03,n=ip(l.y11,l.x11);e.arc(i,s,r,t,n,!c),a>0&&e.arc(i+l.cx,s+l.cy,a,ip(l.y11,l.x11),ip(l.y01,l.x01),!c)}}else e.moveTo(i+f,s+m);if(!(a>1e-12)||C<.001)e.lineTo(i+M,s+w),p=!0;else if(T>1e-12){let t=i_(E,T),r=i_(P,T),n=oL(M,w,A,k,a,-r,Number(c)),l=oL(f,m,_,y,a,-t,Number(c));if(e.lineTo(i+n.cx+n.x01,s+n.cy+n.y01),T<O&&t===r){let t=ip(l.y01,l.x01);
2e.arc(i+n.cx,s+n.cy,T,ip(n.y01,n.x01),t,!c)}else{r>0&&e.arc(i+n.cx,s+n.cy,r,ip(n.y01,n.x01),ip(n.y11,n.x11),!c);let t=ip(n.cy+n.y11,n.cx+n.x11),l=d-o-.03;e.arc(i,s,a,t,l,c)}}else e.lineTo(i+a*ig(B),s+a*iy(B));return p}drawShape(t,e,i,s,r,a,n,l,o){o=null!=o?o:rQ(t,null==a?void 0:a.theme).arc;let{fill:h=o.fill,stroke:u=o.stroke,x:d=o.x,y:c=o.y,fillStrokeOrder:p=o.fillStrokeOrder}=t.attribute,g=this.valid(t,o,n,l);if(!g)return;let{fVisible:f,sVisible:m,doFill:_,doStroke:y}=g,{outerPadding:v=o.outerPadding,innerPadding:b=o.innerPadding,cap:x=o.cap,forceShowCap:S=o.forceShowCap}=t.attribute,{outerRadius:A=o.outerRadius,innerRadius:k=o.innerRadius}=t.attribute;A+=v,k-=b;let M=0,w=(ey(x)&&x||x[0])&&"conical"===h.gradient;if(w){let{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ic(s-i)<id-1e-12&&(M=e||0,h.startAngle-=M,h.endAngle-=M)}let T=!1,{isFullStroke:C,stroke:B}=(t=>{var e;let i=!0;if(ey(t,!0)){for(let s=0;s<4;s++)r7[s]=t,i&&(i=!(null!=(e=r7[s])&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)r7[e]=!!t[e],i&&(i=!!r7[e]);else r7[0]=!1,r7[1]=!1,r7[2]=!1,r7[3]=!1;return{isFullStroke:i,stroke:r7}})(u);if((_||C)&&(e.beginPath(),oF(t,e,i,s,A,k),T=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o),this.beforeRenderStep(t,e,i,s,_,y,f,m,o,r,n,l),p?(this._runStroke(t,e,i,s,o,y,C,m,l),this._runFill(t,e,i,s,o,_,f,d,c,n)):(this._runFill(t,e,i,s,o,_,f,d,c,n),this._runStroke(t,e,i,s,o,y,C,m,l))),!C&&y&&(e.beginPath(),oF(t,e,i,s,A,k,B),T||this.beforeRenderStep(t,e,i,s,_,y,f,m,o,r,n,l),l?l(e,t.attribute,o):m&&(e.setStrokeStyle(t,t.attribute,i,s,o),e.stroke())),(ey(x)&&x||x[1])&&S){let{startAngle:a,endAngle:h}=t.getParsedAngle();if(ic(h-a)>=id-1e-12){e.beginPath();let a=Math.abs(A-k)/2/A,{endAngle:h=o.endAngle,fill:u=o.fill}=t.attribute;this.drawArcTailCapPath(t,e,i,s,A,k,h,h+a),T||this.beforeRenderStep(t,e,i,s,_,y,f,m,o,r,n,l),(()=>{if(_&&"conical"===u.gradient){let r=function(t,e){let{stops:i,startAngle:s,endAngle:r}=e;for(;t<0;)t+=id;for(;t>id;)t-=id;if(t<s||t>r)return i[0].color;let a,n,l=(t-s)/(r-s);for(let t=0;t<i.length;t++)if(i[t].offset>=l){a=i[t-1],n=i[t];break}return l=(l-a.offset)/(n.offset-a.offset),mV(a.color,n.color,l,!1)}(h,u);n||oO&&(e.setCommonStyle(t,t.attribute,i,s,o),e.fillStyle=r,e.fill())}})(),y&&(l||m&&(e.setStrokeStyle(t,t.attribute,i,s,o),e.stroke()))}}this.afterRenderStep(t,e,i,s,_,y,f,m,o,r,n,l),w&&(h.startAngle+=M,h.endAngle+=M)}_runFill(t,e,i,s,r,a,n,l,o,h){a&&(h?h(e,t.attribute,r):n&&(e.setCommonStyle(t,t.attribute,l-i,o-s,r),e.fill()))}_runStroke(t,e,i,s,r,a,n,l,o){a&&n&&(o?o(e,t.attribute,r):l&&(e.setStrokeStyle(t,t.attribute,i,s,r),e.stroke()))}draw(t,e,i,s){let r=rQ(t,null==s?void 0:s.theme).arc;this._draw(t,r,!1,i,s,r)}};ke=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),kt(0,eU(eY)),kt(0,eG(l6)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ke);let ki=!1,ks=new eL(t=>{ki||(ki=!0,t(ke).toSelf().inSingletonScope(),t(ls).to(ke).inSingletonScope(),t(ln).toService(ls),t(l6).toService(o_),eX(t,l6))}),kr=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=nm}};kr=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tg=eU(ls),function(t,e){tg(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],kr);let ka=!1,kn=new eL((t,e,i,s)=>{ka||(ka=!0,t(gf).to(kr).inSingletonScope(),t(gC).toService(gf))}),kl=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=nm}};
2kl=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tf=eU(ls),function(t,e){tf(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],kl);let ko=!1,kh=new eL((t,e,i,s)=>{ko||(ko=!0,t(gr).to(kl).inSingletonScope(),t(gs).toService(gr))});function ku(){ku.__loaded||(ku.__loaded=!0,lF.RegisterGraphicCreator("arc",A9),e7.load(ks),e7.load(gi?kn:kh))}function kd(){p1(),bZ(),A4(),gq()}function kc(){p1(),bZ(),ku(),gq()}ku.__loaded=!1,kd();class kp extends xN{getStartAngle(){return iR(this._startAngle)}getEndAngle(){return iR(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},kp.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();let{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:r=!0,multiSegment:a,mainSegmentIndex:n}=this.attribute;if(!r)return;this._computeLineAngle();let l=this._getMainSegmentPoints(),o=this._renderSymbol(t,l,"start"),h=this._renderSymbol(e,l,"end");if(this.startSymbol=o,this.endSymbol=h,a){let t=[...this.attribute.points];if(eP(n))t[n]=this._clipPoints(t[n]);else{let e=this._clipPoints(oC(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach((t,e)=>{var r,a;let n=lF.line(Object.assign(Object.assign({points:t},(0,ev.A)(i)?null!=(r=i[e])?r:i[i.length-1]:i),{fill:!1}));n.name=`${this.name}-line`,n.id=this._getNodeId("line"+e),pJ(null==s?void 0:s.line)||(n.states=(0,ev.A)(s.line)?null!=(a=s.line[e])?a:s.line[s.line.length-1]:s.line),this.add(n),this.lines.push(n)})}else{let t=lF.line;oS(i)[0].cornerRadius&&(t=lF.polygon);let e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},oS(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),pJ(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){let s;if(!e.length)return;let{autoRotate:r=!0}=t;if(t&&t.visible){let a,n,l=this.getStartAngle(),o=this.getEndAngle(),{state:h}=this.attribute,u=e[0],d=e[e.length-1],{refX:c=0,refY:p=0,refAngle:g=0,style:f,symbolType:m,size:_=12}=t;"start"===i?(a={x:u.x+(eP(l)?c*Math.cos(l)+p*Math.cos(l-Math.PI/2):0),y:u.y+(eP(l)?c*Math.sin(l)+p*Math.sin(l-Math.PI/2):0)},n=this._computeStartRotate(this._startAngle)):(a={x:d.x+(eP(o)?c*Math.cos(o)+p*Math.cos(o-Math.PI/2):0),y:d.y+(eP(o)?c*Math.sin(o)+p*Math.sin(o-Math.PI/2):0)},n=this._computeEndRotate(this._endAngle)),(s=lF.symbol(Object.assign(Object.assign(Object.assign({},a),{symbolType:m,size:_,angle:r?n+g:0,strokeBoundsBuffer:0}),f))).name=`${this.name}-${i}-symbol`,s.id=this._getNodeId(`${i}-symbol`),pJ(null==h?void 0:h.symbol)||(s.states=h.symbol),"start"===i?pJ(null==h?void 0:h.startSymbol)||(s.states=h.startSymbol):pJ(null==h?void 0:h.endSymbol)||(s.states=h.endSymbol),this.add(s)}return s}_getMainSegmentPoints(){let t;if(this._mainSegmentPoints)return this._mainSegmentPoints;let{points:e,multiSegment:i,mainSegmentIndex:s}=this.attribute;return t=i?eP(s)?e[s]:oC(e):e,this._mainSegmentPoints=t,t}_clipPoints(t){let{startSymbol:e={},endSymbol:i={}}=this.attribute,s=t;if(e.visible){let 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){let e=i.clip?i.size||10:0,r={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),r]}return s}_computeLineAngle(){let t=this._getMainSegmentPoints();if(t.length<=1)return;let e=t[0],i=t[1],s=t[t.length-2],r=t[t.length-1],a=[e.x-i.x,e.y-i.y],n=Math.atan2(a[1],a[0]),l=[r.x-s.x,r.y-s.y],o=Math.atan2(l[1],l[0]);this._startAngle=n,this._endAngle=o}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}function kg(){p1(),fh(),gq(),xL(),gD()}kp.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}}};var kf=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};kg();class km extends xN{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},km.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;let s,r,a;this.cacheStates();let{text:n="",textStyle:l={},shape:o={},panel:h={},space:u=4,minWidth:d,maxWidth:c,padding:p=4,visible:g,state:f,type:m,textAlwaysCenter:_,containerTextAlign:y}=this.attribute,v=AN(p),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group"),x,S=-v[3],A=-v[0],k=v[1]+v[3],M=v[0]+v[2],w=0,T=0,{visible:C}=o,B=kf(o,["visible"]);if(ey(C)){let t=(null==B?void 0:B.size)||10,e=ed(t)?t:Math.max(t[0],t[1]);x=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:C,x:e/2,y:e/2}),"symbol"),pJ(null==f?void 0:f.shape)||(x.states=f.shape),C&&(T=e+u)}if(k+=T,w+=T,function(t,e="type"){return"rich"===_L(t,e)}({text:n})||"rich"===m){let t=Object.assign(Object.assign(Object.assign({},_D(Object.assign({type:m,text:n},l))),l),{visible:(0,eA.A)(n)&&!1!==g,x:w,y:0});(0,eE.A)(t.lineHeight)&&(t.lineHeight=l.fontSize),r=(s=b.createOrUpdateChild("tag-text",t,"ric
2htext")).AABBBounds.width(),a=s.AABBBounds.height()}else{let i=Object.assign(Object.assign({text:r2(n)&&"type"in n&&"text"===n.type?n.text:n,visible:(0,eA.A)(n)&&!1!==g,lineHeight:null==l?void 0:l.fontSize},l),{x:w,y:0});(0,eE.A)(i.lineHeight)&&(i.lineHeight=l.fontSize),s=b.createOrUpdateChild("tag-text",i,"text");let o=_I(i.text,l,null==(e=null==(t=this.stage)?void 0:t.getTheme())?void 0:e.text);r=o.width,a=o.height}k+=r;let E=null!=(i=o.size)?i:10,P=ed(E)?E:Math.max(E[0],E[1]);M+=Math.max(a,o.visible?P:0);let{textAlign:O,textBaseline:R}=l;((0,eA.A)(d)||(0,eA.A)(c))&&((0,eA.A)(d)&&k<d&&(k=d),(0,eA.A)(c)&&k>c&&(k=c,s.setAttribute("maxLineWidth",c-v[1]-v[2]))),S=0,A=0;let I=0;"left"===O||"start"===O?I=1:"right"===O||"end"===O?I=-1:"center"===O&&(I=0),I?I<0?(S-=k,x&&x.setAttribute("x",(x.attribute.x||0)-r),b.setAttribute("x",-v[1]-T)):I>0&&b.setAttribute("x",v[3]):(S-=k/2,x&&x.setAttribute("x",(x.attribute.x||0)-r/2),b.setAttribute("x",-T/2));let L=(t,e)=>{"richtext"===s.type?s.setAttributes({x:t,textAlign:e,textConfig:oS(s.attribute.textConfig).map(t=>Object.assign(Object.assign({},t),{textAlign:e}))}):s.setAttributes({x:t,textAlign:e})};if((y?"center"===y:_)&&I){let t=k-v[1]-v[3],e=r+T,i=1===I?(t-e)/2+T+r/2:v[0]+T-(k/2+e/2-T)+r/2;if(L(i,"center"),x){let t=i-r/2-T+P/2;x.setAttributes({x:t})}}if(("left"===y||"start"===y)&&1!==I){let t=k-v[1]-v[3],e=0===I?-t/2+T/2:-k+v[3]+v[1]+T;L(e+T,"left"),x&&x.setAttributes({x:e+P/2})}if(("right"===y||"end"===y)&&-1!==I){let t=k-v[1]-v[3],e=0===I?t/2+T/2:t;if(L(e,"right"),x){let t=e-r-T+P/2;x.setAttributes({x:t})}}"middle"===R?(A-=M/2,x&&x.setAttribute("y",0)):"bottom"===R?(A-=M,x&&x.setAttribute("y",-a/2),b.setAttribute("y",-v[2])):"top"===R&&(b.setAttribute("y",v[0]),x&&x.setAttribute("y",a/2)),pJ(null==f?void 0:f.text)||(s.states=f.text);let{visible:D}=h,F=kf(h,["visible"]);if(g&&ey(D)){let t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},F),{visible:D&&!!n,width:k,height:M,x:S,y:A}),"rect");if(pJ(null==f?void 0:f.panel)||(t.states=f.panel),F.customShape){let e=F.customShape;t.pathProxy=t=>e(this,t,new sO)}this._bgRect=t}this._textShape=s,this._symbol=x,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:eB({},km.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,r,a,n,l,o,h,u,d,c,p;this._tagStates=null!=(e=null==(t=this.currentStates)?void 0:t.slice())?e:[],this._rectStates=null!=(r=null==(s=null==(i=this._bgRect)?void 0:i.currentStates)?void 0:s.slice())?r:[],this._symbolStates=null!=(l=null==(n=null==(a=this._symbol)?void 0:a.currentStates)?void 0:n.slice())?l:[],this._textStates=null!=(u=null==(h=null==(o=this._textShape)?void 0:o.currentStates)?void 0:h.slice())?u:[],this.clearStates(),null==(d=this._bgRect)||d.clearStates(),null==(c=this._symbol)||c.clearStates(),null==(p=this._textShape)||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null==(t=this._bgRect)||t.useStates(this._rectStates)),this._symbolStates.length&&(null==(e=this._symbol)||e.useStates(this._symbolStates)),this._textStates.length&&(null==(i=this._textShape)||i.useStates(this._textStates))}}km.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};let k_=(t,e,i)=>{let s=t.target;return s!==i&&s.name&&!pJ(s.states)?(s.addState(q.hover,!0),b5(e,t=>{t!==s&&t.name&&!pJ(t.states)&&t.addState(q.hoverReverse,!0)}),s):i},ky=(t,e,i)=>i?(b5(e,t=>{t.name&&!pJ(t.states)&&(t.removeState(q.hoverReverse),t.removeState(q.hover))}),null):i,kv=(t,e,i)=>{let s=t.target;return i===s&&s.hasState(q.selected)?(b5(e,t=>{t.name&&!pJ(t.states)&&(t.removeState(q.selectedReverse),t.removeState(q.selected))}),null):s.name&&!pJ(s.states)?(s.addState(q.selected,!0),b5(e,t=>{t!==s&&t.name&&!pJ(t.states)&&t.addState(q.selectedReverse,!0)}),s):i},kb={type:"default",duration:300,easing:"linear"};class kx extends xW{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=k_(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=ky(t,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=kv(t,this.axisContainer,this._lastSelect)}
2}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){let e=ek(this.attribute);e.scale=this.attribute.scale,this.attribute=t;let i=lF.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._prepare(),this._prevInnerView=this._innerView&&S7(this._innerView),this.removeAllChild(!0),this._innerView=lF.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent(),this.runAnimation()}_prepare(){this._prepareAnimate(kb)}_bindEvent(){if(this.attribute.disableTriggerEvent)return;let{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){let{title:e,label:i,tick:s,line:r,items:a}=this.attribute,n=lF.group({x:0,y:0,zIndex:1,pickable:!1});if(n.name=tB.axisContainer,n.id=this._getNodeId("container"),n.setMode(this.mode),this.axisContainer=n,t.add(n),r&&r.visible&&this.renderLine(n),a&&a.length&&(this.data=this._transformItems(a[0]),s&&s.visible&&this.renderTicks(n),i&&i.visible)){let t=lF.group({x:0,y:0,pickable:!1});t.name=tB.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,n.add(t),a.forEach((e,i)=>{let s=this.renderLabels(t,e,i),r=s.getChildren();this.beforeLabelsOverlap(r,e,s,i,a.length),this.handleLabelsOverlap(r,e,s,i,a.length),this.afterLabelsOverlap(r,e,s,i,a.length);let n=0,l=0,o="center",h="middle",u=0;r.forEach((t,e)=>{var i;let s=t.attribute,r=null!=(i=s.angle)?i:0,a=t.AABBBounds,d=a.width(),c=a.height();r&&(d=Math.abs(d*Math.cos(r)),c=Math.abs(c*Math.sin(r))),n=Math.max(n,d),l=Math.max(l,c),o=s.textAlign,h=s.textBaseline,0===e&&(u=s.x)}),this.axisLabelLayerSize[i]={width:n,height:l,labelPos:u,textAlign:o,textBaseline:h}})}e&&e.visible&&this.renderTitle(n)}renderTicks(t){let e=this.getTickLineItems(),i=lF.group({x:0,y:0,pickable:!1});i.name=tB.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach((t,s)=>{var r;let a=lF.line(Object.assign({},this._getTickLineAttribute("tick",t,s,e)));if(a.name=tB.tick,a.id=this._getNodeId(t.id),pJ(null==(r=this.attribute.tick)?void 0:r.state))a.states=_E;else{let t=this.data[s],e=eB({},_E,this.attribute.tick.state);Object.keys(e).forEach(i=>{(0,r3.A)(e[i])&&(e[i]=e[i](t.rawValue,s,t,this.data))}),a.states=e}i.add(a)}),this.tickLineItems=e;let{subTick:s}=this.attribute;if(s&&s.visible){let t=this.getSubTickLineItems();t.length&&t.forEach((t,r)=>{let a=lF.line(Object.assign({},this._getTickLineAttribute("subTick",t,r,e)));if(a.name=tB.subTick,a.id=this._getNodeId(`${r}`),pJ(s.state))a.states=_E;else{let i=eB({},_E,s.state);
2Object.keys(i).forEach(s=>{(0,r3.A)(i[s])&&(i[s]=i[s](t.value,r,t,e))}),a.states=i}i.add(a)}),this.subTickLineItems=t}}renderLabels(t,e,i){let{dataFilter:s}=this.attribute.label;s&&(0,r3.A)(s)&&(e=s(e,i));let r=this._transformItems(e),a=lF.group({x:0,y:0,pickable:!1});return a.name=`${tB.labelContainer}-layer-${i}`,a.id=this._getNodeId(`label-container-layer-${i}`),t.add(a),r.forEach((t,e)=>{var s;let n=_F(this._getLabelAttribute(t,e,r,i));if(n.name=tB.label,n.id=this._getNodeId(`layer${i}-label-${t.id}`),pJ(null==(s=this.attribute.label)?void 0:s.state))n.states=_E;else{let s=eB({},_E,this.attribute.label.state);Object.keys(s).forEach(a=>{(0,r3.A)(s[a])&&(s[a]=s[a](t,e,r,i))}),n.states=s}n.data=Object.assign(Object.assign({},t),{index:e,layer:i}),a.add(n)}),a}renderTitle(t){let e=new km(Object.assign({},this.getTitleAttribute()));e.name=tB.title,e.id=this._getNodeId("title"),t.add(e)}getVerticalCoord(t,e,i){return At(t,this.getVerticalVector(e,i,t))}getTickLineItems(){let{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:s,inside:r=!1,length:a,dataFilter:n}=t,l=1;return e.length>=2&&(l=e[1].value-e[0].value),(n&&(0,r3.A)(n)?n(e):e).forEach(t=>{let e=t.point,n=t.value;if(!s){let i=t.value-l/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),n=i}let o=this.getVerticalCoord(e,a,r);if("3d"===this.mode){let s=this.getVerticalVector(a,r,e),l=0,h=0;ic(s[0])>ic(s[1])?l=io/2*(o.x>e.x?1:-1):h=io/2*(o.y>e.y?-1:1),i.push({start:e,end:o,value:n,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:l,beta:h})}else i.push({start:e,end:o,value:n,id:`tick-${t.id}`})}),i}getSubTickLineItems(){let{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:r=2}=t,a=this.tickLineItems,n=a.length;if(n>=2)for(let t=0;t<n-1;t++){let n=a[t],l=a[t+1];for(let t=0;t<i;t++){let a=(t+1)/(i+1),o=(1-a)*n.value+a*l.value,h=this.getTickCoord(o),u=this.getVerticalCoord(h,r,s);e.push({start:h,end:u,value:o,id:`sub-tick-${o}`})}}return e}_getTickLineAttribute(t,e,i,s){let r=uQ(this.attribute,`${t}.style`),a=this.data[i];r=(0,r3.A)(r)?eB({},uQ(S5,`${t}.style`),"tick"===t?r(a.rawValue,i,a,this.data):r(e.value,i,e,s)):r;let{start:n,end:l,anchor:o,alpha:h,beta:u}=e;return Object.assign({points:[n,l],anchor:o,alpha:h,beta:u},r)}_getLabelAttribute(t,e,i,s){var r,a;let{space:n=4,inside:l=!1,formatMethod:o,type:h="text",text:u}=this.attribute.label,d=n,c=0;(null==(r=this.attribute.tick)?void 0:r.visible)&&this.attribute.tick.inside===l&&(c=this.attribute.tick.length||4),(null==(a=this.attribute.subTick)?void 0:a.visible)&&this.attribute.subTick.inside===l&&(c=Math.max(c,this.attribute.subTick.length||2)),d+=c;let p=this.getRelativeVector(t.point);s>0&&(0===p[1]?d+=(this.axisLabelLayerSize[s-1].height+uQ(this.attribute,"label.space",4))*s:d+=(this.axisLabelLayerSize[s-1].width+uQ(this.attribute,"label.space",4))*s);let g=this.getVerticalCoord(t.point,d,l),f=this.getVerticalVector(d||1,l,g),m=o?o(`${t.label}`,t,e,i,s):t.label,{style:_}=this.attribute.label;_=(0,r3.A)(_)?eB({},S5.label.style,_(t,e,i,s)):_,_=eB(this.getLabelAlign(f,l,_.angle),_),(0,r3.A)(_.text)&&(_.text=_.text({label:t.label,value:t.rawValue,index:t.index,layer:s}));let y=_.react;return(0,r3.A)(y)&&(y=y(t,e,i,s)),Object.assign(Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,f,m,_)),{text:null!=u?u:m,_originText:t.label,lineHeight:null==_?void 0:_.fontSize,type:h}),_),{react:y})}getLabelPosition(t,e,i,s){return t}_transformItems(t){let e=[];return t.forEach(t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!=(i=t.id)?i:t.label}))}),e}runAnimation(){let t=this.lastScale;if(this.attribute.scale){let t=this.attribute.scale;this.lastScale=t.clone(),this.lastScale.range([0,1])}if(this.attribute.animation&&this.applyAnimationState){let e=this.getInnerView(),i=this.getPrevInnerView();if(!i)return;let s=this._animationConfig;this._newElementAttrMap={},b5(e,e=>{var r;if("group"!==e.type&&e.id){let a=i[e.id];if(e.setFinalAttributes(e.attribute),a){a.release();let i=a.attribute,n=e.getFinalAttribute(),l=function(t,e){let i={};for(let s in e)s in t&&(0,ex.n)(t[s],e[s])||(i[s]=e[s]);return i}(i,n),o=Object.keys(l).length>0;if("opacity"in i&&n.opacity!==i.opacity&&(l.opacity=null!=(r=n.opacity)?r:1,o=!0),s.update&&o){this._newElementAttrMap[e.id]={state:"update",node:e,attrs:e.attribute};let i=a.attribute;e.setAttributes(i),e.applyAnimationState(["update"],[{name:"update",animation:Object.assign(Object.assign({selfOnly:!0},s.update),{type:"axisUpdate",customParameters:{config:s.update,diffAttrs:l,lastScale:t}})}])}}else s.enter&&(this._newElementAttrMap[e.id]={state:"enter",node:e,attrs:e.attribute},e.applyAnimationState(["enter"],[{name:"enter",animation:Object.assign(Object.assign({},s.enter),{type:"axisEnter",selfOnly:!0,customParameters:{config:s.enter,lastScale:t,getTickCoord:this.getTickCoord.bind(this)}})}]))}})}}release(){super.release(),this._prevInnerView=null,this._innerView=null}}let kS={parity:function(t){return t.filter((t,e)=>
2e%2?t.setAttribute("opacity",0):1)},greedy:function(t,e){let i;return t.filter((t,s)=>s&&Ar(i,t,e)?t.setAttribute("opacity",0):(i=t,1))}};function kA(t){let e;return(e=t.OBBBounds.empty()?t.AABBBounds:t.OBBBounds).width()>1&&e.height()>1}function kk(t,e,i,s,r=!1){if(i&&!t.attribute.opacity){let i=e.length;if(i>1){t.setAttribute("opacity",1);for(let t=0;t<i;t++){let a=r?e[i-1-t]:e[t];if(!s(a))break;a.setAttribute("opacity",0)}}}}function kM(t,e){let i;if(pJ(t))return;let s=t.filter(kA);if(pJ(s))return;s.forEach(t=>t.setAttribute("opacity",1)),i=s;let{method:r="parity",separation:a=0}=e,n=(0,r3.A)(r)?r:kS[r]||kS.parity;if(i.length>=3&&Aa(i,a)){do i=n(i,a);while(i.length>=3&&Aa(i,a))let t=(t,e,i=!0)=>i&&t<3||e,r=t(i.length,e.firstVisible,!1),l=t(i.length,e.lastVisible),o=s[0],h=oA(s);Ar(o,h,a)&&r&&l&&(h.setAttribute("opacity",0),l=!1),kk(o,i,r,t=>Ar(t,o,a)),kk(h,i,l,t=>Ar(t,h,a)||!(!r||t===o)&&Ar(t,o,a),!0)}s.forEach(t=>{t.setAttribute("visible",!!t.attribute.opacity)})}function kw(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 kT(t,e=0){let i,s=["center","left","left","left","center","right","right","right","left"],r=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(s=["center","right","right","right","center","left","left","left","right"],r=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);let a=(e=kw(e))/(.5*Math.PI);return{textAlign:s[i=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1],textBaseline:r[i]}}function kC(t,e=0){let i,s=["right","right","center","left","left","left","center","right","right"],r=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(s=["left","left","center","right","right","right","center","left","left"],r=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);let a=(e=kw(e))/(.5*Math.PI);return{textAlign:s[i=a===Math.floor(a)?2*Math.floor(a):2*Math.floor(a)+1],textBaseline:r[i]}}function kB(t,e,i){let s;return eP(e)&&(s=Math.abs(e-t)),eP(i)&&(s=eP(s)?Math.min(Math.abs(t-i),s):Math.abs(t-i)),s}var kE=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};Aj(),fh();class kP extends kx{constructor(t,e){var i;if(t.labelHoverOnAxis&&(t.labelHoverOnAxis.textStyle=Object.assign({},t.label.style,t.labelHoverOnAxis.textStyle),void 0===t.labelHoverOnAxis.space)){const{padding:e=2}=t.labelHoverOnAxis,s=AN(e),r="bottom"===t.orient?s[0]:"left"===t.orient?s[1]:"top"===t.orient?s[2]:s[3],a=(null!=(i=t.label.space)?i:kP.defaultAttributes.label.space)-r;t.labelHoverOnAxis.space=a}super((null==e?void 0:e.skipDefault)?t:eB({},kP.defaultAttributes,t),e),this.labelHoverOnAxisGroup=null}_renderInner(t){var e;if(this._breaks=null,this.attribute.breaks&&this.attribute.breaks.length){let t=[];for(let e=0;e<this.attribute.breaks.length;e++){let{range:i,breakSymbol:s,rawRange:r}=this.attribute.breaks[e];t.push({startPoint:this.getTickCoord(i[0]),endPoint:this.getTickCoord(i[1]),range:i,breakSymbol:s,rawRange:r})}this._breaks=t}super._renderInner(t),this._breaks&&this._breaks.length&&this._breaks.forEach((e,i)=>{let{startPoint:s,endPoint:r,breakSymbol:a,rawRange:n}=e;if(!1!==(null==a?void 0:a.visible)){let e=lF.group({zIndex:999});e.name=tB.axisBreak,e.id=this._getNodeId(`${tB.axisBreak}-${i}`),e.data=n;let l=function(t={}){var e,i;let{style:s={},angle:r=.5*Math.PI}=t,a=eB({},S4,s),n=null!=(e=a.size)?e:S4.size;return Object.assign(Object.assign({},a),{symbolType:null!=(i=a.symbolType)?i:`M ${-n/2} ${n*Math.sin(r)} L ${n/2} ${-n*Math.sin(r)}`,symbolSize:n})}(a),o=lF.symbol(Object.assign({x:s.x,y:s.y},l));o.name=tB.axisBreakSymbol;let h=lF.symbol(Object.assign({x:r.x,y:r.y},l));h.name=tB.axisBreakSymbol,e.add(o),e.add(h),t.add(e)}});let{panel:i}=this.attribute;if(i&&i.visible){let t=this.axisContainer,s=t.AABBBounds,r=lF.rect(Object.assign({x:s.x1,y:s.y1,width:s.width(),height:s.height()},i.style));r.name=tB.background,r.id=this._getNodeId("background"),r.states=eB({},SH,null!=(e=i.state)?e:{}),t.insertBefore(r,t.firstChild)}let{labelHoverOnAxis:s}=this.attribute;s&&s.visible&&this.renderLabelHoverOnAxis()}renderLabelHoverOnAxis(){let t=new km(Object.assign({},this.getLabelHoverOnAxisAttribute()));t.name=tB.title,t.id=this._getNodeId("hover-on-label"),this.labelHoverOnAxisGroup=t,this.axisContainer.add(t)}renderLine(t){let{start:e,end:i,line:s}=this.attribute,{startSymbol:r,endSymbol:a,style:n,state:l}=s,o=Object.assign({startSymbol:r,endSymbol:a,lineStyle:n},kE(s,["startSymbol","endSymbol","style","state"]));if(this._breaks&&this._breaks.length){let t=[],s=e;
2this._breaks.forEach(e=>{let{startPoint:i,endPoint:r}=e;t.push([s,i]),s=r}),t.push([s,i]),o.points=t,o.multiSegment=!0}else o.points=[e,i];pJ(l)||(o.state={line:eB({},SH,l),symbol:eB({},SH,l)});let h=new kp(o);h.name=tB.line,h.id=this._getNodeId("line"),t.add(h)}getTextAlign(t){let e="center";return rL(t[0],0)?rL(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;let s=this.attribute.title,{position:r="middle",space:a=4,textStyle:n={},autoRotate:l=!0,shape:o,background:h,state:u={},maxWidth:d}=s,c=kE(s,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]),p=.5;"start"===r?p=0:"end"===r&&(p=1);let{verticalFactor:g=1}=this.attribute,f=this.getTickCoord(p),m=this.getRelativeVector(),_=0;if((null==(t=this.attribute.label)?void 0:t.visible)&&!1===this.attribute.label.inside){let t=+uQ(this.attribute,"label.space",4);_+=t;let e=Object.keys(this.axisLabelLayerSize).length;if(0===m[1]){let i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?_+=i+(e-1)*t:_=0}else if(0===m[0])if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){let i=this.axisLabelLayerSize[0].labelPos,s=this.axisLabelsContainer.AABBBounds;_+=(1==-1*g?s.x2>i?Math.min(s.x2-i,s.width()):0:s.x1<i?Math.min(i-s.x1,s.width()):0)+(e-1)*t}else _=0;else Object.keys(this.axisLabelLayerSize).forEach((e,i)=>{_+=this.axisLabelLayerSize[e].width+(i>0?t:0)})}let y=0;(null==(e=this.attribute.tick)?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null==(i=this.attribute.subTick)?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));let v=y+_+a,b=this.getActualOffset(v),x=this.getVerticalCoord(f,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0}),A,k,{angle:M}=c;if(A="start"===r?"start":"end"===r?"end":"center",(0,eE.A)(M)&&l){M=S3(m,[1,0],!0);let{verticalFactor:t=1}=this.attribute;k=1==-1*t?"bottom":"top"}else A=this.getTextAlign(S),k=this.getTextBaseline(S,!1);let w=d;if((0,eE.A)(w)){let{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,s=Math.min(t||1/0,e||1/0);if(eP(s))if("bottom"===i||"top"===i)if(M!==Math.PI/2){let t=Math.abs(Math.cos(null!=M?M:0));w=t<1e-6?1/0:this.attribute.end.x/t}else w=s-b;else if(M&&0!==M){let t=Math.abs(Math.sin(M));w=t<1e-6?1/0:this.attribute.end.y/t}else w=s-b}let T=Object.assign(Object.assign(Object.assign({},x),c),{maxWidth:w,textStyle:Object.assign({textAlign:A,textBaseline:k},n),state:{text:eB({},SH,u.text),shape:eB({},SH,u.shape),panel:eB({},SH,u.background)}});return T.angle=M,o&&o.visible&&(T.shape=Object.assign({visible:!0},o.style),o.space&&(T.space=o.space)),h&&h.visible&&(T.panel=Object.assign({visible:!0},h.style)),T}getLabelHoverOnAxisAttribute(){var t,e;let{orient:i}=this.attribute,s=this.attribute.labelHoverOnAxis,{position:r=0,space:a=4,autoRotate:n=!0,textStyle:l={},background:o={},formatMethod:h,text:u="",maxWidth:d}=s,c=kE(s,["position","space","autoRotate","textStyle","background","formatMethod","text","maxWidth"]),p=this.getTickCoord(0);"bottom"===i||"top"===i?p.x=r:p.y=r;let g=0;(null==(t=this.attribute.tick)?void 0:t.visible)&&!1===this.attribute.tick.inside&&(g=this.attribute.tick.length||4),(null==(e=this.attribute.subTick)?void 0:e.visible)&&!1===this.attribute.subTick.inside&&(g=Math.max(g,this.attribute.subTick.length||2));let f=g+0+a,m=this.getVerticalCoord(p,f,!1),_=this.getVerticalVector(f,!1,{x:0,y:0}),y,{angle:v}=c,b="center";if((0,eE.A)(v)&&n){v=S3(this.getRelativeVector(),[1,0],!0);let{verticalFactor:t=1}=this.attribute;y=1==-1*t?"bottom":"top"}else{let{textAlign:t,textBaseline:e}=this.getLabelAlign(_,!1,l.angle);b=t,y=e}let x=h?h(u):u,S=Object.assign(Object.assign(Object.assign({},m),c),{maxWidth:d,textStyle:Object.assign({textAlign:b,textBaseline:y},l),text:x});return S.angle=v,o&&o.visible&&(S.panel=Object.assign(Object.assign({visible:!0},c.panel),o.style)),S}getTextBaseline(t,e){let i="middle",{verticalFactor:s=1}=this.attribute;return rL(t[1],0)?i=!rL(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1==(e?1:-1)*s?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){let s=this.attribute.orient;if(["top","bottom","right","left"].includes(s)||0===t[0]&&0===t[1]){if("top"===s||"bottom"===s)return kT(e?"bottom"===s?"top":"bottom":s,i);if("left"===s||"right"===s)return kC(e?"left"===s?"right":"left":s,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,s,r){var a,n,l,o;let{flush:h=!1}=this.attribute.label||{};if(h&&t.length){let{orient:e,start:i,end:s}=this.attribute,r="bottom"===e||"top"===e,h=t[0],u=oA(t),d=r?h.attribute.x>u.attribute.x:h.attribute.y<u.attribute.y;if(r){let t=d?u:h,e=d?h:u,r=i.x,l=s.x,o=t.AABBBounds.x1,c=e.AABBBounds.x2;o<r&&(t.attribute.angle?t.setAttributes({dx:(null!=(a=t.attribute.dx)?a:0)+r-o}):t.setAttributes({x:r,textAlign:"left"})),c>l&&(e.attribute.angle?e.setAttributes({dx:(null!=(n=e.attribute.dx)?n:0)+l-c}):e.setAttributes({x:l,textAlign:"right"}))}
2else{let t=d?u:h,e=d?h:u,r=t.AABBBounds.y2,a=e.AABBBounds.y1,n=i.y,c=s.y;a<n&&(e.attribute.angle?e.setAttributes({dy:(null!=(l=e.attribute.dy)?l:0)+n-a}):e.setAttributes({y:n,textBaseline:"top"})),r>c&&(t.attribute.angle?t.setAttributes({dy:(null!=(o=t.attribute.dy)?o:0)+c-r}):t.setAttributes({y:c,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,s,r){if(pJ(t))return;let{verticalLimitSize:a,label:n,orient:l}=this.attribute,o=this._getAxisLabelLimitLength(a,r),{layoutFunc:h,autoRotate:u,autoRotateAngle:d,autoLimit:c,limitEllipsis:p,autoHide:g,autoHideMethod:f,autoHideSeparation:m,lastVisible:_,firstVisible:y,autoWrap:v,overflowLimitLength:b}=n;if((0,r3.A)(h))h(t,e,s,this);else{if(u)!function(t,e){if(pJ(t))return;let{orient:i,labelRotateAngle:s=[0,45,90]}=e;if(0===s.length||t.some(t=>!!t.attribute.angle))return;let r=0,a=0,n=s;for(t.length>2&&("bottom"===i||"top"===i?Math.abs(t[1].attribute.x-t[0].attribute.x)<t[0].attribute.fontSize/2&&(n=[s[s.length-1]]):Math.abs(t[1].attribute.y-t[0].attribute.y)<t[0].attribute.fontSize/2&&(n=[s[s.length-1]])),n&&n.length>0&&(a=n.length);r<a;){var l,o;let e=n[r++];if(t.forEach(t=>{t.attribute.angle=iC(e)}),l=i,o=t,"bottom"!==l&&"top"!==l||function(t,e){e.forEach(e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},kT(t,e.attribute.angle)),{angle:kw(e.attribute.angle)}))})}(l,o),"left"!==l&&"right"!==l||function(t,e){e.forEach((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},kC(t,e.attribute.angle)),{angle:kw(e.attribute.angle)}))})}(l,o),o.forEach(t=>{let e;if(t.rotatedBounds||!t.attribute.angle)return;let i={x1:(e=t.AABBBounds).x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle},s=iY({x:t.attribute.x,y:t.attribute.y},i.angle,{x:i.centerX,y:i.centerY}),r=s.x-i.centerX,a=s.y-i.centerY;i.x1+=r,i.x2+=r,i.y1+=a,i.y2+=a,i.centerX+=r,i.centerY+=a,t.rotatedBounds=i}),!function(t){for(let e=1;e<t.length;e++)if(function(t,e){var i,s;return(null==(i=t.OBBBounds)?void 0:i.empty())||(null==(s=e.OBBBounds)?void 0:s.empty())?iW(t.AABBBounds,e.AABBBounds,!1)&&(!t.rotatedBounds||!e.rotatedBounds||iK(t.rotatedBounds,e.rotatedBounds,!0)):t.OBBBounds.intersects(e.OBBBounds)}(t[e-1],t[e]))return!0;return!1}(t))break}}(t,{labelRotateAngle:d,orient:l});else if(v){let e="left"===l||"right"===l?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){let{limitLength:i,axisLength:s,ellipsis:r="...",orient:a}=e;if(pJ(t)||!eP(i))return;let n=t[0].attribute.angle,l=S9(n),o=S6(n),h="top"===a||"bottom"===a,u=s/t.length;t.forEach((e,s)=>{var a,n,d,c,p;if(h){if(o&&Math.floor(e.AABBBounds.height())<=i)return;if(l){let i=kB(e.attribute.x,null==(a=t[s+1])?void 0:a.attribute.x,null==(n=t[s-1])?void 0:n.attribute.x);eP(i)&&(u=i_(u,i))}}else{if(o){let i=kB(e.attribute.y,null==(d=t[s+1])?void 0:d.attribute.y,null==(c=t[s-1])?void 0:c.attribute.y);eP(i)&&(u=i_(u,i))}if(l&&Math.floor(e.AABBBounds.width())<=i)return}let g=null,f=null;h?o?(g=i,f=u):(g=u,f=i):o?(g=u,f=i):(g=i,f=u),e.setAttributes({maxLineWidth:g,ellipsis:null!=(p=e.attribute.ellipsis)?p:r,whiteSpace:"normal",heightLimit:f})})}(t,{orient:l,limitLength:o,axisLength:e,ellipsis:p})}if(!v&&c&&eP(o)&&o>0){let e="left"===l||"right"===l,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),s=e?i/t.length:g||u?1/0:i/t.length;!function(t,e){var i;let{limitLength:s,verticalLimitLength:r,ellipsis:a="...",orient:n,axisLength:l}=e;if(pJ(t)||!eP(s))return;let o=eP(i=e.overflowLimitLength)?{left:i,right:i}:r2(i)?{left:i.left||0,right:i.right||0}:{left:0,right:0},h=t[0],u=h.attribute.angle,d=!(0,eE.A)(u),c=d?Math.cos(u):1,p=d?Math.sin(u):0,g=S9(u),f=S6(u),m="top"===n||"bottom"===n,_=h.attribute.direction,y=!g&&!f&&m&&(t.length<2||t.some(t=>Math.abs(t.AABBBounds.width()-h.AABBBounds.width())>=2))&&h.AABBBounds.width()>Math.abs(s/p);t.forEach(t=>{var e;if(m&&(f&&Math.floor(t.AABBBounds.height())<=s||g&&Math.floor(t.AABBBounds.width())<=r))return;
2if(!m&&("vertical"===_&&Math.floor(t.AABBBounds.height())<=r||"vertical"!==_&&(g&&Math.floor(t.AABBBounds.width())<=s||f&&Math.floor(t.AABBBounds.height())<=r)))return;let i=null;if(g||f)i=m?g?r:s:"vertical"===_||f?r:s;else if(m){let{x1:e,x2:r}=t.AABBBounds,a=p/c,n=Math.abs(s/p);i=y&&a>0&&e<=l+o.right&&s/a+e>l+o.right?Math.min((l-e+o.right)/Math.abs(c),n):y&&a<0&&r>=-o.left&&s/a+r<-o.left?Math.min((r+o.left)/Math.abs(c),n):n}else i=Math.abs(s/c);eP(t.attribute.maxLineWidth)&&(i=eP(i)?Math.min(t.attribute.maxLineWidth,i):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:i,ellipsis:null!=(e=t.attribute.ellipsis)?e:a})})}(t,{limitLength:o,verticalLimitLength:s,ellipsis:p,orient:l,axisLength:i,overflowLimitLength:b})}g&&kM(t,{orient:l,method:f,separation:m,lastVisible:_,firstVisible:y})}}afterLabelsOverlap(t,e,i,s,r){let{verticalLimitSize:a,orient:n}=this.attribute,l="bottom"===n||"top"===n,o=i.AABBBounds,h=l?o.height():o.width(),{verticalMinSize:u}=this.attribute;if(eP(u)&&(!eP(a)||u<=a)){let t,e;h=Math.max(h,this._getAxisLabelLimitLength(u,r)),"left"===n?(t=o.x2-h,e=o.y1):"right"===n?(t=o.x1,e=o.y1):"top"===n?(t=o.x1,e=o.y2-h):"bottom"===n&&(t=o.x1,e=o.y1);let s=lF.rect({x:t,y:e,width:l?o.width():h,height:l?h:o.height(),pickable:!1});s.name=tB.axisLabelBackground,s.id=this._getNodeId("axis-label-background"),i.insertBefore(s,i.firstChild)}if((0,eA.A)(this.attribute.label.containerAlign)){var d,c,p;let e;"left"===n?e=o.x2-h:"right"===n?e=o.x1:"top"===n?e=o.y2-h:"bottom"===n&&(e=o.y1),d=e,c=h,p=this.attribute.label.containerAlign,"left"===n||"right"===n?"left"===p?t.forEach(t=>{var e;t.setAttributes({dx:(null!=(e=t.attribute.dx)?e:0)+d-t.AABBBounds.x1})}):"right"===p?t.forEach(t=>{var e;t.setAttributes({dx:(null!=(e=t.attribute.dx)?e:0)+d+c-t.AABBBounds.x2})}):"center"===p&&t.forEach(t=>{var e;t.setAttributes({dx:(null!=(e=t.attribute.dx)?e:0)+d+c/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})}):"bottom"!==n&&"top"!==n||("top"===p?t.forEach(t=>{var e;t.setAttributes({dy:(null!=(e=t.attribute.dy)?e:0)+d-t.AABBBounds.y1})}):"bottom"===p?t.forEach(t=>{var e;t.setAttributes({dy:(null!=(e=t.attribute.dy)?e:0)+d+c-t.AABBBounds.y2})}):"middle"===p&&t.forEach(t=>{var e;t.setAttributes({dy:(null!=(e=t.attribute.dy)?e:0)+d+c/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})}))}}_getAxisLabelLimitLength(t,e){var i,s,r,a,n;let{label:l,title:o,line:h,tick:u}=this.attribute,d=null!=(i=l.space)?i:4,c=t,p=0,g=0,f=h&&h.visible?null!=(s=h.style.lineWidth)?s:1:0,m=u&&u.visible?null!=(r=u.length)?r:4:0;if(o&&o.visible&&"string"==typeof o.text){p=_I(o.text,o.textStyle,null==(n=null==(a=this.stage)?void 0:a.getTheme())?void 0:n.text).height;let t=AN(o.padding);g=o.space+t[0]+t[2]}return c&&(c=(c-d-g-p-f-m)/e),c}showLabelHoverOnAxis(t,e,i=!0){if(this.attribute.labelHoverOnAxis){let s=this.axisContainer.AABBBounds,r=s.width(),a=s.height(),n=s.x1,l=s.y1,o=s.x2,h=s.y2;if(this.labelHoverOnAxisGroup){let{formatMethod:i}=this.attribute.labelHoverOnAxis,s=i?i(e):e;this.labelHoverOnAxisGroup.setAttribute("text",s),this.labelHoverOnAxisGroup.setAttribute("visible",!0),this.labelHoverOnAxisGroup.setAttribute("visibleAll",!0),"left"===this.attribute.orient||"right"===this.attribute.orient?this.labelHoverOnAxisGroup.setAttributes({y:t}):this.labelHoverOnAxisGroup.setAttributes({x:t})}else this.attribute.labelHoverOnAxis.visible=!0,this.attribute.labelHoverOnAxis.position=t,this.attribute.labelHoverOnAxis.text=e,this.renderLabelHoverOnAxis();if(i){let i=this.axisContainer.AABBBounds,s=i.width()-r,u=i.height()-a;s>0&&("top"===this.attribute.orient||"bottom"===this.attribute.orient)&&(i.x1<n?this.showLabelHoverOnAxis(t+s,e,!1):i.x2>o&&this.showLabelHoverOnAxis(t-s,e,!1)),u>0&&("left"===this.attribute.orient||"right"===this.attribute.orient)&&(i.y1<l?this.showLabelHoverOnAxis(t+u,e,!1):i.y2>h&&this.showLabelHoverOnAxis(t-u,e,!1))}}}hideLabelHoverOnAxis(){this.attribute.labelHoverOnAxis&&this.labelHoverOnAxisGroup&&this.labelHoverOnAxisGroup.setAttributes({visible:!1,visibleAll:!1})}getActualOffset(t){let e=this.attribute.orient;return"left"===e||"right"===e?this.attribute.width?this.attribute.width:(this.attribute.maxWidth&&(t=Math.min(t,this.attribute.maxWidth)),this.attribute.minWidth&&(t=Math.max(t,this.attribute.minWidth)),t):t}release(){super.release(),this._breaks=null}}kP.defaultAttributes=S5,yg(kP,Ao);let kO={domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},kR={domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGri
2dColor"},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}}},kI={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}}},kL={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}}};class kD extends SY{constructor(){super(...arguments),this.type=hc.cartesianBandAxis,this._scale=new mM}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){let t=super.updateScaleRange();return this.updateGroupScaleRange(),t}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}axisHelper(){let t=(t=0)=>this._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(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,SZ),t}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){if(this._scale){let{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)){let i=f1(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:r=0}=this._spec,{gap:a,extend:n=0}=null!=(t=this._spec.bandSizeExtend)?t:{};r=Math.min(r,this._scales.length-1);for(let t=r;t>0;t--){let l=this._scales[t],o=l.domain(),h=l.paddingInner(),u=l.paddingOuter(),d=e=>{let i=t===r?n:0;return(0,eE.A)(a)||t<r?f1(o.length,e,h,u)+i:(e+((0,eS.A)(a)?e*(Number(a.substring(0,a.length-1))/100):a))*o.length/(this._scales[t-1].paddingInner()+1)+i};(0,eA.A)(e)&&(e=d(e)),(0,eA.A)(i)&&(i=d(i)),(0,eA.A)(s)&&(s=d(s))}return{bandSize:e,maxBandSize:i,minBandSize:s}}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(null==e?void 0:e.showAllGroupLayers)===(null==t?void 0:t.showAllGroupLayers)&&(0,ex.n)(null==e?void 0:e.layers,null==t?void 0:t.layers)||(i.reMake=!0),i}reInit(t){super.reInit(),null==this||this._updateData()}}kD.type=hc.cartesianBandAxis,kD.specKey="axes",kD.builtInTheme={axis:kR,axisBand:kO,axisX:kI,axisY:kL},yg(kD,S$);let kF=()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),SW(),uP.registerComponent(kD.type,kD,!1)};function kz(t){let e=[];for(let i=0;i<t.length;i++){let s=t[i];0!==i&&s[0]===e[e.length-1]||e.push(s[0]),e.push(s[1])}return e}function kH(t,e,i){let s=t.indexOf(e),r=t.indexOf(i);s>=0&&r>=0&&s<r&&(t.splice(s,1),t.splice(r,0,e))}let kj=(t,e)=>t-e,kV=Math.sqrt(50),kN=Math.sqrt(10),kW=Math.sqrt(2);class kU{constructor(){this._extend={},this._rawDomain=[],this.niceLabelFormatter=null}getRawDomain(){return this._rawDomain}setExtraAttrFromSpec(){(0,eA.A)(this._spec.nice)&&(this._nice=this._spec.nice),(0,eA.A)(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=SM(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;if(!this._nice)return!1;let e=5,i=this._spec.tick||{};if(eP(i.forceTickCount))e=i.forceTickCount;else if((0,r3.A)(i.tickCount)){let t=this._scale.range(),s=Math.abs(oA(t)-t[0]);1===s&&this._option&&(s=x7(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({axisLe
2ngth:s,labelStyle:this._spec.label&&this._spec.label.style})}else e=eP(i.tickCount)?i.tickCount:5;"accurateFirst"===this._spec.niceType&&(e=Math.max(5,e));let{min:s,max:r}=null!=(t=this._domain)?t:{};return(0,eE.A)(s)&&(0,eE.A)(r)&&(0,eE.A)(this._softMaxValue)&&(0,eE.A)(this._softMinValue)?this._scale.nice(e):((0,eA.A)(s)||(0,eA.A)(this._softMinValue))&&(0,eE.A)(r)&&(0,eE.A)(this._softMaxValue)?this._scale.niceMax(e):!(!(0,eE.A)(s)||!(0,eE.A)(this._softMinValue)||!(0,eA.A)(r)&&!(0,eA.A)(this._softMaxValue))&&this._scale.niceMin(e)}setLogScaleNice(){var t;if(!this._nice)return!1;let{min:e,max:i}=null!=(t=this._domain)?t:{};return(0,eE.A)(e)&&(0,eE.A)(i)&&(0,eE.A)(this._softMaxValue)&&(0,eE.A)(this._softMinValue)?this._scale.nice():((0,eA.A)(e)||(0,eA.A)(this._softMinValue))&&(0,eE.A)(i)&&(0,eE.A)(this._softMaxValue)?this._scale.niceMax():!(!(0,eE.A)(e)||!(0,eE.A)(this._softMinValue)||!(0,eA.A)(i)&&!(0,eA.A)(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=[];
2if(t.length){let a=this._spec.breaks&&this._spec.breaks.length,n,l,o=[];if(t.forEach(t=>{let{min:e,max:i}=t;n=void 0===n?e:Math.min(n,e),l=void 0===l?i:Math.max(l,i),a&&(o=o.concat(t.values))}),a){let t=[],a=[],h=(0,eE.A)(this._domain.max)?l:this._domain.max;for(let e=0;e<this._spec.breaks.length;e++){let{range:i}=this._spec.breaks[e];i[0]<=i[1]&&i[1]<=h&&(t.push(i),a.push(this._spec.breaks[e]))}if(t.sort((t,e)=>t[0]-e[0]),t.length){var i,s,r;let n,l,h,{domain:u,scope:d}=(i=o,s=kz(t),r=this._spec.breaks[0].scopeType,i.sort(kj),s.sort(kj),{domain:(n=i[0],l=i[i.length-1],0===(h=s.filter(t=>t>n&&t<l)).length?[[n,l]]:h.reduce((t,e,i)=>(t.push([e,h.length===i+1?l:h[i+1]]),t),[[n,h[0]]])),scope:function(t,e,i="count"){let s=((t,e)=>{let i=[{count:0,sub:[],max:e[0],min:e[0]}],s=0,r=0;for(;s<e.length;)t[r]<=e[s]?(i[s].count+=1,i[s].sub.push(t[r]),r+=1):i[s+=1]={count:0,sub:[],max:e[s],min:e[s]};i.forEach(t=>{t.count&&(t.min=Math.min.apply(null,t.sub))});let a=t.slice(r);return i[s]={count:a.length,sub:a,min:e[e.length-1],max:Math.max.apply(null,a)},i})(t,e),r="count"===i?t.length:s.reduce((t,e,i)=>e.count>0?t+e.max-e.min:t,0),a=[],n=0,l=0;return s.forEach((t,e)=>{if(0===r)a.push([0,e/s.length-1]);else{let o="count"===i?t.count:t.max-t.min,h=a[l-1]?a[l-1][1]:0,u=e===s.length-1?1:Math.min((n+o)/r,1);(h!==u||0!==h&&1!==h)&&(l+=1,a.push([h,u]),n+=o)}}),a}(i,s,r)});e=kz(u),this._break={domain:u,scope:d,breakDomains:t,breaks:a}}else e=[n,l]}else e=[n,l]}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=oA(t);e===i&&(0===i?i=1:i>0?e=0:i<0&&(i=0)),(0,eA.A)(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),(0,eA.A)(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){let{min:e,max:i}=SM(this._spec);if((0,eA.A)(e)||(0,eA.A)(i)||"linear"!==this._spec.type)return t;if(1e-12>=Math.abs(oM(t)-ok(t))){let e=t[0],i=e>=0?1:-1;if((e=Math.abs(e))<1)t[0]=0,t[t.length-1]=1;else{let i=e/5,s=Math.floor(Math.log(i)/Math.LN10),r=i/Math.pow(10,s);i=(r>=kV?10:r>=kN?5:r>=kW?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(oA(t),0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;let 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(dj.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e,i=t.length-1,s=t[0]-t[i]>0,r=s?i:0,a=s?0:i;for(let i in this._extend)(e=this._extend[i])>t[a]&&(t[a]=e),e<t[r]&&(t[r]=e)}getDomainSpec(){return this._domain}setDomainMinMax(t){if(!this._domain)return;let{min:e,max:i}=this._domain;(0,eA.A)(e)&&(t[0]=e),(0,eA.A)(i)&&(t[t.length-1]=i)}setSoftDomainMinMax(t){let{softMin:e,softMax:i}=this._spec;if((0,eA.A)(e)){let i=(0,r3.A)(e)?e(t):e;(0,eE.A)(i)&&(i=t[0]),i<=t[0]&&(t[0]=i,this._softMinValue=i)}if((0,eA.A)(i)){let e=(0,r3.A)(i)?i(t):i;(0,eE.A)(e)&&(e=oA(t)),e>=oA(t)&&(t[t.length-1]=e),this._softMaxValue=e}}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){var t;if(!this.isSeriesDataEnable())return;(null==(t=this._rawDomain)?void 0:t.length)||!this._scale||this._updateRawDomain();let e=this.collectData(),i=this.computeLinearDomain(e);this.updateScaleDomainByModel(i)}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._refreshVisibilityByData(),this.event.emit(dj.scaleDomainUpdate,{model:this}),this.event.emit(dj.scaleUpdate,{model:this,value:"domain"})}getDomainAfterSpec(){return this._domainAfterSpec}_updateNiceLabelFormatter(t){let e=Math.pow(10,Math.max(-Math.floor(Math.log10(Math.abs(oA(t)-t[0]))),0)+2);this.niceLabelFormatter=t=>eP(+t)?Math.round(t*e)/e:t}_updateRawDomain(){let t=this.collectData(0,!0),e=this.computeLinearDomain(t);this._rawDomain=e,this.event.emit(dj.scaleRawDomainUpdate,{model:this})}_clearRawDomain(){this._rawDomain=[]}}function kG(t,e,i,s){let r,{breakData:a}=t;if(a&&a()){let{breakDomains:t}=a(),n=e.domain();r=[];for(let e=0;e<n.length-1;
2e++)s(i,[n[e],n[e+1]]).forEach(e=>{t.some(t=>e>=t[0]&&e<=t[1])||r.push(e)});e.domain(n)}else r=s(i);return r}function kY(t,e,i,s,r=!1){if(i&&!e.includes(t)){let i=e.length;if(i>1){r?e.push(t):e.unshift(t);for(let t=0;t<i;t++){let a=r?i-1-t:t;if(!s(e[a]))break;e.splice(a,1),t--,i--}}}}let k$=(t,e)=>{var i,s,r,a,n,l;let o;if(!fI(t.type))return Sc(t.domain());let h=t.range(),u=Math.abs(h[h.length-1]-h[0]);if(u<2)return Sc([t.domain()[0]]);let{tickCount:d,forceTickCount:c,tickStep:p,noDecimals:g=!1,labelStyle:f,breakData:m}=e;if((0,eA.A)(p))n=t.stepTicks(p),o=(l=m&&m()?m().breakDomains:null)&&l.length?n.filter(t=>l.every(e=>t<e[0]||t>e[1])):n;else if((0,eA.A)(c))o=kG(e,t,c,(e,i)=>i&&i.length?t.domain(i,!0).forceTicks(e):t.forceTicks(e));else if("d3"===e.tickMode)o=kG(e,t,null!=(i=(0,r3.A)(d)?d({axisLength:u,labelStyle:f}):d)?i:5,(e,i)=>i&&i.length?t.domain(i,!0).d3Ticks(e,{noDecimals:g}):t.d3Ticks(e,{noDecimals:g}));else{let i=null!=(s=(0,r3.A)(d)?d({axisLength:u,labelStyle:f}):d)?s:5,r=(0,r3.A)(e.tickMode)?e.tickMode:void 0;o=kG(e,t,i,(e,i)=>i&&i.length?t.domain(i,!0).ticks(e,{noDecimals:g,customTicks:r}):t.ticks(e,{noDecimals:g,customTicks:r}))}let _=t.domain();if(e.labelFirstVisible&&_[0]!==o[0]&&!o.includes(_[0])&&o.unshift(_[0]),e.labelLastVisible&&_[_.length-1]!==o[o.length-1]&&!o.includes(_[_.length-1])&&o.push(_[_.length-1]),e.sampling&&o.length>1&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){let i,{labelGap:s=4,labelFlush:n}=e;if(6*o.length>u){let s=[],a=Math.floor(6*o.length/u);o.forEach((t,e)=>{e%a!=0&&e!==o.length-1||s.push(t)}),i=null==(r=Sf(t,s,e))?void 0:r.map((t,e)=>({AABBBounds:t,value:s[e]}))}else i=null==(a=Sf(t,o,e))?void 0:a.map((t,e)=>({AABBBounds:t,value:o[e]}));if(i){let t=i[0],r=oA(i),a=m&&m()?kX.greedy:kX.parity;for(;i.length>=3&&Aa(i,s);)i=a(i,s);let l=e.labelFirstVisible,h=e.labelLastVisible;Ar(t,r,s)&&i.includes(r)&&i.length>1&&l&&h&&(i.splice(i.indexOf(r),1),h=!1),kY(t,i,l,e=>Ar(e,t,s)),kY(r,i,h,e=>Ar(e,r,s)||!(!l||e===t)&&Ar(e,t,s),!0);let u=i.map(t=>t.value);u.length<3&&n&&(u.length>1&&u.pop(),oA(u)!==oA(o)&&u.push(oA(o))),o=u}}return Sc(o)},kX={parity:function(t){return t.filter((t,e)=>e%2==0)},greedy:function(t,e){let i;return t.filter((t,s)=>(!s||!Ar(i,t,e))&&(i=t,!0))}},kK={domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}};class kq extends SY{constructor(){super(...arguments),this.type=hc.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new mb}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setExtraAttrFromSpec();let i=null==(e=null==(t=this._tickData)?void 0:t[0])?void 0:e.getDataView().transformsArr.find(t=>t.type===this.registerTicksTransform());i&&(i.options=this._tickTransformOption())}initScales(){var t,e;super.initScales();let i=[0,1];(0,eA.A)(null==(t=this._domain)?void 0:t.min)&&(i[0]=this._domain.min),(0,eA.A)(null==(e=this._domain)?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.length)?()=>this._break:null})}_getUpdateAttribute(t){var e,i;let s=super._getUpdateAttribute(t);if(!Se(this._orient)&&(null==(i=null==(e=this._break)?void 0:e.breaks)?void 0:i.length)){let{width:t,height:e}=this.getLayoutRect(),i=x7(this._orient),r=i?t:e;s.breaks=this._break.breaks.map(t=>{let e,{range:s,breakSymbol:a,gap:n=6}=t,l=this.valueToPosition((s[0]+s[1])/2)/r;e=hW(n)?Number(n.substring(0,n.length-1))/100:n/r;let o=eP(null==a?void 0:a.angle)?a.angle:i?60:15;return{range:[l-e/2,l+e/2],breakSymbol:Object.assign(Object.assign({visible:!0},a),{angle:o*Math.PI/180}),rawRange:s}})}return s}getNewScaleRange(){var t,e;let i=super.getNewScaleRange();return(null==(t=this._spec.breaks)?void 0:t.length)&&(null==(e=this._break)?void 0:e.scope)&&(i=kz(this._break.scope).map(t=>i[0]+(oA(i)-i[0])*t)),i}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){let t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}registerTicksTransform(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,k$),t}}kq.type=hc.cartesianLinearAxis,kq.specKey="axes",kq.builtInTheme={axis:kR,axisLinear:kK,axisX:kI,axisY:kL},yg(kq,kU);let kZ=()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),SW(),uP.registerComponent(kq.type,kq)},kJ=`${px.H}_hide_`;function kQ(t,e){t.context.finalAttrs&&(t.context.finalAttrs.visible=e)}let k0=(t,e)=>{if(!e||0===e.length)return e;let{direction:i,delta:s,deltaMul:r=1,groupBy:a}=t,n=e=>{let a,n,l,o,h,u,d,c,p,g,f,m;e.forEach(t=>{t[kJ]&&(kQ(t,!0),t[kJ]=!1)});let _=t.sort?e.slice().sort((t,e)=>t.context.finalAttrs.x-e.context.finalAttrs.x):e;0===i?(a=-1/0,n=0,l=(0,eE.A)(s),o=s,_.forEach(t=>{if(!1===t.context.finalAttrs.visible)return;let e=t.context.finalAttrs.size/2,{x:i,y:s}=t.context.finalAttrs;l&&(o=(e+n)*r),(-1/0-i)**2+(a-s)**2<(o+n+e)**2?t.context.finalAttrs.forceShow||(t[kJ]=!0,kQ(t,!1)):a=s,n=e})):1===i?(h=-1/0,u=0,d=(0,eE.A)(s),c=s,_.forEach(t=>{if(!1===t.context.finalAttrs.visible)return;let e=t.context.finalAttrs.size/2,i=t.context.finalAttrs.x;d&&(c=(e+u)*r),Math.abs(i-h)<c+u+e?t.context.finalAttrs.forceShow||(t[kJ]=!0,kQ(t,!1)):h=i,u=e})):(p=-1/0,g=0,f=(0,eE.A)(s),m=s,_.forEach(t=>{if(!1===t.context.finalAttrs.visible)return;let e=t.context.finalAttrs.size/2,i=t.context.finalAttrs.y;f&&(m=(e+g)*r),Math.abs(i-p)<m+g+e?t.context.finalAttrs.forceShow||(t[kJ]=!0,kQ(t,!1)):p=i,g=e}))};if(a){let t=e.reduce((t,e)=>{var i,s;let r=null==(s=null==(i=e.context.data)?void 0:i[0])?void 0:s[a];return t[r]?t[r].push(e):t[r]=[e],t},{});
2Object.keys(t).forEach(e=>{n(t[e])})}else n(e);return e},k1=()=>{uP.registerGrammarTransform("symbolOverlap",{transform:k0,runType:"afterEncode"})},k2={min:oM,max:ok,average:vW,sum:vN};function k3(t,e,i,s){let r=Math.floor(e.length/t),a=[],n=e.length,l,o,h,u=0,d=0;a[d++]=u;for(let t=1;t<n-1;t+=r){let i=Math.min(t+r,n-1),c=Math.min(t+2*r,n),p=(c+i)/2,g=0;for(let t=i;t<c;t++){let i=e[t][s];Number.isNaN(i)||(g+=i)}g/=c-i;let f=t,m=Math.min(t+r,n),_=t-1,y=e[u][s];l=-1,h=f;for(let t=f;t<m;t++){let i=e[t][s];Number.isNaN(s)||(o=Math.abs((_-p)*(i-y)-(_-t)*(g-y)))>l&&(l=o,h=t)}a[d++]=h,u=h}return a[d-1]!==n-1&&(a[d++]=n-1),a.map(t=>i?e[t].i:t)}function k5(t,e,i,s,r){let a=Math.floor(e.length/t),n=[],l=e.length,o=0,h=[];n.push(o),e[o][r]=e[o][r];for(let t=1;t<l-1;t+=a){a>l-t&&(a=l-t,h.length=a),h=[];for(let i=0;i<a;i++)h.push(e[t+i][r]);let i=k2[s](h);e[o=Math.min(Math.round(t+h.length/2)||0,l-1)][r]=i,n.push(o)}return n.map(t=>i?e[t].i:t)}function k4(t,e,i,s){return k5(t,e,i,"min",s)}function k8(t,e,i,s){return k5(t,e,i,"max",s)}function k6(t,e,i,s){return k5(t,e,i,"average",s)}function k9(t,e,i,s){return k5(t,e,i,"sum",s)}let k7=(t,e)=>{let i=(0,r3.A)(t.size)?t.size():t.size,s=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),(i*=s)<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);let{mode:r,yfield:a,groupBy:n}=t,l=null!=a?a:"y",o=k3;if("min"===r?o=k4:"max"===r?o=k8:"average"===r?o=k6:"sum"===r&&(o=k9),e.length){let t={};if(n){for(let i=0,s=e.length;i<s;i++){let s=e[i],r=s[n];t[r]||(t[r]=[]),t[r].push({[l]:s[l],i:i})}let s=[];return Object.keys(t).forEach(r=>{let a=t[r];if(a.length<=i){let t=a.map(t=>t.i);s=s.concat(t)}else{let t=o(i,a,!0,l);s=s.concat(t),a.forEach(t=>e[t.i][l]=t[l])}}),s.sort((t,e)=>t-e),s.map(t=>e[t])}return o(i,e,!1,l).map(t=>e[t])}return[]},Mt=()=>{uP.registerGrammarTransform("dataSampling",{transform:k7})};class Me extends bP{constructor(){super(...arguments),this.type=dD.line,this.transformerConstructor=x4,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;let e=null!=(t=this._spec.seriesMark)?t:"line";this.initLineMark("line"===e),this.initSymbolMark("point"===e)}initTooltip(){super.initTooltip();let{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;let r={direction:this.direction},a=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;if(this._lineMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("line"))?void 0:i(r,a),bx("line",this._spec,this._markAttributeContext))),this._symbolMark){let t=bE(this);this._symbolMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("scaleInOut"))?void 0:s(),bx("point",this._spec,this._markAttributeContext),t))}}onLayoutEnd(){super.onLayoutEnd(),this.reCompileSampling()}getSeriesStyle(t){var e;let i="point"!==(null==(e=this._spec)?void 0:e.seriesMark);return e=>{var s,r;return i&&"fill"===e&&(e="stroke"),null!=(r=null==(s=this._seriesMark)?void 0:s.getAttribute(e,t))?r:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}Me.type=dD.line,Me.mark=bL,Me.builtInTheme={line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}}},Me.transformerConstructor=x4,yg(Me,bI);let Mi=(t,e)=>{var i;let{regionId:s,regionIndex:r}=t.spec;if((0,eA.A)(s)){let t=oS(s);return null==(i=e.region)?void 0:i.filter(({spec:e})=>t.includes(e.id))}if((0,eA.A)(r))return oS(r).map(t=>{var i;return null==(i=e.region)?void 0:i[t]}).filter(eA.A)};class Ms{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={}
2),(0,eA.A)(t.stackInverse)&&t.region.forEach(e=>{(0,eA.A)(e.stackInverse)||(e.stackInverse=t.stackInverse)}),(0,eA.A)(t.stackSort)&&t.region.forEach(e=>{(0,eA.A)(e.stackSort)||(e.stackSort=t.stackSort)})}generateTransform(t,e){return(i,s,r)=>{let{spec:a,specPath:n,specInfoPath:l,type:o}=s,h=new i.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})),u=h.transformSpec(a,t,r),d=Object.assign(Object.assign({},s),u);e?d.theme=h.getTheme(a,t):f_(t,n,u.spec),f_(r,null!=l?l:n,d)}}transformModelSpec(t){return this.createSpecInfo(t,this.generateTransform(t,!1))}createSpecInfo(t,e){var i,s;e||(e=this.generateTransform(t,!0));let r={};return this.forEachRegionInSpec(t,e,r),this.forEachSeriesInSpec(t,e,r),null==(i=r.series)||i.forEach((t,e)=>{var i,s;let a=(null!=(s=null!=(i=Mi(t,r))?i:r.region)?s:[])[0];a&&(a.seriesIndexes||(a.seriesIndexes=[]),a.seriesIndexes.push(e),t.regionIndexes=a.regionIndexes.slice())}),this.forEachComponentInSpec(t,e,r),Object.values(null!=(s=r.component)?s:{}).forEach(t=>t.forEach((t,e)=>{var i,s,a;if(t){if(!t.regionIndexes){let e=null!=(s=null!=(i=Mi(t,r))?i:r.region)?s:[];t.regionIndexes=e.map(t=>t.regionIndexes[0])}if(!t.seriesIndexes){let e=((t,e)=>{var i;let{seriesId:s,seriesIndex:r}=t.spec;if((0,eA.A)(s)){let t=oS(s);return null==(i=e.series)?void 0:i.filter(({spec:e})=>t.includes(e.id))}if((0,eA.A)(r))return oS(r).map(t=>{var i;return null==(i=e.series)?void 0:i[t]}).filter(eA.A)})(t,r);if(e)t.seriesIndexes=e.map(({seriesIndexes:t})=>t[0]);else{let e=new Set;(null!=(a=t.regionIndexes)?a:[]).forEach(t=>{var i,s;let a=null==(i=r.region)?void 0:i[t];null==(s=null==a?void 0:a.seriesIndexes)||s.forEach(t=>e.add(t))}),t.seriesIndexes=Array.from(e)}}}})),r}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t,e,i){var s,r,a,n,l;let o={dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!=(s=t.animation)?s:null==(r=this._option.globalInstance)?void 0:r.isAnimationEnable(),animationThreshold:null!=(a=t.animationThreshold)?a:null==(l=(n=this._option).getTheme)?void 0:l.call(n,"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},h=this.seriesType;return h&&(o.type=h,o[h]=t[h]),e&&e.length&&e.forEach(e=>{o[e]=t[e]}),i&&i.length&&i.forEach(e=>{o[e]=t[e]}),o}forEachRegionInSpec(t,e,i){var s;return(null!=(s=t.region)?s:[]).map((t,s)=>e(uP.getRegionInType("region"),{spec:t,specPath:["region",s],type:"region",regionIndexes:[s]},i))}forEachSeriesInSpec(t,e,i){var s;return(null!=(s=t.series)?s:[]).map((t,s)=>e(uP.getSeriesInType(t.type),{spec:t,specPath:["series",s],type:t.type,seriesIndexes:[s]},i))}forEachComponentInSpec(t,e,i){var s,r,a;let n,l,o,h,u=[],d=uP.getComponents(),c=[];for(let e=0;e<d.length;e++){let{cmp:i,alwaysCheck:r}=d[e];i.type.startsWith(hc.cartesianAxis)?n=i:i.type.startsWith(hc.polarAxis)?l=i:i.type===hc.geoCoordinate?o=i:(r||t[null!=(s=i.specKey)?s:i.type])&&(i.type===hc.tooltip?h=i:c.push(d[e]))}let p=!1;if(n){let s=n.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(p=!0,s.forEach(t=>{let s=uP.getComponentInKey(t.type);u.push(e(s,t,i))}))}if(l&&!p){let s=l.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(p=!0,s.forEach(t=>{let s=uP.getComponentInKey(t.type);u.push(e(s,t,i))}))}return o&&!p&&(null==(r=o.getSpecInfo(t,i))||r.forEach(t=>{u.push(e(o,t,i))})),c.sort((t,e)=>t.createOrder-e.createOrder),c.forEach(({cmp:s})=>{var r;null==(r=s.getSpecInfo?s.getSpecInfo(t,i):v2(t,s.specKey,s.type))||r.forEach(t=>{u.push(e(s,t,i))})}),h&&(null==(a=v2(t,h.specKey,h.type))||a.forEach(t=>{u.push(e(h,t,i))})),u}transformSeriesSpec(t){let e=this._getDefaultSeriesSpec(t);
2t.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){let s="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find(i=>!!s.includes(i.orient)&&((0,eA.A)(i.seriesId)?oS(i.seriesId).includes(null==t?void 0:t.id):(0,eA.A)(i.seriesIndex)?oS(i.seriesIndex).includes(e):i.type,!0))}_applyAxisBandSize(t,e,i){let{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:n}=i,l=!1;ed(r)?(t.minBandSize=r,l=!0):ed(a)?(t.minBandSize=a,l=!0):ed(s)&&(t.minBandSize=s,l=!0),l&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:(0,ev.A)(n)?n[n.length-1]:n})}}class Mr extends Ms{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["xField","yField","zField","direction","stack","percent","stackOffsetSilhouette","totalLabel","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),super.transformSeriesSpec(t),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=[]);let e={x:!1,y:!1,z:!1};t.axes.forEach(i=>{let{orient:s}=i,r=null;"top"!==s&&"bottom"!==s||(e.x=!0,r=this._setDefaultXAxisSpec(t)),"left"!==s&&"right"!==s||(e.y=!0,r=this._setDefaultYAxisSpec(t)),"z"===s&&(e.z=!0,r=this._setDefaultZAxisSpec(t)),r&&Object.keys(r).forEach(t=>{(0,eE.A)(i[t])&&(i[t]=r[t])}),uQ(i,"trimPadding")&&uy(i,fp(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 Ma extends Mr{_getDefaultSeriesSpec(t){var e;let i=super._getDefaultSeriesSpec(t,["point","line","activePoint","sampling","samplingFactor","pointDis","pointDisMul","markOverlap","lineLabel"]);return i.seriesMark=null!=(e=t.seriesMark)?e:"line",i}transformSpec(t){super.transformSpec(t),fu(t)}}class Mn{get dataList(){return this._dataArr}constructor(t){this._dataArr=[],this._dataSet=t}parseData(t){this._dataArr=[];let e=oS(t);for(let t=0;t<e.length;t++)this._dataArr.push(pe(e[t],this._dataSet,this._dataArr))}updateData(t,e=!1,i=!0){let s=oS(t);return(!e||s.length===this._dataArr.length)&&(this._dataValueForEach(s,(t,e)=>{e.markRunning()}),this._dataValueForEach(s,(t,e)=>{pi(e,t,i)}),!0)}_dataValueForEach(t,e){t.forEach((t,i)=>{if(t instanceof eR)return;let s=this.getSeriesData(t.id,i);s&&e(t,s,i)})}getSeriesData(t,e){if(!this._dataArr.length)return null;if("string"==typeof t){let e=this._dataArr.filter(e=>e.name===t);if(e[0])return e[0];h2(`no data matches dataId ${t}!`)}if("number"==typeof e){if(this._dataArr[e])return this._dataArr[e];h2(`no data matches dataIndex ${e}!`)}return this._dataArr[0]}}class Ml{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=>{let e=[];return this._scaleSpecMap.forEach((i,s)=>{hV(i.domain)&&i.domain.forEach(s=>{s.dataId===t&&s.fields.forEach(t=>{vX(e,[{key:t,operations:fI(i.type)?["max","min"]:["values"]}])})})}),this._markAttributeScaleMap.forEach((i,s)=>{let r=this.getScale(s);i.forEach(i=>{this._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&vX(e,[{key:i.field,operations:fI(r.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?mC("colorOrdinal"):mC(t.type)),e?((0,ev.A)(t.range)&&e.range(t.range),(0,ev.A)(t.domain)&&(hV(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),t.clamp&&e.clamp&&e.clamp(t.clamp),e):null}_setAttrFromSpec(){var t;if(!(null==(t=this._spec)?void 0:t.length))return;let e=new Map,i=new Map;this._spec.forEach(t=>{let s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))}
2),this._modelScaleSpecMap.forEach(t=>{let s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))}),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){let e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if((0,ex.n)(t,this._spec))return e;e.change=!0;for(let i=0;i<t.length;i++){let s=t[i],r=this._scaleMap.get(s.id);if(!r)return e.reMake=!0,e;let a=this._spec.find(t=>t.id===s.id);if(!a.id||a.type!==s.type||!(0,ex.n)(a.specified,s.specified))return e.reMake=!0,e;s.range&&!(0,ex.n)(s.range,r.range())&&(r.range(s.range),e.reRender=!0),hV(s.domain)?e.reRender=!0:(0,ex.n)(s.domain,r.domain())||(r.domain(s.domain),e.reRender=!0),this._scaleSpecMap.set(s.id,s)}return this._spec=t,e}registerModelScale(t){let 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){let e=this._chart.getAllSeries();for(let i=0;i<e.length;i++){let s=e[i];if(s.getRawData().name===t)return s}return null}_getSeriesBySeriesId(t){let e=this._chart.getAllSeries();for(let i=0;i<e.length;i++){let s=e[i];if(s.id===t)return s}return null}updateScaleDomain(t){this._scaleSpecMap.forEach((e,i)=>{let s,r=this._scaleMap.get(i);if(!r)return;if(!hV(e.domain))return e.domain&&0!==e.domain.length||r.domain(t),void this._updateMarkScale(i,r,r.domain().slice());s=fI(e.type)?[null,null]:new Set,e.domain.forEach(t=>{let i=this._getSeriesByRawDataId(t.dataId);if(!i)return;let r=fI(e.type);t.fields.forEach(t=>{let e=i.getRawDataStatisticsByField(t,r);e&&(r?((0,eE.A)(s[0])?s[0]=e.min:s[0]=Math.min(e.min,s[0]),(0,eE.A)(s[1])?s[1]=e.max:s[1]=Math.max(e.max,s[1])):e.values.forEach(t=>{s.add(t)}))})});let a=s;fI(e.type)||(s=Array.from(s)),r.domain(s),this._updateMarkScale(i,r,a)})}_updateMarkScale(t,e,i){let s=this._markAttributeScaleMap.get(t);s&&0!==s.length&&s.forEach(t=>{if(!t.field||!t.markScale||t.markScale===e)return;if((0,eE.A)(t.changeDomain)||"none"===t.changeDomain||(0,eE.A)(t.seriesId))return void(fI(e.type)?t.markScale.domain(i):e.domain(Array.from(i)));let s=this._getSeriesBySeriesId(t.seriesId),r=fI(e.type),a=s.getRawDataStatisticsByField(t.field,r);pJ(a)?fI(e.type)?t.markScale.domain(i):e.domain(Array.from(i)):"expand"===t.changeDomain?(r?(i[0]=Math.min(i[0],a.min),i[1]=Math.max(i[1],a.max)):(a.values.forEach(t=>{i.add(t)}),i=Array.from(i)),t.markScale.domain(i)):"replace"!==t.changeDomain||(r?t.markScale.domain([a.min,a.max]):t.markScale.domain(a.values))})}registerMarkAttributeScale(t,e){let i=this._scaleMap.get(t.scale),s=this._markAttributeScaleMap.get(t.scale);s||(s=[],this._markAttributeScaleMap.set(t.scale,s));let r=i;return!(0,eE.A)(t.field)&&((0,eE.A)(t.changeDomain)||"none"===t.changeDomain||(0,eE.A)(e))||(r=i.clone()),s.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:r})),r}}class Mo{constructor(){this._stateGraphicsByTrigger=new Map,this._disableTriggerEvent=!1,this._triggerMapByState=new Map}setDisableActiveEffect(t){this._disableTriggerEvent=t}addTrigger(t){t&&[t.getStartState(),t.getResetState()].forEach(e=>{if(e){let i=this._triggerMapByState.get(e);i?i.includes(t)||i.push(t):this._triggerMapByState.set(e,[t])}})}setStatedGraphics(t,e){this._stateGraphicsByTrigger.set(t,e)}getStatedGraphics(t){return this._stateGraphicsByTrigger.get(t)}updateStates(t,e,i,s,r){return this._disableTriggerEvent?[]:e&&e.length?(s&&r?i&&i.length?(this.toggleReverseStateOfGraphics(t,e,i,r),this.toggleStateOfGraphics(t,e,i,s)):this.addBothStateOfGraphics(t,e,s,r):s&&(i&&i.length?this.toggleStateOfGraphics(t,e,i,s):this.addStateOfGraphics(t,e,s)),e):[]}toggleReverseStateOfGraphics(t,e,i,s){let r=t.getMarkIdByState();i.forEach(t=>{var e;if(s&&r[s]&&r[s].includes(t.context.markId)){let i=null==(e=t.parent)?void 0:e.mark,r=i.hasAnimationByState&&i.hasAnimationByState("state");t.addState(s,!0,r)}}),e.forEach(t=>{var e;if(s&&r[s]&&r[s].includes(t.context.markId)){let i=null==(e=t.parent)?void 0:e.mark,r=i.hasAnimationByState&&i.hasA
2nimationByState("state");t.removeState(s,r)}})}toggleStateOfGraphics(t,e,i,s){let r=t.getMarkIdByState();i.forEach(t=>{var e;if(s&&r[s]&&r[s].includes(t.context.markId)){let i=null==(e=t.parent)?void 0:e.mark,r=i.hasAnimationByState&&i.hasAnimationByState("state");t.removeState(s,r)}}),e.forEach(t=>{var e;if(s&&r[s]&&r[s].includes(t.context.markId)){let i=null==(e=t.parent)?void 0:e.mark,r=i.hasAnimationByState&&i.hasAnimationByState("state");t.addState(s,!0,r)}})}addBothStateOfGraphics(t,e,i,s){let r=t.getMarks(),a=t.getMarkIdByState();r.forEach(t=>{var r;let n=s&&a[s]&&a[s].includes(t.id),l=i&&a[i]&&a[i].includes(t.id);if(!n&&!l)return;let o=t.hasAnimationByState&&t.hasAnimationByState("state");null==(r=t.getGraphics())||r.forEach(t=>{e&&e.includes(t)?l&&t.addState(i,!0,o):n&&t.addState(s,!0,o)})})}addStateOfGraphics(t,e,i){let s=t.getMarks(),r=t.getMarkIdByState();s.forEach(t=>{var s;let a=i&&r[i]&&r[i].includes(t.id);if(!a)return;let n=t.hasAnimationByState&&t.hasAnimationByState("state");null==(s=t.getGraphics())||s.forEach(t=>{e&&e.includes(t)&&a&&t.addState(i,!0,n)})})}clearAllStatesOfTrigger(t,e,i){if(this._disableTriggerEvent)return;let s=this.getStatedGraphics(t);if(!s||!s.length)return;let r=t.getMarks(),a=t.getMarkIdByState();r.forEach(t=>{if(t){let r=t.getGraphics(),n=t.hasAnimationByState&&t.hasAnimationByState("state");r&&r.length&&(i&&a[i]&&a[i].includes(t.id)&&r.forEach(t=>{t.removeState(i,n)}),e&&a[e]&&a[e].includes(t.id)&&r.forEach(t=>{s.includes(t)&&t.removeState(e,n)}))}})}clearAllStates(){this._disableTriggerEvent||this._triggerMapByState.forEach((t,e)=>{t.forEach(t=>{this.clearAllStatesOfTrigger(t,e,t.getResetState())})})}clearByState(t){if(this._disableTriggerEvent)return;let e=this._triggerMapByState.get(t);e&&e.length&&e.forEach(e=>{this.clearAllStatesOfTrigger(e,t,e.getResetState()),this.setStatedGraphics(e,[])})}updateStateOfGraphics(t,e){if(this._disableTriggerEvent)return;let i=this._triggerMapByState.get(t);i&&i.length&&i.forEach(t=>{let i=e.filter(e=>t.getMarks().some(t=>{let i=t&&t.getGraphics();return i&&i.includes(e)}));this.updateStates(t,i,this.getStatedGraphics(t),t.getStartState(),t.getResetState()),this.setStatedGraphics(t,i)})}}var Mh=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Mu extends ff{getSpec(){return this._spec}setSpec(t){this._spec=t}getOption(){return this._option}getLayoutRect(){return this._layoutRect}getViewRect(){return this._viewRect}getLayoutTag(){return this._layoutTag}setLayoutTag(t,e,i=!0){this._layoutTag=t;let s=this.getCompiler();return s&&(s.updateLayoutTag(),t&&i&&s.renderNextTick(e)),this._layoutTag}resetLayoutItemTag(){this.getLayoutElements().forEach(t=>t.setWillLayoutTag())}getModelOption(){return this._modelOption}getGlobalScale(){return this._globalScale}getEvent(){return this._event}
2get chartData(){return this._chartData}_setModelOption(){}constructor(t,e){var i,s,r,a;super(e),this.type="chart",this.id=hH(),this._regions=[],this._series=[],this._components=[],this._layoutRect={x:0,y:0,width:500,height:500},this._viewRect={width:500,height:500},this._viewBox={x1:0,y1:0,x2:500,y2:500},this._layoutTag=!0,this._idMap=new Map,this.state={layoutUpdateRank:1},this.padding={top:0,left:0,right:0,bottom:0},this.getAllSeries=()=>{var t;return null!=(t=this._series)?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)=>oS(t).some(t=>(0,eA.A)(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=()=>
2this._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)=>{let 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=>{let e=this._components.find(e=>e.userId===t);if(e)return e},this.getComponentsByType=t=>this._components.filter(e=>e.type===t),this._paddingSpec=hY(null!=(i=t.padding)?i:e.getTheme("padding")),this._event=new uK(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new Mn(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.onError,disableTriggerEvent:!0===(null==(r=this._option)?void 0:r.disableTriggerEvent),componentShowContent:null==(a=this._option)?void 0:a.componentShowContent,getSeriesData:this._chartData.getSeriesData.bind(this._chartData),dispatchEvent:(t,e)=>this._option.globalInstance.event.emit(t,e)}),this._setModelOption&&this._setModelOption(),this._spec=t}created(t){this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),t.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),t.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),t.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}_initInteractions(){if(this._option.disableTriggerEvent)return;this._interaction=new Mo;let t=this.getAllSeries(),e=[],i={};t.forEach(t=>{let s=t.getInteractionTriggers();if(s&&s.length){let r=t.getRegion().id;s.forEach(({trigger:t,marks:s})=>{let a=`${r}-${t.type}`;i[a]?s.forEach(t=>{i[a].marks.push(t)}):(i[a]=Object.assign(Object.assign({},t),{marks:s}),e.push(i[a]))})}}),e.forEach(t=>{let e=uP.createInteractionTrigger(t.type,Object.assign(Object.assign({},t),{event:this._event,interaction:this._interaction}));e&&(e.init(),this._interaction.addTrigger(e))})}init(){var t,e;null==(t=this._beforeInit)||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)||e.call(this),this.reDataFlow(),this._initInteractions(),this.initStageAnimation()}initStageAnimation(){let t=this._option.getCompiler();(null==t?void 0:t.setStageAnimationConfig)&&t.setStageAnimationConfig(bb({},bx("stage",this._spec,{}),null))}reDataFlow(){this._series.forEach(t=>{var e;return null==(e=t.getRawData())?void 0:e.markRunning()}),this._series.forEach(t=>t.fillData()),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){this._canvasRect={width:t,height:e},this._updateLayoutRect(this._option.viewBox),this.resetLayoutItemTag(),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.resetLayoutItemTag(),this.setLayoutTag(!0,null,e)}_createBackground(){let t=this._spec.background;if(!t||"object"!=typeof t||(0,eA.A)(t.gradient))return;let e=(0,SD.A)(t,["x","y","width","height","x1","y1","image"]);e.background=t.image,this._backgroundMark=uP.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})),this._backgroundMark.setMarkConfig({zIndex:j.SeriesGroup-2}),this.getCompiler().addRootMark(this._backgroundMark)}_createRegion(t,e){if(!t)return;let{spec:i}=e,s=Mh(e,["spec"]),r=new t(i,Object.assign(Object.assign({},this._modelOption),s));r&&(r.created(),this._regions.push(r))}_createSeries(t,e){let i;if(!t)return;let{spec:s}=e,r=Mh(e,["spec"]);if((0,eA.A)(s.regionId)?i=this.getRegionsInUserId(s.regionId):(0,eA.A)(s.regionIndex)&&(i=this.getRegionsInIndex([s.regionIndex])[0]),!i&&!(i=this._regions[0]))return;let a=new t(s,Object.assign(Object.assign(Object.assign({},this._modelOption),r),{type:s.type,region:i,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));a&&(a.created(),this._series.push(a),i.addSeries(a))}getSeriesById(t){return this._series.find(e=>e.id===t)}_createComponent(t,e){let i=t.createComponent(e,Object.assign(Object.assign({}
2,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((0,eS.A)(t))return this.getAllModels().find(e=>e.userId===t);if((0,r3.A)(t))return this.getAllModels().find(e=>t(e));let e=0;return this.getAllModels().find(i=>{var s;if((null!=(s=i.specKey)?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=uP.getLayoutInKey(null!=(e=null==(t=this._spec.layout)?void 0:t.type)?e:"base");if(s){let t=new s(this._spec.layout,{onError:null==(i=this._option)?void 0:i.onError});this._layoutFunc=t.layoutItems.bind(t)}}}layout(){var t,e,i,s;if(null==(e=null==(t=this._option.performanceHook)?void 0:t.beforeLayoutWithSceneGraph)||e.call(t,this._option.globalInstance),this.getLayoutTag()){this._event.emit(dj.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart();let t=this.getLayoutElements();this._layoutFunc(this,t,this._layoutRect,this._viewBox),this._event.emit(dj.afterLayout,{elements:t,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(),this._event.emit(dj.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null==(s=null==(i=this._option.performanceHook)?void 0:i.afterLayoutWithSceneGraph)||s.call(i,this._option.globalInstance)}onLayoutStart(){this.getAllModels().forEach(t=>t.onLayoutStart(this._layoutRect,this._viewRect))}onLayoutEnd(){this.getAllModels().forEach(t=>{"series"!==t.modelType&&t.onLayoutEnd()})}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach(e=>e.onEvaluateEnd(t))}onBeforeRender(){[...this._components,...this._regions,...this._series].forEach(t=>t.onBeforeRender())}getLayoutElements(){return this.getAllModels().map(t=>t.layout).filter(t=>!!t)}getModelById(t){let e=this._idMap.get(t);if(e&&e instanceof fv)return e}getModelByUserId(t){let e=this.getSeriesInUserId(t);if(e)return e;let i=this.getRegionsInUserId(t);return i||this.getComponentByUserId(t)||void 0}getAllMarks(){return Array.from(this._idMap.values()).filter(t=>t&&t instanceof _x)}getMarkById(t){let e=this._idMap.get(t);if(e&&e instanceof _x)return e}getMarkByUserName(t){return this.getAllMarks().filter(e=>e.name&&e.name===t)}updateData(t,e,i=!0,s){let r=this._dataSet.getDataView(t);r&&(r.markRunning(),r.parseNewData(e,s)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach(t=>t.onDataUpdate())}updateFullData(t,e=!0){oS(t).forEach(t=>{let e=this._dataSet.getDataView(t.id);e&&e.markRunning()}),oS(t).forEach(t=>{let e=this._dataSet.getDataView(t.id);e&&pi(e,t,!0)}),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach(t=>t.onDataUpdate())}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=fd(this._spec,this._option,{width:500,height:500})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t;let e=this._spec.scales?[...this._spec.scales]:[],i=e.find(t=>"color"===t.id),s=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){let t=this._spec.color;(0,ev.A)(t)?i.range=t:(Object.prototype.hasOwnProperty.call(t,"type")&&(i.type=t.type),Object.prototype.hasOwnProperty.call(t,"domain")&&(i.domain=t.domain),Ob
2ject.prototype.hasOwnProperty.call(t,"range")&&(i.range=t.range),Object.prototype.hasOwnProperty.call(t,"specified")&&(i.specified=t.specified),Object.prototype.hasOwnProperty.call(t,"clamp")&&(i.clamp=t.clamp))}return(null==(t=i.range)?void 0:t.length)||(i.range=ud(s),i.rangeTheme=!0),e}_createGlobalScale(){this._globalScale=new Ml(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){let t=new Set;this._series.forEach(e=>{let i=e.getSeriesKeys();i&&i.forEach(e=>t.add(e))});let e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){fc(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){let t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=ud(e),this._globalScale.getScale("color").range(t.range))}_getSpecKeys(t){let e={width:!0,height:!0};return Object.keys(t).filter(t=>!e[t]).sort()}updateSpec(t){let 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;let i=this._getSpecKeys(this._spec),s=this._getSpecKeys(t);
2if(!(0,ex.n)(i,s))return e.reMake=!0,e;for(let s=0;s<i.length;s++){let r=i[s];if((0,ev.A)(this._spec[r])&&this._spec[r].length!==oS(t[r]).length)return e.reMake=!0,e}let r=this._spec;return this._spec=t,this.updateChartConfig(e,r),e.reMake||(this.updateGlobalScale(e),e.reMake||(this.updateRegionSpec(e),e.reMake||(this.updateComponentSpec(e),e.reMake||(this.updateSeriesSpec(e),e.reMake||(this.reInit(),this.updateDataSpec(),this.updateGlobalScaleDomain()))))),e}updateChartConfig(t,e){var i,s;this._paddingSpec=hY(null!=(i=this._spec.padding)?i:null==(s=this._option)?void 0:s.getTheme("padding")),this._updateLayoutRect(this._viewBox)}updateDataSpec(){this._spec.data&&this._chartData.updateData(this._spec.data,!1,!0)}updateRegionSpec(t){var e;(null==(e=this._spec)?void 0:e.region)&&(this._spec.region.length===this._regions.length?this._regions.forEach(e=>{fc(t,e.updateSpec(this._spec.region[e.getSpecIndex()]))}):t.reMake=!0)}updateComponentSpec(t){let e={},i={[hc.title]:!0,[hc.brush]:!0,[hc.indicator]:!0};for(let s in this._components.forEach(s=>{var r,a;if(s.type===hc.label||s.type===hc.totalLabel)return;i[s.type]&&(i[s.type]=!1);let n=s.specKey||s.type,l=null!=(r=this._spec[n])?r:{};(0,ev.A)(l)?(e[n]=e[n]||{specCount:l.length,componentCount:0},e[n].componentCount++,fc(t,s.updateSpec(null!=(a=l[s.getSpecIndex()])?a:{},l))):fc(t,s.updateSpec(l))}),e)if(Object.prototype.hasOwnProperty.call(e,s)){let i=e[s];i.componentCount!==i.specCount&&(t.reMake=!0)}let s=t=>t&&!1!==t.visible;
2Object.keys(i).forEach(e=>{if(i[e]){let i=this._spec[e];((0,ev.A)(i)?i.some(s):s(i))&&(t.reMake=!0)}})}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach(e=>{let i=this._spec.series[e.getSpecIndex()];fc(t,e.updateSpec(i))}):t.reMake=!0}getCanvas(){var t,e;return null!=(e=null==(t=this.getCompiler())?void 0:t.getCanvas())?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;let{x1:i=0,y1:s=0,x2:r,y2:a}=t;e={width:r-i,height:a-s}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=hG(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(dj.layoutRectUpdate,{chart:this})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.resetLayoutItemTag(),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}reInit(){[...this._regions,...this._series,...this._components].forEach(t=>{let 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.call(t)})}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach(t=>{var e;null==(e=t.afterCompile)||e.call(t)}),this.getAllSeries().forEach(t=>{var e;null==(e=t.afterCompile)||e.call(t)}),this.getAllComponents().forEach(t=>{var e;null==(e=t.afterCompile)||e.call(t)})}compileLayout(){let{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){this._backgroundMark&&this._backgroundMark.compile()}compileRegions(){var t,e,i,s;null==(e=null==(t=this._option.performanceHook)?void 0:t.beforeRegionCompile)||e.call(t,this._option.globalInstance),this.getAllRegions().forEach(t=>{t.compile()}),null==(s=null==(i=this._option.performanceHook)?void 0:i.afterRegionCompile)||s.call(i,this._option.globalInstance)}compileSeries(){var t,e,i,s;null==(e=null==(t=this._option.performanceHook)?void 0:t.beforeSeriesCompile)||e.call(t,this._option.globalInstance),this.getAllSeries().forEach(t=>{t.compile()}),null==(s=null==(i=this._option.performanceHook)?void 0:i.afterSeriesCompile)||s.call(i,this._option.globalInstance)}compileComponents(){var t,e,i,s;null==(e=null==(t=this._option.performanceHook)?void 0:t.beforeComponentCompile)||e.call(t,this._option.globalInstance),this.getAllComponents().forEach(t=>{t.compile()}),null==(s=null==(i=this._option.performanceHook)?void 0:i.afterComponentCompile)||s.call(i,this._option.globalInstance)}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(){this.layout()}updateState(t,e){let i=this.getAllSeries();for(let s in t){if(pJ(t[s]))continue;let r=t[s],a={stateValue:s};a=(0,r3.A)(r.filter)?Object.assign({filter:r.filter},a):Object.assign(Object.assign({},r.filter),a),r.level&&(a.level=r.level),i.forEach(t=>{t.getMarks().forEach(i=>{i.stateStyle[s]&&(e&&!e(t,i,s)||(i.state.changeStateInfo(a),i.updateMarkState(s)))})})}}setSelected(t,e,i){this._setStateInDatum(U.STATE_SELECTED,t,e,i)}setHovered(t,e,i){this._setStateInDatum(U.STATE_HOVER,t,e,i)}clearState(t){this._interaction.clearByState(t)}clearAllStates(){this._interaction.clearAllStates()}clearSelected(){this.clearState(U.STATE_SELECTED)}clearHovered(){this.clearState(U.STATE_HOVER)}_initEvent(){[dj.dataZoomChange,dj.scrollBarChange].forEach(t=>{this._event.on(t,({value:t})=>{this._disableMarkAnimation(["exit","update"]);let e=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(dH.AFTER_MARK_RENDER_END,e)};this._event.on(dH.AFTER_MARK_RENDER_END,e)})})}
2_enableMarkAnimation(t){this.getAllMarks().forEach(e=>e.enableAnimationByState(t))}_disableMarkAnimation(t){this.getAllMarks().forEach(e=>e.disableAnimationByState(t))}filterGraphicsByDatum(t,e={}){var i;let s=(t=t?oS(t):null)?Object.keys(t[0]):null,r=[],a=null!=(i=e.getDatum)?i:u3;return this.getRegionsInQuerier(e.region).forEach(i=>{let n=[];t&&i.getSeries().forEach(l=>{l.getMarks().forEach(o=>{let h=o.getGraphics();if(h&&h.length&&(!e.filter||(0,r3.A)(e.filter)&&e.filter(l,o))){let u;if("line"===(u=o.type)||"area"===u)h.filter(h=>{let u=a(h,o,l,i);u&&t.every((t,e)=>s.every(i=>t[i]==u[e][i]))&&(n.push(h),r.push(h),e.callback&&e.callback(h,o,l,i))});else if(t.length>1){let u=t.slice();h.forEach(t=>{let h=a(t,o,l,i),d=h&&u.findIndex(t=>s.every(e=>t[e]==h[e]));d>=0&&(u.splice(d,1),n.push(t),r.push(t),e.callback&&e.callback(t,o,l,i))})}else{let u=h.find(e=>{let r=a(e,o,l,i);return r&&s.every(e=>t[0][e]==r[e])});u&&(n.push(u),r.push(u),e.callback&&e.callback(u,o,l,i))}}})}),e.regionCallback&&e.regionCallback(n,i)}),r}_setStateInDatum(t,e,i,s){if(!e)return void this._interaction.clearByState(t);let r=this.filterGraphicsByDatum(e,{filter:i,region:s});this._interaction.updateStateOfGraphics(t,r)}setDimensionIndex(t,e){var i;let s=null;Array.from(this._event.getComposedEventMap().values()).forEach(i=>{let{eventType:r,event:a}=i;
2if(r===tw.dimensionHover||r===tw.dimensionClick){let i=a.dispatch(t,e);(null==i?void 0:i.length)&&(s=i)}});let r=(0,eE.A)(t)||!s||s.every(t=>fL(t.axis.getScale().type)&&(0,eE.A)(t.index)),a=r||s.every(t=>fL(t.axis.getScale().type)&&t.data.every(t=>0===t.datum.length));if(!1!==e.tooltip){let t=this.getComponentsByType(hc.tooltip)[0];if(null==t?void 0:t.getVisible())if(r||a)null==(i=t.hideTooltip)||i.call(t);else{let i={};s.forEach(t=>{let{axis:e,value:s,data:r}=t,a="left"===e.getOrient()||"right"===e.getOrient();r.forEach(t=>{var e,r,n;let l=a?t.series.fieldY[0]:t.series.fieldX[0];i[l]=null!=(n=null==(r=null==(e=t.datum)?void 0:e[0])?void 0:r[l])?n:s})}),t.showTooltip(i,e.showTooltipOption)}}if(!1!==e.crosshair){let t=this.getComponentsByType(hc.cartesianCrosshair)[0];t&&t.clearAxisValue&&t.setAxisValue&&(r?t.hideCrosshair():t.showCrosshair(s))}}showCrosshair(t){var e;let i=null!=(e=this.getComponentsByType(hc.cartesianCrosshair)[0])?e:this.getComponentsByType(hc.polarCrosshair)[0];if(!i)return;let s=this.getComponentsByKey("axes"),r=[];s.forEach(e=>{let i=t(e);!1!==i&&r.push({axis:e,value:i})}),i.showCrosshair(r)}getColorScheme(){var t,e;return null==(e=(t=this._option).getTheme)?void 0:e.call(t,"colorScheme")}}let Md=(t,e)=>{let i={nodes:{}},{fields:s}=e;if(!(null==s?void 0:s.length))return i;let r=s.length-1,a,n=i;return t.forEach(t=>{t.latestData&&t.latestData.forEach(t=>{n=i;for(let e=0;e<s.length;e++){let i=s[e],l=t[i];if((0,eE.A)(l))break;n.groupField=i,n.nodes[l]||(e===r?n.nodes[l]={values:[]}:(a={nodes:{}},n.nodes[l]=a)),e===r?n.nodes[l].values.push(t):n=n.nodes[l]}})}),i};class Mc{constructor(t,e){this.stackRegion=({model:t})=>{var e;let i=t.getSeries();if(!i.some(t=>t.getStack()))return;let s=i.some(t=>{var e,i,s,r;return!!(null==(i=null==(e=t.getSpec())?void 0:e.totalLabel)?void 0:i.alwayCalculateTotal)||(null==(r=null==(s=t.getSpec())?void 0:s.totalLabel)?void 0:r.visible)}),r=s||i.some(t=>t.getPercent()),a=i.some(t=>t.getStackOffsetSilhouette()),n=vq(t,!0);for(let e in n)for(let i in n[e].nodes)!function t(e,i,s,r,a={key:pw,start:pT,end:pC,startPercent:pB,endPercent:pE,max:pL,min:pD}){let n=r&&(0,eA.A)(a.min),l=r&&(0,eA.A)(a.max);if(e.values.length>0){let t=0,r=0,o=1,h=0,u=null,d=null,c=e.values.length;for(let s=0;s<c;s++){let o=e.values[i?c-1-s:s];(h=o[a.end])>=0?(o[a.start]=t,t+=o[a.end],o[a.end]=t):(o[a.start]=r,r+=o[a.end],o[a.end]=r),o[a.key]=e.key,l&&(delete o[a.max],(!d||o[a.end]>d[a.end])&&(d=o)),n&&(delete o[a.min],(!u||o[a.start]<u[a.start])&&(u=o))}if(l&&d&&(d[a.max]=!0),n&&u&&(u[a.min]=!0),s)for(let s=0;s<c;s++){let n=e.values[i?c-1-s:s],l=(h=n[a.end])>=0?t:r;o=h>=0?1:-1,n[a.startPercent]=0===l?0:Math.min(1,n[a.start]/l)*o,n[a.endPercent]=0===l?0:Math.min(1,n[a.end]/l)*o}}for(let n in e.nodes)t(e.nodes[n],i,s,r,a)}(n[e].nodes[i],t.getStackInverse(),r,s);if(a)for(let t in n)for(let e in n[t].nodes)!function(t){if(!t.values.length)return;let e=t.values[t.values.length-1][pC]/2;for(let i=0;i<t.values.length;i++)t.values[i][pP]=t.values[i][pT]-e,t.values[i][pO]=t.values[i][pC]-e}(n[t].nodes[e]);s&&t.getSeries().forEach(t=>{let e=t.getStackData(),i=t.getStackValue(),s=t.getStackValueField();e&&s&&vZ(n[i],s)}),(null==(e=this._options)?void 0:e.afterStackRegion)&&this._options.afterStackRegion(t,n)},this._chart=t,this._options=e}init(){this._chart.getAllRegions().forEach(t=>{t.event.on(dj.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 Mp{_beforeInit(){this._dataSet&&c3(this._dataSet,"stackSplit",Md)}_initStack(){this._stack=new Mc(this),this._stack.init()}}let Mg={state:U.STATE_DIMENSION_HOVER,reverseState:U.STATE_DIMENSION_HOVER_REVERSE,trigger:tw.dimensionHover};class Mf extends vB{constructor(t){super(t),this.type="dimension-hover",this._resetType=[],this.resetAll=()=>{let{state:t,reverseState:e,interaction:i}=this.options,s=i.getStatedGraphics(this);s&&s.length&&(i.clearAllStatesOfTrigger(this,t,e),this.dispatchEvent("reset",{graphics:s,options:this.options}),i.setStatedGraphics(this,[]))},this.handleStart=t=>{let e=this.options.interaction;switch(t.action){case"enter":let i=this.getStatedGraphics(t);
2e.updateStates(this,this.getStatedGraphics(t),e.getStatedGraphics(this),this.options.state,this.options.reverseState),e.setStatedGraphics(this,i);break;case"leave":e.clearAllStatesOfTrigger(this,this.options.state,this.options.reverseState),e.setStatedGraphics(this,[])}},this.options=Object.assign({},Mg,t),this.updateMarkIdByState([this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getResetState(){return this.options.reverseState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart}]}getStatedGraphics(t,e=!1){let i=this.getMarksByState(e?this.options.reverseState:this.options.state),s=[];return t.dimensionInfo.forEach(t=>{t.data.forEach(t=>{i.filter(e=>e.model===t.series&&e.getVisible()).forEach(i=>{let r=i.getGraphics();if(!r||!r.length)return;let a=r.filter(i=>{let s,r=u3(i);return s=(0,ev.A)(r)?r.every((e,i)=>e===t.datum[i]):t.datum.some(t=>t===r),e?!s:s});s.push(...a)})})}),s}}Mf.type="dimension-hover",Mf.defaultOptions=Mg;let Mm=()=>{uP.registerInteractionTrigger(Mf.type,Mf)};class M_{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.call(t)),this._chart}register(t,e){var i,s;(null!=(s=null==(i=this.chart)?void 0:i.getOption().onError)?s:h3)("Method not implemented.")}unregister(){var t,e;(null!=(e=null==(t=this.chart)?void 0:t.getOption().onError)?e:h3)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,s,r;let a=null!=(r=null==(s=(i=this.chart.getModelOption()).getDimensionInfo)?void 0:s.call(i,this.chart,{x:t,y:e}))?r:[];return 0===a.length?null:a}dispatch(t,e){var i,s;let r=null==(i=this.chart)?void 0:i.getAllComponents().filter(t=>"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t))),a=r.filter(t=>fL(t.getScale().type)),n=a.length?a:r.filter(t=>{let e=t.getOrient();return x7(e)||"angle"===e}),l=[],o=null==(s=this.chart)?void 0:s.getModelOption().getDimensionInfoByValue;return o&&n.forEach(e=>{let i=o(e,t);i&&l.push(i)}),this._callback.call(null,{action:"enter",dimensionInfo:l}),l}}let My=(t,e)=>{var i,s;return t===e||!(0,eE.A)(t)&&!(0,eE.A)(e)&&t.value===e.value&&(null==(i=t.axis)?void 0:i.id)===(null==(s=e.axis)?void 0:s.id)},Mv=(t,e)=>{let i=t.tooltipFilterRange,s="function"==typeof i?i({scale:e}):i;return eP(s)?[-s,s]:s},Mb=(t,e,i,s)=>{var r;let a=e.getScale(),n=fL(a.type),l=[];for(let o of e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes))if(o.coordinate===i){let i=oS(s(o)),h=null==(r=o.getViewData())?void 0:r.latestData;if(i&&h)if(n){let e=[],s=[];h.forEach((r,a)=>{var n;(null==(n=r[i[0]])?void 0:n.toString())===(null==t?void 0:t.toString())&&(e.push(r),s.push(a))}),l.push({series:o,datum:e,key:Mx(o,s)})}else if((0,eA.A)(i[1])){let e=[],s=[];h.forEach((r,a)=>{var n;((null==(n=r[i[0]])?void 0:n.toString())===(null==t?void 0:t.toString())||(0,eA.A)(r[i[0]])&&(0,eA.A)(r[i[1]])&&t>=r[i[0]]&&t<r[i[1]])&&(e.push(r),s.push(a))}),l.push({series:o,datum:e,key:Mx(o,s)})}else{let s=Mv(e.getSpec(),a),r=[],n=[];if(s)h.forEach((e,a)=>{if((0,eA.A)(e[i[0]])){let l=e[i[0]]-t;l>=s[0]&&l<=s[1]&&(r.push(e),n.push(a))}});else{let e=1/0,s=0;h.forEach((a,l)=>{if((0,eA.A)(a[i[0]])){let o=Math.abs(a[i[0]]-t),h=Math.sign(a[i[0]]-t);o<e?(e=o,r=[a],n=[l],s=h):o===e&&h===s&&(r.push(a),n.push(l))}})}l.push({series:o,datum:r,key:Mx(o,n)})}}return l},Mx=(t,e)=>`${t.id}_${e.join("_")}`,MS=(t,e,i)=>{let s=t.getAllComponents().filter(s=>{let r;return"axes"===s.specKey&&e(s)&&(null==(r=t.getRegionsInIds(oS(s.layout.layoutBindRegionID)))?void 0:r.some(t=>{let e,s,r=t.getLayoutRect(),a=t.getLayoutStartPoint();return e={x:a.x,y:a.y},s={x:r.width+a.x,y:r.height+a.y},i.x>=e.x&&i.x<=s.x&&i.y>=e.y&&i.y<=s.y}))});return s.length?s:null};class MA extends M_{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{var e,i,s,r;if(!t||(null==(r=null==(s=null==(i=null==(e=t.chart)?void 0:e.getOption())?void 0:i.globalInstance)?void 0:s.disableDimensionHoverEvent)?void 0:r.call(s)))return;let a=t.event.viewX,n=t.event.viewY,l=this.getTargetDimensionInfo(a,n);null===l&&null!==this._cacheDimensionInfo?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=l):null!==l&&(null===this._cacheDimensionInfo||l.length!==this._cacheDimensionInfo.length||l.some((t,e)=>!My(t,this._cacheDimensionInfo[e])))?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:l.slice()})),this._cacheDimensionInfo=l):null!==l&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:l.slice()}))},this.onMouseOut=t=>{var e,i,s,r;!t||(null==(r=null==(s=null==(i=null==(e=t.chart)?void 0:e.getOption())?void 0:i.globalInstance)?void 0:s.disableDimensionHoverEvent)?void 0:r.call(s))||
2(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:dV.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:dV.canvas}),callback:this.onMouseOut}),hQ(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:dV.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),hQ(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}}class Mk extends M_{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;let 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:dV.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}let MM=()=>{uP.registerComposedEvent(tw.dimensionHover,MA),uP.registerComposedEvent(tw.dimensionCl
2ick,Mk)},Mw=t=>t.fieldX[0],MT=t=>t.fieldY[0],MC=t=>{var e;return[t.fieldX[0],null!=(e=t.fieldX2)?e:t.fieldX[1]]},MB=t=>{var e;return[t.fieldY[0],null!=(e=t.fieldY2)?e:t.fieldY[1]]},ME=(t,e)=>t?e?Mw:MC:e?MT:MB,MP=(t,e,i)=>{var s,r;if(!t)return null;let{x:a,y:n}=e,l=null!=(s=MS(t,t=>x7(t.getOrient()),e))?s:[],o=null!=(r=MS(t,t=>St(t.getOrient()),e))?r:[];if(!l.length&&!o.length)return null;let h=new Set,u=new Set,d=new Set;[l,o].forEach(t=>t.forEach(t=>{fL(t.getScale().type)?h.add(t):u.add(t),i&&t.getSpec().hasDimensionTooltip&&d.add(t)}));let c=[],p=t=>{let e="x"===t,i=e?a:n;(e?l:o).forEach(t=>{if(d.size>0){if(d.has(t)){let s=MO(t,i,ME(e,fL(t.getScale().type)));s&&c.push(s)}}else{let s=h.size>0;if((s?h:u).has(t)){let r=MO(t,i,ME(e,s));r&&c.push(r)}}})};return"horizontal"===t.getSpec().direction?(p("y"),0===c.length&&p("x")):(p("x"),0===c.length&&p("y")),c.length?c:null},MO=(t,e,i)=>{let s=t.positionToData(e,!0);return(0,eE.A)(s)?null:MR(t,s,i)},MR=(t,e,i)=>{let s=t.getScale();if((0,eE.A)(e))return null;let r=s.domain().findIndex(t=>(null==t?void 0:t.toString())===e.toString());r<0&&(r=void 0);let a=Mb(e,t,"cartesian",null!=i?i:x7(t.getOrient())?Mw:MT);return{index:r,value:e,position:s.scale(e),axis:t,data:a}},MI=(t,e,i,s=!1)=>(i||(i={x:0,y:0}),Object.keys(t).forEach(r=>{var a,n,l,o,h,u;let d,{currentValue:c,cacheInfo:p,labelsComp:g,attributes:f,coordKey:m}=t[r],_=null,y=0,v=null;if(c.size){let t=Array.from(c.values())[0];y=t.axis.getScale().scale(t.datum)+t.axis.getLayoutStartPoint()[m]-i[m],v=null==(u=null==(h=null==(o=null==(l=null==(n=null==(a=(_=t.axis).getVRenderComponents()[0])?void 0:a.children[0])?void 0:n.children[0])?void 0:l.children[0])?void 0:o.getChildByName("axis-label-container"))?void 0:h.getChildByName("axis-label-container-layer-0"))?void 0:u.children[0]}let b=!!c.size&&Number.isFinite(y)&&!Number.isNaN(y),x=s&&!b&&(0,eA.A)(p),S=x?p:{coordRange:[0,0],sizeRange:[0,0],coord:y,labelsTextStyle:{},labels:g?Object.keys(g).reduce((t,e)=>(t[e]={visible:!1,text:"",dx:0,dy:0},t),{}):null,visible:b,axis:_,axisLabel:v};S&&(S._isCache=x);let A=0;if(f&&c.forEach(({axis:t,datum:i=""})=>{var s,a,n,l,o,h,u,c,p,g;let m=null,_=t.getScale();if(fL(_.type))0===(d=_.bandwidth())&&_.step&&(A=_.step());else if(fI(_.type)){let s="xField"===r?e.fieldX[0]:e.fieldY[0],a="xField"===r?e.fieldX2:e.fieldY2,n=function(t,e,i,s){for(let r=0,a=t.length;r<a;r++){let a=t[r];if(a){let t=a[i],r=a[s||i];if(t<=e&&r>=e)return a}}return null}(e.getViewData().latestData,+i,s,a);if(n){let t="xField"===r?e.dataToPositionX(n):e.dataToPositionY(n);a?(d=Math.abs(t-("xField"===r?e.dataToPositionX1(n):e.dataToPositionY1(n))),i=`${n[s]} ~ ${n[a]}`):d=1,y=t}m=t.niceLabelFormatter}if(S&&(null==(s=f.label)?void 0:s.visible)&&!x){let e=Sk(t.getSpec()),s=t.getOrient(),r=null==(a=f.label)?void 0:a.syncAxisLabelAngle;S.labels[s]&&(S.labels[s].visible=!0,S.labels[s].text=i,"left"===s?(S.labels[s].dx=-e,S.labelsTextStyle[s]={textAlign:r&&v&&null!=(n=v.attribute.textAlign)?n:"right",textBaseline:r&&v&&null!=(l=v.attribute.textBaseline)?l:"middle"}):"right"===s?(S.labels[s].dx=e,S.labelsTextStyle[s]={textAlign:r&&v&&null!=(o=v.attribute.textAlign)?o:"left",textBaseline:r&&v&&null!=(h=v.attribute.textBaseline)?h:"middle"}):"top"===s?(S.labels[s].y=0,S.labels[s].dy=-e,S.labelsTextStyle[s]={textAlign:r&&v&&null!=(u=v.attribute.textAlign)?u:"center",textBaseline:r&&v&&null!=(c=v.attribute.textBaseline)?c:"bottom"}):"bottom"===s&&(S.labels[s].dy=e,S.labelsTextStyle[s]={textAlign:r&&v&&null!=(p=v.attribute.textAlign)?p:"center",textBaseline:r&&v&&null!=(g=v.attribute.textBaseline)?g:"top"}),S.labels[s].defaultFormatter=m)}}),S&&!x){let t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};MD(t,c),"xField"===r?(S.coordRange=[t.x1,t.x2],S.sizeRange=[t.y1,t.y2],S.coord=y+i.x,S.labels&&(S.labels.top.y=t.y1,S.labels.bottom.y=t.y2)):(S.coordRange=[t.y1,t.y2],S.sizeRange=[t.x1,t.x2],S.coord=y+i.y,S.labels&&(S.labels.left.x=t.x1,S.labels.right.x=t.x2)),(S.coord<S.coordRange[0]||S.coord>S.coordRange[1])&&(S.visible=!1),f&&f.label&&Object.keys(S.labels).forEach(t=>{S.labels[t].visible&&ML(S.labels[t],t,f.label)})}t[r].bandSize=null!=d?d:0,t[r].offsetSize=A,t[r].cacheInfo=S}),t),ML=(t,e,i)=>{let{formatMethod:s,formatter:r}=i,{formatFunc:a,args:n}=v1(s,r,t.text,{label:t.text,position:e});a?t.text=a(...n):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))},MD=(t,e)=>{e.forEach(({axis:e})=>
2{e.getRegions().forEach(e=>{let{x:i,y:s}=e.getLayoutStartPoint(),{width:r,height:a}=e.getLayoutRect();t.x1=Math.min(t.x1,i),t.y1=Math.min(t.y1,s),t.x2=Math.max(t.x2,i+r),t.y2=Math.max(t.y2,s+a)})})},MF=t=>{let e,{cacheInfo:i,attributes:s,bandSize:r,offsetSize:a,coordKey:n,anotherAxisKey:l}=t,{coord:o,sizeRange:h}=i,u=s.type;if("line"===u){let t=o+r/2;e={visible:!0,start:{[n]:t,[l]:h[0]},end:{[n]:t,[l]:h[1]}}}else if("rect"===u){let[t,u]=Mz(s,r,a,i.axis),{coordRange:d}=i;e={visible:!0,start:{[n]:Math.max(o+t,d[0]),[l]:h[0]},end:{[n]:Math.min(o+u,d[1]),[l]:h[1]}}}return e},Mz=(t,e,i,s)=>{var r,a,n;let l=0===e?i:e,o=l;if(null==(r=t.style)?void 0:r.sizePercent)o=l*t.style.sizePercent;else if("number"==typeof(null==(a=t.style)?void 0:a.size))o=t.style.size;else if("function"==typeof(null==(n=t.style)?void 0:n.size)){let e=s.getLayoutRect();o=t.style.size(e,s)}return 0===e?[-o/2,o/2]:[e/2-o/2,o/2+e/2]},MH=(t,e)=>{var i;let s=new Map,r=new Map,{series:a,datum:n}=t,l="horizontal"===a.direction,o=(l?a.getYAxisHelper():a.getXAxisHelper()).getAxisId(),h=a.getChart().getComponentsByKey("axes").find(t=>t.id===o);if(!h)return;(l?r:s).set(h.getSpecIndex(),{datum:null==(i=a.getDatumPositionValues(n[0],a.getDimensionField()))?void 0:i[0],axis:h});let u={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:s,attributes:{visible:!!s.size,type:"rect"}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:r,attributes:{visible:!!r.size,type:"rect"}}};return MI(u,a,e),u.xField.cacheInfo?MF(u.xField):u.yField.cacheInfo?MF(u.yField):void 0},Mj=["updateTitle","updateContent","updatePosition","maxLineCount","othersLine"],MV={dom:`${px.H}_TOOLTIP_HANDLER_DOM`,canvas:`${px.H}_TOOLTIP_HANDLER_CANVAS`},MN={key:"å
¶ä»",value:"..."};(tm=tP||(tP={})).group="group",tm.mark="mark",tm.dimension="dimension";class MW{constructor(t){this._showTooltipByHandler=(t,e)=>{var i,s,r;let a;if((0,eE.A)(t))return 1;e.changePositionOnly||this.clearCache(),this._updateViewSpec(t,e);let n=this._cacheActiveSpec;if((0,eE.A)(n)||!1===n.visible)return 1;e.tooltipSpec=this.component.getSpec(),e.activeTooltipSpec=n;let{title:l,content:o}=n,h=(0,eE.A)(null==l?void 0:l.key)&&(0,eE.A)(null==l?void 0:l.value)&&!(null==o?void 0:o.length);return(this.component.event.emit(dj.tooltipShow,Object.assign(Object.assign({},e),{isEmptyTooltip:h,tooltipData:t,activeType:this.activeType,tooltip:this.component})),h)?1:((null==(i=n.handler)?void 0:i.showTooltip)?a=n.handler.showTooltip.bind(n.handler):(null==(s=this.component.tooltipHandler)?void 0:s.showTooltip)&&(a=this.component.tooltipHandler.showTooltip.bind(this.component.tooltipHandler)),a?null!=(r=a(this.activeType,t,e))?r:0:1)},this.component=t}_preprocessDimensionInfo(t){let e=[];
2if(null==t||t.forEach(t=>{let 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.tooltip)?void 0:i.visible)})});i.data.length>0&&e.push(i)}),e.length>0)return e}_updateViewSpec(t,e){var i,s,r,a,n,l,o,h,u;let{changePositionOnly:d,model:c}=e;if(!d||!this._cacheActiveSpec){let d=this.component.getSpec();if(this._cacheActiveSpec=((t,e,i,s,r)=>{var a,n,l;let o={activeType:t};switch(t){case"mark":case"group":if(i){let l=null==(a=i.getSpec())?void 0:a.tooltip;return o.visible=!0,(null==l?void 0:l.handler)&&(o.handler=l.handler),(null==(n=o.handler)?void 0:n.showTooltip)?o:((null==l?void 0:l[t])&&Mj.forEach(e=>{(0,eA.A)(l[t][e])&&(o[e]=l[t][e])}),Object.assign(Object.assign({},o),i.tooltipHelper.getTooltipData(t,e,s,s[0].datum,r)))}break;case"dimension":if(null==s?void 0:s.length){let i;if((i=[],s.forEach(t=>{t.data.forEach(t=>{(0,eA.A)(t.series)&&i.push(t.series)})}),i).every(t=>{var e;return!v8("dimension",null==(e=t.tooltipHelper)?void 0:e.spec)})?o.visible=!1:o.visible=!0,o.handler=e.handler,null==(l=o.handler)?void 0:l.showTooltip)return o;let a=[];return s.forEach(i=>i.data.forEach(i=>{let{series:n}=i,l=n.tooltipHelper.getTooltipData(t,e,s,i.datum,r);l&&a.push(l)})),function(t){if(!t||!t.length)return null;let 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]}(a)}}return null})(this.activeType,this.component.getSpec(),c,t,e),this._cacheActiveSpec){(0,eE.A)(this._cacheActiveSpec.handler)&&(0,eA.A)(d.handler)&&(this._cacheActiveSpec.handler=d.handler);let c=null!=(i=d[this.activeType])?i:{},p=null!=(s=this._cacheActiveSpec.updateTitle)?s:c.updateTitle,g=null!=(r=this._cacheActiveSpec.updateContent)?r:c.updateContent,f=null!=(n=null!=(a=this._cacheActiveSpec.maxLineCount)?a:c.maxLineCount)?n:20;if(p&&(this._cacheActiveSpec.title=null!=(l=p(this._cacheActiveSpec.title,t,e))?l:this._cacheActiveSpec.title),g)this._cacheActiveSpec.content=null!=(o=g(this._cacheActiveSpec.content,t,e))?o:this._cacheActiveSpec.content;else if(f>=1&&(null==(h=this._cacheActiveSpec.content)?void 0:h.length)>f){let t=null!=(u=this._cacheActiveSpec.othersLine)?u:c.othersLine,e=t?Object.assign(Object.assign({},MN),t):MN;this._cacheActiveSpec.content=[...this._cacheActiveSpec.content.slice(0,f-1),Object.assign(Object.assign({},this._cacheActiveSpec.content[f-1]),e)]}}}}shouldHandleTooltip(t,e){var i,s;return!!this.component.enable&&!(0,eE.A)(e)&&v8(this.activeType,null==(s=null==(i=t.model)?void 0:i.tooltipHelper)?void 0:s.spec)}clearCache(){this._cacheActiveSpec=void 0}}class MU extends MW{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){let 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,s;let r,a=this.component.getChart(),n=a.getCompiler().getStage().getLayer(void 0),l={x:t.event.viewX,y:t.event.viewY};if(n.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},l),0===(r=null!=(s=null==(i=(e=this.component.getOption()).getDimensionInfo)?void 0:i.call(e,a,l,!0))?s:[]).length)r=void 0;else if(r.length>1){let t=r.filter(t=>{var e;let i,s=t.axis;if(s.getSpec().hasDimensionTooltip)return!0;if(!fL(s.getScale().type))return!1;for(let t of null!=(e=null==s?void 0:s.getRegions())?e:[]){for(let e of t.getSeries())if("cartesian"===e.coordinate){i=e;break}if((0,eA.A)(i))break}return(0,eA.A)(i)&&i.getDimensionField()[0]===i.fieldY[0]?"left"===s.getOrient()||"right"===s.getOrient():"bottom"===s.getOrient()||"top"===s.getOrient()});if((r=t.length?t:r.slice(0,1)).length>1){let t=new Set;r.forEach(e=>{e.data=e.data.filter(({key:e})=>!t.has(e)&&(t.add(e),!0))})}}return r}getMouseEventData(t){return{tooltipInfo:this._getDimensionInfo(t),ignore:!1}}}let MG=()=>{uP.registerTooltipProcessor("dimension",MU)};class MY extends MW{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){var s,r,a;let{datum:n,series:l}=t,o=this.component.getSpec(),h=[{datum:[n],series:l}],u=l.tooltipHelper,d=null==(s=l.getSpec())?void 0:s.tooltip,c=null==(r=null==d?void 0:d.mark)?void 0:r.checkOverlap,p=!1;if(!0===c||!0===(null==(a=o.mark)?void 0:a.checkOverlap)&&!1!==c){let t=null==u?void 0:u.activeTriggerSet.mark;if(t){p=!0;let i=this.component.getChart().getCompiler().getStage().getLayer(void 0),s={x:e.event.viewX,y:e.event.viewY};
2i.globalTransMatrix.transformPoint({x:e.event.viewX,y:e.event.viewY},s),t.forEach(t=>{t.getGraphics().forEach(t=>{t!==e.node&&t&&t.containsPoint(s.x,s.y,h_.GLOBAL,t.stage.getPickerService())&&h[0].datum.push(u3(t))})})}}let g=Object.assign(Object.assign({},e),{model:l,changePositionOnly:i,tooltip:this.component});if(i&&p){let 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,r=null==(e=t.model)?void 0:e.modelType;if("series"===r){let e=t.model,r=e.tooltipHelper,a=null==r?void 0:r.activeTriggerSet.mark,n=null==r?void 0:r.ignoreTriggerSet.mark;(null==a?void 0:a.has(t.mark))?i={mark:t.mark,datum:t.datum,series:e}:(null==n?void 0:n.has(t.mark))&&(s=!0)}else if("component"===r){let e=t.model,r=t.node;if("label"===e.name&&r){let t=e.getLabelInfoByTextGraphic(r),{baseMark:a,series:n,labelMark:l}=null!=t?t:{},o=n.tooltipHelper,h=null==o?void 0:o.activeTriggerSet.mark,u=null==o?void 0:o.ignoreTriggerSet.mark;(null==h?void 0:h.has(l))?i={mark:a,datum:r.attribute.data,series:n}:(null==u?void 0:u.has(l))&&(s=!0)}}return{tooltipInfo:i,ignore:s}}}let M$=()=>{uP.registerTooltipProcessor("mark",MY)};class MX extends MW{constructor(){super(...arguments),this.activeType="group"}showTooltip(t,e,i){let{datum:s,series:r}=t,a=[{datum:oS(s),series:r}],n=Object.assign(Object.assign({},e),{groupDatum:this._getGroupDatum(e),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(a,n)}getMouseEventData(t){var e,i;let s;if("series"===(null==(e=t.model)?void 0:e.modelType)){let e=t.model,r=e.tooltipHelper,a=null==r?void 0:r.activeTriggerSet.group;if(null==a?void 0:a.has(t.mark)){let r=this.component.getSpec()[this.activeType];((null==r?void 0:r.triggerMark)?oS(r.triggerMark):[]).includes(null==(i=t.mark)?void 0:i.name)&&(s={mark:t.mark,datum:t.datum,series:e})}}return{tooltipInfo:s,ignore:!1}}_getGroupDatum(t){let{model:e,mark:i,datum:s}=t;if(["line","area"].includes(i.type))return oS(s);let r=e.getViewData().latestData,a=e.getSeriesField();if(!a)return r;let n=oS(s)[0][a];return r.filter(t=>t[a]===n)}}let MK=()=>{uP.registerTooltipProcessor("group",MX)};class Mq extends Mu{constructor(){super(...arguments),this.transformerConstructor=Ma,this.type="line",this.seriesType=dD.line}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}Mq.type="line",Mq.seriesType=dD.line,Mq.transformerConstructor=Ma,yg(Mq,Mp);let MZ=["segments","points","curveType","curveTension",...nX];class MJ extends n0{constructor(t){super(t),this.type="area",this.numberType=ny}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;let{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return rQ(this).area}
2updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ie.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);let{lineJoin:s=e.lineJoin}=t;return ie.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){let{points:r=e.points}=t;return r.forEach(t=>{var e,s;i.add(t.x,t.y),i.add(null!=(e=t.x1)?e:t.x,null!=(s=t.y1)?s:t.y)}),i}updateAreaAABBBoundsBySegments(t,e,i,s){let{segments:r=e.segments}=t;return r.forEach(t=>{t.points.forEach(t=>{var e,s;i.add(t.x,t.y),i.add(null!=(e=t.x1)?e:t.x,null!=(s=t.y1)?s:t.y)})}),i}_interpolate(t,e,i,s,r){"points"===t&&(r.points=an(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,MZ)}needUpdateTag(t){return super.needUpdateTag(t,MZ)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new sO;let e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0,s=[];if(e.forEach(e=>{var r,a;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!=(r=e.x1)?r:e.x,y:null!=(a=e.y1)?a: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 MJ(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return MJ.NOWORK_ANIMATE_ATTR}}function MQ(t){return new MJ(t)}MJ.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},nQ);let M0=!1,M1=new eL(t=>{M0||(M0=!0,t(o2).toSelf().inSingletonScope(),t(lr).to(o2).inSingletonScope(),t(ln).toService(lr),t(l9).toService(o_),eX(t,l9),t(o3).toSelf().inSingletonScope())}),M2=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ny}};M2=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(t_=eU(lr),function(t,e){t_(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],M2);let M3=!1,M5=new eL((t,e,i,s)=>{M3||(M3=!0,t(gm).to(M2).inSingletonScope(),t(gC).toService(gm))}),M4=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ny}};M4=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(ty=eU(lr),function(t,e){ty(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],M4);let M8=!1,M6=new eL((t,e,i,s)=>{M8||(M8=!0,t(ga).to(M4).inSingletonScope(),t(gs).toService(ga))});function M9(){M9.__loaded||(M9.__loaded=!0,lF.RegisterGraphicCreator("area",MQ),e7.load(M1),e7.load(gi?M5:M6))}M9.__loaded=!1;let M7=[...bF,"fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"];class wt extends bz{constructor(){super(...arguments),this.type=wt.type,this._isValidPointChannel=t=>["x","y","x1","y1","defined"].includes(t)}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getSegmentAttributes(){return M7}_getIgnoreAttributes(){return[]}}wt.type="area";let we=()=>{uP.registerMark(wt.type,wt),_k(),M9(),xZ(),x0(),vM(),uP.registerGraphicComponent("area",MQ)};class wi extends bt{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var s,r,a,n;for(let i of oS(e)){let e=null==(s=this.series.getSeriesStyle(t))?void 0:s(i);if(!1!==e||"fill"!==i&&"stroke"!==i||(e="fill"===i?null==(a=null==(r=this.series.getSeriesStyle(t))?void 0:r("stroke"))?void 0:a[0]:null==(n=this.series.getSeriesStyle(t))?void 0:n("fill")),(0,eA.A)(e))return e}return i}}}let ws=Object.assign(Object.assign(Object.assign({},bc),bR),{area:{name:"area",type:"area"}});class wr extends x4{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){var e,i,s;let r=!1!==(null==(e=t.point)?void 0:e.visible)&&!1!==(null==(s=null==(i=t.point)?void 0:i.style)?void 0:s.visible);this._addMarkLabelSpec(t,t=>{let e="inside-middle"===t.position;return!r||e?"area":"point"}),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0)}_transformSpecAfterMergingTheme(t,e,i){var s,r,a,n,l;super._transformSpecAfterMergingTheme(t,e,i);let{area:o={},line:h={},seriesMark:u}=t,d=!1!==o.visible&&!1!==(null==(s=o.style)?void 0:s.visible),c=!1!==h.visible&&!1!==(null==(r=h.style)?void 0:r.visible);o.support3d=!(!o.support3d&&!h.support3d),o.zIndex=(0,eA.A)(o.zIndex)||(0,eA.A)(h.zIndex)?Math.max(null!=(a=o.zIndex)?a:0,null!=(n=h.zIndex)?n:0):void 0,o.style&&delete o.style.stroke,o.state&&Object.keys(o.state).forEach(t=>{"style"in o.state[t]?delete o.state[t].style.stroke:delete o.state[t].stroke});let p=o,g=h;("line"===u||c&&!d)&&(p=h,g=o),o.style=uy({},g.style,p.style),o.state=uy({},g.state,p.state),!1===o.interactive&&(o.style.fillPickable=!1),!1===h.interactive&&(h.style.strokePickable=!1),o.interactive=!(!o.interactive&&null!=(l=h.interactive)&&!l),t.area=o,t.line=h}}class wa extends bP{constructor(){super(...arguments),this.type=dD.area,this.transformerConstructor=wr,this._sortDataByAxis=!1}initMark(){var t;let e=null!=(t=this._spec.seriesMark)?t:"area",i=this._isAreaVisible()||this._isLineVisible();this._areaMark=this._createMark(wa.mark.area,{groupKey:this._seriesField,isSeriesMark:i&&"point"!==e},{morphElementKey:this.getDimensionField()[0]}),this.initSymbolMark("point"===e)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){var t,e,i,s,r;let a=null!=(i=null==(e=null==(t=this.getSpec().area)?void 0:t.style)?void 0:e.curveType)?i:null==(r=null==(s=this.getSpec().line)?void 0:s.style)?void 0:r.curveType,n=a===bO?"horizontal"===this._direction?"monotoneY":"monotoneX":a,l=this._areaMark;if(l){let t=this._isAreaVisible(),e=this._isLineVisible();t||e?l.setVisible(!0):l.setVisible(!1),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:t=>{var e,i;return mB(this.dataToPositionX1(t),null==(i=null==(e=this._xAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),y1:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",N.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:this.dataToPositionX.bind(this),y1:t=>{var e,i;return mB(this.dataToPositionY1(t),null==(i=null==(e=this._yAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",N.Series),this.setMarkStyle(l,{fill:!!t&&this.getColorAttribute(),stroke:!!e&&this.getColorAttribute()},"normal",N.Series),"zero"!==this._invalidType&&this.setMarkStyle(l,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()}
2,"normal",N.Series),this.getStack()&&this.setMarkStyle(l,{zIndex:t=>-t[pC]},"normal",N.Series),this.setMarkStyle(l,{curveType:n},"normal",N.Built_In),Object.keys(l.stateStyle).forEach(t=>{l.stateStyle[t].stroke&&l.setPostProcess("stroke",t=>[t,!1,!1,!1],t)})}}initAnimation(){var t,e,i,s;let r={direction:this.direction},a=null==(t=this._spec.animationAppear)?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("line"))?void 0:e(r,a),bx("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("area"))?void 0:i(r,a),bx("area",this._spec,this._markAttributeContext))),this._symbolMark){let t=bE(this);this._symbolMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("scaleInOut"))?void 0:s(),bx("point",this._spec,this._markAttributeContext),t))}}_isAreaVisible(){var t;let e=this._spec.area||{};return!1!==e.visible&&!1!==(null==(t=e.style)?void 0:t.visible)}_isLineVisible(){var t;let e=this._spec.line||{};return!1!==e.visible&&!1!==(null==(t=e.style)?void 0:t.visible)}initTooltip(){this._tooltipHelper=new wi(this);let{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(){super.onLayoutEnd(),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,s,r,a,n;let l=null!=(i=this._spec.seriesMark)?i:"area",o=null!=(r=null==(s=this._seriesMark)?void 0:s.getAttribute(e,t))?r:void 0;return"fill"!==e||o&&"line"!==l||(e="stroke",o=null!=(n=null==(a=this._seriesMark)?void 0:a.getAttribute(e,t))?n:void 0),"stroke"===e&&(0,ev.A)(o)?o[0]:o}}}wa.type=dD.area,wa.builtInTheme={area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"}},wa.mark=ws,wa.transformerConstructor=wr,yg(wa,bI);class wn extends Mr{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["point","line","area","seriesMark","activePoint","sampling","samplingFactor","pointDis","pointDisMul","markOverlap","areaLabel","useSequentialAnimation"])}transformSpec(t){super.transformSpec(t),fu(t)}}class wl extends Mu{constructor(){super(...arguments),this.transformerConstructor=wn,this.type="area",this.seriesType=dD.area}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}function wo(t,e=!0){return(i,s,r)=>{let a="vertical"===t.direction?t.yField:t.xField,n=null==i?void 0:i[a];return"vertical"===t.direction?{overall:e?t.growFrom():e,orient:n>0?"negative":"positive"}:{overall:!!e&&t.growFrom(),orient:n>0?"positive":"negative"}}}wl.type="area",wl.seriesType=dD.area,wl.transformerConstructor=wn,yg(wl,Mp);let wh=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:wo(t,e)}),wu=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:wo(t,e)}),wd={type:"fadeIn"},wc={type:"growCenterIn"};var wp=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class wg extends xG{constructor(t,e){const{data:i}=t,s=wp(t,["data"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({data:i},eB({},wg.defaultAttributes,s)))}labeling(t,e,i="top",s=0){if(!t||!e)return;let{x1:r,y1:a,x2:n,y2:l}=t,o=Math.abs(n-r),h=Math.abs(l-a),{x:u,y:d}=SQ(e,i),c=0,p=0,g=i.includes("inside");switch(i.includes("top")?p=g?1:-1:i.includes("bottom")?p=g?-1:1:i.includes("left")?c=g?1:-1:i.includes("right")&&(c=g?-1:1),i){case"top-right":case"bottom-right":c=-1;break;case"top-left":case"bottom-left":c=1}return{x:u+c*s+c*o/2,y:d+p*s+p*h/2}}}wg.tag="rect-label",wg.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};class wf extends _x{constructor(){super(...arguments),this.type=wf.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}wf.type="rect";let wm=()=>{_k(),fh(),x$("rect",wg),uP.registerMark(wf.type,wf),y_.registerBuiltInAnimate("growHeightIn",y2),y_.registerBuiltInAnimate("growHeightOut",y3),y_.registerBuiltInAnimate("growWidthIn",y5),y_.registerBuiltInAnimate("growWidthOut",y4),y_.registerBuiltInAnimate("growCenterIn",y8),y_.registerBuiltInAnimate("growCenterOut",y6),uP.registerGraphicComponent("rect",g1)},w_=Object.assign(Object.assign({},bc),{bar:{name:"bar",type:"rect"}
2,barBackground:{name:"barBackground",type:"rect"}});function wy(t,e,i,s,r,a){let n=i.getSpec().barMinHeight,l=i[s.axisHelper].isInverse(),o=mB(i[s.startMethod](t),r),h=mB(i[s.endMethod](t),r);a&&(e=o);let u=Math.abs(o-h);u<=0&&!mE(t[i.getStackValueField()],r)?u=0:u<n&&(u=n);let d=1;return h<o?d=-1:h===o&&(d=s.isVertical?l?1:-1:l?-1:1),h=e+d*u,t[s.start]=e,t[s.end]=h,h}class wv extends bT{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar")}}class wb extends bP{constructor(){super(...arguments),this.type=dD.bar,this._barMarkName="bar",this._barMarkType="rect",this.transformerConstructor=wv,this._bandPosition=0,this._getLinearBarRange=(t,e)=>{let[i,s]=[t,e].sort((t,e)=>t-e),r=s-i;if(this._spec.barGap){let t=.5*this._spec.barGap;i+=t,s-=t}let a=s-i,n=hX(this._spec.barMinWidth||2,r);if(a<n){let t=(n-a)/2;i-=t,s+=t}return[i,s]},this._getBarXStart=(t,e,i)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[bp]):this._spec.barMinHeight?this._calculateRectPosition(t,!1,i):mB(this._dataToPosX(t),e,i),this._getBarXEnd=(t,e,i)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[bg]):mB(this._dataToPosX1(t),e,i),this._getLinearBarXRange=(t,e,i)=>{let s=mB(this._dataToPosX(t),e,i),r=mB(this._dataToPosX1(t),e,i);return this._getLinearBarRange(s,r)},this._getBarYStart=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[bf]):this._spec.barMinHeight?this._calculateRectPosition(t,!0):mB(this._dataToPosY(t),e),this._getBarYEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[bm]):mB(this._dataToPosY1(t),e),this._getLinearBarYRange=(t,e,i)=>{let s=mB(this._dataToPosY(t),e,i),r=mB(this._dataToPosY1(t),e,i);return this._getLinearBarRange(s,r)},this._getBarBackgroundXStart=t=>{let e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundXEnd=t=>{let e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundYStart=t=>{let e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundYEnd=t=>{let e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundPositionXEncoder=()=>{var t;return null==(t=this._barBackgroundPositionXEncoder)?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.bind(this)},this._setBarBackgroundPositionYEncoder=t=>{this._barBackgroundPositionYEncoder=t.bind(this)}}initMark(){this._initBarBackgroundMark(),this._barMark=this._createMark(Object.assign(Object.assign({},wb.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{groupKey:this._seriesField,isSeriesMark:!0},{morphElementKey:this.getDimensionField()[0],morph:bk(this._spec,this._barMarkName)})}_initBarBackgroundMark(){this._spec.barBackground&&this._spec.barBackground.visible&&(this._barBackgroundMark=this._createMark(wb.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId()}))}initMarkStyle(){this._barMark&&this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",N.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();let{mark:t,group:e}=this._tooltipHelper.activeTriggerSet;this._barMark&&(t.add(this._barMark),e.add(this._barMark))}_statisticViewData(){var t,e;let i;super._statisticViewData();let s=null!=(t=this._spec.barBackground)?t:{};if(!s.visible)return;let r=this._getRelatedComponentSpecInfo("axes").some(t=>t.type===hc.cartesianBandAxis);if(c3(this._option.dataSet,"addVChartProperty",vJ),r){let t=([t],{scaleDepth:e})=>{var i,s;let r=[{}],a=this.getDimensionField(),n=(0,eE.A)(e)?a.length:Math.min(a.length,e);for(let e=0;e<n;e++){let n=a[e],l=null==(i=t.latestData[n])?void 0:i.values;if(!(null==l?void 0:l.length))continue;let o=[],h=null!=(s=this._spec.dataKey)?s:pA;for(let t=0;t<l.length;t++)for(let e=0;e<r.length;e++)o.push(Object.assign(Object.assign({},r[e]),{[n]:l[t],[h]:l[t]}));r=o}return r};c3(this._option.dataSet,"dimensionItems",t),i=new eR(this._option.dataSet).parse([this._viewDataStatistics],{type:"dataview"}).transform({type:"dimensionItems",options:{scaleDepth:(0,eE.A)(s.fieldLevel)?void 0:s.fieldLevel+1}}
2,!1).transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1),null==(e=this._viewDataStatistics)||e.target.addListener("change",i.reRunAllTransform)}else{let t=([t])=>{let i=[],[s,r]=this.getDimensionContinuousField(),a={};return e.latestData.forEach(t=>{let e=`${t[s]}-${t[r]}`;a[e]||(a[e]={[s]:t[s],[r]:t[r]},i.push(a[e]))}),i};c3(this._option.dataSet,"dimensionItems",t);let e=this.getViewData();i=new eR(this._option.dataSet).parse([e],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1),null==e||e.target.addListener("change",i.reRunAllTransform)}this._barBackgroundViewData=new mz(this._option,i)}init(t){var e,i;super.init(t),"vertical"===this.direction?"band"===(null==(e=this._xAxisHelper)?void 0:e.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():"band"===(null==(i=this._yAxisHelper)?void 0:i.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){let t=this.getRegion();return this.getStack()&&t.getSeries().filter(t=>t.type===this.type&&t.getSpec().barMinHeight).length}_calculateStackRectPosition(t){let e,i,s,r,a,n=this.getRegion();if(n._bar_series_position_calculated)return;n._bar_series_position_calculated=!0,t?(e=bm,i=bf,s="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(e=bg,i=bp,s="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");let l=vq(n,!1,t=>t.type===this.type);for(let o in l)for(let h in l[o].nodes)!function t(e,i,s){var r,a;if(e.values.length>0){let t;if(e.sortDatums.length){let n=e.sortDatums;i&&(n=e.sortDatums.slice().reverse());for(let e=0;e<n.length;e++)t=wy(n[e].datum,t,n[e].series,s,null==(a=(r=n[e].series[s.axisHelper]).getScale)?void 0:a.call(r,0),0===e)}else{let r=e.series;i&&(r=r.slice().reverse()),r.forEach(({s:e,values:r},a)=>{var n,l;let o=null==(l=(n=e[s.axisHelper]).getScale)?void 0:l.call(n,0);for(let n=0;n<r.length;n++)t=wy(r[i?r.length-1-n:n],t,e,s,o,0===n&&0===a)})}}for(let r in e.nodes)t(e.nodes[r],i,s)}(l[o].nodes[h],n.getStackInverse(),{isVertical:t,start:e,end:i,startMethod:s,endMethod:r,axisHelper:a})}_calculateRectPosition(t,e,i){var s,r;let a,n,l;e?(a="_dataToPosY1",n="_dataToPosY",l="_yAxisHelper"):(a="_dataToPosX1",n="_dataToPosX",l="_xAxisHelper");let o=null==(r=(s=this[l]).getScale)?void 0:r.call(s,0),h=this[l].isInverse(),u=this._spec.barMinHeight,d=mB(this[a](t),o,i),c=mB(this[n](t),o,i),p=Math.abs(d-c);p<=0&&!mE(t[this.getStackValueField()],o)?p=0:p<u&&(p=u);let g=1;return c<d?g=-1:c===d&&(g=e?h?1:-1:h?-1:1),d+g*p}_dataToPosX(t){return this.dataToPositionX(t)}_dataToPosX1(t){return this.dataToPositionX1(t)}_dataToPosY(t){return this.dataToPositionY(t)}_dataToPosY1(t){return this.dataToPositionY1(t)}initBandRectMarkStyle(){var t,e,i,s;let r=null==(e=null==(t=this._xAxisHelper)?void 0:t.getScale)?void 0:e.call(t,0),a=null==(s=null==(i=this._yAxisHelper)?void 0:i.getScale)?void 0:s.call(i,0);"horizontal"===this.direction?this.setMarkStyle(this._barMark,{x:t=>this._getBarXStart(t,r),x1:t=>this._getBarXEnd(t,r),y:t=>this._getPosition(this.direction,t),height:()=>this._getBarWidth(this._yAxisHelper),width:()=>{},y1:()=>{}},"normal",N.Series):this.setMarkStyle(this._barMark,{y:t=>this._getBarYStart(t,a),y1:t=>this._getBarYEnd(t,a),x:t=>this._getPosition(this.direction,t),width:()=>this._getBarWidth(this._xAxisHelper),x1:()=>{},height:()=>{}},"normal",N.Series),this._initStackBarMarkStyle(),this._initBandBarBackgroun
2dMarkStyle()}_initStackBarMarkStyle(){var t,e,i,s;if(!this._spec.stackCornerRadius)return;let r=null==(e=null==(t=this._xAxisHelper)?void 0:t.getScale)?void 0:e.call(t,0),a=null==(s=null==(i=this._yAxisHelper)?void 0:i.getScale)?void 0:s.call(i,0),n="vertical"===this.direction;this._barMark.setMarkConfig({clip:!0,clipPath:()=>{let t=!!this._shouldDoPreCalculate();t&&this._calculateStackRectPosition(n);let e=[];return this._forEachStackGroup(i=>{let s=1/0,l=-1/0,o=1/0,h=-1/0,u=!1,d=1/0,c=-1/0;i.values.forEach(e=>{let i=e[pT],r=e[pC],a=e[pB],p=e[pE];if(s=Math.min(s,i,r),l=Math.max(l,i,r),t){let t=e[n?bf:bp],i=e[n?bm:bg];o=Math.min(o,t,i),h=Math.max(h,t,i)}(0,eA.A)(a)&&(0,eA.A)(p)&&(u=!0,d=Math.min(d,a,p),c=Math.max(c,a,p))});let p=Object.assign(Object.assign(Object.assign({},i.values[0]),{[pT]:s,[pC]:l}),u?{[pB]:d,[pE]:c}:void 0),g="horizontal"===this.direction?{x:t?o:this._getBarXStart(p,r),x1:t?h:this._getBarXEnd(p,r),y:this._getPosition(this.direction,p),height:this._getBarWidth(this._yAxisHelper)}:{y:t?o:this._getBarYStart(p,a),y1:t?h:this._getBarYEnd(p,a),x:this._getPosition(this.direction,p),width:this._getBarWidth(this._xAxisHelper)};e.push(g1(Object.assign(Object.assign({},g),{cornerRadius:(0,r3.A)(this._spec.stackCornerRadius)?this._spec.stackCornerRadius(g,p,this._markAttributeContext):this._spec.stackCornerRadius,fill:!0})))}),e}})}initLinearRectMarkStyle(){var t,e,i,s;let r=null==(e=null==(t=this._xAxisHelper)?void 0:t.getScale)?void 0:e.call(t,0),a=null==(s=null==(i=this._yAxisHelper)?void 0:i.getScale)?void 0:s.call(i,0);if("horizontal"===this.direction){let t=(0,eA.A)(this._fieldY2)?{y:t=>this._getLinearBarYRange(t,a,!0)[0],y1:t=>this._getLinearBarYRange(t,a,!0)[1]}:{y:t=>mB(this._dataToPosY(t)-this._getBarWidth(this._yAxisHelper)/2,a,!0),height:t=>this._getBarWidth(this._yAxisHelper)};this.setMarkStyle(this._barMark,Object.assign({x:t=>this._getBarXStart(t,r,!0),x1:t=>this._getBarXEnd(t,r,!0)},t),"normal",N.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign({x:()=>this._getBarBackgroundXStart(r),x1:()=>this._getBarBackgroundXEnd(r)},t),"normal",N.Series)}else{let t=(0,eA.A)(this._fieldX2)?{x:t=>this._getLinearBarXRange(t,r,!0)[0],x1:t=>this._getLinearBarXRange(t,r,!0)[1]}:{x:t=>mB(this._dataToPosX(t)-this._getBarWidth(this._xAxisHelper)/2,r,!0),width:t=>this._getBarWidth(this._xAxisHelper)};this.setMarkStyle(this._barMark,Object.assign(Object.assign({},t),{y:t=>this._getBarYStart(t,a),y1:t=>this._getBarYEnd(t,a)}),"normal",N.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign(Object.assign({},t),{y:()=>this._getBarBackgroundYStart(a),y1:()=>this._getBarBackgroundYEnd(a)}),"normal",N.Series)}}
2_initBandBarBackgroundMarkStyle(){var t,e,i,s,r;if(!this._barBackgroundMark)return;let a=null==(e=null==(t=this._xAxisHelper)?void 0:t.getScale)?void 0:e.call(t,0),n=null==(s=null==(i=this._yAxisHelper)?void 0:i.getScale)?void 0:s.call(i,0),l=null!=(r=this._spec.barBackground)?r:{},o=(0,eE.A)(l.fieldLevel)?void 0:l.fieldLevel+1;"horizontal"===this.direction?this.setMarkStyle(this._barBackgroundMark,{x:()=>this._getBarBackgroundXStart(a),x1:()=>this._getBarBackgroundXEnd(a),y:t=>this._getPosition(this.direction,t,o,"barBackground"),height:()=>this._getBarWidth(this._yAxisHelper,o),width:()=>{},y1:()=>{}},"normal",N.Series):this.setMarkStyle(this._barBackgroundMark,{x:t=>this._getPosition(this.direction,t,o,"barBackground"),y:()=>this._getBarBackgroundYStart(n),y1:()=>this._getBarBackgroundYEnd(n),width:()=>this._getBarWidth(this._xAxisHelper,o),x1:()=>{},height:()=>{}},"normal",N.Series)}initAnimation(){var t,e;let i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var t;let e="horizontal"===this.direction?null==(t=this._xAxisHelper)?void 0:t.getScale(0):this._yAxisHelper.getScale(0);if(e){let t=e.domain(),i=oM(t),s=ok(t);return s<0?e.scale(s):i>0?e.scale(i):e.scale(0)}}},s=null==(t=this._spec.animationAppear)?void 0:t.preset,r=bE(this);this._barMark.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("bar"))?void 0:e(i,s),bx(this._barMarkName,this._spec,this._markAttributeContext),r))}_getBarWidth(t,e){var i,s;let r=this._groups?this._groups.fields.length:1,a=(0,eE.A)(e)?r:Math.min(r,e),n=null!=(s=null==(i=t.getBandwidth)?void 0:i.call(t,a-1))?s:6,l=(0,eA.A)(this._spec.barWidth)&&a===r,o=(0,eA.A)(this._spec.barMinWidth),h=(0,eA.A)(this._spec.barMaxWidth),u=n;return l&&(u=hX(this._spec.barWidth,n)),o&&(u=Math.max(u,hX(this._spec.barMinWidth,n))),h&&(u=Math.min(u,hX(this._spec.barMaxWidth,n))),u}_getPosition(t,e,i,s){var r,a,n,l,o;let h,u,d;"horizontal"===t?(h=this.getYAxisHelper(),u="height",d="barBackground"===s?this.dataToBarBackgroun
2dPositionY.bind(this):this.dataToPositionY.bind(this)):(h=this.getXAxisHelper(),u="width",d="barBackground"===s?this.dataToBarBackgroundPositionX.bind(this):this.dataToPositionX.bind(this));let c=h.getScale(0),p=this._groups?this._groups.fields.length:1,g=(0,eE.A)(i)?p:Math.min(p,i),f=null!=(a=null==(r=h.getBandwidth)?void 0:r.call(h,g-1))?a:6,m=g===p?this._barMark.getAttribute(u,e):f;if(g>1&&(0,eA.A)(this._spec.barGapInGroup)){let t=this._groups.fields,i=oS(this._spec.barGapInGroup),s=0,r=0;for(let a=t.length-1;a>=1;a--){let u=t[a],d=null!=(l=null==(n=h.getScale(a))?void 0:n.domain())?l:[],c=d.length,p=hX(null!=(o=i[a-1])?o:oA(i),f),g=d.indexOf(e[u]);a===t.length-1?(s+=c*m+(c-1)*p,r+=g*(m+p)):(r+=g*(s+p),s+=s+(c-1)*p)}return c.scale(e[t[0]])+h.getBandwidth(0)/2-s/2+r}let _=fI(c.type||"band");return d(e,g)+.5*(f-m)+(_?-f/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(){super.onLayoutEnd(),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}onDataUpdate(){super.onDataUpdate(),this.getRegion()._bar_series_position_calculated=!1}compile(){if(super.compile(),this._spec.sampling){let{width:t,height:e}=this._region.getLayoutRect(),i=this._fieldY,s=this._fieldX;this._data.setTransform([{type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?s[0]:i[0],groupBy:this._seriesField,mode:this._spec.sampling}])}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),null==(t=this._barBackgroundViewData)||t.compile()}fillData(){var t,e;super.fillData(),null==(e=null==(t=this._barBackgroundViewData)?void 0:t.getDataView())||e.reRunAllTransform()}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null==(i=null==(e=this._barBackgroundViewData)?void 0:e.getDataView())||i.reRunAllTransform(),null==(s=this._barBackgroundViewData)||s.updateData()}release(){var t;super.release(),null==(t=this._barBackgroundViewData)||t.release(),this._barBackgroundViewData=null}}wb.type=dD.bar,wb.builtInTheme={bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}}},wb.mark=w_,wb.transformerConstructor=wv;let wx=()=>{Mt(),wm(),uP.registerAnimation("bar",(t,e)=>({appear:function(t,e){if(!1===e)return{};switch(e){case"fadeIn":return wd;case"scaleIn":return wc;default:return wh(t)}}
2(t,e),enter:wh(t,!1),exit:wu(t,!1),disappear:{duration:vy.disappear.duration}})),kF(),kZ(),uP.registerSeries(wb.type,wb)};class wS extends Mr{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barMinHeight","sampling","samplingFactor","barBackground","stackCornerRadius","useSequentialAnimation"])}transformSpec(t){super.transformSpec(t),fu(t)}_transformAxisSpec(t){var e,i;if(super._transformAxisSpec(t),!t.axes)return;let s=t.series.some(t=>"horizontal"===t.direction),r=null!=(e=t.axes.find(t=>"band"===t.type))?e:t.axes.find(t=>(s?["left","right"]:["top","bottom"]).includes(t.orient));if(r&&!r.bandSize&&!r.maxBandSize&&!r.minBandSize&&t.autoBandSize){let e=r2(t.autoBandSize)&&null!=(i=t.autoBandSize.extend)?i:0,{barMaxWidth:s,barMinWidth:a,barWidth:n,barGapInGroup:l}=t.series.find(t=>"bar"===t.type);this._applyAxisBandSize(r,e,{barMaxWidth:s,barMinWidth:a,barWidth:n,barGapInGroup:l})}}}class wA extends Mu{constructor(){super(...arguments),this.transformerConstructor=wS,this.type="bar",this.seriesType=dD.bar}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}wA.type="bar",wA.seriesType=dD.bar,wA.transformerConstructor=wS,yg(wA,Mp);let wk=[10,20],wM=Y.Linear,ww=Y.Ordinal,wT=["circle","square","triangle","diamond","star"],wC=Object.assign(Object.assign({},bc),{point:{name:"point",type:"symbol"}});class wB extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class wE extends bP{constructor(){super(...arguments),this.type=dD.scatter,this.transformerConstructor=wB,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},r){var a,n,l,o;if((0,r3.A)(e))return e;if((0,ev.A)(e)){if((0,eE.A)(t))return null==(a=this._option)||a.onError(`${r}Field is required.`),e;if("ordinal"!==i&&e.length>2)return null==(n=this._option)||n.onError(`${r} length is invalid, specify up to 2 ${r}s.`),e;let s=`${px.H}_series_scatter_${this.id}_scale_${r}`;return this._option.globalScale.registerModelScale({id:s,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:s,field:t}}if(r2(e)){if((0,eE.A)(t))return null==(l=this._option)||l.onError(`${r}Field is required.`),e;let a=Object.assign({id:`${px.H}_series_scatter_${this.id}_scale_${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==(o=this._option)||o.onError(`${r} attribute is invalid.`),e}getSizeAttribute(t,e){return(0,eE.A)(e)?10:ed(e)?e:!(0,eS.A)(e)||"string"!=typeof e||isNaN(Number(e))||isNaN(parseFloat(e))?this._getSeriesAttribute(t,e,{defaultScaleType:wM,defaultRange:wk},"size"):parseFloat(e)}getShapeAttribute(t,e){return(0,eE.A)(e)?"circle":(0,eS.A)(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:ww,defaultRange:wT},"shape")}initMark(){this._symbolMark=this._createMark(wE.mark.point,{groupKey:this._seriesField,isSeriesMark:!0},{morph:bk(this._spec,wE.mark.point.name),morphElementKey:this.getDimensionField()[0]})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;let s=bE(this),r=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._symbolMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("scatter"))?void 0:i({},r),bx("point",this._spec,this._markAttributeContext),s))}initSymbolMarkStyle(){let 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:ed(this._size)||(0,r3.A)(this._size)?this._size:10,symbolType:(0,eS.A)(this._shape)||(0,r3.A)(this._shape)?this._shape:"circle"},U.STATE_NORMAL,N.Series),((0,eA.A)(this._sizeField)||(0,eA.A)(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},U.STATE_NORMAL,N.User_Mark),((0,eA.A)(this._shapeField)||(0,eA.A)(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},U.STATE_NORMAL,N.User_Mark))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);
2let 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.latestData)?void 0:i[t])?void 0:s.allValid)});"zero"===this._invalidType||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",N.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined.bind(this)},"normal",N.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},U.STATE_NORMAL,N.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},U.STATE_NORMAL,N.Series))}handleZoom(t){var e,i,s,r;this.getMarksWithoutRoot().forEach(t=>{if(!t)return;let e=t.getGraphics();e&&e.length&&e.forEach((t,e)=>{var i,s;let r=null==(s=null==(i=null==t?void 0:t.context)?void 0:i.data)?void 0:s[0],a=this.dataToPosition(r);a&&t&&t.translateTo(a.x,a.y)})});let a=null==(e=this._labelMark)?void 0:e.getComponent();(null==a?void 0:a.renderInner)&&a.renderInner();let n=null==(i=null==a?void 0:a.getComponent)?void 0:i.call(a);(null==n?void 0:n.evaluate)&&n.evaluate(null,null);let l=null==(s=null==a?void 0:a.getProduct)?void 0:s.call(a);l&&(null==t?void 0:t.scale)&&(null==t?void 0:t.scaleCenter)&&((null==(r=l.attribute)?void 0:r.postMatrix)||l.setAttributes({postMatrix:new iL}),l.scale(t.scale,t.scale,t.scaleCenter))}handlePan(t){this.handleZoom(t)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}wE.type=dD.scatter,wE.mark=wC,wE.builtInTheme={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"}}}}},wE.transformerConstructor=wB;class wP extends Mr{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["point","size","shape","shapeField","sizeField"])}}class wO extends Mu{constructor(){super(...arguments),this.transformerConstructor=wP,this.type="scatter",this.seriesType=dD.scatter}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}wO.type="scatter",wO.seriesType=dD.scatter,wO.transformerConstructor=wP,yg(wO,Mp);let wR=(t,e)=>{let i;if(!e.from||!e.from())return t;let s=e.fields,r=e.key,a=e.values,n=e.default,l=e.as||[s],o=e.from().reduce(function(t,e){return e[s]&&t.set(e[s],e),t},new Map);if((0,r3.A)(e.set))i=function(t){let i=o.get(t[r]);e.set(t,i)};else if(a){let t=a.length;i=function(e){let i=o.get(e[r]);if((0,eE.A)(i))for(let i=0;i<t;++i)e[l[i]]=n;else for(let s=0;s<t;++s)e[l[s]]=i[a[s]]}}else i=function(t){let e=o.get(t[r]);t[l[0]]=(0,eA.A)(e)?e:n};return 0===t.length?[]:t.map(t=>(i(t),t))};class wI extends bC{constructor(){super(...arguments),this.type=dD.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return null==(t=this._mapViewData)?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(){let 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||e&&!this.isDatumInViewData(t))return s;let{dataToPosition:r,latitudeField:a,longitudeField:n}=this._coordinateHelper;if(null===(s=this.nameToPosition(t))){let e=n?null==t?void 0:t[n]:NaN,l=a?null==t?void 0:t[a]:NaN;s=null!=(i=null==r?void 0:r([e,l]))?i:null}return s}nameToPosition(t){let e=this.getDatumName(t);return(0,eE.A)(e)?null:this.nameValueToPosition(e)}nameValueToPosition(t){var e,i;let s=null==(i=null==(e=this.getMapViewData())?void 0:e.latestData)?void 0:i.filter(e=>this.getDatumName(e)===t)[0];if((0,eE.A)(s))return null;let{dataToPosition:r}=this._coordinateHelper,a=this.getDatumCenter(s),n=null==r?void 0:r(a);return(0,eE.A)(n)||isNaN(n.x)||isNaN(n.y)?null:n}dataToLatitude(t){if(!this._coordinateHelper)return NaN;let{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return NaN;let{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)||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null==(e=this._option)||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return null==(e=this._option)||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)||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){let t=`${px.H}_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,r;return this._seriesField?null!=(r=null!=(e=null==(t=this.getRawDataStatisticsByField(this._seriesField))?void 0:t.values)?e:null==(s=null==(i=this._mapViewDataStatistics)?void 0:i.latestData[this._seriesField])?void 0:s.values)?r:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),null==(t=this._mapViewData.getDataView())||t.reRunAllTransform(),null==(e=this._mapViewDataStatistics)||e.reRunAllTransform()}getActiveMarks(){return[]}}let wL=(t,e)=>
2(t.features&&t.features.forEach((t,i)=>{var s;t[pS]=i;let r=null==(s=t.properties)?void 0:s[e.nameProperty];e.nameMap&&e.nameMap[r]?t[pj]=e.nameMap[r]:t[pj]=r}),t.features);class wD extends bt{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;let i=this.series;return null!=(e=this._getDimensionData(t))?e:i.getDatumName(t)}}}class wF extends _x{constructor(){super(...arguments),this.type=wF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}wF.type="path";let wz=()=>{uP.registerMark(wF.type,wF),_k(),AF(),uP.registerGraphicComponent("path",Aw)},wH=Object.assign(Object.assign({},bc),{area:{name:"area",type:"path"}});function wj(){var t,e=[];return{point:function(e,i,s){t.push([e,i,s])},lineStart:function(){e.push(t=[])},lineEnd:dT,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function wV(t,e){return 1e-6>dg(t[0]-e[0])&&1e-6>dg(t[1]-e[1])}function wN(t,e,i,s){this.x=t,this.z=e,this.o=i,this.e=s,this.v=!1,this.n=this.p=null}function wW(t,e,i,s,r){var a,n,l=[],o=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,i,s=t[0],n=t[e];if(wV(s,n)){if(!s[2]&&!n[2]){for(r.lineStart(),a=0;a<e;++a)r.point((s=t[a])[0],s[1]);r.lineEnd();return}n[0]+=2e-6}l.push(i=new wN(s,t,null,!0)),o.push(i.o=new wN(s,null,i,!1)),l.push(i=new wN(n,t,null,!1)),o.push(i.o=new wN(n,null,i,!0))}}),l.length){for(o.sort(e),wU(l),wU(o),a=0,n=o.length;a<n;++a)o[a].e=i=!i;for(var h,u,d=l[0];;){for(var c=d,p=!0;c.v;)if((c=c.n)===d)return;h=c.z,r.lineStart();do{if(c.v=c.o.v=!0,c.e){if(p)for(a=0,n=h.length;a<n;++a)r.point((u=h[a])[0],u[1]);else s(c.x,c.n.x,1,r);c=c.n}else{if(p)for(a=(h=c.p.z).length-1;a>=0;--a)r.point((u=h[a])[0],u[1]);else s(c.x,c.p.x,-1,r);c=c.p}h=(c=c.o).z,p=!p}while(!c.v)r.lineEnd()}}}function wU(t){if(e=t.length){for(var e,i,s=0,r=t[0];++s<e;)r.n=i=t[s],i.p=r,r=i;r.n=i=t[0],i.p=r}}function wG(t){return[dm(t[1],t[0]),dw(t[2])]}function wY(t){var e=t[0],i=t[1],s=d_(i);return[s*d_(e),s*dx(e),dx(i)]}function w$(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function wX(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function wK(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function wq(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function wZ(t){var e=dA(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var wJ=new dr;function wQ(t){return dg(t[0])<=dl?t[0]:dS(t[0])*((dg(t[0])+dl)%dd-dl)}function w0(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var w1=(1===(tv=w0).length&&(f=tv,tv=function(t,e){return w0(f(t),e)}),{left:function(t,e,i,s){for(null==i&&(i=0),null==s&&(s=t.length);i<s;){var r=i+s>>>1;0>tv(t[r],e)?i=r+1:s=r}return i},right:function(t,e,i,s){for(null==i&&(i=0),null==s&&(s=t.length);i<s;){var r=i+s>>>1;tv(t[r],e)>0?s=r:i=r+1}return i}});w1.right,w1.left;var w2=Array.prototype;function w3(t){for(var e,i,s,r=t.length,a=-1,n=0;++a<r;)n+=t[a].length;for(i=Array(n);--r>=0;)for(e=(s=t[r]).length;--e>=0;)i[--n]=s[e];return i}function w5(t,e,i,s){return function(r){var a,n,l,o=e(r),h=wj(),u=e(h),d=!1,c={point:p,lineStart:f,lineEnd:m,polygonStart:function(){c.point=_,c.lineStart=y,c.lineEnd=v,n=[],a=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=m,n=w3(n);var t=function(t,e){var i=wQ(e),s=e[1],r=dx(s),a=[dx(i),-d_(i),0],n=0,l=0;wJ.reset(),1===r?s=dh+1e-6:-1===r&&(s=-dh-1e-6);for(var o=0,h=t.length;o<h;++o)if(d=(u=t[o]).length)for(var u,d,c=u[d-1],p=wQ(c),g=c[1]/2+du,f=dx(g),m=d_(g),_=0;_<d;++_,p=v,f=x,m=S,c=y){var y=u[_],v=wQ(y),b=y[1]/2+du,x=dx(b),S=d_(b),A=v-p,k=A>=0?1:-1,M=k*A,w=M>dl,T=f*x;if(wJ.add(dm(T*k*dx(M),m*S+T*d_(M))),n+=w?A+k*dd:A,w^p>=i^v>=i){var C=wX(wY(c),wY(y));wZ(C);var B=wX(a,C);wZ(B);var E=(w^A>=0?-1:1)*dw(B[2]);(s>E||s===E&&(C[0]||C[1]))&&(l+=w^A>=0?1:-1)}}return(n<-1e-6||n<1e-6&&wJ<-1e-6)^1&l}(a,s);n.length?(d||(r.polygonStart(),d=!0),wW(n,w8,t,i,r)):t&&(d||(r.polygonStart(),d=!0),r.lineStart(),i(null,null,1,r),r.lineEnd()),d&&(r.polygonEnd(),d=!1),n=a=null},sphere:function(){r.polygonStart(),r.lineStart(),i(null,null,1,r),r.lineEnd(),r.polygonEnd()}};
2function p(e,i){t(e,i)&&r.point(e,i)}function g(t,e){o.point(t,e)}function f(){c.point=g,o.lineStart()}function m(){c.point=p,o.lineEnd()}function _(t,e){l.push([t,e]),u.point(t,e)}function y(){u.lineStart(),l=[]}function v(){_(l[0][0],l[0][1]),u.lineEnd();var t,e,i,s,o=u.clean(),c=h.result(),p=c.length;if(l.pop(),a.push(l),l=null,p){if(1&o){if((e=(i=c[0]).length-1)>0){for(d||(r.polygonStart(),d=!0),r.lineStart(),t=0;t<e;++t)r.point((s=i[t])[0],s[1]);r.lineEnd()}return}p>1&&2&o&&c.push(c.pop().concat(c.shift())),n.push(c.filter(w4))}}return c}}function w4(t){return t.length>1}function w8(t,e){return((t=t.x)[0]<0?t[1]-dh-1e-6:dh-t[1])-((e=e.x)[0]<0?e[1]-dh-1e-6:dh-e[1])}w2.slice,w2.map;let w6=w5(function(){return!0},function(t){var e,i=NaN,s=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,n){var l,o,h,u,d,c,p,g=a>0?dl:-dl,f=dg(a-i);1e-6>dg(f-dl)?(t.point(i,s=(s+n)/2>0?dh:-dh),t.point(r,s),t.lineEnd(),t.lineStart(),t.point(g,s),t.point(a,s),e=0):r!==g&&f>=dl&&(1e-6>dg(i-r)&&(i-=1e-6*r),1e-6>dg(a-g)&&(a-=1e-6*g),l=i,o=s,h=a,u=n,s=dg(p=dx(l-h))>1e-6?df((dx(o)*(c=d_(u))*dx(h)-dx(u)*(d=d_(o))*dx(l))/(d*c*p)):(o+u)/2,t.point(r,s),t.lineEnd(),t.lineStart(),t.point(g,s),e=0),t.point(i=a,s=n),r=g},lineEnd:function(){t.lineEnd(),i=s=NaN},clean:function(){return 2-e}}},function(t,e,i,s){var r;if(null==t)r=i*dh,s.point(-dl,r),s.point(0,r),s.point(dl,r),s.point(dl,0),s.point(dl,-r),s.point(0,-r),s.point(-dl,-r),s.point(-dl,0),s.point(-dl,r);else if(dg(t[0]-e[0])>1e-6){var a=t[0]<e[0]?dl:-dl;r=i*a/2,s.point(-a,r),s.point(0,r),s.point(a,r)}else s.point(e[0],e[1])},[-dl,-dh]);function w9(t,e){e=wY(e),e[0]-=t,wZ(e);var i=dM(-e[1]);return((0>-e[2]?-i:i)+dd-1e-6)%dd}function w7(t,e,i,s){function r(r,a){return t<=r&&r<=i&&e<=a&&a<=s}function a(r,a,l,h){var u=0,d=0;if(null==r||(u=n(r,l))!==(d=n(a,l))||0>o(r,a)^l>0)do h.point(0===u||3===u?t:i,u>1?s:e);while((u=(u+l+4)%4)!==d)else h.point(a[0],a[1])}function n(s,r){return 1e-6>dg(s[0]-t)?r>0?0:3:1e-6>dg(s[0]-i)?r>0?2:1:1e-6>dg(s[1]-e)?+(r>0):r>0?3:2}function l(t,e){return o(t.x,e.x)}function o(t,e){var i=n(t,1),s=n(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(n){var o,h,u,d,c,p,g,f,m,_,y,v=n,b=wj(),x={point:S,lineStart:function(){x.point=A,h&&h.push(u=[]),_=!0,m=!1,g=f=NaN},lineEnd:function(){o&&(A(d,c),p&&m&&b.rejoin(),o.push(b.result())),x.point=S,m&&v.lineEnd()},polygonStart:function(){v=b,o=[],h=[],y=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,r=h.length;i<r;++i)for(var a,n,l=h[i],o=1,u=l.length,d=l[0],c=d[0],p=d[1];o<u;++o)a=c,n=p,c=(d=l[o])[0],p=d[1],n<=s?p>s&&(c-a)*(s-n)>(p-n)*(t-a)&&++e:p<=s&&(c-a)*(s-n)<(p-n)*(t-a)&&--e;return e}(),i=y&&e,r=(o=w3(o)).length;(i||r)&&(n.polygonStart(),i&&(n.lineStart(),a(null,null,1,n),n.lineEnd()),r&&wW(o,l,e,a,n),n.polygonEnd()),v=n,o=h=u=null}};function S(t,e){r(t,e)&&v.point(t,e)}function A(a,n){var l=r(a,n);if(h&&u.push([a,n]),_)d=a,c=n,p=l,_=!1,l&&(v.lineStart(),v.point(a,n));else if(l&&m)v.point(a,n);else{var o=[g=Math.max(-1e9,Math.min(1e9,g)),f=Math.max(-1e9,Math.min(1e9,f))],b=[a=Math.max(-1e9,Math.min(1e9,a)),n=Math.max(-1e9,Math.min(1e9,n))];!function(t,e,i,s,r,a){var n,l=t[0],o=t[1],h=e[0],u=e[1],d=0,c=1,p=h-l,g=u-o;if(n=i-l,!p&&n>0)return;if(n/=p,p<0){if(n<d)return;n<c&&(c=n)}else if(p>0){if(n>c)return;n>d&&(d=n)}if(n=r-l,p||!(n<0)){if(n/=p,p<0){if(n>c)return;n>d&&(d=n)}else if(p>0){if(n<d)return;n<c&&(c=n)}if(n=s-o,g||!(n>0)){if(n/=g,g<0){if(n<d)return;n<c&&(c=n)}else if(g>0){if(n>c)return;n>d&&(d=n)}if(n=a-o,g||!(n<0)){if(n/=g,g<0){if(n>c)return;n>d&&(d=n)}else if(g>0){if(n<d)return;n<c&&(c=n)}return d>0&&(t[0]=l+d*p,t[1]=o+d*g),c<1&&(e[0]=l+c*p,e[1]=o+c*g),!0}}}}(o,b,t,e,i,s)?l&&(v.lineStart(),v.point(a,n),y=!1):(m||(v.lineStart(),v.point(o[0],o[1])),v.point(b[0],b[1]),l||v.lineEnd(),y=!1)}g=a,f=n,m=l}return x}}function Tt(t,e){function i(i,s){return e((i=t(i,s))[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 Te(t,e){return[dg(t)>dl?t+Math.round(-t/dd)*dd:t,e]}function Ti(t,e,i){return(t%=dd)?e||i?Tt(Tr(t),Ta(e,i)):Tr(t):e||i?Ta(e,i):Te}function Ts(t){return function(e,i){return[(e+=t)>dl?e-dd:e<-dl?e+dd:e,i]}}function Tr(t){var e=Ts(t);return e.invert=Ts(-t),e}function Ta(t,e){var i=d_(t),s=dx(t),r=d_(e),a=dx(e);function n(t,e){var n=d_(e),l=d_(t)*n,o=dx(t)*n,h=dx(e),u=h*i+l*s;return[dm(o*r-u*a,l*i-h*s),dw(u*r+o*a)]}return n.invert=function(t,e){var n=d_(e),l=d_(t)*n,o=dx(t)*n,h=dx(e),u=h*r-o*a;return[dm(o*r+h*a,l*i+u*s),dw(u*i-l*s)]},n}function Tn(t){return function(e){var i=new Tl;for(var s in t)i[s]=t[s];return i.stream=e,i}}function Tl(){}
2function To(t,e,i){var s=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=s&&t.clipExtent(null),ds(i,t.stream(d5)),e(d5.result()),null!=s&&t.clipExtent(s),t}function Th(t,e,i){return To(t,function(i){var s=e[1][0]-e[0][0],r=e[1][1]-e[0][1],a=Math.min(s/(i[1][0]-i[0][0]),r/(i[1][1]-i[0][1])),n=+e[0][0]+(s-a*(i[1][0]+i[0][0]))/2,l=+e[0][1]+(r-a*(i[1][1]+i[0][1]))/2;t.scale(150*a).translate([n,l])},i)}function Tu(t,e,i){return Th(t,[[0,0],e],i)}function Td(t,e,i){return To(t,function(i){var s=+e,r=s/(i[1][0]-i[0][0]),a=(s-r*(i[1][0]+i[0][0]))/2,n=-r*i[0][1];t.scale(150*r).translate([a,n])},i)}function Tc(t,e,i){return To(t,function(i){var s=+e,r=s/(i[1][1]-i[0][1]),a=-r*i[0][0],n=(s-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([a,n])},i)}Te.invert=Te,Tl.prototype={constructor:Tl,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 Tp=d_(30*dp);function Tg(t,e){var i;return+e?function(t,e){function i(s,r,a,n,l,o,h,u,d,c,p,g,f,m){var _=h-s,y=u-r,v=_*_+y*y;if(v>4*e&&f--){var b=n+c,x=l+p,S=o+g,A=dA(b*b+x*x+S*S),k=dw(S/=A),M=1e-6>dg(dg(S)-1)||1e-6>dg(a-d)?(a+d)/2:dm(x,b),w=t(M,k),T=w[0],C=w[1],B=T-s,E=C-r,P=y*B-_*E;(P*P/v>e||dg((_*B+y*E)/v-.5)>.3||n*c+l*p+o*g<Tp)&&(i(s,r,a,n,l,o,T,C,M,b/=A,x/=A,S,f,m),m.point(T,C),i(T,C,M,b,x,S,h,u,d,c,p,g,f,m))}}return function(e){var s,r,a,n,l,o,h,u,d,c,p,g,f={point:m,lineStart:_,lineEnd:v,polygonStart:function(){e.polygonStart(),f.lineStart=b},polygonEnd:function(){e.polygonEnd(),f.lineStart=_}};function m(i,s){i=t(i,s),e.point(i[0],i[1])}function _(){u=NaN,f.point=y,e.lineStart()}function y(s,r){var a=wY([s,r]),n=t(s,r);i(u,d,h,c,p,g,u=n[0],d=n[1],h=s,c=a[0],p=a[1],g=a[2],16,e),e.point(u,d)}function v(){f.point=m,e.lineEnd()}function b(){_(),f.point=x,f.lineEnd=S}function x(t,e){y(s=t,e),r=u,a=d,n=c,l=p,o=g,f.point=y}function S(){i(u,d,h,c,p,g,r,a,s,n,l,o,16,e),f.lineEnd=v,v()}return f}}(t,e):(i=t,Tn({point:function(t,e){t=i(t,e),this.stream.point(t[0],t[1])}}))}var Tf=Tn({point:function(t,e){this.stream.point(t*dp,e*dp)}});function Tm(t,e,i,s,r,a){var n=d_(a),l=dx(a),o=n*t,h=l*t,u=n/t,d=l/t,c=(l*i-n*e)/t,p=(l*e+n*i)/t;function g(t,a){return[o*(t*=s)-h*(a*=r)+e,i-h*t-o*a]}return g.invert=function(t,e){return[s*(u*t-d*e+c),r*(p-d*t-u*e)]},g}function T_(t){return Ty(function(){return t})()}function Ty(t){var e,i,s,r,a,n,l,o,h,u,d=150,c=480,p=250,g=0,f=0,m=0,_=0,y=0,v=0,b=1,x=1,S=null,A=w6,k=null,M=u6,w=.5;function T(t){return o(t[0]*dp,t[1]*dp)}function C(t){return(t=o.invert(t[0],t[1]))&&[t[0]*dc,t[1]*dc]}function B(){var t=Tm(d,0,0,b,x,v).apply(null,e(g,f)),s=(v?Tm:function(t,e,i,s,r){function a(a,n){return[e+t*(a*=s),i-t*(n*=r)]}return a.invert=function(a,n){return[(a-e)/t*s,(i-n)/t*r]},a})(d,c-t[0],p-t[1],b,x,v);return i=Ti(m,_,y),l=Tt(e,s),o=Tt(i,l),n=Tg(l,w),E()}function E(){return h=u=null,T}return T.stream=function(t){var e;return h&&u===t?h:h=Tf((e=i,Tn({point:function(t,i){var s=e(t,i);return this.stream.point(s[0],s[1])}}))(A(n(M(u=t)))))},T.preclip=function(t){return arguments.length?(A=t,S=void 0,E()):A},T.postclip=function(t){return arguments.length?(M=t,k=s=r=a=null,E()):M},T.clipAngle=function(t){return arguments.length?(A=+t?function(t){var e=d_(t),i=6*dp,s=e>0,r=dg(e)>1e-6;function a(t,i){return d_(t)*d_(i)>e}function n(t,i,s){var r=wY(t),a=wY(i),n=[1,0,0],l=wX(r,a),o=w$(l,l),h=l[0],u=o-h*h;if(!u)return!s&&t;var d=wX(n,l),c=wq(n,e*o/u);wK(c,wq(l,-e*h/u));var p=w$(c,d),g=w$(d,d),f=p*p-g*(w$(c,c)-1);if(!(f<0)){var m=dA(f),_=wq(d,(-p-m)/g);if(wK(_,c),_=wG(_),!s)return _;var y,v=t[0],b=i[0],x=t[1],S=i[1];b<v&&(y=v,v=b,b=y);var A=b-v,k=1e-6>dg(A-dl);if(!k&&S<x&&(y=x,x=S,S=y),k||A<1e-6?k?x+S>0^_[1]<(1e-6>dg(_[0]-v)?x:S):x<=_[1]&&_[1]<=S:A>dl^(v<=_[0]&&_[0]<=b)){var M=wq(d,(-p+m)/g);return wK(M,c),[_,wG(M)]}}}function l(e,i){var r=s?t:dl-t,a=0;return e<-r?a|=1:e>r&&(a|=2),i<-r?a|=4:i>r&&(a|=8),a}return w5(a,function(t){var e,i,o,h,u;return{lineStart:function(){h=o=!1,u=1},point:function(d,c){var p,g,f=[d,c],m=a(d,c),_=s?m?0:l(d,c):m?l(d+(d<0?dl:-dl),c):0;!e&&(h=o=m)&&t.lineStart(),m!==o&&(!(g=n(e,f))||wV(e,g)||wV(f,g))&&(f[2]=1),m!==o?(u=0,m?(t.lineStart(),g=n(f,e),t.point(g[0],g[1])):(g=n(e,f),t.point(g[0],g[1],2),t.lineEnd()),e=g):r&&e&&s^m&&!(_&i)&&(p=n(f,e,!0))&&(u=0,s?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1],3))),!m||e&&wV(e,f)||t.point(f[0],f[1]),e=f,o=m,i=_},lineEnd:function(){o&&t.lineEnd(),e=null},clean:function(){return u|(h&&o)<<1}
2}},function(e,s,r,a){!function(t,e,i,s,r,a){if(i){var n=d_(e),l=dx(e),o=s*i;null==r?(r=e+s*dd,a=e-o/2):(r=w9(n,r),a=w9(n,a),(s>0?r<a:r>a)&&(r+=s*dd));for(var h,u=r;s>0?u>a:u<a;u-=o)h=wG([n,-l*d_(u),-l*dx(u)]),t.point(h[0],h[1])}}(a,t,i,r,e,s)},s?[0,-t]:[-dl,t-dl])}(S=t*dp):(S=null,w6),E()):S*dc},T.clipExtent=function(t){return arguments.length?(M=null==t?(k=s=r=a=null,u6):w7(k=+t[0][0],s=+t[0][1],r=+t[1][0],a=+t[1][1]),E()):null==k?null:[[k,s],[r,a]]},T.scale=function(t){return arguments.length?(d=+t,B()):d},T.translate=function(t){return arguments.length?(c=+t[0],p=+t[1],B()):[c,p]},T.center=function(t){return arguments.length?(g=t[0]%360*dp,f=t[1]%360*dp,B()):[g*dc,f*dc]},T.rotate=function(t){return arguments.length?(m=t[0]%360*dp,_=t[1]%360*dp,y=t.length>2?t[2]%360*dp:0,B()):[m*dc,_*dc,y*dc]},T.angle=function(t){return arguments.length?(v=t%360*dp,B()):v*dc},T.reflectX=function(t){return arguments.length?(b=t?-1:1,B()):b<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,B()):x<0},T.precision=function(t){return arguments.length?(n=Tg(l,w=t*t),E()):dA(w)},T.fitExtent=function(t,e){return Th(T,t,e)},T.fitSize=function(t,e){return Tu(T,t,e)},T.fitWidth=function(t,e){return Td(T,t,e)},T.fitHeight=function(t,e){return Tc(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,B()}}function Tv(t){var e=0,i=dl/3,s=Ty(t),r=s(e,i);return r.parallels=function(t){return arguments.length?s(e=t[0]*dp,i=t[1]*dp):[e*dc,i*dc]},r}function Tb(t,e){var i=dx(t),s=(i+dx(e))/2;if(1e-6>dg(s)){var r=d_(t);function a(t,e){return[t*r,dx(e)/r]}return a.invert=function(t,e){return[t/r,dw(e*r)]},a}var n=1+i*(2*s-i),l=dA(n)/s;function o(t,e){var i=dA(n-2*s*dx(e))/s;return[i*dx(t*=s),l-i*d_(t)]}return o.invert=function(t,e){var i=l-e,r=dm(t,dg(i))*dS(i);return i*s<0&&(r-=dl*dS(t)*dS(i)),[r/s,dw((n-(t*t+i*i)*s*s)/(2*s))]},o}function Tx(){return Tv(Tb).scale(155.424).center([0,33.6442])}function TS(){return Tx().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function TA(t){return function(e,i){var s=d_(e),r=d_(i),a=t(s*r);return[a*r*dx(e),a*dx(i)]}}function Tk(t){return function(e,i){var s=dA(e*e+i*i),r=t(s),a=dx(r);return[dm(e*a,s*d_(r)),dw(s&&i*a/s)]}}var TM=TA(function(t){return dA(2/(1+t))});TM.invert=Tk(function(t){return 2*dw(t/2)});var Tw=TA(function(t){return(t=dM(t))&&t/dx(t)});function TT(t,e){return[t,dv(dk((dh+e)/2))]}function TC(t){var e,i,s,r=T_(t),a=r.center,n=r.scale,l=r.translate,o=r.clipExtent,h=null;function u(){var a=dl*n(),l=r((function(t){function e(e){return e=t(e[0]*dp,e[1]*dp),e[0]*=dc,e[1]*=dc,e}return t=Ti(t[0]*dp,t[1]*dp,t.length>2?t[2]*dp:0),e.invert=function(e){return e=t.invert(e[0]*dp,e[1]*dp),e[0]*=dc,e[1]*=dc,e},e})(r.rotate()).invert([0,0]));return o(null==h?[[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]]:t===TT?[[Math.max(l[0]-a,h),e],[Math.min(l[0]+a,i),s]]:[[h,Math.max(l[1]-a,e)],[i,Math.min(l[1]+a,s)]])}return r.scale=function(t){return arguments.length?(n(t),u()):n()},r.translate=function(t){return arguments.length?(l(t),u()):l()},r.center=function(t){return arguments.length?(a(t),u()):a()},r.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]),u()):null==h?null:[[h,e],[i,s]]},u()}function TB(t){return dk((dh+t)/2)}function TE(t,e){var i=d_(t),s=t===e?dx(t):dv(i/d_(e))/dv(TB(e)/TB(t)),r=i*db(TB(t),s)/s;if(!s)return TT;function a(t,e){r>0?e<-dh+1e-6&&(e=-dh+1e-6):e>dh-1e-6&&(e=dh-1e-6);var i=r/db(TB(e),s);return[i*dx(s*t),r-i*d_(s*t)]}return a.invert=function(t,e){var i=r-e,a=dS(s)*dA(t*t+i*i),n=dm(t,dg(i))*dS(i);return i*s<0&&(n-=dl*dS(t)*dS(i)),[n/s,2*df(db(r/a,1/s))-dh]},a}function TP(t,e){return[t,e]}function TO(t,e){var i=d_(t),s=t===e?dx(t):(i-d_(e))/(e-t),r=i/s+t;if(1e-6>dg(s))return TP;function a(t,e){var i=r-e,a=s*t;return[i*dx(a),r-i*d_(a)]}return a.invert=function(t,e){var i=r-e,a=dm(t,dg(i))*dS(i);return i*s<0&&(a-=dl*dS(t)*dS(i)),[a/s,r-dS(s)*dA(t*t+i*i)]},a}Tw.invert=Tk(function(t){return t}),TT.invert=function(t,e){return[t,2*df(dy(e))-dh]},TP.invert=TP;var TR=dA(3)/2;function TI(t,e){var i=dw(TR*dx(e)),s=i*i,r=s*s*s;return[t*d_(i)/(TR*(1.340264+-.24331799999999998*s+r*(.0062510000000000005+.034164*s))),i*(1.340264+-.081106*s+r*(893e-6+.003796
2*s))]}function TL(t,e){var i=d_(e),s=d_(t)*i;return[i*dx(t)/s,dx(e)/s]}function TD(t,e){var i=e*e,s=i*i;return[t*(.8707-.131979*i+s*(-.013791+s*(.003971*i-.001529*s))),e*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))]}function TF(t,e){return[d_(e)*dx(t),dx(e)]}function Tz(t,e){var i=d_(e),s=1+d_(t)*i;return[i*dx(t)/s,dx(e)/s]}function TH(t,e){return[dv(dk((dh+e)/2)),-t]}TI.invert=function(t,e){for(var i,s,r=e,a=r*r,n=a*a*a,l=0;l<12&&(s=r*(1.340264+-.081106*a+n*(893e-6+.003796*a))-e,r-=i=s/(1.340264+-.24331799999999998*a+n*(.0062510000000000005+.034164*a)),n=(a=r*r)*a*a,!(1e-12>dg(i)));++l);return[TR*t*(1.340264+-.24331799999999998*a+n*(.0062510000000000005+.034164*a))/d_(r),dw(dx(r)/TR)]},TL.invert=Tk(df),TD.invert=function(t,e){var i,s=e,r=25;do{var a=s*s,n=a*a;s-=i=(s*(1.007226+a*(.015085+n*(-.044475+.028874*a-.005916*n)))-e)/(1.007226+a*(.045255+n*(-.311325+.259866*a-.005916*11*n)))}while(dg(i)>1e-6&&--r>0)return[t/(.8707+(a=s*s)*(-.131979+a*(-.013791+a*a*a*(.003971-.001529*a)))),s]},TF.invert=Tk(dw),Tz.invert=Tk(function(t){return 2*df(t)}),TH.invert=function(t,e){return[-e,2*df(dy(t))-dh]},cE();let Tj={},TV={albers:TS,albersusa:function(){var t,e,i,s,r,a,n=TS(),l=Tx().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=Tx().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){a=[t,e]}};function u(t){var e=t[0],n=t[1];return a=null,i.point(e,n),a||(s.point(e,n),a)||(r.point(e,n),a)}function d(){return t=e=null,u}return u.invert=function(t){var e=n.scale(),i=n.translate(),s=(t[0]-i[0])/e,r=(t[1]-i[1])/e;return(r>=.12&&r<.234&&s>=-.425&&s<-.214?l:r>=.166&&r<.234&&s>=-.214&&s<-.115?o:n).invert(t)},u.stream=function(i){var s,r;return t&&e===i?t:(r=(s=[n.stream(e=i),l.stream(i),o.stream(i)]).length,t={point:function(t,e){for(var i=-1;++i<r;)s[i].point(t,e)},sphere:function(){for(var t=-1;++t<r;)s[t].sphere()},lineStart:function(){for(var t=-1;++t<r;)s[t].lineStart()},lineEnd:function(){for(var t=-1;++t<r;)s[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<r;)s[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<r;)s[t].polygonEnd()}})},u.precision=function(t){return arguments.length?(n.precision(t),l.precision(t),o.precision(t),d()):n.precision()},u.scale=function(t){return arguments.length?(n.scale(t),l.scale(.35*t),o.scale(t),u.translate(n.translate())):n.scale()},u.translate=function(t){if(!arguments.length)return n.translate();var e=n.scale(),a=+t[0],u=+t[1];return i=n.translate(t).clipExtent([[a-.455*e,u-.238*e],[a+.455*e,u+.238*e]]).stream(h),s=l.translate([a-.307*e,u+.201*e]).clipExtent([[a-.425*e+1e-6,u+.12*e+1e-6],[a-.214*e-1e-6,u+.234*e-1e-6]]).stream(h),r=o.translate([a-.205*e,u+.212*e]).clipExtent([[a-.214*e+1e-6,u+.166*e+1e-6],[a-.115*e-1e-6,u+.234*e-1e-6]]).stream(h),d()},u.fitExtent=function(t,e){return Th(u,t,e)},u.fitSize=function(t,e){return Tu(u,t,e)},u.fitWidth=function(t,e){return Td(u,t,e)},u.fitHeight=function(t,e){return Tc(u,t,e)},u.scale(1070)},azimuthalequalarea:function(){return T_(TM).scale(124.75).clipAngle(179.999)},azimuthalequidistant:function(){return T_(Tw).scale(79.4188).clipAngle(179.999)},conicconformal:function(){return Tv(TE).scale(109.5).parallels([30,30])},conicequalarea:Tx,conicequidistant:function(){return Tv(TO).scale(131.154).center([0,13.9389])},equalearth:function(){return T_(TI).scale(177.158)},equirectangular:function(){return T_(TP).scale(152.63)},gnomonic:function(){return T_(TL).scale(144.049).clipAngle(60)},identity:function(){var t,e,i,s,r,a,n,l=1,o=0,h=0,u=1,d=1,c=0,p=null,g=1,f=1,m=Tn({point:function(t,e){var i=v([t,e]);this.stream.point(i[0],i[1])}}),_=u6;function y(){return g=l*u,f=l*d,a=n=null,v}function v(i){var s=i[0]*g,r=i[1]*f;if(c){var a=r*t-s*e;s=s*t+r*e,r=a}return[s+o,r+h]}return v.invert=function(i){var s=i[0]-o,r=i[1]-h;if(c){var a=r*t+s*e;s=s*t-r*e,r=a}return[s/g,r/f]},v.stream=function(t){return a&&n===t?a:a=m(_(n=t))},v.postclip=function(t){return arguments.length?(_=t,p=i=s=r=null,y()):_},v.clipExtent=function(t){return arguments.length?(_=null==t?(p=i=s=r=null,u6):w7(p=+t[0][0],i=+t[0][1],s=+t[1][0],r=+t[1][1]),y()):null==p?null:[[p,i],[s,r]]},v.scale=function(t){return arguments.length?(l=+t,y()):l},v.translate=function(t){return arguments.length?(o=+t[0],h=+t[1],y()):[o,h]},v.angle=function(i){return arguments.length?(e=dx(c=i%360*dp),t=d_(c),y()):c*dc},v.reflectX=function(t){return arguments.length?(u=t?-1:1,y()):u<0},v.reflectY=function(t){return arguments.length?(d=t?-1:1,y()):d<0},v.fitExtent=function(t,e){return Th(v,t,e)},v.fitSize=function(t,e){return Tu(v,t,e)},v.fitWidth=function(t,e){return Td(v,t,e)},v.fitHeight=function(t,e){return Tc(v,t,e)},v},mercator:function(){return TC(TT).scale(961/dd)},naturalearth1:function(){return T_(TD).scale(175.295)},orthographic:function(){return T_(TF).scale(249.5).clipAngle(90.000001)},stereographic:function(){return T_(Tz).scale(250).clipAngle(142)},transversemercator:function(){var t=TC(TH),e=t.center,i=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?i([t[0],t[1],t.length>2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}},TN=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","t
2ilt"];function TW(t,e){return function i(){let s=e();return s.type=t,s.path=cE().projection(s),s.copy=s.copy||function(){let t=i();return TN.forEach(e=>{s[e]&&t[e](s[e]())}),t.path.pointRadius(s.path.pointRadius()),t},s}}class TU{constructor(t){this.projection=(function(t,e){let i=t.toLowerCase();return arguments.length>1?TW(i,e):TV[i]?(Tj[i]||(Tj[i]=TW(i,TV[i])),Tj[i]):null})(t.type)()}fit(t,e,i){this.projection.fitExtent([t,e],{type:"FeatureCollection",features:i})}center(t){var e,i;null==(i=null==(e=this.projection)?void 0:e.center)||i.call(e,t)}project(t){var e;return null==(e=this.projection)?void 0:e.call(this,t)}shape(t){var e,i;return null==(i=null==(e=this.projection)?void 0:e.path)?void 0:i.call(e,t)}invert(t){var e,i;return null==(i=null==(e=this.projection)?void 0:e.invert)?void 0:i.call(e,t)}scale(t){var e;if(null==(e=this.projection)?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.scale){if(void 0===t)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){let s=this.projection.copy();return null==s?void 0:s.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class TG{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;let 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(){}}class TY{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0}parserZoomEvent(t){let e=t.scale;if(0===this._lastScale)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;let i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function T$(t){return t===hd["desktop-browser"]||t===hd["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:["pointerup","pointerupoutside"],zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:TG}:hQ(t)||h0(t)?{start:"pointerdown",move:"pointermove",end:["pointerup","pointerupoutside","pointerleave"],zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:TY}:null}let TX={debounce:u1,throttle:u2};class TK{constructor(){this._isGestureListener=!1}initZoomable(t,e=hd["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getCompiler()._gestureController,this._isGestureListener=hQ(this._renderMode)||h0(this._renderMode),T$(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return T$(this._renderMode)[t]}_zoomEventDispatch(t,e,i,s){if(!this._isGestureListener&&!t.event)return;let r=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(r);let{zoomDelta:a,zoomX:n,zoomY:l,path:o}=r;if(!s&&!o.some(t=>t.name&&t.name.includes("region"))||(0,eE.A)(a)||!iU({x:n,y:l},this._getRegionOrSeriesLayout(e),!1))return;this._clearDragEvent(),this._zoomableTrigger.clearScroll();let h={};i&&(h=i({zoomDelta:a,zoomX:n,zoomY:l},r)),this._eventObj.emit("zoom",Object.assign(Object.assign({scale:r.zoomDelta,scaleCenter:{x:r.zoomX,y:r.zoomY}},h),{model:this}))}_getRegionOrSeriesLayout(t){"region"!==t.type&&(t=t.getRegion());let{x:e,y:i,width:s,height:r}=t.layout.getLayout();return{x1:e,y1:i,x2:e+s,y2:i+r}}_bindZoomEventAsRegion(t,e,i,s){var r,a;let n=null!=(r=null==s?void 0:s.delayType)?r:"throttle",l=null!=(a=null==s?void 0:s.delayTime)?a:0,o=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:dN.chart,consume:!0}],u=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:dN.chart,consume:!1}];o.on(...u,TX[n](t=>{this._zoomableTrigger.clearZoom()},l)),o.on(...h,TX[n](t=>{var r;this._zoomEventDispatch(t,e,i,null!=(r=null==s?void 0:s.allowComponentZoom)&&r)},l))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||T$(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||T$(this._renderMode)&&t.forEach(t=>
2{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;let r=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(r);let{scrollX:a,scrollY:n,canvasX:l,canvasY:o}=r;return(0,eE.A)(a)&&(0,eE.A)(n)||iU({x:l,y:o},this._getRegionOrSeriesLayout(e),!1)&&(this._clearDragEvent(),this._zoomableTrigger.clearZoom(),i&&(s=i({scrollX:a,scrollY:n},r)),this._eventObj.emit("scroll",{scrollX:a,scrollY:n,model:this})),s}_bindScrollEventAsRegion(t,e,i,s){var r,a;let n=null!=(r=null==s?void 0:s.delayType)?r:"throttle",l=null!=(a=null==s?void 0:s.delayTime)?a:0,o=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:dN.chart,consume:!0}],u=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:dN.chart,consume:!1}];o.on(...u,TX[n](t=>{this._zoomableTrigger.clearScroll()},l)),o.on(...h,TX[n](t=>this._scrollEventDispatch(t,e,i),l))}initScrollEventOfSeries(t,e,i){T$(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||T$(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:dN.chart},t=>{if(!t.event)return;let{event:r}=t;iU({x:r.canvasX,y:r.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(t,i,s)}),t.on("click",{level:dN.chart},()=>!this._clickEnable)}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||T$(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:dN.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||T$(this._renderMode)&&t.forEach(t=>{e?t.getSeries().forEach(t=>{e(t)&&(t.event.on(this._getZoomTriggerEvent("start"),{level:dN.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},t=>{this._handleDrag(t,i)}),t.event.on("click",{level:dN.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},()=>!this._clickEnable))}):this._bindDragEventAsRegion(this._eventObj,t,i,s)})}_clearDragEvent(){let t=this._getZoomTriggerEvent("move"),e=this._getZoomTriggerEvent("end");this._handleDragMouseMove&&(this._eventObj.off(t,{level:dN.chart,source:dV.chart},this._handleDragMouseMove),this._handleDragMouseMove=void 0),this._handleDragMouseUp&&(e.forEach(t=>{this._eventObj.off(t,{level:dN.chart,source:dV.chart},this._handleDragMouseUp),this._eventObj.allow(t)}),this._handleDragMouseUp=void 0)}isDragEnable(t){if(this._isGestureListener&&this._gestureController){let t=this._gestureController.cachedEvents;return!t||t.length<2}return!0}_handleDrag(t,e,i){var s,r,a;if(this._clearDragEvent(),this._option.disableTriggerEvent||(this._clickEnable=!1,!this.isDragEnable(t.event)))return;this._zoomableTrigger.clearZoom(),this._zoomableTrigger.clearScroll();let n=null!=(s=null==i?void 0:i.delayType)?s:"throttle",l=null!=(r=null==i?void 0:i.delayTime)?r:0,o=null==(a=null==i?void 0:i.realTime)||a,h=this._getZoomTriggerEvent("move"),u=this._getZoomTriggerEvent("end"),d=t.event,c=d.canvasX,p=d.canvasY,g=d.canvasX,f=d.canvasY;this._handleDragMouseUp=TX[n](t=>{this._clickEnable=!0;let i=t.event,s=[i.canvasX-g,i.canvasY-f];g=i.canvasX,f=i.canvasY,!o&&e&&e(s,t.event),this._eventObj.emit("panend",{delta:s,model:this}),this._clearDragEvent()},l),this._handleDragMouseMove=TX[n](t=>{if(!this.isDragEnable(t.event))return;this._clickEnable=!1,u.forEach(t=>{this._eventObj.prevent(t,{handler:this._handleDragMouseUp,level:dN.chart})});let i=t.event,s=[i.canvasX-c,i.canvasY-p];c=i.canvasX,p=i.canvasY,o&&e&&e(s,t.event),this._eventObj.emit("panmove",{delta:s,model:this})},l),this._eventObj.on(h,{level:dN.chart,source:dV.chart},this._handleDragMouseMove),u.forEach(t=>{this._eventObj.on(t,{level:dN.chart,source:dV.chart},this._handleDragMouseUp)})}}class Tq extends SL{constructor(){super(...arguments),this.type=hc.geoCoordinate,this.name=hc.geoCoordinate,this.layoutType="none",this.layoutZIndex=j.Mark,this._projectionSpec={name:function(t,e){return`${px.H}_${e}_${t}`}(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,s,r,a,n,l;let o=(0,eA.A)(this._spec.zoomRate)?Math.max(0,this._spec.zoomRate):1,h=Math.pow(Math.max(t.zoomDelta,1e-6),o),u=this._actualScale;return this._actualScale*=h,this._actualScale<(null==(i=this._spec.zoomLimit)?void 0:i.min)?(this._actualScale=null==(s=this._spec.zoomLimit)?void 0:s.min,h=(null==(r=this._spec.zoomLimit)?void 0:r.min)/u):this._actualScale>(null==(a=this._spec.zoomLimit)?void 0:a.max)&&(this._actualScale=null==(n=this._spec.zoomLimit)?void 0:n.max,h=(null==(l=this._spec.zoomLimit)?void 0:l.max)/u),this.zoom(h,[t.zoomX,t.zoomY]),{scale:h,totalScale:this._actualScale}},this.pan=(t=[0,0])=>{var e,i,s;let r=null!=(i=null==(e=this._projection)?void 0:e.translate())?i:[0,0],a=r[0],n=r[1];a+=t[0],n+=t[1],null==(s=this._projection)||s.translate([a,n])}}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((0,eE.A)(t))return null;let e=[];return t.region.forEach((t,i)=>{if("geo"===t.coordinate){let s=Object.assign(Object.assign({},t),{padding:0});
2e.push({spec:s,regionIndex:i,type:hc.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=uy(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>(null==(t=this._spec.zoomLimit)?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<(null==(e=this._spec.zoomLimit)?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=null!=(i=this._projectionSpec.zoom)?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){let i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},{scale:s,totalScale:r}=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});1!==s&&this.event.emit("zoom",{scale:s,scaleCenter:i,totalScale:r,model:this})}initEvent(){var t,e,i;this.event.on(dj.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));let{roam:s}=this._spec;if(s){let r=!0,a=!0,n=!1;!0!==s&&(r=null==(t=s.zoom)||t,a=null==(e=s.drag)||e,n=null!=(i=s.blank)&&i),r&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),a&&this.initDragEventOfRegions(this._regions,n?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 TU(this._projectionSpec),null!==this._projection.projection||null==(t=this._option)||t.onError("unsupported projection type!")}coordinateHelper(){let 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===dD.map||e.type===dD.pictogram?e.setCoordinateHelper(t):(e.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let r=t[0];if((0,eE.A)(r)&&(null==i?void 0:i.datum)){let t=i.datum[e.getDimensionField()[0]];r=null==(s=this._centerCache.get(t))?void 0:s.x}return this.dataToLongitude(r)},valueToPosition:(t,i)=>{var s;if((0,eE.A)(t)&&(null==i?void 0:i.datum)){let r=i.datum[e.getDimensionField()[0]];t=null==(s=this._centerCache.get(r))?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 r=t[0];if((0,eE.A)(r)&&(null==i?void 0:i.datum)){let t=i.datum[e.getDimensionField()[0]];r=null==(s=this._centerCache.get(t))?void 0:s.y}return this.dataToLatitude(r)},valueToPosition:(t,i)=>{var s;if((0,eE.A)(t)&&(null==i?void 0:i.datum)){let r=i.datum[e.getDimensionField()[0]];t=null==(s=this._centerCache.get(r))?void 0:s.y}return this.dataToLatitude(t)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))})})}onLayoutEnd(){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());let{width:t,height:e}=this.getLayoutRect(),{translate:i,scale:s,center:r}=this.evaluateProjection([0,0],[t,e]);i&&this._projection.translate(i),s&&this._projection.scale(s),r&&this._projection.center(r),x8(this._regions,t=>{var e;if(t.type===dD.map||t.type===dD.pictogram){null==(e=t.areaPath)||e.clear();let i=t.getRootMark().getProduct();i&&i.attribute.postMatrix&&i.setAttributes({postMatrix:new iL})}}),this._actualScale=this._initialScale,super.onLayoutEnd()}collectFeatures(){let t=[];
2return this._regions.forEach(e=>{e.getSeries().forEach(e=>{var i,s;e.type!==dD.map&&e.type!==dD.pictogram||t.push(...null!=(s=null==(i=e.getMapViewData())?void 0:i.latestData)?s:[])})}),t}dataToPosition(t=[]){var e;let i=null==(e=this._projection)?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;let i=null==(e=this._projection)?void 0:e.project([0,t]);return null==i?void 0:i[1]}dataToLongitude(t){var e;let i=null==(e=this._projection)?void 0:e.project([t,0]);return null==i?void 0:i[0]}zoom(t,e=[0,0]){var i,s,r,a,n,l;let o=null!=(s=null==(i=this._projection)?void 0:i.scale())?s:0,h=null!=(a=null==(r=this._projection)?void 0:r.translate())?a:[0,0],u=h[0],d=h[1];o*=t,u-=(e[0]-u)*(t-1),d-=(e[1]-d)*(t-1),null==(n=this._projection)||n.scale(o),null==(l=this._projection)||l.translate([u,d])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;let s=this._projection.evaluate(t,e,this.collectFeatures()),r=s.translate(),a=s.scale()*this._initialScale,n=null!=(i=this._projectionSpec.center)?i:s.invert([e[0]/2,e[1]/2]);return n&&(r=[e[0]/2,e[1]/2]),{translate:r,scale:a,center:n}}_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.latestData)?i:[]).forEach((e={})=>{let i=e[t.getDimensionField()[0]]||e[pj],s=t.getDatumCenter(e);i&&(0,eA.A)(s)&&this._centerCache.set(i,{x:s[0],y:s[1]})})})})}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(i.reMake=["roam","longitudeField","latitudeField","projection","zoomLimit","zoomRate"].some(i=>!(0,ex.n)(null==e?void 0:e[i],t[i]))),i}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}Tq.type=hc.geoCoordinate,yg(Tq,TK);let TZ=()=>{uP.registerComponent(Tq.type,Tq)};class TJ extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class TQ extends wI{constructor(){super(...arguments),this.type=dD.map,this.transformerConstructor=TJ,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)||t.onError(`map type '${this.map}' is not specified !`),c4.get(this.map)||null==(e=this._option)||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),c3(this._dataSet,"copyDataView",c7),c3(this._dataSet,"map",wL),c3(this._dataSet,"lookup",wR);let i=c4.get(this.map);i||null==(t=this._option)||t.onError("no valid map data found!");let s=new eR(this._dataSet,{name:`map_${this.id}_data`});s.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:D.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.getLatestData()},key:pj,fields:this._nameField,set:(t,e)=>{e&&Object.keys(e).forEach(i=>{i in t||(t[i]=e[i])})}}}),null==(e=this._data)||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new mz(this._option,s)}compileData(){var t;super.compileData(),null==(t=this._mapViewData)||t.compile()}initMark(){this._pathMark=this._createMark(TQ.mark.area,{groupKey:this.getDimensionField()[0],isSeriesMark:!0},{morph:bk(this._spec,TQ.mark.area.name),morphElementKey:this.getDimensionField()[0]}),this._pathMark.setData(this._mapViewData)}initMarkStyle(){let t=this._pathMark;t&&(this.setMarkStyle(t,{fill:t=>{var e,i,s,r;return(0,eA.A)(t[null!=(e=this._seriesField)?e:pk])?(null!=(i=this._option.globalScale.getScale("color"))?i:this._getDefaultColorScale()).scale(t[null!=(s=this._seriesField)?s:pk]):null==(r=this._spec)?void 0:r.defaultFillColor},path:this.getPath.bind(this)},"normal",N.Series),t.setPostProcess("fill",t=>(0,eA.A)(t)?t:this._spec.defaultFillColor),this.setMarkStyle(t,{smoothScale:!0},"normal",N.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.x},y:t=>{var e;return null==(e=this.dataToPosition(t))?void 0:e.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(bb(null==(t=uP.getAnimationInKey("fadeInOut"))?void 0:t(),bx("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new wD(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;let i=this._areaCache.get(t[pS]);if(i)return i.shape;let s=null==(e=this._coordinateHelper)?void 0:e.shape(t);return this._areaCache.set(t[pS],{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,r;let{scale:a,scaleCenter:n}=t;if(1===a)return;let l=this.getRootMark().getProduct();l&&(l.attribute.postMatrix||l.setAttributes({postMatrix:new iL}),l.scale(a,a,n));let o=null==(e=this._labelMark)?void 0:e.getComponent();(null==o?void 0:o.renderInner)&&o.renderInner();let h=null==(i=null==o?void 0:o.getComponent)?void 0:i.call(o);(null==h?void 0:h.evaluate)&&h.evaluate(null,null);let u=null==(s=null==o?void 0:o.getProduct)?void 0:s.call(o);u&&a&&n&&((null==(r=u.attribute)?void 0:r.postMatrix)||u.setAttributes({postMatrix:new iL}),u.scale(a,a,n))}handlePan(t){var e,i,s,r;let{delta:a}=t;if(0===a[0]&&0===a[1])return;let n=this.getRootMark().getProduct();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new iL}),n.translate(a[0],a[1]));let l=null==(e=this._labelMark)?void 0:e.getComponent();(null==l?void 0:l.renderInner)&&l.renderInner();let o=null==(i=null==l?void 0:l.getComponent)?void 0:i.call(l);(null==o?void 0:o.evaluate)&&o.evaluate(null,null);let h=null==(s=null==l?void 0:l.getProduct)?void 0:s.call(l);h&&a&&((null==(r=h.attribute)?void 0:r.postMatrix)||h.setAttributes({postMatrix:new iL}),h.translate(a[0],a[1]))}getDatumCenter(t){var e,i,s,r;return this._centroidProperty&&(null==(e=t.properties)?void 0:e[this._centroidProperty])?null==(i=t.properties)?void 0:i[this._centroidProperty]:eP(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:(null==(s=t.properties)?void 0:s.center)?t.properties.center:(null==(r=t.properties)?void 0:r.centroid)?t.properties.centroid:[NaN,NaN]}getDatumName(t){var e;if(t[this.nameField])return t[this.nameField];let i=null==(e=t.properties)?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)||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null==(e=this._option)||e.onError("Method not implemented."),0}
2viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null==(i=null==(e=this._mapViewData)?void 0:e.getDataView())||i.reRunAllTransform(),null==(s=this._mapViewData)||s.updateData()}_getDataIdKey(){return pS}getActiveMarks(){return[this._pathMark]}}TQ.type=dD.map,TQ.mark=wH,TQ.builtInTheme={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"}}}}},TQ.transformerConstructor=TJ;class T0 extends Ms{_isValidSeries(t){return t===dD.map}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","map","nameProperty","centroidProperty","nameMap","area","defaultFillColor","showDefaultName"])}transformSpec(t){super.transformSpec(t),t.region.forEach(t=>{t.coordinate="geo"}),super.transformSeriesSpec(t)}}class T1 extends Mu{constructor(){super(...arguments),this.transformerConstructor=T0,this.type="map",this.seriesType=dD.map}}T1.type="map",T1.seriesType=dD.map,T1.transformerConstructor=T0;let T2=`${px.H}_ARC_TRANSFORM_VALUE`,T3=`${px.H}_ARC_RATIO`,T5=`${px.H}_ARC_START_ANGLE`,T4=`${px.H}_ARC_END_ANGLE`,T8=`${px.H}_ARC_K`,T6=`${px.H}_ARC_MIDDLE_ANGLE`,T9=`${px.H}_ARC_QUADRANT`,T7=`${px.H}_ARC_RADIAN`,Ct=-Math.PI/2,Ce=3*Math.PI/2;class Ci extends bC{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=.6,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=(0,eA.A)(t)?oS(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=(0,eA.A)(t)?oS(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=oS(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((0,eE.A)(t)||(0,eE.A)(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:NaN,y:NaN};let i=this.radiusAxisHelper.dataToPosition(oS(e));if(i<0){if("break"===this._invalidType||"link"===this._invalidType)return{x:NaN,y:NaN};if("zero"===this._invalidType)return this.angleAxisHelper.center()}let s=this.angleAxisHelper.dataToPosition(oS(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.x}dataToPositionY(t){var e;return null==(e=this.dataToPosition(t))?void 0:e.y}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;let i=[];return(null==(t=this.radiusAxisHelper)?void 0:t.getScale)&&this._radiusField.forEach(t=>{let e={key:t,operations:[]};fI(this.radiusAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)}),(null==(e=this.angleAxisHelper)?void 0:e.getScale)&&this._angleField.forEach(t=>{let e={key:t,operations:[]};fI(this.angleAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)}),i}setAttrFromSpec(){super.setAttrFromSpec(),(0,eA.A)(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),(0,eA.A)(this._spec.radius)&&
2(this._outerRadius=this._spec.radius),(0,eA.A)(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),(0,eA.A)(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){let t=this._angleAxisHelper||this._radiusAxisHelper;if(t)return t.layoutRadius();let{width:e,height:i}=this._region.getLayoutRect();return Math.min(e/2,i/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(dj.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null==(e=this._angleAxisHelper)?void 0:e.getAxisId())}},()=>{this._sortDataInAxisDomain()})}_sortDataInAxisDomain(){var t,e;(null==(e=null==(t=this.getViewData())?void 0:t.latestData)?void 0:e.length)&&bB(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){let t=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach(e=>{t.push(e)}),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach(e=>{t.push(e)}),t}}function Cs(t){return hj(t)?Number.parseFloat(t):0}let Cr=(t,e)=>{let{asStartAngle:i,asEndAngle:s,asMiddleAngle:r,asRadian:a,asRatio:n,asQuadrant:l,asK:o,showAllZero:h,supportNegative:u,showEmptyCircle:d}=e,c=e.angleField(),p=e.startAngle(),g=e.endAngle(),f=e.minAngle(),m=t.map(t=>Object.assign({},t));if(!m||0===m.length)return m;if(!h&&d&&Ca(m,c,u))return[];let _=(t,e,n)=>{t[i]=e,t[s]=e+n,t[r]=e+n/2,t[a]=n,t[l]=iI(e+n/2)},y=0,v=-1/0,b=!0;for(let t=0;t<m.length;t++){let e=u?Math.abs(Cs(m[t][c])):Cs(m[t][c]);y+=e,v=Math.max(e,v),b&&0!==e&&(b=!1),m[t][T2]=e}let x=m.map(t=>Number(t[c])),S=g-p,A=p,k=S,M=0,w=function(t,e=2){let i=t.reduce((t,e)=>t+(isNaN(e)?0:e),0);if(0===i)return 0;let s=Math.pow(10,e),r=t.map(t=>(isNaN(t)?0:t)/i*s*100),a=100*s,n=r.map(t=>Math.floor(t)),l=n.reduce((t,e)=>t+e,0),o=r.map((t,e)=>t-n[e]);for(;l<a;){let t=-1/0,e=null;for(let i=0;i<o.length;i++)o[i]>t&&(t=o[i],e=i);++n[e],o[e]=0,++l}return n.map(t=>t/s)}(x);if(m.forEach((t,e)=>{let i=t[T2],s=y?i/y:0,r=s*S;r<f?(r=f,k-=f):M+=i;let a=A,l=A+r;t[n]=s,t[o]=v?i/v:0,t._percent_=w[e],_(t,a,r),A=l}),k<S)if(k<=.001){let t=S/m.length;m.forEach((e,i)=>{_(e,p+i*t,t)})}else{let t=k/M;A=p,m.forEach(e=>{let i=e[a]===f?f:e[T2]*t;_(e,A,i),A+=i})}if(0!==y&&(m[m.length-1][s]=g),b&&h){let t=S/m.length;m.forEach((e,i)=>{_(e,p+i*t,t)})}return m},Ca=(t,e,i)=>!!(0,eE.A)(t)||0===t.length||!!t.every(t=>0===Cs(t[e]))||!i&&0===t.reduce((t,i)=>t+Cs(i[e]),0);function Cn(t,e,i){return(s,r,a)=>e?"radius"===t.growField?{overall:0}:{overall:t.growFrom(s,r,i)}:{overall:!1}}let Cl=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",options:Cn(t,!0,F.appear)}),Co={type:"fadeIn"};function Ch(t,e){if(!1===e)return{};switch(e){case"fadeIn":return Co;case"growRadius":return Cl(Object.assign(Object.assign({},t),{growField:"radius"}));default:return Cl(Object.assign(Object.assign({},t),{growField:"angle"}))}}var Cu=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Cd{constructor(t,e,i,s,r,a,n,l,o){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=r,this.middleAngle=a,this.innerRadius=n,this.outerRadius=l,this.circleCenter=o,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 Cc extends xG{constructor(t,e){const{data:i}=t,s=Cu(t,["data"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({data:i},eB({},Cc.defaultAttributes,s))),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map,this._line2MinLength=0,this._alignOffset=0}_overlapping(t){return["inside","inside-center"].includes(this.attribute.position)?super._overlapping(t):t}labeling(t,e,i="outside",s=0){if(t&&e)return{x:0,y:0}}_layout(t){var e,i,s;if(!t||!t.length)return[];let r=super._layout(t),a=r.map(t=>this.getGraphicBounds(t)),n=Object.assign(Object.assign({},this.attribute.textStyle),{text:"â¦"}),l=1/0;if(!1!==n.ellipsis){let t=this._createLabelText(n),e=this.getGraphicBounds(t);l=e.x2-e.x1}let o=r.map(t=>t.attribute),h=Array.from(this._idToGraphic.values());this._line2MinLength=(0,r3.A)(this.attribute.line.line2MinLength)?this.attribute.line.line2MinLength(t,h,this.attribute):this.attribute.line.line2MinLength,this._alignOffset=null!=(e=(0,r3.A)(this.attribute.layout.alignOffset)?this.attribute.layout.alignOffset(t,h,this.attribute):this.attribute.layout.alignOffset)?e:0;let u=this.layoutArcLabels(this.attribute.position,this.attribute,h,o,a,l);for(let t=0;t<o.length;t++){let e=o[t],a=u.find(t=>{var i;return(null==(i=t.refDatum)?void 0:i.id)===e.id});if(a){let e={visible:a.labelVisible,x:a.labelPosition.x,y:a.labelPosition.y,angle:a.angle,points:a.pointA&&a.pointB&&a.pointC?[a.pointA,a.pointB,a.pointC]:void 0,line:a.labelLine};"richtext"===r[t].type?e.width=null!=(i=a.labelLimit)?i:r[t].attribute.width:e.maxLineWidth=null!=(s=a.labelLimit)?s:r[t].attribute.maxLineWidth,a.refArc&&"arc3d"===a.refArc.type&&(e.anchor3d=[a.circleCenter.x-e.x,a.circleCenter.y-e.y],e.beta=a.refArc.attribute.beta),r[t].setAttributes(e)}}return r}layoutArcLabels(t,e,i,s,r,a){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=a;let n=0;
2i.forEach(t=>{t.attribute.outerRadius>n&&(n=t.attribute.outerRadius)}),s.forEach((t,i)=>{var a,l,o;let h=this._idToGraphic.get(t.id),u=h.getAttributes(!0),d={x:null!=(a=null==u?void 0:u.x)?a:0,y:null!=(l=null==u?void 0:u.y)?l:0};if(!(0,eE.A)(s[i])&&!(0,eE.A)(r[i])){let t=s[i]?s[i]:null,a=r[i]?r[i]:{x1:0,x2:0,y1:0,y2:0},l=(u.startAngle+u.endAngle)/2,c=u.endAngle-u.startAngle,p=iI(u.endAngle-c/2),g=new Cd(t,iE(d,u.outerRadius,l),iE(d,n+e.line.line1MinLength,l),p,c,l,u.innerRadius,u.outerRadius,d);g.refArc=h,g.pointA=iE(d,this.computeDatumRadius(2*d.x,2*d.y,u.outerRadius),g.middleAngle),g.labelSize={width:a.x2-a.x1,height:a.y2-a.y1},1===(o=g.quadrant)||2===o?this._arcRight.set(g.refDatum,g):xu(g.quadrant)&&this._arcLeft.set(g.refDatum,g)}});let l=Array.from(this._arcLeft.values()),o=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":case"inside-center":h.push(...this._layoutInsideLabels(o,e,i)),h.push(...this._layoutInsideLabels(l,e,i));break;default:h.push(...this._layoutOutsideLabels(o,e,i)),h.push(...this._layoutOutsideLabels(l,e,i))}return h}_layoutInsideLabels(t,e,i){var s,r;let a=e.spaceWidth,n=null!=(s=e.position)?s:"inside",l=null!=(r=e.offsetRadius)?r:-a;return t.forEach(t=>{var i,s,r,o;let h,{labelSize:u,radian:d}=t,c=t.innerRadius,p=t.outerRadius;h=d<((o=u.height)>2*p?NaN:2*Math.asin(o/2/p))?0:p-(d>=Math.PI?c:Math.max(c,u.height/2/Math.tan(d/2)))-a,!0!==e.rotate&&(h=p-a);let g=this._getFormatLabelText(t.refDatum,h);t.labelText=g;let f=Math.min(h,t.labelSize.width),m=this._computeAlign(t,e),_,y=0;if("inside"===n&&(y="left"===m?f:"right"===m?0:f/2),_="inside-inner"===n?c-l+y:"inside-center"===n?c+(p-c)/2:p+l-y,t.labelPosition=iE(t.circleCenter,_,t.middleAngle),t.labelLimit=f,rD(f,0)||(t.labelVisible=!1),!1!==e.rotate){t.angle=null!=(s=null==(i=e.textStyle)?void 0:i.angle)?s:t.middleAngle;let a=null!=(r=e.offsetAngle)?r:0;["inside-inner","inside-outer"].includes(n)&&(a+=Math.PI/2),t.angle+=a}}),t}_layoutOutsideLabels(t,e,i){var s,r,a;let n=null!=(s=i[0].attribute.x)?s:0,l=2*(null!=(r=i[0].attribute.y)?r:0),o=e.layout,h=e.spaceWidth;if(t.forEach(t=>{let e=xu(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"===o.strategy){for(let s of t){let{labelPosition:t,labelSize:r}=s;s.labelLimit=r.width,s.pointB=xu(s.quadrant)?{x:t.x+r.width/2+this._line2MinLength+h,y:t.y}:{x:t.x-r.width/2-this._line2MinLength-h,y:t.y},this._computeX(s,e,i)}!1===e.coverEnable&&"none"===o.strategy&&this._coverLabels(t)}else{let s=l/((null==(a=e.textStyle)?void 0:a.fontSize)||16);this._adjustY(t,s,e,i);let{minY:r,maxY:n}=t.reduce((t,e)=>{let{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(l,Math.max(s,t.maxY)),t},{minY:1/0,maxY:-1/0}),o=Math.max(Math.abs(l/2-r),Math.abs(n-l/2)),h=this._computeLayoutRadius(o,e,i);for(let s of t)this._computePointB(s,h,e,i),this._computeX(s,e,i)}let u=2*n;return t.forEach(t=>{var i,s;t.labelVisible&&(rF(t.pointB.x,this._line2MinLength+h)||rD(t.pointB.x,u-this._line2MinLength-h))&&(t.labelVisible=!1),t.angle=null!=(s=null==(i=e.textStyle)?void 0:i.angle)?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,r;let a=t.circleCenter,n=this.attribute.width;this.attribute.height;let l=0;i.forEach(t=>{t.getAttributes(!0).outerRadius>l&&(l=t.getAttributes(!0).outerRadius)});let o=this.computeLayoutOuterRadius(l,e.width,e.height),h=e.line.line1MinLength,u=null==(s=e.layout)?void 0:s.align,d=e.spaceWidth,{labelPosition:c,quadrant:p,pointB:g}=t;eP(g.x*g.y)||(t.pointC={x:NaN,y:NaN},c.x=NaN,t.labelLimit=0);let f=this.computeRadius(o,e.width,e.height),m=xu(p)?-1:1,_=0,y=(m>0?n-g.x:g.x-0)+this._alignOffset-this._line2MinLength-d;"labelLine"===u&&(_=(f+h+this._line2MinLength)*m+a.x,y=(m>0?n-_:_-0)-d);let v=this._getFormatLabelText(t.refDatum,y);t.labelText=v;let b=Math.min(y,t.labelSize.width);switch(u){case"labelLine":break;case"edge":_=m>0?n-b-d:0+b+d;break;default:_=g.x+m*this._line2MinLength}let x=(b=Math.max(this._ellipsisWidth,b))<t.labelSize.width-1;t.labelLimit=x?b:null,t.pointC={x:_,y:c.y};let S=("left"===(r=this._computeAlign(t,e))?0:"right"===r?1:.5)*(x?b:t.labelSize.width);"edge"===u?(c.x=(m>0?n:0)-m*S+m*this._alignOffset,t.pointC.x+=m*this._alignOffset):c.x=_+m*(this._alignOffset+d+S)}_computeAlign(t,e){var i,s,r,a,n,l;let o=null!=(s=null==(i=e.textStyle)?void 0:i.textAlign)?s:null==(r=e.textStyle)?void 0:r.align,h=null!=(n=null==(a=e.layout)?void 0:a.textAlign)?n:null==(l=e.layout)?void 0:l.align;return"inside"!==e.position?(0,eE.A)(o)||"auto"===o?"edge"===h?xu(t.quadrant)?"left":"right":xu(t.quadrant)?"right":"left":o:(0,eE.A)(o)||"auto"===o?"center":o}_getFormatLabelText(t,e){var i;return null!=(i=null==t?void 0:t.text)?i:""}_adjustY(t,e,i,s){var r;s[0].attribute.x;
2let a=2*(null!=(r=s[0].attribute.y)?r:0),n=i.layout;if("vertical"===n.strategy){let e,i=0,s=t.length;if(s<=0)return;for(let r=0;r<s;r++){let{y1:a}=t[r].getLabelBounds();if(rF(e=a-i,0)){let i=this._shiftY(t,r,s-1,-e);this._shiftY(t,i,0,e/2)}let{y2:n}=t[r].getLabelBounds();i=n}let{y1:r}=t[0].getLabelBounds();rF(e=r-0,0)&&this._shiftY(t,0,s-1,-e);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>a;e--)t[e].labelVisible=!1}else if("none"!==n.strategy){let r=t.map((t,e)=>({arc:t,originIndex:e,priorityIndex:0}));r.sort((t,e)=>e.arc.radian-t.arc.radian),r.forEach((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1});let l=1/0,o=-1/0;for(let h=0;h<e&&h<t.length;h++){let e;this._storeY(t);let u=r[h].arc;this._computeYRange(u,i,s),u.labelVisible=!0;let d=u.labelPosition.y,{lastIndex:c,nextIndex:p}=this._findNeighborIndex(t,r[h]),g=t[c],f=t[p];if(-1===c&&-1!==p){let e=f.labelPosition.y;d>e?u.labelPosition.y=e-f.labelSize.height/2-u.labelSize.height/2:this._twoWayShift(t,u,f,p)}else if(-1!==c&&-1===p){let e=g.labelPosition.y;d<e?u.labelPosition.y=e+g.labelSize.height/2+u.labelSize.height/2:this._twoWayShift(t,g,u,r[h].originIndex)}else if(-1!==c&&-1!==p){let e=g.labelPosition.y,i=f.labelPosition.y;d>i?(u.labelPosition.y=i-f.labelSize.height/2-u.labelSize.height/2,this._twoWayShift(t,g,u,r[h].originIndex)):(d<e?u.labelPosition.y=e+g.labelSize.height/2+u.labelSize.height/2:this._twoWayShift(t,g,u,r[h].originIndex),this._twoWayShift(t,u,f,p))}let m=Math.min(l,r[h].originIndex),_=Math.max(o,r[h].originIndex);if(rD(e=t[_].getLabelBounds().y2-a,0)&&this._shiftY(t,_,0,-e),rF(e=t[m].getLabelBounds().y1-0,0)&&this._shiftY(t,m,t.length-1,-e),rD(e=t[_].getLabelBounds().y2-a,0)){u.labelVisible=!1,this._restoreY(t);break}n.tangentConstraint&&!this._checkYRange(t)?(u.labelVisible=!1,this._restoreY(t)):(l=m,o=_)}}}_shiftY(t,e,i,s){let r=e<i?1:-1,a=e;for(;-1!==a;){t[a].labelPosition.y+=s;let e=this._findNextVisibleIndex(t,a,i,r);if(e>=0&&e<t.length){let{y1:i,y2:s}=t[a].getLabelBounds(),{y1:n,y2:l}=t[e].getLabelBounds();if(r>0&&s<n||r<0&&i>l)return a}a=e}return i}_findNextVisibleIndex(t,e,i,s){let r=(i-e)*s;for(let i=1;i<=r;i++){let r=e+i*s;if(t[r].labelVisible)return r}return -1}_computePointB(t,e,i,s){let r=0;s.forEach(t=>{t.getAttributes(!0).outerRadius>r&&(r=t.getAttributes(!0).outerRadius)});let a=this.computeLayoutOuterRadius(r,i.width,i.height),n=i.line.line1MinLength;if("none"===i.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{let s=t.circleCenter,r=this.computeRadius(a,i.width,i.height),{labelPosition:l,quadrant:o}=t,h=e-Math.max(r+n,t.outerRadius),u=Math.sqrt(e**2-Math.abs(s.y-l.y)**2)-h;eP(u)?t.pointB={x:s.x+u*(xu(o)?-1:1),y:l.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(let e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){let s,r,a,n,l,o=t.circleCenter,h={width:2*o.x,height:2*o.y},u=0;i.forEach(t=>{t.getAttributes(!0).outerRadius>u&&(u=t.getAttributes(!0).outerRadius)});let d=this.computeLayoutOuterRadius(u,e.width,e.height),c=e.line.line1MinLength,{width:p,height:g}=h,f=this.computeRadius(d,e.width,e.height),m=this._computeLayoutRadius(g/2,e,i),_=Math.abs(t.center.x-p/2),y=t.center.y-g/2;if(rL(p/2,_))s=0,r=1,a=-y;else if(rL(g/2,y))s=1,r=0,a=-_;else{let t=-1/(y/_);s=t,r=-1,a=y-t*_}let v=function(t,e,i,s,r){if(0===t&&0===e||r<=0)return[];if(0===t){let t=-i/e,a=r**2-(t-0)**2;return a<0?[]:0===a?[{x:s,y:t}]:[{x:Math.sqrt(a)+s,y:t},{x:-Math.sqrt(a)+s,y:t}]}if(0===e){let e=-i/t,a=r**2-(e-s)**2;return a<0?[]:0===a?[{x:e,y:0}]:[{x:e,y:Math.sqrt(a)+0},{x:e,y:-Math.sqrt(a)+0}]}let a=(e/t)**2+1,n=2*(e/t*(i/t+s)-0),l=n**2-4*a*((i/t+s)**2+0-r**2);if(l<0)return[];let o=(-n+Math.sqrt(l))/(2*a),h=(-n-Math.sqrt(l))/(2*a),u=-(e*o+i)/t;return 0===l?[{x:u,y:o}]:[{x:u,y:o},{x:-(e*h+i)/t,y:h}]}(s,r,a,c+f-m,m);v.length<2||(v[0].x>v[1].x&&v.reverse(),v[0].x<0?rL(v[0].y,v[1].y)?rD(t.middleAngle,-Math.PI)&&rF(t.middleAngle,0)||rD(t.middleAngle,Math.PI)&&rF(t.middleAngle,2*Math.PI)?(n=0,l=v[1].y+g/2):(n=v[1].y+g/2,l=g):v[0].y<v[1].y?(n=0,l=v[1].y+g/2):(n=v[1].y+g/2,l=h.height):(n=Math.min(v[0].y,v[1].y)+g/2,l=Math.max(v[0].y,v[1].y)+g/2),t.labelYRange=[n,l])}_computeLayoutRadius(t,e,i){let s=e.layoutArcGap,r=e.line.line1MinLength,a=0;
2i.forEach(t=>{t.getAttributes(!0).outerRadius>a&&(a=t.getAttributes(!0).outerRadius)});let n=this.computeLayoutOuterRadius(a,e.width,e.height),l=this.computeRadius(n,e.width,e.height)+r,o=l-s;return Math.max((o**2+t**2)/(2*o),l)}_findNeighborIndex(t,e){let i=e.originIndex,s=-1,r=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){r=e;break}return{lastIndex:s,nextIndex:r}}_twoWayShift(t,e,i,s){let r=i.getLabelBounds().y1-e.getLabelBounds().y2;if(rF(r,0)){let e=this._shiftY(t,s,t.length-1,-r);this._shiftY(t,e,0,r/2)}}_restoreY(t){for(let e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(let e of t){let{labelYRange:t,labelPosition:i}=e;if(e.labelVisible&&t&&(rF(i.y,t[0])||rD(i.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){let s=t[i].getLabelBounds();!function(t,e){let{x1:i,y1:s,x2:r,y2:a}=t,{x1:n,y1:l,x2:o,y2:h}=e;return!(i<=n&&r<=n||i>=o&&r>=o||s<=l&&a<=l||s>=h&&a>=h)}(e,s)?e=s:t[i].labelVisible=!1}}_getLabelLinePoints(t,e){return t.attribute.points}_createLabelLine(t,e){var i,s,r,a,n;let{line:l={},visible:o}=t.attribute,h=super._createLabelLine(t,e);if(h&&(h.setAttributes({visible:null==(r=null!=(i=l.visible&&o)?i:null==(s=t.attribute)?void 0:s.visible)||r,lineWidth:null!=(n=null==(a=l.style)?void 0:a.lineWidth)?n:1}),l.smooth&&h.setAttributes({curveType:"basis"}),"arc3d"===e.type&&e)){let{beta:t,x:i,y:s}=e.getAttributes(!0);h.setAttributes({beta:t,anchor3d:[i,s]})}return h}computeRadius(t,e,i,s){return this.computeLayoutRadius(e||0,i||0)*t*((0,eE.A)(s)?1:s)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position||"inside-center"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){let s=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*s}}Cc.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,boundsPadding:[-1,0,-1,0],ellipsis:!0},position:"outside",line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0}};class Cp extends _x{constructor(t,e){super(t,e),this.type=Cg.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(t,e,i="normal",s)=>{var r;return s+(null!=(r=this.getAttribute("radiusOffset",e,i))?r:0)},this.computeCenter=(t,e,i="normal",s)=>iE({x:0,y:0},this.getAttribute("centerOffset",e,i),e[T6])[t]+s,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 Cg extends Cp{constructor(){super(...arguments),this.type=Cg.type}}Cg.type="arc";let Cf=()=>{_k(),ku(),x$("arc",Cc),y_.registerBuiltInAnimate("growRadiusIn",y7),y_.registerBuiltInAnimate("growRadiusOut",vt),y_.registerBuiltInAnimate("growAngleIn",vi),y_.registerBuiltInAnimate("growAngleOut",vs),uP.registerGraphicComponent("arc",A9),uP.registerMark(Cg.type,Cg)},Cm=Object.assign(Object.assign({},bc),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}});class C_ extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){let i=this._theme,s=t;if(this._shouldMergeThemeToSpec()){let i=this._getDefaultSpecFromChart(e);s=uy({},this._theme,i,t);let r=(t,e)=>uy({},"inside"===t||"inside-center"===t?this._theme.innerLabel:this._theme.outerLabel,e);(0,ev.A)(s.label)?s.label=s.label.map(t=>r(t.position,t)):s.label=r(s.label.position,s.label)}return{spec:s,theme:i}}_getDefaultSpecFromChart(t){var e;let i=null!=(e=super._getDefaultSpecFromChart(t))?e:{},{centerX:s,centerY:r}=t;return(0,eA.A)(s)&&(i.centerX=s),(0,eA.A)(r)&&(i.centerY=r),Object.keys(i).length>0?i:void 0}}px.H,px.H,px.H;let Cy=`${px.H}_LABEL_VISIBLE`;px.H,px.H;class Cv extends Ci{constructor(){super(...arguments),this.transformerConstructor=C_,this._pieMarkName="pie",this._pieMarkType="arc",this.getCenter=()=>{var t,e;let i=this._region.getLayoutRect();return{x:hU(null==(t=this._spec)?void 0:t.centerX,i.width,i,i.width/2),y:hU(null==(e=this._spec)?void 0:e.centerY,i.height,i,i.height/2)}},this._startAngle=Ct,this._endAngle=Ce,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=t=>{let e=t[T6];if((0,eE.A)(e))return null;let i=this.computeDatumRadius(t),s=this.computeDatumInnerRadius(t);return iE(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,r,a;super.setAttrFromSpec(),this._centerOffset=null!=(t=this._spec.centerOffset)?t:0,this._cornerRadius=null!=(e=this._spec.cornerRadius)?e:0;let n=function(t,e){let i=0,s=2*Math.PI,r=(0,eA.A)(t),a=(0,eA.A)(e);for(r||a?a?(i=r?t: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}}((0,eA.A)(this._spec.startAngle)?iC(this._spec.startAngle):this._startAngle,(0,eA.A)(this._spec.endAngle)?iC(this._spec.endAngle):this._endAngle);this._startAngle=n.startAngle,this._endAngle=n.endAngle,this._padAngle=(0,eA.A)(this._spec.padAngle)?iC(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._specR
2adiusField=[],this._showEmptyCircle=null!=(s=null==(i=this._spec.emptyPlaceholder)?void 0:i.showEmptyCircle)&&s,this._showAllZero=null!=(r=this._spec.showAllZero)&&r,this._supportNegative=null!=(a=this._spec.supportNegative)&&a}initData(){super.initData();let t=this.getViewData();if(!t)return;c3(this._dataSet,"pie",Cr),t.transform({type:"pie",options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>(0,eA.A)(this._spec.minAngle)?iC(this._spec.minAngle):0,asStartAngle:T5,asEndAngle:T4,asRatio:T3,asMiddleAngle:T6,asRadian:T7,asQuadrant:T9,asK:T8,showAllZero:this._showAllZero,supportNegative:this._supportNegative,showEmptyCircle:this._showEmptyCircle}},!1);let e=new eR(this._dataSet,{name:`${px.H}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new mz(this._option,e)}compileData(){var t;super.compileData(),null==(t=this._viewDataLabel)||t.compile()}initMark(){this._pieMark=this._createMark(Object.assign(Object.assign({},Cv.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{key:pA,groupKey:this._seriesField,isSeriesMark:!0},{morph:bk(this._spec,this._pieMarkName),morphElementKey:this._seriesField}),this._showEmptyCircle&&(this._emptyArcMark=this._createMark({name:"emptyCircle",type:"arc"},{dataView:!1}),this._data.addRelatedMark(this._emptyArcMark))}startAngleScale(t){return hD(T5)(t)}endAngleScale(t){return hD(T4)(t)}_computeLayoutRadius(){return SP(()=>this._spec.layoutRadius,this.getLayoutRect,this.getCenter,()=>({startAngle:this._startAngle,endAngle:this._endAngle}))}initMarkStyle(){let t={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:mP(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:mP(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",N.Series);let i=this._emptyArcMark;i&&this.setMarkStyle(i,Object.assign(Object.assign({},t),{visible:()=>{let t=this.getViewData().latestData;return!t||!t.length}}),"normal",N.Series)}getInteractionTriggers(){return this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e){if(super.initMarkStyleWithSpec(t,e),t.name===this._pieMarkName){let e=this.getSpec()[t.name];if(e)for(let i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,N.User_Mark)}"emptyCircle"===t.name&&this.setMarkStyle(t,this.generateRadiusStyle(e.style),"normal",N.User_Mark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{visible:hD(Cy).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())||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd()}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(dj.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;let 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,r,a,n,l;let o="normal"===t?null==(s=null==(i=this.getSpec()[(null==(e=this._pieMark)?void 0:e.name)||"pie"])?void 0:i.style)?void 0:s.outerRadius:null==(l=null==(n=null==(a=this.getSpec()[(null==(r=this._pieMark)?void 0:r.name)||"pie"])?void 0:a.state)?void 0:n[t])?void 0:l.outerRadius;return null!=o?o:this._outerRadius}getInnerRadius(t="normal"){var e,i,s,r,a,n,l;let o="normal"===t?null==(s=null==(i=this.getSpec()[(null==(e=this._pieMark)?void 0:e.name)||"pie"])?void 0:i.style)?void 0:s.innerRadius:null==(l=null==(n=null==(a=this.getSpec()[(null==(r=this._pieMark)?void 0:r.name)||"pie"])?void 0:a.state)?void 0:n[t])?void 0:l.innerRadius;return null!=o?o:this._innerRadius}computeRadius(t,e){return this._computeLayoutRadius()*t*((0,eE.A)(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}
2;let s=["centerX","centerY","centerOffset","radius","innerRadius","cornerRadius","startAngle","endAngle","padAngle"];s.forEach(t=>{i[t]=!0});let r=super._compareSpec(t,e,i);return t=null!=t?t:{},s.some(i=>t[i]!==e[i])&&(r.reRender=!0,r.change=!0),r}computeDatumInnerRadius(t,e){return this._computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t,e){let i=t[T6];if((0,eE.A)(i)||e&&!this.isDatumInViewData(t))return null;let s=this.computeDatumRadius(t);return iE(this.computeCenter(t),s,i)}initAnimation(){var t,e,i,s,r,a,n,l,o;let h={growFrom:(t,e,i)=>{var s,r;if(i===F.appear)return this._startAngle;if(i===F.disappear)return this._endAngle;let a=[F.disappear,F.exit],n=this._pieMark.getGraphics(),l=null==t?void 0:t[pS];if(void 0===n.find(t=>{var e;return(null==(e=t.context.data[0])?void 0:e[pS])<l}))return this._startAngle;if(void 0===n.find(t=>{var e;return(null==(e=t.context.data[0])?void 0:e[pS])>l}))return this._endAngle;let o=[...n].reverse().find(t=>{var e;return(null==(e=t.context.data[0])?void 0:e[pS])<l});return a.includes(i)?null==(s=null==o?void 0:o.getFinalAttribute())?void 0:s.endAngle:null==(r=null==o?void 0:o.attribute)?void 0:r.endAngle}},u=null==(t=this._spec.animationAppear)?void 0:t.preset;if(this._pieMark){let t,i,d,c=bb(null==(e=uP.getAnimationInKey("pie"))?void 0:e(h,u),bx("pie",this._spec,this._markAttributeContext));c.normal&&c.normal.type&&(s=this._pieMark,t=null!=(n=null==(a=(r=c.normal).options)?void 0:a.distance)?n:10,i=eP(r.duration)?r.duration/2:1e3,d=null!=(l=r.options.easing)?l:"cubicOut",c.normal={oneByOne:r.oneByOne,loop:null!=(o=r.loop)&&o,timeSlices:[{duration:i,effects:{easing:d,channel:{x:{from:t=>s.getAttribute("x",t),to:e=>s.getAttribute("x",e)+iE({x:0,y:0},t,e[T6]).x},y:{from:t=>s.getAttribute("y",t),to:e=>s.getAttribute("y",e)+iE({x:0,y:0},t,e[T6]).y}}}},{duration:i,effects:{easing:d,channel:{x:{to:t=>s.getAttribute("x",t),from:e=>s.getAttribute("x",e)+iE({x:0,y:0},t,e[T6]).x},y:{to:t=>s.getAttribute("y",t),from:e=>s.getAttribute("y",e)+iE({x:0,y:0},t,e[T6]).y}}}}]}),this._pieMark.setAnimationConfig(c)}if(this._emptyArcMark){let t=bb(null==(i=uP.getAnimationInKey("emptyCircle"))?void 0:i(h,null!=u?u:"fadeIn"));this._emptyArcMark.setAnimationConfig(t)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}Cv.transformerConstructor=C_,Cv.mark=Cm,Cv.builtInTheme={pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}}
2,innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}}};class Cb extends Cv{constructor(){super(...arguments),this.type=dD.pie}}Cb.type=dD.pie;class Cx extends Ms{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;let r=oS(t.indicator),a=null!=(e=t.innerRadius)?e:null==(s=null==(i=t.series)?void 0:i[0])?void 0:s.innerRadius;return(0,eA.A)(a)&&r.forEach(t=>{(0,eE.A)(t.limitRatio)&&(t.limitRatio=a)}),r}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["radius","outerRadius","innerRadius","startAngle","endAngle","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),(0,ev.A)(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach(t=>{"axis"===t.filterMode&&(t.filterMode="filter")}),this.transformSeriesSpec(t),(0,eA.A)(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class CS extends Cx{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;let i=super._getDefaultSeriesSpec(t,["center","centerOffset","cornerRadius","padAngle","minAngle","emptyPlaceholder","showAllZero","supportNegative","useSequentialAnimation","layoutRadius"]);return i.categoryField=t.categoryField||t.seriesField,i.valueField=t.valueField||t.angleField,i.emptyCircle=null==(e=t.emptyPlaceholder)?void 0:e.emptyCircle,i}}class CA extends Mu{constructor(){super(...arguments),this.transformerConstructor=CS}}CA.transformerConstructor=CS;class Ck extends CA{constructor(){super(...arguments),this.transformerConstructor=CS,this.type="pie",this.seriesType=dD.pie}}function CM(t){return"angle"===t?"growAngleIn":"growRadiusIn"}Ck.type="pie",Ck.seriesType=dD.pie,Ck.transformerConstructor=CS;let Cw=t=>({type:CM(t.growField),options:{overall:!0}}),CT={type:"fadeIn"};class CC extends Ci{getStackGroupFields(){return this._angleField}getStackValueField(){return oS(this._spec.valueField)[0]||oS(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.get
2Stack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(pC),this.setInnerRadiusField(pT)}setValueFieldToPercent(){this.setRadiusField(pE),this.setInnerRadiusField(pB)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}let CB=Object.assign(Object.assign({},bc),{rose:{name:"rose",type:"arc"}});class CE extends bT{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}var CP=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class CO extends SN{get center(){return this._center}get startAngle(){return this._startAngle}get endAngle(){return this._endAngle}getOrient(){return this._orient}getDefaultInteractive(){return"angle"!==this._orient}getGroupScales(){return this._groupScales}static getSpecInfo(t){let e,i;if(!t[this.specKey])return null;let s=(0,ev.A)(t[this.specKey]),r=s?t[this.specKey]:[t[this.specKey]],a=[],n=[],l=[];return r.forEach((r,o)=>{var h,u,d,c,p,g;let f,m,_,y,v;if("angle"!==(f=null==r?void 0:r.orient)&&"radius"!==f)return;let{axisType:b,componentName:x,startAngle:S,endAngle:A,center:k,outerRadius:M,layoutRadius:w}=(m=null!=(h=r.type)?h:"angle"===r.orient?"band":"linear",_=`${hc.polarAxis}-${m}`,y=null!=(u=r.startAngle)?u:t.startAngle,{axisType:m,componentName:_,startAngle:null!=y?y:-90,endAngle:null!=(v=null!=(d=r.endAngle)?d:t.endAngle)?v:(0,eA.A)(y)?y+360:270,center:(0,eA.A)(t.center)?t.center:(0,eA.A)(null==t?void 0:t.centerX)||(0,eA.A)(null==t?void 0:t.centerY)?{x:null==t?void 0:t.centerX,y:null==t?void 0:t.centerY}:void 0,outerRadius:null!=(g=null!=(p=null!=(c=r.outerRadius)?c:r.radius)?p:t.outerRadius)?g:t.radius,layoutRadius:t.layoutRadius});r.center=k,r.startAngle=S,r.endAngle=A,r.outerRadius=M,r.type=b,r.layoutRadius=w;let T={spec:r,specPath:s?[this.specKey,o]:[this.specKey],specInfoPath:["component",this.specKey,o],type:x};a.push(T),"radius"===r.orient?(n.push(T),i=o):(l.push(T),e=o)}),n.forEach(t=>{t.angleAxisIndex=e}),l.forEach(t=>{t.radiusAxisIndex=i}),a}static createComponent(t,e){let{spec:i}=t,s=CP(t,["spec"]),r=uP.getComponentInKey(s.type);return r?new r(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}constructor(t,e){super(t,e),this.type=hc.polarAxis,this.name=hc.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=j.Axis,this._tick=void 0,this._center=null,this._startAngle=Ct,this._endAngle=Ce,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),x8(this._regions,t=>{"radius"===this.getOrient()?SB(t.radiusAxisHelper,this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(t.radiusAxisHelper=this.axisHelper()):SB(t.angleAxisHelper,this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(t.angleAxisHelper=this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;let i=null==(e=this.getRegions())?void 0:e[0];return i?i.getLayoutStartPoint():t},this.getCenter=()=>{var t,e;let i=this.getRefLayoutRect(),{width:s,height:r}=i;return{x:hU(null==(t=this._center)?void 0:t.x,s,i,s/2),y:hU(null==(e=this._center)?void 0:e.y,r,i,r/2)}},this.getRefLayoutRect=()=>this.getRegions()[0].getLayoutRect(),this._coordinateType="polar"}setAttrFromSpec(){super.setAttrFromSpec(),this._specVisible&&(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=iC(this._spec.startAngle),this._endAngle=iC(this._spec.endAngle),this._inverse=this._spec.inverse}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimal:null==(t=this._tick)?void 0:t.noDecimals,startAngle:this.startAngle,labelOffset:Sk(this._spec),getRadius:()=>this.getOuterRadius(),inside:this._spec.inside})}updateScaleRange(){let t,e=this._scale.range();return t="radius"===this.getOrient()?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],(!e||!t||e[0]!==t[0]||e[1]!==t[1])&&(this._scale.range(t),!0)}collectSeriesField(t,e){var i,s;return t>0?null==(s=null==(i=e.getGroups())?void 0:i.fields)?void 0:s[t]:"radius"===this.getOrient()?e.getRadiusField():e.getAngleField()}updateSeriesScale(){x8(this._regions,t=>{"radius"===this.getOrient()?SB(t.radiusAxisHelper,this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(t.setRadiusScale(this._scale),t.radiu
2sAxisHelper=this.axisHelper()):SB(t.angleAxisHelper,this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){let e="radius"===this.getOrient()?t.getRadiusField():t.getAngleField();return fI(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:fI(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){let e=this.pointToCoord(t);return"radius"===this.getOrient()?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){return iE(this.getCenter(),t.radius,t.angle)}pointToCoord(t){return iP(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;let i=null==(e=this.getTickData())?void 0:e.getLatestData();return i&&i.length?[i.map(e=>SC(e.value,this._getNormalizedValue([e.value],t)))]:[]}_getStartValue(){return"radius"===this.getOrient()?this.computeLayoutInnerRadius():this._startAngle}_layoutAngleAxis(){var t,e,i,s,r;let a=this.getCenter(),n=this.computeLayoutOuterRadius(),l=this.computeLayoutInnerRadius(),o=this._endAngle-this._startAngle,h=this.getLabelItems(o),u=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:a,radius:n,innerRadius:l,startAngle:this._startAngle,endAngle:this._endAngle,layoutRect:this.getRefLayoutRect(),autoLabelMaxWidth:null!=(e=null==(t=this._spec.label)?void 0:t.autoLabelMaxWidth)&&e,sides:(null==(r=null==(s=null==(i=this._getRelatedAxis(this._option.radiusAxisIndex))?void 0:i.getSpec())?void 0:s.grid)?void 0:r.smooth)?void 0:this.getScale().domain().length}),d=Object.assign(Object.assign({},u),{size:this.getRefLayoutRect(),title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"angle",scale:this._scale});this._spec.grid.visible&&(d.grid=Object.assign({type:"line",smoothLink:!0,items:h[0]},u)),this._update(d)}_layoutRadiusAxis(){var t,e,i;let s=this.getCenter(),r=this.computeLayoutOuterRadius(),a=this.computeLayoutInnerRadius(),n=this.coordToPoint({angle:this._startAngle,radius:r}),l=this.coordToPoint({angle:this._startAngle,radius:a}),o=i6.distancePP(l,n),h=this.getLabelItems(o),u=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:l,end:n,verticalFactor:-1}),d=Object.assign(Object.assign({},u),{title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"radius",scale:this._scale.clone()});(null==(t=this._spec.grid)?void 0:t.visible)&&(d.grid=Object.assign({items:h[0],type:(null==(e=this._spec.grid)?void 0:e.smooth)?"circle":"polygon",center:s,closed:!0,sides:null==(i=this._getRelatedAxis(this._option.angleAxisIndex))?void 0:i.getScale().domain().length,startAngle:this._startAngle,endAngle:this._endAngle},u)),this._update(d)}_getRelatedAxis(t){if((0,eA.A)(t))return this._option.getComponentByIndex(this.specKey,t)}_computeLayoutRadius(){return SP(()=>this._spec.layoutRadius,this.getRefLayoutRect,this.getCenter,()=>({startAngle:this._startAngle,endAngle:this._endAngle}))}computeLayoutOuterRadius(){var t;let e=null!=(t=this._spec.outerRadius)?t:this._spec.radius,i=null!=e?e:this.getRefSeriesRadius().outerRadius;return this._computeLayoutRadius()*i}computeLayoutInnerRadius(){var t;let e=null!=(t=this._spec.innerRadius)?t:this.getRefSeriesRadius().innerRadius;return this._computeLayoutRadius()*e}getRefSeriesRadius(){let t=.6,e=0,i=this.getChart().getSpec();return x8(this.getRegions(),s=>{var r;if(r=s.type,[dD.rose,dD.radar,dD.circularProgress].includes(r)){let{outerRadius:r=i.outerRadius,innerRadius:a=i.innerRadius}=s;eP(r)&&(t=r),eP(a)&&(e=a)}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){let{grid:e}=t,i=CP(t,["grid"]);this._axisMark.getComponent().setAttributes(uy({},this._axisStyle,i)),this._gridMark&&this._gridMark.getComponent().setAttributes(uy({},this._gridStyle,e))}invert(t){var e;if("angle"===this.getOrient()&&"band"===this._scale.type){let i=this._scale.range(),s=i[i.length-1]-i[0],r=.5===(null!=(e=this.getSpec().bandPosition)?e:this._defaultBandPosition)?0:this._scale.bandwidth()/2;if(i[0]<0){let e=(t+r+Math.abs(i[0]))%s-Math.abs(i[0]);return this._scale.invert(e)}return this._scale.invert((t+r)%s)}return this._scale.invert(t)}}CO.type=hc.polarAxis,CO.specKey="axes";let CR=(t,e)=>{let i,{tickCount:s,forceTickCount:r,tickStep:a,getRadius:n,labelOffset:l,labelGap:o=0,labelStyle:h}=e,u=null==n?void 0:n();if(!u||u<=0)return Sc(t.domain());if((0,eA.A)(a))i=t.stepTicks(a);else if((0,eA.A)(r))i=t.forceTicks(r);else if((0,eA.A)(s)){let e=t.range(),r=Math.abs(e[e.length-1]-e[0]),a=(0,r3.A)(s)?s({axisLength:r,labelStyle:h}):s;i=t.ticks(a)}else if(e.sampling){let s=t.domain(),r=t.range(),a=((t,e,i)=>{var s;let{labelStyle:r,getRadius:a,labelOffset:n,labelFormatter:l,inside:o}=i,h=null==a?void 0:a(),u=null!=(s=r.angle)?s:0,d=_R(r);return e.map(e=>{var i;let s,a,c=l?l(e):`${e}`,{width:p,height:g}=d.quickMeasure(c),f=Math.max(p,12),m=Math.max(g,12),_=t.scale(e),y={x:0,y:0},v=0,b=0,x={align:r.textAlign,baseline:r.textBaseline},{x:S,y:A}=(a=At(s=iE({x:0,y:0},h,_),Ae(n,s,y,o)),i=Ae(n||1,a,y,o),{x:a.x+i[0],y:a.y+i[1]});return x.align||(rL(S,y.x)?x.baseline||(x.baseline=A>y.y?"top":"bottom"):S>y.x?x.align="left":S<y.x&&(x.align="right")),v=S+("right"===x.align?-f:"left"
2===x.align?0:-f/2),b=A+("bottom"===x.baseline?-m:"top"===x.baseline?0:-m/2),(new iJ).set(v,b,v+f,b+m).rotate(u,v+f/2,b+m/2)})})(t,s,e),n=oM(r),h=Math.abs(ok(r)-n)*(u+l)/s.length,{step:d,delCount:c}=CI(s,a,o,Math.floor(a.reduce((t,e)=>Math.min(t,e.width(),e.height()),Number.MAX_VALUE)/h));i=(i=t.stepTicks(d)).slice(0,i.length-c)}else i=t.domain();return Sc(i)},CI=(t,e,i,s)=>{let r=s;do{let s=!0;r++;let a=0;do a+r<t.length&&Sp(e[a],e[a+r],i)&&(s=!1),a+=r;while(s&&a<t.length)if(s)break}while(r<=t.length)let a=0;if(t.length>2){let i=t.length-t.length%r;for(i>=t.length&&(i-=r);i>0&&Sp(e[0],e[i]);)a++,i-=r}return{step:r,delCount:a}};class CL{isInValidValue(t){let{startAngle:e=_T,endAngle:i=_C}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){let{startAngle:e=_T,endAngle:i=_C,center:s,radius:r,inside:a=!1,innerRadius:n=0}=this.attribute;return iE(s,a&&n>0?n:r,e+(i-e)*t)}getVerticalVector(t,e=!1,i){return Ae(t,i,this.attribute.center,e,this.attribute.inside)}getRelativeVector(t){let{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}function CD(t,e){let i=t.length;return{prevLabel:e>=1?t[e-1]:t[i-1],nextLabel:e<i-1?t[e+1]:t[0]}}function CF(t,e,i){var s;t.setAttributes({maxLineWidth:e,ellipsis:null!=(s=t.attribute.ellipsis)?s:i})}function Cz(t,e,i){let s=[];if(t.length>=3){let{prevLabel:i,nextLabel:r}=CD(t,e);s.push(i,r)}else 2===t.length&&s.push(t[+(0===e)]);let r=t[e],a=Math.min(Math.abs(r.attribute.y-i.y1),Math.abs(r.attribute.y-i.y2));s.forEach(t=>{a=Math.min(a,Math.abs(t.attribute.y-r.attribute.y))}),a>0&&r.setAttributes({whiteSpace:"normal",heightLimit:a})}var CH=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};Aj(),AA();class Cj extends kx{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Cj.defaultAttributes,t))}renderLine(t){let{startAngle:e=_T,endAngle:i=_C,radius:s,center:r,innerRadius:a=0,line:n={},inside:l=!1,sides:o}=this.attribute,h,u=s,d=a;if(l&&a>0&&(u=a,d=0),eP(o)&&o>=3){let t=Ai(r,o,u,e,i);h=lF.path(Object.assign(Object.assign({},n.style),{path:As(t,!0)}))}else{let t=Object.assign(Object.assign(Object.assign({},r),{startAngle:e,endAngle:i,radius:u,innerRadius:d}),n.style);h=lF.circle(t)}h.name=tB.line,h.id=this._getNodeId("line"),pJ(n.state)||(h.states=eB({},SH,n.state)),t.add(h)}getTitleAttribute(){var t,e,i;let{center:s,radius:r,innerRadius:a=0}=this.attribute,n=this.attribute.title,{space:l=4,textStyle:o={},shape:h,background:u,state:d={}}=n,c=CH(n,["space","textStyle","shape","background","state"]),p=s,g=0;(null==(t=this.attribute.label)?void 0:t.visible)&&!1===this.attribute.label.inside&&(g=uQ(this.attribute.label,"style.fontSize",12)+uQ(this.attribute.label,"space",4));let f=0;(null==(e=this.attribute.tick)?void 0:e.visible)&&!1===this.attribute.tick.inside&&(f=this.attribute.tick.length||4),(null==(i=this.attribute.subTick)?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(f=Math.max(f,this.attribute.subTick.length||2));let m=r+f+g+l,_="middle",{position:y}=this.attribute.title;(0,eE.A)(y)&&(y=0===a?"end":"middle"),"start"===y?(_="bottom",p={x:s.x,y:s.y-m}):"end"===y&&(_="top",p={x:s.x,y:s.y+m});let v=Object.assign(Object.assign(Object.assign({},p),c),{textStyle:Object.assign({textBaseline:_,textAlign:"center"},o),state:{text:eB({},SH,d.text),shape:eB({},SH,d.shape),panel:eB({},SH,d.background)}}),{angle:b}=c;return v.angle=b,h&&h.visible&&(v.shape=Object.assign({visible:!0},h.style),h.space&&(v.space=h.space)),u&&u.visible&&(v.panel=Object.assign({visible:!0},u.style)),v}getSubTickLineItems(){var t,e;let{subTick:i}=this.attribute,s=[],{count:r=4,inside:a=!1,length:n=2}=i,l=this.tickLineItems,o=l.length;if(o>=2){let i=this.data[1].value-this.data[0].value,h=null==(e=null==(t=this.attribute)?void 0:t.tick)?void 0:e.alignWithLabel;for(let t=0;t<o;t++){let e=l[t],o=l[t+1];for(let t=0;t<r;t++){let l=(t+1)/(r+1),u=(1-l)*e.value+l*(o?o.value:h?1:e.value+i),d=this.getTickCoord(u),c=this.getVerticalCoord(d,n,a);s.push({start:d,end:c,value:u})}}}return s}beforeLabelsOverlap(t,e,i,s,r){}handleLabelsOverlap(t,e,i,s,r){if(pJ(t))return;let{inside:a,radius:n,center:l,size:o,label:h,orient:u}=this.attribute,d=o?{x1:0,y1:0,x2:o.width,y2:o.height}:{x1:l.x-n,y1:l.y-n,x2:l.x+n,y2:l.y+n},{layoutFunc:c,autoLimit:p,limitEllipsis:g,autoHide:f,autoHideMethod:m,autoHideSeparation:_,autoWrap:y}=h;(0,r3.A)(c)?c(t,e,s,this):((p||y)&&function(t,e){let{ellipsis:i,inside:s,bounds:r,autoWrap:a,center:n}=e;s||t.forEach((e,s)=>{let{x:l,y:o}=e.attribute,h=e.AABBBounds;
2if(rL(l,n.x)){if(o>r.y2||o<r.y1)return void CF(e,0,i);let a=r.x2-r.x1;if(t.length>=3){let{prevLabel:r,nextLabel:n}=CD(t,s),o=r.attribute.x,h=n.attribute.x;o>h&&(o=n.attribute.x,h=r.attribute.x);let u=o===h?a:l>=o&&l<=h?h-o:Math.min(Math.abs(o-l),Math.abs(h-l));e.AABBBounds.width()>u&&CF(e,u,i)}else e.AABBBounds.width()>a&&CF(e,a,i)}else l>n.x&&h.x2>r.x2?(CF(e,r.x2-l,i),a&&Cz(t,s,r)):l<n.x&&h.x1<r.x1&&(CF(e,l-r.x1,i),a&&Cz(t,s,r))})}(t,{inside:a,autoWrap:y,bounds:d,ellipsis:g,center:l}),f&&kM(t,{orient:u,method:m,separation:_}))}afterLabelsOverlap(t,e,i,s,r){var a;let{layoutRect:n,autoLabelMaxWidth:l}=this.attribute;if(!l||!n||!t||0===t.length)return;let o=0+n.width;for(let e=0;e<t.length;e++){let i=t[e],s=i.attribute.x,r=null!=(a=i.attribute.textAlign)?a:"center",n=0;(n="left"===r?o-s:"right"===r?s-0:2*Math.max(0,Math.min(s-0,o-s)))>0?i.setAttributes({maxLineWidth:n}):i.setAttributes({maxLineWidth:0})}}getTextBaseline(t){return .3>Math.abs(t[1]/t[0])?"middle":t[1]<0?"bottom":t[1]>0?"top":"middle"}getLabelAlign(t,e,i){return rL(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}}Cj.defaultAttributes=S5,yg(Cj,CL);var CV=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};p1(),AF();class CN extends Al{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Al.defaultAttributes,t),e)}getGridPointsByValue(t){let e=this.getTickCoord(t),{radius:i,innerRadius:s=0}=this.attribute;return[e,this.getVerticalCoord(e,i-s,!0)]}getGridAttribute(t){let e,i=[],s=this.attribute,{radius:r,innerRadius:a=0,startAngle:n=_T,endAngle:l=_C,center:o,subGrid:h}=s,u=CV(s,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:d=!0}=u||{},c=r-a,p=this._parseTickSegment();if(t){e=eB({},u,h);let t=[],{count:s=4}=h||{},r=this.data.length;if(r>=2){let e=this._getPointsOfSubGrid(p,d);for(let i=0;i<r;i++){let r=e[i],a=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(r.value),this.getVerticalCoord(this.getTickCoord(r.value),c,!0)],datum:{}});for(let e=0;e<s;e++){let n=(e+1)/(s+1),l=(1-n)*r.value+n*(a?a.value:d?1:r.value+p),o=this.getTickCoord(l),h=this.getVerticalCoord(o,c,!0);t.push({id:`sub-${i}-${e+1}`,points:[o,h],datum:{}})}}Math.abs(l-n)%(2*Math.PI)==0&&t.push(t[0]),i=t}}else{e=u;let t=[];(Math.abs(l-n)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data).forEach(e=>{let{point:i}=e;if(!d){let t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}let s=this.getVerticalCoord(i,c,!0);t.push({id:e.id,points:[i,s],datum:e})}),i=t}return Object.assign(Object.assign({},e),{items:i,center:o,type:"line"})}}yg(CN,CL);let CW={grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},CU={grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}};class CG extends CO{constructor(){super(...arguments),this.type=hc.polarBandAxis,this._scale=new mM}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){let t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){let 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(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,CR),t}transformScaleDomain(){}}CG.type=hc.polarBandAxis,CG.specKey="axes",CG.builtInTheme={axis:kR,axisBand:kO,axisAngle:CU,axisRadius:CW},yg(CG,S$);let CY=()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),uP.registerGraphicComponent(tT.circleAxis,(t,e)=>new Cj(t,e)),uP.registerGraphicComponent(tC.circleAxisGrid,(t,e)=>new CN(t,e)),SW(),uP.registerComponent(CG.type,CG)};class C$ extends CO{constructor(){super(...arguments),this.type=hc.polarLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new mb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){let t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t}registerTicksTransform(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,k$),t}}C$.type=hc.polarLinearAxis,C$.specKey="axes",C$.builtInTheme={axis:kR,axisLinear:kK,axisAngle:CU,axisRadius:CW},yg(C$,kU);let CX=()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),uP.registerGraphicComponent(tT.circleAxis,(t,e)=>new Cj(t,e)),uP.registerGraphicComponent(tC.circleAxisGrid,(t,e)=>new CN(t,e)),SW(),uP.registerComponent(C$.type,C$)};class CK extends CC{constructor(){super(...arguments),this.type=dD.rose,this.transformerConstructor=CE,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(){this._roseMark=this._createMark(CK.mark.rose,{groupKey:this._seriesField,isSeriesMark:!0},{morph:bk(this._spec,CK.mark.rose.name),morphElementKey:this.getDimensionField()[0]})}getRoseAngle(){var t,e,i;return null!=(i=null==(e=(t=this.angleAxisHelper).getBandwidth)?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))?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(){let 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=>mB(this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:t=>{var e;if(!this.getStack())return 0;let i=mB(this.radiusAxisHelper.dataToPosition([t[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return i<=5e-324?this._computeLayoutRadius()*(null!=(e=this._spec.innerRadius)?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;let s=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._roseMark&&this._roseMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("rose"))?void 0:i({innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!=(t=this._spec.innerRadius)?t:0)}},s),bx("rose",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}CK.type=dD.rose,CK.mark=CB,CK.builtInTheme={rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}}},CK.transformerConstructor=CE;class Cq extends Cx{needAxes(){return!0}_getDefaultSeriesSpec(t){let e=super._getDefaultSeriesSpec(t);return e.categoryField=t.categoryField||t.angleField,e.valueField=t.valueField||t.radiu
2sField,e}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);let i={radius:!1,angle:!1};(null!=(e=t.axes)?e:[]).forEach(t=>{let{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 CZ extends Cq{_getDefaultSeriesSpec(t){var e,i,s;let r=super._getDefaultSeriesSpec(t);return r.radius=null!=(e=t.radius)?e:.6,r.outerRadius=null!=(i=t.outerRadius)?i:.6,r.innerRadius=null!=(s=t.innerRadius)?s:0,r.stack=t.stack,r.percent=t.percent,r}transformSpec(t){var e;super.transformSpec(t),(null!=(e=t.axes)?e:[]).forEach(t=>{["domainLine","grid","label","tick"].forEach(e=>{t[e]||(t[e]={visible:!1})}),"angle"===t.orient&&(0,eE.A)(t.bandPosition)&&(t.bandPosition=.5)}),t.crosshair=oS(t.crosshair||{}).map(t=>uy({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t))}}let CJ=(t,e)=>{if(!t)return null;let i=MS(t,t=>"angle"===t.getOrient(),e),s=MS(t,t=>"radius"===t.getOrient(),e);if(!(i&&i.length||s&&s.length))return null;let r=[],a=t=>t.getDimensionField()[0],{x:n,y:l}=e;return i&&i.forEach(t=>{var e,i;let o=t.getScale();if(o&&fL(o.type)){let h,u,d,c=o.domain(),p=o.range(),g=t.getCenter(),f={x:n-t.getLayoutStartPoint().x-g.x,y:l-t.getLayoutStartPoint().y-g.y},m=vG({x:1,y:0},f);i=m,h=2*Math.PI,u=oM(p),d=ok(p),i<u?i+=Math.ceil((u-i)/h)*h:i>d&&(i-=Math.ceil((i-d)/h)*h),m=i;let _=vY(f),y=null==(e=s[0])?void 0:e.getScale(),v=null==y?void 0:y.range();if((m-(null==p?void 0:p[0]))*(m-(null==p?void 0:p[1]))>0||(_-(null==v?void 0:v[0]))*(_-(null==v?void 0:v[1]))>0)return;let b=t.invert(m);if((0,eE.A)(b))return;let x=c.findIndex(t=>(null==t?void 0:t.toString())===b.toString());x<0&&(x=void 0);let S=Mb(b,t,"polar",a);r.push({index:x,value:b,position:o.scale(b),axis:t,data:S})}}),s&&s.forEach(t=>{var e;let s=t.getScale(),o=null==s?void 0:s.range();if(s&&fL(s.type)){let h=t.getCenter(),u={x:n-t.getLayoutStartPoint().x-h.x,y:l-t.getLayoutStartPoint().y-h.y},d=vG({x:1,y:0},u);d<-Math.PI/2&&(d=2*Math.PI+d);let c=vY(u),p=null==(e=i[0])?void 0:e.getScale(),g=null==p?void 0:p.range();if((d-(null==g?void 0:g[0]))*(d-(null==g?void 0:g[1]))>0||(c-(null==o?void 0:o[0]))*(c-(null==o?void 0:o[1]))>0)return;let f=s.invert(c);if((0,eE.A)(f))return;let m=s.domain().findIndex(t=>(null==t?void 0:t.toString())===f.toString());m<0&&(m=void 0);let _=Mb(f,t,"polar",a);r.push({index:m,value:f,position:s.scale(f),axis:t,data:_})}}),r.length?r:null};class CQ extends Mu{constructor(){super(...arguments),this.transformerConstructor=CZ,this.type="rose",this.seriesType=dD.rose}_setModelOption(){this._modelOption.getDimensionInfo=CJ}}CQ.type="rose",CQ.seriesType=dD.rose,CQ.transformerConstructor=CZ,yg(CQ,Mp);class C0 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r),this._center=e.center}getEndProps(){return!1===this.valid?{}:iE(this._center,this._toRadius,this._toAngle)}onBind(){this.from=this.target.attribute,this.to=this.target.getFinalAttribute(),this._prevCenter=this.target.attribute.center,this._center&&this._prevCenter||(this.valid=!1);let{angle:t,radius:e}=iP(this.from,this._prevCenter),{angle:i,radius:s}=iP(this.to,this._center);eP(i*s)||(this.valid=!1),this._fromAngle=eP(t)?t:i,this._fromRadius=eP(e)?e:s,this._toAngle=i,this._toRadius=s,rL(this._fromAngle,this._toAngle)&&rL(this._fromRadius,this._toRadius)&&(this.valid=!1),this.props=this.getEndProps()}onUpdate(t,e,i){if(!1===this.valid)return i.x=this.to.x,void(i.y=this.to.y);let{x:s,y:r}=iE({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);this.target.setAttributes({x:s,y:r}),this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}class C1 extends yj{onBind(){super.onBind();let{center:t}=this.target.attribute,{center:e}=this.target.getFinalAttribute();this._center=e,this._prevCenter=t}onUpdate(t,e,i){this.points=this.points.map((s,r)=>{let a=this.polarPointInterpolation(this.interpolatePoints[r][0],this.interpolatePoints[r][1],e);return t&&(i.center=this._center),a.context=s.context,a}),this.target.attribute.points=this.points,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}_interpolationSinglePoint(t,e,i){if(!v$(t)&&!v$(e))return e;let s=iP(t,this._prevCenter),r=iP(e,this._center),a=iR(s.angle),n=iR(r.angle);
2!eP(a)&&eP(n)&&(a=n),eP(a)&&!eP(n)&&(n=a);let l=a+(n-a)*i,o=s.radius+(r.radius-s.radius)*i;return iE({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*i,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*i},o,l)}polarPointInterpolation(t,e,i){let{x:s,y:r}=this._interpolationSinglePoint(t,e,i),{x:a,y:n}=this._interpolationSinglePoint({x:t.x1,y:t.y1},{x:e.x1,y:e.y1},i),l=new i8(s,r,a,n);return l.defined=e.defined,l}}let C2=t=>({type:"in"===t?"fadeIn":"fadeOut"});function C3(t,e,i){return"fadeIn"===e?C2(i):{type:"in"===i?"growPointsIn":"growPointsOut",options:()=>({center:t.center()})}}let C5=Object.assign(Object.assign(Object.assign({},bc),bR),{area:{name:"area",type:"area"}});class C4 extends CC{constructor(){super(...arguments),this.type=dD.radar,this.transformerConstructor=x4,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,s;let r=!1!==(null==(t=this._spec.area)?void 0:t.visible)&&!1!==(null==(i=null==(e=this._spec.area)?void 0:e.style)?void 0:i.visible),a=null!=(s=this._spec.seriesMark)?s:"area";this.initAreaMark(r&&"area"===a),this.initLineMark("line"===a||"area"===a&&!r),this.initSymbolMark("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.center()}})})}initAreaMark(t){this._areaMark=this._createMark(C4.mark.area,{groupKey:this._seriesField,isSeriesMark:t})}initAreaMarkStyle(){let 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.get
2Stack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).x: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:NaN,fill:this.getColorAttribute(),curveType:"linear",closePath:!0},"normal",N.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",N.Series),this.event.on(dj.viewDataStatisticsUpdate,{filter:t=>t.model===this},()=>{this.encodeDefined(t,"defined")}))}initTooltip(){super.initTooltip();let{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;let r={center:()=>{var t;return null==(t=this.angleAxisHelper)?void 0:t.center()},radius:()=>{let t=this.getLayoutRect();return Math.min(t.width,t.height)},startAngle:(0,eA.A)(this._spec.startAngle)?iC(this._spec.startAngle):Ct},a=null!=(i=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset)?i:"clipIn";"clipIn"===a&&this._rootMark&&this._rootMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("radarGroup"))?void 0:s(r,a),bx("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach(([t,e])=>{if((0,eA.A)(t)){let i=uP.getAnimationInKey(e);t.setAnimationConfig(bb(null==i?void 0:i(r,a),bx(t.name,this._spec,this._markAttributeContext)))}})}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,s,r,a;let n=null!=(s=null==(i=this._seriesMark)?void 0:i.getAttribute(e,t))?s:void 0;return"fill"!==e||n||(e="stroke",n=null!=(a=null==(r=this._seriesMark)?void 0:r.getAttribute(e,t))?a:void 0),"stroke"===e&&(0,ev.A)(n)?n[0]:n}}}C4.type=dD.radar,C4.mark=C5,C4.builtInTheme={radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}}},C4.transformerConstructor=x4,yg(C4,bI);class C8 extends Cq{_getDefaultSeriesSpec(t){var e;let i=super._getDefaultSeriesSpec(t);return i.line=t.line,i.point=t.point,i.stack=t.stack,i.percent=t.percent,i.area=uy({visible:!1},t.area),i.seriesMark=null!=(e=t.seriesMark)?e:"area",i.activePoint=t.activePoint,i.pointDis=t.pointDis,i.pointDisMul=t.pointDisMul,i.markOverlap=t.markOverlap,i}transformSpec(t){var e;
2super.transformSpec(t),(null!=(e=t.axes)?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=oS(t.crosshair||{}).map(t=>uy({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t))}}class C6 extends Mu{constructor(){super(...arguments),this.transformerConstructor=C8,this.type="radar",this.seriesType=dD.radar}_setModelOption(){this._modelOption.getDimensionInfo=CJ}}C6.type="radar",C6.seriesType=dD.radar,C6.transformerConstructor=C8,yg(C6,Mp);class C9 extends Ms{_getDefaultSeriesSpec(t){let 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){let r=this._findBandAxisBySeries(e,i,t.axes);if(r&&!r.bandSize&&!r.maxBandSize&&!r.minBandSize){let t=r2(e.autoBandSize)&&null!=(s=e.autoBandSize.extend)?s:0,{barMaxWidth:i,barMinWidth:a,barWidth:n,barGapInGroup:l}=e;this._applyAxisBandSize(r,t,{barMaxWidth:i,barMinWidth:a,barWidth:n,barGapInGroup:l})}}})}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){let 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=>{uQ(e,"trimPadding")&&uy(e,fp(this.type,t))}),this._transformAxisSpec(t)}}class C7 extends Mu{constructor(){super(...arguments),this.transformerConstructor=C9,this.type="common"}_setModelOption(){this._modelOption.getDimensionInfo=(t,e,i)=>{var s,r;return[...null!=(s=MP(t,e,i))?s:[],...null!=(r=CJ(t,e))?r:[]]},this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}C7.type="common",C7.transformerConstructor=C9,yg(C7,Mp);class Bt extends bt{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=>vQ.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}]}}var Be=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Bi extends _x{constructor(){super(...arguments),this.type=Bi.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}_transformGraphicAttributes(t,e,i){let s=super._transformGraphicAttributes(t,e,i),{x:r,x1:a,y:n,y1:l}=s;return Object.assign(Object.assign({},Be(s,["x","x1","y","y1"])),{points:[{x:r,y:n},{x:a,y:l}]})}_createGraphic(t={}){return bV(t)}}Bi.type="rule";let Bs=()=>{uP.registerMark(Bi.type,Bi),_k(),bZ(),uP.registerGraphicComponent("line",bV)},Br=Object.assign(Object.assign({},bc),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),Ba=(t,e)=>{let{infoKey:i,fields:s,linkData:r,dotData:a}=e,{fromField:n,toField:l,xField:o,yField:h}=s(),u=r(),d=a(),c={};return d.forEach(t=>{let e={};for(let s in t)s!==i&&(e[s]=t[s]);let s=t[i];null==s||s.forEach(t=>{c[t.node_name]=Object.assign({},e,t)})}),u.forEach(t=>{var e,i,s,r;t[n+"_xField"]=null==(e=null==c?void 0:c[t[n]])?void 0:e[o],t[n+"_yField"]=null==(i=null==c?void 0:c[t[n]])?void 0:i[h],t[l+"_xField"]=null==(s=null==c?void 0:c[t[l]])?void 0:s[o],t[l+"_yField"]=null==(r=null==c?void 0:c[t[l]])?void 0:r[h]}),u};class Bn extends bP{constructor(){super(...arguments),this.type=dD.link}getFromField(){return this._fromField}setFromField(t){(0,eA.A)(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){(0,eA.A)(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){(0,eA.A)(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){(0,eA.A)(t)&&(this._dotSeriesSpec=t)}_getDotData(){let t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),c3(this._option.dataSet,"linkDotInfo",Ba),null==(t=this.getViewData())||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:D.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(Bn.mark.group),this._containerMark=this._createMark(Bn.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(Bn.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(Bn.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,s;let r=this._clipMark;r&&(this.setMarkStyle(r,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight},"normal",N.Series),r.setMarkConfig({interactive:!1,clip:!0}));let a=this._containerMark;a&&(this.setMarkStyle(a,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",N.Series),a.setMarkConfig({interactive:!1}));let n=this._linkMark;n&&this.setMarkStyle(n,{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",N.Series);let l=this._arrowMark;if(l){let r=null!=(s=null==(i=null==(e=null==(t=this._theme)?void 0:t.arrow)?void 0:e.style)?void 0:i.size)?s:10;this.setMarkStyle(l,{x:this.dataToPositionXTo.bind(this),y:t=>this.dataToPositionArrowYTo(t,r),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:r,symbolType:t=>this.isPositionYFromHigher(t)?"triangleDown":"triangleUp"},"normal",N.Series)}}afterInitMark(){super.afterInitMark()}dataToPositionXFrom(t){if(!this._xAxisHelper)return NaN;let{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return NaN;let{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return NaN;let{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return NaN;let{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return NaN;let{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)<this.dataToPositionYTo(t)}isPositionXOuterRange(t,e){if(!this._xAxisHelper)return!1;let{dataToPosition:i,getScale:s}=this._xAxisHelper;return i(this.getDatumPositionValues(t,e),{bandPosition:this._bandPosition})<s(0).range()[0]||i(this.getDatumPositionValues(t,e),{bandPosition:this._bandPosition})>s(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?null==(t=this.getViewDataStatistics())?void 0:t.latestData[this._dotTypeField].values:this._seriesField?null==(e=this.getViewDataStatistics())?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!=(t=this._option.globalScale.getScale("color"))?t:this._getDefaultColorScale(),field:null!=(i=null!=(e=this._dotTypeField)?e:this._seriesField)?i:pk}}getInteractionTriggers(){let t=[];
2return this._linkMark&&t.push(this._linkMark),this._arrowMark&&t.push(this._arrowMark),this._parseInteractionConfig(t)}initTooltip(){this._tooltipHelper=new Bt(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach(t=>{t.commit(!1,!0)})}getDotInfoData(){var t,e;return null==(e=null!=(t=this._linkMark)?t:this._arrowMark)?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}Bn.type=dD.link,Bn.mark=Br,Bn.builtInTheme={link:{arrow:{style:{size:10}}}};class Bl extends bt{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=>vQ.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,r){var a,n,l,o;let h=super.getTooltipData(t,e,i,s,r),u=null!=(l=null==(n=null==(a=this.spec)?void 0:a[t])?void 0:n.updateContent)?l:null==(o=null==e?void 0:e[t])?void 0:o.updateContent;return h&&!u&&(h.updateContent=(t,e,i)=>{let s=[],r=t.filter(t=>"children"===t.key);return r.length>0&&r[0].value.forEach(t=>{let e=!0;for(let i in t)s.push(Object.assign(Object.assign({},r[0]),{shapeType:"circle",hasShape:e,key:i,value:t[i]+""})),e=!1}),t.concat(s)}),h}}let Bo=(t,e)=>{var i;let s=(null==(i=t[0])?void 0:i.latestData)?t[0].latestData:t||[],r=[],a=0;return s.forEach(t=>{let i,s={};for(let r in t)r===e||r.startsWith(px.H)||(s[r]=t[r],i=(0,eA.A)(i)?`${i}_${t[r]}`:`${t[r]}`);let n=t[e];null==n||n.forEach((t,e)=>{r.push(Object.assign({},s,t,{[pS]:a,[pA]:`${i}_${e}`})),a++})}),r},Bh={fill:"#bbb",fillOpacity:.2};class Bu extends _x{getTextType(){return this._textType}constructor(t,e){super(t,e),this.type=Bu.type,this._textType="text"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}initStyleWithSpec(t){super.initStyleWithSpec(t),t.textType&&(this._textType=t.textType)}_transformGraphicAttributes(t,e,i){let s=super._transformGraphicAttributes(t,e,i),{text:r}=s;return r2(r)&&(0,eA.A)(r.text)&&("rich"===this._textType||"rich"===r.type)&&(s.textConfig=r.text),s}_createGraphic(t={}){let{text:e}=t;return"rich"===this._textType||"rich"===(null==e?void 0:e.type)?xM(t):p4(t)}}Bu.type="text";let Bd=()=>{uP.registerMark(Bu.type,Bu),_k(),gD(),xL(),uP.registerGraphicComponent("text",p4),uP.registerGraphicComponent("richtext",xM)},Bc=Object.assign(Object.assign({},bc),{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 Bp extends bP{constructor(){super(...arguments),this.type=dD.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){(0,eA.A)(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){(0,eA.A)(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){(0,eA.A)(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){(0,eA.A)(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){(0,eA.A)(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){(0,eA.A)(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map(t=>t[this._fieldY[0]]),c3(this._option.dataSet,"objFlat",Bo),c3(this._option.dataSet,"copyDataView",c7),c5(this._option.dataSet,"dataview",eb),null==(t=this.getViewData())||t.transform({type:"objFlat",options:"dots",level:D.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.setGridBackgroun
2d(uy(Bh,(null==(t=this._spec.grid)?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(Bp.mark.group),this._containerMark=this._createMark(Bp.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(Bp.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(Bp.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(Bp.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(Bp.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(Bp.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(Bp.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){var t;let e=this._clipMark;e&&(this.setMarkStyle(e,{x:-(null!=(t=this._spec.leftAppendPadding)?t:0),y:0,width:1e4,height:()=>{var t;return null!=(t=this._spec.clipHeight)?t:this._region.getLayoutRect().height}},"normal",N.Series),e.setMarkConfig({interactive:!1,clip:!0}));let i=this._containerMark;i&&(this.setMarkStyle(i,{x:this._spec.leftAppendPadding},"normal",N.Series),i.setMarkConfig({interactive:!1}));let s=this._gridBackgroundMark;s&&this.setMarkStyle(s,{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",N.Series);let r=this._gridMark;r&&this.setMarkStyle(r,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",N.Series);let a=this._dotMark;a&&this.setMarkStyle(a,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),stroke:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",N.Series);let n=this._titleMark;n&&this.setMarkStyle(n,{fill:this.getColorAttribute(),text:t=>t[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",N.Series);let l=this._subTitleMark;l&&this.setMarkStyle(l,{fill:this.getColorAttribute(),text:t=>t[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",N.Series);let o=this._symbolMark;o&&this.setMarkStyle(o,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",N.Series)}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return NaN;let{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 NaN;let{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,r;if(!this._xAxisHelper)return NaN;let{dataToPosition:a,getScale:n}=this._xAxisHelper;return a(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})<n(0).range()[0]||a(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})>n(0).range()[1]?0:null!=(r=null==(s=null==(i=null==(e=this._theme)?void 0:e.dot)?void 0:i.style)?void 0:s.fillOpacity)?r:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(){var t,e;super.onLayoutEnd();let i=null!=(e=null==(t=this._spec)?void 0:t.leftAppendPadding)?e:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+i},"normal",N.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?null==(t=this.getViewDataStatistics())?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?null==(e=this.getViewDataStatistics())?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!=(t=this._option.globalScale.getScale("color"))?t:this._getDefaultColorScale(),field:null!=(i=null!=(e=this._seriesGroupField)?e:this._seriesField)?i:pk}}getDotColorScale(){var t,e,i;let s=this._dotTypeField?null==(t=this.getViewDataStatistics())?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?null==(e=this.getViewDataStatistics())?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?null==(i=this.getViewDataStatistics())?void 0:i.latestData[this._seriesField].values:[],r=this._getDataScheme();return(new mw).domain(s).range(r)}getDotColorAttribute(){var t,e,i,s;return{scale:null!=(t=this._option.globalScale.getScale("color"))?t:this.getDotColorScale(),field:null!=(s=null!=(i=null!=(e=this._dotTypeField)?e:this._seriesGroupField)?i:this._seriesField)?s:pk}}initTooltip(){this._tooltipHelper=new Bl(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach(t=>{t.commit(!1,!0)})}getDotData(){var t;return null==(t=this._dotMark)?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}Bp.type=dD.dot,Bp.mark=Bc,Bp.builtInTheme={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"}}}}};
2class Bg extends Ms{_getSeriesDataLength(t,e){var i,s;if(e.data){let t=oS(e.data)[0];return t instanceof eR?null==(i=t.latestData)?void 0:i.length:null==(s=t.values)?void 0:s.length}let r=oS(t.data).find((t,i)=>e.dataId?t instanceof eR?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i);return r?r instanceof eR?r.latestData.length:r.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,r,a,n,l,o,h,u,d,c,p,g,f;super.transformSpec(t);let m=0,_=[],y=[],v=[],b=[],x=[],S=this._option.getCompiler().getStage(),A=(S.viewWidth,S.viewHeight),k=0;if(null==t?void 0:t.legends){_.push({modelId:`legendRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${m}`);let l=oS(t.legends),o=null!=(e=l[0].height)?e:40;if(l[0].padding){let t=hY(l[0].padding);o+=Number(null!=(i=null==t?void 0:t.bottom)?i:0),o+=Number(null!=(s=null==t?void 0:t.top)?s:0),l[0].offsetY=Number(null!=(a=null==(r=l[0])?void 0:r.offsetY)?a:0)+Number(null!=(n=null==t?void 0:t.top)?n:0)}x.push({index:m,size:o}),k+=o,m++}(null==t?void 0:t.dataZoom)&&(_.push({modelId:`dataZoomRow${m}`,col:1,row:m}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${m}`),k+=60,m++,this.addPaddingRow(x,m,10),k+=10,m++),k+=60,null!==t.axes&&"top"!==(null==(o=null==(l=null==t?void 0:t.axes)?void 0:l[0])?void 0:o.orient)||(this.addOrientAxes(y,_,m,t),m++);let M=t.series.filter(t=>t.type!==dD.link).length,w=(A-k-20*M)/M,T=(null==(h=null==t?void 0:t.appendPadding)?void 0:h.left)||0,C=(null==(u=null==t?void 0:t.appendPadding)?void 0:u.right)||0;null==(d=null==t?void 0:t.series)||d.forEach(e=>{var i,s;if([dD.bar,dD.line,dD.area,dD.dot].includes(e.type)){if(_.push({modelId:`${e.type}Row${m}`,col:1,row:m}),_.push({modelId:`axesLeftRow${m}`,col:0,row:m}),y.push({id:`${e.type}Row${m}`,clip:!1}),x.push({index:m,size:(null==e?void 0:e.height)||w}),v.push({orient:"left",id:`axesLeftRow${m}`,type:e.type===dD.dot?"band":"linear",visible:e.type!==dD.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.visible)||(null==(s=null==e?void 0:e.grid)?void 0:s.visible),style:(t,i)=>{var s,r,a,n,l;let o=0;if(0===i){let t=null==(s=null==e?void 0:e.grid)?void 0:s.style;o=null!=(a=null!=(r=null==t?void 0:t.lineWidth)?r:null==t?void 0:t.strokeWidth)?a:1}return{lineWidth:o,stroke:(null==(l=null==(n=null==e?void 0:e.grid)?void 0:n.style)?void 0:l.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:y.length-1}),e.type===dD.dot){_.push({modelId:`scrollBarRightRow${m}`,col:2,row:m});let i=this._getSeriesDataLength(t,e),s=0;i&&(s=((null==e?void 0:e.height)||w)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===dD.dot&&s<1,id:`scrollBarRightRow${m}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:y.length-1,axisId:`axesLeftRow${m}`},oS(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=y.length-1,m++,this.addPaddingRow(x,m,(null==e?void 0:e.padding)||20),m++,e.leftAppendPadding=T,e.type===dD.dot&&(e.title.style.dx=-T,e.subTitle.style.dx=-T)}}),this.addPaddingRow(x,m,20),m++,null==(c=null==t?void 0:t.series)||c.forEach(e=>{if(e.type===dD.link){let i=e.dotSeriesIndex+1;_.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=T,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",[y.length-1]),"bottom"===(null==(g=null==(p=null==t?void 0:t.axes)?void 0:p[0])?void 0:g.orient)&&(this.addOrientAxes(y,_,m,t),m++),t.layout={type:"grid",col:4,row:m,colWidth:[{index:0,size:T},{index:2,size:12},{index:3,size:C}],rowHeight:x,elements:_},t.region=y,null==(f=t.axes)||f.push(...v),t.scrollBar=b}}var Bf=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Bm extends Mu{constructor(){super(...arguments),this.transformerConstructor=Bg,this.type="sequence"}_createSeries(t,e){let i;if(!t)return;let{spec:s}=e,r=Bf(e,["spec"]);if(s.type===dD.link&&(s.dotSeriesSpec=this._spec.series[s.dotSeriesIndex]),s.regionId&&(i=this.getRegionsInUserId(s.regionId)),i||(i=this.getRegionsInIndex(s.regionIndex?[s.regionIndex]:void 0)[0]),!i)return;let a=new t(s,Object.assign(Object.assign(Object.assign({},this._modelOption),r),{region:i,specKey:"series",globalScale:this._globalScale}));a&&(a.created(),this._series.push(a),i.addSeries(a))}}Bm.type="sequence",Bm.transformerConstructor=Bg;class B_ extends Mr{transformSpec(t){super.transformSpec(t),t.axes.forEac
2h(t=>t.type="linear")}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["x2Field","y2Field","barMinHeight","barBackground","barGap"])}}class By extends Mu{constructor(){super(...arguments),this.transformerConstructor=B_}}By.transformerConstructor=B_,yg(By,Mp);class Bv extends B_{transformSpec(t){super.transformSpec(t),fu(t)}}let Bb=(t,e)=>{var i,s,r,a;let{numBins:n,thresholds:l,countName:o,percentageName:h,valuesName:u,countField:d,field:c,n:p,x0Name:g,x1Name:f}=e,m=e.groupField,_=Array.isArray(m)?m.length>0:!!m,y=[];if(!_)for(let t=0;t<n;t++){let i={[g]:l[t],[f]:l[t+1],[o]:0};e.includeValues&&(i[u]=[]),y.push(i)}let v=_?Array(n).fill(0).map(()=>new Map):[],b=_?Array(n).fill(0).map(()=>new Map):[],x=[],S=new Set,A=new Map;for(let r=0;r<p;r++){let a=t[r][c];if(null==a)continue;let h=+a;if(Number.isFinite(h))for(let a=0;a<n;a++){let c=l[a],p=l[a+1];if(h>=c&&h<p||a===n-1&&h<=p){let n=null!=(i=t[r][d])?i:1;if(_){let i;i=(0,ev.A)(m)?m.map(e=>String(t[r][e])).join("||"):String(t[r][m]);let l=v[a],o=null!=(s=l.get(i))?s:0;if(l.set(i,o+n),S.has(i)||(S.add(i),x.push(i),(0,ev.A)(m)?A.set(i,Object.fromEntries(m.map(e=>[e,t[r][e]]))):A.set(i,t[r][m])),e&&e.includeValues){let e=b[a];e.has(i)||e.set(i,[]);let s=e.get(i);s&&s.push(t[r])}}else y[a][o]+=n;e&&e.includeValues&&!_&&y[a][u].push(t[r]);break}}}let k=0,M=[];if(_){for(let t=0;t<n;t++)for(let i of x){let s=null!=(r=v[t].get(i))?r:0,n={[g]:l[t],[f]:l[t+1],[o]:s},h=null!=(a=A.get(i))?a:{};if((0,ev.A)(m))for(let t of m)n[t]=h[t];else m&&(n[m]=h);e&&e.includeValues&&(n[u]=b[t].get(i)||[]),M.push(n),k+=s}let t=k;for(let e of M)e[h]=t>0?e[o]/t:0}else{for(let t=0,e=y.length;t<e;t++)k+=y[t][o];for(let t=0,e=y.length;t<e;t++)y[t][h]=k>0?y[t][o]/k:0,M.push(y[t])}return M},Bx=(t,e)=>{var i,s,r,a,n,l,o,h,u,d;let c=null==e?void 0:e.field;if(!c)return[];let p=e.countField,g=t.length,f,m=1/0,_=-1/0;if(e.extent)m=e.extent[0],_=e.extent[1];else for(let e=0;e<g;e++){let i=t[e][c];if((0,eE.A)(i))continue;let s=+i;Number.isFinite(s)&&(s<m&&(m=s),s>_&&(_=s))}if(!Number.isFinite(m)||!Number.isFinite(_)||0===g)return[];if(e.thresholds&&e.thresholds.length)(f=e.thresholds.slice()).sort((t,e)=>t-e);else if("number"==typeof e.step&&e.step>0){let t=e.step,i=m;for(e.extent||(i=Math.floor(m/t)*t),f=[i];i<=_;)i+=t,f.push(i)}else{let t=e.bins&&e.bins>0?Math.floor(e.bins):10;if(_-m>1){let e=Math.floor(m),i=Math.ceil((_-e)/t);f=Array(t+1);for(let s=0;s<=t;s++)if(f[s]=e+i*s,f[s]>_){t=s,f.length=t+1;break}}else{let e=(_-m)/t;f=Array(t+1);for(let i=0;i<=t;i++)if(f[i]=m+e*i,f[i]>_){t=i,f.length=t+1;break}}}let y=Math.max(0,f.length-1);if(0===y)return[];let v=null!=(s=null==(i=e.outputNames)?void 0:i.x0)?s:"x0",b=null!=(a=null==(r=e.outputN
2ames)?void 0:r.x1)?a:"x1",x=null!=(l=null==(n=e.outputNames)?void 0:n.count)?l:"count",S=null!=(h=null==(o=e.outputNames)?void 0:o.values)?h:"values",A=null!=(d=null==(u=e.outputNames)?void 0:u.percentage)?d:"percentage",k=(0,ev.A)(null==e?void 0:e.facetField)?null==e?void 0:e.facetField:(null==e?void 0:e.facetField)?[e.facetField]:[],M=(0,ev.A)(null==e?void 0:e.groupField)?null==e?void 0:e.groupField:(null==e?void 0:e.groupField)?[e.groupField]:[],w=M.length?M:void 0,T=Object.assign(Object.assign({},e),{numBins:y,thresholds:f,countName:x,percentageName:A,valuesName:S,countField:p,field:c,n:g,x0Name:v,x1Name:b,groupField:w});if(!k.length)return Bb(t,T);let C={};return t.forEach(t=>{let e=k.map(e=>null==t?void 0:t[e]).join("-&&-");C[e]?C[e].push(t):C[e]=[t]}),Object.values(C).map(t=>{let e=[...M,...k];return Bb(t,Object.assign(Object.assign({},T),{groupField:e.length?e:void 0,n:t.length}))}).flat()};class BS extends By{constructor(){super(...arguments),this.transformerConstructor=Bv,this.type="histogram",this.seriesType=dD.bar}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}BS.type="histogram",BS.seriesType=dD.bar,BS.transformerConstructor=Bv;let BA=Object.assign(Object.assign({},bc),{group:{name:"group",type:"group"}});class Bk extends Ci{constructor(){super(...arguments),this._arcGroupMark=null,this._getAngleValueStart=t=>{let e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){let s,r=t[this.getStack()?pT:pF],a=this._getAngleAxisSubTickData(e),n=a[1].value-a[0].value,l=iC(i.offsetAngle);if((0,eA.A)(r)){let t=fj(a,t=>t.value-r),e=t>=a.length||r>a[t].value-n/2?Math.min(t,a.length-1):t>0?t-1:void 0;void 0!==e&&(s=this.angleAxisHelper.dataToPosition([a[e].value-n/2]))}return(0,eE.A)(s)&&(s=this.angleAxisHelper.dataToPosition([a[0].value-n/2])),s+l}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{let e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){let s=t[this.getStack()?pC:this._angleField[0]],r=this._getAngleAxisSubTickData(e),a=r[1].value-r[0].value,n=iC(i.offsetAngle),l=fj(r,t=>t.value-s),o=l>=r.length||s>r[l].value-a/2?Math.min(l,r.length-1):l>0?l-1:void 0;return(void 0!==o?this.angleAxisHelper.dataToPosition([r[o].value+a/2]):this.angleAxisHelper.dataToPosition([r[0].value-a/2]))+n}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();let s=null==(t=this._option.globalInstance.getChart())?void 0:t.getSpec(),r=null!=(e=this._spec.startAngle)?e:null==s?void 0:s.startAngle;this._startAngle=(0,eA.A)(r)?iC(r):Ct;let a=null!=(i=this._spec.endAngle)?i:null==s?void 0:s.endAngle;this._endAngle=(0,eA.A)(a)?iC(a):Ce,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[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){let e=super._convertMarkStyle(t);if(e.fill){let i=t.fill;"conical"!==(null==i?void 0:i.gradient)||(0,eA.A)(null==i?void 0:i.startAngle)||(0,eA.A)(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()){let e=mB(this.angleAxisHelper.dataToPosition([t[pT]]),this.angleAxisHelper.getScale(0));if(eP(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this.getStack()){let e=mB(this.angleAxisHelper.dataToPosition([t[pC]]),this.angleAxisHelper.getScale(0));if(eP(e))return e}let e=this.angleAxisHelper.dataToPosition([t[this._angleField[0]]]);return this._spec.clamp?mB(e,this.angleAxisHelper.getScale(0)):e}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}
2initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(Bk.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){let t=this._arcGroupMark;t.created(),this.setMarkStyle(t,{x:0,y:0},"normal",N.Series),this._arcGroupMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0,clipPath:()=>{let t=this._getAngleAxis(),{x:e,y:i}=this.angleAxisHelper.center(),s=this._computeLayoutRadius();if(this._isTickMaskVisible(t)){let{tickMask:r}=this._spec,{angle:a,offsetAngle:n,style:l={}}=r;return this._getAngleAxisSubTickData(t).map(({value:t})=>{let r=this.angleAxisHelper.dataToPosition([t])+iC(n),o=iC(a)/2;return A9(Object.assign(Object.assign({},l),{x:e,y:i,startAngle:r-o,endAngle:r+o,innerRadius:s*this._innerRadius,outerRadius:s*this._outerRadius,fill:!0}))})}let{width:r,height:a}=this.getLayoutRect();return[g1({width:r,height:a,fill:!0})]}})}_getAngleAxis(){if(!this.angleAxisHelper)return;let 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.getLatestData()}_isTickMaskVisible(t){let e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&!1!==i.visible&&(null==e?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;let i=this._getAngleAxisTickData(t),s=[],{subTick:r={},tick:a={}}=null!=(e=null==t?void 0:t.getSpec())?e:{},{tickCount:n=4}=r,{alignWithLabel:l}=a;if((null==i?void 0:i.length)>=2){let t=i[1].value-i[0].value;for(let e=0;e<i.length-1;e++){let r=i[e],a=i[e+1];s.push(r);for(let e=0;e<n;e++){let i=(e+1)/(n+1),o=(1-i)*r.value+i*(a?a.value:l?1:r.value+t);s.push({value:o})}}return s.push(i[i.length-1]),s}return i}}Bk.mark=BA;let BM=Object.assign(Object.assign({},BA),{track:{name:"track",type:"arc"},progress:{name:"progress",type:"arc"}}),Bw={type:"fadeIn"},BT=()=>{uP.registerAnimation("circularProgress",(t,e)=>{var i;return{appear:(i=t,"fadeIn"===e?Bw:{type:"growAngleIn",options:{overall:i.startAngle}}),enter:{type:"growAngleIn"},disappear:{duration:vy.disappear.duration}}})};class BC extends bT{constructor(){super(...arguments),this._supportStack=!0}}class BB extends Bk{constructor(){super(...arguments),this.type=dD.circularProgress,this.transformerConstructor=BC,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){let e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(eP(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){let s=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+(null==(i=(e=this.radiusAxisHelper).getBandwidth)?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(eP(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(){return this._progressMark=this._createMark(BB.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0},{morph:bk(this._spec,"progress")}),this._progressMark}_initProgressMarkStyle(){var t;let 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.roun
2dCap)&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",N.Series)}getInteractionTriggers(){let t=[];return 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(){return this._trackMark=this._createMark(BB.mark.track,{parent:this._arcGroupMark}),this._trackMark.setMarkConfig({morph:!1,morphKey:null,morphElementKey:null}),this._trackMark}_initTrackMarkStyle(){let t=this._trackMark;t&&this.setMarkStyle(t,{visible:t=>{let e=this.angleAxisHelper.getScale(0).range(),i=Math.min(e[0],e[e.length-1]);return 1e-14>=Math.abs(this._getAngleValueStartWithoutMask(t)-i)},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{let t=this.getStack()?pT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[t]:e[0]})},endAngle:()=>{let t=this.getStack()?pC: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",N.Series)}initAnimation(){var t,e,i,s;let r=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._progressMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("circularProgress"))?void 0:i({startAngle:this._startAngle},r),bx("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("fadeInOut"))?void 0:s(),bx("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}BB.type=dD.circularProgress,BB.mark=BM,BB.builtInTheme={circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},BB.transformerConstructor=BC;let BE=()=>{uP.registerSeries(BB.type,BB),Cf(),BT(),vS(),CY(),CX()};class BP extends Cx{needAxes(){return!1}_getDefaultSeriesSpec(t){let e=super._getDefaultSeriesSpec(t,["startAngle","endAngle","centerX","centerY"]);return e.categoryField=t.categoryField||t.radiusField,e.valueField=t.valueField||t.angleField,e}_transformProgressAxisSpec(t,e,i,s,r){var a,n;t.axes||(t.axes=[]);let l=(null!=(a=t.axes)?a:[]).find(t=>"radius"===t.orient),o=(null!=(n=t.axes)?n:[]).find(t=>"angle"===t.orient);o||(o=e,t.axes.push(o)),l||(l=i,t.axes.push(l)),(0,eE.A)(o.type)&&(o.type="linear"),(0,eE.A)(l.type)&&(l.type="band");let h=SM(o,{min:0,max:1});(0,eE.A)(o.min)&&(o.min=h.min),(0,eE.A)(o.max)&&(o.max=h.max),s&&Object.assign(o,uy({},s,o)),r&&Object.assign(l,uy({},r,l))}}class BO extends BP{_getDefaultSeriesSpec(t){var e,i;let s=super._getDefaultSeriesSpec(t);return s.progress=t.progress,s.track=t.track,s.tickMask=t.tickMask,s.cornerRadius=null!=(e=t.cornerRadius)?e:0,s.roundCap=null!=(i=t.roundCap)&&i,s}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}class BR extends Mu{constructor(){super(...arguments),this.transformerConstructor=BO,this.type="circularProgress",this.seriesType=dD.circularProgress}_setModelOption(){this._modelOption.getDimensionInfo=CJ}}BR.type="circularProgress",BR.seriesType=dD.circularProgress,BR.transformerConstructor=BO,yg(BR,Mp);let BI=Object.assign(Object.assign({},BA),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),BL=Object.assign(Object.assign({},bc),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),BD={type:"fadeIn"};class BF extends bT{constructor(){super(...arguments),this._supportStack=!1}}class Bz extends bt{enableByType(t){return"dimension"!==t}}let BH="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";class Bj extends Bk{constructor(){super(...arguments),this.type=dD.gaugePointer,this.transformerConstructor=BF,this._pinMark=null,this._pointerMark=null,this._pinBackgroun
2dMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null==(t=this._spec.pointer)?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(Bj.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},Bj.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(Bj.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){let t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;let{x:r}=this._getPointerAnchor(t,e);return r-this._getPointerWidth()*(null!=(s=null==(i=null==e?void 0:e.center)?void 0:i[0])?s:0)},y:t=>{var i,s;let{y:r}=this._getPointerAnchor(t,e);return r-this._getPointerHeight(t)*(null!=(s=null==(i=null==e?void 0:e.center)?void 0:i[1])?s:0)},anchor:t=>{let{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 Bz(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null==(i=e.isOnCenter)||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;let s=this._spec.pointer,r=this._radiusField[0];return(0,eA.A)(this.radiusAxisHelper)&&(0,eA.A)(r)?this.radiusAxisHelper.dataToPosition([t[r]])-(null!=(e=null==s?void 0:s.innerPadding)?e:0)-(null!=(i=null==s?void 0:s.outerPadding)?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){let e=this.angleAxisHelper.getScale().domain(),i=ok(e),s=oM(e),r=h4(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([r])}_getRotatedPointerCenterOffset(t){var e,i,s,r;let a=this._spec.pointer,n=this._getPointerWidth()*(null!=(i=null==(e=null==a?void 0:a.center)?void 0:e[0])?i:0),l=-this._getPointerHeight(t)*(null!=(r=null==(s=null==a?void 0:a.center)?void 0:s[1])?r:0),o=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(o),u=Math.sin(o);return{x:n*h+l*u,y:-(l*h-n*u)}}initPinBackgroundMarkStyle(){let 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(){let 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})}getInteractionTriggers(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;let s=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._pointerMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("gaugePointer"))?void 0:i({startAngle:this._startAngle},s),bx("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}Bj.type=dD.gaugePointer,Bj.mark=BL,Bj.builtInTheme={gaugePointer:{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.
2020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:BH,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:BH,fill:"#ddd"}}}},Bj.transformerConstructor=BF;class BV extends bT{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class BN extends Bk{constructor(){super(...arguments),this.type=dD.gauge,this.transformerConstructor=BV,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=iC(null!=(t=this._spec.padAngle)?t:0)}initData(){var t;super.initData(),c3(this._option.dataSet,"spiltSegment",(t,e)=>{let i=t.slice();return i.sort((t,e)=>t[this._angleField[0]]-e[this._angleField[0]]),i.forEach((t,e)=>{t[pz]=t[this._angleField[0]],t[pF]=e>0?i[e-1][pz]:void 0}),i}),null==(t=this.getViewData())||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(BN.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(BN.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;let 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)?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!=(e=null!=(t=this._spec.radius)?t:this._spec.outerRadius)?e:1)}
2,cap:null!=(t=this._spec.roundCap)&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}generateRadiusStyle(t){if(!t)return;let e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),e}initMarkStyleWithSpec(t,e){if(super.initMarkStyleWithSpec(t,e),t&&"segment"===t.name){let e=this.getSpec().segment;if(e)for(let i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,N.User_Mark)}}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;let 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)?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!=(e=null!=(t=this._spec.radius)?t:this._spec.outerRadius)?e:1)}
2,cap:null!=(t=this._spec.roundCap)&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){let e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=my(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?mB(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueEndWithoutMask(t){let e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=my(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?mB(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueStartWithoutPadAngle(t){return(0,eA.A)(t[pF])?this.angleAxisHelper.dataToPosition([t[pF]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[pz]])}initAnimation(){var t,e,i;let s=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._segmentMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("circularProgress"))?void 0:i({startAngle:this._startAngle},s),bx("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}BN.type=dD.gauge,BN.mark=BI,BN.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},BN.transformerConstructor=BV;class BW extends BP{_getDefaultSeriesSpec(t){let e=super._getDefaultSeriesSpec(t);return e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}_getDefaultCircularProgressSeriesSpec(t){let e=super._getDefaultSeriesSpec(t);return e.type=dD.circularProgress,e}transformSpec(t){var e,i,s,r,a;super.transformSpec(t);let n=null==(e=t.series)?void 0:e.find(t=>t.type===dD.gauge||t.type===dD.circularProgress);(0,eE.A)(n)&&("circularProgress"===(n=null!=(i=t.gauge)?i:this._getDefaultCircularProgressSeriesSpec(t)).type&&((0,eE.A)(n.radiusField)&&(0,eE.A)(n.categoryField)&&(n.radiusField=null!=(r=null!=(s=t.radiusField)?s:t.categoryField)?r:t.seriesField),(0,eE.A)(n.valueField)&&(0,eE.A)(n.angleField)&&(n.valueField=null!=(a=t.valueField)?a:t.angleField)),1===t.series.length?t.series.push(n):t.series.forEach(t=>{t.type===n.type&&Object.keys(n).forEach(e=>{e in t||(t[e]=n[e])})})),n.type===dD.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:j.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);let i={radius:null,angle:null};
2(null!=(e=t.axes)?e:[]).forEach(t=>{let{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)),(0,eE.A)(i.angle.type)&&(i.angle.type="linear"),(0,eE.A)(i.radius.type)&&(i.radius.type="linear"),(0,eE.A)(i.angle.zIndex)&&(i.angle.zIndex=j.Region+50)}}class BU extends Mu{constructor(){super(...arguments),this.transformerConstructor=BW,this.type="gauge",this.seriesType=dD.gaugePointer}}BU.type="gauge",BU.seriesType=dD.gaugePointer,BU.transformerConstructor=BW;class BG extends Ms{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["nameField","valueField","fontFamilyField","fontWeightField","fontStyleField","colorHexField","colorMode","colorList","rotateAngles","fontWeightRange","fontSizeRange","maskShape","keepAspect","random","wordCloudConfig","wordCloudShapeConfig","word","fillingWord","wordMask"])}}class BY extends Mu{constructor(){super(...arguments),this.transformerConstructor=BG,this.type="wordCloud",this.seriesType=dD.wordCloud}}BY.transformerConstructor=BG;let B$=[0],BX=[20,40],BK=[200,500],Bq={shrink:!1,enlarge:!1,fontSizeLimitMin:0},BZ=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon","rect"];class BJ{constructor(t=1e3){this._map=new Map,this._maxSize=t}get(t){let e=this._map.get(t);if(e)return this._map.delete(t),this._map.set(t,e),e}set(t,e){if(this._map.has(t))this._map.set(t,e);else{if(this._map.size>=this._maxSize){let t=this._map.keys().next().value;void 0!==t&&this._map.delete(t)}this._map.set(t,e)}}clear(){this._map.clear()}size(){return this._map.size}}px.H,px.H,px.H,px.H,px.H;let BQ=`${px.H}_WORD_CLOUD_TEXT`;px.H;let B0=Object.assign(Object.assign({},bc),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"},wordMask:{name:"wordMask",type:"rect"}});class B1 extends bC{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=>{let 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){(0,eA.A)(t)&&(this._valueField=t)}setFontSizeRange(t){(0,eA.A)(t)?this._fontSizeRange=t:this._fontSizeRange=BX}setAttrFromSpec(){var t,e,i,s,r;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._colorMode=null!=(t=this._spec.colorMode)?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=null!=(e=this._spec.fontWeightRange)?e:BK,this._rotateAngles=null!=(i=this._spec.rotateAngles)?i:B$,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=null!=(s=this._spec.maskShape)?s:"circle",this._textField=(null==(r=this._spec.word)?void 0:r.formatMethod)?BQ:this._nameField;let a=this._spec.wordCloudConfig;this._wordCloudConfig=Object.assign({drawOutOfBound:"hidden",layoutMode:"default",zoomToFit:Bq},this._spec.wordCloudConfig),a&&!(0,eE.A)(a.layoutMode)||hJ(this._option.mode)||(this._wordCloudConfig.layoutMode="fast"),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:B$,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._isWordCloudShape=!BZ.includes(this._maskShape)&&!["fast","grid","cloud"].includes(this._wordCloudConfig.layoutMode),this._defaultFontFamily=this._option.getTheme("fontFamily"),this._wordMeasureCache||(this._wordMeasureCache=new BJ(1e3))}initData(){var t,e;super.initData(),null==(e=null==(t=this.getViewData())?void 0:t.target)||e.addListener("change",()=>{var t;null==(t=this._wordMeasureCache)||t.clear(),this._dataChange=!0,this.compile()})}initMark(){var t;this._wordMark=this._createMark(B1.mark.word,{key:pA,groupKey:this._seriesField,isSeriesMark:!0},{morphElementKey:this._seriesField}),(null==(t=this._spec.wordMask)?void 0:t.visible)&&(this._maskMark=this._createMark(B1.mark.wordMask,{dataView:!1}),this._maskMark.setMarkConfig({zIndex:j.Mark-1}))}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",N.Series)}
2initMarkStyleOfWord(t,e,i,s,r){var a,n;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",N.Series),this.setMarkStyle(t,{fill:null!=(n=null==(a=null==e?void 0:e.style)?void 0:a.fill)?n:this.getWordColor,fontWeight:t=>t.fontWeight,fontFamily:t=>t.fontFamily},"normal",N.User_Mark))}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark)}initAnimation(){[this._wordMark].forEach(t=>{var e,i;if(t){let s=null==(i=null==(e=this._spec)?void 0:e.animationAppear)?void 0:i.preset;t.setAnimationConfig(bb(uP.getAnimationInKey("wordCloud")({animationConfig:()=>{var e,i;return null==(i=null==(e=t.getAnimationConfig())?void 0:e.appear)?void 0:i[0]}},s),bx("word",this._spec,this._markAttributeContext)))}})}getWordOrdinalColorScale(t,e){var i,s,r,a,n;let l=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,o=t?null==(i=this.getViewData())?void 0:i.latestData.map(e=>e[t]):[],h=null!=(r=null!=l?l:null==(s=this._option.globalScale.getScale("color"))?void 0:s.range())?r:this._getDataScheme();return null==(n=(a=(new mw).domain(o)).range)?void 0:n.call(a,h)}initColorCallback(t,e){var i,s,r,a;if("ordinal"===this._colorMode){let i=this.getWordOrdinalColorScale(t,e);return e=>i.scale(e[null!=t?t:pk])}let n=null!=(i=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)?i:this._option.globalScale.getScale("color").range();if(1===n.length)return t=>n[0];if(this._valueField){let t=this.getRawDataStatisticsByField(this._valueField,!0);if(t.min===t.max)return n[0];let e=(new mb).domain([t.min,t.max]).range(n);return t=>e.scale(t[this._valueField])}let l=(new mb).domain([0,null!=(a=null==(r=null==(s=this.getViewData())?void 0:s.latestData)?void 0:r.length)?a:1]).range(n);return t=>l.scale(t[pS])}compile(){super.compile();let{width:t,height:e}=this._region.getLayoutRect();if(!eP(t)||!eP(e)||!(e>0&&t>0))return;let i=[];this._isWordCloudShape?i.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):i.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.setTransform(i)}_getCommonTransformOptions(){var t,e,i,s,r;let{width:a,height:n}=this._region.getLayoutRect(),l=null!=(t=this._spec.word)?t:{},o=null!=(e=l.style)?e:{};return{size:[a,n],shape:r2(this._maskShape)&&"text"===this._maskShape.type&&(0,eE.A)(this._maskShape.fontFamily)?Object.assign({fontFamily:this._option.getTheme("fontFamily")},this._maskShape):this._maskShape,onUpdateMaskCanvas:this.handleMaskCanvasUpdate,onLayoutFinished:()=>{let t=()=>{var e,i,s,r;this._option.globalInstance.getStage().hooks.afterRender.taps=this._option.globalInstance.getStage().hooks.afterRender.taps.filter(e=>e.fn!==t),null==(i=(e=this._option).dispatchEvent)||i.call(e,dj.afterWordcloudShapeDraw,{instance:this._option.globalInstance}),null==(r=null==(s=this._option.globalInstance.getChart().getOption().performanceHook)?void 0:s.afterWordcloudShapeDraw)||r.call(s,this._option.globalInstance)};this._option.globalInstance.getStage().hooks.afterRender.taps.push({type:"sync",name:"afterWordcloudShapeDraw",fn:t})},dataIndexKey:pA,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!=(s=null==(i=this._spec.word)?void 0:i.padding)?s:1,fontFamily:(0,eA.A)(this._spec.fontFamilyField)?{field:this._spec.fontFamilyField}:null!=(r=o.fontFamily)?r:this._defaultFontFamily,fontWeight:(0,eA.A)(this._spec.fontWeightField)?{field:this._spec.fontWeightField}:(0,eA.A)(o.fontWeight)?o.fontWeight:(0,eA.A)(this._valueField)?this._calculateFontWeight:"normal",fontStyle:(0,eA.A)(this._spec.fontStyleField)?{field:this._spec.fontStyleField}:o.fontStyle,createCanvas:hL.createCanvas.bind(hL),getTextBounds:p8}}_wordCloudTransformOption(){var t,e;return Object.assign(Object.assign(Object.assign({},null!=(t=this._wordCloudConfig)?t:{}),this._getCommonTransformOptions()),{layoutType:this._wordCloudConfig.layoutMode,rotate:this._rotateAngles,randomVisible:null==(e=this._spec.random)||e,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,r,a;let n=null!=(e=null==(t=this._spec.fillingWord)?void 0:t.style)?e:{},l=null!=(i=this._wordCloudShapeConfig)?i:{};return Object.assign(Object.assign(Object.assign({},l),this._getCommonTransformOptions()),{createImage:xy,measureCache:this._wordMeasureCache,rotateList:this._rotateAngles,fillingRotateList:l.fillingRotateAngles,fillingFontFamily:(0,eA.A)(l.f
2illingFontFamilyField)?{field:l.fillingFontFamilyField}:null!=(s=n.fontFamily)?s:this._defaultFontFamily,fillingPadding:null!=(a=null==(r=this._spec.fillingWord)?void 0:r.padding)?a:1,fillingFontStyle:(0,eA.A)(l.fillingFontStyleField)?{field:l.fillingFontStyleField}:n.fontStyle,fillingFontWeight:(0,eA.A)(l.fillingFontWeightField)?{field:l.fillingFontWeightField}:n.fontWeight})}getStatisticFields(){let 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(){super.onLayoutEnd(),this.compile(),this._dataChange=!1}getActiveMarks(){return[this._wordMark]}reInit(){var t;super.reInit(),this._keyWordColorCallback&&(this._keyWordColorCallback=null),this._fillingColorCallback&&(this._fillingColorCallback=null),null==(t=this._wordMeasureCache)||t.clear()}release(){var t;super.release(),null==(t=this._wordMeasureCache)||t.clear(),this._wordMeasureCache=void 0}}B1.mark=B0,B1.builtInTheme={wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic",scaleX:1,scaleY:1}}}};let B2=()=>{uP.registerAnimation("wordCloud",(t,e)=>({appear:!1===e?{}:"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn",duration:200,delay:(e,i)=>{let s=t.animationConfig(),r=(null==s?void 0:s.duration)||200,a=(null==s?void 0:s.totalTime)||vy.appear.duration,n=i.context.graphicCount;return i.context.graphicIndex*(r*n<a?r+(a-n*r)/(n-1):(a-r)/(n-1))}},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{duration:vy.disappear.duration}}))},B3={triangleForward:function(){return function(t){let e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:B5,triangle:B5,diamond:function(){return function(t){let 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){let 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){let e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function B5(){return function(t){let e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}function B4(t,e){let i=e[0],s=e[1],r=1,a=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":a[1]=~~(s/2.7*.4),r=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":r=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":a[1]=~~(s/1.5),r=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":r=Math.floor(Math.min(i/2,s/2));break;default:r=Math.floor(Math.max(i/2,s/2))}return{maxRadius:r,center:a}}let B8=t=>B3[t]?B3[t]():B3.circle(),B6=(t,e)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)";function B9(t){return(0,r3.A)(t)?t:function(){return t}}class B7{constructor(t){var e,i;switch(this.options=eB({},B7.defaultOptions,t),(0,r3.A)(this.options.shape)?this.shape=this.options.shape:this.shape=B8(this.options.shape),this.getText=null!=(e=B9(this.options.text))?e:t=>t,this.getTextFontWeight=B9(this.options.fontWeight),this.getTextFontSize=B9(this.options.fontSize),this.getTextFontStyle=B9(this.options.fontStyle),this.getTextFontFamily=B9(this.options.fontFamily),this.outputCallback=null!=(i=this.options.outputCallback)?i:t=>t,this.options.color){case"random-dark":this.getTextColor=()=>B6(10,50);break;case"random-light":this.getTextColor=()=>B6(50,90);break;default:this.getTextColor=B9(this.options.color)}if((0,eE.A)(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=(0,r3.A)(this.options.rotate)?t=>{var e;return iC(null!=(e=this.options.rotate(t))?e:0)}:(t,e)=>{let i=oS(this.options.rotate);return iC(i[Math.floor((this.options.random?Math.random():parseFloat("0."+Math.sin(e).toString().substring(6)))*i.length)])}}canRepeat(){return!1}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>
2=((null!=(t=this.currentStepIndex)?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)?t:-1)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndex<this.data.length){this.progressiveResult=[];let t=this.progressiveIndex,e=0,i=this.options.maxSingleWordTryCount,s=Math.min(this.options.maxFailCount,this.originalData.length);for(;t<this.data.length&&this.failCount<s;){let r=this.layoutWord(t);if(e++,(r||e>i)&&(t++,e=0,this.failCount=r?0:this.failCount+1),this.progressiveIndex=t,this.exceedTime())break;t===this.data.length&&this.failCount<s&&this.options.repeatFill&&this.canRepeat()&&(this.data=[...this.data,...this.originalData.map(t=>Object.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&&!(0,eE.A)(this.progressiveIndex)&&this.progressiveIndex<this.data.length}release(){this.data=null,this.result=null,this.progressiveIndex=null,this.progressiveResult=null}}B7.defaultOptions={fontFamily:'"Trebuchet MS", "Heiti TC", "å¾®è»æ£é»é«", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',fontWeight:"normal",color:"random-dark",fontStyle:"normal",minFontSize:12,drawOutOfBound:!1,shrink:!1,minRotation:-Math.PI/2,maxRotation:Math.PI/2,rotationSteps:0,rotateRatio:.1,random:!1,shape:"circle",progressiveTime:0,progressiveStep:0,repeatFill:!1,fillTextFontSize:12,maxFailCount:20};let Et={archimedean:function(t){let e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){let e=4*t[0]/t[1],i=0,s=0;return t=>{let r=t<0?-1:1;switch(Math.sqrt(1+4*r*t)-r&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};class Ee extends B7{constructor(t){var e;super(eB({},Ee.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<=Ee.defaultOptions.minFontSize&&(this.options.minFontSize=Ee.defaultOptions.minFontSize),this.spiral=(0,eS.A)(this.options.spiral)?null!=(e=Et[this.options.spiral])?e:Et.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=B9(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){let e=this.data[t];if(""===(""+e.text).trim())return!0;let{maxRadius:i,center:s}=B4(this.options.shape,this._size);if(e.x=s[0],e.y=s[1],function(t,e,i,s,r,a){let n,l,o,h,u;if(e.sprite)return;let d=t.context,c=t.ratio;d.setTransform(c,0,0,c,0,0),d.clearRect(0,0,(r<<5)/c,a/c);let p=0,g=0,f=0,m=i.length;for(--s;++s<m;){if(e=i[s],d.save(),d.font=e.fontStyle+" "+e.fontWeight+" "+~~((e.fontSize+1)/c)+"px "+e.fontFamily,n=d.measureText(e.text+"m").width*c,o=e.fontSize<<1,e.angle){let t=Math.sin(e.angle),i=Math.cos(e.angle),s=n*i,r=n*t,a=o*i,l=o*t;n=Math.max(Math.abs(s+l),Math.abs(s-l))+31>>5<<5,o=~~Math.max(Math.abs(r+a),Math.abs(r-a))}else n=n+31>>5<<5;if(o>f&&(f=o),p+n>=r<<5&&(p=0,g+=f,f=0),g+o>=a)break;d.translate((p+(n>>1))/c,(g+(o>>1))/c),e.angle&&d.rotate(e.angle),d.fillText(e.text,0,0),e.padding&&(d.lineWidth=2*e.padding,d.strokeText(e.text,0,0)),d.restore(),e.width=n,e.height=o,e.xoff=p,e.yoff=g,e.x1=n>>1,e.y1=o>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,p+=n}let _=d.getImageData(0,0,(r<<5)/c,a/c).data,y=[];for(;--s>=0;){if(!(e=i[s]).hasText)continue;for(l=(n=e.width)>>5,o=e.y1-e.y0,h=0;h<o*l;h++)y[h]=0;if(null==(p=e.xoff))return;g=e.yoff;let t=0,a=-1;for(u=0;
2u<o;u++){for(h=0;h<n;h++){let e=l*u+(h>>5),i=_[(g+u)*(r<<5)+(p+h)<<2]?1<<31-h%32:0;y[e]|=i,t|=i}t?a=u:(e.y0++,o--,u--,g++)}e.y1=e.y0+a,e.sprite=y.slice(0,(e.y1-e.y0)*l)}}(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i)){var r,a;let t,i;return this.result.push(e),this._bounds?(r=this._bounds,a=e,t=r[0],i=r[1],a.x+a.x0<t.x&&(t.x=a.x+a.x0),a.y+a.y0<t.y&&(t.y=a.y+a.y0),a.x+a.x1>i.x&&(i.x=a.x+a.x1),a.y+a.y1>i.y&&(i.y=a.y+a.y1)):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){let t=e.fontSize*this._originSize[0]/this.options.minFontSize,i=Math.max(e.width,e.height);if(i<=t)this._board=this.expandBoard(this._board,this._bounds,i/this._size[0]);else{if(!this.options.clip)return!0;this._board=this.expandBoard(this._board,this._bounds,t/this._size[0])}}else this._placeStatus,this._board=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];let i=this.getContext(this.options.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Uint32Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null,t.length,this.result=[];let 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)){let t=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(t-this._originSize[1]/2)}return this.result}formatTagItem(t){let e,i,s=this._size,r=this.zoomRatio(),a=this.dy(),n=s[0]>>1,l=s[1]>>1,o=t.length,h=[];for(let s=0;s<o;++s)e=t[s],(i={}).datum=e.datum,i.x=(e.x+n)*r,i.y=(e.y+l+a)*r,i.fontFamily=e.fontFamily,i.fontSize=e.fontSize*r,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.angle=e.angle,h.push(i);return h}output(){return this.outputCallback?this.outputCallback(this.formatTagItem(this.result)):this.formatTagItem(this.result)}progressiveOutput(){return this.outputCallback?this.outputCallback(this.formatTagItem(this.progressiveResult)):this.formatTagItem(this.progressiveResult)}updateBoardExpandStatus(t){this._isBoardExpandCompleted=t*(this._originSize[0]/this._size[0])<this.options.minFontSize}shouldShrinkContinue(){return!this.options.clip&&this.options.shrink&&!this._isBoardExpandCompleted}shrinkBoard(t){let e=t[0],i=t[1];if(i.x>=this._size[0]||i.y>=this._size[1])return;let s=Math.min(e.x,this._size[0]-i.x),r=Math.min(e.y,this._size[1]-i.y),a=2*Math.min(s/this._size[0],r/this._size[1]);this._size=this._size.map(t=>t*(1-a))}expandBoard(t,e,i){let s=this._size[0],r=this._size[1],a=s>>5,n=s*(i||1.1)-s>>5,l=2*n>2?n:2;l%2!=0&&l++;let o=Math.ceil(r*(l<<5)/s);o%2!=0&&o++;let h=s+(l<<5),u=r+o,d=h>>5,c=l/2,p=o/2,g=new Uint32Array(u*d).fill(0);for(let e=0;e<r;e++){let i=e*a,s=i+a,r=(e+p)*d+c,n=t.slice(i,s);g.set(n,r)}if(this._size=[h,u],e){let t=(l<<5)/2,i=o/2;e[0].x+=t,e[0].y+=i,e[1].x+=t,e[1].y+=i}return g}insertZerosToArray(t,e,i){if(this.options.customInsertZerosToArray)return this.options.customInsertZerosToArray(t,e,i);let s=Math.floor(i/6e4);for(let i=0;i<s;i++)t.splice(e+6e4*i,0,...Array(6e4).fill(0));t.splice(e+6e4*s,0,...Array(i%6e4).fill(0))}getContext(t){t.width=1,t.height=1;let e=Math.sqrt(t.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,1,1).data.length>>2);t.width=(this.cw<<5)/e,t.height=this.ch/e;let i=t.getContext("2d",{willReadFrequently:!0});
2return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e,canvas:t}}place(t,e,i,s){let r=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;let a=.5>this.random()?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,a))return null;let n=e.x,l=e.y,o=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),h=this.spiral(this._size),u,d,c,p,g=-a;for(this._tTemp=null,this._dtTemp=null;u=h(g+=a);){let h=Math.sqrt((d=u[0])**2+(c=u[1])**2),_=Math.atan(c/d);d<0?_+=Math.PI:c<0&&(_=2*Math.PI+_);let y=this.shape(_);if(Math.min(Math.abs(d),Math.abs(c))>=o)break;if(h>=s)r&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=a);else{var f,m;if(e.x=n+~~(h*y*Math.cos(-_)),e.y=l+~~(h*y*Math.sin(-_)),p=e,this.options.clip)if(this.shouldShrinkContinue()){if(Es(p,this._size)){r&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=a);continue}}else{if(Ei(p,this._size)){r&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=a);continue}Es(p,this._size)&&(p=function(t,e){let i=t.sprite,s=t.y1-t.y0,r=t.width>>5,a=0,n=[],l=Math.max(-(t.y0+t.y),0),o=Math.min(s+(e[1]-(t.y1+t.y)),s),h=Math.max(-(t.x0+t.x),0)>>5,u=Math.min(r+(e[0]-(t.x1+t.x)>>5)+1,r);for(let t=0;t<s;t++){for(let e=0;e<r;e++)t<l||o<=t||e<h||u<=e||n.push(i[a+e]);a+=r}let d=h<<5,c=r-u<<5,p=s-o;return Object.assign(Object.assign({},t),{width:t.width-d-c,height:t.height-l-p,x0:t.x0+d,x1:t.x1-c,y0:t.y0+l,y1:t.y1-p,x:t.x+d/2-c/2,sprite:n})}(p,this._size))}else if(Es(p,this._size)){r&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=a);continue}if(r=!0,(!i||(f=p,m=i,f.x+f.x1>m[0].x&&f.x+f.x0<m[1].x&&f.y+f.y1>m[0].y&&f.y+f.y0<m[1].y))&&(!i||!function(t,e,i){let s=i[0]>>5,r=t.sprite,a=t.width>>5,n=t.x-(a<<4),l=127&n,o=32-l,h=t.y1-t.y0,u,d=(t.y+t.y0)*s+(n>>5);for(let t=0;t<h;t++){u=0;for(let i=0;i<=a;i++)if((u<<o|(i<a?(u=r[t*a+i])>>>l:0))&e[d+i])return!0;d+=s}return!1}(p,t,this._size))){let i=p.sprite,s=p.width>>5,r=this._size[0]>>5,a=p.x-(s<<4),n=127&a,l=32-n,o=p.y1-p.y0,h,u=(p.y+p.y0)*r+(a>>5);for(let e=0;e<o;e++){h=0;for(let r=0;r<=s;r++)t[u+r]|=h<<l|(r<s?(h=i[e*s+r])>>>n:0);u+=r}return e.sprite=null,p.sprite=null,!0}}}return null!==this._tTemp&&(this._placeStatus=3),this.shouldShrinkContinue()||this.setCache(p,a),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){let i=`${t.angle}-${e}`,s=t.x1-t.x0,r=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:s,height:r});let{width:a,height:n}=this.cacheMap.get(i);(s<a&&r<n||s<=a&&r<n)&&this.cacheMap.set(i,{width:s,height:r})}isSizeLargerThanMax(t,e){let i=`${t.angle}-${e}`;if(!this.cacheMap.has(i))return!1;let{width:s,height:r}=this.cacheMap.get(i),a=t.x1-t.x0,n=t.y1-t.y0;return a>=s&&n>=r}}Ee.defaultOptions={enlarge:!1,minFontSize:2,maxSingleWordTryCount:2};let Ei=(t,e)=>t.x+t.x0>e[0]||t.y+t.y0>e[0]||t.x+t.x1<0||t.y+t.y1<0,Es=(t,e)=>t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>e[0]||t.y+t.y1>e[1],Er=(t,e,i)=>{let{threshold:s,invert:r=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{let a=t.width;if(0===t.data[e*a*4+4*i+3])return!r;let n=t.data[e*a*4+4*i+0],l=t.data[e*a*4+4*i+1],o=t.data[e*a*4+4*i+2];if(255===n&&255===l&&255===o)return!r;if(eP(s)){let t=.3*n+.59*l+.11*o;return r?t<=s:t>=s}return!1};let a=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});a.fillStyle=t,a.fillRect(0,0,1,1);let n=a.getImageData(0,0,1,1).data;return(t,e,i)=>{let s=t.width;return[0,1,2,3].every(a=>r?t.data[4*(e*s+i)+a]!==n[a]:t.data[4*(e*s+i)+a]===n[a])}},Ea=(t,e,i,s,r=!1,a)=>{let{backgroundColor:n="#fff"}=t,{fill:l="#000"}=t;r&&([n,l]=[l,n]);let o=s||a({width:e,height:i,dpr:1}),h=o.getContext("2d",{willReadFrequently:!0});if(s){let t=s.width,r=s.height;h.clearRect(0,0,t,r),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return h.fillStyle=n,h.fillRect(0,0,o.width,o.height),"text"===t.type?En(t,l,o.width,o.height,h):"geometric"===t.type&&Eh(t,l,o.width,o.height,h),o},En=(t,e,i,s,r)=>{let{fontFamily:a="sans-serif",fontWeight:n="normal",fontStyle:l="normal",fontVariant:o="normal",text:h,hollow:u}=t,d=12;r.font=`${l} ${o} ${n} ${d}px ${a}`,r.textAlign="center",r.textBaseline="middle",r.fillStyle=e;let c=r.measureText(h),p="normal"!==l?1.1:1,g=(0,eA.A)(c.actualBoundingBoxRight)&&(0,eA.A)(c.actualBoundingBoxLeft)?Math.ceil(p*(Math.abs(c.actualBoundingBoxRight)+Math.abs(c.actualBoundingBoxLeft))):0,f=Math.max(Math.ceil(c.width),g,d);if(u&&(r.globalCompositeOperation="xor"),f>i){let t=Math.min(i/f,s/d);r.fillText(h,i/2,s/2),r.scale(t,t)}else d=Math.min(d=Math.floor(d*i/f),s),r.font=`${l} ${o} ${n} ${d}px ${a}`,r.fillText(h,Math.floor(i/2),Math.floor(s/2))},El=(t,e,i=0,s)=>{let r=2*Math.PI/s;return Array(s).fill(0).map((s,a)=>iE(t,e,i+a*r))},Eo=(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()},Eh=(t,e,i,s,r)=>{let{hollow:a}=t,{center:n,maxRadius:l}=B4(t.shape,[i,s]);r.fillStyle=e,a&&(r.globalCompositeOperation="xor");let o=n[0],h=n[1];if("cardioid"===t.shape){var u;let t;u=((t,e,i=0,s)=>{let r=2*Math.PI/s,a=B8("cardioid");return Array(s).fill(0).map((s,n)=>{let l=i+n*r;return iE(t,e*a(l),l)})})({x:o,y:h},l,0,100),r.beginPath(),u.forEach((e,i)=>{0===i?r.moveTo(e.x,e.y):r.bezierCurveTo(e.x,e.y,t.x,t.y,e.x,e.y),t=e}),r.closePath(),r.fill()}else if("circle"===t.shape)r.beginPath(),r.arc(o,h,l,0,2*Math.PI,!0),r.fill();else if("diamond"===t.shape)Eo(r,El({x:o,y:h},l,-Math.PI/2,4));else if("square"===t.shape)Eo(r,El({x:o,y:h},l,-Math.PI/4,4));else if("pentagon"===t.shape)Eo(r,El({x:o,y:h},l,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)Eo(r,El({x:o,y:h},l,-Math.PI/2,3));else if("triangleForward"===t.shape)Eo(r,El({x:o,y:h},l,0,3));else if("star"===t.shape){let t=El({x:o,y:h},l,-Math.PI/2,5),e=El({x:o,y:h},l/(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]);Eo(r,i)}
2else r.fillRect(0,0,i,s)};class Eu extends B7{constructor(t){super(eB({},Eu.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,r)=>{let a=r.occupied,n=a.length;for(;n--;){let i=t+a[n][0],s=e+a[n][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];let e=8*t,i=e,s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){let r=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*r*Math.cos(-i/e*2*Math.PI),this.center[1]+t*r*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;let r=this.options.clip?1:e,a=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*r),this.options.minFontSize),n=this.getText(t)+"";if(this.options.clip&&(n=n.slice(0,Math.ceil(n.length*e))),!n)return null;let l=this.getTextFontWeight(t),o=this.getTextFontStyle(t),h=this.getTextRotate&&null!=(s=this.getTextRotate(t,i))?s:0,u=this.getTextFontFamily(t),d=this.options.createCanvas({width:1,height:1}),c=d.getContext("2d",{willReadFrequently:!0});c.font=o+" "+l+" "+a.toString(10)+"px "+u;let p=c.measureText(n).width,g=Math.max(a,c.measureText("m").width,c.measureText("ï¼·").width),f=p+2*g,m=3*g,_=Math.ceil(f/this.gridSize),y=Math.ceil(m/this.gridSize);f=_*this.gridSize;let v=-p/2,b=-(.4*g),x=Math.ceil((f*Math.abs(Math.sin(h))+(m=y*this.gridSize)*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((f*Math.abs(Math.cos(h))+m*Math.abs(Math.sin(h)))/this.gridSize),A=S*this.gridSize,k=x*this.gridSize;d.setAttribute("width",""+A),d.setAttribute("height",""+k),c.scale(1,1),c.translate(A/2,k/2),c.rotate(-h),c.font=o+" "+l+" "+a.toString(10)+"px "+u,c.fillStyle="#000",c.textBaseline="middle",c.fillText(n,v,b);let M=c.getImageData(0,0,A,k).data;if(this.exceedTime())return null;let w=[],T,C=S,B=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let r=this.gridSize;for(;r--;)if(M[4*((e*this.gridSize+s)*A+(t*this.gridSize+r))+3])return i.push([t,e]),t<B[3]&&(B[3]=t),t>B[1]&&(B[1]=t),e<B[0]&&(B[0]=e),void(e>B[2]&&(B[2]=e))}};for(;C--;)for(T=x;T--;)E(C,T,w);return{datum:t,occupied:w,bounds:B,gw:S,gh:x,fillTextOffsetX:v,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:a,fontStyle:o,fontWeight:l,fontFamily:u,angle:h,text:n}}calculateEmptyRate(){let t=this.ngx*this.ngy,e=0;for(let t=0;t<this.ngx;t++)for(let i=0;i<this.ngy;i++)this.grid[t][i]&&e++;return e/t}canFitText(t,e,i,s,r){let a=r.length;for(;a--;){let i=t+r[a][0],s=e+r[a][1];if(i>=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){let i=this.data[t],s=this.getTextInfo(i,e,t);if(!s||this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){let t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let r=this.maxRadius+1,a=t=>{let e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),a=s.gw,n=s.gh;return!!this.canFitText(e,i,a,n,s.occupied)&&(s.distance=this.maxRadius-r,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,a,n,s),!0)};for(;r--;){let t=this.getPointsAtRadius(this.maxRadius-r);if(this.options.random&&oT(t=[].concat(t)),t.some(a))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){let s=this.getTextColor(i),r={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(r),this.progressiveResult&&this.progressiveResult.push(r)}initGrid(t){this.grid=[];let e=this.options.shape;if(r2(e)){let i=Ea(e,t.width,t.height,void 0,!1,this.options.createCanvas),s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let r=Er(e.backgroundColor,void 0,this.options.createCanvas),a=(t,e)=>{let i=this.gridSize;for(;i--;){let a=this.gridSize;for(;a--;)if(!r(s,e*this.gridSize+i,t*this.gridSize+a))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1},n=this.ngx;for(;n--;){this.grid[n]=[];let t=this.ngy;for(;t--;)a(n,t),!1!==this.grid[n][t]&&(this.grid[n][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);let{center:i,maxRadius:s}=B4(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()}}Eu.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class Ed extends B7{constructor(t){super(eB({},Ed.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let s=0,r=this.result.length;s<r;s++){var e,i;if(e=t,i=this.result[s],!(e.left+e.width<i.left||e.top+e.height<i.top||e.left>i.left+i.width||e.top>i.top+i.height))return!1}return!0}getTextInfo(t,e){let 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=this.options.getTextBounds(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){let e=this.getTextInfo(this.data[t],t),i=2*Math.PI,s=0,r=e.left,a=e.top,n=e.width,l=e.height,o=1,h=this.fit(e);for(;!h&&s<this.maxRadius;)s+=.5,o=this.shape(s/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),r=this.center[0]-n/2+s*o*Math.cos(i)*this.aspectRatio,a=this.center[1]-l/2+s*o*Math.sin(i),e.left=r,e.top=a,e.x=r+n/2,e.y=a+l/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>
2=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<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}Ed.defaultOptions={enlarge:!1};let Ec={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},Ep=(t,e)=>{var i,s,r,a,n,l;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return eg.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];let o=(null!=(i=t.size)?i:[500,500]).slice();o[0]=Math.floor(o[0]),o[1]=Math.floor(o[1]);let h=t.fontFamily?Eg(t.fontFamily):"sans-serif",u=t.fontStyle?Eg(t.fontStyle):"normal",d=t.fontWeight?Eg(t.fontWeight):"normal",c=t.rotate?Eg(t.rotate):0,p=Eg(t.text),g=null!=(s=t.spiral)?s:"archimedean",f=t.padding?Eg(t.padding):1,m=null!=(r=t.shape)?r:"square",_=null!=(a=t.shrink)&&a,y=null!=(n=t.enlarge)&&n,v=null!=(l=t.clip)&&l,b=t.minFontSize,x=t.randomVisible,S=t.as?Object.assign(Object.assign({},Ec),t.as):Ec,A=t.depth_3d,k=t.postProjection,M=t.fontSize?Eg(t.fontSize):14,w=t.fontSizeRange;if(w&&!ed(M)){let t=M,i=Em(E_(t,e),w);M=e=>i(t(e))}let T=Ee;"fast"===t.layoutType?T=Ed:"grid"===t.layoutType&&(T=Eu);let C=new T(Object.assign(Object.assign({},t),{text:p,padding:f,spiral:g,shape:m,rotate:c,fontFamily:h,fontStyle:u,fontWeight:d,fontSize:M,shrink:_,clip:v,enlarge:y,minFontSize:b,random:x,outputCallback:e=>{let i,s,r=[];for(let a=0,n=e.length;a<n;a++)(i=(s=e[a]).datum)[S.x]=s.x,i[S.y]=s.y,i[S.fontFamily]=s.fontFamily,i[S.fontSize]=s.fontSize,i[S.fontStyle]=s.fontStyle,i[S.fontWeight]=s.fontWeight,i[S.angle]=s.angle,"StereographicProjection"===k&&function(t,e,i,s,r){let a=Math.max(t[0],t[1])/2,n=function(t,e,i,s,r){let{x:a,y:n}=r,l=a/t*Math.PI*2,o=Math.PI-n/e*Math.PI;return{x:i*Math.sin(o+=(o<Math.PI/2?1:-1)*Math.pow(Math.min(o-Math.PI/2,1),2)/5)*Math.cos(l)+s.x,y:i*Math.cos(o)+s.y,z:i*Math.sin(o)*Math.sin(l)+s.z}}(t[0],t[1],a,{x:a,y:a,z:null!=r?r:a},e);i[s.x]=n.x,i[s.y]=n.y,i[s.z]=n.z}(o,s,i,S,A),t.dataIndexKey&&(i[t.dataIndexKey]=`${a}`),r.push(i);return r}}));return C.layout(e,{width:o[0],height:o[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:C}:C.output()},Eg=t=>(0,eS.A)(t)||ed(t)||(0,r3.A)(t)||(0,ev.A)(t)?t:e=>e[t.field],Ef=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),Em=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];let s=Ef(t[0]),r=Ef(t[1]),a=Math.min(s,r),n=Math.max(s,r);return t=>(Ef(t)-a)/(n-a)*(e[1]-e[0])+e[0]},E_=(t,e)=>{let i,s=1/0,r=-1/0,a=e.length;for(let n=0;n<a;++n)(i=m_(t(e[n])))<s&&(s=i),i>r&&(r=i);return 1===e.length&&s===r&&(s-=1e4),[s,r]};(tb=tO||(tO={})).BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",tb.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",tb.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw";class Ey{constructor(t=1e3){this._map=new Map,this._maxSize=t}get(t){let e=this._map.get(t);if(void 0!==e)return this._map.delete(t),this._map.set(t,e),e}set(t,e){if(this._map.has(t))this._map.set(t,e);else{if(this._map.size>=this._maxSize){let t=this._map.keys().next().value;void 0!==t&&this._map.delete(t)}this._map.set(t,e)}}clear(){this._map.clear()}size(){return this._map.size}}let Ev=t=>/^[\u4e00-\u9fa5]+$/.test(t),Eb=(t,e)=>{if((0,eE.A)(t))return 0;let i=0;for(let e of t)Ev(e)?i+=1:i+=.53;return i};function Ex(t,e,i){let{stepFactor:s,importantWordCount:r,globalShinkLimit:a}=e,{size:n,segmentation:{regions:l},tempCanvas:o,boardSize:h,shapeCenter:u,shapeMaxR:d,shapeRatio:c}=i,p=o.getContext("2d",{willReadFrequently:!0}),g=ET(i),f=g.slice(0),m=e.fontSizeShrinkFactor,_=null,y=1,v=1,b=0;t.length>r&&(b=t.sort((t,e)=>e.weight-t.weight)[r].weight);for(let i=0;i<l.length;i++){let{words:r,center:u,maxR:d,ratio:c}=l[i],x=!1;for(let i=0;i<r.length;i++){EM(o,p,t,i,e.measureCache);let l=r[i];if(l.x=u[0],l.y=u[1],!l.skip&&l.hasText&&l.sprite&&ES(f,l,d,c,n,h,s))l.hasPlaced=!0;else{if(!l.skip&&l.weight>b&&v>a){let e=l.datum[Symbol.for("vGrammar_id")];e!==_&&(_=e,y=v),v*=m,t.forEach(t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m}),f=g.slice(0),x=!0;break}if(!l.skip&&l.datum[Symbol.for("vGrammar_id")]===_){t.forEach(t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/v}),l.skip=!0,v=y,_=null,f=g.slice(0),x=!0;break}}}x&&(i=-1)}for(let i=0;i<e.textLayoutTimes;i++){let i=t.filter(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;t<i.length;t++){let r=i[t];EM(o,p,i,t,e.measureCache),r.x=u[0],r.y=u[1],r.hasText&&ES(f,r,d,c,n,h,s)&&(r.hasPlaced=!0)}}e.board=f}function ES(t,e,i,s,r,a,n){var l;let o=e.x,h=e.y,u=(l=s,function(t){return[l*(t*=.1)*Math.cos(t),t*Math.sin(t)]}),d=+n,c,p,g,f=-d;for(;c=u(f+=d);){let{wordSize:s,bounds:{dTop:n,dBottom:l,dLeft:u,dRight:d}}=e;if(Math.min(Math.abs(p=c[0]),Math.abs(g=c[1]))>=i)break;if(e.x=~~(o+p),e.y=~~(h+g),!(e.x-u<0||e.x+d>r[0]||e.y-n<0||e.y+l>
2r[1]||Ek(e,t,a)))return EA(e,t,a),!0}return!1}function EA(t,e,i){let{wordSize:s}=t,r=t.sprite,a=s[0]>>5,n=i[0]>>5,l=t.x-(a<<4),o=l%32,h=32-o,u=s[1],d,c=(t.y-(s[1]>>1))*n+(l>>5);if(0===o)for(let t=0;t<u;t++){for(let i=0;i<a;i++)e[c+i]|=r[t*a+i];c+=n}else for(let t=0;t<u;t++){d=0;for(let i=0;i<=a;i++)e[c+i]|=d<<h|(i<a?(d=r[t*a+i])>>>o:0);c+=n}}function Ek(t,e,i){let{sprite:s,wordSize:r}=t,a=i[0]>>5,n=r[0]>>5,l=t.x-(n<<4),o=l%32,h=32-o,u=r[1],d,c=(t.y-(r[1]>>1))*a+(l>>5);if(0===o)for(let t=0;t<u;t++){for(let i=0;i<n;i++)if(e[c+i]&s[t*n+i])return!0;c+=a}else for(let t=0;t<u;t++){d=0;for(let i=0;i<=n;i++)if((d<<h|(i<n?(d=s[t*n+i])>>>o:0))&e[c+i])return!0;c+=a}return!1}function EM(t,e,i,s,r){let a,n,l=i[s];if(l.sprite||0===l.fontSize)return;if(r){let t=r.get(Ew(l));if(t)return l.sprite=t.sprite,l.bounds=t.bounds,l.wordSize=t.wordSize,void(l.hasText=!0)}let o=Math.PI/180,h=i.length;t.width=2048,t.height=2048,e.clearRect(0,0,2048,2048),e.textAlign="center";let u,d,c=0,p=0,g=0,f=0,m=s;for(--s;++s<h;){let t=i[s],r=Math.max(t.fontSize,2);if(e.save(),e.font=t.fontStyle+" "+t.fontWeight+" "+r+"px "+t.fontFamily,u=e.measureText(t.text+"m").width+2*t.padding,d=2*r+2*t.padding,0!==t.rotate){let e=Math.sin(t.rotate*o),i=Math.cos(t.rotate*o),s=u*i,r=u*e,a=d*i,n=d*e;u=Math.max(Math.abs(s+n),Math.abs(s-n)),d=~~Math.max(Math.abs(r+a),Math.abs(r-a))}if(u=u+31>>5<<5,(d=Math.ceil(d))>g&&(g=d),c+u>=2048&&(c=0,p+=g,g=d),p+d>=2048){if(0===p){t.hasText=!1;continue}break}p+d>=f&&(f=p+d),e.translate(c+(u>>1),p+(d>>1)),0!==t.rotate&&e.rotate(t.rotate*o),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[c,p],t.wordSize=[u,d],t.hasText=!0,c+=u}if(0===f)return;let _=e.getImageData(0,0,2048,f).data;for(;--s>=m;){let t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}let{LT:e=[0,0],wordSize:l}=t;[c,p]=e;let o=l[0]>>5,h=Array(o*l[1]).fill(0),[u,d,g,f]=[1/0,-1/0,1/0,-1/0];for(n=0;n<l[1];n++){let t;for(a=0;a<l[0];a++)if(_[4*((p+n)*2048+(c+a))+3]>0){let e=1<<31-a%32;h[o*n+(a>>5)]|=e,a<g&&(g=a),a>f&&(f=a),t|=e}t&&(n<u&&(u=n),n>d&&(d=n))}if(t.bounds={dTop:(l[1]>>1)-u,dBottom:d-(l[1]>>1),dLeft:(l[0]>>1)-g,dRight:f-(l[0]>>1)},t.sprite=h,r){let e=Ew(t);r.set(e,{sprite:h,bounds:t.bounds,wordSize:l})}delete t.LT}}function Ew(t){return String(t.text)+"|"+String(t.fontFamily)+"|"+String(t.fontStyle)+"|"+String(t.fontWeight)+"|"+String(t.fontSize)+"|"+String(t.rotate)+"|"+String(t.padding)}function ET(t){let{segmentation:{labels:e},boardSize:i,size:s}=t,r=i[0]>>5,a=Array(r*s[1]).fill(0);for(let t=0;t<s[1];t++)for(let i=0;i<s[0];i++)if(0===e[t*s[0]+i]){let e=1<<31-i%32;a[r*t+(i>>5)]|=e}if(i[0]>s[0]){let t=(1<<i[0]-s[0])-1;for(let e=0;e<s[1];e++)a[r*e+r-1]|=t}return a}let EC=(t,e={})=>{if((0,r3.A)(t))return t;let i=[t];return(e&&e.get||(t=>e=>uQ(e,t)))(i)},EB=(t,e={})=>{if((0,ev.A)(t)){let i=t.map(t=>EC(t,e));return t=>i.map(e=>e(t))}return EC(t,e)},EE=t=>t?"string"==typeof t||"number"==typeof t?()=>t:(0,r3.A)(t)?t:e=>e[t.field]:null;class EP extends mb{constructor(){super(fW,fU),this.type=Y.Sqrt}clone(){return(new EP).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}let EO={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"};class ER{constructor(t){this.progressiveResult=[],this.options=t}layout(t){let e,i;this.data=t;let s=this.options,r={shapeUrl:s.shape,size:s.size,ratio:s.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0},a=this.options.createCanvas({width:s.size[0],height:s.size[1]}),n=a.getContext("2d",{willReadFrequently:!0});if(n.textAlign="center",n.textBaseline="middle",r.tempCanvas=a,r.boardSize=[s.size[0]+31>>5<<5,s.size[1]],r.random?r.randomGenerator=Math.random:(e=-1,i=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9],r.randomGenerator=()=>(e=(e+1)%i.length,i[e])),this.segmentationInput=r,(0,eS.A)(r.shapeUrl)){var l,o;r.isEmptyPixel=Er(void 0,void 0,this.options.createCanvas);let t=(l=r.shapeUrl,o=this.options.createImage,l&&(r0(l)||r1(l)||l.startsWith("<svg"))?new Promise((t,e)=>{var i;let s=o({image:l}),r=null==(i=s.resources)?void 0:i.get(l);r&&"success"===r.state&&r.data?t(r.data):(s.successCallback=()=>{var i;if(s){let r=null==(i=s.resources)?void 0:i.get(l);r&&"success"===r.state&&r.data?t(r.data):e(Error("image load failed: "+l))}else e(Error("image load failed: "+l))},s.failCallback=()=>{e(Error("image load failed: "+l))})}):null);t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then(t=>{var e;let i,a,n,l,o;this.isImageFinished=!0;let h=this.options.createCanvas({width:s.size[0],height:s.size[1],dpr:1});r.maskCanvas=h;let u=h.getContext("2d");
2s.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;let s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);let r=e.width,a=s.getImageData(0,0,e.width,e.height),n=0,l=a.height,o=0,h=a.width,u=(t,e)=>{for(let s=0;s<t;++s)if(!i(a,e,s))return!1;return!0},d=(t,e,s)=>{for(let r=e;r<s;++r)if(!i(a,r,t))return!1;return!0};for(;n<l&&u(r,n);)++n;for(;l-1>n&&u(r,l-1);)--l;for(;o<h&&d(o,n,l);)++o;for(;h-1>o&&d(h-1,n,l);)--h;let c=s.getImageData(o,n,h-o,l-n);e.width=c.width,e.height=c.height,s.clearRect(0,0,e.width,e.height),s.putImageData(c,0,0)}(t,h,r.isEmptyPixel);let d=(e=s.size,i=t.width,(a=t.height)*(n=e[0]/i)>e[1]&&(n=e[1]/a),l=Math.floor(n*i),o=Math.floor(n*a),{x:(e[0]-l)/2,y:(e[1]-o)/2,width:l,height:o,scale:n});u.clearRect(0,0,s.size[0],s.size[1]),u.drawImage(t,d.x,d.y,d.width,d.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(r.maskCanvas)}).catch(t=>{this.isImageFinished=!0})):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(r.shapeUrl&&("text"===r.shapeUrl.type||"geometric"===r.shapeUrl.type)){r.isEmptyPixel=Er(r.shapeUrl.backgroundColor,void 0,this.options.createCanvas);let t=Ea(r.shapeUrl,s.size[0],s.size[1],void 0,!1,this.options.createCanvas);r.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}}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,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x;let S,A,k=this.segmentationInput,M=function(t){let{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),r=Array(e[0]*e[1]).fill(0),a=1,n=[[0,1],[1,0],[-1,0],[0,-1]],l=[];for(let i=0;i<e[1];i++)for(let o=0;o<e[0];o++)if(0===r[i*e[0]+o]&&!t.isEmptyPixel(s,i,o)){r[i*e[0]+o]=a,l.push([i,o]);for(let i=0;i<l.length;i++)for(let o=0;o<4;o++){let h=l[i][0]+n[o][0],u=l[i][1]+n[o][1];h=h<0?0:h>=e[1]?e[1]-1:h,u=u<0?0:u>=e[0]?e[0]-1:u,0!==r[h*e[0]+u]||t.isEmptyPixel(s,h,u)||(r[h*e[0]+u]=a,l.push([h,u]))}a++,l=[]}let o={},h={},u={},d={},c={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){let s=r[t*e[0]+i];0!==s&&(function(t,i){let 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 a=0;a<4;a++){let n=t+s[a][0],l=i+s[a][1];if(n=n<0?0:n>=e[1]?e[1]-1:n,l=l<0?0:l>=e[0]?e[0]-1:l,0===r[n*e[0]+l])return!0}return!1}(t,i)&&(f.push([t,i]),o[s]=o[s]||[],o[s].push([i,t]),d[s]||(d[s]=[1/0,-1/0,1/0,-1/0]),t<d[s][0]&&(d[s][0]=t),t>d[s][1]&&(d[s][1]=t),i<d[s][2]&&(d[s][2]=i),i>d[s][3]&&(d[s][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[s]=(h[s]||0)+1)}let m=[];for(let t in o){let e=o[t],i=~~(e.reduce((t,e)=>t+e[0],0)/e.length),s=~~(e.reduce((t,e)=>t+e[1],0)/e.length);u[t]=[i,s],m.push(...e);let[r,a,n,l]=d[t];c[t]=~~Math.max(Math.sqrt((i-n)**2+(s-r)**2),Math.sqrt((i-l)**2+(s-a)**2),Math.sqrt((i-n)**2+(s-a)**2),Math.sqrt((i-l)**2+(s-r)**2)),p[t]=(l-n)/(a-r)}let _=Object.keys(u).map(t=>({label:t-1,boundary:o[t],area:h[t],center:u[t],maxPoint:d[t],maxR:c[t],ratio:p[t]}));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;let y=~~(m.reduce((t,e)=>t+e[0],0)/m.length),v=~~(m.reduce((t,e)=>t+e[1],0)/m.length),b=~~Math.max(Math.sqrt((y-g.x1)**2+(v-g.y1)**2),Math.sqrt((y-g.x2)**2+(v-g.y2)**2),Math.sqrt((y-g.x1)**2+(v-g.y2)**2),Math.sqrt((y-g.x2)**2+(v-g.y1)**2)),x=g.width/g.height,S=Object.keys(h).reduce((t,e)=>t+h[e],0),A={regions:_,labels:r,labelNumber:a-1};if(t.blur){let i=t.blur,s=function(t,e,i,s){let r=Math.ceil(s/2),a=function(t,e){let i=Array(2*t+1).fill(0),s=0;for(let r=-t;r<=t;r++){let a=Math.exp(-r*r/(2*e*e));i[r+t]=a,s+=a}for(let t=0;t<i.length;t++)i[t]/=s;return i}(r,s/3),n=Array(t.length).fill(0),l=Array(t.length).fill(0);for(let s=0;s<i;s++)for(let i=0;i<e;i++){let l=0;for(let n=-r;n<=r;n++)l+=t[s*e+Math.min(Math.max(i+n,0),e-1)]*a[n+r];n[s*e+i]=l}for(let t=0;t<e;t++)for(let s=0;s<i;s++){let o=0;for(let l=-r;l<=r;l++)o+=n[Math.min(Math.max(s+l,0),i-1)*e+t]*a[l+r];l[s*e+t]=Math.max(0,Math.min(1,o))}return l}(r,e[0],e[1],i);
2(function(t,e,i,s,r=1){let a=Array(t.length).fill(0);for(let[t,n]of e)if(a[t*i+n]=1,r>1){for(let e=1-r;e<=r-1;e++)for(let l=1-r;l<=r-1;l++)if(Math.sqrt(e*e+l*l)<r){let r=t+e,o=n+l;r>=0&&r<s&&o>=0&&o<i&&(a[r*i+o]=1)}}return a})(r,f,e[0],e[1],Math.ceil(i/2)).forEach((t,e)=>{1===t&&(r[e]=s[e])})}return Object.assign(t,{segmentation:A,shapeBounds:g,shapeMaxR:b,shapeRatio:x,shapeCenter:[y,v],shapeArea:S})}(k);if(!M.segmentation.regions.length)return;let w=this.options,T=this.data,C=w.colorMode||"ordinal",B={getText:EE(w.text),getFontSize:EE(w.fontSize),fontSizeRange:w.fontSizeRange,colorMode:C,getColor:w.colorField?EE(w.colorField):EE(w.text),getFillingColor:EE(w.fillingColorField),colorList:w.colorList||("ordinal"===C?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:EE(w.colorHexField),getFontFamily:EE(w.fontFamily||"sans-serif"),rotateList:w.rotateList||[0],getPadding:EE(w.padding||1),getFontStyle:EE(w.fontStyle||"normal"),getFontWeight:EE(w.fontWeight||"normal"),getFontOpacity:w.fontOpacity?EE(w.fontOpacity):()=>1};EL(T,B,M);let E={size:w.size,ratio:w.ratio||.8,measureCache:null!=(t=w.measureCache)?t:new Ey,shapeUrl:w.shape,random:void 0===w.random||w.random,textLayoutTimes:null!=(e=w.textLayoutTimes)?e:3,removeWhiteBorder:w.removeWhiteBorder,layoutMode:null!=(i=w.layoutMode)?i:"default",fontSizeShrinkFactor:null!=(s=w.fontSizeShrinkFactor)?s:.8,stepFactor:null!=(r=w.stepFactor)?r:1,importantWordCount:null!=(a=w.importantWordCount)?a:10,globalShinkLimit:w.globalShinkLimit||.2,fontSizeEnlargeFactor:null!=(n=w.fontSizeEnlargeFactor)?n:1.5,fillingRatio:null!=(l=w.fillingRatio)?l:.7,fillingTimes:null!=(o=w.fillingTimes)?o:4,fillingXStep:w.fillingXRatioStep?Math.max(Math.floor(w.size[0]*w.fillingXRatioStep),1):null!=(h=w.fillingXStep)?h:4,fillingYStep:w.fillingYRatioStep?Math.max(Math.floor(w.size[1]*w.fillingYRatioStep),1):null!=(u=w.fillingYStep)?u:4,fillingInitialFontSize:w.fillingInitialFontSize,fillingDeltaFontSize:w.fillingDeltaFontSize,fillingInitialOpacity:null!=(d=w.fillingInitialOpacity)?d:.8,fillingDeltaOpacity:null!=(c=w.fillingDeltaOpacity)?c:.05,getFillingFontFamily:EE(w.fillingFontFamily||"sans-serif"),getFillingFontStyle:EE(w.fillingFontStyle||"normal"),getFillingFontWeight:EE(w.fillingFontWeight||"normal"),getFillingPadding:EE(null!=(p=w.fillingPadding)?p:.4),fillingRotateList:null!=(g=w.fillingRotateList)?g:[0,90],fillingDeltaFontSizeFactor:null!=(f=w.fillingDeltaFontSizeFactor)?f:.2,fillingColorList:w.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!=(m=w.minInitFontSize)?m:10,minFontSize:null!=(_=w.minFontSize)?_:4,minFillFontSize:null!=(y=w.minFillFontSize)?y:2},P=((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<t.length;i++)if(t[i]!==e[i])return!1;return!0})(B.colorList,E.fillingColorList);E.sameColorList=P,EI(T,B,E,w),function(t,e,i,s){let{getText:r}=e,{fillingInitialFontSize:a,fillingDeltaFontSize:n}=i,{fillingRatio:l}=i,o=Math.ceil(Math.sqrt(s.shapeArea)/4);if(!a||!n){let e,h=t.reduce((t,e)=>{let i=Eb(r(e));return i>o?t:t+i},0)/t.length;a=~~(e=0===h?8:Math.sqrt(.2*s.shapeArea/h*(l/100))),n=e*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:a,fillingDeltaFontSize:n})}}(T,B,E,M);let{getText:O,getFontFamily:R,getFontStyle:I,getFontWeight:L,getPadding:D,getColor:F,getFillingColor:z,getColorHex:H,fontSizeScale:j,colorScale:V,fillingColorScale:N,getFontOpacity:W,rotateList:U}=B,G=T.map(t=>{var e,i;return{x:0,y:0,weight:0,text:O(t),fontFamily:R(t),fontWeight:L(t),fontStyle:I(t),rotate:U[~~(k.randomGenerator()*U.length)],fontSize:Math.max(E.minInitFontSize,~~j(t)),opacity:W(t),padding:D(t),color:H&&H(t)||V&&V(F(t))||"black",fillingColor:!z||(null==(e=w.colorField)?void 0:e.field)===(null==(i=w.fillingColorField)?void 0:i.field)&&P?void 0:H&&H(t)||N&&N(z(t))||"black",datum:t,visible:!0,hasPlaced:!1}}),Y=ok(G.map(t=>t.fontSize));G.forEach(t=>t.weight=t.fontSize/Y),G.sort((t,e)=>e.weight-t.weight);let{fillingWords:$,successedWords:X,failedWords:K}
2=function(t,e,i){(function(t,e){let{segmentation:{regions:i}}=e,s=-1/0,r=0,a=0;i.forEach((t,e)=>{let i=t.area;i>s&&(s=i,a=e),r+=i});let n=0;i.forEach(e=>{let i=e.area,a=Math.ceil(i/r*t.length),l=i/s;e.words=[],e.regionNum=a,e.regionWeight=l,n+=a}),n<t.length&&(i[a].wordsNum+=t.length-n);let l=a,o=i.map(t=>t.regionNum);t.forEach(t=>{let e=0,s=0;t.regionIndex=-1;do{if(o[l]>0&&t.weight<=i[l].regionWeight){t.regionIndex=l,i[l].words.push(t),o[l]--,l=(l+1)%i.length;break}l=(l+1)%i.length,e++,++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=a,i[a].words.push(t),o[a]--)}),i.forEach(t=>{t.words.sort((t,e)=>e.weight-t.weight)})})(t,i),"ensureMapping"===e.layoutMode?Ex(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){let{size:s,stepFactor:r,importantWordCount:a}=e,{segmentation:{regions:n},tempCanvas:l,boardSize:o,shapeCenter:h,shapeMaxR:u,shapeRatio:d}=i,c=l.getContext("2d",{willReadFrequently:!0}),p=ET(i),g=p.slice(0),f=e.fontSizeEnlargeFactor,m=Math.min(a,t.length),_=0;t.length>m&&(_=t.sort((t,e)=>e.weight-t.weight)[m-1].weight);let y=0,v=1,b=!1;for(let a=0;a<n.length;a++){let{words:h,center:u,maxR:d,ratio:x}=n[a],S=!1;for(let a=0;a<h.length;a++){EM(l,c,t,a,e.measureCache);let n=h[a];if(n.x=u[0],n.y=u[1],n.hasText&&n.sprite&&ES(g,n,d,x,s,o,r)){if(n.hasPlaced=!0,n.weight>=_&&y++,y>=m&&!b){v*=f,t.forEach(t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*f}),g=p.slice(0),S=!0,y=0;break}}else{if(n.weight>=_&&v>1){t.forEach(t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/f}),v/=f,b=!0,g=p.slice(0),S=!0;break}if(n.weight>=_)return Ex(t,e,i)}}S&&(a=-1)}for(let i=0;i<e.textLayoutTimes;i++){let i=t.filter(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;t<i.length;t++){let a=i[t];EM(l,c,i,t,e.measureCache),a.x=h[0],a.y=h[1],a.hasText&&ES(g,a,u,d,s,o,r)&&(a.hasPlaced=!0)}}e.board=g}(t,e,i):function(t,e,i){let{size:s,stepFactor:r}=e,{segmentation:{regions:a},tempCanvas:n,boardSize:l,shapeCenter:o,shapeMaxR:h,shapeRatio:u}=i,d=ET(i),c=n.getContext("2d",{willReadFrequently:!0});for(let i of a){let{words:a,center:o,maxR:h,ratio:u}=i;for(let i=0;i<a.length;i++){EM(n,c,t,i,e.measureCache);let p=a[i];p.x=o[0],p.y=o[1],p.hasText&&p.sprite&&ES(d,p,h,u,s,l,r)&&(p.hasPlaced=!0)}}for(let i=0;i<e.textLayoutTimes;i++){let i=t.filter(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;t<i.length;t++){let a=i[t];EM(n,c,i,t,e.measureCache),a.x=o[0],a.y=o[1],a.hasText&&ES(d,a,h,u,s,l,r)&&(a.hasPlaced=!0)}}e.board=d}(t,e,i);let s=function(t,e,i){let{size:s,fillingTimes:r,fillingXStep:a,fillingYStep:n,getFillingFontStyle:l,getFillingFontWeight:o,getFillingFontFamily:h,fillingInitialFontSize:u,fillingDeltaFontSize:d,fillingInitialOpacity:c,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:m,board:_,minFillFontSize:y}=e,{boardSize:v,shapeBounds:b,tempCanvas:x,randomGenerator:S}=i,A=x.getContext("2d",{willReadFrequently:!0}),k=u,M=c,w=[];for(let i=0;i<r;i++)(function(i,r){let u=t.map(t=>{let{text:e,color:s,fillingColor:a,hasPlaced:n,datum:u}=t;return{x:0,y:0,weight:0,text:e,fontFamily:h(u),fontStyle:l(u),fontWeight:o(u),fontSize:i,rotate:g[~~(S()*g.length)],padding:f(u),opacity:r,visible:!0,color:s,fillingColor:a,hasPlaced:n,datum:u}});T(u);let d=0,{x1:c,y1:p,x2:y,y2:k}=b,[M,C]=[c+~~(S()*a*2),p+~~(S()*n*2)];for(let t=C;t<=k;t+=n)for(let i=M;i<=y;i+=a){EM(x,A,u,d,e.measureCache);let r=u[d];r.x=i,r.y=t;let{wordSize:a,bounds:n,hasPlaced:l}=r;if(!l||!n){++d===u.length&&(d=0,m&&T(u));continue}let{dTop:o,dBottom:h,dLeft:c,dRight:p}=n;r.x-c<0||r.x+p>s[0]||r.y-o<0||r.y+h>s[1]||r.hasText&&r.sprite&&!Ek(r,_,v)&&(EA(r,_,v),w.push(Object.assign({},r)),++d===u.length&&(d=0,m&&T(u)))}})(k,M),k=Math.max(k>d?k-d:d,y),M=M>p?M-p:p;return w;function T(t){return t.sort(()=>S()-.5)}}(t,e,i),r=[],a=[];for(let e=0;e<t.length;e++)t[e].hasPlaced?a.push(t[e]):r.push(t[e]);return r.forEach(t=>t.visible=!1),{fillingWords:s,successedWords:a,failedWords:r}}(G,E,M),q=null!=(b=null==(v=w.text)?void 0:v.field)?b:"textKey",Z=null!=(x=w.dataIndexKey)?x:"defaultDataIndexKey",J=w.as?Object.assign(Object.assign({},EO),w.as):EO,Q=[];for(let t=0;t<G.length;++t)(A=(S=G[t]).datum)[J.x]=S.x,A[J.y]=S.y,A[J.fontFamily]=S.fontFamily,A[J.fontSize]=S.fontSize,A[J.fontStyle]=S.fontStyle,A[J.fontWeight]=S.fontWeight,A[J.angle]=iC(S.rotate),A[J.opacity]=S.opacity,A[J.visible]=S.visible,A[J.isFillingWord]=!1,A[J.color]=S.color,A[Z]=`${S.text}_${t}_keyword`,Q.push(A);let tt=[];$.forEach((t,e)=>{var i,s;let r=Object.assign({},t.datum);r[J.x]=t.x,r[J.y]=t.y,r[J.fontFamily]=t.fontFamily,r[J.fontSize]=t.fontSize,r[J.fontStyle]=t.fontStyle,r[J.fontWeight]=t.fontWeight,r[J.angle]=iC(t.rotate),r[J.opacity]=t.o
2pacity,r[J.visible]=t.visible,r[J.isFillingWord]=!0,r[J.color]=z?(null==(i=w.colorField)?void 0:i.field)===(null==(s=w.fillingColorField)?void 0:s.field)&&P?t.color:t.fillingColor:E.fillingColorList[~~(k.randomGenerator()*E.fillingColorList.length)],r[q]=t.text,r[Z]=`${t.text}_${e}_fillingWords`,tt.push(r)}),this.options.onLayoutFinished&&this.options.onLayoutFinished({successedWords:X,failedWords:K}),this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}let EI=(t,e,i,s)=>{var r,a,n,l;let{colorMode:o,getColor:h,getFillingColor:u}=e,{sameColorList:d}=i,c,p,g=e.colorList,f=i.fillingColorList;if("ordinal"===o){let e=t.map(t=>h(t));if(c=t=>(new mS).domain(e).range(g).scale(t),u&&((null==(r=s.colorField)?void 0:r.field)!==(null==(a=s.fillingColorField)?void 0:a.field)||!d)){let e=t.map(t=>u(t));p=t=>(new mS).domain(e).range(f).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);let e=(new mb).domain(EF(h,t)).range(g);if(c=t=>e.scale(t),u&&((null==(n=s.colorField)?void 0:n.field)!==(null==(l=s.fillingColorField)?void 0:l.field)||!d)){1===f.length&&(f=[f[0],f[0]]);let e=(new mb).domain(EF(u,t)).range(f);p=t=>e.scale(t)}}Object.assign(e,{colorScale:c,fillingColorScale:p})},EL=(t,e,i)=>{let s,{fontSizeRange:r}=e,{getFontSize:a,getText:n}=e;if(a){if(a&&r){let e=(new EP).domain(EF(a,t)).range(r);s=t=>e.scale(a(t))}else if(a&&(0,r3.A)(a)&&!r){let[e,l]=EF(a,t),o=ED(t.map(t=>({text:n(t),value:a(t),weight:l===e?1:(a(t)-e)/(l-e)})),i,!0);r=[~~(.5*o),~~o];let h=(new EP).domain(EF(a,t)).range(r);s=t=>h.scale(a(t))}}else{var l;s="function"==typeof(l=ED(t.map(t=>({text:n(t)})),i,!1))?l:function(){return l}}Object.assign(e,{getFontSize:a,fontSizeRange:r,fontSizeScale:s})},ED=(t,e,i)=>{let s=e.shapeArea,r=e.ratio,a=e.segmentation.regions,n=Math.ceil(Math.sqrt(s)/12),l=t.reduce((t,e)=>{let s=Eb(e.text);return s<n?t+s*(i?(.5+.5*e.weight)**2:1):t},0);if(0===l)return 12;let o=20;if(1===a.length)o=Math.sqrt(s/(1.7*l)*r);else{let t=[];for(let e=0;e<a.length;e++){let i=a[e].area,n=a[e].ratio,o=i/s;if(o<.1)continue;let h=Math.sqrt(i/(l*(n<1?2.7-n:1.7)*o)*r);t.push(h)}o=t.length?Math.min(...t):Math.sqrt(s/(1.7*l)*r)}return o},EF=(t,e)=>{let i,s=1/0,r=-1/0,a=e.length;for(let n=0;n<a;++n)(i=m_(t(e[n])))<s&&(s=i),i>r&&(r=i);return 1===e.length&&s===r&&(s-=1e4),[s,r]},Ez=(t,e,i)=>{if(!t.size||(0,eE.A)(t.size[0])||(0,eE.A)(t.size[1])||t.size[0]<=0||t.size[1]<=0)return eg.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||eg.getInstance().error("WordcloudShape shape must be specified."),t.text||eg.getInstance().error("WordcloudShape text must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let s=new ER(t);return s.layout(e),s.unfinished()?{progressive:s}:s.output()};class EH extends B1{constructor(){super(...arguments),this.type=dD.wordCloud}}EH.type=dD.wordCloud;let Ej=()=>{uP.registerGrammarTransform("wordcloud",{transform:Ep}),Bd(),B2(),uP.registerSeries(EH.type,EH)};class EV extends BY{constructor(){super(...arguments),this.transformerConstructor=BG,this.type="wordCloud",this.seriesType=dD.wordCloud}}EV.type="wordCloud",EV.seriesType=dD.wordCloud,EV.transformerConstructor=BG;let EN=(t,e)=>{var i,s;let r=t.map(t=>Object.assign({},t));if(!r||0===r.length)return r;let{valueField:a,asTransformRatio:n,asReachRatio:l,asHeightRatio:o,asValueRatio:h,asNextValueRatio:u,asLastValueRatio:d,asLastValue:c,asCurrentValue:p,asNextValue:g,heightVisual:f=!1,isCone:m=!0,range:_}=e,y=r.reduce((t,e)=>Math.max(t,Number.parseFloat(e[a])||-1/0),-1/0),v=r.reduce((t,e)=>Math.min(t,Number.parseFloat(e[a])||1/0),1/0),b=[null!=(i=null==_?void 0:_.min)?i:v,null!=(s=null==_?void 0:_.max)?s:y];return r.forEach((t,e)=>{var i,s;let _=Number.parseFloat(t[a]),y=Number.parseFloat(null==(i=r[e-1])?void 0:i[a]),v=Number.parseFloat(null==(s=r[e+1])?void 0:s[a]),x=eP(v*_)&&0!==_?v/_:0,S=eP(_*y)&&0!==y?_/y:0;c&&(t[c]=y),g&&(t[g]=v),n&&(t[n]=x),l&&(t[l]=0===e?1:S),o&&(t[o]=!0===f?x:1/r.length),h&&(t[h]=_/b[1]),u&&(t[u]=e===r.length-1?m?0:t[h]:v/b[1]),d&&(t[d]=0===e?1:y/b[1]),p&&(t[p]=_)}),r},EW=(t,e)=>{var i,s;let r=null==(s=null==(i=t[0])?void 0:i.latestData)?void 0:s.map(t=>Object.assign({},t));return r&&0!==r.length&&(r.shift(),r.forEach(t=>{t[e.asIsTransformLevel]=!0})),r},EU=`${px.H}_FUNNEL_TRANSFORM_RATIO`,EG=`${px.H}_FUNNEL_REACH_RATIO`,EY=`${px.H}_FUNNEL_HEIGHT_RATIO`,E$=`${px.H}_FUNNEL_VALUE_RATIO`,EX=`${px.H}_FUNNEL_LAST_VALUE_RATIO`,EK=`${px.H}_FUNNEL_NEXT_VALUE_RATIO`,Eq=`${px.H}_FUNNEL_LAST_VALUE`,EZ=`${px.H}_FUNNEL_CURRENT_VALUE`,EJ=`${px.H}_FUNNEL_NEXT_VALUE`,EQ=`${px.H}_FUNNEL_TRANSFORM_LEVEL`;class E0 extends bt{constructor(t){var e,i;super(t),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,r;let a=this.series;return"transform"===(null==(i=null==e?void 0:e.mark)?void 0:i.name)?this._transformRatioText:null!=(s=this._getDimensionData(t))?s:null==(r=t.properties)?void 0:r[`${a.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null==(i=null==e?void 0:e.mark)?void 0:i.name)?`${(100*(null==t?void 0:t[EG])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null==(i=null==e?void 0:e.mark)?void 0:i.name))return this._transformRatioText;let{dimensionFields:s,seriesFields:r}=this._seriesCacheInfo,a=s[s.length-1];return(0,eA.A)(r[0])?null==t?void 0:t[r[0]]:null==t?void 0:t[a]},this._transformRatioText=null!=(i=null==(e=t.getSpec())?void 0:e.transformRatioText)?i:"转åç"}}class E1 extends _x{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}
2class E2 extends E1{constructor(){super(...arguments),this.type=E2.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}E2.type="polygon";let E3=()=>{uP.registerMark(E2.type,E2),_k(),A4(),y_.registerBuiltInAnimate("growPointsOut",vl),uP.registerGraphicComponent("polygon",AG)},E5=Object.assign(Object.assign({},bc),{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"}});class E4 extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}let E8=((g={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"}}}).transform={style:{fill:{type:"palette",key:"axisGridColor"}}},g);class E6 extends bC{constructor(){super(...arguments),this.type=dD.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=E4,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,r;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!=(t=this._spec.funnelOrient)?t:"top",this._shape=null!=(e=this._spec.shape)?e:"trapezoid",this._minLabelLineWidth=null!=(r=null==(s=null==(i=this._spec.outerLabel)?void 0:i.line)?void 0:s.minLength)?r: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;c3(this._dataSet,"funnel",EN),c3(this._dataSet,"funnelTransform",EW);let t=new eR(this._dataSet,{name:`${px.H}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new mz(this._option,t)}compile(){var t,e;super.compile(),this._funnelOuterLabelMark&&(null==(t=this._funnelOuterLabelMark.label)||t.compile({group:this._rootMark.getProduct()}),null==(e=this._funnelOuterLabelMark.line)||e.compile({group:this._rootMark.getProduct()}))}compileData(){var t;super.compileData(),null==(t=this._viewDataTransform)||t.compile()}getStatisticFields(){let t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,r,a,n,l,o;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:EZ,asTransformRatio:EU,asReachRatio:EG,asHeightRatio:EY,asValueRatio:E$,asNextValueRatio:EK,asLastValueRatio:EX,asLastValue:Eq,asNextValue:EJ,range:{min:null!=(e=null==(t=this._spec.range)?void 0:t.min)?e:null==(s=null==(i=this.getViewDataStatistics().latestData)?void 0:i[this.getValueField()])?void 0:s.min,max:null!=(a=null==(r=this._spec.range)?void 0:r.max)?a:null==(l=null==(n=this.getViewDataStatistics().latestData)?void 0:n[this.getValueField()])?void 0:l.max}}}),null==(o=this._viewDataTransform.getDataView())||o.transform({type:"funnelTransform",options:{asIsTransformLevel:EQ}})}initMark(){var t,e,i,s,r,a,n,l;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},E6.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null==(t=this._theme)?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:bk(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},E6.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null==(e=this._theme)?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null==(s=null==(i=this._spec)?void 0:i.outerLabel)?void 0:s.visible){let{line:t}=null!=(r=this._spec.outerLabel)?r:{},{line:e}=null!=(n=null==(a=this._theme)?void 0:a.outerLabel)?n:{};this._funnelOuterLabelMark.label=this._createMark(E6.mark.outerLabel,{themeSpec:null==(l=this._theme)?void 0:l.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(E6.mark.outerLabelLine,{themeSpec:e,markSpec:t,noSeparateStyle:!0,parent:!1})}}initTooltip(){this._tooltipHelper=new E0(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(){var t,e,i,s;let r=this._funnelMark;r&&this.setMarkStyle(r,{points:t=>this.getPoints(t),visible:t=>(0,eA.A)(t[this._valueField]),fill:this.getColorAttribute()},"normal",N.Series);let a=this._funnelTransformMark;a&&this.setMarkStyle(a,{points:t=>this.getPoints(t)},"normal",N.Series);let n=this._funnelOuterLabelMark.label;n&&(this.setMarkStyle(n,{text:t=>`${t[this.getCategoryField()]}`,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),width:0,height:0},"normal",N.Series),(0,r3.A)(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(n,{text:t=>this._spec.outerLabel.formatMethod(`${t[this.getCategoryField()]}`,t)},"normal",N.User_Mark));let l=this._funnelOuterLabelMark.line;if(l&&n){this.setMarkStyle(l,{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",N.Series);let r=null!=(i=null==(e=null==(t=this._spec.outerLabel)?void 0:t.line)?void 0:e.visible)?i:null==(s=this._spec.outerLabel)?void 0:s.visible;(0,eA.A)(r)&&l.setVisible(r)}}initLabelMarkStyle(t){var e;if(!t)return;let i=t.getTarget(),s=t.getComponent();if(i===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",N.Series);let i=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&kH(i,this._funnelOuterLabelMark.label,s),this._funnelOuterLabelMark.line&&kH(i,this._funnelOuterLabelMark.line,null!=(e=this._funnelOuterLabelMark.label)?e:s)}else this._funnelTransformMark&&i===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*hD(EG).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",N.Series))}initAnimation(){var t,e,i,s,r,a,n;let l=null!=(i=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset)?i:"clipIn";"clipIn"===l&&this._rootMark&&this._rootMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("cartesianGroupClip"))?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{let t=this.getRootMark().getProduct();if(t){let{x1:e,x2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{let t=this.getRootMark().getProduct();if(t){let{y1:e,y2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},l),bx("group",this._spec,this._markAttributeContext))),[null==(r=this._funnelOuterLabelMark)?void 0:r.label].forEach(t=>{t&&t.setAnimationConfig(bb(uP.getAnimationInKey("fadeInOut")(),bx(t.name,this._spec,this._markAttributeContext)))}
2),[this._funnelMark,this._funnelTransformMark].forEach(t=>{t&&t.setAnimationConfig(bb(uP.getAnimationInKey("funnel")({},l),bx(t.name,this._spec,this._markAttributeContext)))}),(null==(a=this._funnelOuterLabelMark)?void 0:a.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(bb(null==(n=uP.getAnimationInKey("fadeInOut"))?void 0:n(),bx("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null==(t=this._viewDataTransform.getDataView())||t.target.addListener("change",t=>{this._viewDataTransform.updateData()})}getPoints(t){let e,i,s=this.isTransformLevel(t),r=this._getMainAxisLength(s)/2;s?(e="rect"===this._shape?this._getSecondaryAxisLength(t[EX])/2:this._getSecondaryAxisLength(t[E$])/2,i=this._getSecondaryAxisLength(t[E$])/2):(e=this._getSecondaryAxisLength(t[E$])/2,i="rect"===this._shape?e:this._getSecondaryAxisLength(t[EK])/2);let{x:a,y:n}=this._getPositionByData(t),l=this._getPolygonPoints([a,n],e,i,e,i,r);return"center"!==this._funnelAlign&&this._adjustPoints(l),l}isTransformLevel(t){return!!(null==t?void 0:t[EQ])}_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;let r=null==(s=null==(i=null==(e=this.getViewData())?void 0:e.latestData)?void 0:i.find)?void 0:s.call(i,e=>e[this._categoryField]===t);return(0,eA.A)(r)?this._getPolygonCenter(this.getPoints(r)):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.x}dataToPositionY(t){var e;return null==(e=this.dataToPosition(t))?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;let i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,r=!!this._spec.isTransform,a=r?0:null!=(e=this._spec.gap)?e:0,n=r?Math.max(0,i-1):0,l=this._spec.heightRatio||.5,o=(s-a*Math.max(0,i-1))/(i+l*n);return t?r?o*l:0:o}_getSecondaryAxisLength(t){let e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;let i=null==(e=this.getViewData().latestData)?void 0:e.findIndex(e=>e[this._categoryField]===t[this._categoryField]&&e[pA]===t[pA]);if(!(0,eA.A)(i)||i<0)return{};let s=this.isTransformLevel(t),r=this._isHorizontal(),a=r?this.getLayoutRect().height:this.getLayoutRect().width,n=r?this.getLayoutRect().width:this.getLayoutRect().height,l=a/2,o=0,h=this._getMainAxisLength(),u=this._getMainAxisLength(!0);return o+=i*(h+u)+(s?-u/2:h/2),!this._spec.isTransform&&this._spec.gap&&(o+=this._spec.gap*i),this._isReverse()&&(o=n-o),this._isHorizontal()?{x:o,y:l}:{x:l,y:o}}_getPolygonPoints(t,e,i,s,r,a){let n=t[0],l=t[1];switch(this._funnelOrient){case"left":return[{x:n-a,y:l+e},{x:n-a,y:l-s},{x:n+a,y:l-r},{x:n+a,y:l+i}];case"right":return[{x:n+a,y:l-s},{x:n+a,y:l+s},{x:n-a,y:l+i},{x:n-a,y:l-i}];case"bottom":return[{x:n+e,y:l+a},{x:n-s,y:l+a},{x:n-r,y:l-a},{x:n+i,y:l-a}];default:return[{x:n-e,y:l-a},{x:n+s,y:l-a},{x:n+r,y:l+a},{x:n-i,y:l+a}]}}_getPolygonCenter(t){if(this._isHorizontal()){let 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}}let 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){let e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){let i=null==e?void 0:e.limit;if(ed(i))return i;let 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,r,a=null==(e=this._spec.outerLabel)?void 0:e.position,n="center",l="middle";if(a=this._isHorizontal()?["top","bottom"].includes(a)?a:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(a)?a:"left"===this._funnelAlign?"right":"left",!1!==(null==(i=this._spec.outerLabel)?void 0:i.alignLabel))({x:s,y:r}=this._getPositionByData(t)),"left"===a?(s=0,n="left"):"right"===a?(s=this.getLayoutRect().width,n="right"):"top"===a?(r=0,l="top"):"bottom"===a&&(r=this.getLayoutRect().height,l="bottom");else{let{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,r=i,"left"===a?(s-=5,n="right"):"right"===a?(s+=5,n="left"):"top"===a?(r-=5,l="bottom"):"bottom"===a&&(r+=5,l="top")}return{x:s,y:r,align:n,textBaseline:l}}_computeOuterLabelLimit(t){var e,i,s,r,a,n;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));let l=this.getPoints(t),o=(Math.abs(l[0].x-l[1].x)+Math.abs(l[2].x-l[3].x))/2,h=this.getCategoryField(),u=null==(r=null==(s=null==(i=null==(e=this._labelMark)?void 0:e.getComponent())?void 0:i.getComponent())?void 0:s.find(({attribute:e,type:i})=>{var s;return"text"===i&&(null==(s=e.data)?void 0:s[h])===t[h]}
2,!0))?void 0:r.AABBBounds,d=u?u.x2-u.x1:0,c=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0,p=this.getLayoutRect().width-Math.max(o,d);return"center"===this._funnelAlign&&(p/=2),p-c-(null!=(n=null==(a=this._spec.outerLabel)?void 0:a.spaceWidth)?n:5)}_computeOuterLabelLinePosition(t){var e,i,s,r,a,n,l,o,h,u;let d,c,p,g,f=this.getCategoryField(),m=null==(r=null==(s=null==(i=null==(e=this._funnelOuterLabelMark)?void 0:e.label)?void 0:i.getGraphics())?void 0:s.find(e=>{var i;return(null==(i=e.context.data[0])?void 0:i[f])===t[f]}))?void 0:r.AABBBounds,_=null==(n=null==(a=this._labelMark)?void 0:a.getComponent())?void 0:n.getComponent(),y=null==(l=null==_?void 0:_.find(({attribute:e,type:i})=>{var s;return"text"===i&&(null==(s=e.data)?void 0:s[f])===t[f]},!0))?void 0:l.AABBBounds,v=null!=(o=this._spec.outerLabel)?o:{};if(this._isHorizontal()){let e=null!=(h=v.spaceWidth)?h: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?(p=this._getPolygonCenter(i).y-s/2-e,g=!1!==v.alignLabel?(null==m?void 0:m.y2)+e:p-e,d=this._getPolygonCenter(i).x,p-g<this._minLabelLineWidth&&(g=p-this._minLabelLineWidth)):(p=this._getPolygonCenter(i).y+s/2+e,g=!1!==v.alignLabel?(null==m?void 0:m.y1)-e:p+e,d=this._getPolygonCenter(i).x,g-p<this._minLabelLineWidth&&(g=p+this._minLabelLineWidth)),c=d,{x1:d,x2:c,y1:p,y2:g}}let b=this.getPoints(t),x=(Math.abs(b[0].x-b[1].x)+Math.abs(b[2].x-b[3].x))/2,S=(null==y?void 0:y.x2)-(null==y?void 0:y.x1)||0,A=null!=(u=v.spaceWidth)?u:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(d=this._getPolygonCenter(b).x+Math.max(S/2,x/2)+A,c=!1!==v.alignLabel?(null==m?void 0:m.x1)-A:d+A,p=this._getPolygonCenter(b).y,c-d<this._minLabelLineWidth&&(c=d+this._minLabelLineWidth)):(d=this._getPolygonCenter(b).x-Math.max(S/2,x/2)-A,c=!1!==v.alignLabel?(null==m?void 0:m.x2)+A:d-A,p=this._getPolygonCenter(b).y,d-c<this._minLabelLineWidth&&(c=d-this._minLabelLineWidth)),g=p,{x1:d,x2:c,y1:p,y2:g}}_computeMaxSize(){var t;let e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return hU(null!=(t=this._spec.maxSize)?t:"80%",e)}_computeMinSize(){var t;let e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return hU(null!=(t=this._spec.minSize)?t:0,e)}_isHorizontal(){return"left"===this._funnelOrient||"right"===this._funnelOrient}_isReverse(){return"bottom"===this._funnelOrient||"right"===this._funnelOrient}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._funnelMark]}}E6.type=dD.funnel,E6.mark=E5,E6.builtInTheme={funnel:E8},E6.transformerConstructor=E4;class E9 extends Ms{needAxes(){return!1}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","funnelAlign","funnelOrient","heightRatio","shape","funnel","transform","outerLabel","transformLabel","isTransform","maxSize","minSize","gap","isCone","range","transformRatioText"])}transformSpec(t){super.transformSpec(t),super.transformSeriesSpec(t)}}class E7 extends Mu{constructor(){super(...arguments),this.transformerConstructor=E9,this.type="funnel",this.seriesType=dD.funnel}}E7.type="funnel",E7.seriesType=dD.funnel,E7.transformerConstructor=E9;let Pt={type:"fadeIn"};function Pe(t,e="grow"){return!1===e?{}:"fadeIn"===e?Pt:{type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:()=>"vertical"===t.direction?{orient:"negative"}:{orient:"positive"}}}class Pi extends bt{enableByType(t){return"dimension"!==t}}let Ps=Object.assign(Object.assign({},bc),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}});class Pr extends bP{constructor(){super(...arguments),this.type=dD.linearProgress,this._progressMark=null,this._trackMark=null,this._defaultProgressCu
2stomShape=(t,e,i)=>{var s,r;let a=null==(s=this._spec)?void 0:s.cornerRadius,n=(0,eA.A)(e.width)?e.width:e.x1-e.x,l=(0,eA.A)(e.height)?e.height:e.y1-e.y,o=Math.min(0,n),h=Math.max(0,n),u=Math.min(0,l),d=Math.max(0,l);if(a>0){let t=a;if("vertical"===(null==(r=this._spec)?void 0:r.direction)){if(2*(t=Math.min(Math.abs(n/2),a))>Math.abs(l)){let e=Math.acos((t-Math.abs(l)/2)/t);return i.moveTo(o+t,u),i.arc(o+t,u+t,t,1.5*Math.PI,1.5*Math.PI-e,!0),i.arc(o+t,d-t,t,e+Math.PI/2,Math.PI/2,!0),i.lineTo(h-a,d),i.arc(h-t,d-t,t,Math.PI/2,Math.PI/2-e,!0),i.arc(h-t,u+t,t,-Math.PI/2+e,-Math.PI/2,!0),i.lineTo(o+t,u),i.closePath(),i}}else if(2*(t=Math.min(Math.abs(l/2),a))>Math.abs(n)){let e=Math.acos((t-Math.abs(n)/2)/t);return i.moveTo(o,u+t),i.arc(o+t,u+t,t,Math.PI,Math.PI+e),i.arc(h-t,u+t,t,-e,0),i.lineTo(h,d-t),i.arc(h-t,d-t,t,0,e),i.arc(o+t,d-t,t,Math.PI-e,Math.PI),i.closePath(),i}i.moveTo(o,u+t),i.arc(o+t,u+t,t,Math.PI,1.5*Math.PI),i.lineTo(h-t,u),i.arc(h-t,u+t,t,-Math.PI/2,0),i.lineTo(h,d-t),i.arc(h-t,d-t,t,0,Math.PI/2),i.lineTo(o+t,d),i.arc(o+t,d-t,t,Math.PI/2,Math.PI),i.closePath()}else i.moveTo(o,u),i.lineTo(h,u),i.lineTo(h,d),i.lineTo(o,d),i.closePath();return i}}initMark(){this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t;return this._progressMark=this._createMark(Pr.mark.progress,{isSeriesMark:!0}),(0,eE.A)(null==(t=this._spec.progress)?void 0:t.customShape)&&this._progressMark.setMarkConfig({setCustomizedShape:this._defaultProgressCu
2stomShape}),this._progressMark}_initProgressMarkStyle(){var t,e,i,s;let r=this._progressMark;if(r)if("vertical"===this._spec.direction){let i=this._spec.progress||{},s=null!=(t=i.leftPadding)?t:0,a=null!=(e=i.rightPadding)?e:0;this.setMarkStyle(r,{x:t=>{var e,i;return mB(this.dataToPositionX(t),null==(i=null==(e=this._xAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0),!0)-this._spec.bandWidth/2+s},y1:t=>{var e,i;return mB(this.dataToPositionY(t),null==(i=null==(e=this._yAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0))},y:()=>{var t,e,i;let s=null==(t=this._yAxisHelper)?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition});return this._spec.clamp?mB(s,null==(i=null==(e=this._yAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0)):s},width:this._spec.bandWidth-s-a,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",N.Series)}else{let t=this._spec.progress||{},e=null!=(i=t.topPadding)?i:0,a=null!=(s=t.bottomPadding)?s:0;this.setMarkStyle(r,{x1:t=>{var e,i;return mB(this.dataToPositionX(t),null==(i=null==(e=this._xAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0))},y:t=>{var i,s;return mB(this.dataToPositionY(t),null==(s=null==(i=this._yAxisHelper)?void 0:i.getScale)?void 0:s.call(i,0),!0)-this._spec.bandWidth/2+e},height:this._spec.bandWidth-e-a,x:()=>{var t,e,i;let s=null==(t=this._xAxisHelper)?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition});return this._spec.clamp?mB(s,null==(i=null==(e=this._xAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0)):s},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",N.Series)}}_initTrackMark(){return this._trackMark=this._createMark(Pr.mark.track),this._trackMark}_initTrackMarkStyle(){let t=this._trackMark;t&&("vertical"===this._spec.direction?this.setMarkStyle(t,{x:t=>{var e,i;return mB(this.dataToPositionX(t),null==(i=null==(e=this._xAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0),!0)-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",N.Series):this.setMarkStyle(t,{x:0,y:t=>{var e,i;return mB(this.dataToPositionY(t),null==(i=null==(e=this._yAxisHelper)?void 0:e.getScale)?void 0:i.call(e,0),!0)-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",N.Series))}getInteractionTriggers(){let t=[];
2return this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initAnimation(){var t,e,i,s;let r={direction:this.direction},a=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._progressMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("linearProgress"))?void 0:i(r,a),bx("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("fadeInOut"))?void 0:s(),bx("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new Pi(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}Pr.type=dD.linearProgress,Pr.mark=Ps,Pr.builtInTheme={linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:{type:"palette",key:"linearProgressTrackColor"},fillOpacity:1}}}};class Pa extends Mr{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;let s=super._getDefaultSeriesSpec(t,["bandWidth","progress","track","clamp"]);return s.direction=null!=(e=t.direction)?e:"horizontal",s.cornerRadius=null!=(i=t.cornerRadius)?i:0,s}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;
2(null!=(e=t.axes)?e:[]).forEach(t=>{let{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)),(0,eE.A)(s.type)&&(s.type="band"),(0,eE.A)(i.type)&&(i.type="linear");let r=SM(i,{min:0,max:1});(0,eE.A)(i.min)&&(i.min=r.min),(0,eE.A)(i.max)&&(i.max=r.max)}else{let e=null,s=null;(null!=(i=t.axes)?i:[]).forEach(t=>{let{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)),(0,eE.A)(s.type)&&(s.type="linear"),(0,eE.A)(e.type)&&(e.type="band");let r=SM(s,{min:0,max:1});(0,eE.A)(s.min)&&(s.min=r.min),(0,eE.A)(s.max)&&(s.max=r.max)}}}class Pn extends Mu{constructor(){super(...arguments),this.transformerConstructor=Pa,this.type="linearProgress",this.seriesType=dD.linearProgress}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}Pn.type="linearProgress",Pn.seriesType=dD.linearProgress,Pn.transformerConstructor=Pa,yg(Pn,Mp);class Pl extends bt{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]]}}let Po=t=>({type:"growCenterIn",options:{direction:"horizontal"===t.direction?"x":"y"}}),Ph={type:"fadeIn"},Pu=Object.assign(Object.assign({},w_),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Pd extends wv{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){var e;"bothEnd"!==(null==(e=t.label)?void 0:e.position)&&this._addMarkLabelSpec(t,"bar")}}class Pc extends wb{constructor(){super(...arguments),this.type=dD.rangeColumn,this._barMarkType="rect",this._barName=dD.bar,this.transformerConstructor=Pd}initMark(){var t,e,i,s,r,a,n,l;this._initBarBackgroundMark();let o=null==(t=this._spec.label)?void 0:t.position;this._barMark=this._createMark(Pc.mark.bar,{groupKey:this._seriesField,isSeriesMark:!0},{morph:bk(this._spec,Pc.mark.bar.name),morphElementKey:this.getDimensionField()[0]}),!1!==(null==(e=this._spec.label)?void 0:e.visible)&&"bothEnd"===o&&(!1!==(null==(s=null==(i=this._spec.label)?void 0:i.minLabel)?void 0:s.visible)&&(this._minLabelMark=this._createMark(Pc.mark.minLabel,{markSpec:null==(r=this._spec.label)?void 0:r.minLabel})),!1!==(null==(n=null==(a=this._spec.label)?void 0:a.maxLabel)?void 0:n.visible)&&(this._maxLabelMark=this._createMark(Pc.mark.maxLabel,{markSpec:null==(l=this._spec.label)?void 0:l.maxLabel})))}initMarkStyle(){var t,e;super.initMarkStyle(),this._initLabelMarkPos(this._minLabelMark,null==(t=this._spec.label)?void 0:t.minLabel,0,"end"),this._initLabelMarkPos(this._maxLabelMark,null==(e=this._spec.label)?void 0:e.maxLabel,1,"start")}_initLabelMarkPos(t,e,i,s){var r,a,n,l,o,h,u,d,c;if(t){this.setMarkStyle(t,{fill:null!=(a=null==(r=null==e?void 0:e.style)?void 0:r.fill)?a:this.getColorAttribute(),text:t=>{let s="horizontal"===this._spec.direction?t[this._spec.xField[i]]:t[this._spec.yField[i]];return(null==e?void 0:e.formatMethod)?e.formatMethod(s,t):s}});let p=null!=(n=null==e?void 0:e.position)?n:s,g=null!=(l=null==e?void 0:e.offset)?l:"vertical"===this._direction?-20:-25;o=t=>this._barMark.getAttribute("x",t),h=t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t),u=t=>this._barMark.getAttribute("y",t),d=t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t),c=()=>this._direction,this.setMarkStyle(t,{textAlign:t=>{if("vertical"===c())return"center";let e=o(t),i=h(t);if("middle"===p)return"center";if(e>=i){if("start"===p)return"left";if("end"===p)return"right";if("outside"===p)return"left"}else{if("start"===p)return"right";if("end"===p)return"left";if("outside"===p)return"right"}return"center"},textBaseline:t=>{if("horizontal"===c())return"middle";let e=u(t),i=d(t);if("middle"===p)return"middle";if(i>=e){if("start"===p)return"bottom";if("end"===p)return"top";if("outside"===p)return"bottom"}else{if("start"===p)return"top";if("end"===p)return"bottom";if("outside"===p)return"top"}return"middle"}}),this.setMarkStyle(t,{x:t=>{let e=c(),i=o(t),s=h(t);if("vertical"===e||"middle"===p)return(i+s)/2;if(i>=s){if("start"===p)return s+g;if("end"===p)return i-g;if("outside"===p)return i+g}else{if("start"===p)return s-g;if("end"===p)return i+g;if("outside"===p)return i-g}return(i+s)/2},y:t=>{let e=c(),i=u(t),s=d(t);if("horizontal"===e||"middle"===p)return(i+s)/2;if(i>=s){if("start"===p)return s+g;if("end"===p)return i-g;if("outside"===p)return i+g}else{if("start"===p)return s-g;if("end"===p)return i+g;if("outside"===p)return i-g}return(i+s)/2}},"normal",N.Series)}}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,r;let a=bE(this),n=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._barMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("rangeColumn"))?void 0:i({direction:this.direction},n),bx("bar",this._spec,this._markAttributeContext),a)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("fadeInOut"))?void 0:s(),bx("label",this._spec,this._markAttributeContext),a)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(bb(null==(r=uP.getAnimationInKey("fadeInOut"))?void 0:r(),bx("label",this._spec,this._markAttributeContext),a))}initTooltip(){this._tooltipHelper=new Pl(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)}}Pc.type=dD.rangeColumn,Pc.mark=Pu,Pc.builtInTheme={rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}}},Pc.transformerConstructor=Pd;class Pp extends Mr{_getDefaultSeriesSpec(t){var e,i;let s=super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackgroun
2d","barMinHeight","stackCornerRadius","bar"]);return"horizontal"===t.direction?s.xField=null!=(e=t.xField)?e:[t.minField,t.maxField]:s.yField=null!=(i=t.yField)?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),fu(t)}}class Pg extends Mu{constructor(){super(...arguments),this.transformerConstructor=Pp,this.type="rangeColumn",this.seriesType=dD.rangeColumn}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}Pg.type="rangeColumn",Pg.seriesType=dD.rangeColumn,Pg.transformerConstructor=Pp;let Pf=(t,e)=>Math.max(0,Math.min(1,(t-e[0])/(e[1]-e[0]||1))),Pm=t=>{let e=t.filter(t=>t.context.diffState===W.update),i=oM(e.map(t=>{var e,i;return null==(i=null==(e=null==t?void 0:t.context)?void 0:e.data)?void 0:i[0].depth}));return e.filter(t=>{var e,s;return(null==(s=null==(e=null==t?void 0:t.context)?void 0:e.data)?void 0:s[0].depth)===i})},P_=(t,e,i)=>pJ(t)?[e,i]:[oM(t.map(t=>+t.getFinalAttribute().startAngle)),ok(t.map(t=>+t.getFinalAttribute().endAngle))],Py=t=>[oM(t.map(t=>+t.getFinalAttribute().startAngle)),ok(t.map(t=>+t.getFinalAttribute().endAngle))];function Pv(t){if(eP(t))return t;let e=+t;return eP(e)?e:0}let Pb=(t,e,i=0,s=-1,r,a,n="value")=>{let l=0,o=null!=s?s:-1,h=i;return t.forEach((t,s)=>{var u,d;let c={flattenIndex:++o,key:a?a(t):`${null!=(u=null==r?void 0:r.key)?u:""}-${s}`,maxDepth:-1,depth:i,index:s,value:t[n],isLeaf:!0,datum:r?r.datum.concat(t):[t],parentKey:null==r?void 0:r.key};if(null==(d=t.children)?void 0:d.length){c.children=[],c.isLeaf=!1;let e=Pb(t.children,c.children,i+1,o,c,a,n);c.value=(0,eE.A)(t[n])?e.sum:Math.max(e.sum,Pv(t[n])),o=e.flattenIndex,h=Math.max(e.maxDepth,h)}else c.isLeaf=!0,c.value=Pv(t[n]);l+=Math.abs(c.value),e.push(c)}),{sum:l,maxDepth:h,flattenIndex:o}},Px=(t,e,i,s)=>{let r=s;return t.forEach((t,s)=>{var a;r=e(t,s,i,r),(null==(a=t.children)?void 0:a.length)&&(r=Px(t.children,e,t,r))}),s},PS=(t,e,i,s)=>{let r=s;return t.forEach((t,s)=>{var a;(null==(a=t.children)?void 0:a.length)&&(r=PS(t.children,e,t,r)),r=e(t,s,i,r)}),r},PA=(t,e=[],i)=>{let 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):PA(t.children,e,i)))}),e},Pk=(t,e={})=>{if(!t)return[];let i=[];return PA(t,i,e),i};function PM(t,e,i,s,r,a={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){let n=t.children,l,o=-1,h=n.length,u=t.value&&(s-e)/t.value;for(;++o<h;)(l=n[o])[a.y0]=i,l[a.y1]=r,l[a.x0]=e,l[a.x1]=e+=l.value*u}let Pw=(t,e)=>(0,eE.A)(t)?e:(0,eS.A)(t)?e*parseFloat(t)/100:t,PT={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class PC{constructor(t){this._layoutNode=t=>{if(t.maxDepth=this._maxDepth,t.children){let e=this._parsedInnerRadius[t.depth+1],i=this._parsedOutterRadius[t.depth+1];PM(t,t.startAngle,Math.min(e,i),t.endAngle,Math.max(e,i),PT);let s=(0,ev.A)(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,ey(s)?{align:"center",rotate:"radial"}:s)})}},this.options=t?Object.assign({},PC.defaultOpionts,t):Object.assign({},PC.defaultOpionts);const e=this.options.nodeKey,i=(0,r3.A)(e)?e:e?EB(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){let i=t.x0+Pw(this.options.center[0],t.width),s=t.y0+Pw(this.options.center[1],t.height),r=Math.min(t.width/2,t.height/2),a=this.options.innerRadius,n=this.options.outerRadius,l=(0,ev.A)(a),o=l?a.map(t=>Pw(t,r)):Pw(a,r),h=(0,ev.A)(n),u=this.options.gapRadius,d=h?n.map(t=>Pw(t,r)):Pw(n,r),c=fD(0,e+1);if(l)this._parsedInnerRadius=c.map((t,e)=>{let i=o[e];return(0,eE.A)(i)?r:i}),this._parsedOutterRadius=c.map((t,i)=>{var s,a;return h?null!=(s=d[i])?s:r:i<e?this._parsedInnerRadius[i+1]-((0,ev.A)(u)?null!=(a=u[i])?a:0:u):d});else if(h)this._parsedOutterRadius=c.map((t,e)=>(0,eE.A)(d[e])?r:d[e]),this._parsedInnerRadius=c.map((t,e)=>{var i;return 0===e?o:this._parsedOutterRadius[e-1]-((0,ev.A)(u)?null!=(i=u[e])?i:0:u)});else{let t=Pw(a,r),i=(d-t)/(e+1);this._parsedInnerRadius=c.map((e,s)=>t+s*i),this._parsedOutterRadius=c.map((t,e)=>{var s;return this._parsedInnerRadius[e]+i-((0,ev.A)(u)?null!=(s=u[e])?s:0:u)})}this._parsedCenter=[i,s],this._maxRadius=r}layout(t,e){let 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[];let s=[],r=Pb(t,s,0,-1,null,this._getNodeKey);return this._parseRadius(i,r.maxDepth),this._maxDepth=r.maxDepth,this._layout(s,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:r.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.length)?this._layout(t.children,t):this._layoutNode(t)})}_layoutLabel(t,e){var i;let s=(t.startAngle+t.endAngle)/2,r=("start"===e.align?t.innerRadius:"end"===e.align?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+(null!=(i=e.offset)?i:0),a=iE({x:this._parsedCenter[0],y:this._parsedCenter[1]},r,s);if(t.label={x:a.x,y:a.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)*r;else{let i=s%(2*Math.PI),r=i<0?i+2*Math.PI:i;r>Math.PI/2&&r<1.5*Math.PI?(t.label.angle=r+Math.PI,t.label.textAlign="start"===e.align?"end":"end"===e.align?"start":"center"):(t.label.angle=r,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}PC.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};let PB=(t,e)=>{if(!t)return t;let i=e(),{width:s,height:r}=i;return new PC(i).layout(t,{width:s,height:r})};class PE extends bt{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}let PP=(t,e,i="key",s="children")=>{for(let r=0;r<t.length;r++){let a=t[r];if(a[i]===e)return a;
2if(a[s]){let t=PP(a[s],e,i,s);if(t)return t}}return null},PO=(t,e,i="key",s="children")=>{for(let r=0;r<t.length;r++){let a=t[r];if(a[s])for(let t=0;t<a[s].length;t++){let r=a[s][t];if(r[i]===e)return a;let n=PO([r],e,i,s);if(n)return n}}return null};(tx=tR||(tR={})).DrillDown="drillDown",tx.DrillUp="drillUp";let PR=(t,e)=>{let i=e.info(),s=e.keyField(),r=null==i?void 0:i.key;if((0,eE.A)(r))return t;if(i.type===tR.DrillDown)return oS(PP(t,r,s,"children"));if(i.type===tR.DrillUp){let e=PO(t,r,s,"children");if(e)return oS(e)}return t};class PI{_getDrillTriggerEvent(t){var e;let{mode:i}=this._drillParams;return null==(e=T$(i))?void 0:e[t]}_hideTooltip(){let t=this.getChart().getComponentsByType(hc.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){let{getRawData:e}=this._drillParams;c3(t,"drillFilter",PR),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){let{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),t=>{var i,r,a;if((0,eE.A)(t.datum)||(0,eE.A)(null==(i=t.datum)?void 0:i[s]))return void this.drillUp();this._hideTooltip();let n=t.datum[s],l=null!=(a=null==(r=this._drillInfo)?void 0:r.path)?a:[],o=((t,e,i="key",s="children")=>{let r=[],a=(t,n)=>{for(let l of t){if(l[i]===e)return r.push(...n,l[i].toString()),!0;if(l[s]){let t=a(l[s],[...n,l[i]]);if(!0===t)return t}}return!1};return a(t,[]),r})(e().rawData,n,s,"children");l[l.length-1]===o[o.length-1]?this.drillUp():this.drillDown(o)})}drillDown(t=[]){let{getRawData:e,event:i}=this._drillParams;if(!(0,ev.A)(t)||pJ(t))return t;let s=t[t.length-1];return this._drillInfo={key:s,path:t,type:tR.DrillDown},e().reRunAllTransform(),i.emit(dj.drill,{value:{path:t,type:tR.DrillDown},model:this}),t}drillUp(){var t,e;let{getRawData:i,event:s}=this._drillParams,r=null!=(e=null==(t=this._drillInfo)?void 0:t.path)?e:[];if(!(0,ev.A)(r)||pJ(r))return r;let a=r.pop();return this._drillInfo={key:a,path:r,type:tR.DrillUp},i().reRunAllTransform(),s.emit(dj.drill,{value:{path:r,type:tR.DrillUp},model:this}),r}}let PL=Object.assign(Object.assign({},bc),{sunburst:{name:"sunburst",type:"arc"}}),PD=(t,e,i)=>(t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:ba,operations:["max","min","values"]}),t.push({key:bn,operations:["values"]}),t);class PF extends Ci{constructor(){super(...arguments),this.type=dD.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)?t:bn),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!=(t=this._spec.drillField)?t:pA},getRawData:()=>this.getRawData()}),this._startAngle=iC(this._spec.startAngle),this._endAngle=iC(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();let t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),c3(this._dataSet,"sunburstLayout",PB),c3(this._dataSet,"flatten",Pk),t.transform({type:"sunburstLayout",options:()=>{let{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[(0,eA.A)(this._centerX)?this._centerX:this.getLayoutRect().width/2,(0,eA.A)(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){let e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return PD(super.getStatisticFields(),this._categoryField,this._valueField)}_addDataIndexAndKey(){let t=this.getRawData();(0,eE.A)(null==t?void 0:t.dataSet)||(c3(t.dataSet,"addVChartProperty",vJ),t.transform({type:"addVCh
2artProperty",options:{beforeCall:bu.bind(this),call:bd}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){if(!1===this._sunburst.visible)return;let t=this._createMark(PF.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}_initArcMarkStyle(){(0,eE.A)(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+((0,eA.A)(this._offsetX)?this._offsetX:0),y:t=>t.y+((0,eA.A)(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},U.STATE_NORMAL,N.Series)}_initLabelMark(){if(!0!==this._label.visible)return;let t=this._createMark(PF.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){(0,eE.A)(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;let i=this._labelAutoVisible;return r2(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!=(e=null==i?void 0:i.circumference)?e:10):this._spec.label.visible},x:t=>{var e;return(null==(e=t.label)?void 0:e.x)+((0,eA.A)(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null==(e=t.label)?void 0:e.y)+((0,eA.A)(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null==(e=t.label)?void 0:e.textBaseline},textAlign:t=>{var e;return null==(e=t.label)?void 0:e.textAlign},angle:t=>{var e,i;return null!=(i=null==(e=t.label)?void 0:e.angle)?i:0},fontSize:10,text:t=>t.name},U.STATE_NORMAL,N.Series)}initTooltip(){this._tooltipHelper=new PE(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;let i={animationInfo:()=>({innerRadius:this._computeRadius(oS(this.__innerRadius))[0],outerRadius:this._computeRadius(oS(this.__outerRadius))[0],startAngle:oS(this._startAngle)[0],endAngle:oS(this._endAngle)[0]})},s=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this.getMarksInType("arc").forEach(t=>{var e;t.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("sunburst"))?void 0:e(i,s),bx(t.name,this._spec,this._markAttributeContext)))}),this.getMarksInType("text").forEach(t=>{var e;t.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("fadeInOut"))?void 0:e(),bx(t.name,this._spec,this._markAttributeContext)))})}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_computeRadius(t){return(0,ev.A)(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}}PF.type=dD.sunburst,PF.mark=PL,PF.builtInTheme={sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{lineWidth:1,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"}}}}},yg(PF,PI);class Pz extends Ms{_getDefaultSeriesSpec(t){let e=(0,eA.A)(t.startAngle)?t.startAngle:-90,i=(0,eA.A)(t.endAngle)?t.endAngle:e+iB(2*Math.PI),s=super._getDefaultSeriesSpec(t,["categoryField","valueField","centerX","centerY","offsetX","offsetY","innerRadius","outerRadius","gap","labelLayout","label","labelAutoVisible","drill","drillField"]);return s.startAngle=e,s.endAngle=i,s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class PH extends Mu{constructor(){super(...arguments),this.transformerConstructor=Pz,this.type="sunburst",this.seriesType=dD.sunburst}}function Pj(t,e){let i=t.radius-e.radius,s=e.x-t.x,r=e.y-t.y;return i<0||i*i<s*s+r*r}function PV(t,e){let i=t.radius-e.radius+1e-9*Math.max(t.radius,e.radius,1),s=e.x-t.x,r=e.y-t.y;return i>0&&i*i>s*s+r*r}function PN(t,e){for(let i=0;i<e.length;++i)if(!PV(t,e[i]))return!1;return!0}function PW(t,e){let i=t.x,s=t.y,r=t.radius,a=e.x,n=e.y,l=e.radiu
2s,o=a-i,h=n-s,u=l-r,d=Math.sqrt(o*o+h*h);return{x:(i+a+o/d*u)/2,y:(s+n+h/d*u)/2,radius:(d+r+l)/2}}function PU(t,e,i){let s=t.x,r=t.y,a=t.radius,n=e.x,l=e.y,o=e.radius,h=i.x,u=i.y,d=i.radius,c=s-n,p=s-h,g=r-l,f=r-u,m=o-a,_=d-a,y=s*s+r*r-a*a,v=y-n*n-l*l+o*o,b=y-h*h-u*u+d*d,x=p*g-c*f,S=(g*b-f*v)/(2*x)-s,A=(f*m-g*_)/x,k=(p*v-c*b)/(2*x)-r,M=(c*_-p*m)/x,w=A*A+M*M-1,T=2*(a+S*A+k*M),C=S*S+k*k-a*a,B=-(Math.abs(w)>1e-6?(T+Math.sqrt(T*T-4*w*C))/(2*w):C/T);return{x:s+S+A*B,y:r+k+M*B,radius:B}}function PG(t,e,i){let s,r,a,n,l=t.x-e.x,o=t.y-e.y,h=l*l+o*o;h?(r=e.radius+i.radius,r*=r,n=t.radius+i.radius,r>(n*=n)?(s=(h+n-r)/(2*h),a=Math.sqrt(Math.max(0,n/h-s*s)),i.x=t.x-s*l-a*o,i.y=t.y-s*o+a*l):(s=(h+r-n)/(2*h),a=Math.sqrt(Math.max(0,r/h-s*s)),i.x=e.x+s*l-a*o,i.y=e.y+s*o+a*l)):(i.x=e.x+i.radius,i.y=e.y)}function PY(t,e){let i=t.radius+e.radius-1e-6,s=e.x-t.x,r=e.y-t.y;return i>0&&i*i>s*s+r*r}function P$(t){let e=t._,i=t.next._,s=e.radius+i.radius,r=(e.x*i.radius+i.x*e.radius)/s,a=(e.y*i.radius+i.y*e.radius)/s;return r*r+a*a}function PX(t){return{_:t,next:null,prev:null}}PH.type="sunburst",PH.seriesType=dD.sunburst,PH.transformerConstructor=Pz;let PK=t=>0;function Pq(t){return function(e){e.children||(e.radius=Math.max(0,+t(e)||0))}}function PZ(t,e,i){return function(s){let r=null==s?void 0:s.children;if(r){let a,n=r.length,l=t(s)*e||0;if(l)for(a=0;a<n;++a)r[a].radius+=l;let o=function(t,e){let i=(t=oS(t)).length;if(!i)return 0;let s=t[0];if(s.x=0,s.y=0,1===i)return s.radius;let r=t[1];if(s.x=-r.radius,r.x=s.radius,r.y=0,2===i)return s.radius+r.radius;let a=t[2];PG(r,s,a);let n,l,o,h,u,d,c,p=PX(s),g=PX(r),f=PX(a);p.next=g,f.prev=g,g.next=f,p.prev=f,f.next=p,g.prev=p;for(let e=3;e<i;++e){c=!1,a=t[e],PG(p._,g._,a),f=PX(a),n=g.next,l=p.prev,o=g._.radius,h=p._.radius;do if(o<=h){if(PY(n._,f._)){g=n,p.next=g,g.prev=p,--e,c=!0;break}o+=n._.radius,n=n.next}else{if(PY(l._,f._)){(p=l).next=g,g.prev=p,--e,c=!0;break}h+=l._.radius,l=l.prev}while(n!==l.next)if(!c){for(f.prev=p,f.next=g,p.next=g.prev=g=f,u=P$(p),f=f.next;f!==g;)(d=P$(f))<u&&(p=f,u=d),f=f.next;g=p.next}}let m=[g._];for(f=g.next;f!==g;)m.push(f._),f=f.next;a=function(t,e){let i=0,s=oT(Array.from(t),e),r=s.length,a,n,l=[];for(;i<r;)a=s[i],n&&PV(n,a)?++i:(n=function(t){switch(t.length){case 1:var e;return{x:(e=t[0]).x,y:e.y,radius:e.radius};case 2:return PW(t[0],t[1]);case 3:return PU(t[0],t[1],t[2])}}(l=function(t,e){let i,s;if(PN(e,t))return[e];for(i=0;i<t.length;++i)if(Pj(e,t[i])&&PN(PW(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(s=i+1;s<t.length;++s)if(Pj(PW(t[i],t[s]),e)&&Pj(PW(t[i],e),t[s])&&Pj(PW(t[s],e),t[i])&&PN(PU(t[i],t[s],e),t))return[t[i],t[s],e];eg.getInstance().error("error when packEncloseRandom")}(l,a)),i=0);return n}(m,e);for(let e=0;e<i;++e)s=t[e],s.x-=a.x,s.y-=a.y;return a.radius}(r,i);if(l)for(a=0;a<n;++a)r[a].radius-=l;s.radius=o+l}}}function PJ(t,e){return function(i,s,r){i.radius*=t,i.maxDepth=e,r&&(i.x=r.x+t*i.x,i.y=r.y+t*i.y)}}class PQ{constructor(t){var e;this.options=t;const i=null==t?void 0:t.nodeKey,s=(0,r3.A)(i)?i:i?EB(i):null;this._getNodeKey=s,this._getPadding=ed(null==t?void 0:t.padding)?e=>t.padding:(0,ev.A)(null==t?void 0:t.padding)?e=>{var i;return null!=(i=t.padding[e.depth+1])?i:0}:()=>0,this._maxDepth=-1,this._valueField=null!=(e=null==t?void 0:t.valueField)?e:"value"}layout(t,e){var i;let 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[];let r=[],a=Pb(t,r,0,-1,null,this._getNodeKey,this._valueField);this._maxDepth=a.maxDepth;let n=function(t=1){let e=t;return()=>(e=(1664525*e+0x3c6ef35f)%0x100000000)/0x100000000}(),l={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:a.sum,datum:null,children:r,x:s.x0+s.width/2,y:s.y0+s.height/2},{nodeSort:o,setRadius:h,padding:u,includeRoot:d}=null!=(i=this.options)?i:{};if(!1!==o){let t=(0,r3.A)(o)?this.options.nodeKey:PQ.defaultOpionts.nodeSort;Px([l],e=>{e.children&&e.children.length&&e.children.sort(t)})}if(h)Px([l],Pq(h)),PS([l],PZ(this._getPadding,.5,n)),Px([l],PJ(1,this._maxDepth));else{let t=Math.min(s.width,s.height);Px([l],Pq(PQ.defaultOpionts.setRadius)),PS([l],PZ(PK,1,n)),u&&PS([l],PZ(this._getPadding,l.radius/t,n)),Px([l],PJ(t/(2*l.radius),this._maxDepth))}return d?[l]:r}}PQ.defaultOpionts={setRadius:t=>Math.sqrt(t.value),padding:0,nodeSort:(t,e)=>e.value-t.value};let P0=(t,e)=>{if(!t)return t;let i=e(),{width:s,height:r}=i;return 0===s||0===r?t:new PQ(i).layout(t,{width:s,height:r})};class P1 extends bt{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}let P2=Object.assign(Object.assign({},bc),{circlePacking:{name:"circlePacking",type:"arc"}});class P3 extends bP{constructor(){super(...arguments),this.type=dD.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)?t:bn),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!=(t=this._spec.drillField)?t:pA},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();let t=this.getRawData();(0,eE.A)(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),c3(this._dataSet,"circlePackingLayout",P0),c3(this._dataSet,"flatten",Pk),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,valueField:this._valueField,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){let e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){let t=this.getRawData();(0,eE.A)(null==t?void 0:t.dataSet)||(c3(t.dataSet,"addVChartProperty",vJ),t.transform({type:"addVCh
2artProperty",options:{beforeCall:bu.bind(this),call:bd}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t;if(!1===(null==(t=this._circlePacking)?void 0:t.visible))return;let e=this._createMark(P3.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}_initCirclePackingMarkStyle(){(0,eE.A)(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},U.STATE_NORMAL,N.Series)}_initLabelMark(){var t;if(!1===(null==(t=this._label)?void 0:t.visible))return;let e=this._createMark(P3.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){(0,eE.A)(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},U.STATE_NORMAL,N.Series)}getStatisticFields(){return PD(super.getStatisticFields(),this._categoryField,this._valueField)}initTooltip(){this._tooltipHelper=new P1(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;let e=null==(t=this._spec.animationAppear)?void 0:t.preset;this.getMarksInType("arc").forEach(t=>{var i;t.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("circlePacking"))?void 0:i(void 0,e),bx(t.name,this._spec,this._markAttributeContext)))}),this.getMarksInType("text").forEach(t=>{var e;t.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("scaleInOut"))?void 0:e(),bx(t.name,this._spec,this._markAttributeContext)))})}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),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}}P3.type=dD.circlePacking,P3.mark=P2,P3.builtInTheme={circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",lineWidth:1,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"}}}}},yg(P3,PI);class P5 extends Ms{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class P4 extends Mu{constructor(){super(...arguments),this.transformerConstructor=P5,this.type="circlePacking",this.seriesType=dD.circlePacking}}P4.type="circlePacking",P4.seriesType=dD.circlePacking,P4.transformerConstructor=P5;let P8=(t,e)=>{let i=e.fields;return((0,r3.A)(i)&&(i=i()),(null==i?void 0:i.length)&&(null==t?void 0:t.length)&&t[0].latestData)?bi([{latestData:Pk(t[0].latestData)}],e):{}};class P6 extends bt{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null==(i=null==(e=this.series)?void 0:e.getMarkData(t))?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;let{measureFields:s}=this._seriesCacheInfo,r=null==(e=this.series)?void 0:e.getMarkData(t);if(s[0]&&r)return null!=(i=r[s[0]])?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;let{dimensionFields:i}=this._seriesCacheInfo,s=null==(e=this.series)?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}let P9=Object.assign(Object.assign({},bc),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}});class P7 extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}function Ot(t,e,i,s,r){let a=t.children,n,l=-1,o=a.length,h=t.value&&(r-i)/t.value;for(;++l<o;)(n=a[l]).x0=e,n.x1=s,n.y0=i,i+=n.value*h,n.y1=i}
2let Oe={binary:function(t,e,i,s,r){let a=t.children,n=a.length,l=0,o=Array(n+1);o[0]=0;for(let t=0;t<n;++t)l+=a[t].value,o[t+1]=l;let h=(t,e,i,s,r,n,l)=>{if(t>=e-1){let e=a[t];return e.x0=s,e.y0=r,e.x1=n,void(e.y1=l)}let u=o[t],d=i/2+u,c=t+1,p=e-1;for(;c<p;){let t=c+p>>>1;o[t]<d?c=t+1:p=t}d-o[c-1]<o[c]-d&&t+1<c&&--c;let g=o[c]-u,f=i-g;if(n-s>l-r){let a=i?(s*f+n*g)/i:n;h(t,c,g,s,r,a,l),h(c,e,f,a,r,n,l)}else{let a=i?(r*f+l*g)/i:l;h(t,c,g,s,r,n,a),h(c,e,f,s,a,n,l)}};h(0,n,t.value,e,i,s,r)},dice:PM,slice:Ot,sliceDice:function(t,e,i,s,r){(t.depth%2==1?Ot:PM)(t,e,i,s,r)}};class Oi{constructor(t){var e;this._filterByArea=(t,e)=>{var i;let s=this._getMinAreaByDepth(t.depth);if(s>0&&t.value*e<s)return!1;if(null==(i=t.children)?void 0:i.length){let i=t.children.filter(t=>this._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=(0,ev.A)(this.options.minVisibleArea)?this.options.minVisibleArea[t]:this.options.minVisibleArea)?e:0},this._getGapWidthByDepth=t=>{var e;return t<0?0:null!=(e=(0,ev.A)(this.options.gapWidth)?this.options.gapWidth[t]:this.options.gapWidth)?e:0},this._getPaddingByDepth=t=>{var e;return t<0?0:null!=(e=(0,ev.A)(this.options.padding)?this.options.padding[t]:this.options.padding)?e:0},this._getLabelPaddingByDepth=t=>{var e;return t<0?0:null!=(e=(0,ev.A)(this.options.labelPadding)?this.options.labelPadding[t]:this.options.labelPadding)?e:0},this._layoutNode=t=>{let e=this._getGapWidthByDepth(t.depth),i=t.x0,s=t.y0,r=t.x1,a=t.y1;if(t.maxDepth=this._maxDepth,e>0&&(i+=e/2,r-=e/2,s+=e/2,a-=e/2,i>r&&(r=i=(i+r)/2),s>a&&(a=s=(s+a)/2),t.x0=i,t.x1=r,t.y0=s,t.y1=a),t.children){let e=this._getLabelPaddingByDepth(t.depth),n=this._getPaddingByDepth(t.depth);n>0&&n<Math.min(r-i,a-s)/2&&(s+=n,a-=n,i+=n,r-=n),e>0&&("top"===this.options.labelPosition&&s+e<a?(t.labelRect={x0:i,y0:s,x1:r,y1:s+e},s+=e):"bottom"===this.options.labelPosition&&a-e>s?(t.labelRect={x0:i,y0:a-e,x1:r,y1:a},a-=e):"left"===this.options.labelPosition&&i+e<r?(t.labelRect={x0:i,y0:s,x1:i+e,y1:a},i+=e):"right"===this.options.labelPosition&&r-e>i&&(t.labelRect={x0:r-e,y0:s,x1:r,y1:a},r-=e));let l=this._getGapWidthByDepth(t.depth+1);l>0&&(i-=l/2,r+=l/2,s-=l/2,a+=l/2),this._splitNode(t,i,s,r,a)}},this.options=Object.assign({},Oi.defaultOpionts,t);const i=this.options.nodeKey,s=(0,r3.A)(i)?i:i?EB(i):null;this._getNodeKey=s,this._splitNode="squarify"===this.options.splitType?(t=>(e,i,s,r,a)=>{!function(t,e,i,s,r,a){let n=[],l=e.children,o,h,u=0,d=0,c=l.length,p,g,f,m,_,y,v,b,x,S=e.value;for(;u<c;){p=r-i,g=a-s;do f=l[d++].value;while(!f&&d<c)for(m=f,v=Math.max((_=f)/(x=f*f*(b=Math.max(g/p,p/g)/(S*t))),x/m);d<c;++d){if(f+=h=l[d].value,h<m&&(m=h),h>_&&(_=h),(y=Math.max(_/(x=f*f*b),x/m))>v){f-=h;break}v=y}o=Object.assign({},e,{value:f,children:l.slice(u,d)}),n.push(o),p<g?PM(o,i,s,r,S?s+=g*f/S:a):Ot(o,i,s,S?i+=p*f/S:r,a),S-=f,u=d}}(t,e,i,s,r,a)})(this.options.aspectRatio):null!=(e=Oe[this.options.splitType])?e:Oe.binary,this._maxDepth=-1}layout(t,e){var i;if(!t||!t.length)return[];let 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)},r=[],a=Pb(t,r,0,-1,null,this._getNodeKey,this.options.valueField);if(this._maxDepth=a.maxDepth,a.sum<=0)return[];let n={flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:a.sum,datum:null,x0:s.x0,x1:s.x1,y0:s.y0,y1:s.y1,children:r},l=s.width*s.height/a.sum;return this._filterByArea(n,l),this._layout(n),null!=(i=n.children)?i:[]}_filterChildren(t){let e=this.options.maxDepth;if(ed(e)&&e>=0&&t.depth>=e)return!1;let i=this.options.minChildrenVisibleArea;if(ed(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0))<i)return!1;let s=this.options.minChildrenVisibleSize;return!ed(s)||!(Math.abs(t.x1-t.x0)<s||Math.abs(t.y1-t.y0)<s)}_layout(t){var e;this._filterChildren(t)||(t.children=null,t.isLeaf=!0),this._layoutNode(t),(null==(e=t.children)?void 0:e.length)&&t.children.forEac
2h(t=>{var e;(null==(e=null==t?void 0:t.children)?void 0:e.length)?this._layout(t):this._layoutNode(t)})}}Oi.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};let Os=(t,e)=>{if(e.getViewBox()){let i=new Oi(e).layout(t,e.getViewBox()),s=[];return PA(i,s,{maxDepth:null==e?void 0:e.maxDepth}),s.forEach((t,i)=>{t&&[bn,"name"].forEach(i=>{t[i]=t.datum[t.depth][e.nameField]})}),s}return[]};class Or extends bP{constructor(){super(...arguments),this.type=dD.treemap,this.transformerConstructor=P7,this._categoryField="name",this._valueField="value",this._viewBox=new iZ,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)?t:bn),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new iL),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!=(e=null!=(t=this._spec.drillField)?t:this._categoryField)?e:pA},getRawData:()=>this.getRawData()}),eP(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t,e,i,s,r;super.initData(),c3(this._dataSet,"treemap",Os),null==(t=this._data.getDataView())||t.transform({type:"treemap",options:{nameField:this._categoryField,valueField:this._valueField,getViewBox:()=>this._viewBox.empty()?null:{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.visible)?null==(i=this._spec.nonLeafLabel)?void 0:i.padding:0,labelPosition:null==(s=this._spec.nonLeafLabel)?void 0:s.position,minVisibleArea:null!=(r=this._spec.minVisibleArea)?r:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}_runTreemapTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null==(t=this._rawData)?void 0:t.dataSet)&&(c3(this._rawData.dataSet,"addVChartProperty",vJ),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:bu.bind(this),call:bd}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){let s=P8([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=eB(null!=(i=this._rawStatisticsCache[t])?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){c3(this._dataSet,"hierarchyDimensionStatistics",P8),c3(this._dataSet,"flatten",Pk);let i=new eR(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{let t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return PD(super.getStatisticFields(),this._categoryField,this._valueField)}initMark(){let t=this._createMark(Or.mark.nonLeaf,{isSeriesMark:!0});t&&(t.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=t);let e=this._createMark(Or.mark.leaf,{isSeriesMark:!0});e&&(e.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=e)}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()},U.STATE_NORMAL,N.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()},U.STATE_NORMAL,N.Series)}
2_initRichStyleOfLabelMark(t){"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},U.STATE_NORMAL,N.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[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?5e-324:t.x1-t.x0},U.STATE_NORMAL,N.Series),this._initRichStyleOfLabelMark(t))}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[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?5e-324:t.x1-t.x0},U.STATE_NORMAL,N.Series),this._initRichStyleOfLabelMark(t))}initAnimation(){this.getMarksInType("rect").forEach(t=>{var e;t.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("treemap"))?void 0:e(),bx(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 P6(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){let i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){let{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);let{a:i,b:s,c:r,d:a,e:n,f:l}=this._matrix;this._matrix.multiply(i,s,r,a,n,l),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){let{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();let{x:s,y:r}=i;this._matrix.translate(s,r),this._matrix.scale(e,e),this._matrix.translate(-s,-r);let{a:a,b:n,c:l,d:o,e:h,f:u}=this._matrix;this._matrix.multiply(a,n,l,o,h,u),this.disableMarkAnimation(),this.event.on(dH.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach(t=>{}),[this._labelMark,this._nonLeafLabelMark].forEach(t=>{t&&t.getComponent()&&t.getComponent().getProduct().enableAnimation()}),this.event.off(dH.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach(t=>{}),[this._labelMark,this._nonLeafLabelMark].forEach(t=>{t&&t.getComponent()&&t.getComponent().getProduct().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}}Or.type=dD.treemap,Or.mark=P9,Or.builtInTheme={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"}}}},Or.transformerConstructor=P7,yg(Or,PI),yg(Or,TK);class Oa extends Ms{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","aspectRatio","splitType","maxDepth","gapWidth","nodePadding","minVisibleArea","minChildrenVisibleArea","minChildrenVisibleSize","roam","drill","drillField","leaf","nonLeaf","nonLeafLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class On extends Mu{constructor(){super(...arguments),this.transformerConstructor=Oa,this.type="treemap",this.seriesType=dD.treemap}}On.type="treemap",On.seriesType=dD.treemap,On.transformerConstructor=Oa;let Ol=`${px.H}_waterfall_default_seriesField`,Oo=(t,e)=>{if(!t||0===t.length)return t;let{indexField:i,total:s,groupData:r,calculationMode:a}=e,n=[],{dimensionValues:l,dimensionData:o}=r().latestData,h=Array.from(l[i]);"decrease"===a&&(h=h.reverse());let u={start:0,end:0,positive:0,negative:0,lastIndex:null};return h.forEach((t,i)=>{let r={start:u.end,end:u.end,lastIndex:u.lastIndex,lastEnd:u.end,index:t,isTotal:!1,positive:u.end,negative:u.end},a=!0===e.stackInverse?o[t].reverse():o[t];if(null==a||a.forEach((t,e)=>{e===a.length-1?t[pL]=!0:delete t[pL]}),a.length>1){let l=t=>{if(s&&"end"!==s.type){if("field"===s.type||"custom"===s.type)return!!t[s.tagField]}else if(i===h.length-1)return!0;return!1};if(a.some(t=>
2l(t)))return u=function(t,e,i,s,r,a,n,l,o){i.isTotal=!0;let{valueField:h,startAs:u,endAs:d,total:c}=l,p=[],g=[];if(t.forEach((t,e)=>{o(t)?g.push(Object.assign(Object.assign({},t),{_vchart_waterfall_waterfall_temp:e})):p.push(t)}),g.length===t.length){let o=Oh([t[0]],e,i,s,r,a,n,l);return g.forEach(e=>{e[u]=t[0][u],e[d]=t[0][d],e[h]=t[0][h]}),o}let{start:f,end:m}=Ou(g[0],i,s,r,c);i.start=f,i.end=m;let _=f,y=f,v=m-f,b=p.reduce((t,e)=>iT(t,+e[h]),v);return g.forEach(t=>{let e={[u]:f,[d]:m,[h]:b};p.splice(t._vchart_waterfall_waterfall_temp,0,e)}),p.forEach(t=>{let e=+t[h];e>=0?(t[u]=+_,_=iw(_,e)):(t[u]=+y,y=iw(y,e)),t[d]=iw(t[u],e),f=iw(f,e),v=iT(v,e)}),g.forEach(e=>{let i=e._vchart_waterfall_waterfall_temp;e=p[i];let s=t[i];s[u]=e[u],s[d]=e[d],s[h]=e[h]}),Object.assign(Object.assign({},i),{lastIndex:e})}(a,t,r,n,u,h,i,e,l),void n.push(r)}u=Oh(a,t,r,n,u,h,i,e),n.push(r)}),n};function Oh(t,e,i,s,r,a,n,l){let{valueField:o,startAs:h,endAs:u,total:d,seriesField:c,seriesFieldName:p}=l;return t.forEach(t=>{let e=!1;if(d&&"end"!==d.type){if(("field"===d.type||"custom"===d.type)&&t[d.tagField]){e=!0;let{start:a,end:n}=Ou(t,i,s,r,d);t[h]=a,t[u]=n,t[o]=n-a,i.start=a,i.end=n}}else n===a.length-1&&(i.start=0,t[h]=i.start,t[u]=i.end,e=!0);if(!e){let e=+t[o];e>=0?(t[h]=+i.positive,i.positive=iw(i.positive,e)):(t[h]=+i.negative,i.negative=iw(i.negative,e)),t[u]=iw(t[h],e),i.end=iw(i.end,e)}i.isTotal=e,((0,eE.A)(c)||c===Ol)&&(t[Ol]=e?p.total:+t[o]>=0?p.increase:p.decrease)}),Object.assign(Object.assign({},i),{lastIndex:e})}function Ou(t,e,i,s,r){var a,n,l,o,h,u,d,c,p;let g,f,m,_,y,v;return r&&"end"!==r.type?"field"===r.type||"custom"===r.type?"custom"===r.type?(a=t,n=s,r.product(a,n)):r.collectCountField&&!(0,eE.A)(t[r.collectCountField])?(l=t,o=i,h=e,u=r,g=0,f=h.end,m=o.length-l[u.collectCountField],_=o.length-1,m<0?h2("total.collectCountField error"):g=o[m].start,_<0?h2("total.collectCountField error"):f=o[_].end,{start:g,end:f}):(d=t,c=e,p=r,y=0,v=c.end,p.startField&&!(0,eE.A)(d[p.startField])&&(y=+d[p.startField]),p.valueField&&!(0,eE.A)(d[p.valueField])&&(v=iw(y,+d[p.valueField])),{start:y,end:v}):{start:0,end:0}:{start:0,end:e.end}}let Od=(t,e)=>{if(!t)return t;let{indexField:i,valueField:s,total:r,seriesField:a,calculationMode:n}=e,l={[i]:(null==r?void 0:r.text)||"total",[s]:t.reduce((t,e)=>iw(t,+e[s]),0)};return a&&(l[a]="total"),"decrease"===n?t.unshift(l):t.push(l),t},Oc={type:"fadeIn"},Op={type:"growCenterIn"},Og=Object.assign(Object.assign({},w_),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),Of=(t,e)=>{if(!e.fields)return t;let i={};return{dimensionValues:i,dimensionData:function t(e,i,s){var r,a,n,l,o;let h;if(0===i.length)return e;let u=i[0],d=i.slice(1);s[u]=new Set;let c=(r=e,a=u,n=s[u],h={},r.forEach(t=>{let e=t[a];h[e]||(h[e]=[],n.add(e)),h[e].push(t)}),h);return d.length?(l=c,o=(e,i)=>t(e,d,s),Object.keys(l).reduce((t,e)=>(t[e]=o(l[e],e),t),{})):c}(t.map(t=>t.latestData).flat(),e.fields,i)}};class Om{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){let i=t.name,s=new eR(e instanceof e_?e:t.dataSet);s.name=i,s.parse([t],{type:"dataview"}),c3(e,"dimensionTree",Of),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;let r=null==(s=null==(i=null==(e=this.groupData)?void 0:e.latestData)?void 0:i.dimensionValues)?void 0:s[t];return r?Array.from(r):[]}}class O_ extends wv{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel","initStackLabelMarkStyle")}}let Oy={rect:OS,symbol:Ox,arc:OA,point:function(t){let{labelSpec:e}=t;return{position:"center",overlap:!1!==e.overlap&&{clampForce:!1,avoidBaseMark:!1}}},"line-data":function(t){let e=Ox(t);return ey(e.overlap)||(e.overlap.avoidBaseMark=!1,e.overlap.clampForce=!1),e},stackLabel:Ok,line:OM,area:OM,rect3d:OS,arc3d:OA,treemap:function(t){return{customLayoutFunc:(t,e)=>e,overlap:!1}},venn:function(t){return{customLayoutFunc:(t,e)=>e,smartInvert:!0}},boxPlot:function(t){return{customLayoutFunc:(e,i,s)=>{for(let r=0;r<i.length;r++){let a=i[r],n=e[r];if(!a||!n)continue;let l=s(n),o=l.getSubGraphic().findIndex(t=>"median"===t.name);if(-1!==o){let e=l.getSubGraphic()[o].AABBBounds;"horizontal"===t.series.direction?a.setAttributes({x:e.x2+a.AABBBounds.width()/2,y:(e.y1+e.y2)/2}):a.setAttributes({x:(e.x1+e.x2)/2,y:e.y2+a.AABBBounds.height()/2})}else{let t=l.AABBBounds;a.setAttributes({x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2})}}return i}}}};function Ov(t,e,i,s){var r,a;let{labelMark:n,series:l}=t,o=l.getMeasureField()[0],h=n.getAttributesOfState(e);if("text"in h||(h.text=null!=(r=h.text)?r:e[o]),"textType"in h||(h.textType=null!=(a=t.labelSpec.textType)?a:"text"),h.data=e,l.type!==dD.sankey){let{formatFunc:t,args:r}=v1(i,s,h.text,e);t&&(h._originText=h.text,h.text=t(...r,{series:l}))}return h}function Ob(t){return(0,r3.A)(t)?e=>t(e.data):t}function Ox(t){var e,i,s;let r,{series:a,labelSpec:n}=t,l="horizontal"===a.direction?"right":"top",o=null!=(e=Ob(n.position))?e:l;return r=!1!==n.overlap&&{strategy:null!=(s=null==(i=n.overlap)?void 0:i.strategy)?s:[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}],avoidBaseMark:"center"!==o},{position:o,overlap:r}}function OS(t){var e,i,s,r,a,n,l;let{series:o,labelSpec:h={}}=t,u=null!=(e=Ob(h.position))?e:"outside",d=null!=(i=o.direction)?i:"vertical",c="horizontal"===o.direction?null==(s=o.getXAxisHelper())?void 0:s.isInverse():null==(r=o.getYAxisHelper())?void 0:r.isInverse(),p,g=u;g=t=>{var e;let{data:i}=t,s=null!=(e="function"==typeof h.position?h.position(i):h.position)?e:"outside";
2if("outside"===s){let t=o.getMeasureField()[0];return({vertical:["top","bottom"],horizontal:["right","left"]})[d][(null==i?void 0:i[t])>=0&&c||(null==i?void 0:i[t])<0&&!c?1:0]}return s},p=!1!==h.overlap&&{strategy:null!=(n=null==(a=h.overlap)?void 0:a.strategy)?n:(l=o,[{type:"position",position:t=>{var e,i;let{data:s}=t,r=l.getMeasureField()[0];return("horizontal"===l.direction?null==(e=l.getXAxisHelper())?void 0:e.isInverse():null==(i=l.getYAxisHelper())?void 0:i.isInverse())?(null==s?void 0:s[r])>=0?"horizontal"===l.direction?["left","inside-left"]:["bottom","inside-bottom"]:"horizontal"===l.direction?["right","inside-right"]:["top","inside-top"]:(null==s?void 0:s[r])>=0?"horizontal"===l.direction?["right","inside-right"]:["top","inside-top"]:"horizontal"===l.direction?["left","inside-left"]:["bottom","inside-bottom"]}}])};let f=!1;return(0,eS.A)(u)&&u.includes("inside")&&(f=!0),{position:g,overlap:p,smartInvert:f}}function OA(t){var e;let i,{labelSpec:s}=t,r=null!=(e=Ob(s.position))?e:"outside";return i=s.smartInvert?s.smartInvert:(0,eS.A)(r)&&r.includes("inside"),{position:r,smartInvert:i}}function Ok(t,e,i){let s=t.series,r=t.labelSpec||{},a=s.getTotalData();return{customLayoutFunc:a=>a.map(a=>{let n=r.position||"withChange",l=r.offset||0,o=e?e(a.data):a.data,h=Ov(t,o,r.formatMethod);return h.x="horizontal"===s.direction?"middle"===n?.5*(s.totalPositionX(o,"end")+s.totalPositionY(o,"start")):"max"===n?s.totalPositionX(o,o.end>=o.start?"end":"start")+l:"min"===n?s.totalPositionX(o,o.end>=o.start?"start":"end")-l:s.totalPositionX(o,"end")+(o.end>=o.start?l:-l):s.totalPositionX(o,"index",.5),h.y="horizontal"===s.direction?s.totalPositionY(o,"index",.5):"middle"===n?.5*(s.totalPositionY(o,"end")+s.totalPositionY(o,"start")):"max"===n?s.totalPositionY(o,o.end>=o.start?"end":"start")-l:"min"===n?s.totalPositionY(o,o.end>=o.start?"start":"end")+l:s.totalPositionY(o,"end")+(o.end>=o.start?-l:l),"horizontal"===s.direction?h.textAlign="middle"===n?"center":"withChange"===n&&o.end-o.start>=0||"max"===n?"left":"right":h.textBaseline="middle"===n?n:"withChange"===n&&o.end-o.start>=0||"max"===n?"bottom":"top",null==i||i(a,o,h),p4(Object.assign(Object.assign({},h),{id:a.id}))}),dataFilter:t=>{let e=[];return a.forEach(i=>{let r=t.find(t=>{var e;return i.index===(null==(e=t.data)?void 0:e[s.getDimensionField()[0]])});r&&(r.data=i,e.push(r))}),e},overlap:{strategy:[]}}}function OM(t){var e,i,s,r;let{labelSpec:a,series:n}=t,l=null==(s=null==(i=null==(e=n.getViewDataStatistics)?void 0:e.call(n).latestData)?void 0:i[n.getSeriesField()])?void 0:s.values,o=l?l.map((t,e)=>({[n.getSeriesField()]:t,index:e})):[{index:0,[pk]:n.getSeriesKeys()[0]}];return{position:null!=(r=a.position)?r:"end",data:o,overlap:{avoidBaseMark:!1,clampForce:!1}}}class Ow extends wb{constructor(){super(...arguments),this.type=dD.waterfall,this.transformerConstructor=O_,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null,this._reStackTotal=()=>{let t=this.getStackData(),e=this.getStackValueField();t&&vZ(t,e)}}getTotalData(){var t;return null==(t=this._totalData)?void 0:t.getLatestData()}initGroups(){let t=this.getGroupFields();t&&t.length&&(this._groups=new Om(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]],(0,eE.A)(this._seriesField)&&(this._seriesField=Ol)}getSeriesKeys(){return this._seriesField===Ol?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t,e,i;super.initData(),c3(this._dataSet,"waterfallFillTotal",Od),c3(this._dataSet,"waterfall",Oo),((0,eE.A)(this._spec.total)||"end"===this._spec.total.type)&&(null==(t=this._rawData)||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total,calculationMode:null!=(e=this._spec.calculationMode)?e:"increase",stackInverse:this.getRegion().getStackInverse()}},!1));let s=pt(this.getViewData(),this._dataSet,{name:`${px.H}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",s.reRunAllTransform),this._totalData=new mz(this._option,s),s.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:pT,endAs:pC,total:this._spec.total,calculationMode:null!=(i=this._spec.calculationMode)?i:"increase",groupData:()=>this.getGroups().groupData,stackInverse:this.getRegion().getStackInverse()}},!1),s.target.addListener("change",this._reStackTotal)}compileData(){var t;super.compileData(),null==(t=this._totalData)||t.compile()}initAnimation(){var t,e,i,s;let r={yField:"horizontal"===this.direction?this._fieldY[0]:this.getStackValueField(),xField:"horizontal"===this.direction?this.get
2StackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null==(t=this._xAxisHelper)?void 0:t.getScale(0).scale(0):null==(e=this._yAxisHelper)?void 0:e.getScale(0).scale(0)}},a=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset,n=bE(this);this._barMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("waterfall"))?void 0:i(r,a),bx("bar",this._spec,this._markAttributeContext),n)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("fadeInOut"))?void 0:s(),bx("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(){super.initMark();let t=this._createMark(Ow.mark.leaderLine,{key:"index"});t&&(this._leaderLineMark=t,t.setData(this._totalData))}initLabelMarkStyle(t){var e;if(t)return!this._labelMark&&(null==(e=this._spec.label)?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.setData(this._totalData),this.setMarkStyle(t,{text:t=>{var e;return"absolute"===(null==(e=this._spec.stackLabel)?void 0:e.valueType)?t.end:iT(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.valueType)?t.end:iT(t.end,t.start):"horizontal"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]]}})}getTotalLabelComponentStyle(t){return Ok(Object.assign(Object.assign({},t),{series:this,labelSpec:this._spec.totalLabel}),t=>{let 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){let{dataToPosition:s,getBandwidth:r}=this._xAxisHelper;return"horizontal"===this._direction?mB(s([t[e]],{bandPosition:this._bandPosition})):s([t[e]],{bandPosition:this._bandPosition})+.5*r(0)-this._barMark.getAttribute("width",t)*(.5-i)}totalPositionY(t,e,i=.5){let{dataToPosition:s,getBandwidth:r}=this._yAxisHelper;return"horizontal"===this._direction?s([t[e]],{bandPosition:this._bandPosition})+.5*r(0)-this._barMark.getAttribute("height",t)*(.5-i):mB(s([t[e]],{bandPosition:this._bandPosition}))}initMarkStyle(){super.initMarkStyle();let t="decrease"===this._spec.calculationMode;this._leaderLineMark&&("horizontal"===this._direction?this.setMarkStyle(this._leaderLineMark,{visible:t=>this.isVisibleLeaderLine(t),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:e=>e.lastIndex?this.totalPositionY(e,"lastIndex",+!t):0,y1:e=>this.totalPositionY(e,"index",+!!t)},"normal",N.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>this.isVisibleLeaderLine(t),x:e=>e.lastIndex?this.totalPositionX(e,"lastIndex",+!t):0,x1:e=>this.totalPositionX(e,"index",+!!t),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",N.Series))}isVisibleLeaderLine(t){return!(0,eE.A)(t.lastIndex)&&mE([t.lastEnd,t[t.isTotal?"end":"start"]],"horizontal"===this.direction?this._xAxisHelper.getScale(0):this._yAxisHelper.getScale(0))}}Ow.type=dD.waterfall,Ow.mark=Og,Ow.builtInTheme={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}}}},Ow.transformerConstructor=O_;class OT extends wS{transformSpec(t){super.transformSpec(t),t.legends&&oS(t.legends).forEach(t=>{t.select=!1,t.hover=!1,t.filter=!1}),fu(t)}_getDefaultSeriesSpec(t){let e=super._getDefaultSeriesSpec(t);return e.bar=t.bar,e.stackLabel=t.stackLabel,e.leaderLine=t.leaderLine,e.total=t.total,e.calculationMode=t.calculationMode,e}}class OC extends wA{constructor(){super(...arguments),this.transformerConstructor=OT,this.type="waterfall",this.seriesType=dD.waterfall}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}OC.type="waterfall",OC.seriesType=dD.waterfall,OC.transformerConstructor=OT;let OB=`${px.H}_BOX_PLOT_OUTLIER_VALUE`;(tS=tI||(tI={})).OUTLIER="outlier",tS.MAX="max",tS.MIN="min",tS.MEDIAN="median",tS.Q1="q1",tS.Q3="q3",tS.SERIES_FIELD="seriesField";let OE=(t,e)=>{let i=[],{outliersField:s,dimensionField:r,seriesField:a}=e;
2return(t[0].latestData||[]).forEach(t=>{let e=t[s];(0,ev.A)(e)||(e=[e]),i.push(...e.map(e=>{let i={[OB]:e};return r.forEach(e=>{i[e]=t[e]}),(0,eA.A)(a)&&(i[a]=t[a]),i}))}),i};class OP extends bt{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===tI.OUTLIER?this.series.getOutliersField():t===tI.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case tI.MIN:return this.series.getMinField();case tI.MAX:return this.series.getMaxField();case tI.MEDIAN:return this.series.getMedianField();case tI.Q1:return this.series.getQ1Field();case tI.Q3:return this.series.getQ3Field();case tI.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===tI.OUTLIER?e[OB]:t===tI.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case tI.MIN:return e[this.series.getMinField()];case tI.MAX:return e[this.series.getMaxField()];case tI.MEDIAN:return e[this.series.getMedianField()];case tI.Q1:return e[this.series.getQ1Field()];case tI.Q3:return e[this.series.getQ3Field()];case tI.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,i;let s=this.series.getOutliersStyle();return null!=(e=null==s?void 0:s.fill)?e:null==(i=this.series.getMarkInName("outlier"))?void 0:i.getAttribute("fill",t)},this.isOutlierMark=t=>(0,eA.A)(t[OB])}getDefaultContentList(t){return[{key:this.getContentKey(tI.OUTLIER),value:this.getContentValue(tI.OUTLIER),shapeType:this.shapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor},{key:this.getContentKey(tI.MAX),value:this.getContentValue(tI.MAX)},{key:this.getContentKey(tI.Q3),value:this.getContentValue(tI.Q3)},{key:this.getContentKey(tI.MEDIAN),value:this.getContentValue(tI.MEDIAN)},{key:this.getContentKey(tI.Q1),value:this.getContentValue(tI.Q1)},{key:this.getContentKey(tI.MIN),value:this.getContentValue(tI.MIN)},{key:this.getContentKey(tI.SERIES_FIELD),value:this.getContentValue(tI.SERIES_FIELD)}]}}class OO extends n0{constructor(t){super(t),this.type="glyph",this.numberType=nb,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 rQ(this).glyph}
2updateAABBBounds(t,e,i){return this.getSubGraphic().forEach(t=>{i.union(t.AABBBounds)}),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();let 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.length)!==t.length||t.some((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates(),this.stateSort&&(t=t.sort(this.stateSort));let s={},r=this.subGraphic.map(()=>({}));t.forEach(e=>{var i;let a=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];a&&(Object.assign(s,a.attributes),(null==(i=a.subAttributes)?void 0:i.length)&&r.forEach((t,e)=>{Object.assign(t,a.subAttributes[e])}))}),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){let t=new OO(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map(t=>t.clone())),t}getNoWorkAnimateAttr(){return OO.NOWORK_ANIMATE_ATTR}}function OR(t){return new OO(t)}OO.NOWORK_ANIMATE_ATTR=nQ;let OI=class{constructor(){this.numberType=nb}reInit(){}drawShape(t,e,i,s,r,a,n,l){r.drawContribution&&t.getSubGraphic().forEach(t=>{let o=r.drawContribution.getRenderContribution(t);o&&o.drawShape&&o.drawShape(t,e,i,s,r,a,n,l)})}draw(t,e,i,s){let{context:r}=i;if(!r||(r.highPerformanceSave(),!i.drawContribution))return;let a=rQ(t),n=t.getSubGraphic();n.length&&n.forEach(t=>{i.drawContribution.renderItem(t,i,{theme:a})}),r.highPerformanceRestore()}};OI=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],OI);let OL=!1,OD=new eL(t=>{OL||(OL=!0,t(lf).to(OI).inSingletonScope(),t(ln).toService(lf))});class OF{constructor(){this.type="glyph",this.numberType=nb}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;let{pickContext:s}=null!=i?i:{};if(!s)return!1;let r=null==i?void 0:i.pickerService;if(r){let s=!1;return t.getSubGraphic().forEach(t=>{if(s)return;let a=r.pickItem(t,e,null,i);s=!(!a||!a.graphic)}),s}return!1}}let Oz=class extends OF{constructor(t){super(),this.canvasRenderer=t}};Oz=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tA=eU(lf),function(t,e){tA(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Oz);let OH=!1,Oj=new eL((t,e,i,s)=>{OH||(OH=!0,t(gw).to(Oz).inSingletonScope(),t(gC).toService(gw))}),OV=class extends OF{constructor(t){super(),this.canvasRenderer=t}};OV=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tk=eU(lf),function(t,e){tk(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],OV);let ON=!1,OW=new eL((t,e,i,s)=>{ON||(ON=!0,t(gg).to(OV).inSingletonScope(),t(OV).toService(gg))});function OU(){OU.__loaded||(OU.__loaded=!0,lF.RegisterGraphicCreator("glyph",OR),e7.load(OD),e7.load(gi?Oj:OW))}OU.__loaded=!1;class OG extends _x{constructor(){super(...arguments),this._setStateOfGraphic=t=>{t.clearStates(),t.stateProxy=null,t.context.diffState!==W.enter&&t.context.diffState!==W.update||(t.glyphStateProxy=(e,i)=>{var s;let r={attributes:Object.assign(Object.assign({},this._runEncoderOfGraphic(null==(s=this._encoderOfState)?void 0:s[e],t)),t.runtimeStateCache?t.runtimeStateCache[e]:null)};return t.glyphStates?t.glyphStates[e]||(t.glyphStates[e]=r):t.glyphStates={[e]:r},r},t.useStates(t.context.states))}}getSubMarks(){return this._subMarks}setGlyphConfig(t){this._glyphConfig=t}getGlyphConfig(){return this._glyphConfig}getPositionChannels(){return this._positionChannels}_onGlyphAttributeUpdate(t){return e=>{var i,s;let r=this.getPositionChannels(),a=r&&this._positionEncoder&&Object.keys(e).some(t=>
2r.includes(t))?this._positionEncoder(e,null==(s=null==(i=null==t?void 0:t.context)?void 0:i.data)?void 0:s[0],t):null;return this._channelEncoder&&Object.keys(this._channelEncoder).forEach(t=>{if(t in e){let i=this._channelEncoder[t](e[t]);a=a?eB(a,i):i}}),a&&t.getSubGraphic().forEach(t=>{t&&a[t.name]&&t.setAttributes(a[t.name])}),e}}_createGraphic(t={}){let e=OR(t);e.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(e);let i=this._subMarks;if(i){let t=[];Object.keys(i).forEach(e=>{let s=uP.createGraphicComponent(i[e].type,Object.assign({},i[e].defaultAttributes));s&&(t.push(s),s.name=e,s.onBeforeAttributeUpdate=t=>t)}),e.setSubGraphic(t)}return e.onBeforeAttributeUpdate(t),e}_runProgressiveEncoder(t){this._runEncoder(t)}}let OY=()=>{uP.registerGraphicComponent("glyph",OR),_k(),OU()},O$=["x","y","minMaxWidth","minMaxHeight","q1q3Width","q1q3Height","q1","q3","min","max","median","angle"],OX=["x","y","boxWidth","boxHeight","ruleWidth","ruleHeight","q1","q3","min","max","median","angle"];class OK extends OG{constructor(){super(...arguments),this.type=OK.type}_isHorizontal(){return this._glyphConfig&&"horizontal"===this._glyphConfig.direction}setGlyphConfig(t){super.setGlyphConfig(t),"bar"===t.shaftShape?(this._subMarks={minMaxBox:{type:"rect",defaultAttributes:{lineWidth:0}},q1q3Box:{type:"rect",defaultAttributes:{lineWidth:0}},median:{type:"line",defaultAttributes:{x:0,y:0}}},this._positionChannels=O$,this._channelEncoder={minMaxFillOpacity:t=>({minMaxBox:{fillOpacity:t}}),lineWidth:t=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}}),stroke:t=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}})},this._positionEncoder=(t,e,i)=>{var s;let{x:r=i.attribute.x,y:a=i.attribute.y,minMaxWidth:n=i.attribute.minMaxWidth,minMaxHeight:l=i.attribute.minMaxHeight,q1q3Width:o=i.attribute.q1q3Width,q1q3Height:h=i.attribute.q1q3Height,q1:u=i.attribute.q1,q3:d=i.attribute.q3,min:c=i.attribute.min,max:p=i.attribute.max,median:g=i.attribute.median,angle:f}=t,m=this._isHorizontal(),_={};if(m?(_.minMaxBox={x:c,x1:p,y:a-l/2,y1:a+l/2},_.q1q3Box={x:u,x1:d,y:a-h/2,y1:a+h/2},_.median={points:[{x:g,y:a-h/2},{x:g,y:a+h/2}]}):(_.minMaxBox={y:c,y1:p,x:r-n/2,x1:r+n/2},_.q1q3Box={y:u,y1:d,x:r-o/2,x1:r+o/2},_.median={points:[{y:g,x:r-o/2},{y:g,x:r+o/2}]}),eP(f)){let e=null!=(s=t.anchor)?s:m?[(c+p)/2,a]:[r,(c+p)/2];Object.keys(_).forEach(t=>{_[t].angle=f,_[t].anchor=e})}return _}):(this._subMarks={shaft:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"},max:{type:"line",defaultAttributes:{x:0,y:0}},min:{type:"line",defaultAttributes:{x:0,y:0}},median:{type:"line",defaultAttributes:{x:0,y:0}}},this._positionChannels=OX,this._channelEncoder={boxStroke:t=>({box:{stroke:t}}),medianStroke:t=>({median:{stroke:t}}),boxCornerRadius:t=>({box:{cornerRadius:t}})},this._positionEncoder=(t,e,i)=>{var s;let{x:r=i.attribute.x,y:a=i.attribute.y,boxWidth:n=i.attribute.boxWidth,boxHeight:l=i.attribute.boxHeight,ruleWidth:o=i.attribute.ruleWidth,ruleHeight:h=i.attribute.ruleHeight,q1:u=i.attribute.q1,q3:d=i.attribute.q3,min:c=i.attribute.min,max:p=i.attribute.max,median:g=i.attribute.median,angle:f}=t,m=this._isHorizontal(),_={};if(m?(_.box={x:u,x1:d,y:a-l/2,y1:a+l/2},_.median={points:[{x:g,y:a-l/2},{x:g,y:a+l/2}]},_.shaft={points:[{x:c,y:a},{x:p,y:a}]},_.max={points:[{x:p,y:a-h/2},{x:p,y:a+h/2}]},_.min={points:[{x:c,y:a-h/2},{x:c,y:a+h/2}]}):(_.box={x:r-n/2,x1:r+n/2,y:u,y1:d},_.median={points:[{x:r-n/2,y:g},{x:r+n/2,y:g}]},_.max={points:[{x:r-o/2,y:p},{x:r+o/2,y:p}]},_.min={points:[{x:r-o/2,y:c},{x:r+o/2,y:c}]},_.shaft={points:[{x:r,y:c},{x:r,y:p}]}),eP(f)){let e=null!=(s=t.anchor)?s:m?[(c+p)/2,a]:[r,(c+p)/2];Object.keys(_).forEach(t=>{_[t].angle=f,_[t].anchor=e})}return _})}setDataLabelType(){return"symbol"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}}OK.type="boxPlot";let Oq=Object.assign(Object.assign({},bc),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}}),OZ=t=>(e,i,s)=>{var r;let a=e.getFinalAttribute(),n=t(e,null!=(r=a.direction)?r:"vertical",i);if(!eP(n))return{};let{x:l,y:o,min:h,max:u,q1:d,q3:c,median:p}=a,g={from:{x:l,y:o},to:{x:l,y:o}};return eP(h)&&(g.from.min=n,g.to.min=h),eP(u)&&(g.from.max=n,g.to.max=u),eP(d)&&(g.from.q1=n,g.to.q1=d),eP(c)&&(g.from.q3=n,g.to.q3=c),eP(p)&&(g.from.median=n,g.to.median=p),g},OJ=t=>(e,i,s)=>{var r;let a=e.getFinalAttribute(),n=t(e,null!=(r=a.direction)?r:"vertical",i);if(!eP(n))return{};let{x:l,y:o,min:h,max:u,q1:d,q3:c,median:p}=a,g={from:{x:l,y:o},to:{x:l,y:o}};return eP(h)&&(g.to.min=n,g.from.min=h),eP(u)&&(g.to.max=n,g.from.max=u),eP(d)&&(g.to.q1=n,g.from.q1=d),eP(c)&&(g.to.q3=n,g.from.q3=c),eP(p)&&(g.to.median=n,g.from.median=p),g},OQ=(t,e)=>t.getSubGraphic().find(t=>t.name===e),O0=(t,e,i)=>{var s,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x,S,A,k;let M,w,T,C,B;if(i&&eP(i.center))return i.center;if("horizontal"===e){M=null==(a=null==(r=(null==(s=OQ(t,"median"))?void 0:s.attribute).points)?void 0:r[0])?void 0:a.x,w=null==(h=null==(o=null==(l=null==(n=OQ(t,"max"))?void 0:n.attribute)?void 0:l.points)?void 0:o[0])?void 0:h.x,T=null==(p=null==(c=null==(d=null==(u=OQ(t,"min"))?void 0:u.attribute)?void 0:d.points)?void 0:c[0])?void 0:p.x;let e=OQ(t,"box").attribute.width,i=OQ(t,"box").attribute.x;C=i,B=i+e}else{M=null==(m=null==(f=(null==(g=OQ(t,"median"))?void 0:g.attribute).points)?void 0:f[0])?void 0:m.y,w=null==(b=null==(v=null==(y=null==(_=OQ(t,"max"))?void 0:_.attribute)?void 0:y.points)?void 0:v[0])?void 0:b.y,T=null==(k=null==(A=null==(S=null==(x=OQ(t,"min"))?void 0:x.attribute)?void 0:S.points)?void 0:A[0])?void 0:k.y;let e=OQ(t,"box").attribute.height,i=OQ(t,"box").attribute.y;C=i,B=i+e}return eP(M)?M:eP(C)&&eP(B)?(C+B)/2:eP(w)&&eP(T)?(w+T)/2:eP(T)?T:eP(w)?w:NaN},O1=(t,e,i)=>{var s,r,a,n,l,o,h,u,d,c,p,g,f,m;let _,y,v,b,x;if(eP(null==i?void 0:i.center))return i.center;if("horizontal"===e){_=null==(a=null==(r=(null==(s=OQ(t,"median"))?void 0:s.attribute).points)?void 0:r[0])?void 0:a.x;let e=(null==(n=OQ(t,"minMaxBox"))?void 0:n.attribute).width,i=null==(l=OQ(t,"minMaxBox"))?void 0:l.attribute.x;v=i,y=i+e;let u=(null==(o=OQ(t,"q1q3Box"))?void 0:o.attribute).width,d=null==(h=OQ(t,"q1q3Box"))?void 0:h.attribute.x;b=d,x=d+u}else{_=null==(c=null==(d=(null==(u=OQ(t,"median"))?void 0:u.attribute).points)?void 0:d[0])?void 0:c.y;let e=(null==(p=OQ(t,"minMaxBox"))?void 0:p.attribute).height,i=null==(g=OQ(t,"minMaxBox"))?void 0:g.attribute.y;v=i,y=i+e;let s=(null==(f=OQ(t,"q1q3Box"))?void 0:f.attribute).height,r=null==(m=OQ(t,"q1q3Box"))?void 0:m.attribute.y;b=r,x=r+s}return eP(_)?_:eP(b)&&eP(x)?(b+x)/2:eP(y)&&eP(v)?(y+v)/2:eP(v)?v:eP(y)?y:NaN};class O2 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){super.onBind();let t=this.target.getFinalAttribute();t&&this.target.setAttributes(t);let{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter(t=>null!=i[t]),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return OZ(O0)(this.target,this.params,this.params.options)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.setAttributes(s)}}class O3 extends m7{constructor(t,e,i,s,r){super(t,e,i,s,r)}onBind(){var t;
2(null==(t=this.params)?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);let{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter(t=>null!=i[t]),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return OJ(O0)(this.target,this.params,this.params.options)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.setAttributes(s)}}class O5 extends O2{computeAttribute(){return OZ(O1)(this.target,this.params,this.params.options)}}class O4 extends O3{computeAttribute(){return OJ(O1)(this.target,this.params,this.params.options)}}class O8 extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"boxPlot")}}class O6 extends bP{constructor(){super(...arguments),this.type=dD.boxPlot,this.transformerConstructor=O8,this._bandPosition=0}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,r,a,n;super.setAttrFromSpec();let l=null!=(e=null==(t=this._spec.boxPlot)?void 0:t.style)?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=l.lineWidth)?i:2,this._boxWidth=l.boxWidth,this._shaftShape=null!=(s=l.shaftShape)?s:"line",this._shaftWidth=l.shaftWidth,this._boxFillColor=l.boxFill,this._strokeColor=l.stroke,this._shaftFillOpacity="bar"===this._shaftShape?null!=(r=l.shaftFillOpacity)?r:.5:void 0,this._outliersStyle=null!=(a=this._spec.outliersStyle)?a:null==(n=this._spec.outlier)?void 0:n.style}initMark(){this._boxPlotMark=this._createMark(O6.mark.boxPlot,{groupKey:this._seriesField,isSeriesMark:!0}),this._outliersField&&(this._outlierMark=this._createMark(O6.mark.outlier,{key:pS,groupKey:this._seriesField}),this._outlierMark.setData(this._outlierData))}initMarkStyle(){var t,e,i,s,r,a;let n=this._boxPlotMark;if(n){let i={lineWidth:this._lineWidth,fill:null!=(t=this._boxFillColor)?t:"line"!==this._shaftShape?this.getColorAttribute():"#FFF",minMaxFillOpacity:this._shaftFillOpacity,stroke:null!=(e=this._strokeColor)?e:"line"!==this._shaftShape?"#000":this.getColorAttribute()};n.setGlyphConfig({direction:this._direction,shaftShape:this._shaftShape});let s="horizontal"===this._direction?{y:t=>this._getPosition(this.direction,t),boxHeight:()=>{var t;return hX(null!=(t=this._boxWidth)?t:"100%",this._getMarkWidth())},ruleHeight:()=>{var t;return hX(null!=(t=this._shaftWidth)?t:"100%",this._getMarkWidth())},q1q3Height:()=>{var t;return hX(null!=(t=this._boxWidth)?t:"100%",this._getMarkWidth())},minMaxHeight:()=>{var t;return hX(null!=(t=this._shaftWidth)?t:"100%",this._getMarkWidth())}}:{x:t=>this._getPosition(this.direction,t),boxWidth:()=>{var t;return hX(null!=(t=this._boxWidth)?t:"100%",this._getMarkWidth())},ruleWidth:()=>{var t;return hX(null!=(t=this._shaftWidth)?t:"100%",this._getMarkWidth())},q1q3Width:()=>{var t;return hX(null!=(t=this._boxWidth)?t:"100%",this._getMarkWidth())},minMaxWidth:()=>{var t;return hX(null!=(t=this._shaftWidth)?t:"100%",this._getMarkWidth())}};this.setMarkStyle(n,i,U.STATE_NORMAL,N.Series),this.setMarkStyle(n,s,U.STATE_NORMAL,N.Built_In)}let l=this._outlierMark;l&&this.setMarkStyle(l,{fill:null!=(r=null!=(s=null==(i=this._outliersStyle)?void 0:i.fill)?s:this._boxFillColor)?r:this.getColorAttribute(),stroke:this.getColorAttribute(),size:ed(null==(a=this._outliersStyle)?void 0:a.size)?this._outliersStyle.size:10},U.STATE_NORMAL,N.Series)}initBoxPlotMarkStyle(){var t,e;let i=this._boxPlotMark,s="horizontal"===this._direction?this._xAxisHelper:this._yAxisHelper;if(i&&s){let{dataToPosition:e}=s,r=null==(t=null==s?void 0:s.getScale)?void 0:t.call(s,0);this.setMarkStyle(i,{min:t=>mB(e(this.getDatumPositionValues(t,this._minField),{bandPosition:this._bandPosition}),r),q1:t=>mB(e(this.getDatumPositionValues(t,this._q1Field),{bandPosition:this._bandPosition}),r),median:t=>mB(e(this.getDatumPositionValues(t,this._medianField),{bandPosition:this._bandPosition}),r),q3:t=>mB(e(this.getDatumPositionValues(t,this._q3Field),{bandPosition:this._bandPosition}),r),max:t=>mB(e(this.getDatumPositionValues(t,this._maxField),{bandPosition:this._bandPosition}),r)},U.STATE_NORMAL,N.Series)}let r=this._outlierMark;if(r&&s){let{dataToPosition:t}=s,i=null==(e=null==s?void 0:s.getScale)?void 0:e.call(s,0),a="horizontal"===this._direction?{y:t=>this._getPosition(this.direction,t),x:e=>mB(t(this.getDatumPositionValues(e,OB),{bandPosition:this._bandPosition}),i)}:{x:t=>this._getPosition(this.direction,t),y:e=>mB(t(this.getDatumPositionValues(e,OB),{bandPosition:this._bandPosition}),i)};this.setMarkStyle(r,a,U.STATE_NORMAL,N.Series)}}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMedianField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initData(){if(super.initData(),!this._data)return;c3(this._dataSet,"foldOutlierData",OE),c3(this._dataSet,"addVChartProperty",vJ);let t=new eR(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${px.H}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:"horizontal"===this._direction?this._fieldY:this._fieldX,outliersField:this._outliersField,seriesField:this._seriesField}}
2),t.transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1),this._outlierData=new mz(this._option,t)}compileData(){var t;super.compileData(),null==(t=this._outlierData)||t.compile()}viewDataUpdate(t){var e;super.viewDataUpdate(t),null==(e=this._outlierData)||e.updateData()}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){var t,e;if(this._autoBoxWidth)return this._autoBoxWidth;let i="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,s=this._groups?this._groups.fields.length:1,r=null!=(e=null==(t=i.getBandwidth)?void 0:t.call(i,s-1))?e:Math.max(this._boxWidth,this._shaftWidth),a=r;return(0,eA.A)(this._spec.boxWidth)&&(a=hX(this._spec.boxWidth,r)),(0,eA.A)(this._spec.boxMinWidth)&&(a=Math.max(a,hX(this._spec.boxMinWidth,r))),(0,eA.A)(this._spec.boxMaxWidth)&&(a=Math.min(a,hX(this._spec.boxMaxWidth,r))),this._autoBoxWidth=a,this._autoBoxWidth}_getPosition(t,e){var i,s,r,a,n,l;let o,h,u;"horizontal"===t?(o=this.getYAxisHelper(),h="boxHeight",u=this.dataToPositionY.bind(this)):(o=this.getXAxisHelper(),h="boxWidth",u=this.dataToPositionX.bind(this));let d=o.getScale(0),c=this._groups?this._groups.fields.length:1,p=null!=(s=null==(i=o.getBandwidth)?void 0:i.call(o,c-1))?s:Math.max(this._boxWidth,this._shaftWidth),g=this._boxPlotMark.getAttribute(h,e);if(c>1&&(0,eA.A)(this._spec.boxGapInGroup)){let t=this._groups.fields,i=oS(this._spec.boxGapInGroup),s=0,h=0;for(let l=t.length-1;l>=1;l--){let u=t[l],d=null!=(a=null==(r=o.getScale(l))?void 0:r.domain())?a:[],c=d.length,f=hX(null!=(n=i[l-1])?n:oA(i),p),m=d.indexOf(e[u]);l===t.length-1?(s+=c*g+(c-1)*f,h+=m*(g+f)):(h+=m*(s+f),s+=s+(c-1)*f)}return d.scale(e[t[0]])+(null!=(l=o.getBandwidth(0))?l:Math.max(this._boxWidth,this._shaftWidth))/2-s/2+h+g/2}let f=fI(d.type||"band");return u(e)+.5*p+(f?-p/2:0)}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}_initAnimationSpec(t={}){let e=eB({},t);return["appear","enter","update","exit","disappear"].forEach(t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="bar"===this._shaftShape?"barBoxplotScaleIn":"boxplotScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="bar"===this._shaftShape?"barBoxplotScaleOut":"boxplotScaleOut")}),e}initAnimation(){var t,e,i,s,r,a,n;let l=bE(this);if(this._boxPlotMark){let e=this._initAnimationSpec(null==(t=uP.getAnimationInKey("scaleInOut"))?void 0:t()),i=this._initAnimationSpec(bx("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(bb(e,i,l))}if(this._outlierMark){let t={appear:null==(e=this._spec.animationAppear)?void 0:e.symbol,disappear:null==(i=this._spec.animationDisappear)?void 0:i.symbol,enter:null==(s=this._spec.animationEnter)?void 0:s.symbol,exit:null==(r=this._spec.animationExit)?void 0:r.symbol,update:null==(a=this._spec.animationUpdate)?void 0:a.symbol};this._outlierMark.setAnimationConfig(bb(null==(n=uP.getAnimationInKey("scaleInOut"))?void 0:n(),t,l))}}initTooltip(){this._tooltipHelper=new OP(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){let t=super.getStatisticFields(),e=t.find(t=>t.key===this._outliersField);return e&&(e.operations=["array-min","array-max"]),t}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}O6.type=dD.boxPlot,O6.builtInTheme={boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}}},O6.mark=Oq,O6.transformerConstructor=O8;class O9 extends Mr{_getDefaultSeriesSpec(t){var e;let i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=super._getDefaultSeriesSpec(t,["boxPlot","outlier","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle","boxWidth","boxMaxWidth","boxMinWidth","boxGapInGroup"]);return s.direction=null!=(e=t.direction)?e:"vertical",s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),fu(t)}}let O7=(t,e)=>{var i,s,r,a,n,l,o,h,u,d,c,p,g,f,m;let _=null==e?void 0:e.field;if(!_)return[];let y=null==e?void 0:e.groupField,v=null!=(i=null==e?void 0:e.whiskers)?i:1.5,b=!!(null==e?void 0:e.includeValues),x=null!=(s=null==e?void 0:e.outputN
2ames)?s:{},S=null!=(r=x.key)?r:(0,ev.A)(y)?null:null!=y?y:"key",A=null!=(a=x.count)?a:"count",k=null!=(n=x.mean)?n:"mean",M=null!=(l=x.q1)?l:"q1",w=null!=(o=x.median)?o:"median",T=null!=(h=x.q3)?h:"q3",C=null!=(u=x.iqr)?u:"iqr",B=null!=(d=x.min)?d:"min",E=null!=(c=x.max)?c:"max",P=null!=(p=x.lowerWhisker)?p:"lowerWhisker",O=null!=(g=x.upperWhisker)?g:"upperWhisker",R=null!=(f=x.outliers)?f:"outliers",I=null!=(m=x.values)?m:"values",L=new Map,D=new Map,F=new Map,z=t.length;for(let e=0;e<z;e++){let i,s=t[e],r=s[_];if((0,eE.A)(r))continue;let a=+r;if(!Number.isFinite(a))continue;i=(0,ev.A)(y)?y.map(t=>String(s[t])).join("||"):y?String(s[y]):"___all",L.has(i)||(L.set(i,[]),b&&D.set(i,[]),(0,ev.A)(y)?F.set(i,Object.fromEntries(y.map(t=>[t,s[t]]))):F.set(i,y?s[y]:null));let n=L.get(i);if(n&&n.push(a),b){let t=D.get(i);t&&t.push(s)}}(0,ev.A)(v)&&(v=[h4(Math.min.apply(null,v),0,1),h4(Math.max.apply(null,v),0,1)]);let H=[];for(let[t,e]of L){if(!e||0===e.length)continue;let i=e.slice().sort((t,e)=>t-e),s=i.length,r=i[0],a=i[i.length-1],n=0;for(let t=0;t<i.length;t++)n+=i[t];let l=n/s,o=vz(i,.25),h=vz(i,.5),u=vz(i,.75),d=u-o,c=(0,ev.A)(v)?vz(i,v[0]):o-v*d,p=(0,ev.A)(v)?vz(i,v[1]):u+v*d,g=[];for(let t=0;t<i.length;t++)(i[t]<c||i[t]>p)&&g.push(i[t]);let f={},m=F.get(t);if(null!==S)f[S]=m;else if((0,ev.A)(y)){let t=m||{};for(let e of y)f[e]=t[e]}f[A]=s,f[k]=l,f[M]=o,f[w]=h,f[T]=u,f[C]=d,f[B]=r,f[E]=a,f[P]=c,f[O]=p,f[R]=g,b&&(f[I]=D.get(t)||[]),H.push(f)}return H};class Rt extends Mu{constructor(){super(...arguments),this.transformerConstructor=O9,this.type="boxPlot",this.seriesType=dD.boxPlot}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}Rt.type="boxPlot",Rt.seriesType=dD.boxPlot,Rt.transformerConstructor=O9;let Re=t=>{let e=0;return t.forEach((t,i)=>{var s;(0,eE.A)(t.value)&&((null==(s=t.children)?void 0:s.length)?t.value=Re(t.children):t.value=0),e+=Math.abs(t.value)}),e};function Ri(t){return t.depth}function Rs(t,e){return e-1-t.endDepth}let Rr=(t,e)=>(null==t?void 0:t.y0)-(null==e?void 0:e.y0),Ra=(t,e)=>{if((0,eE.A)(t.value))return null;let i=(e?t.targetLinks:t.sourceLinks).reduce((t,e)=>((0,eE.A)(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:Ri,right:Rs,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?oM(t.sourceLinks.map(t=>i[t.target].depth))-1:0},start:Ri,end:Rs},Rl=my(0,1);class Ro{constructor(t){this._ascendingSourceBreadth=(t,e)=>Rr(this._nodeMap[t.source],this._nodeMap[e.source])||t.index-e.index,this._ascendingTargetBreadth=(t,e)=>Rr(this._nodeMap[t.target],this._nodeMap[e.target])||t.index-e.index,this.options=Object.assign({},Ro.defaultOptions,t);const e=this.options.nodeKey,i=(0,r3.A)(e)?e:e?EB(e):null;this._getNodeKey=i,this._logger=eg.getInstance(),this._alignFunc=(0,r3.A)(this.options.setNodeLayer)?t=>this.options.setNodeLayer(t.datum):Rn[this.options.nodeAlign]}layout(t,e){if(!t)return null;let 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)};"vertical"===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;let s=this.computeNodeLinks(t),r=s.nodes,a=s.links;if(this._nodeMap=s.nodeMap,this.computeNodeValues(r),this.computeNodeDepths(r),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(r),this._maxDepth<=0)return null;let n=this.computeNodeBreadths(r);if(this.computeLinkBreadths(r),r.forEach(t=>{t.sourceLinks=t.sourceLinks.filter(t=>!(0,eE.A)(t.source)&&!(0,eE.A)(t.target)),t.targetLinks=t.targetLinks.filter(t=>!(0,eE.A)(t.source)&&!(0,eE.A)(t.target))}),a=a.filter(t=>!(0,eE.A)(t.source)&&!(0,eE.A)(t.target)),"vertical"===this.options.direction)if(this.options.inverse){let t=this._viewBox.x1;
2r.forEach(e=>{let{y0:i,y1:s,x0:r,x1:a}=e;e.y0=t-a,e.y1=t-r,e.x0=i,e.x1=s}),a.forEach(e=>{e.vertical=!0;let{x0:i,x1:s,y0:r,y1:a}=e;e.x0=r,e.x1=a,e.y0=t-i,e.y1=t-s})}else r.forEach(t=>{let{y0:e,y1:i}=t;t.y0=t.x0,t.y1=t.x1,t.x0=e,t.x1=i}),a.forEach(t=>{t.vertical=!0;let e=t.x0,i=t.x1;t.x0=t.y0,t.x1=t.y1,t.y0=e,t.y1=i});else this.options.inverse&&(r.forEach(t=>{let{x0:e,x1:s}=t;t.x0=i.x1-s,t.x1=i.x1-e}),a.forEach(t=>{t.x0=i.x1-t.x0,t.x1=i.x1-t.x1}));return a.forEach(t=>{let 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:r,links:a,columns:n}}computeHierarchicNodeLinks(t){var e;let i,s,r,a,n;return e=this._getNodeKey,s=[],a={},function(t,e,i=[],s={},r){Re(t);let a=(t,n,l)=>{t.forEach((t,o)=>{let h=e?e(t):l?`${l[l.length-1].key}-${o}`:`${n}-${o}`,u=(0,eE.A)(t.value)?0:Pv(t.value);if(s[h])s[h].value=void 0;else{let e={depth:n,datum:t,index:o,key:h,value:u,sourceLinks:[],targetLinks:[]};s[h]=e,i.push(e)}l&&r&&r.push({source:l[l.length-1].key,target:h,value:u,parents:l}),t.children&&t.children.length&&a(t.children,n+1,l?l.concat([s[h]]):[s[h]])})};a(t,0,null)}(t,e,i=[],r={}
2,n=[]),n.forEach((t,e)=>{let i=`${t.source}-${t.target}`,n=(0,SD.A)(t,["parents"]);if(n.parents=t.parents.map(t=>(0,SD.A)(t,["sourceLinks","targetLinks"])),a[i])return a[i].value+=Pv(t.value),void a[i].datum.push(n);let l={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[n],value:t.value,parents:t.parents.map(t=>t.key)};s.push(l),r[t.source].sourceLinks.push(l),r[t.target].targetLinks.push(l),a[i]=l}),{nodes:i,links:s,nodeMap:r}}computeSourceTargetNodeLinks(t){let e=[],i=[],s={};t.nodes&&t.nodes.forEach((t,i)=>{let r={depth:-1,datum:t,index:i,key:this._getNodeKey?this._getNodeKey(t):i,value:t.value,sourceLinks:[],targetLinks:[]};s[r.key]=r,e.push(r)});let r=[];return t.links.forEach((a,n)=>{let l=!(0,eE.A)(a.source),o=!(0,eE.A)(a.target);if(t.nodes&&(!s[a.source]||!s[a.target]))return;t.nodes||!l||s[a.source]||(s[a.source]={value:void 0,depth:-1,index:e.length,key:a.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[a.source])),t.nodes||!o||s[a.target]||(s[a.target]={value:void 0,depth:-1,index:e.length,key:a.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[a.target]));let h={index:n,source:a.source,target:a.target,datum:a,value:a.value};this.options.divideNodeValueToLink&&(0,eE.A)(a.value)&&r.push(h),i.push(h),l&&s[a.source].sourceLinks.push(h),o&&s[a.target].targetLinks.push(h)}),this.options.divideNodeValueToLink&&r.length&&r.forEach(t=>{let e=[Ra(s[t.source]),Ra(s[t.target],!0)].filter(t=>!(0,eE.A)(t));e.length&&(t.value=oM(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,s=e.links;if(this.options.linkSortBy)for(let t=0,e=i.length;t<e;t++)i[t].sourceLinks.sort(this.options.linkSortBy),i[t].targetLinks.sort(this.options.linkSortBy);return this.options.dropIsolatedNode&&(i=i.filter(t=>t.targetLinks.length||t.sourceLinks.length)),{nodes:i,links:s,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e<i;e++){let i=t[e];i.value=Math.max((0,eE.A)(i.value)?0:Pv(i.value),i.sourceLinks.reduce((t,e)=>{var i;return t+(null!=(i=Pv(e.value))?i:0)},0),i.targetLinks.reduce((t,e)=>{var i;return t+(null!=(i=Pv(e.value))?i:0)},0))}}computeNodeDepths(t){var e;let i=t.length,s,r,a=t,n=0,l=-1,o=(0,r3.A)(this.options.setNodeLayer)?this.options.setNodeLayer:null;for(;a.length&&n<i;){s=[],r={};for(let t=0,i=a.length;t<i;t++){let i=a[t];if(i&&(i.depth=o&&null!=(e=o(i.datum))?e:n,o&&(l=Math.max(i.depth,l)),i.sourceLinks&&i.sourceLinks.length))for(let t=0,e=i.sourceLinks.length;t<e;t++){let e=i.sourceLinks[t];r[e.target]||(s.push(this._nodeMap[e.target]),r[e.target]=!0)}}a=s,n+=1}n>i&&this._logger.warn("Error: there is a circular link"),this._maxDepth=o?l+1:n}computeNodeEndDepths(t){let e=t.length,i,s,r=t,a=0;for(;r.length&&a<e;){i=[],s={};for(let t=0,e=r.length;t<e;t++){let e=r[t];if(e){e.endDepth=a;for(let t=0,r=e.targetLinks.length;t<r;t++){let r=e.targetLinks[t];s[r.source]||(i.push(this._nodeMap[r.source]),s[r.source]=!0)}}}r=i,a+=1}a>e&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){let e=this.options.nodeWidth,i=this.options.linkWidth,s=this.options.minStepWidth,r=this._viewBox.width,a=null,n=null,l=!1;if((0,eS.A)(e)){let t=h4(parseFloat(e.replace("%",""))/100,0,1),i=r/(this._maxDepth-1+t);s>0&&(i=Math.max(s,i)),a=i*t,n=i*(1-t),l=!0}else if(ed(e)){if(a=e,ed(i))n=i;else if((0,eE.A)(i)){let t=(r-e)/(this._maxDepth-1);s>0&&(t=Math.max(s,t)),n=t-e}l=!0}else(0,r3.A)(e)&&ed(i)&&(n=i);let o=[];for(let e=0,i=t.length;e<i;e++){let i=t[e];i.layer=this._isHierarchic?i.depth:h4(Math.floor(this._alignFunc(i,this._maxDepth,this._nodeMap)),0,this._maxDepth-1);let s=i.layer;s===this._maxDepth-1&&(i.isLastLayer=!0),l&&(i.x0=this._viewBox.x0+s*(a+n),i.x1=i.x0+a),o[s]?o[s].push(i):o[s]=[i]}if(this.options.nodeSortBy)for(let t=0,e=o.length;t<e;t++)o[t].sort(this.options.nodeSortBy);if(!l&&(0,r3.A)(e)){let t=this._viewBox.x0;for(let s=0;s<this._maxDepth;s++){let r=o[s],l=0,h=0;for(let s=0,o=r&&r.length;s<o;s++){let o=r[s],u=e(o);o.x0=t,o.x1=t+u,l=Math.max(a,u);let d=o.sourceLinks;for(let t=0,e=d.length;t<e;t++){let e=d[t];h=Math.max(h,(0,r3.A)(i)?i(e,this._viewBox):n)}}t+=l+h}}return o}initializeNodeBreadths(t){var e,i,s;let r=null!=(e=this.options.minLinkHeight)?e:0,a=null!=(i=this.options.minNodeHeight)?i:0,n=null!=(s=this.options.maxNodeHeight)?s:1/0,l=this.options.maxLinkHeight;((0,eE.A)(a)||a<r)&&(a=r),((0,eE.A)(l)||l>n)&&(l=n);let o=0,h=null,u=null;if((0,r3.A)(this.options.nodeGap))h=this.options.nodeGap,o=t.reduce((t,e)=>{let 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{let 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>i&&(s=a>=i?i/2:(i-a)/2,a=Math.min(i-s,a)),h=()=>s,this._gapY=s,this.options.equalNodeHeight)u=this._viewBox.height/e-s;else{let e=a>0?Math.max(s,a):s;o=t.reduce((t,i)=>{let s=i.reduce((t,e)=>t+e.value,0);return Math.min(t,(this._viewBox.height-((i.length-1)*e+a))/s)},1/0)}}let d="start"===this.options.gapPosition,c=!d&&"end"!==this.options.gapPosition,p=ed(this.options.nodeHeight)?t=>this.options.nodeHeight:(0,r3.A)(this.options.nodeHeight)?this.options.nodeHeight:u>0?t=>u:t=>Math.max(t.value*o,0),g=ed(this.options.linkHeight)?()=>this.options.linkHeight:(0,r3.A)(this.options.linkHeight)?this.options.linkHeight:(t,e,i)=>Math.min(Math.max(e.value?i*Rl(t.value/e.value):0,r,0),l);for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i||!i.length)continue;let s=this._viewBox.y0,r=0,l=0,o=0;for(let t=0,e=i.length;t<e;t++){let e=i[t];r=h(e),d&&(s+=r),l=Math.min(Math.max(o=p(e),a),n),e.y0=s,e.y1=s+l,s=d?e.y1:e.y1+r;for(let t=0,i=e.sourceLinks.length;t<i;t++){let i=e.sourceLinks[t];i.thickness=g(i,e,o)}}let u=this._viewBox.y1-s+(c?r:0);if(u>0)if("start"===this.options.crossNodeAlign);else if("end"===this.options.crossNodeAlign)for(let t=0,e=i.length;t<e;++t){let e=i[t];e.y0+=u,e.y1+=u}else if("parent"===this.options.crossNodeAlign){let s=i.reduce((t,e)=>
2(e.targetLinks&&e.targetLinks.length&&e.targetLinks.forEach(e=>{t[e.source]=!0}),t),{});if(Object.keys(s).length&&t[e-1]&&t[e-1].length){let r=t[e-1].filter(t=>s[t.key]);if(r&&r.length&&r[0].y0!==i[0].y0){let t=r[0].y0-i[0].y0;for(let e=0,s=i.length;e<s;++e){let s=i[e];s.y0+=t,s.y1+=t}}}}else{u/=i.length+1;for(let t=0,e=i.length;t<e;++t){let e=i[t];e.y0+=u*(t+1),e.y1+=u*(t+1)}}else if(u<0&&i.length>1&&r+(u/=i.length-1)>=0){r+=u,this._gapY=Math.min(r);for(let t=1,e=i.length;t<e;++t){let e=i[t];e.y0+=u*t,e.y1+=u*t}}this.reorderLinks(i)}}computeNodeBreadths(t){let e=this.computeNodeLayers(t);this.initializeNodeBreadths(e);let i=this.options.iterations;if(!this._isHierarchic&&!(0,r3.A)(this.options.setNodeLayer)&&!(0,r3.A)(this.options.nodeGap))for(let t=0;t<i;++t){let s=Math.pow(.99,t),r=Math.max(1-s,(t+1)/i);this.relaxRightToLeft(e,s,r),this.relaxLeftToRight(e,s,r)}return e}relaxLeftToRight(t,e,i){for(let s=1,r=t.length;s<r;++s){let r=t[s];for(let t=0,i=r.length;t<i;t++){let i=r[t],s=0,a=0;for(let t=0,e=i.targetLinks.length;t<e;t++){let e=i.targetLinks[t],r=e.value*(i.layer-this._nodeMap[e.source].layer);s+=this.targetTop(this._nodeMap[e.source],i)*r,a+=r}if(!(a>0))continue;let n=(s/a-i.y0)*e;i.y0+=n,i.y1+=n,this.reorderNodeLinks(i)}(0,eE.A)(this.options.nodeSortBy)&&r.sort(Rr),this.resolveCollisions(r,i)}}relaxRightToLeft(t,e,i){for(let s=t.length-2;s>=0;--s){let r=t[s];for(let t=0,i=r.length;t<i;t++){let i=r[t],s=0,a=0;for(let t=0,e=i.sourceLinks.length;t<e;t++){let e=i.sourceLinks[t],r=e.value*(this._nodeMap[e.target].layer-i.layer);s+=this.sourceTop(i,this._nodeMap[e.target])*r,a+=r}if(!(a>0))continue;let n=(s/a-i.y0)*e;i.y0+=n,i.y1+=n,this.reorderNodeLinks(i)}void 0===this.options.nodeSortBy&&r.sort(Rr),this.resolveCollisions(r,i)}}resolveCollisions(t,e){let 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(;i<t.length;++i){let r=t[i],a=(e-r.y0)*s;a>1e-6&&(r.y0+=a,r.y1+=a),e=r.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,s){for(;i>=0;--i){let r=t[i],a=(r.y1-e)*s;a>1e-6&&(r.y0-=a,r.y1-=a),e=r.y0-this._gapY}}targetTop(t,e){let i,s,r,a=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,s=t.sourceLinks.length;i<s&&(r=t.sourceLinks[i]).target!==e.key;i++)a+=r.thickness+this._gapY;for(i=0,s=e.targetLinks.length;i<s&&(r=e.targetLinks[i]).source!==t.key;i++)a-=r.thickness;return a}sourceTop(t,e){let i,s,r,a=e.y0-(e.targetLinks.length-1)*this._gapY/2;for(i=0,s=e.targetLinks.length;i<s&&(r=e.targetLinks[i]).source!==t.key;i++)a+=r.thickness+this._gapY;for(i=0,s=t.sourceLinks.length;i<s&&(r=t.sourceLinks[i]).target!==e.key;i++)a-=r.thickness;return a}computeLinkBreadthsNoOverlap(t){for(let e=0,i=t.length;e<i;e++){let i=t[e],s=i.y0,r=!1;for(let t=0,e=i.sourceLinks.length;t<e;t++){let e=i.sourceLinks[t];r||(e.y0=s+e.thickness/2),e.x0=i.x1,s+e.thickness>i.y1||r?(e.y0=i.y1-e.thickness/2,r=!0):s+=e.thickness}let a=i.y0;r=!1;for(let t=0,e=i.targetLinks.length;t<e;t++){let e=i.targetLinks[t];r||(e.y1=a+e.thickness/2),e.x1=i.x0,a+e.thickness>i.y1||r?(e.y1=i.y1-e.thickness/2,r=!0):a+=e.thickness}}}computeLinkBreadthsOverlap(t){let e=this.options.linkOverlap;for(let i=0,s=t.length;i<s;i++){let s=t[i],r="start"===e?s.y0:"end"===e?s.y1:(s.y0+s.y1)/2,a="start"===e?.5:"end"===e?-.5:0;for(let t=0,e=s.sourceLinks.length;t<e;t++){let e=s.sourceLinks[t];e.y0=r+a*e.thickness,e.x0=s.x1}for(let t=0,e=s.targetLinks.length;t<e;t++){let e=s.targetLinks[t];e.y1=r+a*e.thickness,e.x1=s.x0}}}computeLinkBreadths(t){this.options.linkOverlap?this.computeLinkBreadthsOverlap(t):this.computeLinkBreadthsNoOverlap(t)}reorderNodeLinks(t){if((0,eE.A)(this.options.linkSortBy)){let e=t.targetLinks,i=t.sourceLinks;for(let t=0,i=e.length;t<i;t++){let i=e[t];this._nodeMap[i.source].sourceLinks.sort(this._ascendingTargetBreadth)}for(let t=0,e=i.length;t<e;t++){let e=i[t];this._nodeMap[e.target].targetLinks.sort(this._ascendingSourceBreadth)}}}reorderLinks(t){if((0,eE.A)(this.options.linkSortBy))for(let e=0,i=t.length;e<i;e++){let i=t[e];i.sourceLinks.sort(this._ascendingTargetBreadth),i.targetLinks.sort(this._ascendingSourceBreadth)}}}Ro.defaultOptions={iterations:6,nodeAlign:"justify",direction:"horizontal",nodeWidth:24,nodeGap:8,crossNodeAlign:"middle",dropIsolatedNode:!0};
2let Rh=(t,e,i)=>{e.forEach(e=>{(0,eE.A)(e[i])||t.add(e[i]),e.children&&e.children.length>0&&Rh(t,e.children,i)})},Ru=t=>{var e;if(!t||!(0,ev.A)(t))return[];if(t.length>1){let 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.latestData)?t[0].latestData:t},Rd=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];let 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[];let s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){let t=[];s.links.forEach(i=>{let s={};for(let 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}let r=new Ro(e),a=[];return a.push(r.layout(s,i)),a},Rc=t=>{var e,i;return t&&(0,ev.A)(t)&&(null==(e=t[0])?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!=(i=t[0].latestData[0].nodes)?i:[]},Rp=t=>{var e,i;return t&&(0,ev.A)(t)&&(null==(e=t[0])?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!=(i=t[0].latestData[0].links)?i:[]};class Rg extends bt{constructor(){super(...arguments),this._getDimensionData=t=>{if(!(0,eE.A)(null==t?void 0:t.source)&&!(0,eE.A)(null==t?void 0:t.target)){if(ed(t.source)){let 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}}class Rf extends m7{onBind(){var t,e,i,s;let r;super.onBind(),(null==(t=this.params)?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);let{from:a,to:n}=(s=this.target,this.params.options,this.params,{from:Object.assign({},r={x0:s.getFinalAttribute().x0,x1:s.getFinalAttribute().x1,y0:s.getFinalAttribute().y0,y1:s.getFinalAttribute().y1,thickness:s.getFinalAttribute().thickness},{x1:r.x0,y1:r.y0}),to:r}),l=null!=(i=null==(e=this.target.context)?void 0:e.lastAttrs)?i:a,o=this.target.getFinalAttribute();o&&Object.assign(this.target.attribute,o),this.props=n,this.propKeys=Object.keys(n).filter(t=>null!=n[t]),this.animate.reSyncProps(),this.from=l,this.to=n,this.target.setAttributes(l)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.setAttributes(s)}}class Rm extends m7{onBind(){var t,e,i,s;let r;super.onBind(),(null==(t=this.params)?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);let{from:a,to:n}=(s=this.target,this.params.options,this.params,{from:r={x0:s.getFinalAttribute().x0,x1:s.getFinalAttribute().x1,y0:s.getFinalAttribute().y0,y1:s.getFinalAttribute().y1,thickness:s.getFinalAttribute().thickness},to:Object.assign({},r,{x1:r.x0,y1:r.y0})}),l=null!=(i=null==(e=this.target.context)?void 0:e.lastAttrs)?i:a;this.props=n,this.propKeys=Object.keys(n).filter(t=>null!=n[t]),this.animate.reSyncProps(),this.from=l,this.to=n,this.target.setAttributes(l)}onUpdate(t,e,i){let s=this.target.attribute;this.propKeys.forEach(t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e}),this.target.setAttributes(s)}}let R_=(t,e)=>{var i;let s=null!=(i=t.curvature)?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.x0,n=t.x1,l=t.y0,o=t.y1,h=a+s*(n-a),u=n+s*(a-n),d=t=>t;!1!==t.round&&(a=Math.round(a),n=Math.round(n),l=Math.round(l),o=Math.round(o),h=Math.round(h),u=Math.round(u),d=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(l=d(t.y0-r/2),o=d(t.y1-r/2)):"end"===t.align?(l=d(t.y0+t.thickness/2-r),o=d(t.y1+t.thickness/2-r)):(l=d(t.y0-t.thickness/2),o=d(t.y1-t.thickness/2));let c=d(l+r),p=d(o+r),g=Math.abs(n-a)>1e-6,f=t.endArrow&&g?`L${n},${d(o-r/2)}L${d(n+r)},${d((o+p)/2)}L${n},${d(p+r/2)}`:"",m=t.startArrow&&g?`L${a},${d(c+r/2)}L${d(a-r)},${d((l+c)/2)}L${a},${d(l-r/2)}`:"";return"line"===t.pathType?`M${a},${l}L${n},${o}${f}L${n},${p}L${a},${c}${m}Z`:"polyline"===t.pathType?`M${a},${l}L${h},${l}L${h},${o}L${n},${o} 3 ${f}L${n},${p}L${h},${p}L${h},${c}L${a},${c}${m}Z`:`M${a},${l}C${h},${l},${u},${o},${n},${o} 4 ${f}L${n},${p}C${u},${p},${h},${c},${a},${c}${m}Z`},Ry=(t,e)=>{var i;let s=null!=(i=t.curvature)?i:.5,r="number"==typeof e?t.thickness*e:t.thickness,a=t.y0,n=t.y1,l=t.x0,o=t.x1,h=a+s*(n-a),u=n+s*(a-n),d=t=>t;!1!==t.round&&(d=Math.round,a=Math.round(a),n=Math.round(n),l=Math.round(l),o=Math.round(o),h=Math.round(h),u=Math.round(u)),"line"===t.pathType||t.pathType,"center"===t.align?(l=d(t.x0-r/2),o=d(t.x1-r/2)):"end"===t.align?(l=d(t.x0+t.thickness/2-r),o=d(t.x1+t.thickness/2-r)):(l=d(t.x0-t.thickness/2),o=d(t.x1-t.thickness/2));let c=d(l+r),p=d(o+r),g=Math.abs(n-a)>1e-6,f=t.endArrow&&g?`L${d(o-r/2)},${n}L${d((o+p)/2)},${d(n+r)}L${d(p+r/2)},${n}`:"",m=t.startArrow&&g?`L${d(c+r/2)},${a}L${d((c+l)/2)},${d(a-r)}L${d(l-r/2)},${a}`:"";return"line"===t.pathType?`M${l},${a}L${o},${n}${f}L${p},${n}L${c},${a}${m}Z`:"polyline"===t.pathType?`M${l},${a}L${l},${h}L${o},${h}L${o},${n} 5 ${f}L${p},${n}L${p},${h}L${c},${h}L${c},${a}${m}Z`:`M${l},${a}C${l},${h},${o},${u},${o},${n} 6 ${f}L${p},${n}C${p},${u},${c},${h},${c},${a}${m}Z`};class Rv extends OG{constructor(){super(...arguments),this.type=Rv.type,this._subMarks={back:{type:"path",defaultAttributes:{zIndex:0}},front:{type:"path",defaultAttributes:{zIndex:1}}},this._positionChannels=["x0","y0","x1","y1","thickness","round","curvature","ratio","pathType","align","endArrow","startArrow","ratio"],this._channelEncoder={backgroundStyle:t=>({back:t})},this._positionEncoder=(t,e,i)=>{var s,r;let a=Object.assign(Object.assign({},i.attribute),t),n=["vertical","TB","BT"].includes(null!=(s=a.direction)?s:null==(r=this._glyphConfig)?void 0:r.direction)?Ry:R_,l="number"==typeof a.ratio&&a.ratio>=0&&a.ratio<=1;return{back:{path:l?n(a,1):""},front:{path:n(a,l?a.ratio:1)}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}}Rv.type="linkPath";let Rb=Object.assign(Object.assign({},bc),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class Rx extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}let RS=(t,e,i,s=!0,r)=>{t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&t.removeState(e),t.addState(e,s,r)};class RA extends bP{constructor(){super(...arguments),this.type=dD.sankey,this.transformerConstructor=Rx,this._nodeLayoutZIndex=j.Node,this._labelLayoutZIndex=j.Label,this._viewBox=new iZ,this._fillByNode=t=>{var e,i,s,r,a;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);let n=null==(i=null==(e=this._spec.node)?void 0:e.style)?void 0:i.fill;if((0,eA.A)(n))return n;if((0,eA.A)(this._spec.seriesField)){let e=null==(r=null==(s=this._option)?void 0:s.globalScale)?void 0:r.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==(a=this._colorScale)?void 0:a.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,r,a,n;let l=null==(i=null==(e=this._spec.link)?void 0:e.style)?void 0:i.fill;if(l)return l;if((0,eA.A)(this._spec.seriesField)){let e=null==(s=this._nodesSeriesData.latestData)?void 0:s.find(e=>t.source===e.key),i=null==e?void 0:e.datum,n=null==(a=null==(r=this._option)?void 0:r.globalScale)?void 0:a.getScale("color");return null==n?void 0:n.scale(null==i?void 0:i[this._spec.seriesField])}let o=ed(t.source)?this.getNodeList()[t.source]:t.source;return null==(n=this._colorScale)?void 0:n.scale(o)},this._handleEmphasisElement=t=>{var e;let i=null!=(e=this._spec.emphasis)?e:{},s=t.item;
6"adjacency"===i.effect?s&&t.mark===this._nodeMark?this._handleNodeAdjacencyClick(s):s&&t.mark===this._linkMark?this._handleLinkAdjacencyClick(s):this._handleClearEmpty():"related"===i.effect&&(s&&t.mark===this._nodeMark?this._handleNodeRelatedClick(s):s&&t.mark===this._linkMark?this._handleLinkRelatedClick(s):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;let i=null==(t=this._nodeMark)?void 0:t.getGraphics();if(!i||!i.length)return;let s=null==(e=this._linkMark)?void 0:e.getGraphics();s&&s.length&&(i.forEach(t=>{t.removeState(U.STATE_SANKEY_EMPHASIS),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE)}),s.forEach(t=>{t.removeState(U.STATE_SANKEY_EMPHASIS),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE)}),this._needClear=!1)},this._handleNodeAdjacencyClick=t=>{let e=u3(t),i=[e.key];if(this._linkMark){let t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach((t,s)=>{let r=u3(t);r.source===e.key?(i.includes(r.target)||i.push(r.target),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(U.STATE_SANKEY_EMPHASIS,!0)):r.target===e.key?(i.includes(r.source)||i.push(r.source),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(U.STATE_SANKEY_EMPHASIS,!0)):(t.removeState(U.STATE_SANKEY_EMPHASIS),t.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0))})}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{let e=u3(t),i=[e.source,e.target];if(this._linkMark){let e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach(e=>{e===t?(e.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),RS(e,U.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(U.STATE_SANKEY_EMPHASIS),e.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0))})}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;let i=u3(t),s=this._nodeMark.getGraphics();if(!s||!s.length)return;let r=this._linkMark.getGraphics();if(!r||!r.length)return;let a=(null==(e=u3(r[0]))?void 0:e.parents)?"parents":"source";if("source"===a){let t=[i.key],e=[];if(r.forEach((r,a)=>{var n,l,o,h;let u=u3(r),d=(null==u?void 0:u.parents)?"parents":"source";if(oS(u[d]).includes(i.key)){if(e.includes(null!=(n=u.key)?n:u.index)||e.push(null!=(l=u.key)?l:u.index),t.includes(u.source)||t.push(u.source),!t.includes(u.target)){t.push(u.target);let i=s.find(t=>t.data[0].key===u.target).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){let r=[];return i.forEach(i=>{var a,n;if(!e.includes(null!=(a=i.key)?a:i.index)&&(e.push(null!=(n=i.key)?n:i.index),!t.includes(i.target))){t.push(i.target);let e=s.find(t=>t.data[0].key===i.target);r.push(e.data[0].targetLinks)}}),void(i=r)}}}else if(u.target===i.key&&(e.includes(null!=(o=u.key)?o:u.index)||e.push(null!=(h=u.key)?h:u.index),!t.includes(u.source))){t.push(u.source);let i=s.find(t=>t.data[0].key===u.source).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){let r=[];return i.forEach(i=>{var a,n;if(!e.includes(null!=(a=i.key)?a:i.index)&&(e.push(null!=(n=i.key)?n:i.index),!t.includes(i.source))){t.push(i.source);let e=s.find(t=>t.data[0].key===i.source);r.push(e.data[0].targetLinks)}}),void(i=r)}}}),this._linkMark){let t=this._linkMark.getGraphics();if(!t||!t.length)return;t.forEach((t,i)=>{var s;let r=u3(t);e.includes(null!=(s=r.key)?s:r.index)?(t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(U.STATE_SANKEY_EMPHASIS,!0)):(t.removeState(U.STATE_SANKEY_EMPHASIS),t.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0))})}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}else{let t=[i.key],e=i.targetLinks.reduce((t,e)=>(oS(e.datum).forEach(e=>{let s=e.parents,r=s.length;for(let a=0;a<r;a++){let r=s[a].key,n=s[a+1]?s[a+1].key:i.key,l=e.value,o=t.find(t=>t.source===r&&t.target===n);o?o.value+=l:t.push({source:r,target:n,value:l})}}),t),[]);r.forEach((s,r)=>{let n=u3(s),l=n.datum,o=l?l.filter(t=>t[a].some(t=>t.key===i.key)):null,h=e.find(t=>t.source===n.source&&t.target===n.target);if(o&&o.length){t.includes(n.source)||t.push(n.source),t.includes(n.target)||t.push(n.target);let e=o.reduce((t,e)=>t+e.value,0)/n.value;
6return s.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),void RS(s,U.STATE_SANKEY_EMPHASIS,{ratio:e})}h?(t.includes(n.source)||t.push(n.source),t.includes(n.target)||t.push(n.target),s.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),RS(s,U.STATE_SANKEY_EMPHASIS,{ratio:h.value/n.value})):(s.removeState(U.STATE_SANKEY_EMPHASIS),s.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0))}),this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),t)}this._needClear=!0},this._handleLinkRelatedClick=t=>{let e=this._nodeMark.getGraphics();if(!e||!e.length)return;let i=this._linkMark.getGraphics();if(i&&i.length){if("source"==(u3(t)?"parents":"source"))this._linkMark&&i.forEach(t=>{t.removeState(U.STATE_SANKEY_EMPHASIS),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE)}),this._nodeMark&&e.forEach(t=>{t.removeState(U.STATE_SANKEY_EMPHASIS),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE)});else{let s=u3(t),r=[s.source,s.target],a=[];oS(s.datum).forEach(t=>{let e=t.parents,i=e.length;for(let s=0;s<i-1;s++){let i=e[s].key,r=e[s+1].key,n=t.value,l=a.find(t=>t.source===i&&t.target===r);a.push({source:e[s].key,target:e[s+1].key,value:t.value}),l?l.value+=n:a.push({source:i,target:r,value:n})}}
6),i.forEach(t=>{let e=u3(t),i=e.datum;if(e.source===s.source&&e.target===s.target)return t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),void RS(t,U.STATE_SANKEY_EMPHASIS,{ratio:1});let n=i?i.filter(t=>{let e=t.parents.map(t=>t.key);return e.includes(s.source)&&e.includes(s.target)}):null;if(n&&n.length){r.includes(e.source)||r.push(e.source),r.includes(e.target)||r.push(e.target);let i=n.filter(t=>t.parents.some((e,i)=>{var r;return e.key===s.source&&(null==(r=t.parents[i+1])?void 0:r.key)===s.target})).reduce((t,e)=>t+e.value,0)/e.value;return t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),void RS(t,U.STATE_SANKEY_EMPHASIS,{ratio:i})}let l=a.find(t=>t.source===e.source&&t.target===e.target);l?(r.includes(e.source)||r.push(e.source),r.includes(e.target)||r.push(e.target),t.removeState(U.STATE_SANKEY_EMPHASIS_REVERSE),RS(t,U.STATE_SANKEY_EMPHASIS,{ratio:l.value/e.value})):(t.removeState(U.STATE_SANKEY_EMPHASIS),t.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0))}),this._highLightElements(e,r)}this._needClear=!0}}}get direction(){var t;return null!=(t=this._spec.direction)?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)?t:this._spec.categoryField)}initData(){var t,e,i,s;super.initData();let r=this.getViewData(),a=this.getRawData();if(a&&r){c3(this._dataSet,"sankeyLayout",Rd),c3(this._dataSet,"sankeyFormat",Ru),a.transform({type:"sankeyFormat"},!1),r.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)?t:"justify",nodeGap:null!=(e=this._spec.nodeGap)?e:8,nodeWidth:null!=(i=this._spec.nodeWidth)?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!=(s=this._spec.minNodeHeight)?s:4,maxNodeHeight:this._spec.maxNodeHeight,minLinkHeight:this._spec.minLinkHeight,maxLinkHeight:this._spec.maxLinkHeight,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:D.sankeyLayout});let{dataSet:n}=this._option;c3(n,"sankeyNodes",Rc),c3(n,"flatten",Pk);let l=new eR(n,{name:`sankey-node-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyNodes"}),l.transform({type:"flatten",options:{callback:t=>{if(t.datum){let e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),l.transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1),this._nodesSeriesData=l,c3(n,"sankeyLinks",Rp);let o=new eR(n,{name:`sankey-link-${this.id}-data`});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyLinks"}),o.transform({type:"addVChartProperty",options:{beforeCall:bo.bind(this),call:bh}},!1),this._linksSeriesData=o}}compileData(){var t,e;super.compileData(),null==(t=this._linkMark)||t.compileData(),null==(e=this._nodeMark)||e.compileData()}initMark(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});let t=this._createMark(RA.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);let e=this._createMark(RA.mark.link,{dataView:this._linksSeriesData});e&&(this._linkMark=e)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){let e=this._nodesSeriesData.latestData,i=oS(t)[0];return e&&e.find(t=>t.key===i)}
6valueToLink(t){let e=this._linksSeriesData.latestData,i=oS(t);return e&&e.find(t=>t&&t.source===i[0]&&t.target===i[1])}valueToPositionX(t){let e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){let e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;let i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},U.STATE_NORMAL,N.Mark),this.setMarkStyle(i,{fill:null!=(e=null==(t=this._spec.node.style)?void 0:t.fill)?e:this._fillByNode},"normal",N.User_Mark))}_initLinkMarkStyle(){var t,e;let i=this._linkMark;i&&(i.setGlyphConfig({direction:this.direction}),this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},U.STATE_NORMAL,N.Series),this.setMarkStyle(i,{fill:null!=(e=null==(t=this._spec.link.style)?void 0:t.fill)?e:this._fillByLink},"normal",N.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;let 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)?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((0,eE.A)(t)||(0,eE.A)(t.datum))return"";let i=t.datum[this._spec.categoryField]||"",{formatMethod:s,formatter:r}=e||{},{formatFunc:a,args:n}=v1(s,r,i,t.datum);return a&&(i=a(...n,{series:this})),i}initAnimation(){var t,e,i,s;let r={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null==(t=this._xAxisHelper)?void 0:t.getScale(0).scale(0):null==(e=this._yAxisHelper)?void 0:e.getScale(0).scale(0)}},a=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("sankeyNode"))?void 0:i(r,a),bx("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(bb(null==(s=uP.getAnimationInKey("sankeyLinkPath"))?void 0:s(r,a),bx("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null==(t=this._nodesSeriesData)||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null==(e=this._linksSeriesData)||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));let s=null!=(i=this._spec.emphasis)?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){let t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:dN.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linkMark.getData().updateData()}_highLightElements(t,e){t&&t.length&&t.forEach(t=>{t.removeState([U.STATE_SANKEY_EMPHASIS_REVERSE,U.STATE_SANKEY_EMPHASIS]),e.includes(u3(t).key)?t.addState(U.STATE_SANKEY_EMPHASIS,!0):t.addState(U.STATE_SANKEY_EMPHASIS_REVERSE,!0)})}initTooltip(){this._tooltipHelper=new Rg(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,r;let a,n,l=null==(e=null==(t=this._option)?void 0:t.globalScale)?void 0:e.getScale("color");if(null==l?void 0:l._specified)return void(this._colorScale=l);l&&(a=l.domain(),n=l.range()),n||(n=this._getDataScheme()),a&&!(0,eE.A)(a[0])||(a=this.getNodeList())&&a.length>10&&(n=null==(i=this._getDataScheme()[1])?void 0:i.scheme);let o=new mw;null==(r=(s=o.domain(a)).range)||r.call(s,n),this._colorScale=o}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;let i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null==(t=i.nodes[0])?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.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)?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){let 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){let e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach(t=>{(0,eA.A)(t[i])&&e.add(t[i]),(0,eA.A)(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[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}
6_collectByField(t){var e,i,s;let r=[],a=null==(i=null==(e=this.getRawData())?void 0:e.latestData)?void 0:i[0];if(!a)return[];if(a.links)(null==(s=a.nodes)?void 0:s.length)&&a.nodes.forEach(t=>{t[this._seriesField]&&r.push(t[this._seriesField])});else if(a.nodes){let t=new Set;return Rh(t,a.nodes,this._seriesField),Array.from(t)}return r}onLayoutEnd(){super.onLayoutEnd(),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?(0,ev.A)(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}RA.type=dD.sankey,RA.transformerConstructor=Rx,RA.mark=Rb,RA.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};class Rk extends Ms{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sourceField","targetField","direction","nodeAlign","crossNodeAlign","nodeGap","nodeWidth","linkWidth","minStepWidth","minNodeHeight","maxNodeHeight","minLinkHeight","maxLinkHeight","dropIsolatedNode","nodeHeight","linkHeight","equalNodeHeight","linkOverlap","iterations","nodeKey","linkSortBy","nodeSortBy","setNodeLayer","node","link","emphasis","inverse","overflow"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}let RM=(t,e,i)=>{let[s,r]=t;r<s&&(s=t[1],r=t[0]);let a=r-s;return a>=i-e?[e,i]:[s=Math.min(Math.max(s,e),i-a),s+a]};function Rw(){return"browser"===hL.env?["pointerup","pointerleave","pointercancel"]:["pointerup","pointerleave","pointerupoutside"]}let RT={debounce:u1,throttle:u2};p1(),fh();class RC extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},RC.defaultAttributes,t)),this.name="scrollbar",this._handleTouchMove=t=>{(0,eA.A)(this._prePos)&&t.preventDefault()},this._onRailPointerDown=t=>{let e,{viewX:i,viewY:s}=t,{direction:r,width:a,height:n,range:l}=this.attribute,o=this._sliderSize,[h,u]=this._getScrollRange();if("vertical"===r){let t=s-this._viewPosition.y,i=h4(t-o/2,h,u);e=t/n,this._slider.setAttribute("y",i,!0)}else{let t=i-this._viewPosition.x,s=h4(t-o/2,h,u);e=t/a,this._slider.setAttribute("x",s,!0)}this.setScrollRange([e-(l[1]-l[0])/2,e+(l[1]-l[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{this._clearDragEvents();let{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();let{direction:i}=this.attribute,{x:s,y:r}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?s:r,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t});let a=Rw(),n="browser"===hL.env?hL:this.stage;n.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),a.forEach(t=>{n.addEventListener(t,this._onSliderPointerUp)})},this._computeScrollValue=t=>{let{direction:e}=this.attribute,{x:i,y:s}=this.stage.eventPointTransform(t),r,a=0,{width:n,height:l}=this.getSliderRenderBounds(),o=Math.max(("vertical"===e?l:n)-this._sliderSize,0),{range:h}=this.attribute,u=h4(h[1]-h[0],0,1);return a="vertical"===e?(r=s)-this._prePos:(r=i)-this._prePos,[r,o>0&&u<1?a/o*(1-u):0]},this._onSliderPointerMove=t=>{let{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();let i=this.getScrollRange(),[s,r]=this._computeScrollValue(t);this.setScrollRange([i[0]+r,i[1]+r],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:RT[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{let{range:e,limitRange:i=[0,1]}=this.attribute,s=this.getScrollRange(),[r,a]=this._computeScrollValue(t),n=[s[0]+a,s[1]+a];this._prePos=null,this._dispatchEvent("scrollUp",{pre:e,value:RM(n,i[0],i[1])}),this._clearDragEvents()}}setScrollRange(t,e=!0){let{direction:i="horizontal",limitRange:s=[0,1],range:r,realTime:a=!0}=this.attribute,n=RM(t,s[0],s[1]);if(e){let t=this._getSliderPos(n);if(this._slider){let 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=n,a&&this._dispatchEvent(_O,{pre:r,value:n})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;let{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",RT[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown),("browser"===hL.env?hL:this.stage).addEventListener("touchmove",this._handleTouchMove,{passive:!1})}render(){let t;this._reset();let{direction:e="horizontal",width:i,height:s,range:r,limitRange:a=[0,1],railStyle:n,sliderStyle:l,padding:o=2}=this.attribute,h=this.createOrUpdateChild("scrollbar-container",{},"group"),u=h.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:s},n),"rect");
6this._rail=u;let d=this.getSliderRenderBounds(),c=this._getSliderPos(RM(r,a[0],a[1])),p=c[1]-c[0];this._sliderSize=p,t="horizontal"===e?{x:c[0],y:d.y1,width:p,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:p};let g=h.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},t),{cornerRadius:this._getDefaultSliderCornerRadius()}),l),{boundsPadding:AN(o),pickMode:"imprecise"}),"rect");this._slider=g,this._container=h;let f=this._container.AABBBounds;this._viewPosition={x:f.x1,y:f.y1}}getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;let{width:t,height:e,padding:i=2}=this.attribute,[s,r,a,n]=AN(i),l={x1:n,y1:s,x2:t-r,y2:e-a,width:Math.max(0,t-(n+r)),height:Math.max(0,e-(s+a))};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){let{direction:t,round:e}=this.attribute;if(e){let{width:e,height:i}=this.getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){let{direction:e,minSliderSize:i=0}=this.attribute,{width:s,height:r,x1:a,y1:n}=this.getSliderRenderBounds(),l="horizontal"===e?s:r,o=h4(t[0],0,1),h=h4(t[1],0,1),u=h4(h-o,0,1),d=Math.max(u*l,i),c=("horizontal"===e?a:n)+o/Math.max(1-u,1e-12)*Math.max(l-d,0);return[c,c+d]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;let{limitRange:t=[0,1],direction:e}=this.attribute,[i,s]=RM(t,0,1),{width:r,height:a,x1:n,y1:l}=this.getSliderRenderBounds(),o=this._sliderSize;return"horizontal"===e?RM([n+i*r,n+s*r],n,r-o):RM([l+i*a,l+s*a],l,a-o)}_clearDragEvents(){let t=Rw(),e="browser"===hL.env?hL:this.stage;e.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),t.forEach(t=>{e.removeEventListener(t,this._onSliderPointerUp)})}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}release(t){super.release(t),("browser"===hL.env?hL:this.stage).removeEventListener("touchmove",this._handleTouchMove,{passive:!1}),this._clearDragEvents()}}RC.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,minSliderSize:0,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};let RB=tL=class{constructor(){this.name="scrollbar",this.activeEvent="onRegister",this._uid=eI.GenAutoIncrementId(),this.key=this.name+this._uid,this.scroll=t=>{var e,i;let s=t.target,r=this.getScrollContainer(s);if(!r&&!this.scrollContainer)return;if(!r&&this.scrollContainer){if(!this.scrollContainer.g.stage||this.scrollContainer.g.stage!==s.stage)return;let t=this.formatScrollContainer(this.scrollContainer.g);if(!t)return void this.clearScrollbar(this.scrollContainer.g,"all");this.scrollContainer.showH&&!t.showH&&this.clearScrollbar(this.scrollContainer.g,"horizontal"),this.scrollContainer.showV&&!t.showV&&this.clearScrollbar(this.scrollContainer.g,"vertical"),this.scrollContainer=t}else r&&this.scrollContainer&&r.g!==this.scrollContainer.g&&this.clearScrollbar(this.scrollContainer.g,"all");if(this.scrollContainer=null!=r?r:this.scrollContainer,!r)return;let a=r.g;if(!a)return;let{width:n,height:l,scrollX:o=0,scrollY:h=0}=a.attribute,u=o,d=h,{showH:c,showV:p}=r;this.scrollContainerBounds=(new iZ).set(0,0,a.attribute.width,a.attribute.height),c&&c&&(ic(t.deltaX)>ic(t.deltaY)?(c=c&&!0,p=p&&!1):(c=c&&!1,p=p&&!0));let g=this.childrenBounds.width(),f=this.childrenBounds.height();c&&((u=o-(null!=(e=t.deltaX)?e:0))>0?u=0:u<n-g&&(u=n-g)),p&&((d=h-(null!=(i=t.deltaY)?i:0))>0?d=0:d<l-f&&(d=l-f)),a.setAttributes({scrollX:u,scrollY:d}),this.addOrUpdateScroll(c,p,a.parent,a)},this.handleScrollBarChange=t=>{if(!(this.scrollContainer&&this.scrollContainerBounds&&this.childrenBounds&&t&&t.target&&t.detail&&t.detail.value))return;let e=t.target,i=t.detail.value;if("horizontal"===e.attribute.direction){let t=this.childrenBounds.width();this.scrollContainer.g.setAttributes({scrollX:-i[0]*t})}else{let t=this.childrenBounds.height();this.scrollContainer.g.setAttributes({scrollY:-i[0]*t})}}}activate(t){this.pluginService=t;let{stage:e}=this.pluginService;this.childrenBounds=new iJ,e.addEventListener("wheel",this.scroll),this.params=tL.defaultParams}initEventOfScrollbar(t,e,i){t.addEventListener("pointerover",()=>{e.setAttribute("visibleAll",!0)}),t.addEventListener("pointermove",()=>{e.setAttribute("visibleAll",!0)}),t.addEventListener("pointerout",()=>{e.setAttribute("visibleAll",!1)}),e.addEventListener("pointerover",()=>{e.setAttribute("visibleAll",!0)}),e.addEventListener("pointerout",()=>{e.setAttribute("visibleAll",!0)}),e.addEventListener("scrollUp",this.handleScrollBarChange),e.addEventListener(_O,this.handleScrollBarChange)}addOrUpdateScroll(t,e,i,s){if(t){let{scrollBar:t,isUpdate:e}=this.addOrUpdateHScroll(s,i,!0);e||this.initEventOfScrollbar(s,t,!0)}else this.clearScrollbar(s,"horizontal");if(e){let{scrollBar:t,isUpdate:e}=this.addOrUpdateHScroll(s,i,!1);e||this.initEventOfScrollbar(s,t,!1)}else this.clearScrollbar(s,"vertical")}getDirection(t){return t?"horizontal":"vertical"}addOrUpdateHScroll(t,e,i){var s,r;let a=this.getDirection(i),n=`${null!=(s=t.name)?s:t._uid}_${this.getDirection(i)}_${this.name}`,l=e.children.filter(t=>t.name===n),o=!0,h=l[0],{y:u=0,dy:d=0,x:c=0,dx:p=0,height:g,width:f,zIndex:m=0}=this.scrollContainer.g.attribute,_={x:0,y:0,direction:a,zIndex:m+1,visibleAll:!0,padding:[2,0],railStyle:{fill:"rgba(0, 0, 0, .1)"},range:[0,.05]};i?(_.width=this.scrollContainerBounds.width(),_.height=12):(_.he
6ight=this.scrollContainerBounds.height(),_.width=12),h?l.length>1&&l.forEach((t,e)=>{var i;e&&(null==(i=t.parent)||i.removeChild(t))}):(o=!1,(h=new RC(_)).name=n,e.add(h),h.isScrollBar=!0);let y=this.childrenBounds,{scrollX:v,scrollY:b}=t.attribute;if(i){let t=Math.min(this.scrollContainerBounds.width()/y.width(),1),e=Math.max(Math.min(v/this.childrenBounds.width(),0),t-1);_.x=c+p,_.y=u+d+g-(null!=(r=_.height)?r:0),_.range=[-e,-e+t]}else{let t=Math.min(this.scrollContainerBounds.height()/y.height(),1),e=Math.max(Math.min(b/this.childrenBounds.height(),0),t-1);_.x=c+p+f-this.scrollContainerBounds.width(),_.y=u+d,_.range=[-e,-e+t]}return h.setAttributes(_),{scrollBar:h,isUpdate:o}}clearScrollbar(t,e){t.parent&&t.parent.children.filter(t=>t.isScrollBar&&("all"===e||t.attribute.direction===e)).forEach(t=>{t.parent.removeChild(t)})}formatScrollContainer(t){if(!t||"group"!==t.type||!t.attribute)return null;let{overflow:e,width:i,height:s}=t.attribute;if(!e||"hidden"===e)return null;let r=!1,a=!1;"scroll"===e?(r=!0,a=!0):a=!(r="scroll-x"===e);let n=this.childrenBounds;return n.clear(),t.forEachChildren(t=>{n.union(t.AABBBounds)}),t.AABBBounds.empty()||(r&&(r=i<n.width()),a&&(a=s<n.height())),r||a?{g:t,showH:r,showV:a}:null}getScrollContainer(t){let e=t;for(;e;){let t=this.formatScrollContainer(e);if(t)return t;e=e.parent}return null}deactivate(t){let{stage:e}=this.pluginService;e.removeEventListener("wheel",this.scroll)}};RB.defaultParams={timeout:500},RB=tL=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],RB);let RE=new eL((t,e,i,s)=>{i(RB)||(t(RB).toSelf(),t(lH).toService(RB))});class RP extends Mu{constructor(){super(...arguments),this.transformerConstructor=Rk,this.type="sankey",this.seriesType=dD.sankey}_setStateInDatum(t,e,i,s){let r=(0,ev.A)(e)?e[0]:e;if(!r)return void this._interaction.clearByState(t);let a=null;this.filterGraphicsByDatum(r,{filter:(t,e)=>"text"!==e.type&&e.getProduct()&&(!i||i(t,e)),region:s,getDatum:t=>{var e;let i=null==(e=u3(t))?void 0:e.datum;return(0,ev.A)(i)&&(i=i[0]),i},callback:(t,e,i,s)=>{var r;let a=e.getProductId();a&&(a.includes("node")||a.includes("link"))&&(null==(r=i._handleEmphasisElement)||r.call(i,{item:t,mark:e}))},regionCallback:(t,e)=>{r&&t.length&&(a=t[0])}}),a&&this._interaction.updateStateOfGraphics(t,[a])}}RP.type="sankey",RP.seriesType=dD.sankey,RP.transformerConstructor=Rk;class RO extends bt{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]]}}let RR=Object.assign({},ws);class RI extends wa{constructor(){super(...arguments),this.type=dD.rangeArea}initMark(){this._areaMark=this._createMark(RI.mark.area,{groupKey:this._seriesField,isSeriesMark:!0},{morphElementKey:this.getDimensionField()[0]})}initMarkStyle(){this.initAreaMarkStyle()}initAreaMarkStyle(){let t=this._areaMark;t&&(super.initAreaMarkStyle(),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x1:t=>{if(!this._xAxisHelper)return NaN;let{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}},"normal",N.Series):this.setMarkStyle(this._areaMark,{y1:t=>{if(!this._yAxisHelper)return NaN;let{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}},"normal",N.Series),this.setMarkStyle(t,{stroke:!1},"normal",N.Series))}initTooltip(){this._tooltipHelper=new RO(this)}_isFieldAllValid(){let t=this.getViewDataStatistics(),e=this.fieldY;return!!(t&&t.latestData&&e.length)&&e.every(e=>t.latestData[e]&&t.latestData[e].allValid)}}RI.type=dD.rangeArea,RI.mark=RR;class RL extends Mr{_getDefaultSeriesSpec(t){var e,i;let s=super._getDefaultSeriesSpec(t);return s.area=t.area,s.point=t.point,s.line=t.line,"horizontal"===t.direction?s.xField=null!=(e=t.xField)?e:[t.minField,t.maxField]:s.yField=null!=(i=t.yField)?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),fu(t)}}class RD extends Mu{constructor(){super(...arguments),this.transformerConstructor=RL,this.type="rangeArea",this.seriesType=dD.rangeArea}_setModelOption(){this._modelOption.getDimensionInfo=MP,this._modelOption.getDimensionInfoByValue=MR,this._modelOption.getRectByDimensionData=MH}}RD.type="rangeArea",RD.seriesType=dD.rangeArea,RD.transformerConstructor=RL;class RF extends _x{constructor(){super(...arguments),this.type=RF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(t={}){return oZ(t)}_transformGraphicAttributes(t,e,i){var s,r,a;let n=super._transformGraphicAttributes(t,e,i),l=null!=(r=null!=(s=n.shape)?s:n.symbolType)?r:null==(a=t.attribute)?void 0:a.symbolType;return(0,eE.A)(l)?n.symbolType="rect":n.symbolType=l,n}}RF.type="cell";class Rz extends bt{enableByType(t){return"dimension"!==t}}let RH=Object.assign(Object.assign({},bc),{cell:{name:"cell",type:"cell"}
6,cellBackground:{name:"cellBackground",type:"cell"}});class Rj extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class RV extends bP{constructor(){super(...arguments),this.type=dD.heatmap,this.transformerConstructor=Rj}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=oS(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(RV.mark.cell,{isSeriesMark:!0},{morph:bk(this._spec,RV.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(RV.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){var e,i,s;t&&this.setMarkStyle(t,{fill:null!=(s=null==(i=null==(e=this._spec.cell)?void 0:e.style)?void 0:i.fill)?s: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",N.Series)}
6initCellBackgroundMarkStyle(){var t,e,i;let s=AN(null!=(i=null==(e=null==(t=this._spec.cellBackground)?void 0:t.style)?void 0:e.padding)?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{let e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{let 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",N.Series)}getColorAttribute(){var t;return{scale:null!=(t=this._option.globalScale.getScale("color"))?t:this._getDefaultColorScale(),field:this.getFieldValue()[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;let s=null==(e=null==(t=this._spec)?void 0:t.animationAppear)?void 0:e.preset,r=bE(this);this._cellMark.setAnimationConfig(bb(null==(i=uP.getAnimationInKey("heatmap"))?void 0:i(s),bx("cell",this._spec,this._markAttributeContext),r))}getCellSize(t){var e,i;return null!=(i=null==(e=t.getBandwidth)?void 0:e.call(t,0))?i:6}initTooltip(){this._tooltipHelper=new Rz(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"rect"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}RV.type=dD.heatmap,RV.mark=RH,RV.builtInTheme={heatmap:{cell:{style:{shape:"rect",fillOpacity:1}}
6,cellBackground:{visible:!1},label:{style:{lineWidth:2}}}},RV.transformerConstructor=Rj;class RN extends Mr{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","cell"])}}class RW extends Mu{constructor(){super(...arguments),this.transformerConstructor=RN,this.type="heatmap",this.seriesType=dD.heatmap}}RW.type="heatmap",RW.seriesType=dD.heatmap,RW.transformerConstructor=RN;let RU=Object.assign(Object.assign({},bc),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),RG=(t,e)=>{let i,s,r=(0,r3.A)(e)?e:t=>t;if(t&&t.length){let e=t.length;for(let a=0;a<e;a+=1){let e=r(t[a]);(0,eE.A)(e)||!ed(e*=1)||Number.isNaN(e)||((0,eE.A)(i)?(i=e,s=e):(i=Math.min(i,e),s=Math.max(s,e)))}}return[i,s]},RY=`${px.H}_CORRELATION_X`,R$=`${px.H}_CORRELATION_Y`,RX=`${px.H}_CORRELATION_SIZE`,RK=(t,e)=>{var i,s,r,a,n,l,o,h,u,d,c,p,g,f,m;if(!t||!(null==e?void 0:e.view)||!(0,ev.A)(t))return t;let _=e.view();if(_.x1-_.x0==0||_.y1-_.y0==0||_.x1-_.x0==-1/0||_.x1-_.x0==1/0||_.y1-_.y0==-1/0||_.y1-_.y0==1/0)return t;let y=iC(null!=(i=e.startAngle)?i:-90),v=iC(null!=(s=e.endAngle)?s:270),b=Math.max((_.x1-_.x0)/2,(_.y1-_.y0)/2),x=Pw(null!=(r=e.innerRadius)?r:0,b),S=Pw(e.outerRadius,b),A=[ed(null==(a=e.center)?void 0:a[0])?e.center[0]:_.x0+Pw(null!=(l=null==(n=e.center)?void 0:n[0])?l:"50%",_.x1-_.x0),ed(null==(o=e.center)?void 0:o[1])?e.center[1]:_.y0+Pw(null!=(u=null==(h=e.center)?void 0:h[1])?u:"50%",_.y1-_.y0)],k=EB(e.field),M=t.map(k),[w,T]=RG(M),C=w===T?t=>(x+S)/2:t=>x+(S-x)*(t-w)/(T-w),B=(0,eE.A)(e.radiusField)?k:EB(e.radiusField),E=null!=(c=null==(d=null==e?void 0:e.radiusRange)?void 0:d[1])?c:5,P=t=>E;if(B){let[i,s]=B!==k?RG(t.map(B)):[w,T],r=null!=(g=null==(p=e.radiusRange)?void 0:p[0])?g:5,a=null!=(m=null==(f=e.radiusRange)?void 0:f[1])?m:5;i!==s&&(P=t=>r+(a-r)*(B(t)-i)/(s-i))}let O=Math.min(y,v),R=Math.max(y,v),I=Rq(O,R,t.length),L=[],D=(R-O)/60;return t.forEach((t,e)=>{let i=C(M[e]),s=P(t),r,a,n=I[e];for(let t=0;t<60&&(RZ({x:r=A[0]+i*Math.cos(n),y:a=A[1]+i*Math.sin(n),size:s},L)||r-s<_.x0||r+s>_.x1||a-s<_.y0||a+s>_.y1);t++)t<59&&((n+=D)>R?n=O:n<O&&(n=R));L.push(Object.assign({[RY]:r,[R$]:a,[RX]:s},t))}),L},Rq=(t,e,i)=>{let s=0,r=Math.max(Math.ceil(2*(e-t)/Math.PI),2),a=(e-t)/r,n=0,l=1,o=0,h=0,u=[],d=t;for(;o<i;)h<r&&(u.push(d+(h%2?Math.floor(h/2)+Math.floor(r/2):h/2)*a*l),h++),o++,h===r&&(h=0,n+=1,l*=-1,0===s?s=a/2:s/=2,d=-1===l?e-s:t+s,n>=2&&(a/=2,r*=2));return u},RZ=(t,e)=>!(!e||!e.length)&&e.some(e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(t.size+e.size,2)),RJ=(t,e)=>{if(!t||!(0,ev.A)(t))return[];let{keyword:i,categoryField:s}=e,r=t[0].latestData[0];return{[s]:i,[pS]:null==r?void 0:r[pS],[pk]:null==r?void 0:r[pk]}};class RQ extends OG{constructor(){super(...arguments),this.type=RQ.type,this._subMarks={ripple0:{type:"symbol",defaultAttributes:{fillOpacity:.75}},ripple1:{type:"symbol",defaultAttributes:{fillOpacity:.5}},ripple2:{type:"symbol",defaultAttributes:{fillOpacity:.25}}},this._positionChannels=["ripple","size"],this._positionEncoder=(t,e,i)=>{let{ripple:s=i.attribute.ripple,size:r=i.attribute.size}
6=t,a=h4(s,0,1),n=.5*r;return{ripple0:{size:r+n*a,fillOpacity:.75-.25*a},ripple1:{size:r+n*(1+a),fillOpacity:.5-.25*a},ripple2:{size:r+n*(2+a),fillOpacity:.25-.25*a}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}}RQ.type="ripple";let R0=()=>{OY(),gq(),uP.registerMark(RQ.type,RQ),uP.registerGraphicComponent("symbol",t=>oZ(t))};class R1 extends bT{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class R2 extends Ci{constructor(){super(...arguments),this.type=dD.correlation,this.transformerConstructor=R1,this._viewBox=new iZ}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){(0,eA.A)(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){(0,eA.A)(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){(0,eA.A)(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;c3(this._dataSet,"correlation",RK);let s=new e_;c5(s,"dataview",eb),c3(s,"correlationCenter",RJ);let r=new eR(s,{name:`${this.type}_${this.id}_center`});r.parse([this.getViewData()],{type:"dataview"}),r.transform({type:"correlationCenter",options:{keyword:null!=(i=null==(e=null==(t=this._spec.centerLabel)?void 0:t.style)?void 0:e.text)?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new mz(this._option,r)}compileData(){var t;super.compileData(),null==(t=this._centerSeriesData)||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(){let t=this._createMark(R2.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:pS});t&&(t.setMarkConfig({zIndex:j.Node}),this._nodePointMark=t);let e=this._createMark(R2.mark.ripplePoint,{key:pS,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});e&&(this._ripplePointMark=e);let i=this._createMark(R2.mark.centerPoint,{key:pS,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(i.setMarkConfig({zIndex:j.Node}),this._centerPointMark=i)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;let r=this._nodePointMark;if(!r)return;let a=null!=(e=null==(t=this._spec.nodePoint)?void 0:t.style)?e:{};this.setMarkStyle(r,{x:t=>t[RY],y:t=>t[R$],size:t=>t[RX],fill:null!=(i=a.fill)?i:this.getColorAttribute(),fillOpacity:null!=(s=a.fillOpacity)?s:1,lineWidth:0},U.STATE_NORMAL,N.Series)}_initRipplePointMarkStyle(){var t,e,i,s,r;let a=this._ripplePointMark;if(!a)return;let n=null!=(e=null==(t=this._spec.ripplePoint)?void 0:t.style)?e:{};this.setMarkStyle(a,{x:()=>{var t;return null!=(t=this._spec.centerX)?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!=(t=this._spec.centerY)?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=n.fill)?i:this.getColorAttribute(),opacity:null!=(s=n.fillOpacity)?s:.2,ripple:null!=(r=n.ripple)?r:0},U.STATE_NORMAL,N.Series)}_initCenterPointMarkStyle(){var t,e,i,s,r,a;let n=this._centerPointMark;n&&this.setMarkStyle(n,{x:()=>{var t;return null!=(t=this._spec.centerX)?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!=(t=this._spec.centerY)?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.style)?void 0:e.fill)?i:this.getColorAttribute(),fillOpacity:null!=(a=null==(r=null==(s=this._spec.centerPoint)?void 0:s.style)?void 0:r.fillOpacity)?a:1},U.STATE_NORMAL,N.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)},U.STATE_NORMAL,N.Series)}initAnimation(){var t,e;let i=null==(t=this._spec.animationAppear)?void 0:t.preset;this._nodePointMark.setAnimationConfig(bb(null==(e=uP.getAnimationInKey("correlation"))?void 0:e({},i),bx("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(){super.onLayoutEnd(),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}R2.type=dD.correlation,R2.mark=RU,R2.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}}
6,label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},R2.transformerConstructor=R1;class R3 extends Ms{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","sizeField","sizeRange","centerX","centerY","innerRadius","outerRadius","startAngle","endAngle","ripplePoint","centerPoint","centerLabel","nodePoint"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class R5 extends Mu{constructor(){super(...arguments),this.transformerConstructor=R3,this.type="correlation",this.seriesType=dD.correlation}}R5.type="correlation",R5.seriesType=dD.correlation,R5.transformerConstructor=R3;class R4 extends kq{constructor(){super(...arguments),this.type=hc.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),x8(this._regions,t=>{x7(this.getOrient())?SB(t.getXAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):SB(t.getYAxisHelper(),this.axisHelper(),(0,eA.A)(this._seriesUserId)||(0,eA.A)(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper())},{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=uy({},this._spec.tick,null==(t=this._spec.layers)?void 0:t[0])}_initData(){var t;if(super._initData(),null==(t=this._spec.layers)?void 0:t[1]){let t=new eR(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 mz(this._option,t)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}created(){super.created(),this._layerTickData&&(this._axisMark&&this._layerTickData.addRelatedMark(this._axisMark),this._gridMark&&this._layerTickData.addRelatedMark(this._gridMark))}_getLabelFormatMethod(){var t,e,i,s,r,a,n,l;let o=vQ.getInstance(),h=(null==(e=null==(t=this._spec.layers)?void 0:t[1])?void 0:e.timeFormat)||"%Y%m%d",u="local"===((null==(s=null==(i=this._spec.layers)?void 0:i[1])?void 0:s.timeFormatMode)||"local")?o.timeFormat:o.timeUTCFormat,d=(null==(a=null==(r=this._spec.layers)?void 0:r[0])?void 0:a.timeFormat)||"%Y%m%d",c="local"===((null==(l=null==(n=this._spec.layers)?void 0:n[0])?void 0:l.timeFormatMode)||"local")?o.timeFormat:o.timeUTCFormat;return(t,e,i,s,r)=>{var a;let n;return n=0===r?c(d,t):u(h,t),(null==(a=this._spec.label)?void 0:a.formatMethod)?this._spec.label.formatMethod(n,e):n}}getLabelItems(t){var e,i;let s=[],r=null==(e=this.getTickData())?void 0:e.getLatestData();r&&r.length&&s.push(r.map(e=>SC(e.value,this._getNormalizedValue([e.value],t))));let a=null==(i=this._layerTickData)?void 0:i.getLatestData();return a&&a.length&&s.push(a.map(e=>SC(e.value,this._getNormalizedValue([e.value],t)))),s}registerTicksTransform(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,k$),t}transformScaleDomain(){}}R4.type=hc.cartesianTimeAxis,R4.specKey="axes",R4.builtInTheme={axis:kR,axisX:kI,axisY:kL};class R8{nice(t=10,e){var i,s,r,a,n,l;let o=this._domain,h=[],u=null;if(e){let t=mn(o,e);if(h=t.niceMinMax,this._domainValidator=t.domainValidator,u=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else u="all";if(u){let t,e,d,c,p,g=(n=o.slice(),l=null!=(s=null==(i=this.getNiceConfig)?void 0:i.call(this))?s:{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)},t=n.slice(),e=0,d=t.length-1,c=t[e],(p=t[d])<c&&([e,d]=[d,e],[c,p]=[p,c]),t[e]=l.floor(c),t[d]=l.ceil(p),t);return"min"===u?g[g.length-1]=null!=(r=h[1])?r:g[g.length-1]:"max"===u&&(g[0]=null!=(a=h[0])?a:g[0]),this._niceDomain=g,this.rescale(),this}return this}niceMin(){let t=this._domain[this._domain.length-1];this.nice();let e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){let t=this._domain[0];this.nice();let e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function R6(t=Number.EPSILON){return e=>Math.max(e,t)}class R9 extends mv{constructor(){super(fK(10),fX(10)),this.type=Y.Log,this._limit=R6(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new R9).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();let i=fK(this._base),s=fX(this._base);return(null!=(e=this._niceDomain)?e:this._domain)[0]<0?(this._logs=t=>-i(-t),this._pows=t=>-s(-t),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=fG,this.untransformer=fY):(this._logs=i,this._pows=s,this._limit=R6(),this.transformer=this._logs,this.untransformer=s),this}scale(t){var e;if(Number.isNaN(t=Number(t))||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!=(e=this._niceDomain)?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));let 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 fN}d3Ticks(t=10,e){let i=this.domain();return mo(this._limit(i[0]),this._limit(i[i.length-1]),t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return mh(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return mu(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return mu(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))))}}}yg(R9,R8);class R7 extends kq{constructor(){super(...arguments),this.type=hc.cartesianLogAxis,this._zero=!1,this._scale=new R9}initScales(){var t;super.initScales(),this._scale.base(null!=(t=this._spec.base)?t:10),this._scale.clamp(!0,null,!1)}registerTicksTransform(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,k$),t}transformScaleDomain(){}}R7.type=hc.cartesianLogAxis,R7.specKey="axes",R7.builtInTheme={axis:kR,axisLinear:kK,axisX:kI,axisY:kL},yg(R7,kU);
6class It extends mb{constructor(){super(fq(1),fZ(1)),this.type=Y.Symlog,this._const=1}clone(){return(new It).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=fq(t),this.untransformer=fZ(t),this.rescale(e)):this._const}d3Ticks(t=10,e){let i=this.domain();return mo(i[0],i[i.length-1],t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){let e=this.calculateVisibleDomain(this._range);return mh(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){let e=this.calculateVisibleDomain(this._range);return mu(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){let e=this.calculateVisibleDomain(this._range);return mu(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}yg(It,R8);class Ie extends kq{constructor(){super(...arguments),this.type=hc.cartesianSymlogAxis,this._zero=!1,this._scale=new It}initScales(){var t;super.initScales(),this._scale.constant(null!=(t=this._spec.constant)?t:10)}registerTicksTransform(){let t=`${this.type}-ticks`;return c3(this._option.dataSet,t,k$),t}transformScaleDomain(){}}function Ii(t){var e,i;let s=Object.assign({},t);return pJ(t.style)||(s.textStyle=SS(t.style)),pJ(t.textStyle)||uy(s.textStyle,SS(t.textStyle)),(null==(e=t.shape)?void 0:e.style)&&SS(s.shape.style),(null==(i=t.background)?void 0:i.style)&&SS(s.background.style),s}Ie.type=hc.cartesianSymlogAxis,Ie.specKey="axes",Ie.builtInTheme={axis:kR,axisLinear:kK,axisX:kI,axisY:kL},yg(Ie,kU);var Is=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};(tD=tQ||(tQ={})).selected="selected",tD.unSelected="unSelected",tD.selectedHover="selectedHover",tD.unSelectedHover="unSelectedHover",tD.focus="focus",(tF=t0||(t0={})).legendItemHover="legendItemHover",tF.legendItemUnHover="legendItemUnHover",tF.legendItemClick="legendItemClick",tF.legendItemAttributeUpdate="legendItemAttributeUpdate",(tz=t1||(t1={})).innerView="innerView",tz.title="legendTitle",tz.item="legendItem",tz.itemShape="legendItemShape",tz.itemLabel="legendItemLabel",tz.itemValue="legendItemValue",tz.focus="legendItemFocus";class Ir extends xN{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);let{interactive:t=!0,title:e,padding:i=0}=this.attribute;this._parsedPadding=AN(i);let s=lF.group({x:this._parsedPadding[3],y:this._parsedPadding[0],pickable:t,childrenPickable:t});s.name=t1.innerView,this.add(s),this._innerView=s,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();let r=this._innerView.AABBBounds;this.attribute.width=r.width()+this._parsedPadding[1]+this._parsedPadding[3],this.attribute.height=r.height()+this._parsedPadding[0]+this._parsedPadding[2]}_renderTitle(t){let{text:e="",textStyle:i,padding:s=0,background:r,minWidth:a,maxWidth:n,shape:l}=t,o={x:0,y:0,text:e,textStyle:i,padding:AN(s),minWidth:a,maxWidth:n};l&&l.visible&&(o.shape=Object.assign({visible:!0},l.style),(0,eA.A)(l.space)&&(o.space=l.space)),r&&r.visible&&(o.panel=Object.assign({visible:!0},r.style));let h=new km(o);h.name=t1.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){let e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null==(t=this.attribute.title)?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}function Ia(){p1(),gq(),gD()}let In={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};Ia();class Il extends xN{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Il.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{let e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{let 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<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t,e,i;this._reset();let{layout:s="horizontal",handler:r=In,total:a,defaultCurrent:n=1,textStyle:l,padding:o=0}=this.attribute;this._current=n;let h=AN(o),u="horizontal"===s,d=lF.group({x:0,y:0}),c=r.style||{},p=c.size||15,g=null!=(t=r.space)?t:8,f=r.state||{},{preShape:m,nextShape:_}=r;
6m||(m=u?"triangleLeft":"triangleUp"),_||(_=u?"triangleRight":"triangleDown");let y=lF.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:0,y:0,symbolType:m,size:p}));y.states=f,y.name="preHandler",this.preHandler=y,d.add(y);let{width:v,height:b}=_I(this._getPageText(a),Object.assign({textAlign:"center",textBaseline:"middle"},l),null==(i=null==(e=this.stage)?void 0:e.getTheme())?void 0:i.text),x=ed(p)?p:p[0],S=ed(p)?p:p[1],A=lF.text(Object.assign({x:u?x/2+g+v/2:0,y:u?0:S/2+g+b/2,text:this._getPageText(n),textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize},l));this.text=A,d.add(A);let k=lF.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:u?x+2*g+v:0,y:u?0:S+2*g+b,symbolType:_,size:p}));k.name="nextHandler",k.states=f,this.nextHandler=k,d.add(k),1===this._total?(y.addState("disable"),k.addState("disable")):1===this._current?y.addState("disable"):this._current===a&&k.addState("disable");let M=d.AABBBounds,w=M.width(),T=M.height();d.translateTo(0-M.x1+h[3],0-M.y1+h[0]),this.add(d),this.attribute.width=w+h[1]+h[3],this.attribute.height=T+h[0]+h[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(!0),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){let{pageFormatter:e}=this.attribute;return e?(0,r3.A)(e)?e(t,this._total):`${e}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,1!==this._current&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}function Io(){p1(),gD(),fh(),gq()}function Ih(){p1(),kg()}Il.defaultAttributes={handler:In,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};var Iu=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let Id={[tQ.focus]:{},[tQ.selected]:{},[tQ.selectedHover]:{},[tQ.unSelected]:{},[tQ.unSelectedHover]:{}};Ih(),Ia(),p1(),fh();class Ic extends Ir{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Ic.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._contentMaxHeight=0,this._onHover=t=>{let e=t.target;if(e&&e.name&&e.name.startsWith(t1.item)){let 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,r;let a=t.target;if(a&&a.name&&a.name.startsWith(t1.item)){let n=a.delegate,{selectMode:l="multiple"}=this.attribute;if(a.name===t1.focus||"focus"===l){let s=n.hasState(tQ.focus);n.toggleState(tQ.focus),s?null==(e=this._itemsContainer)||e.getChildren().forEac
6h(e=>{this._removeLegendItemState(e,[tQ.unSelected,tQ.unSelectedHover,tQ.focus],t),this._setLegendItemState(e,tQ.selected,t)}):(this._setLegendItemState(n,tQ.selected,t),this._removeLegendItemState(n,[tQ.unSelected,tQ.unSelectedHover],t),null==(i=this._itemsContainer)||i.getChildren().forEach(e=>{n!==e&&(this._removeLegendItemState(e,[tQ.selected,tQ.selectedHover,tQ.focus],t),this._setLegendItemState(e,tQ.unSelected,t))}))}else{null==(s=this._itemsContainer)||s.getChildren().forEach(t=>{t.removeState(tQ.focus)});let{allowAllCanceled:e=!0}=this.attribute,i=n.hasState(tQ.selected),a=this._getSelectedLegends();if("multiple"===l){if(!1===e&&i&&1===a.length)return void this._dispatchLegendEvent(t0.legendItemClick,n,t);i?(this._removeLegendItemState(n,[tQ.selected,tQ.selectedHover],t),this._setLegendItemState(n,tQ.unSelected,t)):(this._setLegendItemState(n,tQ.selected,t),this._removeLegendItemState(n,[tQ.unSelected,tQ.unSelectedHover],t))}else this._setLegendItemState(n,tQ.selected,t),this._removeLegendItemState(n,[tQ.unSelected,tQ.unSelectedHover],t),null==(r=this._itemsContainer)||r.getChildren().forEac
6h(e=>{n!==e&&(this._removeLegendItemState(e,[tQ.selected,tQ.selectedHover],t),this._setLegendItemState(e,tQ.unSelected,t))})}this._dispatchLegendEvent(t0.legendItemClick,n,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null==(e=this._itemsContainer)?void 0:e.getChildren()).forEach(e=>{let i=e.data;t.includes(i.label)?(this._setLegendItemState(e,tQ.selected),this._removeLegendItemState(e,[tQ.unSelected,tQ.unSelectedHover])):(this._removeLegendItemState(e,[tQ.selected,tQ.selectedHover]),this._setLegendItemState(e,tQ.unSelected))})}_renderItems(){let{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:s,defaultSelected:r,lazyload:a,autoPage:n}=this.attribute,{spaceCol:l=16,spaceRow:o=8,verticalAlign:h="middle"}=t,u=this._itemsContainer,{items:d,isHorizontal:c,startIndex:p,isScrollbar:g}=this._itemContext,f=g?1:c?i:e,m=this._contentMaxHeight,_,{doWrap:y,maxWidthInCol:v,startX:b,startY:x,pages:S}=this._itemContext,A=0,k=0,M=[];for(let t=p,e=d.length;t<e&&!(a&&S>this._itemContext.currentPage*f);t++){a&&(this._itemContext.startIndex=t+1),(_=d[t]).id||(_.id=_.label),_.index=t;let e=!0;(0,ev.A)(r)&&(e=r.includes(_.label));let i=this._renderEachItem(_,e,t,d),p=i.attribute.width,f=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,f),v=Math.max(p,v),this._itemMaxWidth=Math.max(p,this._itemMaxWidth),c?((0,eA.A)(s)&&(g&&n?y=(S=Math.ceil((b+p)/s))>1:b+p>s&&(y=!0,b>0&&("middle"!==h&&"bottom"!==h||M.forEach(t=>{t.setAttributes({y:t.attribute.y+(k-t.attribute.height)/("middle"===h?2:1)})}),S+=1,b=0,x+=k+o,k=0,M.length=0))),0===b&&0===x||i.setAttributes({x:b,y:x}),b+=l+p,k=Math.max(k,f),M.push(i)):((0,eA.A)(m)&&(g&&n?y=(S=Math.ceil((x+f)/m))>1:m<=f?(S+=1,y=!0,x=0,t>0&&(b+=A+l)):m<x+f&&(S+=1,y=!0,x=0,b+=v+l,v=0)),0===b&&0===x||i.setAttributes({x:b,y:x}),x+=o+f),u.add(i),A=p}return c&&("middle"===h||"bottom"===h)&&M.forEach(t=>{t.setAttributes({y:t.attribute.y+(k-t.attribute.height)/("middle"===h?2:1)})}),this._itemContext.doWrap=y,this._itemContext.startX=b,this._itemContext.startY=x,this._itemContext.maxWidthInCol=v,this._itemContext.pages=S,this._itemContext.maxPages=f,g&&(this._itemContext.totalPage=S),a||(this._itemContext.startIndex=d.length),this._itemContext}_renderContent(){let{item:t={},items:e,reversed:i,maxWidth:s,maxHeight:r}=this.attribute;if(!1===t.visible||pJ(e))return;let a=e;i&&(a=null==e?void 0:e.reverse()),this._contentMaxHeight=Math.max(0,r-this._parsedPadding[0]-this._parsedPadding[2]);let n=lF.group({x:0,y:0});this._itemsContainer=n;let{layout:l,autoPage:o}=this.attribute,{maxWidth:h,width:u,height:d}=t,c=[];(0,eA.A)(h)&&c.push(h),(0,eA.A)(u)&&c.push(u),c.length&&((0,eA.A)(s)&&c.push(s),this._itemWidthByUser=oM(c)),(0,eA.A)(d)&&(this._itemHeightByUser=d);let p=this.attribute.pager;
6this._itemContext={currentPage:p&&p.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:a,isHorizontal:"horizontal"===l,totalPage:1/0,isScrollbar:p&&"scrollbar"===p.type,clipContainer:void 0},this._itemContext=this._renderItems();let g=!1;this._itemContext.doWrap&&o&&this._itemContext.pages>this._itemContext.maxPages&&(g=this._renderPagerComponent()),g||(n.setAttribute("y",this._title?this._title.AABBBounds.height()+uQ(this.attribute,"title.space",8):0),this._innerView.add(n))}_bindEvents(){if(this.attribute.disableTriggerEvent||!this._itemsContainer)return;let{hover:t=!0,select:e=!0}=this.attribute;if(t){let e="pointermove",i="pointerleave";r2(t)&&(t.trigger&&(e=t.trigger),t.triggerOff&&(i=t.triggerOff)),this._itemsContainer.addEventListener(e,this._onHover),this._itemsContainer.addEventListener(i,this._onUnHover)}if(e){let t="pointerdown";r2(e)&&e.trigger&&(t=e.trigger),this._itemsContainer.addEventListener(t,this._onClick)}}_autoEllipsis(t,e,i,s){var r,a;let{label:n,value:l}=this.attribute.item,o=s.AABBBounds,h=i.AABBBounds,u=o.width(),d=h.width(),c=!1;"labelFirst"===t?d>e?c=!0:s.setAttribute("maxLineWidth",e-d):"valueFirst"===t?u>e?c=!0:i.setAttribute("maxLineWidth",e-u):u+d>e&&(c=!0),c&&(s.setAttribute("maxLineWidth",Math.max(e*(null!=(r=n.widthRatio)?r:.5),e-d)),i.setAttribute("maxLineWidth",Math.max(e*(null!=(a=l.widthRatio)?a:.5),e-u)))}_renderEachItem(t,e,i,s){var r,a;let n,{id:l,label:o,value:h,shape:u}=t,{padding:d=0,focus:c,focusIconStyle:p,align:g,autoEllipsisStrategy:f}=this.attribute.item,{shape:m,label:_,value:y,background:v}=this.attribute.item,b=this._handleStyle(m,t,e,i,s),x=this._handleStyle(_,t,e,i,s),S=this._handleStyle(y,t,e,i,s),A=this._handleStyle(v,t,e,i,s),k=AN(d);!1===v.visible?(n=lF.group({x:0,y:0,cursor:null==(r=A.style)?void 0:r.cursor}),this._appendDataToShape(n,t1.item,t,n)):(n=lF.group(Object.assign({x:0,y:0},A.style)),this._appendDataToShape(n,t1.item,t,n,A.state)),n.id=`${null!=l?l:o}-${i}`,n.addState(e?tQ.selected:tQ.unSelected);let M=lF.group({x:0,y:0,pickable:!1});n.add(M);let w,T=0,C=0,B=0;if(m&&!1!==m.visible){let i=uQ(b,"style.size",10);C=(0,ev.A)(i)?i[0]||0:i,B=uQ(m,"space",8);let s=lF.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},u),b.style));Object.keys(b.state||{}).forEach(t=>{let e=b.state[t].fill||b.state[t].stroke;u.fill&&(0,eE.A)(b.state[t].fill)&&e&&(b.state[t].fill=e),u.stroke&&(0,eE.A)(b.state[t].stroke)&&e&&(b.state[t].stroke=e)}),this._appendDataToShape(s,t1.itemShape,t,n,b.state),s.addState(e?tQ.selected:tQ.unSelected),M.add(s)}let E=0;if(c){let e=uQ(p,"size",10);w=lF.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0,boundsPadding:k},p),{visible:!0,pickMode:"imprecise"})),this._appendDataToShape(w,t1.focus,t,n),E=e}let P=_.formatMethod?_.formatMethod(o,t,i):o,O=_F(Object.assign(Object.assign({x:C/2+B,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null==(a=x.style)?void 0:a.fontSize},x.style),{text:P,_originText:_.formatMethod?o:void 0}));this._appendDataToShape(O,t1.itemLabel,t,n,x.state),O.addState(e?tQ.selected:tQ.unSelected),M.add(O);let R=uQ(_,"space",8);if((0,eA.A)(h)){let s=uQ(y,"space",8*!!c),r=y.formatMethod?y.formatMethod(h,t,i):h,a=_F(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:S.style.fontSize},S.style),{text:r,_originText:y.formatMethod?h:void 0}));if(this._appendDataToShape(a,t1.itemValue,t,n,S.state),a.addState(e?tQ.selected:tQ.unSelected),this._itemWidthByUser){let t=this._itemWidthByUser-k[1]-k[3]-C-B-R-E-s;this._autoEllipsis(f,t,O,a),y.alignRight?a.setAttributes({textAlign:"right",x:this._itemWidthByUser-C/2-k[1]-k[3]-E-s}):a.setAttribute("x",R+(O.AABBBounds.empty()?0:O.AABBBounds.x2))}else a.setAttribute("x",R+(O.AABBBounds.empty()?0:O.AABBBounds.x2));T=s+(a.AABBBounds.empty()?0:a.AABBBounds.x2),M.add(a)}else this._itemWidthByUser&&O.setAttribute("maxLineWidth",this._itemWidthByUser-k[1]-k[3]-C-B-E),T=R+(O.AABBBounds.empty()?0:O.AABBBounds.x2);w&&(w.setAttribute("x",T),M.add(w));let I=M.AABBBounds,L=I.width();if("right"===g){let t=I.x2,e=I.x1;M.forEachChildren((i,s)=>
6{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===w?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)})}let D=I.height(),F=(0,eA.A)(this.attribute.item.width)?this.attribute.item.width:L+k[1]+k[3],z=this._itemHeightByUser||D+k[0]+k[2];return n.attribute.width=F,n.attribute.height=z,w&&w.setAttribute("visible",!1),M.translateTo(-I.x1+k[3],-I.y1+k[0]),n}_createPager(t){var e,i;let{disableTriggerEvent:s,maxRow:r}=this.attribute,a=t=>t<=99?99:t<=999?999:9999;return new Il(this._itemContext.isHorizontal?Object.assign(Object.assign({layout:1===r?"horizontal":"vertical",total:a(this._itemContext.pages)},eB({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null==(e=this.attribute.pager)?void 0:e.defaultCurrent,disableTriggerEvent:s}):Object.assign({layout:"horizontal",total:a(this._itemContext.pages),disableTriggerEvent:s,defaultCurrent:null==(i=this.attribute.pager)?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){let{disableTriggerEvent:i}=this.attribute;return new RC(this._itemContext.isHorizontal?Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12*(!1!==t.visible)},t),{width:e}):Object.assign(Object.assign({direction:"vertical",width:12*(!1!==t.visible),range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i){let{pager:s}=this.attribute,{totalPage:r,isHorizontal:a}=this._itemContext,n=s&&s.position||"middle";if(this._pagerComponent.setTotal(r),a){let s;s="start"===n?t:"end"===n?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"===n?0:"end"===n?e-this._pagerComponent.AABBBounds.width():(e-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:i-this._pagerComponent.AABBBounds.height()})}}_computeScrollbarDelta(){let{isHorizontal:t,clipContainer:e}=this._itemContext,i=this._itemsContainer.AABBBounds,s=e.AABBBounds;return t?s.width()/i.width():s.height()/i.height()}_updatePositionOfScrollbar(t,e,i){let{isHorizontal:s,currentPage:r,totalPage:a}=this._itemContext,n=(r-1)/a;this._pagerComponent.setScrollRange([n,n+this._computeScrollbarDelta()]),s?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){let{animation:i=!0,animationDuration:s=450,animationEasing:r="quadIn"}=this.attribute.pager||{},a=this._itemContext.isScrollbar?t=>{let{value:e}=t.detail;return 0===e[0]?1:1===e[1]?this._itemContext.totalPage:e[0]*this._itemContext.totalPage+1}:t=>t.detail.current,n=t=>{let e=this._pagerComponent,i=e.getScrollRange(),{direction:s}=e.attribute,{width:r,height:a}=e.getSliderRenderBounds(),n="vertical"===s?t.deltaY/a:t.deltaX/r;e.setScrollRange([i[0]+n,i[1]+n],!0),this.updateScrollMask()},l=n=>{let l=a(n);if(l!==this._itemContext.currentPage){if(this._itemContext.currentPage=l,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length){this._renderItems();let t=Math.ceil(this._itemContext.pages/this._itemContext.maxPages);if(this._itemContext.totalPage=t,this._itemContext.isScrollbar&&this._pagerComponent){let t=this._computeScrollbarDelta(),[e]=this._pagerComponent.getScrollRange();this._pagerComponent.setScrollRange([e,e+t])}}if(this._itemContext.isScrollbar){let[t]=this._pagerComponent.getScrollRange(),a=(this._itemContext.isHorizontal?this._itemsContainer.AABBBounds.width():this._itemsContainer.AABBBounds.height())*t;this.updateScrollMask(),i?this._itemsContainer.animate().to({[e]:-a},s,r):this._itemsContainer.setAttribute(e,-a)}else i?this._itemsContainer.animate().to({[e]:-(l-1)*t},s,r):this._itemsContainer.setAttribute(e,-(l-1)*t)}};this._itemContext.isScrollbar?(this._pagerComponent.addEventListener("scrollDrag",l),this._pagerComponent.addEventListener("scrollUp",l),this.attribute.pager.roamScroll&&(this.addEventListener("wheel",t=>t.nativeEvent.preventDefault()),this.addEventListener("wheel",u2(n,50)))):(this._pagerComponent.addEventListener("toPrev",l),this._pagerComponent.addEventListener("toNext",l))}_renderPager(){let t=this._title?this._title.AABBBounds.height()+uQ(this.attribute,"title.space",8):0,{maxWidth:e,maxCol:i=1,maxRow:s=2,item:r={},pager:a={}}=this.attribute,{spaceCol:n=16,spaceRow:l=8}=r,o=this._itemsContainer,{space:h=12,defaultCurrent:u=1}=a,d=Iu(a,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext,p=this._contentMaxHeight,g,f=0,m=0,_=0,y=0,v=0,b=0,x=1;if(c){if(m=(s-1)*l+this._itemHeight*s,f=e,g=this._createPager(d),this._pagerComponent=g,this._innerView.add(g),(_=e-g.AABBBounds.width()-h)<=0)return this._innerView.removeChild(g),!1;
6o.getChildren().forEach((t,e)=>{let{width:i,height:s}=t.attribute;_<v+i&&e>0&&(v=0,b+=s+l,x+=1),e>0&&t.setAttributes({x:v,y:b}),v+=n+i}),this._itemContext.startX=v,this._itemContext.startY=b,this._itemContext.pages=x;let i=Math.ceil(x/s);this._itemContext.totalPage=i,this._updatePositionOfPager(t,f,m)}else{if(f=this._itemMaxWidth*i+(i-1)*n,m=p,_=f,g=this._createPager(d),this._pagerComponent=g,this._innerView.add(g),(y=p-g.AABBBounds.height()-h-t)<=0)return this._innerView.removeChild(g),!1;o.getChildren().forEach((t,e)=>{let{width:i,height:s}=t.attribute;y<b+s&&e>0&&(b=0,v+=this._itemMaxWidth+n,x+=1),e>0&&t.setAttributes({x:v,y:b}),b+=l+s});let e=Math.ceil(x/i);this._itemContext.totalPage=e,this._updatePositionOfPager(t,f,m)}u>1&&(c?o.setAttribute("y",-(u-1)*(m+l)):o.setAttribute("x",-(u-1)*(f+n)));let S=lF.group({x:0,y:t,width:c?_:f,height:c?m:y,clip:!0,pickable:!1});return S.add(o),this._innerView.add(S),this._itemContext.clipContainer=S,this._bindEventsOfPager(c?m+l:f+n,c?"y":"x"),!0}_renderScrollbar(){var t;let e=this._title?this._title.AABBBounds.height()+uQ(this.attribute,"title.space",8):0,{maxWidth:i,item:s={},pager:r={}}=this.attribute,{spaceCol:a=16,spaceRow:n=8}=s,l=this._itemsContainer,{space:o=12,defaultCurrent:h=1}=r,u=Iu(r,["space","defaultCurrent"]),{isHorizontal:d}=this._itemContext,c=this._contentMaxHeight,p,g=0,f=0,m=0,_=1;if(d)g=i,f=this._itemHeight,p=this._createScrollbar(u,g),this._pagerComponent=p,this._innerView.add(p);else{if(f=c-e,g=this._itemMaxWidth,p=this._createScrollbar(u,f),this._pagerComponent=p,this._innerView.add(p),f<=0)return this._innerView.removeChild(p),!1;let t=l.getChildren(),i=t.map(t=>t.attribute.height);if(1===i.length||i.every(t=>t===i[0])){let e=i[0],s=Math.floor(f/(n+e));f=s*(n+e),_=Math.ceil(t.length/s)}else t.forEach((t,e)=>{let{height:i}=t.attribute,s=_,r=m;_=Math.floor((m+i)/f)+1,m+=n+i,s!==_&&e===l.getChildren().length-1&&m-f>=1/3*i&&(f=r+i,_-=1)});this._itemContext.totalPage=_,this._itemContext.pages=_}if(h>1)if(d){let t=this._itemsContainer.AABBBounds.width()-g;l.setAttribute("x",-Math.min((h-1)*(g+a),t))}else{let t=this._itemsContainer.AABBBounds.height()-f;l.setAttribute("y",-Math.min((h-1)*(f+n),t))}let y=lF.group({x:0,y:e,width:g,height:f,clip:!0,pickable:!1});return y.add(l),this._innerView.add(y),this._itemContext.clipContainer=y,this._updatePositionOfScrollbar(g,f,e),(null==(t=r.scrollMask)?void 0:t.visible)&&this.renderScrollMask(y),this._bindEventsOfPager(d?g:f,d?"x":"y"),!0}renderScrollMask(t){let{scrollMask:e={}}=this.attribute.pager,{visible:i=!0,gradientLength:s=16,gradientStops:r}=e;if(!i||!r)return;let a=t.AABBBounds.width(),n=t.AABBBounds.height(),l=this._itemContext.isHorizontal?a:n,o=r.map(t=>({offset:s*t.offset/l,color:t.color})),h=r.map(t=>({offset:(l-s*t.offset)/l,color:t.color})),u=lF.rect({x:0,y:0,width:a,height:n});this._scrollMask=u,this._scrollMaskContext={startStops:o,endStops:h},this.updateScrollMask(),t.add(u)}updateScrollMask(){if(!this._scrollMask||!this._pagerComponent||!this._itemContext.isScrollbar)return;let[t,e]=this._pagerComponent.getScrollRange(),i=[];rL(h4(e,0,1),1)||i.push(...this._scrollMaskContext.endStops),rL(h4(t,0,1),0)||i.push(...this._scrollMaskContext.startStops),i.length&&(this._itemContext.isHorizontal?this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:i}}):this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:0,y1:1,stops:i}}))}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(tQ.selected)?this._setLegendItemState(t,tQ.selectedHover,e):this._setLegendItemState(t,tQ.unSelectedHover,e);let i=t.getChildren()[0].find(t=>t.name===t1.focus,!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(t0.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(tQ.unSelectedHover)||t.hasState(tQ.selectedHover))&&(i=!0),t.removeState(tQ.unSelectedHover),t.removeState(tQ.selectedHover),t.getChildren()[0].getChildren().forEac
6h(t=>{!i&&(t.hasState(tQ.unSelectedHover)||t.hasState(tQ.selectedHover))&&(i=!0),t.removeState(tQ.unSelectedHover),t.removeState(tQ.selectedHover)});let s=t.getChildren()[0].find(t=>t.name===t1.focus,!1);s&&s.setAttribute("visible",!1),i&&this._dispatchLegendEvent(t0.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(t0.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!==t1.focus&&(s||t.hasState(e)||(s=!0),t.addState(e,!0))}),s&&this._dispatchLegendEvent(t0.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!==t1.focus&&e.forEach(e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)})}),s&&this._dispatchLegendEvent(t0.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;let e=[];return null==(t=this._itemsContainer)||t.getChildren().forEach(t=>{t.hasState(tQ.selected)&&e.push(t.data)}),e}_appendDataToShape(t,e,i,s,r={}){t.name=e,t.data=i,t.delegate=s,t.states=eB({},Id,r)}_dispatchLegendEvent(t,e,i){let s=this._getSelectedLegends();s.sort((t,e)=>t.index-e.index);let r=s.map(t=>t.label);this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(tQ.selected),currentSelectedItems:s,currentSelected:r,event:i})}_handleStyle(t,e,i,s,r){let a={};return t.style&&((0,r3.A)(t.style)?a.style=t.style(e,i,s,r):a.style=t.style),t.state&&(a.state={},Object.keys(t.state).forEach(n=>{t.state[n]&&((0,r3.A)(t.state[n])?a.state[n]=t.state[n](e,i,s,r):a.state[n]=t.state[n])})),a}release(){super.release(),this.removeAllEventListeners()}}Ic.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}}
6,item:{spaceCol:16,spaceRow:8,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:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};let Ip=(t,e)=>{let i=[],s={},{series:r,seriesField:a}=e;return r().forEach(t=>{let e=a(t);(e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e)).forEach(t=>{s[t.key]||(s[t.key]=!0,i.push(t))})}),i},Ig=(t,e)=>{var i,s,r;let{series:a,selected:n,field:l,data:o,customFilter:h}=e,u=n(),d=o();if(0===u.length&&d.length)return[];if(u.length===d.length)return t;let c={};u.forEach(t=>{c[t]=!0});let p=null!=(i=l())?i:pk;return h?h(t,u,p):((0,ev.A)(t)&&(null==(s=t[0])?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter(t=>!0===c[t.key]),(null==(r=t[0])?void 0:r.links)&&(t[0].links=t[0].links.filter(t=>!0===c[t.source]&&!0===c[t.target]))):(0,eA.A)(p)&&(t=t.filter(t=>!0===c[a.getSeriesFieldValue(t,p)])),t)};class If extends SL{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=j.Legend,this.layoutLevel=V.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{x8(this._regions,t=>{var e;null==(e=t.getViewData())||e.markRunning()},{userId:this._seriesUserId,specIndex:this._seriesIndex}),x8(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=hN(this._spec.orient)?this._spec.orient:"left",this._position=null!=(t=this._spec.position)?t:"middle",this._visible=!1!==this._spec.visible;let{regionId:e,regionIndex:i,seriesId:s,seriesIndex:r}=this._spec;(0,eA.A)(s)&&(this._seriesUserId=oS(s)),(0,eA.A)(e)&&(this._regionUserId=oS(e)),(0,eA.A)(r)&&(this._seriesIndex=oS(r)),(0,eA.A)(i)&&(this._regionUserIndex=oS(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?i.reMake=!0:(0,ex.n)(e,t)||(i.reCompile=!0),i}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}initData(){let t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new mz(this._option,t),this._initSelectedData(),x8(this._regions,t=>{t.event.on(dj.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},()=>{this._legendData.getDataView().reRunAllTransform({skipEqual:!0})})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;let r=this._selectedData;(0,eE.A)(t)||JSON.stringify(r)===JSON.stringify(t)||(x8(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)||i.call(e),this.event.emit(dj.legendSelectedDataChange,{model:this}),null==(s=this._legendComponent)||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){let{x:e,y:i}=t;eP(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};let 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)(0,ex.n)(s,this._cacheAttrs)||this._legendComponent.setAttributes(uy({},s,{defaultSelected:this._selectedData}));else{let t=new(this._getLegendConstructor())(uy({},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;
6let r=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,a=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){let t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:n}=e,l=0,o=0;"horizontal"===t?"middle"===i?l=(s-r)/2:"end"===i&&(l=s-r):"middle"===i?o=(n-a)/2:"end"===i&&(o=n-a),this._legendComponent.setAttributes({dx:l,dy:o})}return i.x2=i.x1+r,i.y2=i.y1+a,i}onDataUpdate(){var t,e;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){let t=this._getLegendAttributes(this.getLayoutRect());(0,ex.n)(t,this._cacheAttrs)||this._legendComponent.setAttributes(uy({},t,{defaultSelected:this._selectedData}))}null==(e=(t=this.effect).onSelectedDataChange)||e.call(t),this.event.emit(dj.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}If.specKey="legends";let Im={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"}}}}
6,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};class I_ extends If{constructor(){super(...arguments),this.type=hc.discreteLegend,this.name=hc.discreteLegend}static getSpecInfo(t){return v2(t,this.specKey,this.type,t=>!t.type||"discrete"===t.type)}init(t){super.init(t),x8(this._regions,t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData(),customFilter:this._spec.customFilter},level:D.legendFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){c3(this._option.dataSet,"discreteLegendFilter",Ig),c3(this._option.dataSet,"discreteLegendDataMake",Ip);let t=new eR(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{let t=[];return x8(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;let r=t.getSeriesField(),a=null!=(e=this._spec.scaleName)?e:this._spec.scale;if((0,eE.A)(a)||!t.getRawData())return r;let n=this._option.globalScale.getScaleSpec(a);if(!n)return r;if(this._spec.field)return this._spec.field;if(!hV(n.domain))return r;let l=n.domain.find(e=>e.dataId===t.getRawData().name);return l&&null!=(s=null==(i=l.fields)?void 0:i[0])?s:r}_initSelectedData(){let t=this.getLegendDefaultData();if(this._unselectedData){let 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(0,r3.A)(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,r;if((null==(e=t.title)?void 0:e.visible)&&(0,eE.A)(t.title.text)&&(0,eE.A)(null==(i=t.title.style)?void 0:i.text)){let e=null==(r=null==(s=this._regions)?void 0:s[0])?void 0:r.getSeries()[0];if(!e)return;t.title.text=vK(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){let e=Object.assign(Object.assign({layout:"bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){let{title:i={},item:s={},pager:r={},background:a={},type:n,id:l,visible:o,orient:h,position:u,data:d,filter:c,regionId:p,regionIndex:g,seriesIndex:f,seriesId:m,padding:_}=t,y=Is(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]),{title:v={},item:b={},pager:x={},background:S={}}=t;return v=ek(v),b=ek(b),x=ek(x),S=ek(S),v.visible?y.title=Ii(v):y.title={visible:!1},pJ(b.focusIconStyle)||SS(b.focusIconStyle),b.shape&&(b.shape=Sv(b.shape)),b.label&&(b.label=Sv(b.label)),b.value&&(b.value=Sv(b.value)),b.background&&(b.background=Sv(b.background)),hW(b.maxWidth)&&(b.maxWidth=Number(b.maxWidth.substring(0,b.maxWidth.length-1))*e.width/100),hW(b.width)&&(b.width=Number(b.width.substring(0,b.width.length-1))*e.width/100),hW(b.height)&&(b.height=Number(b.height.substring(0,b.height.length-1))*e.width/100),y.item=b,"scrollbar"===x.type?(pJ(x.railStyle)||SS(x.railStyle),pJ(x.sliderStyle)||SS(x.sliderStyle)):(pJ(x.textStyle)||SS(x.textStyle),x.handler&&Sv(x.handler)),y.pager=x,S.visible&&!pJ(S.style)&&(uy(y,S.style),(0,eA.A)(S.padding)&&(y.padding=S.padding)),y}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(e),this._addLegendItemFormatMethods(e),e}_getLegendConstructor(){return Ic}setSelectedData(t){t&&(this._unselectedData=this.getLegendDefaultData().filter(e=>!t.includes(e))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){let t=!1!==this._spec.filter;this._legendComponent.addEventListener(t0.legendItemClick,e=>{let i=uQ(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(dj.legendItemClick,{model:this,value:i,event:e})}),this._legendComponent.addEventListener(t0.legendItemHover,t=>{let e=uQ(t,"detail");this.event.emit(dj.legendItemHover,{model:this,value:e,event:t})}),this._legendComponent.addEventListener(t0.legendItemUnHover,t=>{let e=uQ(t,"detail");this.event.emit(dj.legendItemUnHover,{model:this,value:e,event:t})})}}_getLegendItems(){let t=(this._legendData.getLatestData()||[]).map(t=>{var e,i;let s=t.style("fillOpacity"),r=t.style("strokeOpacity"),a=t.style("opacity"),n=t.style("texture");return{label:t.key,shape:{symbolType:null!=(i=null!=(e=t.style("symbolType"))?e:t.shapeType)?i:"circle",fillOpacity:eP(s)?s:1,strokeOpacity:eP(r)?r:1,opacity:eP(a)?a:1,texturePadding:n?1:null,textureSize:n?4:null,texture:n,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(0,r3.A)(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,r;let{formatMethod:a,formatter:n}=null!=(i=null==(e=this._spec.item)?void 0:e.label)?i:{},{formatMethod:l,formatter:o}=null!=(r=null==(s=this._spec.item)?void 0:s.value)?r:{},{formatFunc:h}=v1(a,n);n&&!a&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,n));let{formatFunc:u}=v1(l,o);o&&!l&&u&&(t.item.value.formatMethod=(t,e)=>u(o,t,e,n))}}I_.specKey="legends",I_.builtInTheme={discreteLegend:Im},I_.type=hc.discreteLegend;let Iy=(t,e)=>{let{series:i,field:s,scale:r}=e,a=s();if(s&&a){let t=1/0,e=-1/0;
6return i().forEach(i=>{let s=i.getRawDataStatisticsByField(a,!0),r=null==s?void 0:s.min,n=null==s?void 0:s.max;eP(r)&&(t=Math.min(r,t)),eP(n)&&(e=Math.max(n,e))}),[t,e]}if(r){let t=r();return t?t.domain():[]}return[]},Iv=(t,e)=>{let{selected:i,field:s,data:r,isHierarchyData:a,customFilter:n}=e,l=i(),o=s(),h=a||(t=>t&&t.some(t=>t&&function(t,e="children"){return!!r2(t)&&!!t.hasOwnProperty(e)&&Array.isArray(t[e])}(t)));if(l===r())return t;if(o&&!pJ(l)){let[e,i]=l;return n?n(t,l,o):h(t)?function t(e,i,s,r="value",a="children"){return Array.isArray(e)?e.map(e=>{let n=Object.assign({},e);return Array.isArray(n[a])&&(n[a]=t(n[a],i,s,r,a)),n}).filter(t=>+t[r]>=i&&+t[r]<=s||t[a]&&t[a].length>0):e}(t,+e,+i,o):t.filter(t=>t[o]>=e&&t[o]<=i)}return t};function Ib(t){return(0,ev.A)(t)?t:[t,t]}function Ix(t){return t?"ew-resize":"ns-resize"}(tH=t2||(t2={})).innerView="innerView",tH.railContainer="sliderRailContainer",tH.rail="sliderRail",tH.startText="sliderStartText",tH.endText="sliderEndText",tH.startHandler="sliderStartHandler",tH.startHandlerText="startHandlerText",tH.endHandler="sliderEndHandler",tH.endHandlerText="sliderEndHandlerText",tH.track="sliderTrack",tH.trackContainer="sliderTrackContainer",Io();class IS extends xN{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:eB({},IS.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;let e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=h4(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=()=>{let{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=>{this._clearAllDragEvents(),this._isChanging=!0;let{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i;let s=Rw(),r="browser"===hL.env?hL:this.stage;r.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),s.forEach(t=>{r.addEventListener(t,this._onHandlerPointerUp)})},this._onHandlerPointerMove=t=>{var e,i;this._isChanging=!0;let{railWidth:s,railHeight:r,min:a,max:n}=this.attribute;if(n===a)return;let{x:l,y:o}=this.stage.eventPointTransform(t),h,u,d,c=0;this._isHorizontal?(c=(h=l)-this._prePos,u=null==(i=this._currentHandler)?void 0:i.attribute.x,d=s):(c=(h=o)-this._prePos,u=null==(e=this._currentHandler)?void 0:e.attribute.y,d=r);let p=h4(u+c,0,d),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=>{this._isChanging=!1,this._currentHandler=null,this._clearAllDragEvents()},this._handleTouchMove=t=>{this._isChanging&&t.preventDefault()},this._onTrackPointerdown=t=>{this._clearAllDragEvents(),this._isChanging=!0;let{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i;let s=Rw(),r="browser"===hL.env?hL:this.stage;r.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}
6),s.forEach(t=>{r.addEventListener(t,this._onTrackPointerUp)})},this._onTrackPointerMove=t=>{let e,i,s;this._isChanging=!0;let{railWidth:r,railHeight:a,min:n,max:l,inverse:o}=this.attribute;if(l===n)return;let{startHandler:h,endHandler:u}=this._getHandlers(),{x:d,y:c}=this.stage.eventPointTransform(t);this._isHorizontal?(e=d,i=this._track.attribute.width,s=r):(e=c,i=this._track.attribute.height,s=a);let p=e-this._prePos;if(h){let t=this._isHorizontal?h.attribute.x:h.attribute.y,e=o?h4(t+p,i,s):h4(t+p,0,s-i),r=this.calculateValueByPos(e);this._updateHandler(h,e,r)}if(u){let t=this._isHorizontal?u.attribute.x:u.attribute.y,e=o?h4(t+p,0,s-i):h4(t+p,i,s),r=this.calculateValueByPos(e),a=null==h?void 0:h.attribute;this._updateHandler(u,e,r),this._track.setAttributes(this._isHorizontal?{x:Math.min(a.x,u.attribute.x),width:Math.abs(a.x-u.attribute.x)}:{y:Math.min(a.y,u.attribute.y),height:Math.abs(a.y-u.attribute.y)})}this._prePos=e,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{this._isChanging=!1,this._clearAllDragEvents()},this._onRailPointerDown=t=>{let e,i,s;this._clearAllDragEvents(),this._isChanging=!0;let{railWidth:r,railHeight:a,min:n,max:l}=this.attribute;if(l===n)return;let o=this._startHandler,h=this._endHandler;this._isHorizontal?(e=t.viewX-this._rail.globalAABBBounds.x1,i=null==o?void 0:o.attribute.x,s=null==h?void 0:h.attribute.x):(e=t.viewY-this._rail.globalAABBBounds.y1,i=null==o?void 0:o.attribute.y,s=null==h?void 0:h.attribute.y);let u=this.calculateValueByPos(e);if((0,eA.A)(s)){let t=Math.abs(e-i)>Math.abs(e-s)?h:o;this._updateHandler(t,e,u)}else this._updateHandler(o,e,u);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){let{layout:i,railWidth:s,railHeight:r,min:a,max:n,inverse:l}=this.attribute,o=0;return o=a===n?"start"===e?0:+("end"===e):(t-a)/(n-a),(l?1-o:o)*("vertical"===i?r:s)}calculateValueByPos(t){let{layout:e,railWidth:i,railHeight:s,min:r,max:a,inverse:n}=this.attribute,l="vertical"===e?s:i;return r+(a-r)*(n?1-t/l:t/l)}setValue(t){let{min:e,max:i}=this.attribute;if(i===e)return;let[s,r]=oS(t),{startHandler:a,endHandler:n}=this._getHandlers();a&&this._updateHandler(a,this.calculatePosByValue(s),s),n&&this._updateHandler(n,this.calculatePosByValue(r),r),this._updateTrack()}render(){var t,e;let i;this.removeAllChild(!0);let{layout:s="horizontal",railWidth:r,railHeight:a,startText:n,endText:l,min:o,max:h,showHandler:u=!0,showTooltip:d}=this.attribute,{value:c}=this.attribute;(0,eE.A)(c)&&(c=[o,h]),this._currentValue={startValue:Ib(c)[0],endValue:Ib(c)[1]};let p="horizontal"===s;this._isHorizontal=p;let g=lF.group({x:0,y:0});g.name=t2.innerView,this.add(g),this._innerView=g;let f,m=0;if(n&&n.visible){(f=lF.text(Object.assign({x:p?0:r/2,y:p?a/2:0,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:n.text,lineHeight:null==(t=n.style)?void 0:t.fontSize},n.style))).name=t2.startText,g.add(f);let e=(0,eA.A)(n.space)?n.space:0;m+=(p?f.AABBBounds.width():f.AABBBounds.height())+e}let _=lF.group({x:p?m:0,y:p?0:m});g.add(_);let y=lF.group({x:0,y:0});if(y.name=t2.railContainer,this._railContainer=y,_.add(y),this._mainContainer=_,this._renderRail(y),m+=p?r:a,l&&l.visible){let t=(0,eA.A)(l.space)?l.space:0;(i=lF.text(Object.assign({x:p?m+t:r/2,y:p?a/2:m+t,textAlign:p?"start":"center",textBaseline:p?"middle":"top",text:l.text,lineHeight:null==(e=l.style)?void 0:e.fontSize},l.style))).name=t2.endText,g.add(i)}this._renderTrack(y),u&&(this._renderHandlers(_),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){let{railWidth:e,railHeight:i,railStyle:s,slidable:r}=this.attribute,a="default";!1!==r&&(a="pointer");let n=lF.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:a},s));return n.name=t2.rail,t.add(n),this._rail=n,n}_renderHandlers(t){let{range:e,min:i,max:s,handlerSize:r=14,handlerStyle:a,handlerText:n,railHeight:l,railWidth:o,slidable:h}=this.attribute,{value:u}=this.attribute;(0,eE.A)(u)&&(u=[i,s]);let d=n&&n.visible,c=this._isHorizontal,[p,g]=Ib(u),f=this.calculatePosByValue(p,e?"start":"end"),m=this._renderHandler(Object.assign({x:c?f:o/2,y:c?l/2:f,size:r,strokeBoundsBuffer:0,cursor:!1===h?"default":Ix(c)},a));if(m.name=t2.startHandler,this._startHandler=m,t.add(m),this._currentValue.startPos=f,d){let i=this._renderHandlerText(p,e?"start":"end");i.name=t2.startHandlerText,t.add(i),this._startHandlerText=i}if(e){let e=this.calculatePosByValue(g,"end"),i=this._renderHandler(Object.assign({x:c?e:o/2,y:c?l/2:e,size:r,strokeBoundsBuffer:0,cursor:!1===h?"default":Ix(c)},a));if(i.name=t2.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,d){let e=this._renderHandlerText(g,"end");e.name=t2.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){let e,i,s,{range:r,min:a,max:n,railHeight:l,railWidth:o,trackStyle:h,railStyle:u,slidable:d,value:c}=this.attribute;if((0,eE.A)(c))r?(e=a,i=n):e=i=a;else if(r){let t=RM(c,a,n);e=t[0],i=t[1]}else e=a,i=h4(c,a,n);let p=this._isHorizontal;r||(e=a);let g=lF.group({x:0,y:0,width:o,height:l,cornerRadius:null==u?void 0:u.cornerRadius,clip:!0,pickable:!1});g.name=t2.trackContainer;let f=r2(r)&&!0===r.draggableTrack;s=!1===d?"default":!1===r||!1===f?"pointer":Ix(p);let m=this.calculatePosByValue(e,"start"),_=this.calculatePosByValue(i,r?"end":"start"),y=lF.rect(Object.assign({x:
6p?Math.min(m,_):0,y:p?0:Math.min(m,_),width:p?Math.abs(_-m):o,height:p?l:Math.abs(_-m),cursor:s},h));y.name=t2.track,this._track=y,g.add(y),t.add(g)}_renderHandler(t){return lF.symbol(t)}_renderHandlerText(t,e){return lF.text(this._getHandlerTextAttributes(t,e))}_getHandlerPosition(t){return this.attribute.range&&t?"start":"end"}_getHandlerTextStyle(t,e){let{align:i,handlerSize:s=14,handlerText:r={},railHeight:a,railWidth:n,slidable:l}=this.attribute;return(0,r3.A)(r.style)?r.style(t,e,{layout:this.attribute.layout,align:i,railWidth:n,railHeight:a,handlerSize:s,slidable:l}):r.style}_getHandlerTextAttributes(t,e){var i,s;let{align:r,handlerSize:a=14,handlerText:n={},railHeight:l,railWidth:o,slidable:h}=this.attribute,u=this._isHorizontal,d=this.calculatePosByValue(t,e),c=null!=(i=n.space)?i:4,p=this._getHandlerTextStyle(t,e),g={text:n.formatter?n.formatter(t):t.toFixed(null!=(s=n.precision)?s:0),lineHeight:null==p?void 0:p.lineHeight,cursor:!1===h?"default":Ix(u)};return u?"top"===r?(g.textBaseline="bottom",g.textAlign="center",g.x=d,g.y=(l-a)/2-c):(g.textBaseline="top",g.textAlign="center",g.x=d,g.y=(l+a)/2+c):("left"===r?(g.textBaseline="middle",g.textAlign="end",g.x=(o-a)/2-c):(g.textBaseline="middle",g.textAlign="start",g.x=(o+a)/2+c),g.y=d),Object.assign(Object.assign({},g),p)}_renderTooltip(){var t;let{tooltip:e,railHeight:i,railWidth:s,align:r}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;let a=this._isHorizontal?0:s/2,n=this._isHorizontal?i/2:0;if(e&&e.shape){let t=lF.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:a,y:n,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}let l=e&&e.text||{},o=null!=(t=l.space)?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=a,h.y="top"===r?n-i/2-o:n+i/2+o,h.textAlign="center",h.textBaseline="top"===r?"bottom":"top"):(h.y=n,h.x="left"===r?a-s/2-o:n+s/2+o,h.textAlign="left"===r?"end":"start",h.textBaseline="middle");let u=lF.text(Object.assign(Object.assign({},h),l.style));this._mainContainer.add(u),this._tooltipText=u,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;let{railWidth:i,railHeight:s}=this.attribute,r=this._isHorizontal?i:s,a=this._tooltipState.pos*r,n=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[n]:a});let{align:l}=this.attribute;if(this._tooltipText){let i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[n]:a,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==l?`â ${this._tooltipState.value.toFixed(null!=(e=i.precision)?e:0)}`:`${this._tooltipState.value.toFixed(null!=(t=i.precision)?t:0)} â`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;let{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),r2(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown),("browser"===hL.env?hL:this.stage).addEventListener("touchmove",this._handleTouchMove,{passive:!1}))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_clearAllDragEvents(){let t=Rw(),e="browser"===hL.env?hL:this.stage;e.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),t.forEach(t=>{e.removeEventListener(t,this._onHandlerPointerUp)}),e.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),t.forEach(t=>{e.removeEventListener(t,this._onTrackPointerUp)})}_updateTrack(){let{inverse:t,railWidth:e,railHeight:i}=this.attribute,s=this._startHandler,r=this._endHandler;if(this._isHorizontal){let i=null==s?void 0:s.attribute.x;if(r){let t=null==r?void 0:r.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{let e=null==s?void 0:s.attribute.y;if(r){let t=null==r?void 0:r.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){let s=this._isHorizontal;t.setAttribute(s?"x":"y",e);let r=t.name===t2.startHandler?this._startHandlerText:this._endHandlerText;if(r){let e=this._getHandlerPosition(t.name===t2.startHandler);r.setAttributes(this._getHandlerTextAttributes(i,e))}t.name===t2.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){let s=this._isHorizontal,r=this._getHandlerPosition(t.name===t2.startHandlerText);t.setAttributes(this._getHandlerTextAttributes(i,r));let a=t.name===t2.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[s?"x":"y"]:e}),t.name===t2.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){let 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(){let{inverse:t}=this.attribute,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
6)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e])),{startHandler:e,endHandler:i}}release(t){super.release(t),("browser"===hL.env?hL:this.stage).removeEventListener("touchmove",this._handleTouchMove,{passive:!1}),this._clearAllDragEvents()}}IS.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}}},Ih(),Io();class IA extends Ir{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IA.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{let e=this._slider.tooltipShape;if(e&&t.detail&&!(0,eE.A)(t.detail.value)){let 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(){let{colors:t,slidable:e,layout:i,align:s,min:r,max:a,value:n,railWidth:l,railHeight:o,showHandler:h=!0,handlerSize:u,handlerStyle:d,railStyle:c,trackStyle:p,startText:g,endText:f,handlerText:m,showTooltip:_,tooltip:y,inverse:v,disableTriggerEvent:b}=this.attribute,x=[],S=(a-r)/(t.length-1);for(let e=0;e<t.length;e++)x.push(r+S*e);this._colorScale=(new mb).domain(x,!0).range(t),this._color=this._getTrackColor();let A=new IS({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:s,min:r,max:a,value:n,railWidth:l,railHeight:o,showHandler:h,handlerSize:u,handlerStyle:d,railStyle:c,trackStyle:Object.assign({fill:this._color},p),startText:g,endText:f,handlerText:m,showTooltip:_,tooltip:y,disableTriggerEvent:b,inverse:v});this._innerView.add(A),this._slider=A,A.translateTo(0-A.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+uQ(this.attribute,"title.space",12):0)-A.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}_getTrackColor(){let{colors:t,layout:e,inverse:i}=this.attribute;if(pJ(t))return;let s=t.length;if(1===s)return t[0];let r=[];for(let e=0;e<s;e++){let i=e/(s-1);r.push({offset:i,color:t[e]})}let a="horizontal"===e,n={gradient:"linear",stops:r,x0:0,y0:0,x1:+!!a,y1:+!a};return i&&(a?(n.x0=1,n.x1=0):(n.y0=1,n.y1=0)),n}_updateColor(){var t;let{layout:e="horizontal",colors:i,railWidth:s,railHeight:r}=this.attribute,{startHandler:a,endHandler:n,track:l,attribute:o}=this._slider,{startValue:h,endValue:u,startPos:d,endPos:c}=this._slider.currentValue,p=null==(t=o.handlerStyle)?void 0:t.fill;if(a&&!p){let t=this._colorScale.scale(h);a.setAttribute("fill",t)}if(n&&!p){let t=this._colorScale.scale(u);n.setAttribute("fill",t)}let g="horizontal"===e?s:r;if(Math.abs(d-c)!==g&&i&&i.length>1){let t=this._color.stops,e=Math.min(d,c)/g,i=Math.max(d,c)/g,s=i-e,r=t.filter(t=>t.offset>e&&t.offset<i),a=Math.min(h,u),n=Math.max(h,u),o=this._colorScale.scale(a),p=this._colorScale.scale(n),f=[{offset:0,color:o}];r.forEach(t=>{f.push({offset:(t.offset-e)/s,color:t.color})}),f.push({offset:1,color:p}),l.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}IA.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"}}},Ih(),Io(),AF();class Ik extends Ir{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Ik.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(){let{slidable:t,layout:e,align:i,min:s,max:r,value:a,railWidth:n,railHeight:l,showHandler:o=!0,handlerSize:h,handlerStyle:u,railStyle:d,trackStyle:c,startText:p,endText:g,handlerText:f,showTooltip:m,tooltip:_,sizeBackgroun
6d:y,disableTriggerEvent:v,inverse:b}=this.attribute,x=lF.group({x:0,y:0});this._innerView.add(x);let S=new IS({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:s,max:r,value:a,railWidth:n,railHeight:l,showHandler:o,handlerSize:h,handlerStyle:Object.assign({symbolType:function(t="bottom"){let e=0;return"top"===t?` 7 M${e},-6L${e-3.5},-2.5 8 v5 9 h7 10 v-5 11 Z 12`:"left"===t?(e=1,` 13 M${e-6},0L${e-6+2.5},-3.5 14 h5 15 v7 16 h-5 17 Z 18`):"right"===t?(e=-1,` 19 M${e+6},0L${e+6-2.5},-3.5 20 h-5 21 v7 22 h5 23 Z 24 `):` 25 M${e},6L${e-3.5},2.5 26 v-5 27 h7 28 v5 29 Z 30`}(i)},u),railStyle:d,trackStyle:c,startText:p,endText:g,handlerText:f,showTooltip:m,tooltip:_,disableTriggerEvent:v,inverse:b});x.add(S);let A,k=0;"horizontal"===e?"top"===i?(A=`M0,0L${n},0L${b?0:n},12Z`,k=l):(A=`M0,12L${n},12L${b?0:n},0Z`,S.setAttribute("y",12)):"left"===i?A=`M${n},0L${n+12},${b?0:l}L${n},${l}Z`:(A=`M0,${b?0:l}L12,${l}L12,0Z`,S.setAttribute("x",12));let M=lF.path(Object.assign(Object.assign({x:0,y:k,path:A},y),{zIndex:0}));x.add(M);let w=this._title?this._title.AABBBounds.height()+uQ(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))}}Ik.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)"}};var IM=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let Iw={color:IA,size:Ik},IT={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}},IC=t=>{let 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({},IT),{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"}}}})},IB={horizontal:IC(!0),vertical:IC(!1)},IE=t=>{let 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({},IT),{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"}}}})},IP={horizontal:IE(!0),vertical:IE(!1)},IO=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],IR=[2,10];class II extends If{static getSpecInfo(t){let e=v2(t,this.specKey,this.type,t=>{var e;return"color"===(e=t.type)||"size"===e});return e&&e.forEach(t=>{t.type="color"===t.spec.type?hc.colorLegend:hc.sizeLegend}),e}constructor(t,e){super(t,e),this.type=hc.colorLegend,this.name=hc.
30colorLegend;const i="color"===this._spec.type?hc.colorLegend:hc.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),x8(this._regions,t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData,customFilter:this._spec.customFilter},level:D.legendFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){let t=this._option.globalScale,e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){c3(this._option.dataSet,"continuousLegendFilter",Iv),c3(this._option.dataSet,"continuousLegendDataMake",Iy);let t=new eR(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>x6(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,r;if((null==(e=t.title)?void 0:e.visible)&&(0,eE.A)(t.title.text)&&(0,eE.A)(null==(i=t.title.style)?void 0:i.text)){let e=this._field;if(e){let i=null==(r=null==(s=this._regions)?void 0:s[0])?void 0:r.getSeries()[0];if(!i)return;return void(t.title.text=vK(i.getRawData(),e))}let i=this._spec.scale;
30i||(i=this._legendType);let a=this._option.globalScale.getScaleSpec(i);if(!hV(null==a?void 0:a.domain))return;let n=a.domain[0];if(0===n.fields.length)return;t.title.text=vK(this._option.dataSet.getDataView(n.dataId),n.fields[0])}}_getLegendAttributes(t){var e,i;let s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",r="horizontal"===s?"bottom":this.layoutOrient,a=[],n=this._getScaleInGlobal();n&&"linear"===n.type&&(a=n.range()),pJ(a)&&(a="color"===this._legendType?IO:IR);let l=null!=(e=this._legendData.getLatestData()[0])?e:0,o=null!=(i=this._legendData.getLatestData()[1])?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),o=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));let h=Object.assign({layout:s,align:r,zIndex:this.layoutZIndex,min:l,max:o,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:a},function(t){let e=uy({},t),{title:i={},handler:s={},rail:r={},track:a={},startText:n,endText:l,handlerText:o,sizeBackground:h,background:u={},type:d,id:c,visible:p,orient:g,position:f,data:m,defaultSelected:_,field:y,filter:v,regionId:b,regionIndex:x,seriesIndex:S,seriesId:A,padding:k}=e,M=IM(e,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return i.visible?M.title=Ii(i):M.title={visible:!1},M.showHandler=!1!==s.visible,pJ(s.style)||(M.handlerStyle=SS(s.style)),(0,eA.A)(r.width)&&(M.railWidth=r.width),(0,eA.A)(r.height)&&(M.railHeight=r.height),pJ(r.style)||(M.railStyle=SS(r.style)),pJ(a.style)||(M.trackStyle=SS(a.style)),M.startText=Sv(n),M.endText=Sv(l),M.handlerText=function(t){if(!t)return t;let e=Object.assign({},t),i=t.style;return(0,r3.A)(i)?e.style=(t,e,s)=>SS(i(t,e,s)):pJ(i)||(e.style=SS(i)),e}(o),pJ(h)||(M.sizeBackground=SS(h)),u.visible&&!pJ(u.style)&&(uy(M,u.style),(0,eA.A)(u.padding)&&(M.padding=u.padding)),M}(this._spec));return this._addDefaultTitleText(h),h}
30_getLegendConstructor(){return Iw[this._legendType]}_initEvent(){if(this._legendComponent){let t=!1!==this._spec.filter;this._legendComponent.addEventListener("change",u1(e=>{let i=uQ(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(dj.legendFilter,{model:this,value:i,event:e})},30))}}}II.specKey="legends",II.builtInTheme={colorLegend:IB,sizeLegend:IP},II.type=hc.continuousLegend;let IL=(t,e)=>(0,eA.A)(e)?t.map(t=>e[t]):void 0,ID=(t,e)=>i=>t.every((t,s)=>i[t]===(null==e?void 0:e[s])),IF=t=>!(0,eE.A)(t)&&((0,ev.A)(t)?t.length>0&&t.every(eA.A):Object.keys(t).length>0),Iz=t=>(0,eA.A)(t)&&!(0,ev.A)(t),IH=t=>(0,eA.A)(t)&&(0,ev.A)(t),Ij=["panel","shape","titleLabel","keyLabel","valueLabel","spaceRow","maxContentHeight","align"];class IV extends SR{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){let{spec:i,theme:s}=super._initTheme(t,e),r=uy({},...Ij.map(t=>void 0!==(null==s?void 0:s[t])?{[t]:s[t]}:void 0),null==s?void 0:s.style),a=uy({},s);Ij.forEach(t=>{delete a[t]}),delete a.style;let n=uy({},a,i);return n.style=uy({},r,n.style),{spec:n,theme:s}}_transformSpecAfterMergingTheme(t,e,i){var s,r,a,n,l,o,h;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null==(s=t.visible)||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];let r={mark:!1!==(null==(e=null==t?void 0:t.mark)?void 0:e.visible),dimension:!1!==(null==(i=null==t?void 0:t.dimension)?void 0:i.visible),group:!1!==(null==(s=null==t?void 0:t.group)?void 0:s.visible)};return(0,eA.A)(null==t?void 0:t.activeType)&&Object.keys(r).forEach(e=>{var i;r[e]=null==(i=null==t?void 0:t.activeType)?void 0:i.includes(e)}),Object.keys(r).filter(t=>r[t])})(t),t.renderMode=null!=(r=t.renderMode)?r:h0(this._option.mode)||!hJ(this._option.mode)?"canvas":"html",t.trigger=null!=(a=t.trigger)?a:"hover",t.className=null!=(n=t.className)?n:"vchart-tooltip-element",t.enterable=null!=(l=t.enterable)&&l,t.transitionDuration=null!=(o=t.transitionDuration)?o:150,t.confine=null!=(h=t.confine)?h:"canvas"===t.renderMode,(0,eA.A)(t.parentElement)?(0,eS.A)(t.parentElement)&&(t.parentElement=hL.getElementById(t.parentElement)):hJ(this._option.mode)&&(t.parentElement=null==hZ?void 0:hZ.body)}}class IN extends SL{constructor(){super(...arguments),this.layoutZIndex=1,this.type=hc.tooltip,this.name=hc.tooltip,this.transformerConstructor=IV,this.specKey="tooltip",this.layoutType="none",this._isReleased=!1,this.enable=!0,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=>{var e,i;if(this._clickLock)this._handleChartMouseOut(t),this._clickLock=!1;else{if(!this._isTooltipShown&&!(null==(i=null==(e=this.tooltipHandler)?void 0:e.isTooltipShown)?void 0:i.call(e)))return;this._clickLock=!0}
30},this._getMouseOutHandler=t=>e=>{var i,s,r,a,n;if(this._isReleased||this._alwaysShow||this._clickLock||!this._isTooltipShown&&!(null==(s=null==(i=this.tooltipHandler)?void 0:i.isTooltipShown)?void 0:s.call(i)))return;let l=hJ(null==(r=this._option)?void 0:r.mode),{clientX:o,clientY:h}=e.event;l&&t&&this._isPointerInChart({x:o,y:h})||(this._enterable?this._outTimer=setTimeout(()=>{this._handleChartMouseOut(e)},null!=(n=null==(a=this._spec)?void 0:a.showDelay)?n:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{var e;this._cacheActiveType&&(null==(e=this._option)?void 0:e.componentShowContent)&&(!1===this._option.componentShowContent.tooltip||r2(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[this._cacheActiveType])||this._alwaysShow||this._isReleased||this._isEnterTooltip||"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,r,a;this._isReleased||this._isEnterTooltip||(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.isTooltipShown)?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout(()=>{this._handleChartMouseMove(e,t)},null!=(a=null==(r=this._spec)?void 0:r.showDelay)?a:50)):this._handleChartMouseMove(e,t)))},this._handleChartMouseMove=(t,e)=>{if(this._isReleased)return;let i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:r}}=i,a={mark:!1,dimension:!1,group:!1},n=["group","mark","dimension"];for(let s=0,r=n.length;s<r;s++){let r=n[s],l=!!this.processor[r]&&this._showTooltipByMouseEvent(r,i,t,e);if("unShowByOption"===l)a[r]="unShowByOption";else if(l){a[r]=!0;break}}Object.values(a).every(t=>!t)&&!((0,eE.A)(t.mark)&&(0,eE.A)(t.model)&&(0,eE.A)(t.datum))&&(r&&Iz(this._cacheInfo)?a.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):(0,eA.A)(s)&&(a.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),!0!==a.mark&&!0!==a.group&&(!0!==a.dimension||(0,eE.A)(s))?this._cacheActiveType&&"unShowByOption"===a[this._cacheActiveType]||this._handleChartMouseOut(t):this._initEventOfTooltipContent()},this._showTooltipByMouseEvent=(t,e,i,s,r)=>{var a;let n;if(!this._showContentByEvent(t))return"unShowByOption";let l=this.processor[t];if(!l.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;if(this._hideTimer&&clearTimeout(this._hideTimer),r)n=!l.showTooltip(this._cacheInfo,i,!0);else{let s=e.tooltipInfo[t],r=this._isSameAsCache(s,i,t);(n=!l.showTooltip(s,i,r))&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}n&&(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)));let o=null==(a=this._option)?void 0:a.globalInstance;return n&&vF.globalConfig.uniqueTooltip&&o&&vF.hideTooltip(o.id),n},this._getMouseEventData=t=>{let e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach(i=>{let{tooltipInfo:s,ignore:r}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=r}),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null==(i=null==(e=this.tooltipHandler)?void 0:e.isTooltipShown)?void 0:i.call(e)))return 0;this.event.emit(dj.tooltipHide,Object.assign(Object.assign({},t),{source:dV.chart,tooltip:this})),Object.values(this.processor).forEach(t=>{t.clearCache()});let r=null!=(s=this._spec.handler)?s:this.tooltipHandler;if(null==r?void 0:r.hideTooltip){let e=r.hideTooltip.call(r,t);return e||(this._isTooltipShown=!1),e}return 1},this.hideTooltip=()=>{if(this._isReleased)return!1;let t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:dV.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}}isTooltipShown(){return this._isTooltipShown}_registerEvent(){}_releaseEvent(){}onLayoutEnd(){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._isReleased=!0,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.release)||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(dj.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(dj.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;let s=null!=(t=this._spec.renderMode)?t:"html",r=this._option.globalInstance.getTooltipHandlerByUser();if(r)this.tooltipHandler=r,this._enterable=!1;else{let t="canvas"===s?MV.canvas:MV.dom,r=uP.getComponentPluginInType(t);r||h3("Can not find tooltip handler: "+t);let a=new r;a.name=`${this._spec.className}-${null!=(e=this._option.globalInstance.id)?e:0}
30-${this.getSpecIndex()}`,null==(i=this.pluginService)||i.load([a]),this.tooltipHandler=a,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip)return;let i=null==(e=null==(t=this.tooltipHandler)?void 0:t.getRootDom)?void 0:e.call(t);i&&(i.addEventListener("pointerenter",()=>{var t;if(!this._enterable)return;this._isEnterTooltip=!0;let e=null==(t=i.getBoundingClientRect)?void 0:t.call(i);e&&(this._cacheEnterableRect={width:e.width,height:e.height}),this._outTimer&&(clearTimeout(this._outTimer),this._outTimer=null),this._showTimer&&(clearTimeout(this._showTimer),this._showTimer=null)}),i.addEventListener("pointerleave",()=>{var t,e,s;if(this._enterable&&(this._isEnterTooltip=!1,"none"!==this._spec.triggerOff&&this._cacheEnterableRect)){let r=null==(t=i.getBoundingClientRect)?void 0:t.call(i);r&&Object.keys(this._cacheEnterableRect).every(t=>this._cacheEnterableRect[t]===r[t])&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!=(s=null==(e=this._spec)?void 0:e.showDelay)?s:50))}}),this._needInitEventOfTooltip=!1)}_initProcessor(){let t=this._spec.activeType;this.processor={},t.forEach(t=>{let e=uP.createTooltipProcessor(t,this);e&&(this.processor[t]=e)})}_initEvent(){var t;if(this._option.disableTriggerEvent)return;let e=oS(null!=(t=this._spec.trigger)?t:"hover"),i=oS(this._spec.triggerOff),s=this._option.mode;e.forEach(t=>{var e;"hover"===t?(this._handleMouseMove=this._throttle(this._getMouseMoveHandler(!1)),this._mountEvent("pointermove",{source:"chart"},this._handleMouseMove),(hQ(s)||h0(s))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerleave",{source:"chart"},this._getMouseOutHandler(!1))):"click"===t?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):r2(t)&&this._mountEvent(t.eventType,{source:null!=(e=t.source)?e:"chart",consume:t.consume},this._getMouseMoveHandler(!0))}),i.filter(t=>r2(t)).forEach(t=>{var e,i;this._mountEvent(t.eventType,{source:null!=(e=t.source)?e:"chart",consume:t.consume},this._getMouseOutHandler(null!=(i=t.checkOutside)&&i))}),!e.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){return u2(t,ed(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10)}_showContentByEvent(t){var e;return!((null==(e=this._option)?void 0:e.componentShowContent)&&(!1===this._option.componentShowContent.tooltip||r2(this._option.componentShowContent.tooltip)&&!1===this._option.componentShowContent.tooltip[t]))&&!0}reInit(t){var e,i,s;if(super.reInit(t),this.tooltipHandler){let t=null!=(e=this._spec.renderMode)?e:"html",r=this._spec.enterable&&"html"===t;r&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=r,null==(s=null==(i=this.tooltipHandler)?void 0:i.reInit)||s.call(i)}else this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null==(i=this.tooltipHandler)?void 0:i.showTooltip))return!1;let s=function(t,e,i){var s,r,a,n,l,o,h,u;let d,c,p=Object.assign({regionIndex:0},e),g=i.getOption(),f=g.getRegionsInUserIdOrIndex((0,eA.A)(p.regionId)?[p.regionId]:void 0,(0,eA.A)(p.regionIndex)?[p.regionIndex]:void 0)[0];if(!f)return"none";let m=(u=t,d=f.getSeries(),c=[],d.forEach(t=>{var e,i,s,r,a,n,l;let o=t.getDimensionField(),h=t.getMeasureField(),d=t.getSeriesField(),p=(0,eA.A)(d)?u[d]:void 0,g=(0,eA.A)(d)&&null!=(r=null==(s=null==(i=null==(e=t.getViewDataStatistics)?void 0:e.call(t))?void 0:i.latestData[d])?void 0:s.values)?r:[],f=IL(o,u),m=IL(h,u),_=IF(m),y=!_&&(0,eA.A)(d)&&(0,eE.A)(p)&&g.length>0,v=()=>{var e;let i=null==(e=t.getViewData())?void 0:e.latestData.find(ID(o,f));if(!_&&!IF(m=IL(h,i)))return;let s=t.type===dD.pie?t.dataToCentralPosition(i):t.dataToPosition(i);(0,eE.A)(s)||isNaN(s.x)||isNaN(s.y)||c.push({pos:s,data:{dimensionFields:o,dimensionData:f,measureFields:h,measureData:m,hasMeasureData:_,groupField:d,groupData:p},series:t})};if("cartesian"===t.coordinate){let e=fL(null==(n=null==(a=t.getYAxisHelper())?void 0:a.getScale(0))?void 0:n.type)?"y":"x",i=o.map((t,e)=>[t,e]).filter(([,t])=>(0,eE.A)(null==f?void 0:f[t])),s=[null!=f?f:[]];i.length>
300&&i.forEach(([e,i])=>{var r,a,n,l;let o=null!=(l=null==(n=null==(a=null==(r=t.getViewDataStatistics)?void 0:r.call(t))?void 0:a.latestData[e])?void 0:n.values)?l:[],h=[];s.forEach(t=>{o.forEach(e=>{var s;let r=null!=(s=null==t?void 0:t.slice())?s:[];r[i]=e,h.push(r)})}),s=h}),s.forEach(i=>{var s,r;if(y){let r=null==(s=t.getViewData())?void 0:s.latestData.filter(ID(o,i));g.forEach(s=>{let a=r.find(t=>t[d]===s);if(!IF(m=IL(h,a)))return;let n=t.dataToPosition(a);(0,eE.A)(n)||isNaN(n.x)||isNaN(n.y)||c.push({pos:n,data:{dimensionFields:o,dimensionData:i,measureFields:h,measureData:m,hasMeasureData:_,groupField:d,groupData:s},series:t,dimType:e})})}else{let s=null==(r=t.getViewData())?void 0:r.latestData.find(ID(o,i));if(!_&&!IF(m=IL(h,s)))return;let a=t.dataToPosition(s);if((0,eE.A)(a)||isNaN(a.x)||isNaN(a.y))return;c.push({pos:a,data:{dimensionFields:o,dimensionData:i,measureFields:h,measureData:m,hasMeasureData:_,groupField:d,groupData:p},dimType:e,series:t})}})}else if("polar"===t.coordinate)if(t.type===dD.pie)v();else if(y){let e=(null==(l=t.getViewData())?void 0:l.latestData.filter(ID(o,f))).find(t=>t[d]===p);g.forEach(i=>{if(!IF(m=IL(h,e)))return;let s=t.dataToPosition(e);(0,eE.A)(s)||isNaN(s.x)||isNaN(s.y)||c.push({pos:s,data:{dimensionFields:o,dimensionData:f,measureFields:h,measureData:m,hasMeasureData:_,groupField:d,groupData:i},series:t})})}else v();else"geo"===t.coordinate&&(()=>{var e,i,s;let r=null==(e=t.getViewData())?void 0:e.latestData.find(ID(o,f)),a=t.getNameMap(),n=null==(s=null==(i=t.getMapViewData)?void 0:i.call(t))?void 0:s.latestData.find(t=>o.every((e,i)=>"name"===e?a[t.properties[e]]===(null==f?void 0:f[i]):t.properties[e]===(null==f?void 0:f[i])));if(!n)return;let l=m;if(n&&!r&&(r=Object.assign({},u)),!_){if(l=m=IL(h,r),!IF(m)&&!r)return;IF(m)||(m=[null])}let g=t.dataToPosition(r);(0,eE.A)(g)||isNaN(g.x)||isNaN(g.y)||c.push({pos:g,data:{dimensionFields:o,dimensionData:f,measureFields:h,measureData:l,hasMeasureData:_,groupField:d,groupData:p,originDatum:r},series:t})})()}),c),_=null!=(s=p.activeType)?s:m.length>1?"dimension":"mark",y=f.getLayoutStartPoint(),v=f.getLayoutRect(),b=g.globalInstance.getContainer(),x=Object.assign({x:0,y:0},b?function(t){let{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(b):{}),S=t=>{var e;let{dimensionFields:i,dimensionData:s,measureFields:r,measureData:a,groupField:n,groupData:l}=t.data;return null==(e=t.series.getViewData())?void 0:e.latestData.find(t=>ID(i,s)(t)&&ID(r,a)(t)&&((0,eE.A)(n)||ID([n],[l])(t)))},A=f.getOption().globalInstance.getStage().window.getViewBoxTransform().getInverse(),k=t=>{var e,i;let s={x:Math.min(Math.max(t.x,0),v.width),y:Math.min(Math.max(t.y,0),v.height)},r=null!=(e=p.x)?e:y.x+s.x,a=null!=(i=p.y)?i:y.y+s.y,n={x:0,y:0};A.transformPoint({x:r,y:a},n);let{x:l,y:o}=n;return{canvasX:l,canvasY:o,clientX:x.x+l,clientY:x.y+o}};if("dimension"===_){let e=m[0];if(!e)return"none";let s=new Map;m.forEach(t=>{var e;s.has(t.series)||s.set(t.series,[]),null==(e=s.get(t.series))||e.push(t)});let o=[{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.map(t=>S(t)))?i:[]}})}];(0,eA.A)(e.dimType)&&(o[0].position=e.pos[e.dimType],o[0].dimType=e.dimType);let h={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:o,chart:null!=(r=g.globalInstance.getChart())?r:void 0,datum:void 0,model:void 0,source:dV.chart,event:k({x:m.reduce((t,e)=>t+e.pos.x,0)/m.length,y:m.reduce((t,e)=>t+e.pos.y,0)/m.length}),item:void 0};null==(l=null==(n=null==(a=i.processor)?void 0:a.dimension)?void 0:n.showTooltip)||l.call(n,o,h,!1);let u=g.globalInstance;return vF.globalConfig.uniqueTooltip&&vF.hideTooltip(u.id),_}if("mark"===_){let e=m[0];if(!e)return"none";let s=null!=(o=e.data.originDatum)?o:Object.assign(Object.assign({},S(e)),t),r=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:r}],chart:null!=(h=g.globalInstance.getChart())?h:void 0,datum:s,model:e.series,source:dV.chart,event:k(e.pos),item:void 0};
30i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);let n=g.globalInstance;return vF.globalConfig.uniqueTooltip&&vF.hideTooltip(n.id),_}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow),this._cacheActiveType=s),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if((0,eE.A)(this._cacheInfo)||(0,eE.A)(t))return!1;if(IH(t)){if(Iz(this._cacheInfo))return!1;let e=this._cacheInfo;return e.length===t.length&&t.every((t,i)=>My(t,e[i]))}if(IH(this._cacheInfo))return!1;let s=this._cacheInfo;if((null==t?void 0:t.datum)!==s.datum||(null==t?void 0:t.mark)!==s.mark||(null==t?void 0:t.series)!==s.series)return!1;let r=this._cacheParams;return!(0,eE.A)(r)&&!(0,eE.A)(e)&&r.mark===e.mark&&r.model===e.model&&r.datum===e.datum}_isPointerInChart(t){var e;let i=null==(e=this._option)?void 0:e.globalInstance;if(!i||!i.getChart())return!1;let{x:s,y:r}=t,{x:a,y:n,width:l,height:o}=i.getCanvas().getBoundingClientRect();return s>=a&&s<=a+l&&r>=n&&r<=n+o}getVisible(){return!1!==this._spec.visible}}IN.type=hc.tooltip,IN.transformerConstructor=IV,IN.builtInTheme={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}}},IN.specKey="tooltip";class IW extends xN{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}p1(),bZ();class IU extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IU.defaultAttributes,t))}renderCrosshair(t){let{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){let{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}IU.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p1(),fh();class IG extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IG.defaultAttributes,t))}renderCrosshair(t){let{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){let{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}IG.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},(tj=t3||(t3={}))[tj.ALL=3]="ALL",tj[tj.HORIZONTAL=2]="HORIZONTAL",tj[tj.VERTICAL=1]="VERTICAL";var IY=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let I$={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]};class IX extends SL{get enableRemain(){return"none"===this.triggerOff}constructor(t,e){super(t,e),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=j.CrossHair_Grid,this.labelZIndex=j.CrossHair,this.trigger="hover",this._handleIn=t=>{if(!this._option)return;let{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);let s=this._getNeedClearVRenderComponents();this._hasActive=s.some(t=>t&&!1!==t.attribute.visible)},this._handleClickInEvent=t=>{this._hasActive&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:this._clickLock?(this._clickLock=!1,this._handleOutEvent()):this._onlyLockClick||(this._handleIn(t),ed(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this._handleOutEvent()},this.triggerOff)))},this._handleHoverInEvent=u2(t=>{this._clickLock||this._handleIn(t)},10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hideCrosshair())},this._handleTooltipShow=t=>{let e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length||r2(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();let{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);let r=this._getNeedClearVRenderComponents();this._hasActive=r.some(t=>t&&!1!==t.attribute.visible)},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hideCrosshair()},this.enable=!0,this.showDefault=!0}_setAllAxisValues(t,e,i){let s=!1;if(t.forEach(t=>{fL(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)}),!this.enable)return!1;let{currentValue:r}=this._stateByField[i];return t.forEach((t,i)=>{let s=t.axis;r.set(i,{datum:this._getDatumAtPoint(s,e),axis:s})}),!0}
30clearAxisValue(){Object.keys(this._stateByField).forEach(t=>{this._stateByField[t].currentValue.clear()})}hideCrosshair(){this.clearAxisValue(),this.hide()}showCrosshair(t){t&&t.length&&(this.showDefault=!1,this.clearAxisValue(),t.forEach(t=>{let{axis:e,value:i}=t;this.setAxisValue(i,e)}),this.layoutByValue(!1))}_getLimitBounds(){var t,e;if(!this._limitBounds){let{width:i,height:s}=null!=(e=null==(t=this._option.globalInstance.getChart())?void 0:t.getViewRect())?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshairBySpec(){let t=!1;return Object.keys(this._stateByField).forEach(e=>{let i=this._spec[e];if(i&&i.visible&&i.defaultSelect){let{axisIndex:s=0,datum:r}=i.defaultSelect,a=this._option.getComponentsByKey("axes").find(t=>t.getSpecIndex()===s);a&&(t=!0,this._stateByField[e].currentValue.clear(),this._stateByField[e].currentValue.set(s,{axis:a,datum:r}))}}),t}_updateVisibleCrosshair(){let t=!1;Object.keys(this._stateByField).forEach(e=>{let i=this._spec[e];i&&i.visible&&this._stateByField[e].currentValue.size?t=!0:this._hideByField(e)}),t&&this.layoutByValue(!1)}_showDefaultCrosshair(){this.showDefault?this._showDefaultCrosshairBySpec()&&this.layoutByValue(!1):this._updateVisibleCrosshair()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(0,ex.n)(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{let 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){var s;if(!1===(null==(s=this._option.componentShowContent)?void 0:s.crosshair))return;let r=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,a=e?{level:dN.chart}:{source:dV.chart};(0,ev.A)(t)?t.forEach(t=>{this.event.on(t,a,r)}):this.event.on(t,a,r)}_eventOff(t,e,i){let s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;(0,ev.A)(t)?t.forEach(t=>{this.event.off(t,s)}):this.event.off(t,s)}onBeforeRender(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){let{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}}
30_getTriggerEvent(){let{mode:t=hd["desktop-browser"]}=this._option,e=t===hd["desktop-browser"]||t===hd["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:hQ(t)||h0(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null;if(e){let t=oS(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;let s=[];return t.forEach(t=>{s.push({click:"click"===t,in:e[t],out:i(t)})}),s}return null}_registerTooltipEvent(){this.event.on(dj.tooltipHide,{source:dV.chart},this._handleTooltipHideOrRelease),this.event.on(dj.tooltipShow,{source:dV.chart},this._handleTooltipShow),this.event.on(dj.tooltipRelease,{source:dV.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;let s=null==(i=(e=this._option).getComponentsByKey)?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let r=uQ(this._spec,`${t}Field.bindingAxesIndex`);if(r||(r=[],s.forEach((e,i)=>{I$[t].includes(e.getOrient())&&r.push(i)})),!r.length)return null;let a=new Map,n=1/0,l=1/0,o=-1/0,h=-1/0,{x:u,y:d}=this.getLayoutStartPoint();return r.forEach(t=>{var e;n=1/0,l=1/0,o=-1/0,h=-1/0;let i=s.find(e=>e.getSpecIndex()===t);if(!i)return;let r=(null==(e=i.getInnerOffset)?void 0:e.call(i))||{left:0,right:0,top:0,bottom:0};i.getRegions().forEach(t=>{let{x:e,y:i}=t.getLayoutStartPoint();n=Math.min(n,e-u+r.left),l=Math.min(l,i-d+r.top),o=Math.max(o,e+t.getLayoutRect().width-u-r.right),h=Math.max(h,i+t.getLayoutRect().height-d-r.bottom)}),a.set(t,{x1:n,y1:l,x2:o,y2:h,axis:i})}),a}onLayoutEnd(){let t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),super.onLayoutEnd()}_releaseEvent(){this.clearOutEvent();let t=this._getTriggerEvent();t&&t.forEach(t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)})}_parseFieldInfo(){Object.keys(this._stateByField).forEach(t=>{let e=this._spec[t],{crosshairComp:i}=this._stateByField[t];if(e&&e.visible){if(this._stateByField[t].attributes=this._parseField(e,t),i){let{style:e,type:s}=this._stateByField[t].attributes;i.setAttributes({["rect"===s?"rectStyle":"lineStyle"]:e})}}else i&&i.parent&&i.parent.removeChild(i)})}_parseCrosshairSpec(){this._parseFieldInfo();let{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||ed(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,r;let a={},{line:n={},label:l={},visible:o}=t;if(a.visible=o,a.type=n.type||"line",!1===n.visible)a.style={visible:!1};else{let e=n.style||{},{stroke:r,fill:l,lineWidth:o}=e,{strokeOpacity:h,fillOpacity:u,opacity:d}=e,c=IY(e,["strokeOpacity","fillOpacity","opacity"]),p="line"===a.type,g=p?h:u;if(ed(d)&&(g=(null!=g?g:1)*d),a.style=Object.assign({opacity:g,pickable:!1,visible:!0},c),p)a.style.stroke=r||l,a.style.lineWidth=uQ(n,"width",o||2);else{a.style.fill=l||r,(null==(s=null==(i=null==t?void 0:t.line)?void 0:i.style)?void 0:s.stroke)&&(a.style.stroke=t.line.style.stroke);let e=uQ(n,"width");
30if("string"==typeof e){let t=parseInt(e.substring(0,e.length-1),10)/100;a.style.sizePercent=t}else"number"!=typeof e&&"function"!=typeof e||(a.style.size=e)}}if(l.visible){let t=l.labelBackground||{},e=null!=(r=l.syncAxisLabelAngle)&&r,i=l.style||{},s=t.style||{},{fill:n="rgba(47, 59, 82, 0.9)",stroke:o,outerBorder:h}=s,u=IY(s,["fill","stroke","outerBorder"]);a.label={visible:!0,formatMethod:l.formatMethod,formatter:l.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,syncAxisLabelAngle:e,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},i),{fill:i.fill||"#fff",stroke:uQ(i,"stroke")}),panel:(ey(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:n,stroke:o,outerBorder:Object.assign({stroke:n,distance:0,lineWidth:3},h)},u):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else a.label={visible:!1};return a}_filterAxisByPoint(t,e,i){return t&&t.forEach(s=>{let r=s.axis;if((s.x1>e||s.x2<e||s.y1>i||s.y2<i)&&t.delete(r.getSpecIndex()),r.type.startsWith("polarAxis")){let s=r.getCenter(),a=r.getInnerRadius(),n=r.getOuterRadius(),l=i6.distancePP({x:e,y:i},s);(l>n||l<a)&&t.delete(r.getSpecIndex())}}),t}_updateCrosshairLabel(t,e,i){let s=this.getContainer();t?t.setAttributes(e):(t=new km(e),null==s||s.add(t),i(t)),function(t,e){let{x1:i,y1:s,x2:r,y2:a}=e,{x1:n,y1:l,x2:o,y2:h}=t.AABBBounds,{dx:u=0,dy:d=0}=t.attribute,c=0,p=0;n<i&&(c=i-n),l<s&&(p=s-l),o>r&&(c=r-o),h>a&&(p=a-h),c&&t.setAttribute("dx",c+u),p&&t.setAttribute("dy",p+d)}(t,this._getLimitBounds())}clearOutEvent(){this._timer&&(clearTimeout(this._timer),this._timer=null),this._clickLock&&(this._clickLock=null),this._hasActive&&(this._hasActive=null)}_hideByField(t){let{crosshairComp:e,labelsComp:i}=this._stateByField[t];
30e&&e.hideAll(),i&&Object.keys(i).forEach(t=>{i[t]&&i[t].hideAll()})}hide(){Object.keys(this._stateByField).forEach(t=>{this._hideByField(t)})}_getNeedClearVRenderComponents(){return Object.keys(this._stateByField).reduce((t,e)=>{let{crosshairComp:i,labelsComp:s}=this._stateByField[e];return i&&t.push(i),s&&Object.keys(s).forEach(e=>{s[e]&&t.push(s[e])}),t},[])}}IX.specKey="crosshair";let IK={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}}}}};class Iq extends IX{static getSpecInfo(t){return v2(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=hc.cartesianCrosshair,this.name=hc.cartesianCrosshair,this._stateByField={xField:{coordKey:"x",anotherAxisKey:"y",currentValue:new Map,labelsComp:{top:null,bottom:null}},yField:{coordKey:"y",anotherAxisKey:"x",currentValue:new Map,labelsComp:{left:null,right:null}}}}_findAllAxisContains(t,e){let i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){let i=x7(t.getOrient())?"x":"y",s=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(s)}setAxisValue(t,e){x7(e.getOrient())?this._stateByField.xField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.yField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_layoutCrosshair(t,e,i,s){var r;let a=t,n=e;if(i&&i.length){if("dimension"===s){let t,e=i[0],s=e.data.findIndex(t=>t.datum.length>0);if(s>-1){let i=e.data[s];t=i.series.dataToPosition(i.datum[0])}((0,eA.A)(e.dimType)?"y"===e.dimType:St(null==(r=null==e?void 0:e.axis)?void 0:r.getOrient()))?n=null==t?void 0:t.y:a=null==t?void 0:t.x}else if("mark"===s){let t=i[0],e=t.series.dataToPosition(t.datum[0]);a=null==e?void 0:e.x,n=null==e?void 0:e.y}}this.clearAxisValue();let{xAxisMap:l,yAxisMap:o}=this._findAllAxisContains(a,n);if(l&&0===l.size||o&&0===o.size){if(this.enableRemain)return;this.hide()}else l&&l.size&&this._setAllAxisValues(l,{x:a,y:n},"xField"),o&&o.size&&this._setAllAxisValues(o,{x:a,y:n},"yField"),this.layoutByValue()}layoutByValue(t){if(!this.enable)return;let e=x9(this._regions,"cartesian");e&&(MI(this._stateByField,e,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach(t=>{this._layoutByField(t)}))}_layoutByField(t){let{cacheInfo:e,attributes:i,labelsComp:s,bandSize:r,coordKey:a}=this._stateByField[t];if(!i||!e||e._isCache&&this.enableRemain)return;let{coord:n,labels:l,visible:o,labelsTextStyle:h}=e;if(o){let o=MF(this._stateByField[t]);this._updateCrosshairByField(t,o),Object.keys(l).forEach(o=>{var u,d,c;if(l[o].visible){let p=Object.assign(Object.assign(Object.assign({[a]:n+r/2},l[o]),i.label),{angle:i.label.syncAxisLabelAngle&&null!=(d=null==(u=e.axisLabel)?void 0:u.attribute.angle)?d:0,textStyle:Object.assign(Object.assign({},null==(c=i.label)?void 0:c.textStyle),h[o]),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(s[o],p,e=>{e.name=`crosshair-${t.replace("Field","")}-${o}-label`,s[o]=e})}else s[o]&&s[o].hideAll()})}else this._hideByField(t)}_updateCrosshairByField(t,e){let i=this.getContainer(),{attributes:s}=this._stateByField[t],{crosshairComp:r}=this._stateByField[t];if(r)r.setAttributes(e);else{let a=s.style;"line"===s.type?r=new IU(Object.assign(Object.assign({},e),{lineStyle:a,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===s.type&&(r=new IG(Object.assign(Object.assign({},e),{rectStyle:a,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(r),this._stateByField[t].crosshairComp=r}}}Iq.specKey="crosshair",Iq.builtInTheme={crosshair:IK},Iq.type=hc.cartesianCrosshair,p1(),ku();class IZ extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IZ.defaultAttributes,t))}renderCrosshair(t){let{center:e,radius:i,innerRadius:s=0,sectorStyle:r}=this.attribute,{startAngle:a,endAngle:n}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:a,endAngle:n}),r),"arc")}setLocation(t){let{center:e,startAngle:i=_T,endAngle:s=_C}=this.attribute,r=s-i,a=iB(iO(e,t));this.setAttributes({startAngle:a-r/2,endAngle:a+r/2})}}IZ.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},p1(),AF();class IJ extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IJ.defaultAttributes,t))}renderCrosshair(t){let e,{center:i,radius:s,sides:r=6,lineStyle:a}=this.attribute,{startAngle:n,endAngle:l}=this.attribute,o=(l-n)%(2*Math.PI)==0,h=(l-n)/r;for(let t=0;t<=r;t++){let a=iE(i,s,n+h*t);0===t?e=`M${a.x},${a.y}`:e+=`L${a.x},${a.y}`,t===r&&o&&(e+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:e},a),"path")}setLocation(t){let{center:e}=this.attribute,i=i6.distancePP(t,e);this.setAttribute("radius",i)}}IJ.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},p1(),ku();class IQ extends IW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},IQ.defaultAttributes,t))}renderCrosshair(t){let{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){let{center:e}=this.attribute,i=i6.distancePP(t,e);this.setAttribute("radius",i)}}IQ.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class I0 extends IX{static getSpecInfo(t){return v2(t,this.specKey,this.type,t=>t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible)}constructor(t,e){super(t,e),this.type=hc.polarCrosshair,this.name=hc.polarCrosshair,this._stateByField={categoryField:{coordKey:"angle",anotherAxisKey:"radius",currentValue:new Map,labelsComp:{all:null}},valueField:{coordKey:"radius",anotherAxisKey:"angle",currentValue:new Map,labelsComp:{all:null}}}}setAxisValue(t,e){"radius"===e.getOrient()?this._stateByField.valueField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e}):this._stateByField.categoryField.currentValue.set(e.getSpecIndex(),{datum:t,axis:e})}_findAllAxisContains(t,e){let i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){let{x:i,y:s}=t.getLayoutStartPoint(),{x:r,y:a}=this.getLayoutStartPoint();return t.positionToData({x:e.x-(i-r),y:e.y-(s-a)})}_layoutCrosshair(t,e,i,s){let r=t,a=e;if(i&&i.length){if("dimension"===s){let t=i[0];if(t.axis){let e=t.axis.pointToCoord({x:r,y:a}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);r=s.x,a=s.y}}else if("mark"===s){let t=i[0],e=t.series.dataToPosition(t.datum[0]);
30r=e.x,a=e.y}}this.clearAxisValue();let{angleAxisMap:n,radiusAxisMap:l}=this._findAllAxisContains(r,a);if(0!==n.size||0!==l.size)n&&this._setAllAxisValues(n,{x:r,y:a},"categoryField"),l&&this._setAllAxisValues(l,{x:r,y:a},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}layoutByValue(t){if(!this.enable)return;let e=x9(this._regions,"polar");e&&(((t,e,i=!1)=>{Object.keys(t).forEach(s=>{let{attributes:r,currentValue:a,cacheInfo:n,coordKey:l}=t[s];if(r){let o=!!a.size,h=i&&!o&&(0,eA.A)(n),u=h?n:{coord:0,axis:null,visible:o,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(n&&(n._isCache=h),"valueField"===s&&(u.sides=e.angleAxisHelper.getScale(0).domain().length),a.forEach(({axis:t,datum:i=""})=>{var a;let n=t.niceLabelFormatter;if((null==(a=r.label)?void 0:a.visible)&&(u.labels.all.visible=!0,u.labels.all.defaultFormatter=n,u.labels.all.text=i,u.labels.all.offset=Sk(t.getSpec())),"categoryField"===s){let s=e.angleAxisHelper.dataToPosition([i]),r=e.angleAxisHelper.getBandwidth(0),a=t.getOuterRadius();u.coord=s,u.coordRange=[s-r/2,s+r/2],u.sizeRange=[a,a]}else{let s=t.startAngle,r=e.radiusAxisHelper.dataToPosition([i]);u.coord=r,u.coordRange=[r,r],u.sizeRange=[s,s]}u.axis=t}),u&&!h&&u.labels.all.visible&&r&&r.label){let t=u.labels.all,{formatMethod:e,formatter:i}=r.label,{formatFunc:s,args:a}=v1(e,i,t.text,{label:t.text,orient:l});s?t.text=s(...a):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}t[s].cacheInfo=u}})})(this._stateByField,e,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach(t=>{this._layoutByField(t)}))}_layoutByField(t){var e,i,s,r,a;let{cacheInfo:n,attributes:l,crosshairComp:o,labelsComp:h,coordKey:u}=this._stateByField[t];if(!n||n._isCache&&this.enableRemain)return;let d=this.getContainer(),{visible:c,labels:p,coord:g,sizeRange:f,axis:m}=n;if(c){let n=this.getLayoutStartPoint(),c=null==(i=null==(e=this._spec.valueField)?void 0:e.line)?void 0:i.smooth,_=((t,e,i)=>{let{cacheInfo:s,coordKey:r,attributes:a}=t,{axis:n,coord:l,sizeRange:o,coordRange:h}=s,u=n.getCenter(),d={x:u.x+e.x,y:u.y+e.y};if("angle"===r)return"sector"==("rect"===a.type?"sector":"line")?{center:d,innerRadius:n.getInnerRadius(),radius:n.getOuterRadius(),startAngle:h[0],endAngle:h[1]}:{start:iE(d,n.getInnerRadius(),l),end:iE(d,n.getOuterRadius(),l)};let c=n.startAngle,p=n.endAngle,g=s.sides,f=l;if(!i){let t=n.getCenter(),e=n.coordToPoint({angle:o[0],radius:l}),i=iO(t,e),s=(p-c)/g,r=Math.floor((i-c)/s),a=Math.min((r+1)*s+c,p),h=iE(t,l,r*s+c),u=iE(t,l,a),d=ij([u.x,u.y],[h.x,h.y],[t.x,t.y],[e.x,e.y]);d&&(f=h4(i6.distancePN(e,d[0],d[1])+l,n.getInnerRadius(),n.getOuterRadius()))}return{center:d,startAngle:c,endAngle:p,radius:f,sides:g}})(this._stateByField[t],n,c);if(o)o.setAttributes(_);else{let e;if("angle"===u){let t="rect"===l.type?"sector":"line";"line"===t?e=new IU(Object.assign(Object.assign({},_),{lineStyle:l.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===t&&(e=new IZ(Object.assign(Object.assign({},_),{sectorStyle:l.style,zIndex:this.gridZIndex,pickable:!1})))}else e="polygon"==(c?"circle":"polygon")?new IJ(Object.assign(Object.assign({},_),{lineStyle:l.style,zIndex:this.gridZIndex+1})):new IQ(Object.assign(Object.assign({},_),{lineStyle:l.style,zIndex:this.gridZIndex}));this._stateByField[t].crosshairComp=e,d.add(e)}let y=p.all;if(y.visible){let t=m.getCenter(),e={x:t.x+n.x,y:t.y+n.y},i="angle"===u?{align:(r=iR(r=g))>=5/3*Math.PI||r<=1/3*Math.PI?"left":r>=2/3*Math.PI&&r<=4/3*Math.PI?"right":"center",baseline:r>=7/6*Math.PI&&r<=11/6*Math.PI?"bottom":r>=1/6*Math.PI&&r<=5/6*Math.PI?"top":"middle"}:(a=m.startAngle,{align:(a=iR(a))>=7/6*Math.PI&&a<=11/6*Math.PI?"right":a>=1/6*Math.PI&&a<=5/6*Math.PI?"left":"center",baseline:a>=5/3*Math.PI||a<=1/3*Math.PI?"bottom":a>=2/3*Math.PI&&a<=4/3*Math.PI?"top":"middle"}),o=Object.assign(Object.assign(Object.assign(Object.assign({},"angle"===u?iE(e,f[1]+y.offset,g):iE(e,_.radius,m.startAngle)),l.label),y),{textStyle:Object.assign(Object.assign({},null==(s=l.label)?void 0:s.textStyle),{textAlign:i.align,textBaseline:i.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(h.all,o,t=>{t.name=`crosshair-${u}-label`,h.all=t})}else h.all&&h.all.hideAll()}}}I0.specKey="crosshair",I0.builtInTheme={crosshair:IK},I0.type=hc.polarCrosshair;let I1=(t,e)=>{let{getNewDomain:i,isContinuous:s,field:r,originalFields:a}=e,n=r(),l=i();if((0,eE.A)(l)||(0,eE.A)(n))return t;let o=a(),h=(0,ev.A)(n)?n[0]:n;return t[h]&&o&&o[h]&&o[h].lockStatisticsByDomain&&!s()&&(t[h].values=l),t},I2=(t,e)=>{let{getNewDomain:i,isContinuous:s,field:r}=e,a=r(),n=i();if((0,eE.A)(n)||(0,eE.A)(a))return t;if(0===n.length)return[];let l={};
30n.forEach(t=>{l[t]||(l[t]=1)});let o=null;return o=s()?t=>{let e=!1;return oS(a).every(i=>{t[i]>=n[0]&&t[i]<=oA(n)&&(e=!0)}),e}:t=>{let e=!1;return oS(a).every(i=>{(l[t[i]+""]||l[t[i]])&&(e=!0)}),e},t.filter(o)},I3=(t,e)=>{let{stateFields:i,valueFields:s,dataCollection:r,isCategoryState:a,seriesCollection:n}=e.input,{stateField:l,valueField:o}=e.output,h={},u=[],d=[],c=[],p=!1,g=!1;return r.forEach((t,e)=>{var r;if((0,eE.A)(i[e]))return;let a=n[e];if(a){let t=a.getRawDataStatisticsByField(i[e]);(0,eA.A)(null==t?void 0:t.max)&&(0,eA.A)(null==t?void 0:t.min)&&(g=!0)}let l=null==(r=t.getFields())?void 0:r[i[e]];l&&l.lockStatisticsByDomain&&(p=!0,l.domain.forEach(t=>{(0,eE.A)(h[t])&&(c.push(t),h[t]=0,u.push(t))})),t.latestData.forEach(t=>{oS(i[e]).forEach(i=>{(0,eE.A)(t[i])||((0,eE.A)(h[t[i]])&&(c.push(t[i]),h[t[i]]=0,u.push(t[i])),(0,eE.A)(s[e])||(h[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))})})}),(p?c:!1===a||g?c.sort((t,e)=>t-e):u).forEach(t=>{let e={[l]:t};o&&(e[o]=h[t]),d.push(e)}),d},I5=(t,e,i)=>{let s=e.domain();if(fI(e.type))return i?s[0]+(oA(s)-s[0])*(1-t):s[0]+(oA(s)-s[0])*t;let r=e.range();i&&(r=r.slice().reverse());let a=r[0]+(oA(r)-r[0])*t;return e.invert(a)},I4=(t,e,i)=>{let s=e.scale(t),r=e.range();return!i&&fI(e.type)&&(r=r.slice().reverse()),Math.max(0,Math.min(1,(s-r[0])/(oA(r)-r[0])))},I8=(t,e)=>{if(!t)return!1;let i=t.getScale();return i.range()[0]>i.range()[1]&&(!t.getInverse()||e)},I6=t=>{let 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}},I9=(t,e,i)=>"start"===t?"percent"===e&&(0,eA.A)(i.start)||"value"===e&&(0,eA.A)(i.startValue):"percent"===e&&(0,eA.A)(i.end)||"value"===e&&(0,eA.A)(i.endValue),I7=(t,e,i)=>{if(fI(i.type))return[Math.min(e,t),Math.max(e,t)];let s=i.domain(),r=s.indexOf(t),a=s.indexOf(e);return s.slice(Math.min(r,a),Math.max(r,a)+1)};class Lt{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})}constructor(t,e,i,s,r,a,n,l){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.initZoomEvent=()=>{var t,e,i,s,r,a,n;let l={delayType:null!=(e=null==(t=this._spec)?void 0:t.delayType)?e:"throttle",delayTime:(0,eA.A)(null==(i=this._spec)?void 0:i.delayType)?null!=(r=null==(s=this._spec)?void 0:s.delayTime)?r:30:0,realTime:null==(n=null==(a=this._spec)?void 0:a.realTime)||n,allowComponentZoom:!0};this._zoomAttr.enable&&this.initZoomEventOfRegions(this.getRegions(),null,this.handleChartZoom,l),this._scrollAttr.enable&&this.initScrollEventOfRegions(this.getRegions(),null,this.handleChartScroll,l),this._dragAttr.enable&&this.initDragEventOfRegions(this.getRegions(),null,this.handleChartDrag,l)},this.handleChartZoom=(t,e)=>{var i,s;if(!this._activeRoam||this._zoomAttr.filter&&!this._zoomAttr.filter(t,e))return;let{zoomDelta:r,zoomX:a,zoomY:n}=t,{x:l,y:o}=this.getRegions()[0].getLayoutStartPoint(),{width:h,height:u}=this.getRegions()[0].getLayoutRect(),d=Math.abs(this.getState().start-this.getState().end),c=null!=(s=null==(i=this._spec.roamZoom)?void 0:i.rate)?s:1;if(d>=1&&r<1||d<=.01&&r>1)return;let p=this._isHorizontal?a:n,g=d*(r-1)*c,f=g/2,m=g/2;if(p){let t=this._isHorizontal?l:o,e=this._isHorizontal?h:u;f=Math.abs(t-p)/Math.abs(e-t)*g,m=Math.abs(e-p)/Math.abs(e-t)*g}let _=h4(this.getState().start+f,0,1),y=h4(this.getState().end-m,0,1);this._handleChange(Math.min(_,y),Math.max(_,y),!0)},this.handleChartScroll=(t,e)=>{var i;if(!this._activeRoam||this._scrollAttr.filter&&!this._scrollAttr.filter(t,e))return!1;let{scrollX:s,scrollY:r}=t,a=this._isHorizontal?s:r,n=this._isHorizontal?ic(s/r)>=.5:ic(r/s)>=.5;if(this._scrollAttr.reverse||(a=-a),n){let t=this._spec.scrollStep;eP(t)&&(a=(a>0?1:-1)*(t*(this.getState().end-this.getState().start)/1)),this.handleChartMove(a,null!=(i=this._scrollAttr.rate)?i:1)}let l=0!==this.getState().start&&1!==this.getState().end;return n&&l},this.handleChartDrag=(t,e)=>{var i;if(!this._activeRoam||this._dragAttr.filter&&!this._dragAttr.filter(t,e))return;let[s,r]=t,a=this._isHorizontal?s:r;this._dragAttr.reverse&&(a=-a),this.handleChartMove(a,null!=(i=this._dragAttr.rate)?i:1)},this.handleChartMove=(t,e)=>{let i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6){if(t>
300&&this.getState().end<1){let s=Math.min(1-this.getState().end,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}else if(t<0&&this.getState().start>0){let s=Math.max(-this.getState().start,t/i)*e;this._handleChange(this.getState().start+s,this.getState().end+s,!0)}}return!1},this._type=t,this._spec=e,this._handleChange=i,this.getLayoutRect=s,this.getState=r,this.getRegions=a,this._regions=a(),this.getOption=n,this._option=n(),this.getEvent=l,this._isHorizontal="horizontal"===Ss(Si(e))}setEventAttrFromSpec(){!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=eB({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=eB({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=eB({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,ey(this._spec.roam)&&(this._zoomAttr.enable="scrollBar"!==this._type&&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.getEvent(),this._option.mode)}}yg(Lt,TK);class Le extends SL{get isHorizontal(){return this._isHorizontal}get stateScale(){return this._stateScale}get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){let[s="percent",r="percent"]=i,a="percent"===s?t:I4(t,this._stateScale,this._isHorizontal),n="percent"===r?e:I4(e,this._stateScale,this._isHorizontal);this._handleChange(a,n,!0)}enableInteraction(){this._dataFilterEvent.enableInteraction()}disableInteraction(){this._dataFilterEvent.disableInteraction()}zoomIn(t){this._dataFilterEvent.zoomIn(t)}zoomOut(t){this._dataFilterEvent.zoomOut(t)}_initEvent(){var t;this._dataFilterEvent.initZoomEvent(),null==(t=this._relatedAxisComponent)||t.event.on(dj.scaleRawDomainUpdate,({model:t})=>{t.getRawDomain()})}_handleChange(t,e,i){var s,r;null!=(r=null==(s=this._spec)?void 0:s.zoomLock)&&r||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_updateRangeFactor(t){let e=this._relatedAxisComponent,i=e.getScale(),s=I8(e,this._isHorizontal),r=s?[1-this._end,1-this._start]:[this._start,this._end];if(s)switch(t){case"startHandler":e.scaleRangeFactorEnd(r[1]);break;case"endHandler":e.scaleRangeFactorStart(r[0]);break;default:e.scaleRangeFactorStart(r[0],!0),e.scaleRangeFactorEnd(r[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(r[0]);break;case"endHandler":e.scaleRangeFactorEnd(r[1]);break;default:e.scaleRangeFactorEnd(r[1],!0),e.scaleRangeFactorStart(r[0])}let a=i.rangeFactor();a?(this._start=s?1-a[1]:a[0],this._end=s?1-a[0]:a[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._hasInitStateScale=!1,this._shouldChange=!0,this._stateField="x",this._currentDataCollection=[],this._handleStateChange=(t,e,i)=>{var s,r;return this._startValue=t,this._endValue=e,this._newDomain=I7(this._startValue,this._endValue,this._stateScale),null==(r=(s=this.effect).onZoomChange)||r.call(s,i),!0},this.effect={onZoomChange:t=>{var e,i;let s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){let r=s.getScale(),a=s.getSpec();this._auto&&I6(a)&&this._spec.ignoreBandSize&&(r.bandwidth("auto"),r.maxBandwidth("auto"),r.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null==(i=null==(e=this._component)?void 0:e.setStartAndEnd)||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else x8(this._regions,t=>{var e;null==(e=t.getViewData())||e.markRunning()},{userId:this._seriesUserId,specIndex:this._seriesIndex}),x8(this._regions,t=>{t.reFilterViewData()},{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._orient=Si(t),this._isHorizontal="horizontal"===Ss(this._orient),this._dataFilterEvent=new Lt(this.t
30ype,this._spec,this._handleChange.bind(this),this.getLayoutRect.bind(this),()=>({start:this._start,end:this._end}),()=>this._regions,(()=>this._option).bind(this),()=>this.event)}created(){this._handleDataCollectionChangeBound=this._handleDataCollectionChange.bind(this),super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reMake||(0,ex.n)(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])})})}onLayoutStart(t,e){super.onLayoutStart(t,e);let i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),this._hasInitStateScale||(0===this._start&&1===this._end||(this._newDomain=((t,e,i,s,r)=>{if(fI(r.type)){let a=r.domain(),n=a[0],l=oA(a)-n,o=(0,eA.A)(t)?n+l*t:+e,h=(0,eA.A)(i)?n+l*i:+s;return[Math.min(h,o),Math.max(h,o)]}let a=r.domain(),n=r.range(),l=n[n.length-1]-n[0],o=(0,eA.A)(t)?a.indexOf(r.invert(l*t+n[0])):a.indexOf(e),h=(0,eA.A)(i)?a.indexOf(r.invert(l*i+n[0])):a.indexOf(s);return a.slice(Math.min(o,h),Math.max(o,h)+1)})(this._spec.start,this._startValue,this._spec.end,this._endValue,this._stateScale),this.effect.onZoomChange()),this._hasInitStateScale=!0)}_initAfterLayout(){this._stateScale=null,this._initStateScale(),this._updateScaleRange(),this._setStateFromAxis()}_beforeLayoutEnd(){this._hasInitStateScale?this._updateScaleRange():this._initAfterLayout()}onLayoutEnd(){var t;this._beforeLayoutEnd();let e=0!==this._start||1!==this._end;this._autoVisible(e),super.onLayoutEnd(),null==(t=this._relatedAxisComponent)||t.updateScaleRange()}getBoundsInRect(t){let 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}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._dataFilterEvent.setEventAttrFromSpec(),this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null==(t=this._spec.visible)||t}_setAxisFromSpec(){if((0,eA.A)(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):(0,eA.A)(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),(0,eE.A)(this._spec.field)&&!this._relatedAxisComponent){let t=this._option.getComponentsByKey("axes"),e=t.find(t=>Ss(t._orient)===Ss(this._orient));if(e)this._relatedAxisComponent=e;else{let e=t.find(t=>!fI(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();let i=this._relatedAxisComponent?null==(e=(t=this._relatedAxisComponent).getBindSeriesFilter)?void 0:e.call(t):null;if((0,eA.A)(i)&&((0,eA.A)(i.userId)&&(this._seriesUserId=oS(i.userId)),(0,eA.A)(i.specIndex)&&(this._seriesIndex=oS(i.specIndex))),(0,eA.A)(this._spec.seriesId)){let t=oS(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter(e=>t.includes(e)):this._seriesUserId=t}if((0,eA.A)(this._spec.seriesIndex)){let t=oS(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter(e=>t.includes(e)):this._seriesIndex=t}if((0,eA.A)(this._spec.regionIndex)){let t=this._option.getRegionsInIndex(oS(this._spec.regionIndex));this._regions=this._regions.filter(e=>t.includes(e))}else if((0,eA.A)(this._spec.regionId)){let t=oS(this._spec.regionId);this._regions=t.length?this._regions.filter(e=>t.includes(e.id)):[]}}_collectDataInfo(){let t,e=[],i=[],s=[],r=[];if(this._relatedAxisComponent){let i={};x8(this._regions,a=>{var n,l;let o="cartesian"===a.coordinate?a.getXAxisHelper():"polar"===a.coordinate?a.angleAxisHelper:null,h="cartesian"===a.coordinate?a.getYAxisHelper():"polar"===a.coordinate?a.radiusAxisHelper:null;if(!o||!h)return;let u=o.getAxisId()===this._relatedAxisComponent.id?o:h.getAxisId()===this._relatedAxisComponent.id?h:this._isHorizontal?o:h,d=u===o?h:o,c=fI(d.getScale(0).type),p=fI(u.getScale(0).type);e.push(a.getRawData());let g=a.getSpec(),f="cartesian"===a.coordinate?oS(g.xField):oS(null!=(n=g.angleField)?n:g.categoryField),m="cartesian"===a.coordinate?oS(g.yField):oS(null!=(l=g.radiusField)?l:g.valueField);if(i[a.id]="link"===a.type?["from_xField"]:u===o?f:m,p?(t=!1,s.push(i[a.id])):(t=!0,s.push(i[a.id][0])),this._valueField){let t="link"===a.type?["from_yField"]:d===o?f:m;c&&r.push(...t)}},{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=i}else x8(this._regions,t=>{e.push(t.getRawData()),i.push(t),s.push(this._field),this._valueField&&r.push(this._spec.valueField)},{userId:this._seriesUserId,specIndex:this._seriesIndex});return{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:r,isCategoryState:t}}_initData(){let{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:r}=this._collectDataInfo(),{dataSet:a}=this._option;c5(a,"dataview",eb),c3(a,"dataFilterComputeDomain",I3);let n=new eR(a,{name:`${this.type}_${this.id}_data`});n.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,seriesCollection:e,stateFields:i,valueFields:s,isCategoryState:r},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new mz(this._option,n),n.reRunAllTransform(),this._currentDataCollection=t,a.multipleDataViewAddListener(t,"change",this._handleDataCollectionChangeBound)}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(c3(this._option.dataSet,"dataFilterWithNewDomain",I2),c3(this._option.dataSet,"lockStatisticsFilter",I1),x8(this._regions,t=>{t.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:()=>t.getViewDataStatistics().getFields(),getNewDomain:()=>this._newDomain,field:()=>{var e;return null!=(e=this._field)?e:this._parseFieldOfSeries(t)},isContinuous:()=>fI(this._stateScale.type)},level:1},!1),t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!=(e=this._field)?e:this._parseFieldOfSeries(t)},isContinuous:()=>fI(this._stateScale.type)},level:D.dataZoomFilter})},{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onDataUpdate(){var t;let{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:r,isCategoryState:a}=this._collectDataInfo();if(this._currentDataCollection.length!==e.length||this._currentDataCollection.some((t,i)=>t!==e[i])){this._currentDataCollection.forEach(t=>{var e;null==(e=null==t?void 0:t.target)||e.removeListener("change",this._handleDataCollectionChangeBound)}),this._currentDataCollection=e;let{dataSet:t}=this._option;t.multipleDataViewAddListener(this._currentDataCollection,"change",this._handleDataCollectionChangeBound)}this._data.getDataView().transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:e,seriesCollection:i,stateFields:s,valueFields:r,isCategoryState:a},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data.getDataView().reRunAllTransform();let n=this._computeDomainOfStateScale(fI(this._stateScale.type));this._stateScale.domain(n,!1),((0,eA.A)(this._spec.start)||(0,eA.A)(this._spec.end))&&this._setStateFromSpec(),this._handleChange(this._start,this._end,!0),this._spec.auto&&!(0,ex.n)(this._domainCache,n)&&(this._domainCache=n,this._dataUpdating=!0,null==(t=this.getChart())||t.setLayoutTag(!0,null,!1))}_parseFieldOfSeries(t){var e;return null==(e=this._originalStateFields)?void 0:e[t.id]}_setStateFromSpec(){let t,e;if(this._auto=!!this._spec.auto,this._spec.rangeMode){let[i,s]=this._spec.rangeMode;I9("start",i,this._spec)&&I9("end",s,this._spec)&&(t="percent"===i?this._spec.start:I4(this._spec.startValue,this._stateScale,this._isHorizontal),e="percent"===s?this._spec.end:I4(this._spec.endValue,this._stateScale,this._isHorizontal))}else t=this._spec.start?this._spec.start:this._spec.startValue?I4(this._spec.startValue,this._stateScale,this._isHorizontal):0,e=this._spec.end?this._spec.end:this._spec.endValue?I4(this._spec.endValue,this._stateScale,this._isHorizontal):1;this._start=Math.max(0,Math.min(1,t)),this._end=Math.max(0,Math.min(1,e))}_setStateFromAxis(){var t,e;this._setStateFromSpec();let i=this._relatedAxisComponent;this._startValue=I5(this._start,this._stateScale,I8(i,this._isHorizontal)),this._endValue=I5(this._end,this._stateScale,I8(i,this._isHorizontal)),this._minSpan=null!=(t=this._spec.minSpan)?t:0,this._maxSpan=null!=(e=this._spec.maxSpan)?e:1,fI(this._stateScale.type)&&this._stateScale.domain()[0]!==oA(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(oA(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(oA(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),i&&(i&&"axis"===this._filterMode||0===this._start&&1===this._end||
30(this._newDomain=I7(this._startValue,this._endValue,this._stateScale)))}_initStateScale(){var t,e,i;let s=[0,1];if(this._relatedAxisComponent){let r=this._relatedAxisComponent.getScale().clone();this._stateScale=r,null==(t=r.maxBandwidth)||t.call(r,"auto",!0),null==(e=r.minBandwidth)||e.call(r,"auto",!0),null==(i=r.bandwidth)||i.call(r,"auto",!0),r.rangeFactor(s,!0).range(s)}else{let t=!0;this._field&&x8(this._regions,e=>{let i=e.getRawDataStatisticsByField(this._field);eP(null==i?void 0:i.min)&&eP(null==i?void 0:i.max)||(t=!1)},{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._stateScale=t?new mb:new mM,this._stateScale.domain(this._computeDomainOfStateScale(t),!0).range(s)}}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;let e=this._data.getLatestData().map(t=>t[this._stateField]);if(t){let t=e.map(t=>+t);return e.length?[oM(t),ok(t)]:[-1/0,1/0]}return e}_autoVisible(t){if(!this._auto)return;t?this.show():this.hide();let e=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[e]:t?this[`_${e}`]:0},{[e]:N.Built_In})}hide(){var t;null==(t=this._component)||t.hideAll()}show(){var t;null==(t=this._component)||t.showAll()}_autoUpdate(t){var e,i,s,r,a,n;if(!this._auto)return this._cacheVisibility=void 0,!0;let l=this._relatedAxisComponent,o=null==l?void 0:l.getSpec(),h=null==l?void 0:l.getScale(),u=I6(o);if(!this._dataUpdating&&fL(h.type)&&(null==t?void 0:t.height)===(null==(e=this._cacheRect)?void 0:e.height)&&(null==t?void 0:t.width)===(null==(i=this._cacheRect)?void 0:i.width)&&this._fixedBandSize===(null==u?void 0:u.bandSize))return this._cacheVisibility;let d=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null==(s=this._cacheRect)?void 0:s.width)?h.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null==(r=this._cacheRect)?void 0:r.height)&&h.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==u?void 0:u.bandSize,fL(h.type)){u&&(this._start||this._end)&&(this.type===hc.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());let[t,e]=null!=(a=h.rangeFactor())?a:[];d=(!(0,eE.A)(t)||!(0,eE.A)(e))&&(0!==t||1!==e)}else{let[t,e]=null!=(n=h.rangeFactor())?n:[this._start,this._end];d=0!==t||1!==e}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=d,d}_getNeedClearVRenderComponents(){return[this._component]}}yg(Le,TK),(tV=t5||(t5={})).startHandler="startHandler",tV.endHandler="endHandler",tV.middleHandler="middleHandler",tV.background="background",(tN=t4||(t4={})).stateUpdate="stateUpdate",tN.maskUpdate="maskUpdate",tN.dataZoomUpdate="dataZoomUpdate",(t8||(t8={})).dataZoomChange="dataZoomChange";let Li="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",Ls={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}},Lr=(t,e,i,s)=>{if(!e)return!1;if(s){if("start"===i){if(e.x1<t.x1)return!0}else if(e.x2>t.x2)return!0}else if("start"===i){if(e.y1<t.y1)return!0}else if(e.y2>t.y2)return!0;return!1};var La=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Ln{get startHandlerMask(){return this._startHandlerMask}get middleHandlerSymbol(){return this._middleHandlerSymbol}get middleHandlerRect(){return this._middleHandlerRect}get endHandlerMask(){return this._endHandlerMask}
30get selectedBackground(){return this._selectedBackground}get dragMask(){return this._dragMask}get startText(){return this._startText}get endText(){return this._endText}get startValue(){return this._startValue}get endValue(){return this._endValue}set showText(t){this._showText=t}get background(){return this._background}set previewData(t){this._previewData=t}get previewGroup(){return this._previewGroup}get selectedPreviewGroup(){return this._selectedPreviewGroup}set previewPointsX(t){this._previewPointsX=t}set previewPointsY(t){this._previewPointsY=t}set previewPointsX1(t){this._previewPointsX1=t}set previewPointsY1(t){this._previewPointsY1=t}set statePointToData(t){this._statePointToData=t}_initAttrs(t){this.attribute=t.attribute,this._isHorizontal="top"===this.attribute.orient||"bottom"===this.attribute.orient;let{previewData:e,previewPointsX:i,previewPointsY:s,previewPointsX1:r,previewPointsY1:a}=this.attribute;e&&(this._previewData=e),(0,r3.A)(i)&&(this._previewPointsX=i),(0,r3.A)(s)&&(this._previewPointsY=s),(0,r3.A)(r)&&(this._previewPointsX1=r),(0,r3.A)(a)&&(this._previewPointsY1=a),this._getState=t.getState,this._getLayoutAttrFromConfig=t.getLayoutAttrFromConfig,this._getContainer=t.getContainer}constructor(t){this._previewData=[],this._statePointToData=t=>t;const{showDetail:e}=t.attribute;this._showText="auto"!==e&&e,this._initAttrs(t)}setAttributes(t){this._initAttrs(t)}renderDataZoom(t=!1){var e,i,s,r,a,n;let{backgroundChartStyle:l={},selectedBackgroundChartStyle:o={},brushSelect:h}=this.attribute;this._renderBackground(),(null==(e=l.line)?void 0:e.visible)&&!t&&this._setPreviewAttributes("line",this._getContainer()),(null==(i=l.area)?void 0:i.visible)&&!t&&this._setPreviewAttributes("area",this._getContainer()),h&&this.renderDragMask(),this._renderSelectedBackground(),(null==(s=o.line)?void 0:s.visible)&&this._setSelectedPreviewClipAttributes("line",this._getContainer()),(null==(r=o.line)?void 0:r.visible)&&!t&&this._setSelectedPreviewAttributes("line"),(null==(a=o.line)?void 0:a.visible)&&this._setSelectedPreviewClipAttributes("area",this._getContainer()),(null==(n=o.area)?void 0:n.visible)&&!t&&this._setSelectedPreviewAttributes("area"),this._renderHandler(),this._showText&&this.renderText()}renderDragMask(){let{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:s}=this._getLayoutAttrFromConfig(),{start:r,end:a}=this._getState();return this._isHorizontal?this._dragMask=this._getContainer().createOrUpdateChild("dragMask",Object.assign({x:e.x+r*i,y:e.y,width:(a-r)*i,height:s,zIndex:2},t),"rect"):this._dragMask=this._getContainer().createOrUpdateChild("dragMask",Object.assign({x:e.x,y:e.y+r*s,width:i,height:(a-r)*s,zIndex:2},t),"rect"),{start:r,end:a}}_renderBackground(){var t;let{backgroundStyle:e,brushSelect:i,zoomLock:s}=this.attribute,{position:r,width:a,height:n}=this._getLayoutAttrFromConfig(),l=this._getContainer();this._background=l.createOrUpdateChild("background",Object.assign(Object.assign({x:r.x,y:r.y,width:a,height:n,cursor:i?"crosshair":"auto",zIndex:0},e),{pickable:!s&&(null==(t=e.pickable)||t)}),"rect")}_renderHandler(){var t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x,S,A,k,M,w;let{orient:T,middleHandlerStyle:C={},startHandlerStyle:B={},endHandlerStyle:E={},zoomLock:P}=this.attribute,{start:O,end:R}=this._getState(),{position:I,width:L,height:D}=this._getLayoutAttrFromConfig(),F=null!=(t=B.triggerMinSize)?t:40,z=null!=(e=E.triggerMinSize)?e:40,H=this._getContainer();if(this._isHorizontal){if(C.visible){let t=(null==(i=C.background)?void 0:i.size)||10;this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:I.x+O*L,y:I.y-t,width:(R-O)*L,height:t,zIndex:5},null==(s=C.background)?void 0:s.style),{pickable:!P&&(null==(n=null==(a=null==(r=C.background)?void 0:r.style)?void 0:a.pickable)||n)}),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:I.x+(O+R)/2*L,y:I.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!=(o=null==(l=C.icon)?void 0:l.symbolType)?o:"square",zIndex:5},C.icon),{pickable:!P&&(null==(h=C.icon.pickable)||h)}),"symbol")}this._startHandler=H.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign(Object.assign({x:I.x+O*L,y:I.y+D/2,size:D,symbolType:null!=(u=B.symbolType)?u:"square"},Ls.horizontal),{zIndex:5}),B),{pickable:!P&&(null==(d=B.pickable)||d)}),"symbol"),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign(Object.assign({x:I.x+R*L,y:I.y+D/2,size:D,symbolType:null!=(c=E.symbolType)?c:"square"},Ls.horizontal),{zIndex:5}),E),{pickable:!P&&(null==(p=E.pickable)||p)}),"symbol");let t=Math.max(this._startHandler.AABBBounds.width(),F),e=Math.max(this._startHandler.AABBBounds.height(),F),g=Math.max(this._endHandler.AABBBounds.width(),z),f=Math.max(this._endHandler.AABBBounds.height(),z);this._startHandlerMask=H.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:I.x+O*L-t/2,y:I.y+D/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},Ls.horizontal),{pickable:!P}),"rect"),this._endHandlerMask=H.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:I.x+R*L-g/2,y:I.y+D/2-f/2,width:g,height:f,fill:"white",fillOpacity:0,zIndex:999},Ls.horizontal),{pickable:!P}),"rect")}else{if(C.visible){let t=(null==(g=C.background)?void 0:g.size)||10;this._middleHandlerRect=H.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===T?I.x-t:I.x+L,y:I.y+O*D,width:t,height:(R-O)*D,zIndex:5},null==(f=C.background)?void 0:f.style),{pickable:!P&&(null==(y=null==(_=null==(m=C.background)?void 0:m.style)?void 0:_.pickable)||y)}),"rect"),this._middleHandlerSymbol=H.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===T?I.x-t/2:I.x+L+t/2,y:I.y+(O+R)/2*D,angle:Math.PI/180*90,symbolType:null!=(b=null==(v=C.icon)?void 0:v.symbolType)?b:"square",strokeBoundsBuffer:0,zIndex:5},C.icon),{pickable:!P&&(null==(S=null==(x=C.icon)?void 0:x.pickable)||S)}),"symbol")}this._startHandler=H.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign(Object.assign({x:I.x+L/2,y:I.y+O*D,size:L,symbolType:null!=(A=B.symbolType)?A:"square"},Ls.vertical),{zIndex:5}),B),{pickable:!P&&(null==(k=B.pickable)||k)}),"symbol"),this._endHandler=H.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:I.x+L/2,y:I.y+R*D,size:L,symbolType:null!=(M=E.symbolType)?M:"square",zIndex:5},Ls.vertical),E),{pickable:!P&&(null==(w=E.pickable)||w)}),"symbol");let t=Math.max(this._startHandler.AABBBounds.width(),F),e=Math.max(this._startHandler.AABBBounds.height(),F),i=Math.max(this._endHandler.AABBBounds.width(),z),s=Math.max(this._endHandler.AABBBounds.height(),z);this._startHandlerMask=H.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:I.x+L/2+t/2,y:I.y+O*D-e/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},Ls.vertical),{pickable:!P}),"rect"),this._endHandlerMask=H.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:I.x+L/2+i/2,y:I.y+R*D-s/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},Ls.vertical),{pickable:!P}),"rect")}}
30_renderSelectedBackground(){var t,e;let{selectedBackgroundStyle:i={},selectedBackgroundChartStyle:s={},brushSelect:r,zoomLock:a}=this.attribute,{start:n,end:l}=this._getState(),{position:o,width:h,height:u}=this._getLayoutAttrFromConfig(),d=this._getContainer();this._isHorizontal?this._selectedBackground=d.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:o.x+n*h,y:o.y,width:(l-n)*h,height:u,cursor:r?"crosshair":"move",zIndex:3},i),{pickable:!a&&(null==(t=s.pickable)||t)}),"rect"):this._selectedBackground=d.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:o.x,y:o.y+n*u,width:h,height:(l-n)*u,cursor:r?"crosshair":"move",zIndex:3},i),{pickable:!a&&(null==(e=i.pickable)||e)}),"rect")}_setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1,zIndex:1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");let{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))}_setSelectedPreviewClipAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1,zIndex:4},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group"));let{start:i,end:s}=this._getState(),{position:r,width:a,height:n}=this._getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?r.x+i*a:r.x,y:this._isHorizontal?r.y:r.y+i*n,width:this._isHorizontal?(s-i)*a:a,height:this._isHorizontal?n:(s-i)*n,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?r.x+i*a:r.x),y:-(this._isHorizontal?r.y:r.y+i*n),width:this._isHorizontal?(s-i)*a:a,height:this._isHorizontal?n:(s-i)*n,pickable:!1})}_setSelectedPreviewAttributes(t){let{selectedBackgroundChartStyle:e={}}=this.attribute;"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area"),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this._getPreviewLinePoints(),curveType:"basis",pickable:!1},e.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this._getPreviewAreaPoints(),curveType:"basis",pickable:!1},e.area))}_computeBasePoints(t){let e,i,{orient:s}=this.attribute,r="bottom"===s||"top"===s?"x":"y",a=Math.sign(t[t.length-1][r]-t[0][r]);0===a&&(a=1);let{position:n,width:l,height:o}=this._getLayoutAttrFromConfig();return this._isHorizontal?(e=[{x:n.x,y:n.y+o}],i=[{x:n.x+l,y:n.y+o}]):"left"===s?(e=[{x:n.x+l,y:n.y}],i=[{x:n.x+l,y:n.y+o}]):(e=[{x:n.x,y:n.y+o}],i=[{x:n.x,y:n.y}]),Math.sign(i[0][r]-e[0][r])!==a?{basePointStart:i,basePointEnd:e}:{basePointStart:e,basePointEnd:i}}_simplifyPoints(t){var e;if(t.length>1e4){let i=null!=(e=this.attribute.tolerance)?e:this._previewData.length/1e4;return t.length<=10?t:function(t,e){let i,s,r=t[0].x,a=t[0].y,n=[t[0]];for(let l=1,o=t.length;l<o;l++)(i=t[l].x-r)*i+(s=t[l].y-a)*s>e&&(r=t[l].x,a=t[l].y,n.push(t[l]));return t[t.length-1].x===r&&t[t.length-1].y===a||n.push(t[t.length-1]),n}(t,void 0!==i?i*i:1)}return 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);let{basePointStart:e,basePointEnd:i}=this._computeBasePoints(t);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);let{basePointStart:e,basePointEnd:i}=this._computeBasePoints(t);return e.concat(t).concat(i)}renderText(){let t=null,e=null;if(this._setTextAttr(t,e),this._showText){t=this._startText.AABBBounds,e=this._endText.AABBBounds,this._setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;let{x1:i,x2:s,y1:r,y2:a}=t,{dx:n=0,dy:l=0}=this.attribute.startTextStyle;if((new iZ).set(i,r,s,a).intersects(e)){let t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",l+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",n+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",l):this._startText.setAttribute("dx",n)}}_setTextAttr(t,e){var i,s,r,a,n,l,o,h;let u,d,c,p,{startTextStyle:g,endTextStyle:f}=this.attribute,{formatMethod:m}=g,_=La(g,["formatMethod"]),{formatMethod:y}=f,v=La(f,["formatMethod"]),{start:b,end:x}=this._getState();this._startValue=this._statePointToData(b),this._endValue=this._statePointToData(x);let{position:S,width:A,height:k}=this._getLayoutAttrFromConfig(),M=m?m(this._startValue):this._startValue,w=y?y(this._endValue):this._endValue,T={x1:S.x,y1:S.y,x2:S.x+A,y2:S.y+k};this._isHorizontal?(u={x:S.x+b*A,y:S.y+k/2},d={x:S.x+x*A,y:S.y+k/2},c={textAlign:Lr(T,t,"start",this._isHorizontal)?"left":"right",textBaseline:null!=(s=null==(i=null==_?void 0:_.textStyle)?void 0:i.textBaseline)?
30s:"middle"},p={textAlign:Lr(T,e,"end",this._isHorizontal)?"right":"left",textBaseline:null!=(a=null==(r=null==v?void 0:v.textStyle)?void 0:r.textBaseline)?a:"middle"}):(u={x:S.x+A/2,y:S.y+b*k},d={x:S.x+A/2,y:S.y+x*k},c={textAlign:null!=(l=null==(n=null==_?void 0:_.textStyle)?void 0:n.textAlign)?l:"center",textBaseline:Lr(T,t,"start",this._isHorizontal)?"top":"bottom"},p={textAlign:null!=(h=null==(o=null==v?void 0:v.textStyle)?void 0:o.textAlign)?h:"center",textBaseline:Lr(T,e,"end",this._isHorizontal)?"bottom":"top"}),this._startText=this._maybeAddLabel(this._getContainer(),eB({},_,{text:M,x:u.x,y:u.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:c,zIndex:5}),"data-zoom-start-text"),this._endText=this._maybeAddLabel(this._getContainer(),eB({},v,{text:w,x:d.x,y:d.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:p,zIndex:5}),"data-zoom-end-text")}_maybeAddLabel(t,e,i){let s=t.find(t=>t.name===i,!0);return s?s.setAttributes(e):((s=new km(e)).name=i,t.add(s)),s}}let Ll={debounce:u1,throttle:u2};class Lo extends eh(){constructor(t){super(),this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}}
30,this._layoutCache={attPos:"x",attSize:"width",size:0},this._handleTouchMove=t=>{this._activeState&&t.preventDefault()},this._onHandlerPointerDown=(t,e)=>{this.clearDragEvents(),"start"===e?(this._activeTag=t5.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=t5.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=t5.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=t5.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=t5.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this._eventPosToStagePos(t),this._activeCache.lastPos=this._eventPosToStagePos(t);let i="browser"===hL.env?hL:this.stage,s=Rw();i.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.on("pointermove",this._onHandlerPointerMove,{capture:!0}),s.forEach(t=>{i.addEventListener(t,this._onHandlerPointerUp)})},this._pointerMove=t=>{let{brushSelect:e}=this.attribute,{position:i}=this._getLayoutAttrFromConfig(),s=this._eventPosToStagePos(t),{attPos:r,size:a,attSize:n}
30=this._layoutCache,l=(s[r]-this._activeCache.lastPos[r])/a,o=(s[r]-i[r])/this._getLayoutAttrFromConfig()[n],{start:h,end:u}=this._getState(),d=!0;this._activeState&&(this._activeTag===t5.middleHandler?{start:h,end:u}=this._moveZoomWithMiddle(l):this._activeTag===t5.startHandler?{start:h,end:u}=this._moveZoomWithHandler(o,"start"):this._activeTag===t5.endHandler?{start:h,end:u}=this._moveZoomWithHandler(o,"end"):this._activeTag===t5.background&&e&&({start:h,end:u}=this._moveZoomWithBackground(o),d=!1,this._dispatchEvent(t4.maskUpdate)),this._activeCache.lastPos=s),this._getState().start===h&&this._getState().end===u||(this._setStateAttr(h,u),this._dispatchEvent(t4.stateUpdate,{start:this._getState().start,end:this._getState().end,shouldRender:d,tag:this._activeTag}),this.attribute.realTime&&this._dispatchEvent(t4.dataZoomUpdate,{start:this._getState().start,end:this._getState().end,shouldRender:!0,tag:this._activeTag}))},this._onHandlerPointerUp=t=>{this._activeState&&this._activeTag===t5.background&&(this._setStateAttr(this._getState().start,this._getState().end),this._dispatchEvent(t4.stateUpdate,{start:this._getState().start,end:this._getState().end,shouldRender:!0,tag:this._activeTag})),this._activeState=!1,this._dispatchEvent(t4.dataZoomUpdate,{start:this._getState().start,end:this._getState().end,shouldRender:!0,tag:this._activeTag}),this.clearDragEvents()},this._initAttrs(t)}setAttributes(t){var e,i,s,r,a,n;this._initAttrs(t),this._onHandlerPointerMove=0===(null!=(i=null==(e=this.attribute)?void 0:e.delayTime)?i:0)?this._pointerMove:Ll[null!=(r=null==(s=this.attribute)?void 0:s.delayType)?r:"debounce"](this._pointerMove,null!=(n=null==(a=this.attribute)?void 0:a.delayTime)?n:0)}_initAttrs(t){this.stage=t.stage,this.attribute=t.attribute,this._startHandlerMask=t.startHandlerMask,this._endHandlerMask=t.endHandlerMask,this._middleHandlerSymbol=t.middleHandlerSymbol,this._middleHandlerRect=t.middleHandlerRect,this._selectedBackground=t.selectedBackground,this._background=t.background,this._previewGroup=t.previewGroup,this._selectedPreviewGroup=t.selectedPreviewGroup,this._getLayoutAttrFromConfig=t.getLayoutAttrFromConfig,this._getState=t.getState,this._setState=t.setState;let{width:e,height:i}=this._getLayoutAttrFromConfig();this._spanCache=this._getState().end-this._getState().start;let s="top"===this.attribute.orient||"bottom"===this.attribute.orient;
30this._layoutCache.size=s?e:i,this._layoutCache.attPos=s?"x":"y",this._layoutCache.attSize=s?"width":"height",this._getGlobalTransMatrix=t.getGlobalTransMatrix}clearDragEvents(){let t="browser"===hL.env?hL:this.stage,e=Rw();t.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),e.forEach(e=>{t.removeEventListener(e,this._onHandlerPointerUp)}),this.off("pointermove",this._onHandlerPointerMove,{capture:!0})}clearVGlobalEvents(){("browser"===hL.env?hL:this.stage).removeEventListener("touchmove",this._handleTouchMove,{passive:!1})}bindEvents(){var t,e,i,s,r,a,n,l;let{brushSelect:o}=this.attribute;null==(t=this._startHandlerMask)||t.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"start")),null==(e=this._endHandlerMask)||e.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"end")),null==(i=this._middleHandlerSymbol)||i.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"middleSymbol")),null==(s=this._middleHandlerRect)||s.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"middleRect"));let h=o?"background":"middleRect";null==(r=this._selectedBackground)||r.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,h)),o&&(null==(a=this._background)||a.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"background"))),o&&(null==(n=this._previewGroup)||n.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,"background"))),null==(l=this._selectedPreviewGroup)||l.addEventListener("pointerdown",t=>this._onHandlerPointerDown(t,h)),("browser"===hL.env?hL:this.stage).addEventListener("touchmove",this._handleTouchMove,{passive:!1})}_setStateAttr(t,e){let{zoomLock:i=!1,minSpan:s=0,maxSpan:r=1}=this.attribute,a=e-t;a!==this._spanCache&&(i||a<s||a>r)||(this._spanCache=a,this._setState({start:t,end:e}))}_moveZoomWithMiddle(t){let{start:e,end:i}=this._getState();return t>0&&i+t>
301?t=1-i:t<0&&e+t<0&&(t=-e),{start:h4(e+t,0,1),end:h4(i+t,0,1)}}_moveZoomWithHandler(t,e){let{start:i,end:s}=this._getState(),r=i,a=s;return"start"===e?t>s?(r=s,a=t,this._activeTag=t5.endHandler):r=t:"end"===e&&(t<i?(a=i,r=t,this._activeTag=t5.startHandler):a=t),{start:h4(r,0,1),end:h4(a,0,1)}}_moveZoomWithBackground(t){let{position:e}=this._getLayoutAttrFromConfig(),{attSize:i}=this._layoutCache,s=h4((this._activeCache.startPos[this._layoutCache.attPos]-e[this._layoutCache.attPos])/this._getLayoutAttrFromConfig()[i],0,1),r=h4(t,0,1);return s>r&&([s,r]=[r,s]),{start:s,end:r}}_eventPosToStagePos(t){var e,i;let s={x:0,y:0},r=null!=(i=null==(e=this.stage)?void 0:e.eventPointTransform(t))?i:{x:0,y:0};return this._getGlobalTransMatrix().transformPoint(r,s),s}_dispatchEvent(t,e){this.emit(t,e)}}kg(),fh(),gq(),M9(),bZ();class Lh extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Lh.defaultAttributes,t)),this.name="dataZoom",this._state={start:0,end:1},this.getLayoutAttrFromConfig=()=>{var t,e,i,s,r,a;let n,l,o;
30if(this._layoutCacheFromConfig)return this._layoutCacheFromConfig;let{position:h,size:u,orient:d,middleHandlerStyle:c={},startHandlerStyle:p={},endHandlerStyle:g={},backgroundStyle:f={}}=this.attribute,{width:m,height:_}=u,y=null!=(e=null==(t=c.background)?void 0:t.size)?e:10;c.visible?this._isHorizontal?(n=m,l=_-y,o={x:h.x,y:h.y+y}):(n=m-y,l=_,o={x:h.x+("left"===d?y:0),y:h.y}):(n=m,l=_,o=h);let v=null!=(i=p.size)?i:this._isHorizontal?l:n,b=null!=(s=g.size)?s:this._isHorizontal?l:n;return p.visible&&(this._isHorizontal?(n-=(v+b)/2,o={x:o.x+v/2,y:o.y}):(l-=(v+b)/2,o={x:o.x,y:o.y+v/2})),l+=(null!=(r=f.lineWidth)?r:2)/2,n+=(null!=(a=f.lineWidth)?a:2)/2,this._layoutCacheFromConfig={position:o,width:n,height:l},this._layoutCacheFromConfig};const{start:i,end:s,orient:r}=this.attribute;this._isHorizontal="top"===r||"bottom"===r,i&&(this._state.start=i),s&&(this._state.end=s),this._renderer=new Ln(this._getRendererAttrs()),this._interaction=new Lo(this._getInteractionAttrs())}_getRendererAttrs(){return{attribute:this.attribute,getLayoutAttrFromConfig:this.getLayoutAttrFromConfig,setState:t=>{this._state=t},getState:()=>this._state,getContainer:()=>this._container}}_getInteractionAttrs(){return{stage:this.stage,attribute:this.attribute,startHandlerMask:this._renderer.startHandlerMask,endHandlerMask:this._renderer.endHandlerMask,middleHandlerSymbol:this._renderer.middleHandlerSymbol,middleHandlerRect:this._renderer.middleHandlerRect,selectedBackground:this._renderer.selectedBackground,background:this._renderer.background,previewGroup:this._renderer.previewGroup,selectedPreviewGroup:this._renderer.selectedPreviewGroup,getLayoutAttrFromConfig:this.getLayoutAttrFromConfig,setState:t=>{this._state=t},getState:()=>this._state,getGlobalTransMatrix:()=>this.globalTransMatrix}}bindEvents(){this.attribute.disableTriggerEvent?this.setAttribute("childrenPickable",!1):(this._interaction.bindEvents(),this._interaction.on(t4.stateUpdate,({shouldRender:t})=>{t&&this._renderer.renderDataZoom(!0)}),this._interaction.on(t4.dataZoomUpdate,({start:t,end:e,tag:i})=>{this._dispatchEvent(t8.dataZoomChange,{start:t,end:e,tag:i})}),this._interaction.on(t4.maskUpdate,()=>{this._renderer.renderDragMask()}),"auto"===this.attribute.showDetail&&(this._container.addEventListener("pointerenter",()=>{this._renderer.showText=!0,this._renderer.renderText()}),this._container.addEventListener("pointerleave",()=>{this._renderer.showText=!1,this._renderer.renderText()})))}setAttributes(t,e){var i,s;let{start:r,end:a}=this.attribute;r&&(this._state.start=null!=(i=t.start)?i:r),a&&(this._state.end=null!=(s=t.end)?s:a),this._renderer.setAttributes(this._getRendererAttrs()),this._interaction.setAttributes(this._getInteractionAttrs()),super.setAttributes(t,e)}
30render(){this._layoutCacheFromConfig=null,this._container=this.createOrUpdateChild("datazoom-container",{},"group"),this._renderer.renderDataZoom(),this._interaction.setAttributes(this._getInteractionAttrs())}release(t){super.release(t),this._interaction.clearDragEvents()}setStartAndEnd(t,e){let{start:i,end:s}=this._state;(0,eA.A)(t)&&(0,eA.A)(e)&&(t!==i||e!==s)&&(this._state={start:t,end:e},this._renderer.renderDataZoom(!0),this._dispatchEvent(t8.dataZoomChange,{start:t,end:e}))}setPreviewData(t){this._renderer.previewData=t}setText(t,e){"start"===e?this._renderer.startText.setAttribute("text",t):this._renderer.endText.setAttribute("text",t)}getStartValue(){return this._renderer.startValue}getEndTextValue(){return this._renderer.endValue}getMiddleHandlerSize(){var t,e,i,s;let{middleHandlerStyle:r={}}=this.attribute;return Math.max(null!=(e=null==(t=r.background)?void 0:t.size)?e:10,...oS(null!=(s=null==(i=r.icon)?void 0:i.size)?s:10))}setPreviewPointsX(t){(0,r3.A)(t)&&(this._renderer.previewPointsX=t)}setPreviewPointsY(t){(0,r3.A)(t)&&(this._renderer.previewPointsY=t)}setPreviewPointsX1(t){(0,r3.A)(t)&&(this._renderer.previewPointsX1=t)}setPreviewPointsY1(t){(0,r3.A)(t)&&(this._renderer.previewPointsY1=t)}setStatePointToData(t){(0,r3.A)(t)&&(this._renderer.statePointToData=t)}}Lh.defaultAttributes={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:Li,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:Li,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}};class Lu extends SR{_mergeThemeToSpec(t,e){let i=this._theme,s=t;if(this._shouldMergeThemeToSpec()){let e=t=>{let e=uy({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:r}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),r&&!1!==r.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e};s=(0,ev.A)(t)?t.map(t=>e(t)):e(t)}return this._adjustPadding(s),{spec:s,theme:i}}}let Ld=()=>({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}}),Lc=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),Lp={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}}
30,selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:Lc(!1),startHandler:Ld(),endHandler:Ld(),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:Lc(!0)};class Lg extends Le{constructor(t,e){var i;super(t,e),this.type=hc.dataZoom,this.name=hc.dataZoom,this.transformerConstructor=Lu,this.specKey="dataZoom",this.layoutZIndex=j.DataZoom,this.layoutLevel=V.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{let e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,r=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[r])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{let e=this._isHorizontal?0:this._middleHandlerSize,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,r=s.domain()[0];return s.scale(r)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{let e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),r=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[r])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{let e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._getPreviewStateScale(),r=s.domain()[0];return s.scale(r)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!=(i=t.filterMode)?i:"filter"}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange)if(i&&this._component)this._component.setStartAndEnd(t,e);else{let i=this._relatedAxisComponent,r=I5(t,this._stateScale,I8(i,this._isHorizontal)),a=I5(e,this._stateScale,I8(i,this._isHorizontal));if(!(0,eA.A)(r)||!(0,eA.A)(a))return;this._start=t,this._end=e,((0,r3.A)(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,r,a):this._handleStateChange(r,a,s))&&this.event.emit(dj.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._data.getDataView().reRunAllTransform(),this._initAfterLayout();let t=this._computeDomainOfValueScale();t&&(this._valueScale||(this._valueScale=new mb),this._valueScale.domain(t),this._updateValueScaleRange(),this._component&&this._createOrUpdateComponent(!0))}created(){super.created(),this._initValueScale()}updateLayoutAttribute(){!1!==this._cacheVisibility&&super.updateLayoutAttribute()}_beforeLayoutEnd(){super._beforeLayoutEnd();let t=this._relatedAxisComponent;(I8(t,this._isHorizontal)&&!this._isReverseCache||this._auto)&&(this._isReverseCache=I8(t,this._isHorizontal),this.effect.onZoomChange())}clear(){if(this._component){let t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}getBoundsInRect(t){var e,i,s,r;let a={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},n=this._startHandlerSize*(null!=(e=this._spec.startHandler.style.scaleX)?e:1),l=this._startHandlerSize*(null!=(i=this._spec.startHandler.style.scaleY)?i:1),o=this._endHandlerSize*(null!=(s=this._spec.endHandler.style.scaleX)?s:1),h=this._endHandlerSize*(null!=(r=this._spec.endHandler.style.scaleY)?r:1),u=this._visible?this._isHorizontal?(n-this._startHandlerSize)/2+(o-this._endHandlerSize)/2:(Math.max(n,o)-this._width)/2:0,d=this._visible?this._isHorizontal?(Math.max(l,h)-this._height)/2:(l-this._startHandlerSize)/2+(h-this._endHandlerSize)/2:0;return this._isHorizontal?(a.y2=a.y1+this._height+d,a.x2=a.x1+t.width+u):(a.x2=a.x1+this._width+u,a.y2=a.y1+t.height+d),a}setAttrFromSpec(){var t,e,i,s,r,a,n,l,o,h;super.setAttrFromSpec();let u=this._isHorizontal?Number(this._spec.height):Number(this._spec.width);this._backgroundSize=null!=(e=null==(t=this._spec.background)?void 0:t.size)?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),(0,eE.A)(null==(r=null==(s=null==(i=this._spec)?void 0:i.startHandler)?void 0:s.style)?void 0:r.size)&&(this._spec.startHandler.style.size=isNaN(u)?this._backgroundSize:u-this._middleHandlerSize),(0,eE.A)(null==(l=null==(n=null==(a=this._spec)?void 0:a.endHandler)?void 0:n.style)?void 0:l.size)&&(this._spec.endHandler.style.size=isNaN(u)?this._backgroundSize:u-this._middleHandlerSize);let d=null==(o=this._spec.startHandler.style.visible)||o,c=null==(h=this._spec.endHandler.style.visible)||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0,this._width=this._computeWidth(),this._height=this._computeHeight()}_initValueScale(){let t=this._computeDomainOfValueScale();if(t){let e=new mb;e.domain(t),this._valueScale=e}}
30_updateScaleRange(){this._updateStateScaleRange(),this._updateValueScaleRange()}_updateStateScaleRange(){var t,e,i;let s,r=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale)return;let a=this._isHorizontal?this.getLayoutRect().width-r:this.getLayoutRect().height-r,n=null!=(e=null==(t=this._relatedAxisComponent)?void 0:t.getScale().range())?e:[this._startHandlerSize/2,a+this._startHandlerSize/2],l=this._computeWidth(),o=this._computeHeight();s=this._isHorizontal?this._visible?[this._startHandlerSize/2,l-r+this._startHandlerSize/2]:n:this._visible?[this._startHandlerSize/2,o-r+this._startHandlerSize/2]:n,this._stateScale.range(s),null==(i=this._previewStateScale)||i.range(I8(this._relatedAxisComponent,this._isHorizontal)?s.reverse():s)}_updateValueScaleRange(){if(!this._valueScale)return;let t=this._computeWidth(),e=this._computeHeight();this._isHorizontal?this._valueScale.range([e-this._middleHandlerSize,0]):"left"===this.layoutOrient?this._valueScale.range([t-this._middleHandlerSize,0]):this._valueScale.range([0,t-this._middleHandlerSize])}_computeDomainOfValueScale(){let t=this._data.getLatestData().map(t=>t[this._valueField]),e=t.map(t=>+t);return t.length?[oM(e),ok(e)]:null}_isScaleValid(t){if(!t||!t.domain())return!1;let e=t.domain();return(!fI(t.type)||e[0]!==oA(e))&&(!fL(t.type)||1!==(e&&(0,ev.A)(e)?Array.from(new Set(oS(e))):e).length)}_getXScale(){return this._relatedAxisComponent.getScale().type===this.stateScale.type&&this._isHorizontal?this.stateScale:this._isHorizontal?this._stateScale:this._valueScale}_getYScale(){return this._isHorizontal?this._valueScale:this._stateScale}_computeMiddleHandlerSize(){var t,e,i,s;let r=0;return(null==(e=null==(t=this._spec)?void 0:t.middleHandler)?void 0:e.visible)&&(r+=Math.max(null!=(i=this._spec.middleHandler.icon.style.size)?i:8,null!=(s=this._spec.middleHandler.background.size)?s:40)),r}_computeWidth(){return!1===this._visible?0:ed(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:ed(this._spec.height)?this._spec.height:this._isHorizontal?Math.max(this._startHandlerSize||0,this._endHandlerSize||0,this._backgroundSize||0)+this._middleHandlerSize:this.getLayoutRect().height}_getAttrs(t){var e,i,s,r,a;let n=null!=(e=this._spec)?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._computeWidth(),height:this._computeHeight()},showDetail:n.showDetail,brushSelect:null!=(i=n.brushSelect)&&i,zoomLock:null!=(s=n.zoomLock)&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:n.delayType,delayTime:(0,eA.A)(n.delayType)?null!=(r=n.delayTime)?r:30:0,realTime:null==(a=n.realTime)||a,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance,isReverse:I8(this._relatedAxisComponent,this._isHorizontal)},this._getComponentAttrs(t))}_getLayoutAttrs(){return{position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},size:{width:this._computeWidth(),height:this._computeHeight()}}}_createOrUpdateComponent(t){if(this._visible){let e=!1!==this._spec.showBackgroundChart,i=this._getAttrs(e),s=this._relatedAxisComponent;if(this._component)this._component.setAttributes(i),t&&(this._component.setPreviewData(this._data.getDataView().latestData),e&&(this._isHorizontal?this._component.setPreviewPointsY1(this._dataToPositionY2):this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData(t=>I5(t,this._stateScale,I8(s,this._isHorizontal)))));else{let t=this.getContainer();this._component=new Lh(i),this._component.setPreviewData(this._data.getDataView().latestData),this._isHorizontal?e&&this._component.setPreviewPointsY1(this._dataToPositionY2):e&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData(t=>I5(t,this._stateScale,I8(s,this._isHorizontal))),this._component.addEventListener("dataZoomChange",t=>{let{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)}),t.add(this._component)}}}_getComponentAttrs(t){var e,i,s,r,a,n,l,o,h,u,d;let{middleHandler:c={},startText:p={},endText:g={},backgroundChart:f={}
30,selectedBackgroundChart:m={}}=this._spec;return{backgroundStyle:SS(null==(e=this._spec.background)?void 0:e.style),startHandlerStyle:SS(null==(i=this._spec.startHandler)?void 0:i.style),middleHandlerStyle:c.visible?{visible:!0,icon:SS(null==(s=c.icon)?void 0:s.style),background:{size:null==(r=c.background)?void 0:r.size,style:SS(null==(a=c.background)?void 0:a.style)}}:{visible:!1},endHandlerStyle:SS(null==(n=this._spec.endHandler)?void 0:n.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:SS(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:SS(g.style)},selectedBackgroundStyle:SS(this._spec.selectedBackground.style),dragMaskStyle:SS(null==(l=this._spec.dragMask)?void 0:l.style),backgroundChartStyle:t?{line:uy(SS(null==(o=f.line)?void 0:o.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},SS(null==(h=f.area)?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:uy(SS(null==(u=m.line)?void 0:u.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},SS(null==(d=m.area)?void 0:d.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){let{formatMethod:e,formatter:i}=t,{formatFunc:s}=v1(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}onDataUpdate(){super.onDataUpdate(),this._previewStateScale!==this._stateScale&&(this._previewStateScale=null)}_getPreviewStateScale(){return this._previewStateScale||(I8(this._relatedAxisComponent,this._isHorizontal)?(this._previewStateScale=this._stateScale.clone(),this._previewStateScale.range(this._stateScale.range().reverse())):this._previewStateScale=this._stateScale),this._previewStateScale}}Lg.type=hc.dataZoom,Lg.transformerConstructor=Lu,Lg.builtInTheme={dataZoom:Lp},Lg.specKey="dataZoom";class Lf extends Le{constructor(t,e){var i;super(t,e),this.type=hc.scrollBar,this.name=hc.scrollBar,this.specKey="scrollBar",this.layoutZIndex=j.DataZoom,this.layoutLevel=V.DataZoom,this.layoutType="region-relative",this._filterMode=null!=(i=t.filterMode)?i:"axis"}_handleChange(t,e,i){super._handleChange(t,e,i);let s=rL(this._start,t)&&rL(this._end,e);if(this._shouldChange&&(!s||!1===this._spec.realTime)){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;let s=I8(this._relatedAxisComponent,this._isHorizontal),r=I5(t,this._stateScale,s),a=I5(e,this._stateScale,s);((0,r3.A)(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,r,a):this._handleStateChange(r,a))&&this.event.emit(dj.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){this._spec.auto&&this._data.getDataView().reRunAllTransform()}_beforeLayoutEnd(){var t,e;super._beforeLayoutEnd(),null==(e=(t=this.effect).onZoomChange)||e.call(t)}onLayoutEnd(){this._updateComponentBounds(),super.onLayoutEnd()}_updateScaleRange(){}_updateComponentBounds(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return!1===this._visible?0:ed(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return!1===this._visible?0:ed(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,r,a,n;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.delayType,delayTime:(0,eA.A)(null==(e=this._spec)?void 0:e.delayType)?null!=(s=null==(i=this._spec)?void 0:i.delayTime)?s:30:0,realTime:null==(a=null==(r=this._spec)?void 0:r.realTime)||a,minSli
30derSize:null==(n=this._spec)?void 0:n.minSliderSize},this._getComponentAttrs())}_createOrUpdateComponent(){let t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{let e=this.getContainer();this._component=new RC(t),this._component.addEventListener("scrollDrag",t=>{let e=t.detail.value;this._handleChange(e[0],e[1])}),this._component.addEventListener("scrollUp",t=>{let e=t.detail.value;this._handleChange(e[0],e[1])}),e.add(this._component)}}_getComponentAttrs(){let{rail:t,slider:e,innerPadding:i}=this._spec,s={};return(0,eE.A)(i)||(s.padding=i),pJ(null==t?void 0:t.style)||(s.railStyle=SS(t.style)),pJ(null==e?void 0:e.style)||(s.sliderStyle=SS(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}Lf.type=hc.scrollBar,Lf.builtInTheme={scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},Lf.specKey="scrollBar";let Lm=(t,e)=>{let{datum:i,title:s,content:r}=e,a=[],n=i.call(null);return s.visible&&a.push({type:"title",index:0,datum:n,spec:s}),oS(r).forEach((t,e)=>{t.visible&&a.push({type:"content",index:e,datum:n,spec:t})}),a},L_={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"}}};p1(),gD(),xL();class Ly extends xN{constructor(){super(...arguments),this.name="indicator"}_renderText(t,e,i,s,r,a){if(!1!==e.visible){let n=eB({},uQ(L_,r),e.style,{visible:e.visible});n.lineHeight=(0,eA.A)(n.lineHeight)?n.lineHeight:n.fontSize,e.formatMethod&&(n._originText=n.text,n.text=e.formatMethod(n.text,n));let l=_F(n);return l.name=a,t.appendChild(l),e.autoFit&&eP(i)&&this._setLocalAutoFit(i,l,e),e.autoLim
30it&&eP(s)&&l.setAttribute("maxLineWidth",i),l}}render(){var t,e;if(this.removeAllChild(!0),!0!==this.attribute.visible)return;let{title:i={},content:s,size:r,limitRatio:a=1/0}=this.attribute,n=Math.min(r.width,r.height)*a,l=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1,pickable:null==(t=this.attribute.pickable)||t},"group");if((0,eA.A)(i)&&(this._title=this._renderText(l,i,n,a,"title.style","indicator-title")),(0,eA.A)(s)){let t=oS(s),e=[];t.forEach((t,i)=>{!1!==t.visible&&e.push(this._renderText(l,t,n,a,"content.style","indicator-content-"+i))}),this._content=e}this._setGlobalAutoFit(n),this._setYPosition();let o=null!=(e=null==l?void 0:l.AABBBounds.height())?e:0;l.setAttribute("y",r.height/2-o/2),l.setAttribute("x",r.width/2)}_setLocalAutoFit(t,e,i){var s,r,a,n,l,o,h,u,d;if("default"!==(null!=(s=i.fitStrategy)?s:"default"))return;let c=_I(null!=(a=null==(r=i.style)?void 0:r.text)?a:"",null!=(n=i.style)?n:{},null==(o=null==(l=this.stage)?void 0:l.getTheme())?void 0:o.text).width;if(c>0){let s=t*(null!=(h=i.fitPercent)?h:.5)/c,r=Math.floor((null!=(d=null==(u=i.style)?void 0:u.fontSize)?d:20)*s);e.setAttribute("fontSize",r),e.setAttribute("lineHeight",(0,eA.A)(i.style.lineHeight)?i.style.lineHeight:r)}}_setGlobalAutoFit(t){var e,i,s,r,a,n,l;let o=[],h=0,u=null!=(e=this.attribute.title)?e:{};u.autoFit&&"inscribed"===u.fitStrategy?(this._title.setAttribute("fontSize",12),o.push({text:this._title,spec:null!=(i=this.attribute.title)?i:{}})):h+=null!=(n=null==(a=null==(r=null==(s=this._title)?void 0:s.AABBBounds)?void 0:r.height)?void 0:a.call(r))?n:0;let d=null!=(l=u.space)?l:0;if(h+=d,oS(this.attribute.content).filter(t=>!1!==t.visible).forEach((t,e)=>{var i,s,r,a;let n=this._content[e];t.autoFit&&"inscribed"===t.fitStrategy?(n.setAttribute("fontSize",12),o.push({text:n,spec:t})):h+=null!=(r=null==(s=null==(i=null==n?void 0:n.AABBBounds)?void 0:i.height)?void 0:s.call(i))?r:0;let l=null!=(a=t.space)?a:0;h+=l}),o.length<=0)return;let c=12/o.reduce((t,e)=>Math.max(t,e.text.AABBBounds.width()),0)*o.length,p=h/2,g=c**2+1,f=2*p*c,m=2*(c*((-f+Math.sqrt(f**2-4*g*(p**2-(t/2)**2)))/(2*g))+p),_=(m-h)/o.length;eP(m)&&o.forEach(t=>{var e;let i=null==(e=t.spec.style)?void 0:e.lineHeight;t.text.setAttribute("fontSize",_),t.text.setAttribute("lineHeight",(0,eA.A)(i)?i:_)})}_setYPosition(){var t,e,i,s,r,a;let n=0,l=null!=(s=null==(i=null==(e=null==(t=this._title)?void 0:t.AABBBounds)?void 0:e.height)?void 0:i.call(e))?s:0,o=null!=(a=null==(r=this.attribute.title)?void 0:r.space)?a:0;oS(this.attribute.content).filter(t=>!1!==t.visible).forEach((t,e)=>{var i;let s=this._content[e];s.setAttribute("y",l+o+n);let r=null!=(i=t.space)?i:0;n+=s.AABBBounds.height()+r})}}let Lv=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),Lb={title:{visible:!0,autoLimit:!1,autoFit:!1,style:Lv("l1FontSize","primaryFontColor")},content:{visible:!0,style:Lv("l2FontSize","tertiaryFontColor")}};var Lx=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class LS extends SL{constructor(){super(...arguments),this.type=hc.indicator,this.name=hc.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=j.Indicator,this.layoutLevel=V.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return v2(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=oS(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(oS(this._spec.regionId),oS(this._spec.regionIndex))}initEvent(){this._option.disableTriggerEvent||"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",t=>{let e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(u3(e))}),this.event.on("element-highlight:reset",t=>{this._activeDatum&&this.updateDatum(null)})):(this.event.on("element-select:start",t=>{let e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(u3(e))}),this.event.on("element-select:reset",t=>{this._activeDatum&&this.updateDatum(null)})))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();let e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){c3(this._option.dataSet,"indicatorFilter",Lm);let t=new eR(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 mz(this._option,t)}updateLayoutAttribute(){let t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};let t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:r}=t.getLayoutStartPoint(),a=this._spec,{content:n,offsetX:l,offsetY:o,limitRatio:h,title:u}=a,d=Lx(a,["content","offsetX","offsetY","limitRatio","title"]),c=[];
30return oS(n).forEach(t=>{let e=uy({},this._theme.content,t);c.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({},Sx((0,SD.A)(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:r,dx:l?hX(l,this._computeLayoutRadius()):0,dy:o?hX(o,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==u.visible&&(!(0,eA.A)(u.field)||null!==this._activeDatum),space:u.space||this._gap,autoLimit:u.autoLimit,autoFit:u.autoFit,fitPercent:u.fitPercent,fitStrategy:u.fitStrategy,style:Object.assign(Object.assign({},Sx((0,SD.A)(u.style,["text"]),this._activeDatum)),{text:this._createText(u.field,u.style.text)})},content:c},d)}_createOrUpdateIndicatorComponent(t){if(!1===t.visible)return this._indicatorComponent&&this._indicatorComponent.parent&&this._indicatorComponent.parent.removeChild(this._indicatorComponent),void(this._indicatorComponent=null);if(this._indicatorComponent)(0,ex.n)(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{let e=this.getContainer(),i=new Ly(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",(t,e)=>this._delegateEvent(this._indicatorComponent,t,e))}this._cacheAttrs=t}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":(0,r3.A)(e)?null!=(i=e(this._activeDatum,void 0))?i:"":null!=e?e:""}_computeLayoutRadius(){let{width:t,height:e}=this._regions[0].getLayoutRect();return Math.min(t/2,e/2)}isRelativeModel(t){return this._regions.some(e=>!!e.getSeriesInId(t.context.modelId))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}LS.type=hc.indicator,LS.builtInTheme={indicator:Lb},LS.specKey="indicator";let LA=["sum","average","min","max","variance","standardDeviation","median"];var Lk=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};function LM(t,e,i){if(!i)return!1;let s=t.map(t=>+t),r=oM(s),a=ok(s);return e<r||e>a}function Lw(t,e,i,s,r,a){var n,l;let{relativeSeries:o}=s;return ed(t.x)&&LM(e,t.x,i)&&(null==(l=null==o?void 0:(n=o.getXAxisHelper()).setExtendDomain)||l.call(n,"marker_xAxis_extend",t.x)),hW(t.x)?LE(t.x,r)+a.x:LP(o.getXAxisHelper(),[t.x])+a.x}function LT(t,e,i,s,r,a){var n,l;let{relativeSeries:o}=s;return ed(t.y)&&LM(e,t.y,i)&&(null==(l=null==(n=o.getYAxisHelper())?void 0:n.setExtendDomain)||l.call(n,"marker_yAxis_extend",t.y)),hW(t.y)?LE(t.y,r)+a.y:LP(o.getYAxisHelper(),[t.y])+a.y}function LC(t,e,i,s){var r,a;let{relativeSeries:n}=s;return ed(t.angle)&&LM(e,t.angle,i)&&(null==(a=null==(r=n.angleAxisHelper)?void 0:r.setExtendDomain)||a.call(r,"marker_angleAxis_extend",t.angle)),LP(n.angleAxisHelper,[t.angle])}function LB(t,e,i,s){var r,a;let{relativeSeries:n}=s;return ed(t.radius)&&LM(e,t.radius,i)&&(null==(a=null==(r=n.radiusAxisHelper)?void 0:r.setExtendDomain)||a.call(r,"marker_radiusAxis_extend",t.radius)),LP(n.radiusAxisHelper,[t.radius])}function LE(t,e){return Number(t.substring(0,t.length-1))*e/100}function LP(t,e){let i=t.getScale(0);return fI(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function LO(t){return LA.includes(t)}function LR(t,e,i,s,r,a=!1){let n=e.getRegion(),l=n.getLayoutStartPoint(),o=i.getRegion(),h=o.getLayoutStartPoint(),u=Math.abs(Math.min(l.x,h.x)-Math.max(l.x+n.getLayoutRect().width,h.x+o.getLayoutRect().width)),d=Math.abs(Math.min(l.y,h.y)-Math.max(l.y+n.getLayoutRect().height,h.y+o.getLayoutRect().height)),c={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},p=[],g=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,f=s.getXAxisHelper(),m=s.getYAxisHelper(),_=f.getScale(0).domain(),y=m.getScale(0).domain(),v=a&&!f.isContinuous&&!!f.getBandwidth,b=a&&!m.isContinuous&&!!m.getBandwidth,x={min:null,max:null},S={min:null,max:null};return g.forEach(t=>{let e,i,s=(0,eA.A)(t.x),a=(0,eA.A)(t.y);if(s&&a)e=Lw(t,_,r,c,u,l),i=LT(t,y,r,c,d,l),LI(e,v,x,p.length),LI(i,b,S,p.length),p.push([{x:e,y:i}]);else if(s){e=Lw(t,_,r,c,u,l),i=Math.max(l.y+n.getLayoutRect().height,h.y+o.getLayoutRect().height);let s=Math.min(l.y,h.y);LI(e,v,x,p.length),p.push([{x:e,y:i},{x:e,y:s}])}else if(a){e=Math.min(l.x,h.x),i=LT(t,y,r,c,d,l);let s=Math.max(l.x+n.getLayoutRect().width,h.x+o.getLayoutRect().width);LI(i,b,S,p.length),p.push([{x:e,y:i},{x:s,y:i}])}}
30),function(t,e,i,s,r){if(s.min||s.max){let i=e.getBandwidth(0)*(1+e.getScale(0).paddingInner());s.min&&t[s.min.index].forEach(t=>t.x-=i/2),s.max&&t[s.max.index].forEach(t=>t.x+=i/2)}if(r.min||r.max){let e=i.getBandwidth(0)*(1+i.getScale(0).paddingInner());r.min&&t[r.min.index].forEach(t=>t.y-=e/2),r.max&&t[r.max.index].forEach(t=>t.y+=e/2)}}(p,f,m,x,S),p}function LI(t,e,i,s){return e&&((null===i.min||i.min.value>t)&&(i.min={value:t,index:s}),(null===i.max||i.max.value<t)&&(i.max={value:t,index:s})),t}function LL(t,e,i,s,r){let a={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},n=[],l=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,o=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),u=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return l.forEach(t=>{let e=(0,eA.A)(t.angle),i=(0,eA.A)(t.radius);if(e&&i){let e=LC(t,o,r,a),i=LB(t,h,r,a);n.push([{angle:e,radius:i}])}else if(e){let e=LC(t,o,r,a);n.push([{angle:e,radius:-u},{angle:e,radius:u}])}else if(i){let e=LB(t,h,r,a);n.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}}),n}function LD(t,e,i,s){let r=[],a=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,n=(0,ev.A)(s);return a.forEach((t,a)=>{var l,o,h,u;let d=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,c=d.getRegion(),p=c.getLayoutStartPoint(),{width:g,height:f}=c.getLayoutRect(),m=0,_=0;if(s){let t=n?s[a]:s,e=t.x,i=t.y;e&&(m=hW(e)?Number(e.substring(0,e.length-1))*g/100:e),i&&(_=hW(i)?Number(i.substring(0,i.length-1))*f/100:i)}let y=d.getXAxisHelper().getScale(0).domain(),v=d.getYAxisHelper().getScale(0).domain(),b=
30oS(t.x),x=oS(t.y);1===b.length&&ed(b[0])&&LM(y,b[0],i)&&(null==(o=null==(l=d.getXAxisHelper())?void 0:l.setExtendDomain)||o.call(l,"marker_xAxis_extend",b[0])),1===x.length&&ed(x[0])&&LM(v,x[0],i)&&(null==(u=null==(h=d.getYAxisHelper())?void 0:h.setExtendDomain)||u.call(h,"marker_yAxis_extend",x[0])),r.push({x:LP(d.getXAxisHelper(),b)+p.x+m,y:LP(d.getYAxisHelper(),x)+p.y+_})}),r}function LF(t,e,i){let s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach(t=>{var r,a,n,l;let o=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,h=o.angleAxisHelper.getScale(0).domain(),u=o.radiusAxisHelper.getScale(0).domain(),d=oS(t.angle),c=oS(t.radius);1===d.length&&ed(d[0])&&LM(h,d[0],i)&&(null==(a=null==(r=o.angleAxisHelper)?void 0:r.setExtendDomain)||a.call(r,"marker_xAxis_extend",d[0])),1===c.length&&ed(c[0])&&LM(u,c[0],i)&&(null==(l=null==(n=o.radiusAxisHelper)?void 0:n.setExtendDomain)||l.call(n,"marker_yAxis_extend",c[0])),s.push({angle:LP(o.angleAxisHelper,d),radius:LP(o.radiusAxisHelper,c)})}),s}function Lz(t,e,i){let{x:s,y:r}=t;return hW(s)&&(s=LE(s,e)),hW(r)&&(r=LE(r,i)),{x:s,y:r}}function LH(t,e,i){let s;if(s=(0,r3.A)(t)?oS(t(e.getData().getLatestData(),e)):oS(t),i){let t=e.getRegion(),{x:i,y:r}=t.getLayoutStartPoint(),{width:a,height:n}=t.getLayoutRect();return s.map(t=>{let{x:e,y:s}=Lz(t,a,n);return{x:e+=i,y:s+=r}})}let{width:r,height:a}=e.getOption().getChart().getViewRect();return s.map(t=>Lz(t,r,a))}function Lj(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;return t.forEach(t=>{let a=t.getLayoutStartPoint(),n=t.getLayoutRect();a.x<e&&(e=a.x),a.x+n.width>i&&(i=a.x+n.width),a.y<s&&(s=a.y),a.y+n.height>r&&(r=a.y+n.height)}),{minX:e,maxX:i,minY:s,maxY:r}}function LV(t,e,i){let{labelBackground:s={},style:r,shape:a}=t,n=Lk(t,["labelBackground","style","shape"]);return!1!==t.visible?((null==a?void 0:a.visible)?n.shape=Object.assign({visible:!0},SS(a.style)):n.shape={visible:!1},!1!==s.visible?(n.panel=Object.assign({visible:!0,customShape:s.customShape},LW(SS(s.style),e,i)),(0,eA.A)(s.padding)&&(n.padding=AN(s.padding))):(n.panel={visible:!1},n.padding=0),r&&(n.textStyle=LW(SS(r),e,i)),n):{visible:!1}}function LN(t,e,i){for(let s in t)(0,r3.A)(t[s])&&(t[s]=t[s](e,i));return t}function LW(t,e,i){return(0,r3.A)(t)?t(e,i):t}function LU(t,e){return(0,r3.A)(t)?t(e):t}function LG(t,e,i){return(0,eA.A)(t)?"regionLeft"===e?i.getLayoutStartPoint().x-t.x:"regionRight"===e?i.getLayoutStartPoint().x+i.getLayoutRect().width-t.x:"regionTop"===e?i.getLayoutStartPoint().y-t.y:"regionBottom"===e?i.getLayoutStartPoint().y+i.getLayoutRect().height-t.y:e:e}function LY(t){return{isXProcess:(0,eA.A)(t.x),isYProcess:(0,eA.A)(t.y),isX1Process:(0,eA.A)(t.x1),isY1Process:(0,eA.A)(t.y1),isAngleProcess:(0,eA.A)(t.angle),isRadiusProcess:(0,eA.A)(t.radius),isAngle1Process:(0,eA.A)(t.angle1),isRadius1Process:(0,eA.A)(t.radius1),isCoordinatesProcess:(0,eA.A)(t.coordinates),isValidProcess:(0,eA.A)(t.process)}}function L$(t){let{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:r,isAngleProcess:a,isRadiusProcess:n,isAngle1Process:l,isRadius1Process:o,isCoordinatesProcess:h,isValidProcess:u}=LY(t);return{doXProcess:e&&!i&&!r,doXYY1Process:e&&i&&r,doYProcess:i&&!e&&!s,doYXX1Process:i&&e&&s,doXYProcess:e&&i&&s&&r,doAngleProcess:a&&!l&&!n&&!o,doRadiusProcess:n&&!o&&!a&&!l,doAngRadRad1Process:a&&!l&&n&&o,doRadAngAng1Process:n&&a&&l&&!o,doRadAngProcess:a&&n&&l&&o,doCoordinatesProcess:h&&(!u||"process"in t&&"xy"in t.process)}}function LX(t){let{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:r,isAngleProcess:a,isRadiusProcess:n,isAngle1Process:l,isRadius1Process:o,isCoordinatesProcess:h}=LY(t);return{doXProcess:e&&s&&!i&&!r,doYProcess:i&&r&&!e&&!s,doXYProcess:e&&s&&i&&r,doAngleProcess:a&&l&&!n&&!o,doRadiusProcess:n&&o&&!a&&!l,doRadAngProcess:a&&n&&l&&o,doCoordinatesProcess:h}}function LK(t){return{doXYProcess:(0,eA.A)(t.x)&&(0,eA.A)(t.y),doPolarProcess:(0,eA.A)(t.angle)&&(0,eA.A)(t.radius),doGeoProcess:(0,eA.A)(t.areaName)}}let Lq=new class extends g3{constructor(){super(...arguments),this.time=hx.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,r,a,n,l,o,h,u,d){return super.drawShape(t,e,i,s,r,a,n,l,o,h,u,d)}};var LZ=function(t,e){return function(i,s){e(i,s,t)}};let LJ=["","repeat-x","repeat-y","repeat"];function LQ({repeatX:t="no-repeat",repeatY:e="no-repeat",imageMode:i}){let s,r=(s=0,"repeat"===t&&(s|=1),"repeat"===e&&(s|=2),s?LJ[s]:"no-repeat");return{repeatMode:r,sizingMode:"no-repeat"===r&&null!=i?i:"fill"}}let L0={cover:"no-repeat-cover",contain:"no-repeat-contain",fill:"no-repeat-fill",auto:"no-repeat-auto"},L1=class extends oN{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=nS,this.builtinContributions=[Lq,ou],this.init(t)}drawShape(t,e,i,s,r,a,n,l){let o=rQ(t).image,{repeatX:h=o.repeatX,repeatY:u=o.repeatY,x:d=o.x,y:c=o.y,cornerRadius:p=o.cornerRadius,fillStrokeOrder:g=o.fillStrokeOrder,cornerType:f=o.cornerType,imageMode:m=o.imageMode,imageScale:_=o.imageScale,imageOffsetX:y=o.imageOffsetX,imageOffsetY:v=o.imageOffsetY,imagePosition:b=o.imagePosition,image:x}=t.attribute,S=this.valid(t,o,n);if(!S)return;let{fVisible:A,sVisible:k,doFill:M,doStroke:w}=S;if(!x||!t.resources)return;let T=t.resources.get(x);if("success"!==T.state)return;let C=t.width,B=t.height;e.beginPath();let E=!1;0===p||(0,ev.A)(p)&&p.every(t=>0===t)?e.rect(i,s,C,B):(oE(e,i,s,C,B,p,"bevel"!==f),E=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,o);let P=()=>{M&&(n?n(e,t.attribute,o):A&&(e.setCommonStyle(t,t.attribute,i,s,o),function(t,e,
30i,s,r,a,{repeatX:n="no-repeat",repeatY:l="no-repeat",imageMode:o,imageScale:h=1,imageOffsetX:u=0,imageOffsetY:d=0,imagePosition:c="top-left"}){let{repeatMode:p,sizingMode:g}=LQ({repeatX:n,repeatY:l,imageMode:o}),f="no-repeat"===p?{backgroundMode:L0[g],backgroundFit:!1,backgroundKeepAspectRatio:!1}:{backgroundMode:p,backgroundFit:!1,backgroundKeepAspectRatio:!1};om(t,e,{x1:i,y1:s,x2:i+r,y2:s+a,width:()=>r,height:()=>a},{backgroundMode:f.backgroundMode,backgroundFit:f.backgroundFit,backgroundKeepAspectRatio:f.backgroundKeepAspectRatio,backgroundScale:h,backgroundOffsetX:u,backgroundOffsetY:d,backgroundPosition:c})}(e,T.data,i,s,C,B,{repeatX:h,repeatY:u,imageMode:m,imageScale:_,imageOffsetX:y,imageOffsetY:v,imagePosition:b})))},O=()=>{w&&(l?l(e,t.attribute,o):k&&(e.setStrokeStyle(t,t.attribute,d-i,c-s,o),e.stroke()))},R=function({repeatX:t="no-repeat",repeatY:e="no-repeat",imageMode:i,imageScale:s=1,imageOffsetX:r=0,imageOffsetY:a=0,imagePosition:n="top-left"}){let{repeatMode:l,sizingMode:o}=LQ({repeatX:t,repeatY:e,imageMode:i});return"no-repeat"===l&&("cover"===o||"auto"===o||1!==s||0!==r||0!==a)}({repeatX:h,repeatY:u,imageMode:m,imageScale:_,imageOffsetX:y,imageOffsetY:v,imagePosition:b}),I=E||R;g?(O(),I&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,M,!1,A,!1,o,r,n),P(),I&&e.restore()):(I&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,M,!1,A,!1,o,r,n),P(),I&&e.restore(),O()),this.afterRenderStep(t,e,i,s,M,!1,A,!1,o,r,n)}draw(t,e,i){let{image:s}=t.attribute;if(!s||!t.resources)return;let r=t.resources.get(s);if("loading"===r.state&&(0,eS.A)(s))return void r6.improveImageLoading(s);if("success"!==r.state)return;let{context:a}=e.drawParams;if(!a)return;let n=rQ(t).image;this._draw(t,n,!1,i)}};L1=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),LZ(0,eU(eY)),LZ(0,eG(oe)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],L1);let L2=!1,L3=new eL(t=>{L2||(L2=!0,t(lm).to(L1).inSingletonScope(),t(ln).toService(lm),t(oe).toService(o_),eX(t,oe))}),L5=class extends gY{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=nS}};L5=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej(),(tW=eU(lm),function(t,e){tW(t,e,0)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],L5);let L4=!1,L8=new eL((t,e,i,s)=>{L4||(L4=!0,t(gy).to(L5).inSingletonScope(),t(gC).toService(gy))}),L6=!1,L9=new eL((t,e,i,s)=>{L6||(L6=!0,t(gl).to(xO).inSingletonScope(),t(xO).toService(gl))});function L7(){L7.__loaded||(L7.__loaded=!0,lF.RegisterGraphicCreator("image",xy),e7.load(L3),e7.load(gi?L8:L9))}function Dt(){p1(),kg(),yR()}function De(t,e){let{x1:i,y1:s,x2:r,y2:a}=e,{x1:n,y1:l,x2:o,y2:h}=t.AABBBounds,u=0,d=0;return n<i&&(u=i-n),l<s&&(d=s-l),o>r&&(u=r-o),h>a&&(d=a-h),{dx:u,dy:d}}function Di(t,e){let{dx:i,dy:s}=De(t,e),{dx:r=0,dy:a=0}=t.attribute;i&&t.setAttribute("dx",i+r),s&&t.setAttribute("dy",s+a)}L7.__loaded=!1;class Ds extends xN{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=k_(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=ky(t,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=kv(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){let s=r2(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:eB({},this.defaultUpdateAnimation,s,null!=(t=this.attribute.animationEnter)?t:{}),exit:eB({},this.defaultExitAnimation,s,null!=(e=this.attribute.animationExit)?e:{}),update:eB({},this.defaultUpdateAnimation,s,null!=(i=this.attribute.animationUpdate)?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;let{hover:s,select:r}=this.attribute;s&&(null==(t=this._container)||t.addEventListener("pointermove",this._onHover),null==(e=this._container)||e.addEventListener("pointerout",this._onUnHover)),r&&(null==(i=this._container)||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null==(t=this._container)||t.removeEventListener("pointermove",this._onHover),null==(e=this._container)||e.removeEventListener("pointerout",this._onUnHover),null==(i=this._container)||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;let i,{limitRect:s={},clipInRange:r}=this.attribute;if(r){let r=lF.group(Object.assign(Object.assign({}
30,s),{clip:!0,pickable:!1}));i=lF.group({x:-(null!=(t=s.x)?t:0),y:-(null!=(e=s.y)?e:0),pickable:!1}),r.add(i),this._containerClip=r,this.add(r)}else i=lF.group({x:0,y:0,pickable:!1}),this.add(i);i.name="marker-container",this._container=i}_updateContainer(){var t,e;let{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!=(t=i.x)?t:0):0,y:s?-(null!=(e=i.y)?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);let e=null==(t=this.attribute.visible)||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 Dr(t,e,i,s){var r,a,n,l,o;if(!t)return;null==(r=null==t?void 0:t.animates)||r.forEach(t=>t.stop("end"));let h=null!=(n=null==(a=t.attribute)?void 0:a.fillOpacity)?n:1,u=null!=(o=null==(l=t.attribute)?void 0:l.strokeOpacity)?o:1;t.setAttributes({fillOpacity:0,strokeOpacity:0}),t.animate().wait(e).to({fillOpacity:h,strokeOpacity:u},i,s)}function Da(t,e,i,s){t&&(Dr(t.startSymbol,e,i,s),t.lines.forEach(t=>Dr(t,e,i,s)),Dr(t.line,e,i,s),Dr(t.endSymbol,e,i,s))}function Dn(t,e,i,s){t&&(Dr(t.getTextShape(),e,i,s),Dr(t.getBgRect(),e,i,s))}function Dl(t,e,i,s){var r,a,n,l;t&&(t.setAttributes({fillOpacity:null!=(a=null==(r=t.attribute)?void 0:r.fillOpacity)?a:1,strokeOpacity:null!=(l=null==(n=t.attribute)?void 0:n.strokeOpacity)?l:1}),t.animate().wait(e).to({fillOpacity:0,strokeOpacity:0},i,s))}function Do(t,e,i,s){t&&(Dl(t.startSymbol,e,i,s),t.lines.forEach(t=>Dl(t,e,i,s)),Dl(t.line,e,i,s),Dl(t.endSymbol,e,i,s))}function Dh(t,e,i,s){t&&(Dl(t.getTextShape(),e,i,s),Dl(t.getBgRect(),e,i,s))}function Du(t,e,i,s,r){let a=.1*i,n=.7*i,l=.1*i,o=.1*i;Dr(t.startSymbol,s,a,r),t.lines.forEach(t=>t.setAttribute("clipRange",0)),t.lines.forEach((e,i)=>{let l=n/t.lines.length;e.animate().wait(s+a+i*l).to({clipRange:1},l,r)}),Dr(t.endSymbol,s+a+n,l,r),oS(e).forEach(t=>{let e=s+a+n+l;Dr(t.getTextShape(),e,o,r),Dr(t.getBgRect(),e,o,r)})}function Dd(t,e,i,s,r){Da(t,s,i,r),oS(e).forEach(t=>{Dn(t,s,i,r)})}function Dc(t,e,i,s,r){Dr(t,s,i,r),oS(e).forEach(t=>{Dn(t,s,i,r)})}function Dp(t,e,i,s,r){Dr(t,s,i,r),oS(e).forEach(t=>{Dn(t,s,i,r)})}function Dg(t,e,i,s,r,a){var n;Da(t,r,s,a),Dr(e,r,s,a),(null==(n=i.getTextShape)?void 0:n.call(i))?Dn(i,r,s,a):Dr(i,r,s,a)}function Df(t,e,i,s,r,a){var n;let l=.1*s,o=.65*s,h=.05*s,u=.1*s,d=.1*s;Dr(t.startSymbol,r,l,a),t.lines.forEach(t=>t.setAttribute("clipRange",0)),t.lines.forEach((e,i)=>{let s=o/t.lines.length;e.animate().wait(r+l+i*s).to({clipRange:1},s,a)}),Dr(e,r+l+o,h,a),Dr(t.endSymbol,r+l+o+h,u,a),(null==(n=i.getTextShape)?void 0:n.call(i))?(Dr(i.getTextShape(),r+l+o+h+u,d,a),Dr(i.getBgRect(),r+l+o+u,d,a)):Dr(i,r+l+o+u,d,a)}function Dm(t,e,i,s){let{enter:r,update:a,exit:n}=i;if("enter"===s){let{type:i,duration:s,delay:a,easing:n}=r;"clipIn"===i?Du(t,e,s,a,n):"fadeIn"===i&&Dd(t,e,s,a,n)}else if("update"===s){let{type:i,duration:s,delay:r,easing:n}=a;"clipIn"===i?Du(t,e,s,r,n):"fadeIn"===i&&Dd(t,e,s,r,n)}else if("exit"===s){let{duration:i,delay:s,easing:r}=n;Do(t,s,i,r),oS(e).forEach(t=>{Dh(t,s,i,r)})}}function D_(t,e,i,s){let{enter:r,update:a,exit:n}=i;if("enter"===s){let{type:i,duration:s,delay:a,easing:n}=r;"fadeIn"===i&&Dc(t,e,s,a,n)}else if("update"===s){let{type:i,duration:s,delay:r,easing:n}=a;"fadeIn"===i&&Dc(t,e,s,r,n)}else if("exit"===s){let{duration:i,delay:s,easing:r}=n;Dl(t,s,i,r),oS(e).forEach(t=>{Dh(t,s,i,r)})}}function Dy(t,e,i,s){let{enter:r,update:a,exit:n}=i;if("enter"===s){let{type:i,duration:s,delay:a,easing:n}=r;"fadeIn"===i&&Dp(t,e,s,a,n)}else if("update"===s){let{type:i,duration:s,delay:r,easing:n}=a;"fadeIn"===i&&Dp(t,e,s,r,n)}else if("exit"===s){let{duration:i,delay:s,easing:r}=n;Dl(t,s,i,r),oS(e).forEach(t=>
30{Dh(t,s,i,r)})}}function Dv(t,e,i,s){let[r,a]=t,{enter:n,update:l,exit:o}=i;if("enter"===s){let{type:t,duration:i,delay:s,easing:l}=n;"fadeIn"===t?Dg(r,a,e,i,s,l):"callIn"===t&&Df(r,a,e,i,s,l)}else if("update"===s){let{type:t,duration:i,delay:s,easing:n}=l;"fadeIn"===t?Dg(r,a,e,i,s,n):"callIn"===t&&Df(r,a,e,i,s,n)}else if("exit"===s){var h;let{duration:t,delay:i,easing:s}=o;Do(r,i,t,s),Dl(a,i,t,s),(null==(h=e.getTextShape)?void 0:h.call(e))?Dh(e,i,t,s):Dl(e,i,t,s)}}let Db={type:"clipIn",duration:500,easing:"linear",delay:0},Dx={type:"fadeIn",duration:500,easing:"linear",delay:0},DS={type:"callIn",duration:500,easing:"linear",delay:0},DA={type:"fadeOut",duration:500,easing:"linear",delay:0};class Dk{getLabel(){return this._label}_addMarkLabels(t,e,i){let{label:s,state:r}=this.attribute,a=oS(null==r?void 0:r.label),n=oS(null==r?void 0:r.labelBackground),l=oS(s).map((s,r)=>{var l,o;let h=eB({},i,s),u=new km(Object.assign(Object.assign({},h),{state:{panel:eB({},_E,null!=(l=n[r])?l:oA(n)),text:eB({},_E,null!=(o=a[r])?o:oA(a))}}));return u.name=e,t.add(u),this.setLabelPos(u,h),u});this._label=1===oS(l).length?l[0]:l}_updateMarkLabels(t){let{label:e,state:i}=this.attribute,s=oS(this._label),r=oS(null==i?void 0:i.label),a=oS(null==i?void 0:i.labelBackground);if(s.length){let i=oS(e);s.forEach((e,s)=>{var n,l;let o=eB({},t,i[s]);e.setAttributes(Object.assign(Object.assign({dx:0,dy:0},o),{state:{panel:eB({},_E,null!=(n=a[s])?n:oA(a)),text:eB({},_E,null!=(l=r[s])?l:oA(r))}})),this.setLabelPos(e,o)})}}}class DM extends Ds{constructor(){super(...arguments),this.name="markCommonLine",this.defaultUpdateAnimation=Db,this.defaultExitAnimation=DA}getLine(){return this._line}setLabelPos(t,e){let{limitRect:i}=this.attribute,{position:s,confine:r,autoRotate:a}=e,n=this.getPointAttrByPosition(s,e),l=s.toString().toLocaleLowerCase().includes("start")?this._line.getStartAngle()||0:this._line.getEndAngle()||0;if(t.setAttributes(Object.assign(Object.assign({},n.position),{angle:a?this.getRotateByAngle(n.angle,e):0,textStyle:Object.assign(Object.assign({},this.getTextStyle(s,l,a)),e.textStyle)})),i&&r){let{x:e,y:s,width:r,height:a}=i;Di(t,{x1:e,y1:s,x2:e+r,y2:s+a})}}initMarker(t){let e=this.createSegment();e.name="mark-common-line-line",this._line=e,t.add(e),this.addMarkLineLabels(t)}updateMarker(){this.setLineAttributes(),this.updateMarkLineLabels()}}yg(DM,Dk),(tU=t6||(t6={})).start="start",tU.startTop="startTop",tU.startBottom="startBottom",tU.insideStart="insideStart",tU.insideStartTop="insideStartTop",tU.insideStartBottom="insideStartBottom",tU.middle="middle",tU.insideMiddleTop="insideMiddleTop",tU.insideMiddleBottom="insideMiddleBottom",tU.end="end",tU.endTop="endTop",tU.endBottom="endBottom",tU.insideEnd="insideEnd",tU.insideEndTop="insideEndTop",tU.insideEndBottom="insideEndBottom",(tG=t9||(t9={})).left="left",tG.right="right",tG.top="top",tG.bottom="bottom",tG.topLeft="topLeft",tG.topRight="topRight",tG.bottomLeft="bottomLeft",tG.bottomRight="bottomRight",tG.middle="middle",tG.insideLeft="insideLeft",tG.insideRight="insideRight",tG.insideTop="insideTop",tG.insideBottom="insideBottom",tG.insideTopLeft="insideTopLeft",tG.insideTopRight="insideTopRight",tG.insideBottomLeft="insideBottomLeft",tG.insideBottomRight="insideBottomRight",(tY=t7||(t7={})).arcInnerStart="arcInnerStart",tY.arcInnerEnd="arcInnerEnd",tY.arcInnerMiddle="arcInnerMiddle",tY.arcOuterStart="arcOuterStart",tY.arcOuterEnd="arcOuterEnd",tY.arcOuterMiddle="arcOuterMiddle",tY.center="center",(t$=et||(et={})).top="top",t$.bottom="bottom",t$.middle="middle",t$.insideTop="insideTop",t$.insideBottom="insideBottom",t$.insideMiddle="insideMiddle";let Dw={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:t6.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]}},DT={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"}},DC={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"}},DB={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:{autoRotate:!0,position:t7.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]}},DE={interactive:!0,label:{position:t9.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}},DP={interactive:!0,label:{autoRotate:!0,position:t7.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}},DO={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"}},DR={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"},topLeft:{textAlign:"right",textBaseline:"top"},insideTopLeft:{textAlign:"left",textBaseline:"top"},topRight:{textAlign:"left",textBaseline:"top"},insideTopRight:{textAlign:"right",textBaseline:"top"},bottomLeft:{textAlign:"right",textBaseline:"bottom"},insideBottomLeft:{textAlign:"left",textBaseline:"bottom"},bottomRight:{textAlign:"left",textBaseline:"bottom"},insideBottomRight:{textAlign:"right",textBaseline:"bottom"}},DI={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"}},DL={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 DD(){DF._animate=Dm}Dt(),kd(),yR();class DF extends DM{markerAnimate(t){DF._animate&&this._animationConfig&&DF._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},DF.defaultAttributes,t)),this.name="markLine"}getPointAttrByPosition(t,e){var i;let{refX:s=0,refY:r=0}=e,a=this._line.getMainSegmentPoints(),n=null!=(i=this._line.getEndAngle())?i:0,l=(b8(n),n),o=s*Math.cos(l)+r*Math.cos(l-Math.PI/2),h=s*Math.sin(l)+r*Math.sin(l-Math.PI/2);return t.includes("start")||t.includes("Start")?{position:{x:a[0].x+o,y:a[0].y+h},angle:l}:t.includes("middle")||t.includes("Middle")?{position:{x:(a[0].x+a[a.length-1].x)/2+o,y:(a[0].y+a[a.length-1].y)/2+h},angle:l}:{position:{x:a[a.length-1].x+o,y:a[a.length-1].y+h},angle:l}}getRotateByAngle(t,e){var i;return(b8(t)?t:t-Math.PI)+(null!=(i=e.refAngle)?i:0)}getTextStyle(t,e,i){return b6(Math.abs(e),Math.PI/2,.001)||b6(Math.abs(e),3*Math.PI/2,.001)?b9(i,e,t):b8(e)?DT[t]:DC[t]}createSegment(){let{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:r,multiSegment:a,state:n}=this.attribute;return new kp({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:r,multiSegment:a,pickable:!1,state:{line:eB({},_E,null==n?void 0:n.line),startSymbol:eB({},_E,null==n?void 0:n.lineStartSymbol),endSymbol:eB({},_E,null==n?void 0:n.lineEndSymbol)}})}setLineAttributes(){let{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:r,multiSegment:a,state:n}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:r,multiSegment:a,state:{line:eB({},_E,null==n?void 0:n.line),startSymbol:eB({},_E,null==n?void 0:n.lineStartSymbol),endSymbol:eB({},_E,null==n?void 0:n.lineEndSymbol)}})}isValidPoints(){let{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach(t=>{if(t.length)t.forEach(t=>{eP(t.x)&&eP(t.y)||(e=!1)});else if(!eP(t.x)||!eP(t.y))return void(e=!1)}),e}addMarkLineLabels(t){this._addMarkLabels(t,"mark-common-line-label",DF.defaultAttributes.label)}updateMarkLineLabels(){this._updateMarkLabels(DF.defaultAttributes.label)}}DF.defaultAttributes=Dw;var Dz=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};function DH(t,e){let i;if(e.coordinates){let t,s,{coordinates:r,coordinateType:a,getSeriesByIdOrIndex:n}=e,l=Dz(e,["coordinates","coordinateType","getSeriesByIdOrIndex"]);if((0,r3.A)(r)){let i=e.getRelativeSeries();t=r(i.getData().getLatestData(),i)}else t=r;i=(t=oS(t)).map(t=>{let e=n(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===a){let{xField:i,yField:r}=e.getSpec(),{xFieldDim:a,xFieldIndex:n,yFieldDim:o,yFieldIndex:h}=t,u=i;(0,eA.A)(n)&&(u=oS(i)[n]),a&&oS(i).includes(a)&&(u=a);let d=r;(0,eA.A)(h)&&(d=oS(r)[h]),o&&oS(r).includes(o)&&(d=o),s=Object.assign({x:void 0,y:void 0}
30,l),(0,eS.A)(t[u])&&LO(t[u])?s.x={field:u,aggrType:t[u]}:s.x=oS(u).map(e=>t[e]),(0,eS.A)(t[d])&&LO(t[d])?s.y={field:d,aggrType:t[d]}:s.y=oS(d).map(e=>t[e])}else if("polar"===a){let{valueField:i,categoryField:r}=e.getSpec(),{angleFieldDim:a,angleFieldIndex:n}=t,o=r;(0,eA.A)(n)&&(o=oS(r)[n]),a&&oS(r).includes(a)&&(o=a),s=Object.assign({angle:void 0,radius:void 0},l),(0,eS.A)(t[o])&&LO(t[o])?s.angle={field:o,aggrType:t[o]}:s.angle=oS(o).map(e=>t[e]),(0,eS.A)(t[i])&&LO(t[i])?s.radius={field:i,aggrType:t[i]}:s.radius=oS(i).map(e=>t[e])}return s.getRefRelativeSeries=()=>e,s})}else i=e;let s=[];return i.forEach(e=>{let i={x:null,y:null,angle:null,radius:null,areaName:null};if((0,eA.A)(e.x)){let s=e.x;(0,ev.A)(s)?i.x=s.map(i=>DV(i,t,e)):i.x=DV(s,t,e)}if((0,eA.A)(e.y)){let s=e.y;(0,ev.A)(s)?i.y=s.map(i=>DV(i,t,e)):i.y=DV(s,t,e)}if((0,eA.A)(e.angle)){let s=e.angle;(0,ev.A)(s)?i.angle=s.map(i=>DV(i,t,e)):i.angle=DV(s,t,e)}if((0,eA.A)(e.radius)){let s=e.radius;(0,ev.A)(s)?i.radius=s.map(i=>DV(i,t,e)):i.radius=DV(s,t,e)}(0,eA.A)(e.areaName)&&(i.areaName=DV(e.areaName,t,e)),e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)}),s}let Dj={min:(t,e)=>vj(t[0].latestData,e.field),max:(t,e)=>vV(t[0].latestData,e.field),sum:function(t,e){return vN(t[0].latestData,e.field)},average:function(t,e){return vW(t[0].latestData,e.field)},variance:function(t,e){return vU(t[0].latestData,e.field)},standardDeviation:function(t,e){return Math.sqrt(vU(t[0].latestData,e.field))},median:function(t,e){var i,s,r,a;let n;return i=t[0].latestData,s=e.field,n=r=i.map(t=>t[s]),!0!==a&&(n=r.sort(fz)),vz(n,.5)}};function DV(t,e,i){let s=i.getRelativeSeries(),r=i.getStartRelativeSeries(),a=i.getEndRelativeSeries(),n=s.getData().getLatestData(),l=r.getData().getLatestData(),o=a.getData().getLatestData();if((0,r3.A)(t))return t(n,l,o,s,r,a);if((0,ew.A)(t)){let{aggrType:i,field:s}=t;return Dj[i](e,{field:s})}return t}function DN(t,e){if(e&&e.getRelativeSeries){let i=e.getRelativeSeries();if(i){let e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class DW extends SL{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 v2(t,this.specKey,this.type,t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType)}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkerAttributeContext(){this._markAttributeContext={relativeSeries:this._relativeSeries,startRelativeSeries:this._startRelativeSeries,endRelativeSeries:this._endRelativeSeries,vchart:this._option.globalInstance}}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent(),this._buildMarkerAttributeContext()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){return(0,eS.A)(e)&&LO(e)?{field:i.getSpec()[({x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"})[t]],aggrType:e}:e}_processSpecByDims(t){let 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})}
30_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];oS(this._specifiedDataSeries).forEach(e=>{t=t.concat(e.getViewData().latestData)});let e=new e_;return e.registerParser("array",el),new eR(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null==(t=this._spec.visible)||t){if(!this._markerComponent){let t=this._createMarkerComponent();t.name=null!=(e=this._spec.name)?e:this.type,t.id=null!=(i=this._spec.id)?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 r;return(r=null==(i=this._option.getSeriesInUserIdOrIndex((0,eA.A)(t)?[t]:[],[e]))?void 0:i[0])||(r=null!=(s=this._relativeSeries)?s:this._getFirstSeries()),r}_bindSeries(){let 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)))}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;let e=x9(this._regions);return e?(this._firstSeries=e,e):(null==(t=this._option)||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e){(0,eE.A)(this._spec.offsetX)||(this._layoutOffsetX=hU(this._spec.offsetX,e.width,e)),(0,eE.A)(this._spec.offsetY)||(this._layoutOffsetY=hU(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e)}_compareSpec(t,e){let i=super._compareSpec(t,e);return(0,ex.n)(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}_initCommonDataView(){let{options:t}=this._computeOptions(),e=this._getRelativeDataView();c3(this._option.dataSet,"markerAggregation",DH),c3(this._option.dataSet,"markerFilter",DN);let i=new eR(this._option.dataSet,{name:`${this.type}_${this.id}_data`});i.parse([e],{type:"dataview"}),i.transform({type:"markerAggregation",options:t}),i.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),i.target.on("change",()=>{this._markerLayout()}),this._markerData=i}}function DU(t,e){return function(t,e,i){let{predict:s}=function(t,e=t=>t.x,i=t=>t.y){let s=.05,r=0,a=0,n=0,l=0,o=0;!function(t,e,i,s){for(let r=0;r<t.length;r++){let a=t[r],n=e(a),l=i(a);!(0,eE.A)(n)&&(n*=1)>=n&&!(0,eE.A)(l)&&(l*=1)>=l&&s(n,l,r)}}(t,e,i,(t,e)=>{r++,a+=(t-a)/r,n+=(e-n)/r,l+=(t*e-l)/r,o+=(t*t-o)/r});let{a:h,b:u}=function(t,e,i,s){let r=s-t*t;if(Math.abs(r)<Number.EPSILON)return{a:e,b:0};let a=(i-t*e)/r;return{a:e-a*t,b:a}}(a,n,l,o),d=t=>h+u*t,c=function(t,e,i,s){let r=1/0,a=-1/0,n=0,l=0;for(let s=0;s<t.length;s++){let o=t[s],h=e(o),u=i(o);!(0,eE.A)(h)&&(h*=1)>=h&&!(0,eE.A)(u)&&(u*=1)>=u&&(h<r&&(r=h),h>a&&(a=h),n++,l+=h)}if(0===n)return{min:r,max:a,n:n,X:0,SSE:0,Sxx:0};let o=l/n,h=0,u=0;for(let r=0;r<t.length;r++){let a=t[r],n=e(a),l=i(a);if(!(0,eE.A)(n)&&(n*=1)>=n&&!(0,eE.A)(l)&&(l*=1)>=l){let t=l-s(n);h+=t*t;let e=n-o;u+=e*e}}return{min:r,max:a,n:n,X:o,SSE:h,Sxx:u}}(t,e,i,d);return{coef:{a:h,b:u},predict:d,rSquared:function(t,e,i,s,r){let a=0,n=0;for(let l=0;l<t.length;l++){let o=t[l],h=i(o);if(!(0,eE.A)(h)&&(h*=1)>=h){let t=h-r(e(o));a+=t*t;let i=h-s;n+=i*i}}return 0===n?0:1-a/n}(t,e,i,n,d),evaluateGrid:function(t){let e=[];
30if(0===c.n||t<=0)return e;if(c.min===c.max){for(let i=0;i<t;i++)e.push({x:c.min,y:d(c.min)});return e}let i=(c.max-c.min)/(t-1);for(let s=0;s<t;s++){let r=s===t-1?c.max:c.min+i*s;e.push({x:r,y:d(r)})}return e},confidenceInterval:function(t=50){var e;let i,r,a=[];if(0===c.n||t<=0)return a;let n=(e=1-s/2)<=0||e>=1?0:e<.02425?(((((-.00778489400243029*(i=Math.sqrt(-2*Math.log(e)))+-.322396458041136)*i+-2.40075827716184)*i+-2.54973253934373)*i+4.37466414146497)*i+2.93816398269878)/((((.00778469570904146*i+.32246712907004)*i+2.445134137143)*i+3.75440866190742)*i+1):e<=.97575?(((((-39.6968302866538*(r=(i=e-.5)*i)+220.946098424521)*r-275.928510446969)*r+138.357751867269)*r-30.6647980661472)*r+2.50662827745924)*i/(((((-54.4760987982241*r+161.585836858041)*r-155.698979859887)*r+66.8013118877197)*r-13.2806815528857)*r+1):-(((((-.00778489400243029*(i=Math.sqrt(-2*Math.log(1-e)))+-.322396458041136)*i+-2.40075827716184)*i+-2.54973253934373)*i+4.37466414146497)*i+2.93816398269878)/((((.00778469570904146*i+.32246712907004)*i+2.445134137143)*i+3.75440866190742)*i+1);if(c.min===c.max){let e=d(c.min),i=vH(c.min,c);for(let s=0;s<t;s++)a.push({x:c.min,mean:e,lower:e-n*i.seMean,upper:e+n*i.seMean,predLower:e-n*i.sePred,predUpper:e+n*i.sePred});return a}let l=(c.max-c.min)/(t-1);for(let e=0;e<t;e++){let i=e===t-1?c.max:c.min+l*e,s=d(i),r=vH(i,c);a.push({x:i,mean:s,lower:s-n*r.seMean,upper:s+n*r.seMean,predLower:s-n*r.sePred,predUpper:s+n*r.sePred})}return a}}}(t,t=>t[e],t=>t[i]),r=vj(t,e),a=vV(t,e),n=s(r),l=s(a);return[{[e]:r,[i]:n},{[e]:a,[i]:l}]}(t[0].latestData,e.fieldX,e.fieldY)}class DG extends DW{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=j.MarkLine}static _getMarkerCoordinateType(t){let{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:r,doRadAngProcess:a}=L$(t);return"polar"===t.coordinateType||e||i||s||r||a?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,r,a,n,l,o,h,u,d,c;let{startSymbol:p={},endSymbol:g={}}=this._spec,f=oS(null!=(t=this._spec.label)?t:{}),m={zIndex:this.layoutZIndex,interactive:null==(e=this._spec.interactive)||e,hover:null==(i=this._spec.interactive)||i,select:null==(s=this._spec.interactive)||s,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:LW(SS(null==(r=this._spec.line)?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!=(a=this._spec.clip)&&a,label:f.map(t=>LV(t,this._markerData,this._markAttributeContext)),state:{line:LN(null!=(l=null==(n=this._spec.line)?void 0:n.state)?l:{},this._markerData,this._markAttributeContext),lineStartSymbol:LN(null!=(h=null==(o=this._spec.startSymbol)?void 0:o.state)?h:{},this._markerData,this._markAttributeContext),lineEndSymbol:LN(null!=(d=null==(u=this._spec.endSymbol)?void 0:u.state)?d:{},this._markerData,this._markAttributeContext),label:f.map(t=>{var e;return LN(null!=(e=t.state)?e:{},this._markerData,this._markAttributeContext)}),labelBackground:f.map(t=>{var e,i;return LN(null!=(i=null==(e=t.labelBackground)?void 0:e.state)?i:{},this._markerData,this._markAttributeContext)})},animation:null!=(c=this._spec.animation)&&c,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return p.visible?m.startSymbol=Object.assign(Object.assign({},p),{visible:!0,style:LW(SS(p.style),this._markerData,this._markAttributeContext)}):m.startSymbol={visible:!1},g.visible?m.endSymbol=Object.assign(Object.assign({},g),{visible:!0,style:LW(SS(g.style),this._markerData,this._markAttributeContext)}):m.endSymbol={visible:!1},this._newMarkLineComponent(m)}_getUpdateMarkerAttrs(){var t,e;let i,s=this._spec,r=this._markerData,a=this._startRelativeSeries,n=this._endRelativeSeries,l=this._relativeSeries,o=this._computePointsAttr(),h=l.getViewData().latestData,u=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;if(s.clip||oS(s.label).some(t=>null==t?void 0:t.confine)){let{minX:t,maxX:e,minY:s,maxY:r}=Lj([a.getRegion(),n.getRegion(),l.getRegion()]);i={x:t,y:s,width:e-t,height:r-s}}let d=oS((null!=(e=null==(t=this._markerComponent)?void 0:t.attribute)?e:{}).label),c=oS(this._spec.label),p=d.map((t,e)=>{let i=c[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(u,h):null==t?void 0:t.text})});return Object.assign(Object.assign({},o),{label:p,limitRect:i,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;
30let e=this._getUpdateMarkerAttrs();null==(t=this._markerComponent)||t.setAttributes(e)}_initDataView(){let t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:r,doYXX1Process:a,doXYProcess:n,doAngleProcess:l,doRadiusProcess:o,doAngRadRad1Process:h,doRadAngAng1Process:u,doRadAngProcess:d}=L$(t);if(this._markerData=this._getRelativeDataView(),!(i||s||r||a||n||l||o||h||u||d||e))return;c3(this._option.dataSet,"markerAggregation",DH),c3(this._option.dataSet,"markerRegression",DU),c3(this._option.dataSet,"markerFilter",DN);let{options:c,needAggr:p,needRegr:g,processData:f}=this._computeOptions(),m=new eR(this._option.dataSet);m.parse([f],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:c}),g&&m.transform({type:"markerRegression",options:c}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),m.target.on("change",()=>{this._markerLayout()}),this._markerData=m}}DG.specKey="markLine";let DY=()=>({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"}}}}),D$=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),DX=DY();DX.refY=5;let DK={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:D$(!1),endSymbol:D$(!0),label:DX};class Dq extends DG{constructor(){super(...arguments),this.type=hc.markLine,this.name=hc.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new DF(t)}_computePointsAttr(){var t;let e=this._spec,i=this._markerData,s=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,n=(0,eA.A)(e.coordinates),l=(0,eA.A)(e.process),o=l&&(0,eA.A)(e.process.x),h=l&&(0,eA.A)(e.process.y),u=(0,eA.A)(e.positions),d=null!=(t=e.autoRange)&&t,{doXProcess:c,doYProcess:p,doXYY1Process:g,doYXX1Process:f,doXYProcess:m,doCoordinatesProcess:_}=L$(e),y=[];if(c||g||p||f||m||n&&o||n&&h){let t=LR(i,s,r,a,d);y=1===t.length?t[0]:t.map(t=>t[0])}else _?y=LD(i,a,d,e.coordinatesOffset):u&&(y=LH(e.positions,a,e.regionRelative));return{points:y}}_markerLayout(){var t,e,i,s,r;let a=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){let r,n,l=this._startRelativeSeries,o=this._endRelativeSeries,{multiSegment:h,mainSegmentIndex:u}=this._spec.line||{},{connectDirection:d,expandDistance:c=0}=this._spec;if(hW(c)){let t=l.getRegion(),e=t.getLayoutStartPoint(),i=o.getRegion(),s=i.getLayoutStartPoint();if("bottom"===d||"top"===d){let a=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));r=Number(c.substring(0,c.length-1))*a/100}else{let a=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));r=Number(c.substring(0,c.length-1))*a/100}}else r=c;let{points:p,limitRect:g}=a;if(!p||p.length<2)return void(null==(t=this._markerComponent)||t.setAttributes(a));let f=function(t,e,i,s=0){let r=[],a=t.y-e.y,n=t.x-e.x;switch(i){case"top":r.push(t),r.push({x:t.x,y:a>0?t.y-s-Math.abs(a):t.y-s}),r.push({x:e.x,y:a>0?e.y-s:e.y-s-Math.abs(a)}),r.push(e);break;case"bottom":r.push(t),r.push({x:t.x,y:a<0?t.y+s+Math.abs(a):t.y+s}),r.push({x:e.x,y:a<0?e.y+s:e.y+s+Math.abs(a)}),r.push(e);break;case"left":r.push(t),r.push({x:n>0?t.x-s-Math.abs(n):t.x-s,y:t.y}),r.push({x:n>0?e.x-s:e.x-s-Math.abs(n),y:e.y}),r.push(e);break;case"right":r.push(t),r.push({x:n>0?t.x+s:t.x+s+Math.abs(n),y:t.y}),r.push({x:n>0?e.x+s+Math.abs(n):e.x+s,y:e.y}),r.push(e)}return r}(p[0],p[1],d,r);n=h&&(0,eA.A)(u)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){let r=t.y-e.y,a=t.x-e.x;return"bottom"===i?{dx:a>0?-a/2:Math.abs(a/2),dy:r>0?s:Math.abs(r)+s}:"top"===i?{dx:a>0?-Math.abs(a/2):+Math.abs(a/2),dy:r>0?-(Math.abs(r)+s):-s}:"left"===i?{dx:a>0?-a-s:-s,dy:r>0?-r/2:Math.abs(r/2)}:"right"===i?{dx:a>0?s:Math.abs(a)+s,dy:r>0?-r/2:Math.abs(r/2)}:{}}(p[0],p[1],d,r));let m=oS((null!=(i=null==(e=this._markerComponent)?void 0:e.attribute)?i:{}).label),_=oS(a.label),y=oS(this._spec.label);null==(s=this._markerComponent)||s.setAttributes({points:h?[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]]]:f,label:_.map((t,e)=>{var i,s,r,a;let l=0,o=0,h=null!=(i=n.dx)?i:0,u=null!=(s=n.dy)?s:0,d=null!=(r=y[e])?r:y[0];return eP(null==d?void 0:d.refX)&&(l+=d.refX),eP(null==d?void 0:d.refY)&&(o+=d.refY),eP(null==d?void 0:d.dx)&&(h+=d.dx),eP(null==d?void 0:d.dy)&&(u+=d.dy),Ob
30ject.assign(Object.assign(Object.assign({},t),n),{refX:l,refY:o,dx:h,dy:u,textStyle:Object.assign(Object.assign({},null==(a=m[e])?void 0:a.textStyle),{textAlign:"center",textBaseline:"middle"})})}),limitRect:g,multiSegment:h,mainSegmentIndex:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null==(r=this._markerComponent)||r.setAttributes(a)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1,r=this._spec,a=this._relativeSeries,{doXProcess:n,doYProcess:l,doXYY1Process:o,doYXX1Process:h,doXYProcess:u,doCoordinatesProcess:d}=L$(r);if(u)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y1}])];else if(n)t=[this._processSpecByDims([{dim:"x",specValue:r.x}])];else if(l)t=[this._processSpecByDims([{dim:"y",specValue:r.y}])];else if(o)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:r.x},{dim:"y",specValue:r.y}]),this._processSpecByDims([{dim:"x",specValue:r.x1},{dim:"y",specValue:r.y}])];else if(d){if(t=this._processSpecCoo(r),i=!1,e=new eR(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([a.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),r.process&&(0,eA.A)(r.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:r.process.x}])],i=!0),r.process&&(0,eA.A)(r.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:r.process.y}])],i=!0),r.process&&(0,eA.A)(r.process.xy)){let{xField:e,yField:i}=a.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}Dq.type=hc.markLine,Dq.coordinateType="cartesian",Dq.builtInTheme={markLine:DK},kc();class DZ extends kp{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},kp.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){let 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(){let 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();let{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:r=!0,radius:a,startAngle:n,endAngle:l,center:o}=this.attribute;if(!r)return;this._startAngle=n,this._endAngle=l,this.isReverseArc=n>l;let h={x:o.x+a*Math.cos(this._startAngle),y:o.y+a*Math.sin(this._startAngle)},u={x:o.x+a*Math.cos(this._endAngle),y:o.y+a*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,u];let d=this._renderSymbol(t,this._mainSegmentPoints,"start"),c=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=d,this.endSymbol=c;let p=lF.arc(Object.assign({x:o.x,y:o.y,startAngle:n,endAngle:l,innerRadius:a,outerRadius:a},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),pJ(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}Dt(),kc(),yR();class DJ extends DM{markerAnimate(t){DJ._animate&&this._animationConfig&&DJ._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},DJ.defaultAttributes,t)),this.name="markArcLine"}getPointAttrByPosition(t,e){let i,{center:s,radius:r,startAngle:a,endAngle:n}=this.attribute,{refX:l=0,refY:o=0}=e;switch(t){case t7.arcInnerStart:i=a;case t7.arcOuterStart:i=a;break;case t7.arcInnerEnd:i=n;case t7.arcOuterEnd:i=n;break;case t7.center:case t7.arcInnerMiddle:case t7.arcOuterMiddle:default:i=(a+n)/2}return{position:{x:s.x+(r+o)*Math.cos(i)+l*Math.cos(i-Math.PI/2),y:s.y+(r+o)*Math.sin(i)+l*Math.sin(i-Math.PI/2)},angle:i}}getTextStyle(t){return DO[t]}getRotateByAngle(t,e){var i;return t-Math.PI/2+(null!=(i=e.refAngle)?i:0)}createSegment(){let{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:r,endSymbol:a,lineStyle:n,state:l}=this.attribute;return new DZ({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:r,endSymbol:a,lineStyle:n,state:{line:eB({},_E,null==l?void 0:l.line),startSymbol:eB({},_E,null==l?void 0:l.lineStartSymbol),endSymbol:eB({},_E,null==l?void 0:l.lineEndSymbol)}})}setLineAttributes(){let{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:r,endSymbol:a,lineStyle:n,state:l}=this.attribute;this._line&&this._line.setAttributes({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:r,endSymbol:a,lineStyle:n,state:{line:eB({},_E,null==l?void 0:l.line),startSymbol:eB({},_E,null==l?void 0:l.lineStartSymbol),endSymbol:eB({},_E,null==l?void 0:l.lineEndSymbol)}})}isValidPoints(){return!0}
30addMarkLineLabels(t){this._addMarkLabels(t,"mark-common-line-label",DJ.defaultAttributes.label)}updateMarkLineLabels(){this._updateMarkLabels(DJ.defaultAttributes.label)}}DJ.defaultAttributes=DB;class DQ extends DG{constructor(){super(...arguments),this.type=hc.polarMarkLine,this.name=hc.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){let{doRadiusProcess:e,doRadAngAng1Process:i}=L$(this._spec);return e||i?new DJ(t):new DF(t)}_computePointsAttr(){var t;let e=this._spec,i=this._markerData,s=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,n=null!=(t=e.autoRange)&&t,{doAngleProcess:l,doRadiusProcess:o,doAngRadRad1Process:h,doRadAngAng1Process:u,doRadAngProcess:d,doCoordinatesProcess:c}=L$(e),p=[],g={},f={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(l||o||h||u||d){let t=LL(i,s,r,a,n);g=(p=1===t.length?t[0]:t.map(t=>t[0]))[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:f}:{points:p.map(t=>iE(f,t.radius,t.angle))}}else c&&(g={points:(p=LF(i,a,n)).map(t=>iE(f,t.radius,t.angle))});return g}_computeOptions(){let t,e=this._spec,{doAngleProcess:i,doRadiusProcess:s,doAngRadRad1Process:r,doRadAngAng1Process:a,doRadAngProcess:n,doCoordinatesProcess:l}=L$(e),o=this._getRelativeDataView();return n?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:i?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle}])]:s?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}])]:r?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius1}])]:a?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:l&&(t=this._processSpecCoo(e)),{options:t,needAggr:!0,needRegr:!1,processData:o}}}DQ.type=hc.polarMarkLine,DQ.coordinateType="polar",DQ.builtInTheme={polarMarkLine:DK},p1(),gD(),xL();class D0 extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},D0.defaultAttributes,t)),this.name="title"}render(){var t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y,v;let{textType:b,text:x,subtextType:S,textStyle:A={},subtext:k,subtextStyle:M={},width:w,height:T,minWidth:C,maxWidth:B,minHeight:E,maxHeight:P,align:O,verticalAlign:R,padding:I=0}=this.attribute,L=AN(I),D=this.createOrUpdateChild("title-container",{x:L[3],y:L[0],zIndex:1},"group"),F=null!=(t=A.height)?t:T;if(!1!==this.attribute.visible&&!1!==A.visible){let{width:t,maxHeight:l,maxWidth:o,x:h=0,y:u=0,ellipsis:d=!0,wordBreak:c="break-word",maxWidth:p,lineClamp:g}=A;if("rich"===b||(0,eA.A)(A.character)){let s=Object.assign({x:h,y:u,width:null!=(e=null!=t?t:w)?e:0,height:null!=F?F:0,ellipsis:null==d||d,wordBreak:null!=c?c:"break-word",maxHeight:null!=l?l:P,maxWidth:null!=o?o:p,textConfig:null!=(i=A.character)?i:x},A);this._mainTitle=D.createOrUpdateChild("mainTitle",s,"richtext")}else if("html"===b){let e=Object.assign({html:Object.assign(Object.assign({dom:x},_P),A),x:h,y:u,width:null!=(s=null!=t?t:w)?s:0,height:null!=F?F:0,ellipsis:d,wordBreak:c,maxHeight:null!=l?l:P,maxWidth:null!=o?o:p,textConfig:[]},A);this._mainTitle=D.createOrUpdateChild("mainTitle",e,"richtext")}else(0,eA.A)(x)&&(this._mainTitle=D.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:(0,ev.A)(x)?x:[x],whiteSpace:"normal"},A),{maxLineWidth:null!=(a=null!=(r=A.maxLineWidth)?r:t)?a:w,heightLimit:null!=(n=A.height)?n:P,lineClamp:g,ellipsis:d,x:h,y:u}),"text"))}let z=this._mainTitle?this._mainTitle.AABBBounds.height():0,H=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==M.visible){let{width:t,height:e,maxWidth:i,maxHeight:s,x:r=0,y:a=0,ellipsis:n=!0,wordBreak:g="break-word",lineClamp:f}=M,m=Math.max(5e-324,P-z);
30if("rich"===S||(0,eA.A)(M.character)){let u=Object.assign({x:r,y:a,width:null!=(l=null!=t?t:w)?l:0,height:null!=(o=null!=e?e:T)?o:0,ellipsis:n,wordBreak:g,maxHeight:null!=s?s:m,maxWidth:null!=i?i:B,textConfig:null!=(h=M.character)?h:k},M);this._subTitle=D.createOrUpdateChild("subTitle",u,"richtext")}else if("html"===S){let l=Object.assign({html:Object.assign(Object.assign({dom:k},_P),M),x:r,y:a,width:null!=(u=null!=t?t:w)?u:0,height:null!=(d=null!=e?e:T)?d:0,ellipsis:n,wordBreak:g,maxHeight:null!=s?s:m,maxWidth:null!=i?i:B,textConfig:[]},M);this._subTitle=D.createOrUpdateChild("subTitle",l,"richtext")}else(0,eA.A)(k)&&(this._subTitle=D.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:(0,ev.A)(k)?k:[k],whiteSpace:"normal"},M),{maxLineWidth:null!=(c=M.maxLineWidth)?c:w,heightLimit:null!=(p=M.heightLimit)?p:m,lineClamp:f,ellipsis:n,x:0,y:z}),"text"))}let j=this._subTitle?this._subTitle.AABBBounds.height():0,V=Math.max(H,this._subTitle?this._subTitle.AABBBounds.width():0),N=z+(null!=(g=M.height)?g:j);if((0,eA.A)(w)&&(V=w),(0,eA.A)(T)&&(N=T),(0,eA.A)(C)&&V<C&&(V=C),(0,eA.A)(B)&&V>B&&(V=B),(0,eA.A)(E)&&N<E&&(N=E),(0,eA.A)(P)&&N>P&&(N=P),D.attribute.width=V,D.attribute.height=N,D.attribute.boundsPadding=L,this._mainTitle){if((0,eA.A)(O)||(0,eA.A)(A.align)){let t=A.align?A.align:O,e=null!=(f=A.width)?f:V;"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")):(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left"))}let t=A.verticalAlign?A.verticalAlign:R,e=null!=F?F:this._mainTitle.AABBBounds.empty()?0:this._mainTitle.AABBBounds.height();"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")):(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top"))}if(this._subTitle){if((0,eA.A)(O)||(0,eA.A)(M.align)){let t=M.align?M.align:O,e=null!=(_=null!=(m=M.width)?m:A.width)?_:V;"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")):(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left"))}let t=M.verticalAlign?M.verticalAlign:R,e=this._mainTitle?(0,eA.A)(F)?this._mainTitle.AABBBounds.y1+Math.max(this._mainTitle.AABBBounds.empty()?0:this._mainTitle.AABBBounds.height(),F):this._mainTitle.AABBBounds.y2:0,i=null!=(v=null!=(y=M.height)?y:T)?v:this._subTitle.AABBBounds.empty()?0:this._subTitle.AABBBounds.height();"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")):(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top"))}}}D0.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 D1 extends SL{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=hc.title,this.specKey=hc.title,this.layoutType="normal",this.layoutZIndex=j.Title,this.layoutLevel=V.Title,this._orient="top",this._orient=hN(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return v2(t,this.specKey,hc.title,t=>!1!==t.visible)}_compareSpec(t,e){let 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}afterSetLayoutStartPoint(t){eP(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),eP(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);let i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();let{x:s,y:r}=this.getLayoutStartPoint();return{x1:s,y1:r,x2:s+e.width,y2:r+e.height}}
30_getTitleLayoutRect(){let t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:eP(t.width())?t.width():0,height:this._spec.height?this._spec.height:eP(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,r,a;if(!1===this._spec.visible)return{visible:!1};let n=this.getLayoutRect(),l=hU(this._spec.width,n.width,null,n.width),o=Math.max(Math.min(l,hU(this._spec.maxWidth,n.width,null,n.width),n.width),0),h=(0,eA.A)(this._spec.text)&&""!==this._spec.text,u=(0,eA.A)(this._spec.subtext)&&""!==this._spec.subtext,d=Object.assign(Object.assign({},(0,SD.A)(this._spec,["padding"])),{textType:null!=(t=this._spec.textType)?t:"text",text:h?this._spec.text:void 0,subtextType:null!=(e=this._spec.subtextType)?e:"text",subtext:u?this._spec.subtext:void 0,x:null!=(i=this._spec.x)?i:0,y:null!=(s=this._spec.y)?s:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:o,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!=(r=this._spec.align)?r:"left",verticalAlign:null!=(a=this._spec.verticalAlign)?a:"top",textStyle:Object.assign({maxLineWidth:o},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:o},this._spec.subtextStyle)});if(h&&(d.textStyle.width=o),u&&(d.subtextStyle.width=o),(0,eA.A)(this._spec.width)){let t=Math.max(Math.min(l,n.width),0);h?d.textStyle.width=t:delete d.textStyle.width,u&&(d.subtextStyle.width=t)}return d}_createOrUpdateTitleComponent(t){if(this._titleComponent)(0,ex.n)(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{let e=this.getContainer(),i=new D0(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 D2(){D3._animate=D_}D1.type=hc.title,D1.specKey=hc.title,D1.builtInTheme={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"}}}},Dt(),A4(),yR();class D3 extends Ds{markerAnimate(t){D3._animate&&this._animationConfig&&D3._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},D3.defaultAttributes,t)),this.name="markArea",this.defaultUpdateAnimation=Dx,this.defaultExitAnimation=DA}getPointAttrByPosition(t){let{x1:e,x2:i,y1:s,y2:r}=this._area.AABBBounds,a={x:(e+i)/2,y:(s+r)/2};return(t.includes("left")||t.includes("Left"))&&(a.x=e),(t.includes("right")||t.includes("Right"))&&(a.x=i),(t.includes("top")||t.includes("Top"))&&(a.y=s),(t.includes("bottom")||t.includes("Bottom"))&&(a.y=r),a}setLabelPos(t,e){var i;if(this._area){let s=null!=(i=e.position)?i:"middle",r=this.getPointAttrByPosition(s);if(t.setAttributes(Object.assign(Object.assign({},r),{textStyle:Object.assign(Object.assign({},DR[s]),e.textStyle)})),this.attribute.limitRect&&e.confine){let{x:e,y:i,width:s,height:r}=this.attribute.limitRect;Di(t,{x1:e,y1:i,x2:e+s,y2:i+r})}}}initMarker(t){let{points:e,areaStyle:i,state:s}=this.attribute,r=lF.polygon(Object.assign({points:e},i));r.states=eB({},_E,null==s?void 0:s.area),r.name="mark-area-polygon",this._area=r,t.add(r),this._addMarkLabels(t,"mark-area-label",D3.defaultAttributes.label)}updateMarker(){let{points:t,areaStyle:e,state:i}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({points:t},e)),this._area.states=eB({},_E,null==i?void 0:i.area)),this._updateMarkLabels(D3.defaultAttributes.label)}isValidPoints(){let{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach(t=>{eP(t.x)&&eP(t.y)||(e=!1)}),e}}D3.defaultAttributes=DE,yg(D3,Dk);class D5 extends DW{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=j.MarkArea}static _getMarkerCoordinateType(t){let{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=LX(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,r,a,n,l;let o=oS(null!=(t=this._spec.label)?t:{}),h={zIndex:this.layoutZIndex,interactive:null==(e=this._spec.interactive)||e,hover:null==(i=this._spec.interactive)||i,select:null==(s=this._spec.interactive)||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:LW(SS(null==(r=this._spec.area)?void 0:r.style),this._markerData,this._markAttributeContext),clipInRange:null!=(a=this._spec.clip)&&a,label:o.map(t=>LV(t,this._markerData,this._markAttributeContext)),state:{area:LN(null==(n=this._spec.area)?void 0:n.state,this._markerData,this._markAttributeContext),label:o.map(t=>LN(t.state,this._markerData,this._markAttributeContext)),labelBackgroun
30d:o.map(t=>{var e;return LN(null==(e=t.labelBackground)?void 0:e.state,this._markerData,this._markAttributeContext)})},animation:null!=(l=this._spec.animation)&&l,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}_markerLayout(){var t;let e,i=this._spec,s=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,n=this._relativeSeries,l=this._computePointsAttr(),o=this._getRelativeDataView().latestData,h=s?s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData:o;if(i.clip||oS(i.label).some(t=>null==t?void 0:t.confine)){let{minX:t,maxX:i,minY:s,maxY:l}=Lj([r.getRegion(),a.getRegion(),n.getRegion()]);e={x:t,y:s,width:i-t,height:l-s}}if(this._markerComponent){let i=oS(null==(t=this._markerComponent.attribute)?void 0:t.label),s=oS(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},l),{label:i.map((t,e)=>{let i=s[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,o):null==t?void 0:t.text})}),limitRect:e,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}_initDataView(){let{doXProcess:t,doYProcess:e,doXYProcess:i,doAngleProcess:s,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:n}=LX(this._spec);if(!(t||e||i||s||r||a||n))return null;this._initCommonDataView()}}D5.specKey="markArea";let D4={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:DY()};class D8 extends D5{constructor(){super(...arguments),this.type=hc.markArea,this.name=hc.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new D3(t)}_computePointsAttr(){var t,e;let i=this._spec,s=this._markerData,r=this._startRelativeSeries,a=this._endRelativeSeries,n=this._relativeSeries,{doXProcess:l,doYProcess:o,doXYProcess:h,doCoordinatesProcess:u}=LX(i),d=(0,eA.A)(i.positions),c=null!=(t=i.autoRange)&&t,p=null!=(e=i.includeFullBand)&&e,g=[];if(h){let[t,e]=LR(s,r,a,n,c,p);t&&t.length&&e&&e.length&&(g=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(l||o){let[t,e]=LR(s,r,a,n,c,p);t&&t.length&&e&&e.length&&(g=[...t,e[1],e[0]])}else u?g=LD(s,n,c,i.coordinatesOffset):d&&(g=LH(i.positions,n,i.regionRelative));return{points:g}}_computeOptions(){let t,e=this._spec,{doXProcess:i,doYProcess:s,doXYProcess:r,doCoordinatesProcess:a}=LX(e);return r?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"x",specValue:e.x1},{dim:"y",specValue:e.y1}])]:i?t=[this._processSpecByDims([{dim:"x",specValue:e.x}]),this._processSpecByDims([{dim:"x",specValue:e.x1}])]:s?t=[this._processSpecByDims([{dim:"y",specValue:e.y}]),this._processSpecByDims([{dim:"y",specValue:e.y1}])]:a&&(t=this._processSpecCoo(e)),{options:t}}}D8.type=hc.markArea,D8.coordinateType="cartesian",D8.builtInTheme={markArea:D4},Dt(),ku(),yR();class D6 extends Ds{markerAnimate(t){D6._animate&&this._animationConfig&&D6._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},D6.defaultAttributes,t)),this.name="markArcArea",this.defaultUpdateAnimation=Dx,this.defaultExitAnimation=DA}getPointAttrByPosition(t,e){let i,s,{center:r,innerRadius:a,outerRadius:n,startAngle:l,endAngle:o}=this.attribute,{refX:h=0,refY:u=0}=e;switch(t){case t7.center:i=(a+n)/2,s=(l+o)/2;break;case t7.arcInnerStart:i=a,s=l;break;case t7.arcOuterStart:i=n,s=l;break;case t7.arcInnerEnd:i=a,s=o;break;case t7.arcOuterEnd:i=n,s=o;break;case t7.arcInnerMiddle:i=a,s=(l+o)/2;break;case t7.arcOuterMiddle:i=n,s=(l+o)/2;break;default:i=a,s=(l+o)/2}return{position:{x:r.x+(i+u)*Math.cos(s)+h*Math.cos(s-Math.PI/2),y:r.y+(i+u)*Math.sin(s)+h*Math.sin(s-Math.PI/2)},angle:s}}setLabelPos(t,e){var i;if(this._area){let{position:s="arcInnerMiddle",autoRotate:r}=e,a=this.getPointAttrByPosition(s,e);if(t.setAttributes(Object.assign(Object.assign({},a.position),{angle:r?a.angle-Math.PI/2+(null!=(i=e.refAngle)?i:0):0,textStyle:Object.assign(Object.assign({},DO[s]),e.textStyle)})),this.attribute.limitRect&&e.confine){let{x:e,y:i,width:s,height:r}=this.attribute.limitRect;Di(t,{x1:e,y1:i,x2:e+s,y2:i+r})}}}initMarker(t){let{center:e,innerRadius:i,outerRadius:s,startAngle:r,endAngle:a,areaStyle:n,state:l}=this.attribute,o=lF.arc(Object.assign({x:e.x,y:e.y,innerRadius:i,outerRadius:s,startAngle:r,endAngle:a},n));o.states=eB({},_E,null==l?void 0:l.area),o.name="polar-mark-area-area",this._area=o,t.add(o),this._addMarkLabels(t,"mark-area-label",D6.defaultAttributes.label)}updateMarker(){let{center:t,innerRadius:e,outerRadius:i,startAngle:s,endAngle:r,areaStyle:a,label:n,state:l}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({x:t.x,y:t.y,innerRadius:e,outerRadius:i,startAngle:s,endAngle:r},a)),this._area.states=eB({},_E,null==l?void 0:l.area)),this._updateMarkLabels(D6.defaultAttributes.label)}isValidPoints(){return!0}}D6.defaultAttributes=DP,yg(D6,Dk);class D9 extends D5{constructor(){super(...arguments),this.type=hc.polarMarkArea,this.name=hc.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){let{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=LX(this._spec);return i||e||s?new D6(t):new D3(t)}_computePointsAttr(){var t;let e=this._spec,i=this._markerData,s=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,{doAngleProcess:n,doRadiusProcess:l,doRadAngProcess:o,doCoordinatesProcess:h}=LX(e),u=null!=(t=e.autoRange)&&t,d={},c={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(n||l||o){let t=LL(i,s,r,a,u);o?d={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:c}:n?d={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:c}:l&&(d={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:c})}else h&&(d={points:LF(i,a,u).map(t=>
30iE(c,t.radius,t.angle))});return d}_computeOptions(){let t,e=this._spec,{doAngleProcess:i,doRadiusProcess:s,doRadAngProcess:r,doCoordinatesProcess:a}=LX(e);return r?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius1}])]:i?t=[this._processSpecByDims([{dim:"angle",specValue:e.angle},{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"angle",specValue:e.angle1},{dim:"radius",specValue:e.radius}])]:s?t=[this._processSpecByDims([{dim:"radius",specValue:e.radius}]),this._processSpecByDims([{dim:"radius",specValue:e.radius1}])]:a&&(t=this._processSpecCoo(e)),{options:t}}}D9.type=hc.polarMarkArea,D9.coordinateType="polar",D9.builtInTheme={polarMarkArea:D4};class D7 extends oq{constructor(t){super(t)}}(tX=ee||(ee={})).OnPlay="onPlay",tX.OnPause="onPause",tX.OnForward="onForward",tX.OnBackward="onBackward",(tK=ei||(ei={})).Start="start",tK.Pause="pause",tK.Forward="forward",tK.Backward="backward";class Ft extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Ft.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"},Ft.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"},Ft.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},Ft.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},Ft.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)?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)?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)?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.
30153 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)?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=()=>{(0,eE.A)(this._playController)&&(this._playController=new D7(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{(0,eE.A)(this._backwardController)&&(this._backwardController=new D7(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{(0,eE.A)(this._forwardController)&&(this._forwardController=new D7(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)}
30,this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent(ee.OnPlay)},this.pause=()=>{this._dispatchEvent(ee.OnPause)},this.forward=()=>{this._dispatchEvent(ee.OnForward)},this.backward=()=>{this._dispatchEvent(ee.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()}}Ft.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Ft.defaultAttributes={[ei.Start]:{},[ei.Pause]:{},[ei.Backward]:{},[ei.Forward]:{}};let Fe={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Fi=[200,10];(tq=es||(es={})).Default="default",tq.Reverse="reverse";let Fs=t=>"top"===t||"bottom"===t;class Fr extends xN{getMinIndex(){return this._minIndex}getMaxIndex(){return this._maxIndex}getDataIndex(){return this._dataIndex}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Fr.defaultAttributes,t)),this._data=[],this._dataIndex=0,this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e;let i;eP(this._handlerStyle.size)?i=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(i=im(this._handlerStyle.size[0],this._handlerStyle.size[1]));let 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:eP(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(Fs(this._orient)){let e=Math.max(0,this._layoutInfo.slider.size),i=null!=(t=this._railStyle.height)?t:Fi["1"];s.layout="horizontal",s.railHeight=i,s.railWidth=e,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}else{let t=Math.max(0,this._layoutInfo.slider.size),i=null!=(e=this._railStyle.width)?e:Fi["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=()=>{let t=this._updateSliderAttrs();this._slider=new IS(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{let t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return t.layout=Fs(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=()=>{let t=this._updateControllerAttrs();this._controller=new Ft(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;let{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;
30this._dataIndex=null!=(t=this.attribute.dataIndex)?t:0}_initLayoutInfo(){var t,e,i;let s=[this._start,this._backward,this._forward].sort((t,e)=>t.order-e.order),r=s.filter(t=>"end"!==t.position),a=s.filter(t=>"end"===t.position),n=null!=(t=Fs(this._orient)?this._railStyle.height:this._railStyle.width)?t:Fi["1"],l=s.reduce((t,e)=>{let i=e.style.size,s=ed(i)?i:im(i[0],i[1]);return t+e.space+s},0),o=this._sliderVisible?(Fs(this._orient)?null==(e=this._size)?void 0:e.width:null==(i=this._size)?void 0:i.height)-l:0,h=o-this.attribute.slider.space,u=r.reduce((t,e)=>{let{key:i,space:s,style:{size:r}}=e,a=ed(r)?r:im(r[0],r[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:a,x:Fs(this._orient)?t+s:(this._size.width-a)/2,y:Fs(this._orient)?(this._size.height-a)/2:t+s}),t+s+a},0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:Fs(this._orient)?u+this.attribute.slider.space:(this._size.width-n)/2,y:Fs(this._orient)?(this._size.height-n)/2:u+this.attribute.slider.space}),a.reduce((t,e)=>{let{key:i,space:s,style:{size:r}}=e,a=ed(r)?r:im(r[0],r[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:a,x:Fs(this._orient)?t+s:(this._size.width-a)/2,y:Fs(this._orient)?(this._size.height-a)/2:t+s}),t+s+a},u+o)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){let t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){let t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}release(t){this._sliderVisible||this._slider.release(t),super.release(t)}}function Fa(){Io(),p1(),gq()}Fr.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({},Fe),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},Fe),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},Fe),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},Fe),{key:"backward",position:"start"})}},(tZ=er||(er={})).change="change",tZ.play="play",tZ.pause="pause",tZ.backward="backward",tZ.forward="forward",tZ.end="end",tZ.OnChange="change",tZ.OnPlay="play",tZ.OnPause="pause",tZ.OnBackward="backward",tZ.OnForward="forward",tZ.OnEnd="end",Fa();class Fn extends Fr{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i;super._initAttributes(),this._alternate=null!=(t=this.attribute.alternate)&&t,this._interval=null!=(e=this.attribute.interval)?e:1e3,this._direction=null!=(i=this.attribute.direction)?i:es.Default},this._initDataIndex=()=>{var t;this._dataIndex=(0,eE.A)(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!=(t=this.attribute.dataIndex)?t:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ee.OnPlay,t=>{t.stopPropagation(),this.play()}),this._controller.addEventListener(ee.OnPause,t=>{t.stopPropagation(),this.pause()}),this._controller.addEventListener(ee.OnForward,t=>{t.stopPropagation(),this.forward()}),this._controller.addEventListener(ee.OnBackward,t=>{t.stopPropagation(),this.backward()}),this._slider.addEventListener("change",t=>{let 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(er.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===es.Default&&i===e)({direction:t,maxIndex:e,dataIndex:s})||(({direction:t,minIndex:e,dataIndex:i})=>t===es.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===es.Default&&i===e)({direction:t,minIndex:i,dataIndex:s})||(({direction:t,maxIndex:e,dataIndex:i})=>t===es.Reverse&&i===e)({direction:t,maxIndex:e,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===es.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(er.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=hL.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{let e,i,s,r,a=Date.now();this._isReachEnd&&a-this._tickTime>=this._interval?(this._isReachEnd=!1,this._playEnd()):(t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(er.change),this._activeIndex=this._dataIndex):a-this._tickTime>=this._interval&&(this._tickTime=a,this._updateDataIndex((e=this._direction,i=this._dataIndex,s=this._minIndex,r=this._maxIndex,"default"===e?Math.min(i+1,r):Math.max(i-1,s))),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(er.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=hL.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(),hL.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(er.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,hL.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(er.pause))},this.backward=()=>{let t,{loop:e=!1}=this.attribute;t=e?this._dataIndex-1<this._minIndex?this._maxIndex:this._dataIndex-1:Math.max(this._dataIndex-1,this._minIndex),this._updateDataIndex(t),this.dispatchCustomEvent(er.change),this.dispatchCustomEvent(er.backward)},this.forward=()=>{let t,{loop:e=!1}=this.attribute;t=e?this._dataIndex+1>this._maxIndex?this._minIndex:this._dataIndex+1:Math.min(this._dataIndex+1,this._maxIndex),this._updateDataIndex(t),this.dispatchCustomEvent(er.change),this.dispatchCustomEvent(er.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}Fa();class Fl extends Fr{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)?t:1e3;let 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;
30this._dataIndex=null!=(t=this.attribute.dataIndex)?t:this._minIndex},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(ee.OnPlay,t=>{t.stopPropagation(),this.play()}),this._controller.addEventListener(ee.OnPause,t=>{t.stopPropagation(),this.pause()}),this._controller.addEventListener(ee.OnForward,t=>{t.stopPropagation(),this.forward()}),this._controller.addEventListener(ee.OnBackward,t=>{t.stopPropagation(),this.backward()}),this._slider.addEventListener("change",t=>{var e;t.stopPropagation();let i=null==(e=t.detail)?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)}))},this._getSliderValue=()=>Math.min(this._elapsed/this._totalDuration*this._maxIndex,this._maxIndex),this._updateSlider=()=>{let t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{let e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(er.change))},this.play=()=>{var t,e,i,s;return t=this,e=void 0,i=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(er.play),this._rafId=hL.getRequestAnimationFrame()(this._play.bind(this)))},new(i||(i=Promise))(function(r,a){function n(t){try{o(s.next(t))}catch(t){a(t)}}function l(t){try{o(s.throw(t))}catch(t){a(t)}}function o(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(n,l)}o((s=s.apply(t,e||[])).next())})},this._play=()=>{this._elapsed=Date.now()-this._startTime;let t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=hL.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,hL.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(er.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,hL.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(er.pause))},this.backward=()=>{let t=Date.now(),e=+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(er.backward)},this.forward=()=>{let t=Date.now(),e=+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(er.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}let Fo=t=>SS(Object.assign({},t)),Fh=t=>Object.assign(Object.assign({},t),{style:Object.assign({},SS(t.style))}),Fu=t=>{var e,i,s,r,a,n,l,o,h,u,d,c,p,g,f;let m=Fo(null!=(i=null==(e=null==t?void 0:t.slider)?void 0:e.trackStyle)?i:{}),_=Fo(null!=(r=null==(s=null==t?void 0:t.slider)?void 0:s.railStyle)?r:{}),y=SS(Object.assign({},null!=(n=null==(a=null==t?void 0:t.slider)?void 0:a.handlerStyle)?n:{})),v=Fh(null!=(o=null==(l=null==t?void 0:t.controller)?void 0:l.start)?o:{}),b=Fh(null!=(u=null==(h=null==t?void 0:t.controller)?void 0:h.pause)?u:{}),x=Fh(null!=(c=null==(d=null==t?void 0:t.controller)?void 0:d.backward)?c:{}),S=Fh(null!=(g=null==(p=null==t?void 0:t.controller)?void 0:p.forward)?g:{}),A=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!=(f=t.orient)?f:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:m,railStyle:_,handlerStyle:y}),controller:Object.assign(Object.assign({},t.controller),{start:v,pause:b,backward:x,forward:S})});return t.visible||(A.controller.visible=!1,A.slider.visible=!1),A},Fd=t=>
30"left"===t||"right"===t,Fc=t=>"top"===t||"bottom"===t;class Fp extends SL{constructor(){super(...arguments),this.layoutZIndex=j.Player,this.layoutLevel=V.Player,this.specKey="player",this.type=hc.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,r,a;let n,l,o,h,u=this._spec.type,d={size:{width:this._width,height:this._height},dx:null!=(t=this._spec.dx)?t:0+this._dx,dy:null!=(e=this._spec.dy)?e:0+this._dy};return"discrete"===u?Object.assign(Object.assign(Object.assign({},(n=this._spec,l=this._specs,Object.assign(Object.assign({},Fu(n)),{data:l,type:"discrete"}))),d),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null==(s=null==(i=this._spec)?void 0:i.loop)||s}):Object.assign(Object.assign(Object.assign({},(o=this._spec,h=this._specs,Object.assign(Object.assign({},Fu(o)),{data:h,type:"continuous"}))),d),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null==(a=null==(r=this._spec)?void 0:r.loop)||a})},this._createOrUpdatePlayerComponent=()=>{let t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?(0,ex.n)(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new Fn(t):this._playerComponent=new Fl(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,r,a,n,l,o;return Math.max(...oS(null==(e=null==(t=this._spec.controller.start)?void 0:t.style)?void 0:e.size),...oS(null==(s=null==(i=this._spec.controller.pause)?void 0:i.style)?void 0:s.size),...oS(null==(a=null==(r=this._spec.controller.backward)?void 0:r.style)?void 0:a.size),...oS(null==(l=null==(n=this._spec.controller.forward)?void 0:n.style)?void 0:l.size),null!=(o=Fd(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)?o:10)},this._sliderExceededSize=()=>{var t,e,i,s,r,a,n,l,o;let h=null!=(t=Fd(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)?t:10,u=Math.max(...oS(null==(i=null==(e=this._spec.controller.start)?void 0:e.style)?void 0:i.size),...oS(null==(r=null==(s=this._spec.controller.pause)?void 0:s.style)?void 0:r.size),...oS(null==(n=null==(a=this._spec.controller.backward)?void 0:a.style)?void 0:n.size),...oS(null==(o=null==(l=this._spec.controller.forward)?void 0:l.style)?void 0:o.size));return h>=u?h-u:0},this.autoPlayCallback=()=>{var t;(null==(t=this._spec)?void 0:t.auto)&&(this._playerComponent.pause(),this._playerComponent.play())},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.off(dj.rendered,this.autoPlayCallback),this._option.globalInstance.on(dj.rendered,this.autoPlayCallback),this._playerComponent.addEventListener(er.end,()=>{var t;this.event.emit(dj.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.loop)&&this._playerComponent.play()}),this._playerComponent.addEventListener(er.change,t=>{let{index:e}=t.detail;this.changePlayerIndex(e)}),this._playerComponent.addEventListener(er.backward,t=>{let{index:e}=t.detail,i=this._specs[e];this.event.emit(dj.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(er.forward,t=>{let{index:e}=t.detail,i=this._specs[e];this.event.emit(dj.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(er.play,t=>{let{index:e}=t.detail,i=this._specs[e];this.event.emit(dj.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})}),this._playerComponent.addEventListener(er.pause,t=>{let{index:e}=t.detail,i=this._specs[e];this.event.emit(dj.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,r,a,n,l;super.setAttrFromSpec(),this._orient=null!=(t=this._spec.orient)?t:"bottom",this._specs=null!=(e=this._spec.specs)?e:[],this._direction=null!=(i=this._spec.direction)?i:"default",this._alternate=null!=(s=this._spec.alternate)&&s,this._dx=null!=(r=this._spec.dx)?r:0,this._dy=null!=(a=this._spec.dy)?a:0,this._position=null!=(n=this._spec.position)?n:"middle",this._visible=null==(l=this._spec.visible)||l}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),eP(t.x)){let e=Fd(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(eP(t.y)){let e=Fc(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);let i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}_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 ed(this._spec.width)?Math.min(t.width,Number(this._spec.width)):Fd(this._orient)?this._maxSize():t.width}_computeHeight(t){return ed(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):Fc(this._orient)?this._maxSize():t.height}_computeDx(t){return Fd(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return Fc(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){let e=this._specs[t];this._option.globalInstance.updateFullData(e.data),this.event.emit(dj.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}release(){this._option.globalInstance.off(dj.rendered,this.autoPlayCallback)}}Fp.builtInTheme={player:{visible:!0,position:"start",padding:{top:20,bottom:20}
30,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}}}}},Fp.specKey="player",Fp.type=hc.player;class Fg extends SL{constructor(t,e){super(t,e),this.type=hc.label,this.name=hc.label,this.layoutType="none",this.layoutZIndex=j.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){let{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;let{hover:s,select:r}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===r&&!1===r.enable||(i.select=!0),i}_compareSpec(t,e){let i=super._compareSpec(t,e);return i.reRender=!0,(0,ex.n)(e,t)||(i.reMake=!0),i}_getDataLabelType(t,e){let i=t.type;return"line"===i||"area"===i?null!=e?e:"line-data":"rect"===i?"rect":"arc"===i?"arc":"symbol"===i||"cell"===i?"symbol":t.setDataLabelType?t.setDataLabelType():""}_setTransformOfComponent(t,e){t.setAttributeTransform(({labelStyle:t,size:i,itemEncoder:s})=>{let r=i(),a=ug({type:"palette",key:"secondaryFontColor"},this.getColorScheme());return{dataLabels:oS(e).map((e,i)=>{let n=t(i),l=[],o=e.getGraphics();if(o)return n.data&&n.data.length?n.data.forEach((t,e)=>{if(o[e]){let e=s(t,{labelIndex:i});(0,eE.A)(e.fill)&&(e.fill=a),(0,eE.A)(e.data)&&(e.data=t),l.push(e)}}):o.forEach(t=>{let{data:e,diffState:r}=t.context;r!==W.exit&&e.forEach((t,{})=>{let e=s(t,{labelIndex:i});(0,eE.A)(e.fill)&&(e.fill=a),(0,eE.A)(e.data)&&(e.data=t),l.push(e)})}),(0,ew.A)(n.overlap)&&(0,eE.A)(n.overlap.size)&&(n.overlap.size=Object.assign({},r)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:e.getProductId(),getBaseMarks:()=>o},n),{type:this._getDataLabelType(e,n.type),data:l})}),size:r}})}getVRenderComponents(){let t=[];return this.getMarks().forEach(e=>{let i=e.getComponent();i&&t.push(i)}),t}clear(){super.clear(),this.getMarks().forEach(t=>{t&&t.clearComponent()})}}Fg.type=hc.label;class Ff extends Bu{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}render(){}}Ff.type="text",Ff.constructorType="label";let Fm=()=>{Bd(),uP.registerMark(Ff.constructorType,Ff)};class F_ extends SR{_initTheme(t,e){return{spec:t,theme:this._theme}}}var Fy=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Fv extends xN{constructor(t,e){const{dataLabels:i}=t,s=Fy(t,["dataLabels"]);super((null==e?void 0:e.skipDefault)?t:Object.assign({dataLabels:i},eB({},Fv.defaultAttributes,s))),this.name="data-label"}render(){var t;let{dataLabels:e,size:i}=this.attribute;if(!e||0===e.length)return;let{width:s=0,height:r=0,padding:a}=i||{};if(!s||!r||!eP(r*s))return;this._componentMap||(this._componentMap=new Map);let n=xe(s,r,a),l=n.bitmap(),o=new Map,h=this._componentMap;for(let s=0;s<e.length;s++){let r=e[s],a=xX(r.type)||xG;if(a){let{baseMarkGroupName:e,type:h}=r,u=null!=(t=r.id)?t:`${e}-${h}-${s}`;"arc"===r.type&&(r.width=i.width,r.height=i.height);let d=this._componentMap.get(u);d?(d.setBitmapTool(n),d.setBitmap(l),d.setAttributes(r)):((d=new a(r)).setBitmap(l),d.setBitmapTool(n),this.add(d)),o.set(u,d)}}
30h.forEach((t,e)=>{o.get(e)||this.removeChild(t)}),this._componentMap=o}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach(t=>{t.disableAnimation()})}enableAnimation(){this._componentMap.forEach(t=>{t.enableAnimation()})}}Fv.defaultAttributes={pickable:!1};class Fb extends Fg{constructor(t,e){super(t,e),this.type=hc.label,this.name=hc.label,this.specKey="label",this.transformerConstructor=F_,this.layoutZIndex=j.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){let i=[];return((null==e?void 0:e.region)||[]).forEach((s,r)=>{(s.seriesIndexes||[]).some(t=>{let{markLabelSpec:i={}}=e.series[t];return Object.values(i).some(t=>Array.isArray(t)&&t.some(t=>t.visible))})&&i.push({spec:t,type:hc.label,specInfoPath:["component",this.specKey,r],regionIndexes:[r]})}),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&(this._labelInfoMap.forEach(t=>{t.forEach(({labelMark:t})=>{t.release()})}),this._labelInfoMap.clear()),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}initEvent(){this.event.on(dj.dataZoomChange,()=>{this._labelComponentMap.forEach((t,e)=>{let i=e.getComponent();i&&i.disableAnimation()}),this.event.on(dH.AFTER_MARK_RENDER_END,t)});let t=()=>{this._labelComponentMap.forEach((t,e)=>{let i=e.getComponent();i&&i.enableAnimation()}),this.event.off(dH.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),x8(this._regions,t=>{let{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let r=0;r<i.length;r++){let a=i[r],n=t.getMarkInName(a);n&&e[a].forEach((e,i)=>{var r,l,o;if(e.visible){let h=this._labelInfoMap.get(s),u=this._createMark({type:"label",name:`${null!=(r=t.userId)?r:t.id}-${a}-label-${i}`},{attributeContext:t.getMarkAttributeContext()});e.showRelatedMarkTooltip&&(null==(o=null==(l=t.tooltipHelper)?void 0:l.activeTriggerSet.mark)||o.add(u)),u.setTarget(n),h.push({labelMark:u,baseMark:n,series:t,labelSpec:e})}})}})}_initLabelComponent(){let t={};this._labelComponentMap.forEach((e,i)=>{t[i.name]=i}),this._labelInfoMap.forEach((e,i)=>{if("region"===this._layoutRule){let s=!1,r=`${i.getGroupMark().name}-label-component`,a=t[r];a||(s=!0,a=this._createMark({type:"component",name:r},{componentType:"label"},{support3d:this._spec.support3d})),a&&(s&&(a.setSkipBeforeLayouted(!0),this._marks.addMark(a),e.forEach(t=>{var e;null==(e=t.baseMark.getData())||e.addRelatedMark(a)})),e[0]&&(0,eA.A)(e[0].labelSpec.zIndex)&&a.setMarkConfig({zIndex:e[0].labelSpec.zIndex}),this._labelComponentMap.set(a,()=>this._labelInfoMap.get(i)),t[r]=null)}else e.forEach((e,s)=>{var r;let a=!1,n=`${e.labelMark.name}-component`,l=t[n];l||(a=!0,l=this._createMark({type:"component",name:n},{componentType:"label",noSeparateStyle:!0},{support3d:e.baseMark.getMarkConfig().support3d})),l&&((0,eA.A)(e.labelSpec.zIndex)&&l.setMarkConfig({zIndex:e.labelSpec.zIndex}),a&&(l.setSkipBeforeLayouted(!0),this._marks.addMark(l),null==(r=e.baseMark.getData())||r.addRelatedMark(l)),this._labelComponentMap.set(l,()=>this._labelInfoMap.get(i)[s]),t[n]=null)})}),Object.keys(t).forEach(e=>{let i=t[e];i&&(i.release(),this._labelComponentMap.delete(i))})}_initTextMarkStyle(){this._labelComponentMap.forEach((t,e)=>{oS(t()).forEach(({labelMark:t})=>{t.setComponent(e)})}),this._labelInfoMap.forEach(t=>{t.forEach(t=>{var e,i;let{labelMark:s,labelSpec:r,series:a}=t;if(this.initMarkStyleWithSpec(s,r),(0,r3.A)(null==r?void 0:r.getStyleHandler)){let t=r.getStyleHandler(a);null==t||t.call(a,s,r)}(null==(i=null==(e=s.stateStyle)?void 0:e.normal)?void 0:i.lineWidth)&&s.setAttribute("stroke",a.getColorAttribute(),"normal",N.Base_Series)})})}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach((t,e)=>{let i=t();(0,ev.A)(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)})}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e,t.map(({baseMark:t})=>t),t)}_updateSingleLabelAttribute(t,e){let{baseMark:i}=t;this._updateLabelComponentAttribute(e,i,[t])}_updateLabelComponentAttribute(t,e,i){let s=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:t=>{var e,r;let a=i[t],{labelSpec:n,labelMark:l,series:o}=a,h=l.getRule(),u=this._interactiveConfig(n),d=null!=(r=null==(e=this._spec)?void 0:e.centerOffset)?r:0,c=uy({textStyle:Object.assign({pickable:!0===n.interactive},n.style),overlap:{avoidMarks:s.map(t=>t.getMarks()[0].getProductId())}},function(t,e){var i;let{labelSpec:s}=e;s.overlap&&!r2(s.overlap)&&(s.overlap={});let r=null!=(i=Oy[t])?i:Oy.point;return e.series.type===dD.sankey?function(t){var e,i,s,r;let{series:a,labelSpec:n={}}=t,l=null!=(e=Ob(n.position))?e:"outside",o=a.direction,h=l;return(0,eS.A)(l)&&("vertical"===o?h="inside-start"===l?t=>"inside-left":"inside-middle"===l?t=>
30"center":"inside-end"===l?t=>"inside-right":t=>"bottom":"inside-start"===l?h=t=>"inside-left":"inside-middle"===l?h=t=>"center":"inside-end"===l?h=t=>"inside-right":"outside"===l&&(h=t=>"right")),{position:h,overlap:!1!==n.overlap&&(!(0,eS.A)(l)||!l.includes("inside"))&&{strategy:null!=(s=null==(i=n.overlap)?void 0:i.strategy)?s:(r=a,[{type:"position",position:t=>"horizontal"===r.direction?["right","left"]:["bottom","top"]}])},smartInvert:!1,offset:0,syncState:!0}}(e):r(e)}(h,a),Object.assign(Object.assign(Object.assign({},(0,SD.A)(n,["position","style","state","type","stackDataFilterType","getStyleHandler"])),u),{centerOffset:d}),n.stackDataFilterType?{dataFilter:"min"===n.stackDataFilterType?t=>t.filter(t=>t.data[pD]):t=>t.filter(t=>t.data[pL])}:{});return o&&o.parseLabelStyle&&(c=o.parseLabelStyle(c,n,l)),"line"!==h&&"area"!==h||(c.type=h),c},size:()=>{var t;return Object.assign({padding:null==(t=i[0].labelSpec.overlap)?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:(t,{labelIndex:e})=>i[e]&&!i[e].labelMark.skipEncode?Ov(i[e],t,i[e].labelSpec.formatMethod,i[e].labelSpec.formatter):{data:t}}),this._setTransformOfComponent(t,e)}compileMarks(){this.getMarks().forEach(t=>{let e,i=this._labelComponentMap.get(t)();e=(0,ev.A)(i)?i[0].series.getRegion().getGroupMark().getProduct():i.series.getRegion().getGroupMark().getProduct(),t.compile({group:e})})}getLabelInfoByTextGraphic(t){let e,i=null==t?void 0:t.parent,s=null==i?void 0:i.parent;if(s){let t=s.getChildren().indexOf(i);this._labelComponentMap.forEach((i,r)=>{r.getComponent()===s&&(e=oS(i())[t])})}return e}}Fb.type=hc.label,Fb.specKey="label",Fb.transformerConstructor=F_;class Fx extends Fg{constructor(){super(...arguments),this.type=hc.totalLabel,this.name=hc.totalLabel,this.specKey="totalLabel",this.layoutZIndex=j.Label}static getSpecInfo(t,e){var i;let s=[];return null==(i=null==e?void 0:e.region)||i.forEach((t,i)=>{var r;null==(r=t.seriesIndexes)||r.forEach(t=>{let{spec:r}=e.series[t],a=r[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:hc.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;let e=this._getSeries();if(null==(t=e.getSpec().totalLabel)?void 0:t.visible){let t=e.getSeriesMark();if(t){let 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[pR]},"normal",N.Default);let e=this._getSeries();null==(t=e.initTotalLabelMarkStyle)||t.call(e,this._textMark)}_initLabelComponent(){var t;let e=this._getSeries(),i=this._createMark({type:"component",name:`${null!=(t=e.name)?t:e.type}-total-label-component`},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}updateLayoutAttribute(){super.updateLayoutAttribute();let t=this._getSeries();this._marks.forEach((e,i)=>{e.setMarkConfig({interactive:!1}),e.setSimpleStyle({labelStyle:()=>{var e,i;if(this._baseMark){let{offset:s,animation:r,overlap:a,position:n="top"}=this._spec,l=this._interactiveConfig(this._spec);return uy({textStyle:{pickable:!0===this._spec.interactive},position:function(t,e,i="top"){var s,r;let a,{direction:n}=t,l=+("horizontal"===n?null!=(s=t.getXAxisHelper())&&!!s.isInverse():null!=(r=t.getYAxisHelper())&&!!r.isInverse());switch(e){case"rect":case"symbol":a=("bottom"===i?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]})[n][l];break;default:a="top"}return a}(t,this._baseMark.type,n),x:0,y:0},null!=(i=null==(e=t.getTotalLabelComponentStyle)?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))?i:{},Object.assign({offset:s,animation:r,overlap:a,dataFilter:t=>t.filter(t=>"bottom"===n?t.data[pD]:t.data[pL])},l))}},size:()=>{var t;return Object.assign({padding:null==(t=this._spec.overlap)?void 0:t.padding},this._regions[0].getLayoutRect())},itemEncoder:e=>Ov({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod)}),this._setTransformOfComponent(e,this._baseMark)})}
30compileMarks(){this.getMarks().forEach(t=>{let e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})})}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}Fx.type=hc.totalLabel,Fx.builtInTheme={totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}}},Fx.specKey="totalLabel";let FS=(t,e)=>{let i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function FA(){Fk._animate=Dv}Dt(),kd(),kc(),gq(),L7(),bZ(),yR();class Fk extends Ds{markerAnimate(t){Fk._animate&&this._animationConfig&&Fk._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},Fk.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=DS,this.defaultExitAnimation=DA,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,r){return b6(Math.abs(s),Math.PI/2,.001)||b6(Math.abs(s),3*Math.PI/2,.001)?b9(t,s,r):b8(s)?DI[r]:DL[r]}setItemAttributes(t,e,i,s,r){var a,n;if(!t)return;let{autoRotate:l=!0,refX:o=0,refY:h=0,refAngle:u=0,style:d,position:c=et.middle}=e,{state:p}=this.attribute,g=(null==(a=this._line)?void 0:a.getEndAngle())||0,f=o*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=o*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===r){let r=s.x-i.x,a=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},d),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(l,r,a,g,null!=(n=e.position)?n:"end")),d.textStyle),state:{panel:eB({},_E,null==p?void 0:p.textBackground),text:eB({},_E,null==p?void 0:p.itemContent)}}))}else("richText"===r||"image"===r)&&(t.setAttributes({dx:this.getItemDx(t,c,d)+(d.dx||0),dy:this.getItemDy(t,c,d)+(d.dy||0)}),t.states=eB({},_E,null==p?void 0:p.itemContent));let _=b8(g)?g:g-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(m||0),angle:l&&_+u})}getItemDx(t,e,i){var s,r;let a=null!=(r=null==(s=null==t?void 0:t.AABBBounds)?void 0:s.width())?r:(null==i?void 0:i.width)||0;return e.includes("inside")?-a:0}getItemDy(t,e,i){var s,r;let a=null!=(r=null==(s=null==t?void 0:t.AABBBounds)?void 0:s.height())?r:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-a:e.includes("middle")||e.includes("Middle")?-a/2:0}initItem(t,e,i){let s,{state:r}=this.attribute,{type:a="text",style:n,renderCustomCallback:l}=t;return"symbol"===a?(s=lF.symbol(Object.assign(Object.assign({},i),n))).states=eB({},_E,null==r?void 0:r.itemContent):"text"===a?s=new km(Object.assign(Object.assign({},i),{state:{panel:eB({},_E,null==r?void 0:r.textBackground),text:eB({},_E,null==r?void 0:r.itemContent)}})):"richText"===a?(s=lF.richtext(Object.assign(Object.assign({},i),n))).states=eB({},_E,null==r?void 0:r.itemContent):"image"===a?(s=lF.image(Object.assign(Object.assign({},i),n))).states=eB({},_E,null==r?void 0:r.itemContent):"custom"===a&&l&&((s=l()).states=eB({},_E,null==r?void 0:r.itemContent)),s.name=`mark-point-${a}`,this.setItemAttributes(s,t,e,i,a),s}getItemLineAttr(t,e,i){let s=[],r={x:0,y:0},a=0,n=0,l=0,{type:o="type-s",arcRatio:h=.8}=t,u=i.x-e.x,d=i.y-e.y;if(this._isStraightLine=b6(u,0,.001)||b6(d,0,.001),this._isArcLine){let{x:t,y:e}=this.attribute.position,{x:s,y:o}=i,u=(t+s)/2,d=u+h*(o>e?-1:1)*u,c=(e===o?0:-(t-s)/(e-o))*(d-u)+(e+o)/2;n=FS(e-c,t-d),l=FS(o-c,s-d),r={x:d,y:c};let p=Math.sqrt((d-t)*(d-t)+(c-e)*(c-e)),g=this.attribute.targetSymbol.style.size/2;n+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?l<n&&(l+=2*Math.PI):n<l&&(n+=2*Math.PI),a=Math.sqrt((d-t)*(d-t)+(c-e)*(c-e))}else s="type-do"!==o||this._isStraightLine?"type-po"!==o||this._isStraightLine?"type-op"!==o||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return{points:s=function(t){let e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(s),center:r,radius:a,startAngle:n,endAngle:l}}reDrawLine(t,e){this._line.release();let{startSymbol:i,endSymbol:s,lineStyle:r,type:a="type-s"}=t,{state:n}=this.attribute,l=this._isArcLine?DZ:kp;this._container.removeChild(this._line),this._line=new l(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:s,lineStyle:r,visible:t.visible,state:{line:eB({},_E,null==n?void 0:n.line),startSymbol:eB({},_E,null==n?void 0:n.lineStartSymbol),endSymbol:eB({},_E,null==n?void 0:n.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){let{startSymbol:s,endSymbol:r,lineStyle:a,type:n="type-s"}=t,{state:l}=this.attribute,o=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},o),{startSymbol:s,endSymbol:r,lineStyle:a,visible:t.visible,state:{line:eB({},_E,null==l?void 0:l.line),startSymbol:eB({},_E,null==l?void 0:l.lineStartSymbol),endSymbol:eB({},_E,null==l?void 0:l.lineEndSymbol)}})):this.reDrawLine(t,o)}}getDecorativeLineAttr(t){var e;let i=(null==(e=null==t?void 0:t.decorativeLine)?void 0:e.length)||10,s=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(s-Math.PI/2),startPointOffsetY:i/2*Math.sin(s-Math.PI/2),endPointOffsetX:-i/2*Math.cos(s-Math.PI/2),endPointOffsetY:-i/2*Math.sin(s-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var s;if(this._decorativeLine){let{lineStyle:r}=t,{startPointOffsetX:a,startPointOffsetY:n,endPointOffsetX:l,endPointOffsetY:o}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+a,y:e.y+n},{x:e.x+l,y:e.y+o}]},r),{visible:i})),this._decorativeLine.states=eB({},_E,null==(s=this.attribute.state)?void 0:s.line)}}setTargetItemAttributes(t,e){var i,s;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!=(i=t.visible)&&i,size:t.size},t.style)),this._targetItem.states=eB({},_E,null==(s=this.attribute.state)?void 0:s.targetItem))}setAllOfItemsAttr(t,e){var i;let{position:s,itemLine:r={},itemContent:a={},limitRect:n,targetSymbol:l}=this.attribute,{type:o="text",confine:h}=a;if(n&&h){let{x:t,y:i,width:s,height:r}=n,{dx:a,dy:l}=De(this._item,{x1:t,y1:i,x2:t+s,y2:i+r});e.x=e.x+a,e.y=e.y+l}this.setTargetItemAttributes(l,s),this.setItemLineAttr(r,t,e),this.setItemAttributes(this._item,a,t,e,o),this.setDecorativeLineAttr(r,e,null==(i=r.decorativeLine)?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;let s,{itemContent:r={},targetSymbol:a,itemLine:n}=this.attribute,{offsetX:l=0,offsetY:o=0}=r,{offset:h=0,style:u,visible:d=!1,size:c}=a,p=d?null!=(i=null!=(e=u.size)?e:c)?i:20:0;return s="type-do"===n.type?FS(o,l/2):"type-po"===n.type?FS(0,l):"type-op"===n.type?FS(o,0):FS(o,l),{newPosition:{x:t.x+(p/2+h)*Math.cos(s),y:t.y+(p/2+h)*Math.sin(s)},newItemPosition:{x:t.x+(p/2+h)*Math.cos(s)+l,y:t.y+(p/2+h)*Math.sin(s)+o}}}initMarker(t){let{position:e,itemContent:i={},itemLine:s}
30=this.attribute,{type:r="type-s",arcRatio:a=.8}=s,{offsetX:n=0,offsetY:l=0}=i;this._isStraightLine=b6(n,0,.001)||b6(l,0,.001),this._isArcLine="type-arc"===r&&0!==a&&!this._isStraightLine;let{newPosition:o,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),u=new(this._isArcLine?DZ:kp)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});u.name="mark-point-line",this._line=u,t.add(u);let d=lF.line({points:[]});d.name="mark-point-decorativeLine",this._decorativeLine=d,t.add(d);let c=lF.symbol({});c.name="mark-point-targetItem",this._targetItem=c,t.add(this._targetItem);let p=this.initItem(i,o,h);this._item=p,t.add(p),this.setAllOfItemsAttr(o,h)}updateMarker(){let{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:s="text"}=e,{type:r="type-s",arcRatio:a=.8}=i,{offsetX:n=0,offsetY:l=0}=e;this._isStraightLine=b6(n,0,.001)||b6(l,0,.001);let o="type-arc"===r&&0!==a&&!this._isStraightLine,{newPosition:h,newItemPosition:u}=this.computeNewPositionAfterTargetItem(t);o!==this._isArcLine?(this._isArcLine=o,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=o,this.setItemAttributes(this._item,e,h,u,s),this.setAllOfItemsAttr(h,u)}isValidPoints(){let{position:t}=this.attribute;return!(!eP(t.x)||!eP(t.y))}}Fk.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};var FM=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Fw extends DW{constructor(){super(...arguments),this.specKey="markPoint",this.layoutZIndex=j.MarkPoint}static _getMarkerCoordinateType(t){let{doPolarProcess:e,doGeoProcess:i}=LK(t);return"polar"===t.coordinateType||e?"polar":"geo"===t.coordinateType||i?"geo":"cartesian"}_createMarkerComponent(){var t,e,i,s,r,a,n,l,o,h,u,d,c,p,g,f,m,_,y,v,b,x,S,A,k,M,w,T,C,B,E,P,O,R;let{itemContent:I={},itemLine:L={},targetSymbol:D={}}=this._spec,{type:F="text",text:z,symbol:H,image:j,richText:V,customMark:N,textStyle:W,symbolStyle:U,imageStyle:G,richTextStyle:Y,customMarkStyle:$,style:X={},state:K={}}=I,q=FM(I,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]),Z=null,J=null,Q={};"text"===F?(Z=null!=(t=null==z?void 0:z.state)?t:K,Q={dx:0,dy:0},J=LV(Object.assign(Object.assign({},z),{style:eB(Q,null!=(s=null!=(i=null!=(e=null==z?void 0:z.style)?e:null==z?void 0:z.textStyle)?i:W)?s:X)}),this._markerData,this._markAttributeContext)):"richText"===F?(Z=null!=(r=null==V?void 0:V.state)?r:K,J=LW(eB(Q={width:100,height:100},null!=(n=null!=(a=null==V?void 0:V.style)?a:Y)?n:X),this._markerData,this._markAttributeContext)):"symbol"===F?(Z=null!=(l=null==H?void 0:H.state)?l:K,J=SS(LW(eB(Q={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},null!=(h=null!=(o=null==H?void 0:H.style)?o:U)?h:X),this._markerData,this._markAttributeContext))):"image"===F?(Z=null!=(u=null==j?void 0:j.state)?u:K,J=LW(eB(Q={width:80,height:80},null!=(c=null!=(d=null==j?void 0:j.style)?d:G)?c:X),this._markerData,this._markAttributeContext)):"custom"===F&&(Z=null!=(p=null==N?void 0:N.state)?p:K,J=LW(null!=(f=null!=(g=null==N?void 0:N.style)?g:$)?f:X,this._markerData,this._markAttributeContext));let tt={zIndex:this.layoutZIndex,interactive:null==(m=this._spec.interactive)||m,hover:null==(_=this._spec.interactive)||_,select:null==(y=this._spec.interactive)||y,position:{x:0,y:0},clipInRange:null!=(v=this._spec.clip)&&v,itemContent:Object.assign(Object.assign({type:F,offsetX:LU(I.offsetX,this._relativeSeries.getRegion()),offsetY:LU(I.offsetX,this._relativeSeries.getRegion())},q),{style:LW(J,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!=(b=D.offset)?b:0,visible:null!=(x=D.visible)&&x,size:null!=(S=D.size)?S:20,style:LW(D.style,this._markerData,this._markAttributeContext)},state:{line:LN(null!=(k=null==(A=this._spec.itemLine.line)?void 0:A.state)?k:{},this._markerData,this._markAttributeContext),lineStartSymbol:LN(null!=(w=null==(M=this._spec.itemLine.startSymbol)?void 0:M.state)?
30w:{},this._markerData,this._markAttributeContext),lineEndSymbol:LN(null!=(C=null==(T=this._spec.itemLine.endSymbol)?void 0:T.state)?C:{},this._markerData,this._markAttributeContext),itemContent:LN(Z,this._markerData,this._markAttributeContext),textBackground:LN(null==(E=null==(B=this._spec.itemContent.text)?void 0:B.labelBackground)?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:LN(null!=(O=null==(P=this._spec.targetSymbol)?void 0:P.state)?O:{},this._markerData,this._markAttributeContext)},animation:null!=(R=this._spec.animation)&&R,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},{visible:te,line:ti={}}=L,ts=FM(L,["visible","line"]);return tt.itemLine=!1!==te?Object.assign(Object.assign({},ts),{visible:!0,lineStyle:SS(ti.style)}):{visible:!1},new Fk(tt)}_markerLayout(){var t,e,i,s,r;let a,n=this._spec,l=this._markerData,o=this._relativeSeries,{point:h}=this._computePointsAttr(),u=this._getRelativeDataView().latestData,d=l?l.latestData[0]&&l.latestData[0].latestData?l.latestData[0].latestData:l.latestData:u;if(n.clip||(null==(t=n.itemContent)?void 0:t.confine)){let{minX:t,maxX:e,minY:i,maxY:s}=Lj([o.getRegion()]);a={x:t,y:i,width:e-t,height:s-i}}if(this._markerComponent){let t=null!=(e=this._markerComponent.attribute)?e:{},n=null!=(s=null==(i=t.itemContent)?void 0:i.textStyle)?s:{};this._markerComponent.setAttributes({position:void 0===h?{x:null,y:null}:h,itemContent:Object.assign(Object.assign({},t.itemContent),{textStyle:Object.assign(Object.assign({},n),{text:(null==(r=this._spec.itemContent.text)?void 0:r.formatMethod)?this._spec.itemContent.text.formatMethod(d,u):n.text}),offsetX:LG(h,t.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:LG(h,t.itemContent.offsetY,this._relativeSeries.getRegion())}),limitRect:a,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){let t=this._spec,{doXYProcess:e,doPolarProcess:i,doGeoProcess:s}=LK(t);((0,eA.A)(t.coordinate)||e||i||s)&&this._initCommonDataView()}}Fw.specKey="markPoint";let FT={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}};class FC extends Fw{constructor(){super(...arguments),this.type=hc.markPoint,this.name=hc.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t,e,i;let s,r=this._spec,a=this._markerData,n=this._relativeSeries,l=(0,eA.A)(r.x)&&(0,eA.A)(r.y),o=(0,eA.A)(r.coordinate),h=(0,eA.A)(r.position),u=null!=(t=null==r?void 0:r.autoRange)&&t;return l?s=null==(i=null==(e=LR(a,n,n,n,u))?void 0:e[0])?void 0:i[0]:o?s=LD(a,n,u,r.coordinatesOffset)[0]:h&&(s=LH(r.position,n,r.regionRelative)[0]),{point:s}}_computeOptions(){let t,e=this._spec,{doXYProcess:i}=LK(e),s=(0,eA.A)(e.coordinate);return i?t=[this._processSpecByDims([{dim:"x",specValue:e.x},{dim:"y",specValue:e.y}])]:s&&(t=this._processSpecCoo(e)),{options:t}}}FC.type=hc.markPoint,FC.coordinateType="cartesian",FC.builtInTheme={markPoint:FT};class FB extends Fw{constructor(){super(...arguments),this.type=hc.polarMarkPoint,this.name=hc.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;let i=this._markerData,s=this._relativeSeries,r=LL(i,s,s,s,null!=(e=null==(t=this._spec)?void 0:t.autoRange)&&e)[0][0];return{point:iE({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},r.radius,r.angle)}}_computeOptions(){let t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}FB.type=hc.polarMarkPoint,FB.coordinateType="polar",FB.builtInTheme={polarMarkPoint:FT};class FE extends Fw{constructor(){super(...arguments),this.type=hc.geoMarkPoint,this.name=hc.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){let t,e=this._markerData,i=this._relativeSeries;return{point:(t=[],(e.latestData[0]&&e.latestData[0].latestData?e.latestData[0].latestData:e.latestData).forEac
30h(e=>{(0,eA.A)(e.areaName)&&t.push([{x:i.nameValueToPosition(e.areaName).x+i.getRegion().getLayoutStartPoint().x,y:i.nameValueToPosition(e.areaName).y+i.getRegion().getLayoutStartPoint().y}])}),t)[0][0]}}_computeOptions(){let t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}FE.type=hc.geoMarkPoint,FE.coordinateType="geo",FE.builtInTheme={geoMarkPoint:FT},(tJ=ea||(ea={})).drawStart="drawStart",tJ.drawEnd="drawEnd",tJ.drawing="drawing",tJ.moving="moving",tJ.moveStart="moveStart",tJ.moveEnd="moveEnd",tJ.brushActive="brushActive",tJ.brushClear="brushClear";let FP={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:["pointerup","pointerleave"],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:{minY:-1/0,maxY:1/0,minX:-1/0,maxX:1/0}},FO={debounce:u1,throttle:u2};p1(),A4();class FR extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},FR.defaultAttributes,t)),this.name="brush",this._activeBrushState=!1,this._activeDrawState=!1,this._cacheDrawPoints=[],this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._firstUpdate=!0,this._onBrushStart=t=>{if(!1===this.attribute.interactive||!1===this._beforeBrushEvent(t))return;let{updateTrigger:e=FP.updateTrigger,endTrigger:i=FP.endTrigger,brushMoved:s=!0}=this.attribute;oS(e).forEach(t=>this.stage.addEventListener(t,this._onBrushingWithDelay)),oS(i).forEach(t=>this.stage.addEventListener(t,this._onBrushEnd)),t.stopPropagation(),this._firstUpdate=!0,this._activeMoveState=s&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._startPos=this.eventPosToStagePos(t),this._cacheDrawPoints=[this._startPos]},this._onBrushing=t=>{!1!==this.attribute.interactive&&!1!==this._beforeBrushEvent(t)&&(this._outOfInteractiveRange(t)||(t.stopPropagation(),this._firstUpdate?(this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t),this._firstUpdate=!1):(this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:FO[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{!1!==this.attribute.interactive&&(this._releaseBrushUpdateEvents(),t.preventDefault(),this._activeDrawState&&this._drawEnd(t),this._activeMoveState&&this._moveEnd(t),this._activeDrawState=!1,this._activeMoveState=!1)},this._onBrushClear=t=>{!1!==this.attribute.interactive&&!1!==this._beforeBrushEvent(t)&&(t.preventDefault(),this._isEmptyMask()||(this._clearMask(),this._dispatchBrushEvent(ea.brushClear,t)),this._activeDrawState=!1,this._activeMoveState=!1)}}_bindBrushEvents(){if(this.releaseBrushEvents(),this.attribute.disableTriggerEvent)return;let{trigger:t=FP.trigger,resetTrigger:e=FP.resetTrigger}=this.attribute;oS(t).forEach(t=>this.stage.addEventListener(t,this._onBrushStart)),oS(e).forEach(t=>this.stage.addEventListener(t,this._onBrushClear))}_initDraw(t){if(!1===this.attribute.interactive)return;let{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints.push(i),"single"===e&&this._clearMask(),this._addBrushMask(),this._dispatchBrushEvent(ea.drawStart,t),this._activeBrushState=!1}_initMove(t){var e,i;if(!1===this.attribute.interactive)return;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!=(e=this._operatingMask.attribute.dx)?e:0,this._operatingMaskMoveDy=null!=(i=this._operatingMask.attribute.dy)?i:0;let{interactiveRange:s}=this.attribute,{minY:r=-1/0,maxY:a=1/0,minX:n=-1/0,maxX:l=1/0}=s,{x1:o,x2:h,y1:u,y2:d}=this._operatingMask.globalAABBBounds;this._operatingMaskMoveRangeX=[n-o,l-h],this._operatingMaskMoveRangeY=[r-u,a-d],this._operatingMask.setAttribute("pickable",!0),this._dispatchBrushEvent(ea.moveStart,t)}_drawing(t){var e;if(!1===this.attribute.interactive)return;let i=this.eventPosToStagePos(t),{brushType:s,sizeThreshold:r=5}=this.attribute,a=this._cacheDrawPoints.length;if(a>0){let t=null!=(e=this._cacheDrawPoints[this._cacheDrawPoints.length-1])?e:{};
30if(i.x===t.x&&i.y===t.y)return}"polygon"===s||a<=1?this._cacheDrawPoints.push(i):this._cacheDrawPoints[a-1]=i;let n=this._computeMaskPoints();this._operatingMask.setAttribute("points",n);let{x:l,y:o}=this._startPos,{x:h,y:u}=this.eventPosToStagePos(t);(Math.abs(h-l)>r||Math.abs(o-u)>r)&&(1!==Object.keys(this._brushMaskAABBBoundsDict).length||this._activeBrushState?this._dispatchBrushEvent(ea.drawing,t):(this._activeBrushState=!0,this._dispatchBrushEvent(ea.brushActive,t)))}_moving(t){if(!1===this.attribute.interactive)return;let 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;let s=i.x-e.x,r=i.y-e.y,a=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],s))+this._operatingMaskMoveDx,n=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],r))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:a,dy:n}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchBrushEvent(ea.moving,t)}_drawEnd(t){if(!1===this.attribute.interactive)return;let{removeOnClick:e=!0,sizeThreshold:i=5}=this.attribute;if(this._outOfInteractiveRange(t))this._isEmptyMask()||(this._clearMask(),this._dispatchBrushEvent(ea.brushClear,t));else{let{x:s,y:r}=this._startPos,{x:a,y:n}=this.eventPosToStagePos(t);1>=Math.abs(a-s)&&1>=Math.abs(n-r)&&e?this._isEmptyMask()||(this._clearMask(),this._dispatchBrushEvent(ea.brushClear,t)):Math.abs(a-s)<i&&Math.abs(r-n)<i?(delete this._brushMaskAABBBoundsDict[this._operatingMask.name],this._container.setAttributes({}),this._container.removeChild(this._operatingMask),this._isEmptyMask()&&this._dispatchBrushEvent(ea.brushClear,t)):(this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchBrushEvent(ea.drawEnd,t))}}_moveEnd(t){!1!==this.attribute.interactive&&(this._operatingMask&&this._operatingMask.setAttribute("pickable",!1),this._dispatchBrushEvent(ea.moveEnd,t))}render(){this._bindBrushEvents();let t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}releaseBrushEvents(){let{trigger:t=FP.trigger,resetTrigger:e=FP.resetTrigger}=this.attribute;oS(t).forEach(t=>this.stage.removeEventListener(t,this._onBrushStart)),oS(e).forEach(t=>this.stage.removeEventListener(t,this._onBrushClear)),this._releaseBrushUpdateEvents()}_releaseBrushUpdateEvents(){let{updateTrigger:t=FP.updateTrigger,endTrigger:e=FP.endTrigger}=this.attribute;oS(t).forEach(t=>this.stage.removeEventListener(t,this._onBrushingWithDelay)),oS(e).forEach(t=>this.stage.removeEventListener(t,this._onBrushEnd))}_computeMaskPoints(){let{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute,s=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return"rect"===t?[s,{x:r.x,y:s.y},r,{x:s.x,y:r.y}]:"x"===t?[{x:s.x,y:i[0]},{x:r.x,y:i[0]},{x:r.x,y:i[1]},{x:s.x,y:i[1]}]:"y"===t?[{x:e[0],y:s.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:s.y}]:ek(this._cacheDrawPoints)}_addBrushMask(){var t;let{brushStyle:e,hasMask:i}=this.attribute,s=lF.polygon(Object.assign(Object.assign({points:ek(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!=(t=e.opacity)?t:1:0}));s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_isPosInBrushMask(t){let e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t<i.length;t++){let{points:s=[],dx:r=0,dy:a=0}=i[t].attribute;if(rd(s.map(t=>({x:t.x+r,y:t.y+a})),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_outOfInteractiveRange(t){let{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:r=-1/0,maxX:a=1/0}=e,n=this.eventPosToStagePos(t);return n.x>a||n.x<r||n.y>s||n.y<i}_beforeBrushEvent(t){var e,i;return null==(i=(e=this.attribute).beforeBrushChange)?void 0:i.call(e,t)}_dispatchBrushEvent(t,e){this._dispatchEvent(t,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_clearMask(){this._brushMaskAABBBoundsDict={},this._container.removeAllChild(),this._operatingMask=null}
30_isEmptyMask(){return pJ(this._brushMaskAABBBoundsDict)||Object.keys(this._brushMaskAABBBoundsDict).every(t=>this._brushMaskAABBBoundsDict[t].empty())}}FR.defaultAttributes=FP;class FI extends SL{constructor(){super(...arguments),this.layoutType="none",this.type=hc.brush,this.name=hc.brush,this.specKey="brush",this.layoutZIndex=j.Brush,this._linkedSeries=[],this._itemMap={},this._linkedItemMap={},this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._cacheInteractiveRangeAttrs=[],this._releatedAxes=[],this._regionAxisMap={},this._axisDataZoomMap={},this._zoomRecord=[]}static getSpecInfo(t){return v2(t,this.specKey,this.type,t=>!1!==t.visible)}init(){let t=this._transformBrushedMarkAttr(this._spec.inBrush),e=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach(i=>{i.getActiveMarks().forEach(s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",N.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",N.Series))})})}_initNeedOperatedItem(){let t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach(i=>{let s=[];i.getSeries().forEach(r=>{(t&&oS(t).includes(r.userId.toString())||e&&oS(e).includes(r.getSpecIndex())||!e&&!t)&&s.push(...r.getMarksWithoutRoot()),this._itemMap[i.id]=s})}),this._linkedSeries.forEach(t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()})}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_bindRegions(){(0,eA.A)(this._spec.regionId)||(0,eA.A)(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(oS(this._spec.regionId),oS(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}_bindLinkedSeries(){((0,eA.A)(this._spec.brushLinkSeriesId)||(0,eA.A)(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(oS(this._spec.brushLinkSeriesId),oS(this._spec.brushLinkSeriesIndex)))}_initRegionAxisMap(){(0,eA.A)(this._spec.axisId)?oS(this._spec.axisId).forEach(t=>{this._releatedAxes.push(this._option.getComponentByUserId(t))}):(0,eA.A)(this._spec.axisIndex)?oS(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)})}initEvent(){}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach((t,e)=>{this._updateBrushComponent(t,e)});let i=super._compareSpec(t,e);return(0,ex.n)(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(){var t;super.onLayoutEnd(),!this._option.disableTriggerEvent&&(null==(t=this._spec.visible)||t)&&(this._brushComponents?this._relativeRegions.forEach((t,e)=>{this._updateBrushComponent(t,e)}):(this._brushComponents=[],this._relativeRegions.forEach((t,e)=>{this._createBrushComponent(t,e)})))}_updateBrushComponent(t,e){let i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild()}_shouldEnableInteractive(){return!1!==this.getOption().getCompiler().getOption().interactive}_createBrushComponent(t,e){var i,s;let r=this._getBrushInteractiveAttr(t),a=new FR(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:SS(null==(i=this._spec)?void 0:i.style)},r),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));a.id=null!=(s=this._spec.id)?s:`brush-${this.id}`,this.getContainer().add(a),this._brushComponents.push(a),this._cacheInteractiveRangeAttrs.push(r),a.addEventListener(ea.brushActive,i=>{this._initMarkBrushState(e,"outOfBrush"),this._emitEvent(dj.brushActive,t,i)}),a.addEventListener(ea.drawStart,e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(dj.brushStart,t,e)}),a.addEventListener(ea.moveStart,e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!0),this._setRegionMarkPickable(t,!0),this._emitEvent(dj.brushStart,t,e)}),a.addEventListener(ea.drawing,e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(dj.brushChange,t,e)}),a.addEventListener(ea.moving,e=>{this._setRegionMarkPickable(t,!1),this._handleBrushChange(t,e),this._emitEvent(dj.brushChange,t,e)}),a.addEventListener(ea.brushClear,i=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0),this._initMarkBrushState(e,""),this._emitEvent(dj.brushClear,t,i)}),a.addEventListener(ea.drawEnd,i=>{var s;this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);let{operateMask:r}=i.detail,{updateElementsState:a=!0}=this._spec;if(null==(s=this._spec)?void 0:s.onBrushEnd)!0===this._spec.onBrushEnd(i)?(this.clearGraphic(),this._initMarkBrushState(e,""),this._emitEvent(dj.brushClear,t,i)):(this._spec.onBrushEnd(i),this._emitEvent(dj.brushEnd,t,i));else{let e=this._extendDataInBrush(this._inBrushElementsMap);(this._spec.zoomWhenEmpty||!(e.length>0))&&a||this._setAxisAndDataZoom(r,t),this._emitEvent(dj.brushEnd,t,i)}}),a.addEventListener(ea.moveEnd,e=>{this._spec.disableDimensionHoverWhenBrushing&&this._option.globalInstance.disableDimensionHoverEvent(!1),this._setRegionMarkPickable(t,!0);let{operateMask:i}=e.detail,{updateElementsState:s=!0}=this._spec,r=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&r.length>0||s)&&this._setAxisAndDataZoom(i,t),this._emitEvent(dj.brushEnd,t,e)})}_getBrushInteractiveAttr(t){let e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,r=s+i.width,a=e.y,n=a+i.height;return{interactiveRange:{minY:a,maxY:n,minX:s,maxX:r},xRange:[s,r],yRange:[a,n],interactive:this._shouldEnableInteractive()}}_transformBrushedMarkAttr(t){let 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({},SS(t)),e)}_handleBrushChange(t,e){let{operateMask:i}=e.detail;this._operateMask=i;let{updateElementsState:s=!0}=this._spec;s&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}_extendDataInBrush(t){var e,i;let s=[];for(let r in t)for(let a in t[r])s.push(Object.assign({},null==(i=null==(e=t[r][a].context)?void 0:e.data)?void 0:i[0]));return s}_extendDatumOutOfBrush(t){var e,i;let s=[];for(let r in t)s.push(null==(i=null==(e=t[r].context)?void 0:e.data)?void 0:i[0]);return s}_emitEvent(t,e,i){var s;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},vchart:null==(s=this._option)?void 0:s.globalInstance,event:i})}_reconfigItem(t,e){var i,s,r;if(!(null==t?void 0:t.globalTransMatrix)||!(null==(i=null==t?void 0:t.attribute)?void 0:i.points))return;let a=null!=(r=null==(s=null==t?void 0:t.attribute)?void 0:s.points)?r:[],{a:n,b:l,c:o,d:h,e:u,f:d}=t.globalTransMatrix,c=a.map(t=>({x:n*t.x+o*t.y+u,y:l*t.x+h*t.y+d})),{markTypeFilter:p=[]}=this._spec;
30this._itemMap[e.id].forEach(e=>{if(p.includes(e.type))return;let i=e.getGraphics();i&&i.length&&i.forEach(i=>{var s,r,a;let n=e.id+"_"+i.context.key,l=this._isBrushContainItem(t.globalAABBBounds,c,i);(null==(s=this._outOfBrushElementsMap)?void 0:s[n])&&l?(i.addState("inBrush",!0),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][n]=i,delete this._outOfBrushElementsMap[n]):(null==(a=null==(r=this._inBrushElementsMap)?void 0:r[null==t?void 0:t.name])?void 0:a[n])&&!l&&(i.removeState("inBrush"),i.addState("outOfBrush",!0),this._outOfBrushElementsMap[n]=i,delete this._inBrushElementsMap[t.name][n])})})}_reconfigLinkedItem(t,e){var i;if(!(null==t?void 0:t.globalTransMatrix)||!(null==(i=null==t?void 0:t.attribute)?void 0:i.points))return;let s=e.getLayoutStartPoint(),r=e.getSeries().map(t=>t.id);this._linkedSeries.forEach(e=>{var i,a;if(!r.includes(e.id)){let r=e.getRegion().getLayoutStartPoint(),n=r.x-s.x,l=r.y-s.y,o=null!=(a=null==(i=null==t?void 0:t.attribute)?void 0:i.points)?a:[],{a:h,b:u,c:d,d:c,e:p,f:g}=t.globalTransMatrix,f=n||0,m=l||0,_=o.map(t=>({x:h*t.x+d*t.y+p+f,y:u*t.x+c*t.y+g+m}));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+f,t.globalAABBBounds.y1+m,t.globalAABBBounds.x2+f,t.globalAABBBounds.y2+m);let{markTypeFilter:y=[]}=this._spec;this._linkedItemMap[e.id].forEach(e=>{if(y.includes(e.type))return;let i=e.getGraphics();i&&i.length&&i.forEach(i=>{var s,r,a;let{key:n}=i.context,l=e.id+"_"+i.context.key;(null==(s=this._linkedOutOfBrushElementsMap)?void 0:s[l])&&this._isBrushContainItem(t.globalAABBBounds,_,i)?(i.addState("inBrush",!0),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][l]=i,delete this._linkedOutOfBrushElementsMap[l]):(null==(a=null==(r=this._linkedInBrushElementsMap)?void 0:r[null==t?void 0:t.name])?void 0:a[l])&&!this._isBrushContainItem(t.globalAABBBounds,_,i)&&(i.removeState("inBrush"),i.addState("outOfBrush",!0),this._linkedOutOfBrushElementsMap[l]=i)})})}})}_isBrushContainItem(t,e,i){if(["symbol","rect"].includes(i.type)){let{x1:t,x2:r,y1:a,y2:n}=null==i?void 0:i.globalAABBBounds;var s=[{x:t,y:a},{x:r,y:a},{x:r,y:n},{x:t,y:n}];for(let t=0;t<s.length;t++)if(rd(e,s[t].x,s[t].y)||t>0&&function(t,e,i,s,r){for(let a=0,n=r[r.length-1];a<r.length;a++){let l=r[a];if(iH([t,e],[i,s],[l.x,l.y],[n.x,n.y]))return!0;n=l}return!1}(s[t-1].x,s[t-1].y,s[t].x,s[t].y,e))return!0;return!1}return t.intersects(i.globalAABBBounds)}_initItemMap(t,e,i){let{markTypeFilter:s=[]}=this._spec;Object.entries(t).forEach(([t,r])=>{r.forEach(t=>{if(s.includes(t.type))return;let r=t.getGraphics();r&&r.length&&r.forEach(s=>{let r=t.id+"_"+s.context.key;s.removeState("inBrush"),s.removeState("outOfBrush"),i&&s.addState(i,!0),e[r]=s})})})}_initMarkBrushState(t,e){this._brushComponents.forEach((e,i)=>{i!==t&&e.children[0].removeAllChild()}),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._initItemMap(this._itemMap,this._outOfBrushElementsMap,e),this._initItemMap(this._linkedItemMap,this._linkedOutOfBrushElementsMap,e)}_setRegionMarkPickable(t,e){t.getGroupMark().getGraphics().forEach(t=>t.setAttribute("childrenPickable",e))}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){let s=t.AABBBounds;null==(i=this._regionAxisMap["region_"+e.id])||i.forEach(t=>{var i,r;let a="bottom"===t.layoutOrient||"top"===t.layoutOrient,n=null!=(i=this._spec.axisRangeExpand)?i:0,{x1:l,x2:o,y1:h,y2:u}=s,d=a?"x":"y",c=t.getScale().range(),p=null!=(r=t.scaleRangeFactor())?r:[0,1],g=oA(c)<c[0],f=(a?l:h)-e.getLayoutStartPoint()[d],m=(a?o:u)-e.getLayoutStartPoint()[d],_=g?Math.min(f,m):Math.max(f,m),y=g?Math.max(f,m):Math.min(f,m),v=(y-c[0])/(oA(c)-c[0])*(p[1]-p[0])+p[0],b=(_-c[0])/(oA(c)-c[0])*(p[1]-p[0])+p[0],x=this._stateClamp(v-n),S=this._stateClamp(b+n);if(this._axisDataZoomMap[t.id]){let e=this._axisDataZoomMap[t.id],i=g?1-x:x,s=g?1-S:S;e.setStartAndEnd(Math.min(i,s),Math.max(i,s),["percent","percent"]),this._zoomRecord.push({operateComponent:e,start:i,end:s,startValue:I5(i,e.stateScale,I8(e.relatedAxisComponent,e.isHorizontal)),endValue:I5(s,e.stateScale,I8(e.relatedAxisComponent,e.isHorizontal))})}else t.scaleRangeFactor([x,S]),t.effect.scaleUpdate(),this._zoomRecord.push({operateComponent:t,start:x,end:S,startValue:t.getScale().invert(y),endValue:t.getScale().invert(_)})})}}_getNeedClearVRenderComponents(){return this._brushComponents}clearGraphic(){this._brushComponents&&this._brushComponents.forEac
30h(t=>{t._container.incrementalClearChild()})}clear(){if(this._brushComponents){let t=this.getContainer();this._brushComponents.forEach((e,i)=>{this._initMarkBrushState(i,""),e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)}),this._brushComponents=null}}clearBrushStateAndMask(){this._relativeRegions.forEach((t,e)=>{this._initMarkBrushState(e,""),this._brushComponents[e].children[0].removeAllChild()})}}FI.type=hc.brush,FI.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},FI.specKey="brush";class FL extends SL{constructor(){super(...arguments),this.type=hc.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=j.CustomMark,this.layoutLevel=V.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.scale(e)}}}initMarks(){if(!this._spec)return;let t=null;if(this._spec.parent){let e=this.getChart().getAllMarks().find(t=>t.getUserId()===this._spec.parent);"group"===e.type&&(t=e)}this._createExtensionMark(this._spec,t,`${px.H}_series_${this.id}_extensionMark`,0)}_createExtensionMark(t,e,i,s=0){var r,a;let n=this._createMark({type:t.type,name:(0,eA.A)(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});
30if(n){if((0,eA.A)(t.id)&&n.setUserId(t.id),(null==(r=this._option.globalInstance)?void 0:r.isAnimationEnable())&&t.animation){let e=bb({},bx(t.type,t,this._markAttributeContext));n.setAnimationConfig(e)}if((0,eE.A)(e)?this._marks.addMark(n):e&&e.addMark(n),this.initMarkStyleWithSpec(n,t),"group"===t.type&&(i=`${i}_${s}`,null==(a=t.children)||a.forEach((t,e)=>{this._createExtensionMark(t,n,i,e)})),(0,eA.A)(t.dataId)||eP(t.dataIndex)){let e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(n.setDataView(e),e.target.addListener("change",()=>{n.getData().updateData()}))}}}initEvent(){}_compareSpec(t,e){let i=super._compareSpec(t,e);return(0,ex.n)(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}_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.scale(e)},getLayoutBounds:()=>{let{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new iZ).set(t,e,t+i,e+s)}}}_getLayoutRect(){let t=new iZ;return this.getMarks().forEach(e=>{let i=e.getProduct();i&&t.union(i.AABBBounds)}),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);let e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}getVRenderComponents(){let t=[],e=i=>{if(i&&"group"===i.type)i.getMarks().forEach(t=>{e(t)});else if("component"===i.type){let e=null==i?void 0:i.getComponent();e&&t.push(e)}};return this.getMarks().forEach(t=>{e(t)}),t}}FL.type=hc.customMark,FL.specKey="customMark";class FD{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=Array(this._col).fill(null),this._rowSize=Array(this._row).fill(null),this._colElements=Array(this._col).fill([]),this._rowElements=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)?e:1,t.row=null!=(i=t.row)?i:1,t.elements=null!=(s=t.elements)?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||(eP(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:(0,r3.A)(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))})}clearLayoutSize(){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=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}),this._rowSize.forEach(t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})}getItemGridInfo(t){var e;let i,s=this._elementMap.get(t);return s||((i=null==(e=this._gridInfo.elements)?void 0:e.find(e=>{var i;if("modelId"in e&&(0,eA.A)(e.modelId)){if((0,eA.A)(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&(0,eA.A)(e.modelKey)&&"modelIndex"in e&&(0,eA.A)(e.modelIndex)&&(null!=(i=t.model.specKey)?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1}))||(i={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,i),i)}getSizeFromGrid(t,e){var i;let s="col"===e?this._colSize:this._rowSize,r=0;for(let a=t[e];a<t[e]+(null!=(i=t[`${e}Span`])?i:1);a++)r+=s[a].value;return r}getSizeFromUser(t,e){var i,s;let r="col"===e?this._colSize:this._rowSize;if(!(null==(i=r[t[e]])?void 0:i.isUserSetting))return;let a=0;for(let i=t[e];i<t[e]+(null!=(s=t[`${e}Span`])?s:1);i++){if(!r[i].isUserSetting)return;a+=r[i].value}return a}setItemLayoutSizeToGrid(t,e){if(FF(t))e.colSpan&&e.colSpan>1||this._colSize[e.col].isUserSetting||(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||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){let e="col"===t?this._colSize:this._rowSize,i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height,s=[];e.forEach(t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)}),i<0&&console.warn(`layout content ${t}
30 size bigger than chart`),s.forEach(t=>t.value=i/s.length)}getItemPosition(t){let e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;t<e.col;t++)i.x+=this._colSize[t].value;for(let t=0;t<e.row;t++)i.y+=this._rowSize[t].value;return i.x+=t.layoutPaddingLeft+t.layoutOffsetX,i.y+=t.layoutPaddingTop+t.layoutOffsetY,i}getItemLayoutRect(t){var e,i;let s=this.getItemGridInfo(t);return{width:(null!=(e=this.getSizeFromGrid(s,"col"))?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!=(i=this.getSizeFromGrid(s,"row"))?i:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom}}layoutItems(t,e,i,s){this._chartLayoutRect=i,this._chartViewBox=s,this.clearLayoutSize(),e.sort((t,e)=>e.layoutLevel-t.layoutLevel);let r=e.filter(t=>"normal"===t.layoutType&&!1!==t.getModelVisible()),a=r.filter(t=>FF(t)),n=r.filter(t=>!FF(t));r.forEach(t=>{this.layoutOneItem(t,"user",!1)});let l=e.filter(t=>"region-relative"===t.layoutType),o=l.filter(t=>FF(t)),h=l.filter(t=>!FF(t));o.forEach(t=>this.layoutOneItem(t,"user",!1)),this.layoutGrid("col"),n.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)}),a.forEach(t=>this.layoutOneItem(t,"grid",!1)),o.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,r;let a="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),n="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),l=this.getItemGridInfo(t),o={width:(null!=(s=n(l,"col"))?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!=(r=a(l,"row"))?r:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(o);eP(h.width)||(h.width=o.width),eP(h.height)||(h.height=o.height),t.setLayoutRect("grid"!==e?h:o),this.setItemLayoutSizeToGrid(t,l)}}function FF(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}FD.type="grid";var Fz=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&0>e.indexOf(s)&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)0>e.indexOf(s[r])&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};let FH=new iJ;p1(),gD(),gq(),fh();let Fj="M -0.5 -0.5, L -0.5 0.5, L 0.5 -0.5, Z",FV="M -0.5 -0.5, L -0.5 0.5, L 0.5 0.5, Z",FN="M -0.5 -0.5, L 0.5 -0.5, L 0.5 0.5, Z",FW="M 0.5 -0.5, L 0.5 0.5, L -0.5 0.5, Z",FU={tl:Fj,tr:FN,bl:FV,br:FW,lt:Fj,lb:FV,rt:FN,rb:FW};class FG extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},FG.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,r,a,n,l,o;let{titleStyle:h={},position:u,contentStyle:d={},panel:c,logoSymbol:p,poptipAnchor:g="position",logoText:f,logoTextStyle:m={},triangleMode:_="default",space:y=4,minWidth:v=0,maxWidth:b=1/0,padding:x=4,maxWidthPercent:S,visible:A,state:k,dx:M=0,dy:w=0,positionBounds:T}=this.attribute,{title:C="",content:B=""}=this.attribute;C=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(C):C,B=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(B):B;let E=AN(x),P=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group");this.group=P;let O=b-E[1]-E[3],R=(0,eA.A)(C)&&!1!==A,I=Object.assign(Object.assign({text:(0,ev.A)(C)?C:[C],visible:R,wrap:!0},h),{x:E[3],y:E[0],maxLineWidth:O,textAlign:"left",textBaseline:"top"}),L=P.createOrUpdateChild("poptip-title",I,"text");pJ(null==k?void 0:k.title)||(L.states=k.title);let D=L.AABBBounds,F=D.height(),z=D.width(),H=F+y;R||(H=0);let j=(0,eA.A)(B)&&!1!==A,V=Object.assign(Object.assign({text:(0,ev.A)(B)?B:[B],visible:j,wrap:!0},d),{x:E[3],y:E[0]+H,maxLineWidth:O,textAlign:"left",textBaseline:"top"}),N=P.createOrUpdateChild("poptip-content",V,"text");pJ(null==k?void 0:k.content)||(N.states=k.content);let W=N.AABBBounds,U=W.height(),G=W.width();j&&(H+=U),this.titleShape=L,this.contentShape=N;let Y=im(z+E[1]+E[3],G+E[1]+E[3]);Y>b?Y=b:Y<v&&(Y=v);let $=E[0]+E[2]+H,{visible:X,square:K}=c,q=Fz(c,["visible","square"]);if(K){let t=im(Y,$);Y=t;let e=t-$;$=t,L.setAttributes({dy:e/2}),N.setAttributes({dy:e/2})}let Z=null!=(t=q.size)?t:12,J=(0,ev.A)(Z)?[Z[0]+(null!=(e=q.space)?e:0),Z[1]+(null!=(i=q.space)?i:0)]:Z+(null!=(s=q.space)?s:0),Q=null!=(r=q.lineWidth)?r:1,tt=this.stage?[null!=(a=this.stage.viewWidth)?a:this.stage.width,null!=(n=this.stage.viewHeight)?n:this.stage.height]:void 0;if(tt){let t=this.AABBBounds,e=Math.max(null!=(l=this.attribute.x)?l:t.x1,tt[0]-t.x1);if((e=Math.min(e-(((0,ev.A)(Z)?Z[0]:12)+3),e*S))<Y){Y=e;let t=E[1]+E[3];L.setAttribute("maxLineWidth",e-t),N.setAttribute("maxLineWidth",e-t),$=E[0]+E[2],R&&($+=L.AABBBounds.height()+y),$+=N.AABBBounds.height()}}let te="auto"===u||(0,ev.A)(u),ti=(0,ev.A)(u)?u:this.positionList,ts,tr=-1/0;for(let t=0;t<ti.length+1;t++){let e=te?ti[t===ti.length?ts:t]:u,i="arrow2Left",s=((0,ev.A)(Z)?Z[0]:Z)/4,r=0;"top"===e||"bottom"===e||"left"===e||"right"===e?i="arrow2Left":"concise"===_&&(i=FU[e],s=["tl","bl","rt","rb"].includes(e)?((0,ev.A)(Z)?Z[0]:Z)/2:-((0,ev.A)(Z)?Z[0]:Z)/2,r=["tl","tr","lb","rb"].includes(e)?-((0,ev.A)(Z)?Z[1]:Z)/2:((0,ev.A)(Z)?Z[1]:Z)/2);let{angle:a,offset:n}=this.getAngleAndOffset(e,Y,$,(0,ev.A)(J)?J:[J,J-Q],i),l,h={x:0,y:0};if("bounds"===g&&T&&(h=this.calculateAnchorPoint(e,T)),ey(X)){let t;l=P.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},q),{visible:X&&(j||R),x:s,y:r,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:i,angle:a,dx:n[0],dy:n[1]-(null!=(o=q.space)?o:0),size:Z,zIndex:9}),"symbol"),pJ(null==k?void 0:k.panel)||(l.states=k.panel),t=c.panelSymbolType?P.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},q),{visible:X&&(j||R),x:0,y:0,symbolType:"rect",size:[Y,$],zIndex:-8}),"symbol"):P.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},q),{visible:X&&(j||R),x:0,y:0,width:Y,height:$,zIndex:-8}),"rect"),pJ(null==k?void 0:k.panel)||(t.states=k.panel)}if(P.setAttributes({x:-n[0]+M+h.x,y:-n[1]+w+h.y,anchor:[s,r]}),p){let{size:t=12}=p,e=(0,ev.A)(t)?t:[t,t];"auto"===e[1]&&(e[1]=$),"auto"===e[0]&&(e[0]=$);let i=e[0];P.createOrUpdateChild("poptip-logo",Object.assign(Object.assign({},p),{x:0,y:$/2,visible:X&&(j||R),zIndex:10,size:e}),"symbol"),P.setAttributes({x:-n[0]+M+i/2,y:-n[1]+w}),f&&P.createOrUpdateChild("poptip-logo-text",Object.assign(Object.assign({},m),{x:0,y:$/2,visible:X&&(j||R),text:f,textAlign:"center",textBaseline:"middle",zIndex:10}),"text")}if(!tt)break;{FH.setValue(0,0,Y,$).transformWithMatrix(P.globalTransMatrix);let i=(new iZ).setValue(0,0,tt[0],tt[1]);
30if(te){if(function(t,e,i){if(!t||!e)return hf.NONE;let{x11:s,x12:r,y11:a,y12:n,x21:l,x22:o,y21:h,y22:u}=iN(t,e,i);return s>l&&r<o&&a>h&&n<u?hf.BBOX1:l>s&&o<r&&h>a&&u<n?hf.BBOX2:hf.NONE}(FH,i,!1))break;{let e=iV(FH,i,!1),s=(e.x2-e.x1)*(e.y2-e.y1);s>tr&&(tr=s,ts=t)}}if(["top","bottom","left","right"].includes(e)){let t="top"===e||"bottom"===e,s="left"===e||"right"===e,r=!1;if(t?r="top"===e&&FH.y1<0||"bottom"===e&&FH.y2>i.y2:s&&(r="left"===e&&FH.x1<0||"right"===e&&FH.x2>i.x2),!r){let e=0,r=((0,ev.A)(Z)?Z[1]:Z)/2;t?(FH.x1<0?e=-FH.x1:FH.x2>i.x2&&(e=i.x2-FH.x2),P.setAttribute("x",P.attribute.x+e),l.setAttribute("dx",i_(im(l.attribute.dx-e,r),FH.width()-r))):s&&(FH.y1<0?e=-FH.y1:FH.y2>i.y2&&(e=i.y2-FH.y2),P.setAttribute("y",P.attribute.y+e),l.setAttribute("dy",i_(im(l.attribute.dy-e,r),FH.height()-r)));break}}if(!te)break}}}calculateAnchorPoint(t,e){if(!e)return{x:0,y:0};let{x:i,y:s}=this.attribute,{x1:r,y1:a,x2:n,y2:l}=e,o=n-r,h=l-a;switch(t){case"top":case"tl":case"tr":return{x:r+o/2-i,y:a-s};case"bottom":case"bl":case"br":return{x:r+o/2-i,y:l-s};case"left":case"lt":case"lb":return{x:r-i,y:a+h/2-s};case"right":case"rt":case"rb":return{x:n-i,y:a+h/2-s};default:return{x:0,y:0}}}getAngleAndOffset(t,e,i,s,r){let a="arrow2Left"===r?s[1]/2:s[1];switch(t){case"tl":return{angle:"arrow2Left"===r?io/2*3:0,offset:"arrow2Left"===r?[e/4,i+a]:[0,i+a]};case"top":return{angle:io/2*3,offset:[e/2,i+a]};case"tr":return{angle:"arrow2Left"===r?io/2*3:0,offset:"arrow2Left"===r?[e/4*3,i+a]:[e,i+a]};case"rt":return{angle:0,offset:"arrow2Left"===r?[-a,i/5]:[-a,0]};case"right":return{angle:0,offset:[-a,i/2]};case"rb":return{angle:0,offset:"arrow2Left"===r?[-a,i/5*4]:[-a,i]};case"bl":return{angle:"arrow2Left"===r?io/2:0,offset:"arrow2Left"===r?[e/4,-a]:[0,-a]};case"bottom":return{angle:io/2,offset:[e/2,-a]};case"br":return{angle:"arrow2Left"===r?io/2:0,offset:"arrow2Left"===r?[e/4*3,-a]:[e,-a]};case"lt":return{angle:"arrow2Left"===r?io:0,offset:"arrow2Left"===r?[e+a,i/5]:[e+a,0]};case"left":return{angle:io,offset:[e+a,i/2]};case"lb":return{angle:"arrow2Left"===r?io:0,offset:"arrow2Left"===r?[e+a,i/5*4]:[e+a,i]}}}}FG.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"},panel:{},maxWidthPercent:.8,space:8,padding:10};let FY=class{render(t,e,i,s,r,a,n,l,o,h,u,d,c){var p,g,f;if(1===t._showPoptip){let{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;let s={};eB(s,FG.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(s):this.poptipComponent=new FG(s);let r=t.attribute.poptip||{};if("text"===t.type&&null==r.title&&null==r.content){let e={};f=r,eB(e,p0.poptip,f),(r=e).content=null!=(p=r.content)?p:t.attribute.text}let a=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1,poptipAnchor:"bounds"},r),{x:a.e,y:a.f,positionBounds:t.globalAABBBounds})),h.stage.tryInitInteractiveLayer();let n=h.stage.getLayer("_builtin_interactive");n&&n.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null==(g=this.poptipComponent.parent)||g.removeChild(this.poptipComponent),this.poptipComponent=null))}};FY=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n}([ej()],FY);var F$=function(t,e,i,s){var r,a=arguments.length,n=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(a<3?r(n):a>3?r(e,i,n):r(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};class FX{constructor(){this.activeEvent="onRegister",this._uid=eI.GenAutoIncrementId(),this.poptip=t=>{let 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;let{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){let{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let FK=class extends FX{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};FK=F$([ej()],FK);let Fq=class extends FX{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{let{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);let{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){let{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};Fq=F$([ej()],Fq);let FZ=new eL((t,e,i,s)=>{i(FY)||(t(FY).toSelf().inSingletonScope(),t(ol).toService(FY)),i(FK)||(t(FK).toSelf(),t(lH).toService(FK)),i(Fq)||(t(Fq).toSelf(),t(lH).toService(Fq))}),FJ="vchart-tooltip",FQ=`${FJ}-container`,F0=`${FJ}-title`,F1=`${FJ}-content-box`,F2={offsetX:10,offsetY:10},F3="99999999999999";function F5(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}let F4=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1,F8=t=>(0,eS.A)(t)&&""!==(null==t?void 0:t.trim())||ed(t)?F5(t):"",F6=(t,e)=>{let i;if((0,eA.A)(t)){if(ed(t))i=t;else if((0,r3.A)(t)){let s=t(e);ed(s)&&(i=s)}}return i}
30,F9={left:[-2,0],right:[2,0],top:[0,-2],bottom:[0,2],insideTop:[0,-1.5],insideBottom:[0,1.5],insideLeft:[-1.5,0],insideRight:[1.5,0],insideTopLeft:[-1.5,-1.5],insideTopRight:[1.5,-1.5],insideBottomLeft:[-1.5,1.5],insideBottomRight:[1.5,1.5],lt:[-2,-2],tl:[-2,-2],rt:[2,-2],tr:[2,-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]},F7=(t,e,i=2)=>{var s,r;return null!=(r=null==(s=F9[t])?void 0:s[+("x"!==e)])?r:i};class zt extends S_{constructor(){super(...arguments),this._visible=!0,this._isReleased=!1,this.showTooltip=(t,e,i)=>{let{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,r,a,n;if(this._isReleased)return 1;let l=t.event,{tooltipSpec:o,activeTooltipSpec:h,changePositionOnly:u}=t;if(!h)return 1;let d=h.activeType;if(h.handler)return null!=(r=null==(s=(i=h.handler).showTooltip)?void 0:s.call(i,d,e,t))?r:0;let c=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,u));h.position=c;let p=null!=(a=h.updatePosition)?a:null==(n=o[d])?void 0:n.updatePosition;p&&(h.position=p(h.position,e,t));let g=!1!==(null==h?void 0:h.visible);return e&&"pointerout"!==l.type&&h.visible&&(h.title||h.content)||(g=!1),this._updateTooltip(g,Object.assign(Object.assign({},t),{changePositionOnly:u})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,r,a,n,l,o,h,u,d;let c=this._chartOption.getRectByDimensionData,{tooltipSpec:p}=e,g={x:1/0,y:1/0};if(!p)return g;let f=e.event,{activeType:m,data:_}=t,y="dimension"===m?null==(r=null==(s=_[0])?void 0:s.data)?void 0:r[0]:null==_?void 0:_[0],{offsetX:v,offsetY:b}=this._option,x=p[m],S=v5(null==x?void 0:x.position,_,e),A=null!=(a=v5(null==x?void 0:x.positionMode,_,e))?a:"mark"===m?"mark":"pointer",{width:k=0,height:M=0}=null!=i?i:{},w="canvas"===p.renderMode,T=null==(n=null==e?void 0:e.chart)?void 0:n.getCanvasRect(),C=null!=(l=null==T?void 0:T.width)?l:500,B=null!=(o=null==T?void 0:T.height)?o:500,E=!1,P={width:0,height:0},O,R={x:0,y:0},I={x:0,y:0},L=1,D=1,F=hJ(this._env);if(F&&!p.confine?(P.width=window.innerWidth,P.height=window.innerHeight):(P.width=C,P.height=B),F&&!w){let t=this._getParentElement(p);I=null!=(u=null==(h=null==t?void 0:t.getBoundingClientRect)?void 0:h.call(t))?u:g;let e=null!=(d=this._compiler.getCanvas())?d:this._chartContainer;R={x:(O=null==e?void 0:e.getBoundingClientRect()).x-I.x,y:O.y-I.y},L=F4(e,O),D=F4(t,I)}let z=D/L,H={},j={x:S,y:S},V={x:["left","right"],y:["top","bottom"]},N=({orient:t,mode:i,offset:s},r)=>{var a;let n,l,o=e.model,h=null==o?void 0:o.getLayoutStartPoint(),u=null!=s?s:"x"===r?v:b;if("mark"===i){E=!0;let t=e.item,i=null==t?void 0:t.AABBBounds;i&&h&&(n=("x"===r?i.x1:i.y1)+h[r],l=("x"===r?i.x2:i.y2)+h[r])}else if(c&&"crosshair"===i&&"cartesian"===(null==(a=null==y?void 0:y.series)?void 0:a.coordinate)&&y.datum&&y.datum.length){E=!0;let t=c(y,h);t&&(n=t.start[r],l=t.end[r])}else j[r]=t;if(E){let e=V[r][0],i="x"===r?k:M;switch(F7(t,r)){case -2:H[e]=n-i*z-u;break;case -1.5:H[e]=n+u;break;case 0:H[e]=(n+l)/2-i*z/2;break;case -1:H[e]=(n+l)/2-i*z-u;break;case 1:H[e]=(n+l)/2+u;break;case 1.5:H[e]=l-i*z-u;break;case 2:H[e]=l+u}}},W=["x","y"];if(r2(S))if(r2(S)&&((0,eA.A)(S.left)||(0,eA.A)(S.right)||(0,eA.A)(S.top)||(0,eA.A)(S.bottom))){let{left:t,right:e,top:i,bottom:s}=S;H.left=F6(t,f),H.top=F6(i,f),H.right=F6(e,f),H.bottom=F6(s,f)}else r2(S)&&((0,eA.A)(S.x)||(0,eA.A)(S.y))&&W.forEach(t=>{let e=S[t];ed(e)||(0,r3.A)(e)?H[V[t][0]]=F6(e,f):N(e,t)});else(0,eA.A)(S)&&(N({orient:S,mode:A},"x"),N({orient:S,mode:A},"y"));let U={x:null,y:null};return W.forEach(t=>{var e;let i="x"===t?k:M,s="x"===t?C:B,r="x"===t?v:b,a=F7(j[t],t);if(eP(H[V[t][0]]))U[t]=H[V[t][0]];else if(eP(H[V[t][1]]))U[t]=s-i*z-H[V[t][1]];else{let e="x"===t?f.canvasX:f.canvasY;U[t]=a>0?e+r:0===a?e-i*z/2:e-i*z-r}U[t]*=L,F&&(U[t]+=R[t]),U[t]/=D;let n="x"===t?P.width:P.height,l=p.confine?-(I[t]-(null!=(e=null==O?void 0:O[t])?e:0)/L)/D:-I[t]/
30D,o=n/D+l-i;2!==a&&U[t]<l?E?U[t]=l:(U[t]+=0===a?r+i/2:2*r+i,U[t]>o&&(U[t]=o)):-2!==a&&U[t]>o&&(E?U[t]=o:(U[t]-=0===a?r+i/2:2*r+i,U[t]<l&&(U[t]=l)))}),U}}get env(){return this._env}onAdd(t){super.onAdd(t);let e=t.component;this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i,s;let r=null!=(e=null==(t=this._component)?void 0:t.getSpec())?e:{};r.handler?null==(s=(i=r.handler).release)||s.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}_getDefaultOption(){var t,e;let{offset:i}=this._component.getSpec();return i?{offsetX:null!=(t=i.x)?t:F2.offsetX,offsetY:null!=(e=i.y)?e:F2.offsetY}:F2}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}zt.specKey="tooltip";let ze=(t,e)=>(0,eA.A)(t)?(0,ev.A)(t)?t.map(t=>`${t}px`).join(" "):`${t}px`:null!=e?e:"initial",zi=(t={},e={})=>{var i,s;(0,eA.A)(t.fontFamily)&&(e.fontFamily=t.fontFamily);let r=null!=(i=t.fill)?i:t.fontColor;return(0,eA.A)(r)&&(e.color=r),(0,eA.A)(t.fontWeight)&&(e.fontWeight=t.fontWeight),(0,eA.A)(t.textAlign)&&(e.textAlign=t.textAlign),(0,eA.A)(t.fontSize)&&(e.fontSize=ze(t.fontSize)),(0,eA.A)(t.maxWidth)&&(e.maxWidth=ze(t.maxWidth)),t.multiLine||(0,eA.A)(t.maxWidth)&&!1!==t.multiLine?(e.whiteSpace="initial",e.wordBreak=null!=(s=t.wordBreak)?s:"break-word"):(e.wordBreak="normal",e.whiteSpace="nowrap"),e},zs=(t={})=>{let{lineHeight:e}=t;return t.fontSize?hU(e,t.fontSize):0};function zr(t,e){t&&t.style&&e&&Object.keys(e).forEach(i=>{t.style[i]=e[i]})}let za=t=>{uP.registerComponentPlugin(t.type,t)};class zn extends zt{getVisibility(){return!!this._rootDom&&"visible"===this._rootDom.style.visibility}setVisibility(t){t!==this.getVisibility()&&this._rootDom&&(this._rootDom.style.visibility=t?"visible":"hidden")}getRootDom(){return this._rootDom}constructor(){super(zn.type),this.type=MV.dom,this._tooltipContainer=null==hZ?void 0:hZ.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){let t=this._component.getSpec().parentElement;if(hZ&&t&&t.children&&t.children.length){for(let e=0;e<t.children.length;e++)if(t.children[e].classList.contains(FQ)){this._container=t.children[e];break}this._container||(this._container=hZ.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=F3,this._container.classList.add(FQ),t.appendChild(this._container))}}initRootDom(){var t;let e=this._component.getSpec(),i=document.createElement("div"),s=null==(t=this._chartOption)?void 0:t.getTheme("fontFamily");zr(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:F3,fontFamily:null!=s?s:uD.fontFamily,fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh",visibility:"hidden"},this._domStyle.panel)),i.classList.add(e.className),i.setAttribute("vchart-tooltip-id",`${this.id}`),this._container.appendChild(i),this._rootDom=i}_getTooltipBoxSize(t,e){var i;this._rootDom||this.initRootDom(),e||this._updateDomStringByCol(t),this._updateDomStyle("height",e);let s=null==(i=this._rootDom)?void 0:i.getBoundingClientRect();return{width:null==s?void 0:s.width,height:null==s?void 0:s.height}}_removeTooltip(){this._rootDom&&this._rootDom.parentNode&&(this._rootDom.parentNode.removeChild(this._rootDom),this._rootDom=null),this._container=null}_updateTooltip(t,e){var i,s;if(t&&this._rootDom){let{tooltipSpec:r,activeTooltipSpec:a}=e;e.changePositionOnly||(this._tooltipActual=a);let n=this._rootDom;if(n){let{x:l=0,y:o=0}=null!=(i=a.position)?i:{},h={x:l,y:o},u=this.getVisibility();r.updateElement&&(this._updatePosition(null!=(s=this._cacheCustomTooltipPosition)?s:{x:l,y:o}),r.updateElement(n,a,e),h=this._getActualTooltipPosition(a,e,{width:n.offsetWidth,height:n.offsetHeight}),this._cacheCustomTooltipPosition=h),!u&&t&&(this._rootDom.style.transition="none",this._updatePosition(h,!1),this._rootDom.getBoundingClientRect()),this._updatePosition(h)}this.setVisibility(t)}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){let t=this._component.getSpec();this._domStyle=((t={})=>{var e,i,s,r;let{style:a={},enterable:n,transitionDuration:l}=t,{panel:o={},titleLabel:h,shape:u,keyLabel:d,valueLabel:c,spaceRow:p,align:g}=a,{panelStyle:f,panelPadding:m}=(t=>{var e;let{backgroundColor:i,border:s,shadow:r,padding:a}=t,n={borderWidth:`${null!=(e=null==s?void 0:s.width)?e:0}px`},l=null;(null==s?void 0:s.color)&&(n.borderColor=s.color),i&&(n.backgroundColor=i),n.boxSh
30adow=r?`${r.x}px ${r.y}px ${r.blur}px ${r.spread}px ${r.color}`:"initial";let{radius:o}=null!=s?s:{};return(0,eA.A)(o)&&(n.borderRadius=eP(o)?`${o}px`:`${o}`),(0,eA.A)(a)&&(n.padding=ze(l=AN(a))),{panelStyle:n,panelPadding:l}})(o),_={marginTop:"0px",marginBottom:"0px"};f.pointerEvents=n?"auto":"none",l&&(f.transitionDuration=l?`${l}ms`:"initial",f.transitionProperty=l?"transform":"initial",f.transitionTimingFunction=l?"ease-out":"initial"),eP(p)&&(_.marginBottom=`${p}px`);let y={width:ze(null!=(e=null==u?void 0:u.size)?e:8)},v=zi(h),b=zi(d),x=zi(c),S="right"===g?"marginLeft":"marginRight";"right"===g&&(f.direction="rtl"),(0,eE.A)(v.textAlign)&&(v.textAlign="right"===g?"right":"left"),(0,eE.A)(b.textAlign)&&(b.textAlign="right"===g?"right":"left"),(0,eE.A)(x.textAlign)&&(x.textAlign="right"===g?"left":"right"),y[S]=ze(null!=(i=u.spacing)?i:8),b[S]=ze(null!=(s=d.spacing)?s:26),x[S]=ze(null!=(r=c.spacing)?r:0);let A=Math.max(zs(c),zs(d));return _.lineHeight=A>0?`${A}px`:"20px",{panelPadding:m,row:_,panel:f,title:v,shape:y,key:b,value:x}})(t)}_updateDomStringByCol(t){var e;let{title:i={},content:s}=t,r=s&&s.length,a=this._domStyle.row,n=[...this._rootDom.children],l=n.find(t=>t.className.includes(F0)),o=n.find(t=>t.className.includes(F1));if(!l&&!1!==i.visible){l=document.createElement("h2");let t=document.createElement("span");l.appendChild(t),l.classList.add(F0),this._rootDom.firstChild?this._rootDom.insertBefore(l,this._rootDom.firstChild):this._rootDom.appendChild(l)}l&&!1!==i.visible?(zr(l,Object.assign(Object.assign(Object.assign({},this._domStyle.title),r?a:{marginBottom:"0px"}),{marginTop:"0px"})),l.firstChild.innerHTML=`${null!=(e=i.value)?e:""}`):l&&!1===i.visible&&l.parentNode.removeChild(l);let h=["shape","key","value"];if(!o&&r&&(o=document.createElement("div"),h.forEach(t=>{let e=document.createElement("div");e.classList.add(`${FJ}-column`),e.classList.add(`${FJ}-${t}-column`),e.setAttribute("data-col",t),o.appendChild(e)}),o.classList.add(F1),this._rootDom.appendChild(o)),o&&r){let t=[...o.children];zr(o,{whiteSpace:"nowrap"}),t.forEach((t,e)=>{let i=t.getAttribute("data-col");if(i&&h.includes(i)){let e="shape"===i&&s.every(t=>!t.hasShape||!t.shapeType);zr(t,Object.assign(Object.assign({},this._domStyle[i]),{display:e?"none":"inline-block",verticalAlign:"top"}));let r=[...t.children];r.slice(s.length).forEach(t=>{t.parentNode.removeChild(t)}),s.forEach((e,n)=>{let l=r[n];l||((l=document.createElement("div")).classList.add(`${FJ}-${i}`),t.appendChild(l));let o=Object.assign({},a);n===s.length-1&&(o.marginBottom="0px"),o.display=!1===e.visible?"none":"block",o.height="initial","key"===i?(l.innerHTML=F8(e.key),e.keyStyle&&zi(e.keyStyle,o)):"value"===i?(l.innerHTML=F8(e.value),e.valueStyle&&zi(e.valueStyle,o)):"shape"===i&&(l.innerHTML=function(t,e){var i,s,r,a,n,l;let o,h;if(!t||!t.hasShape||!t.shapeType)return"";let u='style="display:inline-block;vertical-align:middle;"',{shapeType:d,shapeStroke:c,shapeHollow:p=!1,shapeFill:g}=t,f=null!=(i=t.shapeSize)?i:8,m=t.shapeLineWidth?F5(t.shapeLineWidth)+"px":"0px",_="currentColor",y=()=>c?F5(c):_,v=t=>new oq({symbolType:t,size:f,fill:!0}),b=v(d),x=b.getParsedPath();if(!x.path&&x.pathStr&&(b=v(x.pathStr)),b.getParsedPath().path){let t=b.getParsedPath().path;h=t.toString(),o=t.bounds}else x.isSvg&&x.svgCache&&(h=x.svgCache.map(t=>t.path.toString()).join(),o=x.svgCache.reduce((t,e)=>t.union(e.path.bounds),new iZ));let S=`${o.x1} ${o.y1} ${o.width()} ${o.height()}`;if("0px"!==m){let[t,e,i,s]=S.split(" ").map(t=>Number(t)),r=Number(m.slice(0,-2));S=`${t-r/2} ${e-r/2} ${i+r} ${s+r}`}let A=s5.IsGradientStr(g);if(!g||(0,eS.A)(g)&&!A||p)return _=p?"none":g?F5(g):"currentColor",` 31 <svg ${u} width="${f}" height="${f}" viewBox="${S}"> 32 <path 33 d="${h}" 34 style="fill: ${_}; stroke: ${y()}; stroke-width: ${m}" 35 > 36 </path> 37 </svg>`;let k=A?s5.Parse(g):r2(g)?g:null;if(k){_="gradientColor"+(null!=e?e:"");let t="",i=(null!=(s=k.stops)?s:[]).map(t=>`<stop offset="${F5(t.offset.toString())}" stop-color="${F5(t.color)}"/>`).join("");return"radial"===k.gradient?t=`<radialGradient id="${_}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%"> 38 ${i} 39 </radialGradient>`:"linear"===k.gradient&&(t=`<linearGradient id="${_}" x1="${100*(null!=(r=k.x0)?r:0)}%" y1="${100*(null!=(a=k.y0)?a:0)}%" x2="${100*(null!=(n=k.x1)?n:0)}%" y2="${100*(null!=(l=k.y1)?l:0)}%"> 40 ${i} 41 </linearGradient>`),` 42 <svg ${u} width="${f}" height="${f}
42" viewBox="-0.5 -0.5 1 1"> 43 ${t} 44 <path 45 d="${h}" 46 style="fill: url(#${_}); stroke: ${y()}; stroke-width: ${m}" 47 > 48 </path> 49 </svg>`}return""}(e,`${this.id}_${n}`)),zr(l,o)})}})}else o&&!r&&o.parentNode.removeChild(o)}_updateDomStyle(t="width",e){var i,s,r,a,n;let l=this._rootDom,o=[...l.children].find(t=>t.className.includes(F1)),h=[...l.children].find(t=>t.className.includes(F0));if(o){let l=this._component.getSpec(),u={},d=null==(i=l.style)?void 0:i.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&h){let e=[...o.children].reduce((e,i)=>"height"===t?e+i.getBoundingClientRect().width:Math.max(e,i.getBoundingClientRect().width),0);e>0&&(h.style.maxWidth=`${e}px`,h.style.maxWidth=`${Math.ceil(o.getBoundingClientRect().width)}px`)}if((0,eA.A)(null==(s=null==l?void 0:l.style)?void 0:s.maxContentHeight)){let t=h&&h.className.includes(F0)?h.getBoundingClientRect().height+(null!=(r=l.style.spaceRow)?r:0):0,e=this._chartOption.getChartViewRect(),i=hU(l.style.maxContentHeight,Math.min(e.height,document.body.clientHeight)-t-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));i>0&&(u.maxHeight=`${i}px`,u.overflowY="auto",u.width=`calc(100% + ${this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px"})`,zr(o,u))}let c=o.children,p=[];if(c){for(let i=0;i<c.length;i++){let s=null!=(a=c[i].children)?a:[];for(let i=0;i<s.length;i++){e&&(s[i].style[t]="initial");let r=s[i].getBoundingClientRect()[t];(void 0===p[i]||p[i]<r)&&(p[i]=r)}}for(let e=0;e<c.length;e++){let i=null!=(n=c[e].children)?n:[];for(let e=0;e<i.length;e++)i[e].style[t]=`${p[e]}px`}}}}_getParentElement(t){var e;return null!=(e=this._container)?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle(),this._rootDom&&zr(this._rootDom,this._domStyle.panel),this.getVisibility()&&(this._updateDomStringByCol(this._tooltipActual),this._updateDomStyle("height",!1))}_updatePosition({x:t,y:e},i=!0){this._rootDom&&(this._rootDom.style.transform=`translate3d(${t}px, ${e}px, 0)`,i&&""!==this._rootDom.style.transition&&(this._rootDom.style.transition="",Object.assign(this._rootDom.style,this._domStyle.panel)))}}zn.type=MV.dom;let zl=(t,...e)=>{let i=[t.shape,...e.map(t=>null==t?void 0:t.shape)],s=[t.key,...e.map(t=>null==t?void 0:t.key)],r=[t.value,...e.map(t=>null==t?void 0:t.value)];return eB(t,...e,{shape:i.every(eE.A)?void 0:eB({},...i),key:s.every(eE.A)?void 0:eB({},...s),value:r.every(eE.A)?void 0:eB({},...r)})},zo=t=>{let{width:e,height:i,wordBreak:s="break-word",textAlign:r,textBaseline:a,text:n}=t;return Array.isArray(n)?{width:e,height:i,wordBreak:s,textAlign:r,textBaseline:a,singleLine:!1,textConfig:oS(n).map(e=>Object.assign(Object.assign({},t),{text:e}))}:{width:e,height:i,wordBreak:s,textAlign:r,textBaseline:a,singleLine:!1,textConfig:null==n?void 0:n.text}},zh={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:_B,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:_B,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:_B,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new iJ).setValue(-1/0,-1/0,1/0,1/0),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},zu=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];p1(),fh(),gq(),gD(),xL();class zd extends xN{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:eB({},zd.defaultAttributes,t),e),this.name="tooltip"}render(){var t;let{visible:e,content:i,panel:s,keyWidth:r,valueWidth:a,hasContentShape:n,autoCalculatePosition:l,autoMeasure:o,align:h}=this.attribute;if(!e)return void this.hideAll();o&&zd.measureTooltip(this.attribute),l&&zd.calculateTooltipPosition(this.attribute);let u=AN(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:u[3],y:u[0]},"group");let d=zd.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",eB({symbolType:"circle"},d.shape,{visible:b4(d)&&b4(d.shape)}),"symbol"),"object"!=typeof d.value.text||null===d.value.text||"rich"!==d.value.text.type&&"html"!==d.value.text.type?d.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:b4(d)&&b4(d.value)},zo(d.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!=(t=d.value.text)?t:"",visible:b4(d)&&b4(d.value)},d.value),"text"):"rich"===d.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:b4(d)&&b4(d.value)},zo(d.value)),"richtext"):"html"===d.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:d.value.text.text},_P),d.value),visible:b4(d)&&b4(d.value),width:d.value.width,height:d.value.height,wordBreak:d.value.wordBreak,textAlign:d.value.textAlign,textBaseline:d.value.textBaseline,singleLine:!1,textConfig:[]},d.value),"richtext"));let c=b4(d.shape)?d.shape.size+d.shape.spacing:0,{textAlign:p,textBaseline:g}=d.value,f=s.width-u[3]-u[0]-c;"center"===p?this._tooltipTitle.setAttribute("x",c+f/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",c+f):this._tooltipTitle.setAttribute("x",c),"bottom"===g?this._tooltipTitle.setAttribute("y",d.height):"middle"===g?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);let m=b4(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",u[3]),this._tooltipContent.setAttribute("y",u[0]+m);let t=0;
49i.forEach((e,i)=>{let s=zd.getContentAttr(this.attribute,i);if(!b4(s))return;let l=`tooltip-content-${i}`,o=this._tooltipContent.createOrUpdateChild(l,{visible:!0,x:0,y:t},"group"),u=s.shape.size+s.shape.spacing,d="right"===h?(n?u:0)+(b4(s.key)?r+s.key.spacing:0)+(b4(s.value)?a:0):0;this._createShape("right"===h?d-s.shape.size/2:d+s.shape.size/2,s,o,l),n&&("right"===h?d-=u:d+=u);let c=this._createKey(s,o,l);c&&(_z(h,c,s.key.textAlign,d,r),c.setAttribute("y",0),"right"===h?d-=r+s.key.spacing:d+=r+s.key.spacing);let p=this._createValue(s,o,l);if(p){let t="right";(0,eA.A)(s.value.textAlign)?t=s.value.textAlign:b4(s.key)||"right"===h||(t="left"),p.setAttribute("textAlign",t),_z(h,p,t,d,a),p.setAttribute("y",0)}t+=s.height+s.spaceRow})}}_createShape(t,e,i,s){var r;if(b4(e.shape))return i.createOrUpdateChild(`${s}-shape`,Object.assign({visible:!0,x:t,y:e.shape.size/2+((null!=(r=au(e.key.lineHeight,e.key.fontSize))?r:e.key.fontSize)-e.shape.size)/2},e.shape),"symbol")}_createKey(t,e,i){var s;if(b4(t.key))return t.key.multiLine?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0},zo(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)?s:""},t.key),{textBaseline:"top"}),"text"):"rich"===t.key.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},zo(t.key)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign(Object.assign({dom:t.key.text.text},_P),t.key)},"richtext")}_createValue(t,e,i){var s;if(b4(t.value))return t.value.multiLine?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},zo(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)?s:""},t.value),{textBaseline:"top"}),"text"):"rich"===t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},zo(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")}setAttributes(t,e){let i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every(t=>zu.includes(t))?(this._mergeAttributes(t,i),(0,eE.A)(this.attribute.panel.width)&&this.attribute.autoMeasure&&zd.measureTooltip(this.attribute),zd.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){let{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:r,pointerX:a,pointerY:n,positionX:l,positionY:o,parentBounds:h}=t,u=a,d=n;return"left"===l?u-=e+s:"center"===l?u-=e/2:u+=s,"top"===o?d-=i+r:"middle"===o?d-=i/2:d+=r,u+e>h.x2&&(u-=e+s),d+i>h.y2&&(d-=i+r),u<h.x1&&(u=h.x1),d<h.y1&&(d=h.y1),t.x=u,t.y=d,t}static measureTooltip(t){let{content:e,contentStyle:i}=t,s=AN(t.padding),r=zd.getTitleAttr(t),a=0,n=s[0]+s[2],l=0,{value:o,shape:h}=r,{visible:u=!1,symbolType:d=""}=null!=h?h:{};if((0,eA.A)(o)&&"object"!=typeof r.value.text){let{width:t,height:e}=_R(o).quickMeasure(o.text);a=t,l=e}if(u&&ne[d]&&(a+=h.size+h.spacing,l=Math.max(h.size,l)),t.title&&(t.title.width=a,t.title.height=l),b4(r)&&(n+=l+r.spaceRow),e&&e.length){let s=[];if(e.forEach((e,i)=>{let r=zd.getContentAttr(t,i);(e.key||e.value)&&b4(r)&&s.push([e,r])}),s.length){let r=!1,l=[],o=[],h=[];s.forEach(([t,e],a)=>{var u;let{key:d,value:c,shape:p,spaceRow:g}=e,f=b4(p),m=null!=(u=null==p?void 0:p.symbolType)?u:"",_=_R(d),y=_R(c),v=0;if(b4(d)){let{width:t,height:e}=_.quickMeasure(d.text);o.push(t),v=Math.max(v,e)}if(b4(c)){let{width:t,height:e}=y.quickMeasure(c.text);h.push(t),v=Math.max(v,e)}f&&ne[m]&&(r=!0,l.push(p.size),v=Math.max(p.size,v)),t.height=v,n+=v,a<s.length-1&&(n+=null!=g?g:i.spaceRow)});let u=l.length?Math.max(...l):0,d=o.length?Math.max(...o):0,c=h.length?Math.max(...h):0;a=Math.max(d+c+i.key.spacing+i.value.spacing+(r?u+i.shape.spacing:0),a),e.forEach(t=>{t.width=a}),t.hasContentShape=r,t.keyWidth=d,t.valueWidth=c}}return t.panel.width=a+s[1]+s[3],t.panel.height=n,t}static getTitleAttr(t){return zl({},zd.defaultAttributes.titleStyle,zd.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return zl({},zd.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}zd.defaultAttributes=zh;let zc={fontFamily:uD.fontFamily,spacing:10,wordBreak:"break-word"},zp=(t,e)=>{var i,s;let r,a;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),a=(r=e.multiLine?(r=t.split("\n")).map((t,e)=>e<r.length-1?t+"\n":t):[t]).map(t=>Object.assign(Object.assign({},e),{text:t}))):(a=t.text,r=t);let n=(s={wordBreak:null!=(i=e.wordBreak)?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:a},d||(d=lF.CreateGraphic("richtext",{})),d.setAttributes(s),d.AABBBounds);return{width:n.width(),height:n.height(),text:r}};function zg(t={},e,i){var s,r;return Object.assign(Object.assign({},null!=i?i:zc),{fill:null!=(s=t.fill)?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!=(r=t.fontFamily)?r:e,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:(0,eA.A)(t.maxWidth)?!1!==t.multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}class zf extends zt{constructor(){super(zf.type),this.type=MV.canvas,this._attributes=null}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null==(e=this._chartOption.modeParams)?void 0:e.tooltipCanvasId}_initTooltipComponent(t){let e=this._getLayer(t);this._tooltipComponent=new zd({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);let e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_getTooltipBoxSize(t,e){var i,s;if(!e||(0,eE.A)(this._attributes)){let e=null==(i=this._chartOption)?void 0:i.getTheme("fontFamily");
49this._attributes=((t,e,i)=>{var s,r,a,n,l;let{style:o={},enterable:h,transitionDuration:u}=e,{panel:d={},titleLabel:c,shape:p,keyLabel:g,valueLabel:f,spaceRow:m,align:_}=o,y=AN(d.padding),v=hY(d.padding),b=zg(Object.assign({textAlign:"right"===_?"right":"left"},c),i),x=zg(Object.assign({textAlign:"right"===_?"right":"left"},g),i),S=zg(f,i),A={fill:!0,size:null!=(s=null==p?void 0:p.size)?s:8,spacing:null!=(r=null==p?void 0:p.spacing)?r:6},k={panel:(t=>{var e;let{backgroundColor:i,border:s,shadow:r}=t,a={lineWidth:null!=(e=null==s?void 0:s.width)?e:0,shadow:!!r};(null==s?void 0:s.color)&&(a.stroke=s.color),i&&(a.fill=i),r&&(a.shadowColor=r.color,a.shadowBlur=r.blur,a.shadowOffsetX=r.x,a.shadowOffsetY=r.y,a.shadowSpread=r.spread);let{radius:n}=null!=s?s:{};return(0,eA.A)(n)&&(a.cornerRadius=[n,n,n,n]),a})(d),padding:y,title:{},content:[],titleStyle:{value:b,spaceRow:m},contentStyle:{shape:A,key:x,value:S,spaceRow:m},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:u,align:_},{title:M={},content:w=[]}=t,T=v.left+v.right,C=v.top+v.bottom,B=0,E=!!w.length,P=0,O=0,R=0,I=0;if(E){let t=[],e=[],i=[],s=[],r=0;k.content=w.map((a,n)=>{let l=0,{hasShape:o,key:h,shapeType:u="",shapeFill:d,shapeStroke:c,shapeLineWidth:p,shapeSize:g,value:f,isKeyAdaptive:_,spaceRow:y,keyStyle:v,valueStyle:b,shapeHollow:k}=a,M={height:0,spaceRow:null!=y?y:m};if((0,eA.A)(h)){let i=uy({},x,zg(v,void 0,{})),{width:s,height:r,text:a}=zp(h,i);M.key=Object.assign(Object.assign({width:s,height:r},i),{text:a}),_?e.push(s):t.push(s),l=Math.max(l,r)}if((0,eA.A)(f)){let t=uy({},S,zg(b,void 0,{})),{width:e,height:s,text:r}=zp(f,t);M.value=Object.assign(Object.assign({width:e,height:s},t),{text:r}),i.push(e),l=Math.max(l,s)}if(o){let t={visible:!0,symbolType:u};k?t.stroke=d:t.fill=d,t.stroke=null!=c?c:d,t.lineWidth=p,M.shape=t;let e=null!=g?g:A.size;l=Math.max(e,l),s.push(e)}else M.shape={visible:!1};return M.height=l,r+=l,n<w.length-1&&(r+=M.spaceRow),M}),C+=r,P=t.length?ok(t):0,O=e.length?ok(e):0,R=i.length?ok(i):0,B=Math.max((I=s.length?ok(s)+A.spacing:0)+P+x.spacing+R+S.spacing,I+O,B),k.hasContentShape=!!s.length,k.keyWidth=P,k.valueWidth=R}let L=0,D=0,F=0,{visible:z=!0,value:H="",valueStyle:j,spaceRow:V}=M;k.title.visible=z,k.title.spaceRow=null!=V?V:m;let N={},W=()=>N.autoWidth&&!1!==N.multiLine;if(z){N=uy({},b,zg(j,void 0,{})),W()&&(N.multiLine=null==(a=N.multiLine)||a,N.maxWidth=null!=(n=N.maxWidth)?n:E?Math.ceil(B):void 0);let{text:t,width:e,height:i}=zp(H,N);k.title.value=Object.assign(Object.assign({width:W()?Math.min(e,null!=(l=N.maxWidth)?l:Number.MAX_VALUE):e,height:i},N),{text:t}),L=k.title.value.width,F=(D=k.title.value.height)+(E?k.title.spaceRow:0)}return C+=F,k.title.width=L,k.title.height=D,W()?T+=B||L:T+=Math.max(L,B),E&&k.content.forEach(t=>{var e;let i=t.value;i&&(null==(e=i.autoWidth)||e)&&(i.width=T-v.left-v.right-I-P-x.spacing-S.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),k.valueWidth=Math.max(k.valueWidth,i.width))}),k.panel.width=T,k.panel.height=C,k})(t,this._component.getSpec(),e)}let{panel:r}=null!=(s=this._attributes)?s:{};return{width:r.width+r.lineWidth,height:r.height+r.lineWidth}}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;let 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);let{activeTooltipSpec:s}=e,r=s.position;e.changePositionOnly?(0,eA.A)(r)&&this._tooltipComponent.setAttributes(r):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),r)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null==(t=this._tooltipComponent)?void 0:t.attribute.visibleAll}release(){var t;super.release(),null==(t=this._layer)||t.release()}}function zm(t,e){let i=e?t.toExponential(e-1):t.toExponential(),s=i.indexOf("e");if(s<0)return null;let r=i.slice(0,s);return[r.length>1?r[0]+r.slice(2):r,+i.slice(s+1)]}function z_(t,e){let i=zm(t,e);if(!i)return t+"";let s=i[0],r=i[1];return r<0?"0."+Array(-r).join("0")+s:s.length>r+1?s.slice(0,r+1)+"."+s.slice(r+1):s+Array(r-s.length+2).join("0")}zf.type=MV.canvas;class zy{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.
49width,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}}let zv=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zb(t){let e;if(e=zv.exec(t))return new zy({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]});eg.getInstance().error("invalid format: "+t)}let zx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class zS{constructor(){this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:function(t,e){return function(i,s){let r=i.length,a=[],n=0,l=t[0],o=0;for(;r>0&&l>0&&(o+l+1>s&&(l=Math.max(1,s-o)),a.push(i.substring(r-=l,r+l)),!((o+=l+1)>s));)l=t[n=(n+1)%t.length];return a.reverse().join(e)}}([...this.locale.grouping].map(Number),`${this.locale.thousands}`),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:function(t){return function(e){return e.replace(/[0-9]/g,e=>t[+e])}}([...this.locale.numerals].map(String)),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 zS.instance||(zS.instance=new zS),zS.instance}newFormat(t){let e=zb(t),i=e.fill,s=e.align,r=e.sign,a=e.symbol,n=e.zero,l=e.width,o=e.comma,h=e.precision,u=e.trim,d=e.type;"n"===d?(o=!0,d="g"):zA[d]||(void 0===h&&(h=12),u=!0,d="g"),(n||"0"===i&&"="===s)&&(n=!0,i="0",s="=");let p="$"===a?this.currencyPrefix:"#"===a&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",g="$"===a?this.currencySuffix:/[%p]/.test(d)?this.percent:"",f=zA[d],m=/[defgprstz%]/.test(d);h=void 0===h?6:/[gprs]/.test(d)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h));
49let{nan:_,minus:y,decimal:v,group:b,numerals:x}=this;function S(t){let e,a,S,A=p,k=g,M=t;if("c"===d)k=f(M)+k,M="";else{let t=(M*=1)<0||1/M<0;if(M=isNaN(M)?_:f(Math.abs(M),h),u&&(M=function(t){let e=t.length,i,s=-1;t:for(let r=1;r<e;++r)switch(t[r]){case".":s=i=r;break;case"0":0===s&&(s=r),i=r;break;default:if(!+t[r])break t;s>0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(M)),t&&0==+M&&"+"!==r&&(t=!1),A=(t?"("===r?r:y:"-"===r||"("===r?"":r)+A,k=("s"===d?zx[8+c/3]:"")+k+(t&&"("===r?")":""),m){for(e=-1,a=M.length;++e<a;)if(48>(S=M.charCodeAt(e))||S>57){k=(46===S?v+M.slice(e+1):M.slice(e))+k,M=M.slice(0,e);break}}}o&&!n&&(M=b(M,1/0));let w=A.length+M.length+k.length,T=w<l?Array(l-w+1).join(i):"";switch(o&&n&&(M=b(T+M,T.length?l-k.length:1/0),T=""),s){case"<":M=A+M+k+T;break;case"=":M=A+T+M+k;break;case"^":M=T.slice(0,w=T.length>>1)+A+M+k+T.slice(w);break;default:M=T+A+M+k}return x(M)}return S.toString=function(){return t+""},S}_formatPrefix(t,e){let i,s=zb(t);s.type="f";let r=this.newFormat(s.toString()),a=3*Math.max(-8,Math.min(8,Math.floor(((i=zm(Math.abs(e)))?i[1]:NaN)/3))),n=Math.pow(10,-a),l=zx[8+a/3];return function(t){return r(n*t)+l}}}let zA={"%":(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)=>z_(100*t,e),r:z_,s:function(t,e){let i=zm(t,e);if(!i)return t+"";let s=i[0],r=i[1],a=r-(c=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,n=s.length;return a===n?s:a>n?s+Array(a-n+1).join("0"):a>0?s.slice(0,a)+"."+s.slice(a):"0."+Array(1-a).join("0")+zm(t,Math.max(0,e+a-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)},zk=/\{([^}]+)\}/,zM=/\{([^}]+)\}/g,zw=/:/;class zT extends S_{constructor(){super(zT.type),this.type="formatterPlugin",this._timeModeFormat={utc:vQ.getInstance().timeUTCFormat,local:vQ.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=zS.getInstance().format,this._numericSpecifier=zS.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;let{globalInstance:s}=t;if(!s)return;this._spec=null!=(i=null==e?void 0:e[zT.specKey])?i:{};let{timeMode:r,customFormatter:a,numericFormatter:n,timeFormatter:l}=this._spec;(0,r3.A)(a)?this._formatter=a:(this._formatter=this._format.bind(this),(0,r3.A)(l)?this._timeFormatter=l:r&&this._timeModeFormat[r]&&(this._timeFormatter=this._timeModeFormat[r]),n&&(this._numericFormatter=n,this._numericSpecifier=null,this._numericFormatterCache=null)),uP.registerFormatter(this._formatter)}_format(t,e,i){return(0,ev.A)(t)?t.map((t,s)=>{let r=(0,ev.A)(i)?i[s]:i;return r?this._formatSingleLine(t,e,r):t}):(0,ev.A)(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=zk.test(i),this._isNumericFormatterCache.set(i,s))),s)?i.replace(zM,(t,i)=>{if(!zw.test(i)){let s=e[i.trim()];return void 0!==s?s:t}let s=i.split(":"),r=e[s.shift()],a=s.join(":");return this._formatSingleText(r,a)}):this._formatSingleText(t,i)}_formatSingleText(t,e){if(zv.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):e.startsWith("calc(")?this._calcFormatter(e,t):t}_calcFormatter(t,e){try{let i=t.slice(5,-1).replace(/v/g,String(e));return this._calculateMathExpression(i,e)}catch(t){return e}}_calculateMathExpression(t,e){let i=t.replace(/\s+/g,"");if(!this._isValidMathExpression(i))return e;try{let t=Function("return ("+i+")")();if("number"!=typeof t||isNaN(t)||!isFinite(t))throw Error("Invalid calculation result");return t}catch(t){return e}}_isValidMathExpression(t){return/^[0-9+\-*/().]+$/.test(t)}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}zT.pluginType="chart",zT.specKey="formatter",zT.type="formatterPlugin";let zC={state:U.STATE_ACTIVE,trigger:"pointerover",triggerOff:"pointerout"};class zB extends vB{constructor(t){super(t),this.type="element-active",this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{this.reset(t.item)},this.options=Object.assign({},zC,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(t){let{state:e,interaction:i}=this.options;this.isGraphicInStateMark(t,e)&&(t.addState(e,!0),i.setStatedGraphics(this,[t]))}}reset(t){let{interaction:e,state:i}=this.options,s=e.getStatedGraphics(this),r=null!=t?t:null==s?void 0:s[0];r&&s.includes(r)&&(r.removeState(i),e.setStatedGraphics(this,s.filter(t=>t!==r)))}}zB.type="element-active",zB.defaultOptions=zC;let zE="element-active-by-legend",zP={state:U.STATE_ACTIVE,filterType:"groupKey"};class zO extends vB{constructor(t){super(t),this.type=zE,this.handleStart=t=>{var e,i;let s=t.event;s&&this.start(null==(i=null==(e=s.detail)?void 0:e.data)?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},zP,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:dj.legendItemHover,handler:this.handleStart},{type:dj.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if((0,eE.A)(t))return;let{interaction:e,state:i}=this.options,s=vT(this.options),r=e.getStatedGraphics(this),a=[];
49this.getMarks().forEach(e=>{var i;null==(i=e.getGraphics())||i.forEach(e=>{s(e)===t&&a.push(e)})}),e.updateStates(this,a,r,i),e.setStatedGraphics(this,a)}resetAll(){let{interaction:t,state:e}=this.options;t.clearAllStatesOfTrigger(this,e),t.setStatedGraphics(this,[])}reset(t){let{state:e,interaction:i}=this.options;if(t){let s=i.getStatedGraphics(this);s&&s.includes(t)&&(t.removeState(e),i.setStatedGraphics(this,s.filter(e=>e!==t)))}else this.resetAll()}}zO.type=zE,zO.defaultOptions=zP;let zR="element-highlight-by-legend",zI={highlightState:U.STATE_HIGHLIGHT,blurState:U.STATE_BLUR,filterType:"groupKey"};class zL extends vB{constructor(t){super(t),this.type=zR,this.handleStart=t=>{var e,i;let s=t.event;s&&this.start(null==(i=null==(e=s.detail)?void 0:e.data)?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},zI,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:dj.legendItemHover,handler:this.handleStart},{type:dj.legendItemUnHover,handler:this.handleReset}]}start(t){if(t){let e=vT(this.options),{interaction:i,highlightState:s,blurState:r}=this.options,a=i.getStatedGraphics(this),n=[];this.getMarks().forEach(i=>{var s;null==(s=i.getGraphics())||s.forEach(i=>{e(i)===t&&n.push(i)})}),i.updateStates(this,n,a,s,r),i.setStatedGraphics(this,n)}}resetAll(){let{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){let{highlightState:e,blurState:i,interaction:s}=this.options;if(t){let r=s.getStatedGraphics(this);r&&r.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,r.filter(e=>e!==t)))}else this.resetAll()}}zL.type=zR,zL.defaultOptions=zI;let zD="element-highlight-by-name",zF={highlightState:U.STATE_HIGHLIGHT,blurState:U.STATE_BLUR,filterType:"groupKey"};class zz extends vB{constructor(t){super(t),this.type=zD,this.handleStart=t=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){let e=this._parseTargetKey(t);this.start(e)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.resetAll()},this.options=Object.assign({},zF,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;let i=oS(this.options.graphicName);return(null==(e=null==t?void 0:t.node)?void 0:e.name)&&i.includes(t.node.name)}_parseTargetKey(t){return this.options.parseData?this.options.parseData(t):"text"===t.node.type?t.node.attribute.text:null}start(t){if(t){let e=vT(this.options),{interaction:i,highlightState:s,blurState:r}=this.options,a=i.getStatedGraphics(this),n=[];this.getMarks().forEach(i=>{var s;null==(s=i.getGraphics())||s.forEach(i=>{e(i)===t&&n.push(i)})}),i.updateStates(this,n,a,s,r),i.setStatedGraphics(this,n)}}resetAll(){let{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){let{highlightState:e,blurState:i,interaction:s}=this.options;if(t){let r=s.getStatedGraphics(this);r&&r.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,r.filter(e=>e!==t)))}else this.resetAll()}}zz.type=zD,zz.defaultOptions=zF;let zH="element-highlight-by-group";class zj extends vB{constructor(t){super(t),this.type=zH,this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{let e=t.item;e&&this.isGraphicInMark(e)&&this.resetAll()},this.options=Object.assign({},vC,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}resetAll(){let{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}_getHightlightKey(t){var e;return null==(e=t.context)?void 0:e.groupKey}start(t){if(t&&this.isGraphicInMark(t)){let e=this._getHightlightKey(t);if((0,eE.A)(e))return;let{interaction:i,highlightState:s,blurState:r}=this.options,a=i.getStatedGraphics(this),n=[];
49this.getMarks().forEach(t=>{var i;null==(i=t.getGraphics())||i.forEach(t=>{this._getHightlightKey(t)===e&&n.push(t)})}),i.updateStates(this,n,a,s,r),i.setStatedGraphics(this,n)}}reset(t){if(t){if(this.isGraphicInMark(t)){let{interaction:e}=this.options,i=e.getStatedGraphics(this);t.removeState([this.options.highlightState,this.options.blurState]),e.setStatedGraphics(this,i.filter(e=>e!==t))}}else this.resetAll()}}zj.type=zH,zj.defaultOptions=vC;let zV="element-highlight-by-key";class zN extends zj{constructor(){super(...arguments),this.type=zV}_getHightlightKey(t){var e;return null==(e=t.context)?void 0:e.key}}zN.type=zV;class zW extends _x{constructor(){super(...arguments),this.type=zW.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}zW.type="image";class zU{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=eI.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{let e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])})}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter(t=>t.name!==this.key),this.release()}getWrapContainer(t,e,i){let s;return s=e?"string"==typeof e?ie.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ie.global.createDom(Object.assign({tagName:"div",parent:s},i)),nativeContainer:s}}parseDefaultStyleFromGraphic(t){var e;let i,s;return e="text"===t.type&&t.attribute?t.attribute:rQ(t).text,i={},s=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`,["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach(t=>{e[t]&&(i[lO(t)]=e[t])}),["fontSize","lineHeight"].forEach(t=>{let r=lO(t);(0,eE.A)(e[t])||(i[r]=s(e[t]))}),(0,eA.A)(e.maxLineWidth)&&(i["max-width"]=s(e.maxLineWidth)),e.underline?i["text-decoration"]="underline":e.lineThrough&&(i["text-decoration"]="line-through"),e.fill&&(0,eS.A)(e.fill)&&(i.color=e.fill),i}getTransformOfText(t){let e=rQ(t).text,{textAlign:i=e.textAlign,textBaseline:s=e.textBaseline}=t.attribute,{rotateDeg:r,scaleX:a,scaleY:n}=t.globalTransMatrix.toTransformAttrs(),l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},o={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(${n})`,transformOrigin:`${o[i]} ${o[s]}`}}updateStyleOfWrapContainer(t,e,i,s,r){let{pointerEvents:a,penetrateEventList:n=[]}=r,l=this.parseDefaultStyleFromGraphic(t);l.display=!1!==t.attribute.visible?"block":"none",l.pointerEvents=!0===a?"all":a||"none","none"!==l.pointerEvents&&(this.removeWrapContainerEventListener(i),n.forEach(t=>{"wheel"===t&&i.addEventListener("wheel",this.onWheel)})),i.style.position||(i.style.position="absolute",s.style.position="relative");let o=0,h=0,u=t.globalAABBBounds,d=r.anchorType;if((0,eE.A)(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||u.empty()){let e=t.globalTransMatrix;o=e.e,h=e.f}else{let t=SQ(u,d);o=t.x,h=t.y}let c=ie.global.getElementTopLeft(s,!1),p=e.window.getTopLeft(!1),g=e.viewBox,f=o+p.left-c.left+g.x1,m=h+p.top-c.top+g.y1;if(l.left=`${f}px`,l.top=`${m}px`,"text"===t.type&&"position"===d&&(l=Object.assign(Object.assign({},l),this.getTransformOfText(t))),(0,r3.A)(r.style)){let e=r.style({top:m,left:f,width:u.width(),height:u.height()},t,i);e&&(l=Object.assign(Object.assign({},l),e))}else r2(r.style)?l=Object.assign(Object.assign({},l),r.style):(0,eS.A)(r.style)&&r.style&&(l=Object.assign(Object.assign({},l),((t="")=>{let e={};return t.split(";").forEach(t=>{if(t){let i=t.split(":");if(2===i.length){let t=i[0].trim(),s=i[1].trim();t&&s&&(e[t]=s)}}}),e})(r.style)));ie.global.updateDom(i,{width:r.width,height:r.height,style:l})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEac
49h(t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)}),this.renderId+=1}drawHTML(t){"browser"===ie.global.env&&(t.sort((t,e)=>{var i,s;return(null!=(i=t.attribute.zIndex)?i:sV.zIndex)-(null!=(s=e.attribute.zIndex)?s:sV.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;let{wrapContainer:e}=this.htmlMap[t];e&&ie.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;let{html:i}=t.attribute;if(!i)return;let s=t.stage;if(!s)return;let{dom:r,container:a}=i;if(!r)return;let n=(0,eE.A)(i.id)?`${null!=(e=t.id)?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[n]&&a&&a!==this.htmlMap[n].container&&this.removeElement(n),this.htmlMap&&this.htmlMap[n])"string"==typeof r?this.htmlMap[n].wrapContainer.innerHTML=r:r!==this.htmlMap[n].wrapContainer.firstChild&&(this.htmlMap[n].wrapContainer.removeChild(this.htmlMap[n].wrapContainer.firstChild),this.htmlMap[n].wrapContainer.appendChild(r));else{let{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,a);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[n]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[n])return;let{wrapContainer:l,nativeContainer:o}=this.htmlMap[n];this.updateStyleOfWrapContainer(t,s,l,o,i),this.htmlMap[n].renderId=this.renderId}release(){"browser"===ie.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 zG extends zU{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=eI.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;let{root:e,wrapContainer:i,unmount:s}=this.htmlMap[t];e?ie.global.getRequestAnimationFrame()(()=>{e.unmount()}):s&&s(),i&&ie.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;let{react:i}=t.attribute;if(!i)return;let s=t.stage;if(!s)return;let r=s.params.ReactDOM,{element:a,container:n}=i;if(!a||!r||!r.createRoot&&!r.render)return;let l=(0,eE.A)(i.id)?`${null!=(e=t.id)?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[l]&&n&&n!==this.htmlMap[l].container&&this.removeElement(l),this.htmlMap&&this.htmlMap[l])r.createRoot?this.htmlMap[l].root.render(a):r.render(a,this.htmlMap[l].wrapContainer);else{let{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,n);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){let i=r.createRoot(t);i.render(a),this.htmlMap[l]={root:i,wrapContainer:t,nativeContainer:e,container:n,renderId:this.renderId}}else r.render(a,t),this.htmlMap[l]={wrapContainer:t,nativeContainer:e,container:n,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[l])return;let{wrapContainer:o,nativeContainer:h}=this.htmlMap[l];this.updateStyleOfWrapContainer(t,s,o,h,i),this.htmlMap[l].renderId=this.renderId}}vF.useRegisters([()=>{MG(),M$(),MK(),MM(),Mm(),Mt(),k1(),x2(),x5(),vk(),vx(),kF(),kZ(),uP.registerSeries(Me.type,Me),uP.registerChart(Mq.type,Mq)},()=>{MG(),M$(),MK(),Mm(),Mt(),k1(),x2(),we(),x5(),uP.registerAnimation("area",vA),vk(),vx(),kF(),kZ(),uP.registerSeries(wa.type,wa),MM(),uP.registerChart(wl.type,wl)},()=>{MG(),M$(),MK(),Mm(),wx(),MM(),uP.registerChart(wA.type,wA)},()=>{MG(),M$(),MM(),Mm(),x5(),uP.registerAnimation("scatter",(t,e)=>Object.assign({appear:"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},vv)),kF(),kZ(),uP.registerSeries(wE.type,wE),uP.registerChart(wO.type,wO)},()=>{M$(),Cf(),uP.registerAnimation("pie",(t,e)=>
49({appear:Ch(t,e),enter:{type:"radius"===t.growField?"growRadiusIn":"growAngleIn",easing:"linear",options:Cn(t,!0,F.enter)},exit:{type:"radius"===t.growField?"growRadiusOut":"growAngleOut",easing:"linear",options:Cn(t,!0,F.exit)},disappear:{duration:vy.disappear.duration}})),uP.registerAnimation("emptyCircle",(t,e)=>({appear:Ch(t,e)})),uP.registerSeries(Cb.type,Cb),uP.registerChart(Ck.type,Ck)},()=>{MG(),M$(),MM(),Mm(),uP.registerSeries(CK.type,CK),Cf(),uP.registerAnimation("rose",(t,e)=>({appear:function(t,e){if(!1===e)return{};switch(e){case"fadeIn":return CT;case"growAngle":return Cw(Object.assign(Object.assign({},t),{growField:"angle"}));default:return Cw(Object.assign(Object.assign({},t),{growField:"radius"}))}}(t,e),enter:{type:CM(t.growField)},exit:{type:"angle"===t.growField?"growAngleOut":"growRadiusOut"},disappear:{duration:vy.disappear.duration}})),CY(),CX(),uP.registerChart(CQ.type,CQ)},()=>{MG(),M$(),MK(),MM(),Mm(),uP.registerSeries(C4.type,C4),we(),x2(),x5(),uP.registerAnimation("radar",(t,e)=>({appear:"clipIn"===e?void 0:C3(t,e,"in"),enter:C3(t,e,"in"),exit:C3(t,e,"out"),disappear:"clipIn"===e?void 0:{duration:vy.disappear.duration},update:[{channel:["points","center"],custom:C1,customParameters:t,duration:vy.update.duration,easing:vy.update.easing},{type:"update",options:{excludeChannels:["points","defined","center"]}}]})),uP.registerAnimation("radarSymbol",(t,e)=>{let i,s,r,a;return{appear:"clipIn"===e?void 0:"fadeIn"===e?C2("in"):(i=()=>{var e;return null==(e=t.center())?void 0:e.x},s=(t,e)=>e.getGraphicAttribute("x"),r=()=>{var e;return null==(e=t.center())?void 0:e.y},a=(t,e)=>e.getGraphicAttribute("y"),{channel:{x:{from:i,to:s},y:{from:r,to:a}}}),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:"clipIn"===e?void 0:{duration:vy.disappear.duration},update:[{options:{excludeChannels:["x","y","center"]}},{channel:["x","y","center"],custom:C0,customParameters:t,duration:vy.update.duration,easing:vy.update.easing}]}}),uP.registerAnimation("radarGroup",(t,e)=>({appear:{custom:yz,customParameters:(e,i)=>{var s;return{group:i,startAngle:null!=(s=t.startAngle)?s:Math.PI/2,orient:"clockwise",center:t.center(),radius:t.radius(),animationType:"in"}}},disappear:{duration:vy.disappear.duration}})),ku(),CY(),CX(),uP.registerChart(C6.type,C6)},()=>{MG(),M$(),MK(),MM(),Mm(),wx(),uP.registerTransform("bin",Bx),uP.registerChart(BS.type,BS)},()=>{M$(),TZ(),wz(),uP.registerSeries(TQ.type,TQ),uP.registerImplement("registerMap",c8),uP.registerImplement("unregisterMap",c6),vS(),uP.registerChart(T1.type,T1)},()=>{M$(),uP.registerSeries(Bj.type,Bj),wz(),wm(),uP.registerAnimation("gaugePointer",(t,e)=>{var i;let s=(i=t,"fadeIn"===e?BD:{channel:{angle:{from:i.startAngle+Math.PI/2}}});return{appear:s,enter:s,disappear:{duration:vy.disappear.duration}}}),CY(),CX(),uP.registerSeries(BN.type,BN),Cf(),BT(),CX(),BE(),uP.registerChart(BU.type,BU)},()=>{M$(),Ej(),uP.registerChart(EV.type,EV)},()=>{uP.registerGrammarTransform("wordcloudShape",{transform:Ez}),uP.registerGrammarTransform("wordcloud",{transform:Ep}),Bd(),B2(),uP.registerSeries(EH.type,EH),M$(),Ej(),uP.registerChart(EV.type,EV)},()=>{M$(),E3(),Bd(),Bs(),uP.registerSeries(E6.type,E6),uP.registerAnimation("funnel",(t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},vb)),uP.registerAnimation("cartesianGroupClip",t=>({appear:{custom:yH,customParameters:(e,i)=>({animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}})),vS(),uP.registerChart(E7.type,E7)},()=>{MG(),M$(),MK(),MM(),Mm(),Bs(),wm(),uP.registerAnimation("waterfall",(t,e)=>({appear:function(t,e){switch(e){case"fadeIn":return Oc;case"scaleIn":return Op;default:return wh(t,!1)}}
49(t,e),enter:wh(t,!1),exit:wu(t,!1),disappear:{duration:vy.disappear.duration}})),vS(),kF(),kZ(),uP.registerSeries(Ow.type,Ow),uP.registerChart(OC.type,OC)},()=>{MG(),M$(),MM(),Mm(),OY(),bZ(),fh(),uP.registerGraphicComponent("line",t=>bV(t)),uP.registerGraphicComponent("rect",t=>g1(t)),uP.registerMark(OK.type,OK),x5(),vx(),kF(),kZ(),y_.registerBuiltInAnimate("boxplotScaleIn",O2),y_.registerBuiltInAnimate("boxplotScaleOut",O3),y_.registerBuiltInAnimate("barBoxplotScaleIn",O5),y_.registerBuiltInAnimate("barBoxplotScaleOut",O4),uP.registerSeries(O6.type,O6),uP.registerTransform("boxplot",O7),uP.registerChart(Rt.type,Rt)},()=>{MG(),M$(),MM(),Mm(),BE(),uP.registerChart(BR.type,BR)},()=>{MG(),M$(),MM(),Mm(),wm(),uP.registerAnimation("linearProgress",(t,e)=>({appear:Pe(t,e),enter:Pe(t),disappear:{duration:vy.disappear.duration}})),vS(),uP.registerSeries(Pr.type,Pr),uP.registerChart(Pn.type,Pn)},()=>{MG(),M$(),MM(),Mm(),wm(),Bd(),uP.registerAnimation("rangeColumn",(t,e)=>({appear:"fadeIn"===e?Ph:Po(t),enter:Po(t),exit:{type:"growCenterOut",options:{direction:"horizontal"===t.direction?"x":"y"}},disappear:{duration:vy.disappear.duration}})),vS(),kF(),kZ(),uP.registerSeries(Pc.type,Pc),uP.registerChart(Pg.type,Pg)},()=>{MG(),M$(),MK(),MM(),Mm(),we(),kF(),kZ(),uP.registerSeries(RI.type,RI),uP.registerChart(RD.type,RD)},()=>{M$(),uP.registerSeries(PF.type,PF),Cf(),Bd(),vS(),uP.registerAnimation("sunburst",(t,e)=>({appear:((t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}})(0,e),enter:{channel:{startAngle:{from:(e,i)=>{let{startAngle:s,endAngle:r}=t.animationInfo(),a=P_(Pm(i.parent.children),s,r);return Pf(i.getFinalAttribute().startAngle,a)*(r-s)+s},to:(t,e)=>e.getFinalAttribute().startAngle},endAngle:{from:(e,i)=>{let{startAngle:s,endAngle:r}=t.animationInfo(),a=P_(Pm(i.parent.children),s,r);return Pf(i.getFinalAttribute().endAngle,a)*(r-s)+s},to:(t,e)=>e.getFinalAttribute().endAngle},outerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().outerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:(t,e)=>e.getFinalAttribute().innerRadius}}},exit:{channel:{startAngle:{from:(t,e)=>e.getFinalAttribute().startAngle,to:(e,i)=>{let{startAngle:s,endAngle:r}=t.animationInfo(),a=Py(Pm(i.parent.children));return Pf(i.getFinalAttribute().startAngle,a)*(r-s)+s}},endAngle:{from:(t,e)=>e.getFinalAttribute().endAngle,to:(e,i)=>{let{startAngle:s,endAngle:r}=t.animationInfo(),a=Py(Pm(i.parent.children));return Pf(i.getFinalAttribute().endAngle,a)*(r-s)+s}},outerRadius:{from:(t,e)=>e.getFinalAttribute().outerRadius,to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:()=>t.animationInfo().innerRadius}}},disappear:{duration:vy.disappear.duration}})),uP.registerChart(PH.type,PH)},()=>{M$(),uP.registerSeries(P3.type,P3),Cf(),Bd(),vx(),uP.registerAnimation("circlePacking",(t,e)=>({appear:"fadeIn"===e?{type:"fadeIn"}:{type:"growRadiusIn"},enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{duration:vy.disappear.duration}})),uP.registerChart(P4.type,P4)},()=>{M$(),uP.registerGrammarTransform("filter",{transform:(t,e)=>null==e?void 0:e.filter(t.callback)}),uP.registerGrammarTransform("map",{transform:(t,e)=>(null==e||e.forEach((e,i)=>{t.callback(e)}),e)}),wm(),Bd(),uP.registerAnimation("treemap",(t,e)=>({appear:"fadeIn"===e?{type:"fadeIn"}:{type:"growCenterIn"},enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{duration:vy.disappear.duration}})),vS(),uP.registerSeries(Or.type,Or),uP.registerChart(On.type,On)},()=>{M$(),e7.load(RE),wm(),OY(),AF(),uP.registerGraphicComponent("path",t=>Aw(t)),uP.registerMark(Rv.type,Rv),Bd(),uP.registerAnimation("sankeyNode",(t,e)=>Object.assign({appear:"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t)},vb)),uP.registerAnimation("sankeyLinkPath",(t,e)=>({appear:"fadeIn"===e?{type:"fadeIn"}:{type:"linkPathGrowIn"},enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{duration:vy.disappear.duration}})),y_.registerBuiltInAnimate("linkPathGrowOut",Rm),y_.registerBuiltInAnimate("linkPathGrowIn",Rf),vS(),uP.registerSeries(RA.type,RA),uP.registerChart(RP.type,RP)},()=>{M$(),Bd(),uP.registerMark(RF.type,RF),uP.registerGraphicComponent("symbol",oZ),_k(),gq(),x0(),uP.registerAnimation("heatmap",(t,e)=>Object.assign(Object.assign({},vb),{appear:!1===e?{}:{type:"fadeIn"}})),kF(),kZ(),uP.registerSeries(RV.type,RV),uP.registerChart(RW.type,RW)},()=>{MG(),M$(),x5(),Bs(),wm(),Bd(),uP.registerSeries(Bp.type,Bp),Bs(),x5(),kF(),kZ(),uP.registerSeries(Bn.type,Bn),
49kF(),kZ(),uP.registerChart(Bm.type,Bm)},()=>{M$(),x5(),R0(),uP.registerSeries(R2.type,R2),uP.registerAnimation("correlation",(t,e)=>Object.assign({appear:"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"}},vv)),uP.registerChart(R5.type,R5)},()=>{MG(),M$(),MK(),MM(),uP.registerChart(C7.type,C7),Mm()},kZ,kF,()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),SW(),uP.registerComponent(R4.type,R4)},()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),SW(),uP.registerComponent(R7.type,R7)},()=>{uP.registerGraphicComponent(tT.lineAxis,(t,e)=>new kP(t,e)),uP.registerGraphicComponent(tC.lineAxisGrid,(t,e)=>new AV(t,e)),SW(),uP.registerComponent(Ie.type,Ie)},CY,CX,()=>{uP.registerComponent(I_.type,I_)},()=>{uP.registerComponent(II.type,II)},()=>{uP.registerComponent(IN.type,IN)},()=>{uP.registerComponent(Iq.type,Iq)},()=>{uP.registerComponent(I0.type,I0)},()=>{uP.registerComponent(Lg.type,Lg)},()=>{uP.registerComponent(Lf.type,Lf)},()=>{uP.registerComponent(LS.type,LS)},TZ,()=>{uP.registerComponent(Dq.type,Dq),DD()},()=>{uP.registerComponent(D8.type,D8),D2()},()=>{uP.registerComponent(FC.type,FC),FA()},()=>{uP.registerComponent(DQ.type,DQ),DJ._animate=Dm,DD()},()=>{uP.registerComponent(D9.type,D9),D6._animate=Dy,D2()},()=>{uP.registerComponent(FB.type,FB),FA()},()=>{uP.registerComponent(FE.type,FE),FA()},()=>{uP.registerComponent(D1.type,D1)},()=>{uP.registerComponent(Fp.type,Fp)},()=>{uP.registerGraphicComponent(Fb.type,t=>new Fv(t)),Fm(),Sz(),uP.registerComponent(Fb.type,Fb,!0,1/0)},()=>{uP.registerGraphicComponent(Fx.type,t=>new Fv(t)),Fm(),Sz(),uP.registerComponent(Fx.type,Fx,!0)},()=>{uP.registerComponent(FI.type,FI)},()=>{uP.registerComponent(FL.type,FL)},()=>{e7.load(FZ)},()=>{uP.registerLayout(FD.type,FD)},()=>{_w(),x2(),x5(),Bs(),Bd(),we(),wm(),wz(),Cf(),E3(),uP.registerMark(zW.type,zW),_k(),L7(),uP.registerGraphicComponent("image",xy),R0(),Sz()},()=>{za(zn)},()=>{za(zf)},()=>{uP.registerChartPlugin(zT.type,zT)},()=>{uP.registerInteractionTrigger(zB.type,zB)},()=>{uP.registerInteractionTrigger(zE,zO)},()=>{uP.registerInteractionTrigger(zR,zL)},()=>{uP.registerInteractionTrigger(zD,zz)},()=>{uP.registerInteractionTrigger(zH,zj)},()=>{uP.registerInteractionTrigger(zV,zN)},()=>{yR(),y_.registerBuiltInAnimate("scaleIn",yV),y_.registerBuiltInAnimate("scaleOut",yN),y_.registerBuiltInAnimate("fadeIn",yG),y_.registerBuiltInAnimate("fadeOut",yY),y_.registerBuiltInAnimate("moveIn",yX),y_.registerBuiltInAnimate("moveOut",yK),y_.registerBuiltInAnimate("rotateIn",yZ),y_.registerBuiltInAnimate("rotateOut",yJ),y_.registerBuiltInAnimate("update",yQ),y_.registerBuiltInAnimate("state",y0),y_.registerBuiltInAnimate("fromTo",y1),y_.registerBuiltInAnimate(p$,v_)},()=>{py.registerPlugin("ReactAttributePlugin",zG)},()=>{py.registerPlugin("HtmlAttributePlugin",zU)}]);let zY=vF},64091(t,e,i){"use strict";i.d(e,{A:()=>r});var s=i(75540);let r=t=>Array.isArray?Array.isArray(t):(0,s.A)(t,"Array")},63574(t,e,i){"use strict";i.d(e,{n:()=>function t(e,i,o){if(e===i)return!0;if(typeof e!=typeof i||null==e||null==i)return!1;if(Number.isNaN(e)&&Number.isNaN(i))return!0;if(n(e)!==n(i))return!1;if((0,r.A)(e))return!!(null==o?void 0:o.skipFunction);if("object"!=typeof e)return!1;if((0,s.A)(e)){if(e.length!==i.length)return!1;for(let s=e.length-1;s>=0;s--)if(!t(e[s],i[s],o))return!1;return!0}if(!(0,a.A)(e))return!1;let h=l(e),u=l(i);if(h.length!==u.length)return!1;h.sort(),u.sort();for(let t=h.length-1;t>=0;t--)if(h[t]!=u[t])return!1;for(let s=h.length-1;s>=0;s--){let r=h[s];if(!t(e[r],i[r],o))return!1}return!0}});var s=i(64091),r=i(83564),a=i(31724);function n(t){return Object.prototype.toString.call(t)}function l(t){return Object.keys(t)}},83564(t,e,i){"use strict";i.d(e,{A:()=>s});let s=t=>"function"==typeof t},33049(t,e,i){"use strict";i.d(e,{A:()=>s});let s=t=>null==t},31724(t,e,i){"use strict";i.d(e,{A:()=>r});var s=i(75540);let r=function(t){if("object"!=typeof t||null===t||!(0,s.A)(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}},6181(t,e,i){"use strict";i.d(e,{A:()=>r});var s=i(75540);let r=(t,e=!1)=>{let i=typeof t;return e?"string"===i:"string"===i||(0,s.A)(t,"String")}},75540(t,e,i){"use strict";i.d(e,{A:()=>s});let s=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`},42496(t,e,i){"use strict";i.d(e,{A:()=>s});let s=t=>null!=t},23017(t,e,i){"use strict";i.d(e,{A:()=>a});var s=i(31724),r=i(6181);function a(t,e){if(!t||!(0,s.A)(t))return t;let i={};return Object.keys(t).forEach(s=>{let a=t[s],n=!1;e.forEach(t=>{((0,r.A)(t)&&t===s||t instanceof RegExp&&s.match(t))&&(n=!0)}),n||(i[s]=a)}),i}},9768(t){"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}
49function a(t,e,s,a,n){if("function"!=typeof s)throw TypeError("The listener must be a function");var l=new r(s,a||t,n),o=i?i+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],l]:t._events[o].push(l):(t._events[o]=l,t._eventsCount++),t}function n(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1)),l.prototype.eventNames=function(){var t,s,r=[];if(0===this._eventsCount)return r;for(s in t=this._events)e.call(t,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},l.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 r=0,a=s.length,n=Array(a);r<a;r++)n[r]=s[r].fn;return n},l.prototype.listenerCount=function(t){var e=i?i+t:t,s=this._events[e];return s?s.fn?1:s.length:0},l.prototype.emit=function(t,e,s,r,a,n){var l=i?i+t:t;if(!this._events[l])return!1;var o,h,u=this._events[l],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,s),!0;case 4:return u.fn.call(u.context,e,s,r),!0;case 5:return u.fn.call(u.context,e,s,r,a),!0;case 6:return u.fn.call(u.context,e,s,r,a,n),!0}for(h=1,o=Array(d-1);h<d;h++)o[h-1]=arguments[h];u.fn.apply(u.context,o)}else{var c,p=u.length;for(h=0;h<p;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),d){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,s);break;case 4:u[h].fn.call(u[h].context,e,s,r);break;default:if(!o)for(c=1,o=Array(d-1);c<d;c++)o[c-1]=arguments[c];u[h].fn.apply(u[h].context,o)}}return!0},l.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,s,r){var a=i?i+t:t;if(!this._events[a])return this;if(!e)return n(this,a),this;var l=this._events[a];if(l.fn)l.fn!==e||r&&!l.once||s&&l.context!==s||n(this,a);else{for(var o=0,h=[],u=l.length;o<u;o++)(l[o].fn!==e||r&&!l[o].once||s&&l[o].context!==s)&&h.push(l[o]);h.length?this._events[a]=1===h.length?h[0]:h:n(this,a)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&n(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,t.exports=l},51271(t,e,i){var s=i(58644);function r(e,i){var s=e.geometry,r=s.type;if("LineString"===r)s.coordinates=t.exports.simplify(s.coordinates,i);else if("Polygon"===r||"MultiLineString"===r)for(var a=0;a<s.coordinates.length;a++)s.coordinates[a]=t.exports.simplify(s.coordinates[a],i);else if("MultiPolygon"===r)for(var n=0;n<s.coordinates.length;n++)for(var l=0;l<s.coordinates[n].length;l++)s.coordinates[n][l]=t.exports.simplify(s.coordinates[n][l],i);return e}t.exports=function(t,e,i){return(i||(t=JSON.parse(JSON.stringify(t))),t.features)?function(t,e){for(var i=0;i<t.features.length;i++)t.features[i]=r(t.features[i],e);return t}(t,e):t.type&&"Feature"===t.type?r(t,e):Error("FeatureCollection or individual Feature required")},t.exports.simplify=function(t,e){return s(t,e)}},58644(t,e,i){var s=i(7944),r=function(t,e){for(var i=0,a=0,n=1;n<=t.length-2;n++){var l=new s(t[0],t[t.length-1]).perpendicularDistance(t[n]);l>i&&(a=n,i=l)}if(i>e)var o=r(t.slice(0,a),e),h=r(t.slice(a,t.length),e),u=o.concat(h);else u=t.length>1?[t[0],t[t.length-1]]:[t[0]];return u};t.exports=r},7944(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}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.