@visactor/vchart 2.0.5-alpha.4 → 2.0.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +2 -2
- package/build/index.js +2 -2
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/series/sankey/sankey.js +1 -1
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/series/sankey/sankey.js +1 -1
- package/esm/series/sankey/sankey.js.map +1 -1
- package/package.json +2 -2
package/build/index.min.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
* Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
|
|
21
21
|
* Released under the MIT license
|
|
22
22
|
*/
|
|
23
|
-
let U$=class t extends w${constructor(e){super(j({},t.defaultOptions,e)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,c=this.getTextFontFamily(t),d=this.options.createCanvas({width:1,height:1}),u=d.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+c;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let f=p+2*g,m=3*g;const v=Math.ceil(f/this.gridSize),y=Math.ceil(m/this.gridSize);f=v*this.gridSize,m=y*this.gridSize;const _=-p/2,b=.4*-g,x=Math.ceil((f*Math.abs(Math.sin(h))+m*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),u.scale(1,1),u.translate(A/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+c,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,_,b);const T=u.getImageData(0,0,A,k).data;if(this.exceedTime())return null;const M=[];let C,w=S;const E=[x/2,S/2,x/2,S/2],B=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(T[4*((e*this.gridSize+s)*A+(t*this.gridSize+n))+3])return i.push([t,e]),t<E[3]&&(E[3]=t),t>E[1]&&(E[1]=t),e<E[0]&&(E[0]=e),void(e>E[2]&&(E[2]=e))}};for(;w--;)for(C=x;C--;)B(w,C,M);return{datum:t,occupied:M,bounds:E,gw:S,gh:x,fillTextOffsetX:_,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:c,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let 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,n){let r=n.length;for(;r--;){const i=t+n[r][0],s=e+n[r][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){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),Z(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(g(e)){const i=F$(e,t.width,t.height,void 0,!1,this.options.createCanvas);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n=D$(e.backgroundColor,void 0,this.options.createCanvas);const r=(t,e)=>{let i=this.gridSize;for(;i--;){let r=this.gridSize;for(;r--;)if(!n(s,e*this.gridSize+i,t*this.gridSize+r))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let a=this.ngx;for(;a--;){this.grid[a]=[];let t=this.ngy;for(;t--;)r(a,t),!1!==this.grid[a][t]&&(this.grid[a][t]=!0)}s=n=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=k$(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()}};U$.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class W$ extends w${constructor(t){super(j({},W$.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let e=0,i=this.result.length;e<i;e++)if(G$(t,this.result[e]))return!1;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=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){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s<this.maxRadius;)s+=.5,l=this.shape(s/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}function G$(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}W$.defaultOptions={enlarge:!1};const Y$={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},X$=(t,e)=>{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,h=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]);const c=t.fontFamily?$$(t.fontFamily):"sans-serif",d=t.fontStyle?$$(t.fontStyle):"normal",u=t.fontWeight?$$(t.fontWeight):"normal",p=t.rotate?$$(t.rotate):0,g=$$(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",m=t.padding?$$(t.padding):1,v=null!==(n=t.shape)&&void 0!==n?n:"square",y=null!==(r=t.shrink)&&void 0!==r&&r,_=null!==(a=t.enlarge)&&void 0!==a&&a,b=null!==(o=t.clip)&&void 0!==o&&o,x=t.minFontSize,A=t.randomVisible,k=t.as?Object.assign(Object.assign({},Y$),t.as):Y$,T=t.depth_3d,M=t.postProjection;let C=t.fontSize?$$(t.fontSize):14;const w=t.fontSizeRange;if(w&&!S(C)){const t=C,e=q$(Z$(t,l),w);C=i=>e(t(i))}let E=B$;"fast"===t.layoutType?E=W$:"grid"===t.layoutType&&(E=U$);const B=new E(Object.assign(Object.assign({},t),{text:g,padding:m,spiral:f,shape:v,rotate:p,fontFamily:c,fontStyle:d,fontWeight:u,fontSize:C,shrink:y,clip:b,enlarge:_,minFontSize:x,random:A,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r<a;r++)n=e[r],s=n.datum,s[k.x]=n.x,s[k.y]=n.y,s[k.fontFamily]=n.fontFamily,s[k.fontSize]=n.fontSize,s[k.fontStyle]=n.fontStyle,s[k.fontWeight]=n.fontWeight,s[k.angle]=n.angle,"StereographicProjection"===M&&J$(h,n,s,k,T),t.dataIndexKey&&(s[t.dataIndexKey]=`${r}`),i.push(s);return i}}));return B.layout(l,{width:h[0],height:h[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:B}:B.output()},$$=t=>y(t)||S(t)||d(t)||_(t)?t:e=>e[t.field],K$=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),q$=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=K$(t[0]),n=K$(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(K$(t)-r)/(a-r)*(e[1]-e[0])+e[0]},Z$=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=it(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function J$(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(o)+s.x,y:i*Math.cos(l)+s.y,z:i*Math.sin(l)*Math.sin(o)+s.z}}(t[0],t[1],r,{x:r,y:r,z:null!=n?n:r},e);i[s.x]=a.x,i[s.y]=a.y,i[s.z]=a.z}var Q$;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(Q$||(Q$={}));const tK=t=>/^[\u4e00-\u9fa5]+$/.test(t),eK=(t,e)=>{if(u(t))return 0;let i=0;for(const e of t)tK(e)?i+=1:i+=.53;return i};function iK(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:c,shapeMaxR:d,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=oK(i);let f=g.slice(0);const m=e.fontSizeShrinkFactor;let v=null,y=1,_=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;e<o.length;e++){const i=o[e],{words:n,center:c,maxR:d,ratio:u}=i;let b=!1;for(let e=0;e<n.length;e++){aK(l,p,t,e);const i=n[e];if(i.x=c[0],i.y=c[1],!i.skip&&i.hasText&&i.sprite&&sK(f,i,d,u,a,h,s))i.hasPlaced=!0;else{if(!i.skip&&i.weight>x&&_>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==v&&(v=e,y=_),_*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),f=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===v){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/_})),i.skip=!0,_=y,v=null,f=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(l,p,i,t),e.x=c[0],e.y=c[1],e.hasText&&sK(f,e,d,u,a,h,s)&&(e.hasPlaced=!0)}}e.board=f}function sK(t,e,i,s,n,r,a){const o=e.x,l=e.y,h=function(t){return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}(s),c=1*a;let d,u,p,g=-c;for(;d=h(g+=c);){const{wordSize:s,bounds:{dTop:a,dBottom:h,dLeft:c,dRight:g}}=e;if(u=d[0],p=d[1],Math.min(Math.abs(u),Math.abs(p))>=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-c<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||rK(e,t,r)))return nK(e,t,r),!0}return!1}function nK(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,c=s[1];let d,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<r;i++)e[u+i]|=n[t*r+i];u+=a}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=r;i++)e[u+i]|=d<<h|(i<r?(d=n[t*r+i])>>>l:0);u+=a}}function rK(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,c=n[1];let d,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<a;i++)if(e[u+i]&s[t*a+i])return!0;u+=r}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=a;i++)if((d<<h|(i<a?(d=s[t*a+i])>>>l:0))&e[u+i])return!0;u+=r}return!1}function aK(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,c=0,d=0,u=0;const p=s;for(--s;++s<a;){const t=i[s],a=Math.max(t.fontSize,2);if(e.save(),e.font=t.fontStyle+" "+t.fontWeight+" "+a+"px "+t.fontFamily,o=e.measureText(t.text+"m").width+2*t.padding,l=2*a+2*t.padding,0!==t.rotate){const e=Math.sin(t.rotate*r),i=Math.cos(t.rotate*r),s=o*i,n=o*e,a=l*i,h=l*e;o=Math.max(Math.abs(s+h),Math.abs(s-h)),l=~~Math.max(Math.abs(n+a),Math.abs(n-a))}if(o=o+31>>5<<5,l=Math.ceil(l),l>d&&(d=l),h+o>=n&&(h=0,c+=d,d=l),c+l>=2048){if(0===c){t.hasText=!1;continue}break}c+l>=u&&(u=c+l),e.translate(h+(o>>1),c+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,c],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let f,m;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,c]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,d,u,p]=[1/0,-1/0,1/0,-1/0];for(m=0;m<r[1];m++){let t;for(f=0;f<r[0];f++)if(g[4*((c+m)*n+(h+f))+3]>0){const e=1<<31-f%32;o[a*m+(f>>5)]|=e,f<u&&(u=f),f>p&&(p=f),t|=e}t&&(m<l&&(l=m),m>d&&(d=m))}t.bounds={dTop:(r[1]>>1)-l,dBottom:d-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function oK(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t<s[1];t++)for(let i=0;i<s[0];i++)if(0===e[t*s[0]+i]){const e=1<<31-i%32;r[n*t+(i>>5)]|=e}if(i[0]>s[0]){const t=(1<<i[0]-s[0])-1;for(let e=0;e<s[1];e++)r[n*e+n-1]|=t}return r}function lK(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),a<t.length&&(i[r].wordsNum+=t.length-a);let o=r;const l=i.map((t=>t.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?iK(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:c,shapeRatio:d}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=oK(i);let g=p.slice(0);const f=e.fontSizeEnlargeFactor,m=Math.min(r,t.length);let v=0;t.length>m&&(v=t.sort(((t,e)=>e.weight-t.weight))[m-1].weight);let y=0,_=1,b=!1;for(let r=0;r<a.length;r++){const h=a[r],{words:c,center:d,maxR:x,ratio:S}=h;let A=!1;for(let r=0;r<c.length;r++){aK(o,u,t,r);const a=c[r];if(a.x=d[0],a.y=d[1],a.hasText&&a.sprite&&sK(g,a,x,S,s,l,n)){if(a.hasPlaced=!0,a.weight>=v&&y++,y>=m&&!b){_*=f,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*f})),g=p.slice(0),A=!0,y=0;break}}else{if(a.weight>=v&&_>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/f})),_/=f,b=!0,g=p.slice(0),A=!0;break}if(a.weight>=v)return iK(t,e,i)}}A&&(r=-1)}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(o,u,i,t),e.x=h[0],e.y=h[1],e.hasText&&sK(g,e,c,d,s,l,n)&&(e.hasPlaced=!0)}}e.board=g}(t,e,i):function(t,e,i){const{size:s,stepFactor:n}=e,{segmentation:{regions:r},tempCanvas:a,boardSize:o,shapeCenter:l,shapeMaxR:h,shapeRatio:c}=i,d=oK(i),u=a.getContext("2d",{willReadFrequently:!0});for(const e of r){const{words:i,center:r,maxR:l,ratio:h}=e;for(let e=0;e<i.length;e++){aK(a,u,t,e);const c=i[e];c.x=r[0],c.y=r[1],c.hasText&&c.sprite&&sK(d,c,l,h,s,o,n)&&(c.hasPlaced=!0)}}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(a,u,i,t),e.x=l[0],e.y=l[1],e.hasText&&sK(d,e,h,c,s,o,n)&&(e.hasPlaced=!0)}}e.board=d}(t,e,i);const s=function(t,e,i){const{size:s,fillingTimes:n,fillingXStep:r,fillingYStep:a,getFillingFontStyle:o,getFillingFontWeight:l,getFillingFontFamily:h,fillingInitialFontSize:c,fillingDeltaFontSize:d,fillingInitialOpacity:u,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:m,board:v,minFillFontSize:y}=e,{boardSize:_,shapeBounds:b,tempCanvas:x,randomGenerator:S}=i,A=x.getContext("2d",{willReadFrequently:!0});let k=c,T=u;const M=[];for(let t=0;t<n;t++)C(k,T),k=Math.max(k>d?k-d:d,y),T=T>p?T-p:p;return M;function C(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:c}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(c),fontStyle:o(c),fontWeight:l(c),fontSize:e,rotate:g[~~(S()*g.length)],padding:f(c),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:c}}));w(n);let c=0;const{x1:d,y1:u,x2:p,y2:y}=b,[k,T]=[d+~~(S()*r*2),u+~~(S()*a*2)];for(let t=T;t<=y;t+=a)for(let e=k;e<=p;e+=r){aK(x,A,n,c);const i=n[c];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++c===n.length&&(c=0,m&&w(n));continue}const{dTop:l,dBottom:h,dLeft:d,dRight:u}=a;i.x-d<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!rK(i,v,_)&&(nK(i,v,_),M.push(Object.assign({},i)),++c===n.length&&(c=0,m&&w(n)))}}function w(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;e<t.length;e++)t[e].hasPlaced?r.push(t[e]):n.push(t[e]);return n.forEach((t=>t.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}const hK={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"};class cK{constructor(t){this.progressiveResult=[],this.options=t}layout(t){this.data=t;const e=this.options,i={shapeUrl:e.shape,size:e.size,ratio:e.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0},s=this.options.createCanvas({width:e.size[0],height:e.size[1]}),n=s.getContext("2d",{willReadFrequently:!0});n.textAlign="center",n.textBaseline="middle",i.tempCanvas=s;const r=e.size[0]+31>>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,y(i.shapeUrl)){i.isEmptyPixel=D$(void 0,void 0,this.options.createCanvas);const t=function(t,e){return t&&(T(t)||M(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}(i.shapeUrl,this.options.createImage);t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=this.options.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},d=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=D$(i.shapeUrl.backgroundColor,void 0,this.options.createCanvas);const t=F$(i.shapeUrl,e.size[0],e.size[1],void 0,!1,this.options.createCanvas);i.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,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b;const x=this.segmentationInput,S=V$(x);if(!S.segmentation.regions.length)return;const A=this.options,k=this.data,T=A.colorMode||"ordinal",M={getText:Pt(A.text),getFontSize:Pt(A.fontSize),fontSizeRange:A.fontSizeRange,colorMode:T,getColor:A.colorField?Pt(A.colorField):Pt(A.text),getFillingColor:Pt(A.fillingColorField),colorList:A.colorList||("ordinal"===T?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:Pt(A.colorHexField),getFontFamily:Pt(A.fontFamily||"sans-serif"),rotateList:A.rotateList||[0],getPadding:Pt(A.padding||1),getFontStyle:Pt(A.fontStyle||"normal"),getFontWeight:Pt(A.fontWeight||"normal"),getFontOpacity:A.fontOpacity?Pt(A.fontOpacity):()=>1};uK(k,M,S);const C={size:A.size,ratio:A.ratio||.8,shapeUrl:A.shape,random:void 0===A.random||A.random,textLayoutTimes:null!==(t=A.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:A.removeWhiteBorder,layoutMode:null!==(e=A.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=A.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=A.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=A.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:A.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=A.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=A.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=A.fillingTimes)&&void 0!==o?o:4,fillingXStep:A.fillingXRatioStep?Math.max(Math.floor(A.size[0]*A.fillingXRatioStep),1):null!==(l=A.fillingXStep)&&void 0!==l?l:4,fillingYStep:A.fillingYRatioStep?Math.max(Math.floor(A.size[1]*A.fillingYRatioStep),1):null!==(h=A.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:A.fillingInitialFontSize,fillingDeltaFontSize:A.fillingDeltaFontSize,fillingInitialOpacity:null!==(c=A.fillingInitialOpacity)&&void 0!==c?c:.8,fillingDeltaOpacity:null!==(d=A.fillingDeltaOpacity)&&void 0!==d?d:.05,getFillingFontFamily:Pt(A.fillingFontFamily||"sans-serif"),getFillingFontStyle:Pt(A.fillingFontStyle||"normal"),getFillingFontWeight:Pt(A.fillingFontWeight||"normal"),getFillingPadding:Pt(null!==(u=A.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=A.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=A.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:A.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(f=A.minInitFontSize)&&void 0!==f?f:10,minFontSize:null!==(m=A.minFontSize)&&void 0!==m?m:4,minFillFontSize:null!==(v=A.minFillFontSize)&&void 0!==v?v:2},w=((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})(M.colorList,C.fillingColorList);C.sameColorList=w,dK(k,M,C,A),function(t,e,i,s){const{getText:n}=e;let{fillingInitialFontSize:r,fillingDeltaFontSize:a}=i;const{fillingRatio:o}=i,l=Math.ceil(Math.sqrt(s.shapeArea)/4);if(!r||!a){const e=o/100,h=t.reduce(((t,e)=>{const i=eK(n(e));return i>l?t:t+i}),0)/t.length;let c;if(0===h)c=8;else{const t=.2*s.shapeArea;c=Math.sqrt(e*(t/h))}r=~~c,a=c*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(k,M,C,S);const{getText:E,getFontFamily:B,getFontStyle:P,getFontWeight:R,getPadding:L,getColor:I,getFillingColor:O,getColorHex:D,fontSizeScale:F,colorScale:z,fillingColorScale:j,getFontOpacity:H,rotateList:N}=M,V=k.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:B(t),fontWeight:R(t),fontStyle:P(t),rotate:N[~~(x.randomGenerator()*N.length)],fontSize:Math.max(C.minInitFontSize,~~F(t)),opacity:H(t),padding:L(t),color:D&&D(t)||z&&z(I(t))||"black",fillingColor:!O||(null===(e=A.colorField)||void 0===e?void 0:e.field)===(null===(i=A.fillingColorField)||void 0===i?void 0:i.field)&&w?void 0:D&&D(t)||j&&j(O(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),U=$(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/U)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:W,successedWords:G,failedWords:Y}=lK(V,C,S),X=null!==(_=null===(y=A.text)||void 0===y?void 0:y.field)&&void 0!==_?_:"textKey",K=null!==(b=A.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=A.as?Object.assign(Object.assign({},hK),A.as):hK;let Z,J;const Q=[];for(let t=0;t<V.length;++t)Z=V[t],J=Z.datum,J[q.x]=Z.x,J[q.y]=Z.y,J[q.fontFamily]=Z.fontFamily,J[q.fontSize]=Z.fontSize,J[q.fontStyle]=Z.fontStyle,J[q.fontWeight]=Z.fontWeight,J[q.angle]=oe(Z.rotate),J[q.opacity]=Z.opacity,J[q.visible]=Z.visible,J[q.isFillingWord]=!1,J[q.color]=Z.color,J[K]=`${Z.text}_${t}_keyword`,Q.push(J);const tt=[];W.forEach(((t,e)=>{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=oe(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=O?(null===(i=A.colorField)||void 0===i?void 0:i.field)===(null===(s=A.fillingColorField)||void 0===s?void 0:s.field)&&w?t.color:t.fillingColor:C.fillingColorList[~~(x.randomGenerator()*C.fillingColorList.length)],n[X]=t.text,n[K]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.options.onLayoutFinished&&this.options.onLayoutFinished({successedWords:G,failedWords:Y}),this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const dK=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:c}=e,{sameColorList:d}=i;let u,p,g=e.colorList,f=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new GP).domain(e).range(g).scale(t),c&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!d)){const e=t.map((t=>c(t)));p=t=>(new GP).domain(e).range(f).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new fR).domain(gK(h,t)).range(g);if(u=t=>e.scale(t),c&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!d)){1===f.length&&(f=[f[0],f[0]]);const e=(new fR).domain(gK(c,t)).range(f);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},uK=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new bR).domain(gK(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&d(n)&&!s){const e=.5,[o,l]=gK(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),c=pK(h,i,!0);s=[~~(e*c),~~c];const d=(new bR).domain(gK(n,t)).range(s);a=t=>d.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=pK(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},pK=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=eK(e.text);return s<a?t+s*(i?(.5+.5*e.weight)**2:1):t}),0);if(0===o)return 12;let l=20;if(1===r.length)l=Math.sqrt(n*(s/(1.7*o)));else{const t=[];for(let e=0;e<r.length;e++){const i=r[e].area,a=r[e].ratio,l=i/s;if(l<.1)continue;const h=l*(o*(a<1?2.7-a:1.7)),c=Math.sqrt(n*(i/h));t.push(c)}l=t.length?Math.min(...t):Math.sqrt(n*(s/(1.7*o)))}return l};const gK=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=it(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},fK=(t,e,i)=>{if(!t.size||u(t.size[0])||u(t.size[1])||t.size[0]<=0||t.size[1]<=0)return at.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||at.getInstance().error("WordcloudShape shape must be specified."),t.text||at.getInstance().error("WordcloudShape text must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];const s=new cK(t);return s.layout(e),s.unfinished()?{progressive:s}:s.output()};class mK extends kX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.wordCloud}}mK.type=t.SeriesTypeEnum.wordCloud;const vK=()=>{AD.registerGrammarTransform("wordcloud",{transform:X$}),RG(),AD.registerAnimation("wordCloud",((t,e)=>({appear:TX(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),AD.registerSeries(mK.type,mK)},yK=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:c,asLastValueRatio:d,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:f=!1,isCone:m=!0,range:v}=e,y=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),_=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==v?void 0:v.min)&&void 0!==i?i:_,null!==(s=null==v?void 0:v.max)&&void 0!==s?s:y];return n.forEach(((t,e)=>{var i,s;const v=Number.parseFloat(t[r]),y=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),_=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=k(_*v)&&0!==v?_/v:0,S=k(v*y)&&0!==y?v/y:0;u&&(t[u]=y),g&&(t[g]=_),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===f?x:1/n.length),h&&(t[h]=v/b[1]),c&&(t[c]=e===n.length-1?m?0:t[h]:_/b[1]),d&&(t[d]=0===e?1:y/b[1]),p&&(t[p]=v)})),n},_K=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},bK=`${YD}_FUNNEL_TRANSFORM_RATIO`,xK=`${YD}_FUNNEL_REACH_RATIO`,SK=`${YD}_FUNNEL_HEIGHT_RATIO`,AK=`${YD}_FUNNEL_VALUE_RATIO`,kK=`${YD}_FUNNEL_LAST_VALUE_RATIO`,TK=`${YD}_FUNNEL_NEXT_VALUE_RATIO`,MK=`${YD}_FUNNEL_LAST_VALUE`,CK=`${YD}_FUNNEL_CURRENT_VALUE`,wK=`${YD}_FUNNEL_NEXT_VALUE`,EK=`${YD}_FUNNEL_TRANSFORM_LEVEL`;class BK extends eH{constructor(t){var e,i;super(t),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?this._transformRatioText:null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)){return`${(100*(null==t?void 0:t[xK])).toFixed(1)}%`}return this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return this._transformRatioText;const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return p(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]},this._transformRatioText=null!==(i=null===(e=t.getSpec())||void 0===e?void 0:e.transformRatioText)&&void 0!==i?i:"转化率"}}class PK extends nj{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class RK extends PK{constructor(){super(...arguments),this.type=RK.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}RK.type="polygon";const LK=()=>{AD.registerMark(RK.type,RK),zM(),RM(),Mj(),AD.registerGraphicComponent("polygon",lf)},IK=Object.assign(Object.assign({},pH),{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 OK extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class DK extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=OK,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;qF(this._dataSet,"funnel",yK),qF(this._dataSet,"funnelTransform",_K);const t=new Ba(this._dataSet,{name:`${YD}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new Qz(this._option,t)}compile(){var t,e;super.compile(),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}compileData(){var t;super.compileData(),null===(t=this._viewDataTransform)||void 0===t||t.compile()}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:CK,asTransformRatio:bK,asReachRatio:xK,asHeightRatio:SK,asValueRatio:AK,asNextValueRatio:TK,asLastValueRatio:kK,asLastValue:MK,asNextValue:wK,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:EK}})}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},DK.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:TH(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},DK.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(DK.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(DK.mark.outerLabelLine,{themeSpec:e,markSpec:t,noSeparateStyle:!0,parent:!1})}}initTooltip(){this._tooltipHelper=new BK(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 e,i,s,n;const r=this._funnelMark;r&&this.setMarkStyle(r,{points:t=>this.getPoints(t),visible:t=>p(t[this._valueField]),fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);const a=this._funnelTransformMark;a&&this.setMarkStyle(a,{points:t=>this.getPoints(t)},"normal",t.AttributeLevel.Series);const o=this._funnelOuterLabelMark.label;o&&(this.setMarkStyle(o,{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",t.AttributeLevel.Series),d(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(o,{text:t=>this._spec.outerLabel.formatMethod(`${t[this.getCategoryField()]}`,t)},"normal",t.AttributeLevel.User_Mark));const l=this._funnelOuterLabelMark.line;if(l&&o){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",t.AttributeLevel.Series);const r=null!==(s=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==s?s:null===(n=this._spec.outerLabel)||void 0===n?void 0:n.visible;p(r)&&l.setVisible(r)}}initLabelMarkStyle(e){var i;if(!e)return;const s=e.getTarget(),n=e.getComponent();if(s===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{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",t.AttributeLevel.Series);const s=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&U_(s,this._funnelOuterLabelMark.label,n),this._funnelOuterLabelMark.line&&U_(s,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:n)}else this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:t=>`${(100*IO(xK).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",t.AttributeLevel.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),SH("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(xH(AD.getAnimationInKey("fadeInOut")(),SH(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(xH(AD.getAnimationInKey("funnel")({},o),SH(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(xH(null===(a=AD.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),SH("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[kK])/2:this._getSecondaryAxisLength(t[AK])/2,n=this._getSecondaryAxisLength(t[AK])/2):(s=this._getSecondaryAxisLength(t[AK])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[TK])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[EK])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return p(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[ZD]===t[ZD]));if(!p(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return l+=i*(h+c),l+=s?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(S(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r,a;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const o=this.getPoints(t),l=(Math.abs(o[0].x-o[1].x)+Math.abs(o[2].x-o[3].x))/2,h=this.getCategoryField(),c=null===(n=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[h])===t[h]}),!0))||void 0===n?void 0:n.AABBBounds,d=c?c.x2-c.x1:0,u=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let p=this.getLayoutRect().width-Math.max(l,d);return"center"===this._funnelAlign&&(p/=2),p-u-(null!==(a=null===(r=this._spec.outerLabel)||void 0===r?void 0:r.spaceWidth)&&void 0!==a?a:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,c;const d=this.getCategoryField(),u=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===s?void 0:s.find((e=>{var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[d])===t[d]})))||void 0===n?void 0:n.AABBBounds,p=null===(a=null===(r=this._labelMark)||void 0===r?void 0:r.getComponent())||void 0===a?void 0:a.getComponent(),g=null===(o=null==p?void 0:p.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[d])===t[d]}),!0))||void 0===o?void 0:o.AABBBounds,f=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};let m,v,y,_;if(this._isHorizontal()){const e=null!==(h=f.spaceWidth)&&void 0!==h?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?(y=this._getPolygonCenter(i).y-s/2-e,_=!1!==f.alignLabel?(null==u?void 0:u.y2)+e:y-e,m=this._getPolygonCenter(i).x,y-_<this._minLabelLineWidth&&(_=y-this._minLabelLineWidth),v=m):(y=this._getPolygonCenter(i).y+s/2+e,_=!1!==f.alignLabel?(null==u?void 0:u.y1)-e:y+e,m=this._getPolygonCenter(i).x,_-y<this._minLabelLineWidth&&(_=y+this._minLabelLineWidth),v=m),{x1:m,x2:v,y1:y,y2:_}}const b=this.getPoints(t),x=(Math.abs(b[0].x-b[1].x)+Math.abs(b[2].x-b[3].x))/2,S=(null==g?void 0:g.x2)-(null==g?void 0:g.x1)||0,A=null!==(c=f.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(m=this._getPolygonCenter(b).x+Math.max(S/2,x/2)+A,v=!1!==f.alignLabel?(null==u?void 0:u.x1)-A:m+A,y=this._getPolygonCenter(b).y,v-m<this._minLabelLineWidth&&(v=m+this._minLabelLineWidth),_=y):(m=this._getPolygonCenter(b).x-Math.max(S/2,x/2)-A,v=!1!==f.alignLabel?(null==u?void 0:u.x2)+A:m-A,y=this._getPolygonCenter(b).y,m-v<this._minLabelLineWidth&&(v=m-this._minLabelLineWidth),_=y),{x1:m,x2:v,y1:y,y2:_}}_computeMaxSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return aD(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}_computeMinSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return aD(null!==(t=this._spec.minSize)&&void 0!==t?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]}}DK.type=t.SeriesTypeEnum.funnel,DK.mark=IK,DK.builtInTheme={funnel:CD},DK.transformerConstructor=OK;const FK=()=>{LK(),RG(),WW(),AD.registerSeries(DK.type,DK),AD.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},yj))),AD.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:IE,customParameters:(e,i)=>({animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:IE,customParameters:(e,i)=>({animationType:"out",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),bj()},zK=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},jK=t=>{const e=t.filter((t=>t.context.diffState===Wz.update)),i=K(e.map((t=>{var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?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?void 0:e.data)||void 0===s?void 0:s[0].depth)===i}))},HK=(t,e,i)=>{if(P(t))return[e,i];const s=K(t.map((t=>1*t.getFinalAttribute().startAngle))),n=$(t.map((t=>1*t.getFinalAttribute().endAngle)));return[s,n]},NK=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=HK(r,s,n);return zK(i.getFinalAttribute().startAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=HK(r,s,n);return zK(i.getFinalAttribute().endAngle,a)*(n-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}}}),VK=t=>{const e=K(t.map((t=>1*t.getFinalAttribute().startAngle))),i=$(t.map((t=>1*t.getFinalAttribute().endAngle)));return[e,i]},UK=t=>({channel:{startAngle:{from:(t,e)=>e.getFinalAttribute().startAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=VK(r);return zK(i.getFinalAttribute().startAngle,a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getFinalAttribute().endAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=VK(r);return zK(i.getFinalAttribute().endAngle,a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getFinalAttribute().outerRadius,to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:()=>t.animationInfo().innerRadius}}}),WK=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},GK=(t,e={})=>{if(!t)return[];const i=[];return EX(t,i,e),i},YK=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new i$(i).layout(t,{width:s,height:n})};class XK extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}var $K;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}($K||($K={}));const KK=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(u(n))return t;if(i.type===$K.DrillDown){return Y(EF(t,n,s,"children"))}if(i.type===$K.DrillUp){const e=BF(t,n,s,"children");if(e)return Y(e)}return t};class qK{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=MW(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;qF(t,"drillFilter",KK),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(u(t.datum)||u(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(e=[]){const{getRawData:i,event:s}=this._drillParams;if(!_(e)||P(e))return e;const n=e[e.length-1];return this._drillInfo={key:n,path:e,type:$K.DrillDown},i().reRunAllTransform(),s.emit(t.ChartEvent.drill,{value:{path:e,type:$K.DrillDown},model:this}),e}drillUp(){var e,i;const{getRawData:s,event:n}=this._drillParams,r=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!_(r)||P(r))return r;const a=r.pop();return this._drillInfo={key:a,path:r,type:$K.DrillUp},s().reRunAllTransform(),n.emit(t.ChartEvent.drill,{value:{path:r,type:$K.DrillUp},model:this}),r}}const ZK=Object.assign(Object.assign({},pH),{sunburst:{name:"sunburst",type:"arc"}}),JK=(t,e,i)=>(t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:aH,operations:["max","min","values"]}),t.push({key:oH,operations:["values"]}),t),QK={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"}}}};class tq extends $G{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:ZD},getRawData:()=>this.getRawData()}),this._startAngle=oe(this._spec.startAngle),this._endAngle=oe(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),qF(this._dataSet,"sunburstLayout",YK),qF(this._dataSet,"flatten",GK),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[p(this._centerX)?this._centerX:this.getLayoutRect().width/2,p(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(qF(t.dataSet,"addVChartProperty",$j),t.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){if(!1===this._sunburst.visible)return;const t=this._createMark(tq.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}_initArcMarkStyle(){u(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(p(this._offsetX)?this._offsetX:0),y:t=>t.y+(p(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(tq.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return g(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(p(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(p(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initTooltip(){this._tooltipHelper=new XK(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Y(this.__innerRadius))[0],outerRadius:this._computeRadius(Y(this.__outerRadius))[0],startAngle:Y(this._startAngle)[0],endAngle:Y(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_computeRadius(t){return _(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}}tq.type=t.SeriesTypeEnum.sunburst,tq.mark=ZK,tq.builtInTheme={sunburst:QK},G(tq,qK);const eq=()=>{AD.registerSeries(tq.type,tq),oY(),RG(),bj(),AD.registerAnimation("sunburst",((t,e)=>({appear:WK(0,e),enter:NK(t),exit:UK(t),disappear:UK(t)})))},iq=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;if(0===s||0===n)return t;return new GX(i).layout(t,{width:s,height:n})};class sq extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const nq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},rq=Object.assign(Object.assign({},pH),{circlePacking:{name:"circlePacking",type:"arc"}});class aq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:ZD},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();u(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),qF(this._dataSet,"circlePackingLayout",iq),qF(this._dataSet,"flatten",GK),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(qF(t.dataSet,"addVChartProperty",$j),t.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const e=this._createMark(aq.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}_initCirclePackingMarkStyle(){u(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},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(aq.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}initTooltip(){this._tooltipHelper=new sq(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),SH(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}}aq.type=t.SeriesTypeEnum.circlePacking,aq.mark=rq,aq.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"}}}}},G(aq,qK);const oq=()=>{AD.registerSeries(aq.type,aq),oY(),RG(),_j(),AD.registerAnimation("circlePacking",((t,e)=>({appear:nq(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}})))},lq=(t,e,i)=>{e.forEach((e=>{u(e[i])||t.add(e[i]),e.children&&e.children.length>0&&lq(t,e.children,i)}))},hq=t=>{var e;if(!t||!_(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},cq=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new QX(e),r=[];return r.push(n.layout(s,i)),r},dq=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},uq=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class pq extends eH{constructor(){super(...arguments),this._getDimensionData=t=>{if(t.source){if(S(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const gq=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}),fq=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:gq(t),mq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"};class vq extends cE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s,a=this.target.getFinalAttribute();a&&Object.assign(this.target.attribute,a),this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const 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 yq extends cE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s;this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const _q=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c),d=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.y0-n/2),l=d(t.y1-n/2)):"end"===t.align?(o=d(t.y0+t.thickness/2-n),l=d(t.y1+t.thickness/2-n)):(o=d(t.y0-t.thickness/2),l=d(t.y1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${a},${d(l-n/2)}L${d(a+n)},${d((l+p)/2)}L${a},${d(p+n/2)}`:"",m=t.startArrow&&g?`L${r},${d(u+n/2)}L${d(r-n)},${d((o+u)/2)}L${r},${d(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${f}L${a},${p}L${r},${u}${m}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${f}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${m}Z`:`M${r},${o}C${h},${o},${c},${l},${a},${l}\n ${f}L${a},${p}C${c},${p},${h},${u},${r},${u}${m}Z`},bq=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(d=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.x0-n/2),l=d(t.x1-n/2)):"end"===t.align?(o=d(t.x0+t.thickness/2-n),l=d(t.x1+t.thickness/2-n)):(o=d(t.x0-t.thickness/2),l=d(t.x1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${d(l-n/2)},${a}L${d((l+p)/2)},${d(a+n)}L${d(p+n/2)},${a}`:"",m=t.startArrow&&g?`L${d(u+n/2)},${r}L${d((u+o)/2)},${d(r-n)}L${d(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${f}L${p},${a}L${u},${r}${m}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${f}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${m}Z`:`M${o},${r}C${o},${h},${l},${c},${l},${a}\n ${f}L${p},${a}C${p},${c},${u},${h},${u},${r}${m}Z`};class xq extends gG{constructor(){super(...arguments),this.type=xq.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,n;const r=Object.assign(Object.assign({},i.attribute),t),a=null!==(s=r.direction)&&void 0!==s?s:null===(n=this._glyphConfig)||void 0===n?void 0:n.direction,o=["vertical","TB","BT"].includes(a)?bq:_q,l="number"==typeof r.ratio&&r.ratio>=0&&r.ratio<=1;return{back:{path:l?o(r,1):""},front:{path:o(r,l?r.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})}}xq.type="linkPath";const Sq=Object.assign(Object.assign({},pH),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class Aq extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}const kq=(t,e,i,s=!0,n)=>{t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&t.removeState(e),t.addState(e,s,n)};class Tq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.sankey,this.transformerConstructor=Aq,this._nodeLayoutZIndex=t.LayoutZIndex.Node,this._labelLayoutZIndex=t.LayoutZIndex.Label,this._viewBox=new Ve,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(p(a))return a;if(p(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a;const o=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(o)return o;if(p(this._spec.seriesField)){const e=null===(s=this._nodesSeriesData.latestData)||void 0===s?void 0:s.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,a=null===(r=null===(n=this._option)||void 0===n?void 0:n.globalScale)||void 0===r?void 0:r.getScale("color");return null==a?void 0:a.scale(null==i?void 0:i[this._spec.seriesField])}const l=S(t.source)?this.getNodeList()[t.source]:t.source;return null===(a=this._colorScale)||void 0===a?void 0:a.scale(l)},this._handleEmphasisElement=t=>{var e;const i=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},s=t.item;"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 e,i;if(!this._needClear)return;const s=null===(e=this._nodeMark)||void 0===e?void 0:e.getGraphics();if(!s||!s.length)return;const n=null===(i=this._linkMark)||void 0===i?void 0:i.getGraphics();n&&n.length&&(s.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),n.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),this._needClear=!1)},this._handleNodeAdjacencyClick=e=>{const i=FF(e),s=[i.key];if(this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach(((e,n)=>{const r=FF(e);r.source===i.key?(s.includes(r.target)||s.push(r.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):r.target===i.key?(s.includes(r.source)||s.push(r.source),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),s),this._needClear=!0},this._handleLinkAdjacencyClick=e=>{const i=FF(e),s=[i.source,i.target];if(this._linkMark){const i=this._linkMark.getGraphics();if(!i||!i.length)return;i.forEach((i=>{i===e?(i.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),kq(i,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(i.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),i.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),s),this._needClear=!0},this._handleNodeRelatedClick=e=>{var i;const s=FF(e),n=this._nodeMark.getGraphics();if(!n||!n.length)return;const r=this._linkMark.getGraphics();if(!r||!r.length)return;const a=(null===(i=FF(r[0]))||void 0===i?void 0:i.parents)?"parents":"source";if("source"===a){const e=[s.key],i=[];if(r.forEach(((t,r)=>{var a,o,l,h;const c=FF(t),d=(null==c?void 0:c.parents)?"parents":"source";if(Y(c[d]).includes(s.key)){if(i.includes(null!==(a=c.key)&&void 0!==a?a:c.index)||i.push(null!==(o=c.key)&&void 0!==o?o:c.index),e.includes(c.source)||e.push(c.source),!e.includes(c.target)){e.push(c.target);let t=n.find((t=>t.data[0].key===c.target)).data[0].sourceLinks;for(;(null==t?void 0:t.length)>0;){const s=[];return t.forEach((t=>{var r,a;if(!i.includes(null!==(r=t.key)&&void 0!==r?r:t.index)&&(i.push(null!==(a=t.key)&&void 0!==a?a:t.index),!e.includes(t.target))){e.push(t.target);const i=n.find((e=>e.data[0].key===t.target));s.push(i.data[0].targetLinks)}})),void(t=s)}}}else if(c.target===s.key&&(i.includes(null!==(l=c.key)&&void 0!==l?l:c.index)||i.push(null!==(h=c.key)&&void 0!==h?h:c.index),!e.includes(c.source))){e.push(c.source);let t=n.find((t=>t.data[0].key===c.source)).data[0].targetLinks;for(;(null==t?void 0:t.length)>0;){const s=[];return t.forEach((t=>{var r,a;if(!i.includes(null!==(r=t.key)&&void 0!==r?r:t.index)&&(i.push(null!==(a=t.key)&&void 0!==a?a:t.index),!e.includes(t.source))){e.push(t.source);const i=n.find((e=>e.data[0].key===t.source));s.push(i.data[0].targetLinks)}})),void(t=s)}}})),this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach(((e,s)=>{var n;const r=FF(e);i.includes(null!==(n=r.key)&&void 0!==n?n:r.index)?(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),e)}else{const e=[s.key],i=s.targetLinks.reduce(((t,e)=>(Y(e.datum).forEach((e=>{const i=e.parents,n=i.length;for(let r=0;r<n;r++){const n=i[r].key,a=i[r+1]?i[r+1].key:s.key,o=e.value,l=t.find((t=>t.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);r.forEach(((n,r)=>{const o=FF(n),l=o.datum,h=l?l.filter((t=>t[a].some((t=>t.key===s.key)))):null,c=i.find((t=>t.source===o.source&&t.target===o.target));if(h&&h.length){e.includes(o.source)||e.push(o.source),e.includes(o.target)||e.push(o.target);const i=h.reduce(((t,e)=>t+e.value),0),s=i/o.value;return n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(n,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:s})}if(c)return e.includes(o.source)||e.push(o.source),e.includes(o.target)||e.push(o.target),n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(n,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c.value/o.value});n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),n.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),e)}this._needClear=!0},this._handleLinkRelatedClick=e=>{const i=this._nodeMark.getGraphics();if(!i||!i.length)return;const s=this._linkMark.getGraphics();if(!s||!s.length)return;if("source"===(FF(e)?"parents":"source"))this._linkMark&&s.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&i.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)}));else{const n=FF(e),r=[n.source,n.target],a=[];Y(n.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;s<i-1;s++){const i=e[s].key,n=e[s+1].key,r=t.value,o=a.find((t=>t.source===i&&t.target===n));a.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=r:a.push({source:i,target:n,value:r})}})),s.forEach((e=>{const i=FF(e),s=i.datum;if(i.source===n.source&&i.target===n.target)return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});const o=s?s.filter((t=>{const e=t.parents.map((t=>t.key));return e.includes(n.source)&&e.includes(n.target)})):null;if(o&&o.length){r.includes(i.source)||r.push(i.source),r.includes(i.target)||r.push(i.target);const s=o.filter((t=>t.parents.some(((e,i)=>{var s;return e.key===n.source&&(null===(s=t.parents[i+1])||void 0===s?void 0:s.key)===n.target})))).reduce(((t,e)=>t+e.value),0),a=s/i.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:a})}const l=a.find((t=>t.source===i.source&&t.target===i.target));if(l)return r.includes(i.source)||r.push(i.source),r.includes(i.target)||r.push(i.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/i.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._highLightElements(i,r)}this._needClear=!0}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var e,i,s,n;super.initData();const r=this.getViewData(),a=this.getRawData();if(a&&r){qF(this._dataSet,"sankeyLayout",cq),qF(this._dataSet,"sankeyFormat",hq),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!==(e=this._spec.nodeAlign)&&void 0!==e?e:"justify",nodeGap:null!==(i=this._spec.nodeGap)&&void 0!==i?i:8,nodeWidth:null!==(s=this._spec.nodeWidth)&&void 0!==s?s:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(n=this._spec.minNodeHeight)&&void 0!==n?n: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:t.TransformLevel.sankeyLayout});const{dataSet:o}=this._option;qF(o,"sankeyNodes",dq),qF(o,"flatten",GK);const l=new Ba(o,{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){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),l.transform({type:"addVChartProperty",options:{beforeCall:hH.bind(this),call:cH}},!1),this._nodesSeriesData=l,qF(o,"sankeyLinks",uq);const h=new Ba(o,{name:`sankey-link-${this.id}-data`});h.parse([this.getViewData()],{type:"dataview"}),h.transform({type:"sankeyLinks"}),h.transform({type:"addVChartProperty",options:{beforeCall:hH.bind(this),call:cH}},!1),this._linksSeriesData=h}}compileData(){var t,e;super.compileData(),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}initMark(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});const t=this._createMark(Tq.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);const e=this._createMark(Tq.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){const e=this._nodesSeriesData.latestData,i=Y(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.latestData,i=Y(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var e,i;const s=this._nodeMark;s&&(this.setMarkStyle(s,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(s,{fill:null!==(i=null===(e=this._spec.node.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByNode},"normal",t.AttributeLevel.User_Mark))}_initLinkMarkStyle(){var e,i;const s=this._linkMark;s&&(s.setGlyphConfig({direction:this.direction}),this.setMarkStyle(s,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(s,{fill:null!==(i=null===(e=this._spec.link.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByLink},"normal",t.AttributeLevel.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}_createText(t,e){if(u(t)||u(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=Gj(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),SH("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),SH("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:GF.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linkMark.getData().updateData()}_highLightElements(e,i){e&&e.length&&e.forEach((e=>{e.removeState([t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(FF(e).key)?e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}initTooltip(){this._tooltipHelper=new pq(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!u(a[0])||(a=this.getNodeList(),a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new qO;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{if(i.add(t[e]),t.children){this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))}})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{p(t[i])&&e.add(t[i]),p(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]){this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})}return this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return lq(t,r.nodes,this._seriesField),Array.from(t)}return n}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?_(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}Tq.type=t.SeriesTypeEnum.sankey,Tq.transformerConstructor=Aq,Tq.mark=Sq,Tq.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};const Mq=()=>{XU(),fG(),BM(),AD.registerGraphicComponent("path",(t=>Jg(t))),AD.registerMark(xq.type,xq),RG(),AD.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:fq(t,e)},yj))),AD.registerAnimation("sankeyLinkPath",((t,e)=>({appear:mq(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),Qw.registerBuiltInAnimate("linkPathGrowOut",yq),Qw.registerBuiltInAnimate("linkPathGrowIn",vq),bj(),AD.registerSeries(Tq.type,Tq)},Cq=(t,e)=>{let i={},s=e.fields;if(d(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=GK(n);return i=sH([{latestData:r}],e),i};class wq extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const Eq=Object.assign(Object.assign({},pH),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),Bq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class Pq extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}const Rq=()=>{AD.registerGrammarTransform("filter",{transform:(t,e)=>null==e?void 0:e.filter(t.callback)})},Lq=()=>{AD.registerGrammarTransform("map",{transform:(t,e)=>(null==e||e.forEach(((e,i)=>{t.callback(e)})),e)})},Iq=(t,e)=>{if(e.getViewBox()){const i=new a$(e).layout(t,e.getViewBox()),s=[];return EX(i,s,{maxDepth:null==e?void 0:e.maxDepth}),s.forEach(((t,i)=>{t&&[oH,"name"].forEach((i=>{t[i]=t.datum[t.depth][e.nameField]}))})),s}return[]};class Oq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.treemap,this.transformerConstructor=Pq,this._categoryField="name",this._valueField="value",this._viewBox=new Ve,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Ge),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:ZD},getRawData:()=>this.getRawData()}),k(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t,e,i,s,n;super.initData(),qF(this._dataSet,"treemap",Iq),null===(t=this._data.getDataView())||void 0===t||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?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}),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?void 0:t.dataSet)&&(qF(this._rawData.dataSet,"addVChartProperty",$j),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=Cq([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=j(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){qF(this._dataSet,"hierarchyDimensionStatistics",Cq),qF(this._dataSet,"flatten",GK);const i=new Ba(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}initMark(){const t=this._createMark(Oq.mark.nonLeaf,{isSeriesMark:!0});t&&(t.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=t);const e=this._createMark(Oq.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()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.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()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initRichStyleOfLabelMark(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}initNonLeafLabelMarkStyle(e){e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("treemap"))||void 0===e?void 0:e(),SH(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 wq(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:c}=this._matrix;this._matrix.multiply(r,a,o,l,h,c),this.disableMarkAnimation(),this.event.on(NF.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(NF.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}}Oq.type=t.SeriesTypeEnum.treemap,Oq.mark=Eq,Oq.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"}}}},Oq.transformerConstructor=Pq,G(Oq,qK),G(Oq,wW);const Dq=()=>{Rq(),Lq(),XU(),RG(),AD.registerAnimation("treemap",((t,e)=>({appear:Bq(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),bj(),AD.registerSeries(Oq.type,Oq)},Fq=Object.assign(Object.assign({},QY),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),zq=Object.assign(Object.assign({},pH),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),jq={type:"fadeIn"};function Hq(t,e){return"fadeIn"===e?jq:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}class Nq extends EH{constructor(){super(...arguments),this._supportStack=!1}}class Vq extends eH{enableByType(t){return"dimension"!==t}}const Uq="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",Wq={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:Uq,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:Uq,fill:"#ddd"}}};class Gq extends tX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.gaugePointer,this.transformerConstructor=Nq,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(Gq.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},Gq.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(Gq.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new Vq(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return p(this.radiusAxisHelper)&&p(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=$(e),s=K(e),n=vt(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),c=Math.sin(l);return{x:a*h+o*c,y:-(o*h-a*c)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}getInteractionTriggers(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),SH("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}Gq.type=t.SeriesTypeEnum.gaugePointer,Gq.mark=zq,Gq.builtInTheme={gaugePointer:Wq},Gq.transformerConstructor=Nq;const Yq=()=>{AD.registerSeries(Gq.type,Gq),xW(),XU(),AD.registerAnimation("gaugePointer",((t,e)=>{const i=Hq(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),BY(),wY()};class Xq extends EH{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class $q extends tX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.gauge,this.transformerConstructor=Xq,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=oe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData();qF(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[mF]=t[this._angleField[0]],t[fF]=e>0?i[e-1][mF]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark($q.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark($q.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),e}initMarkStyleWithSpec(e,i){if(super.initMarkStyleWithSpec(e,i),e&&"segment"===e.name){const i=this.getSpec().segment;if(i)for(const s in i.state||{})this.setMarkStyle(e,this.generateRadiusStyle(i.state[s]),s,t.AttributeLevel.User_Mark)}}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?tD(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?tD(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueStartWithoutPadAngle(t){return p(t[fF])?this.angleAxisHelper.dataToPosition([t[fF]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[mF]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),SH("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}$q.type=t.SeriesTypeEnum.gauge,$q.mark=Fq,$q.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},$q.transformerConstructor=Xq;const Kq=()=>{AD.registerSeries($q.type,$q),oY(),nX(),wY()};class qq extends nj{constructor(){super(...arguments),this.type=qq.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(t={}){return Cg(t)}_transformGraphicAttributes(t,e,i){var s,n,r;const a=super._transformGraphicAttributes(t,e,i),o=null!==(n=null!==(s=a.shape)&&void 0!==s?s:a.symbolType)&&void 0!==n?n:null===(r=t.attribute)||void 0===r?void 0:r.symbolType;return u(o)?a.symbolType="rect":a.symbolType=o,a}}qq.type="cell";function Zq(t){return!1===t?{}:{type:"fadeIn"}}class Jq extends eH{enableByType(t){return"dimension"!==t}}const Qq=Object.assign(Object.assign({},pH),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class tZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class eZ extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.heatmap,this.transformerConstructor=tZ}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Y(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(eZ.mark.cell,{isSeriesMark:!0},{morph:TH(this._spec,eZ.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(eZ.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}initCellBackgroundMarkStyle(){var e,i,s;const n=oi(null!==(s=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==s?s:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+n[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+n[0]},width:()=>this.getCellSize(this._xAxisHelper)-n[1]-n[3],height:()=>this.getCellSize(this._yAxisHelper)-n[0]-n[2]},"normal",t.AttributeLevel.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=LH(this);this._cellMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),SH("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new Jq(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}eZ.type=t.SeriesTypeEnum.heatmap,eZ.mark=Qq,eZ.builtInTheme={heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}}},eZ.transformerConstructor=tZ;const iZ=()=>{RG(),AD.registerMark(qq.type,qq),AD.registerGraphicComponent("symbol",Cg),zM(),HM(),cL(),AD.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},yj),{appear:Zq(e)}))),mV(),uV(),AD.registerSeries(eZ.type,eZ)},sZ=Object.assign(Object.assign({},pH),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),nZ=`${YD}_CORRELATION_X`,rZ=`${YD}_CORRELATION_Y`,aZ=`${YD}_CORRELATION_SIZE`,oZ=(t,e)=>{var i,s,n,r,a,o,l,h,c,d,p,g,f,m,v;if(!t||!(null==e?void 0:e.view)||!_(t))return t;const y=e.view();if(y.x1-y.x0==0||y.y1-y.y0==0||y.x1-y.x0==-1/0||y.x1-y.x0==1/0||y.y1-y.y0==-1/0||y.y1-y.y0==1/0)return t;const b=oe(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=oe(null!==(s=e.endAngle)&&void 0!==s?s:270),A=Math.max((y.x1-y.x0)/2,(y.y1-y.y0)/2),k=Rt(null!==(n=e.innerRadius)&&void 0!==n?n:0,A),T=Rt(e.outerRadius,A),M=[S(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:y.x0+Rt(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",y.x1-y.x0),S(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:y.y0+Rt(null!==(c=null===(h=e.center)||void 0===h?void 0:h[1])&&void 0!==c?c:"50%",y.y1-y.y0)],C=Bt(e.field),w=t.map(C),[E,B]=It(w),P=E===B?t=>(k+T)/2:t=>k+(T-k)*(t-E)/(B-E),R=u(e.radiusField)?C:Bt(e.radiusField),L=null!==(p=null===(d=null==e?void 0:e.radiusRange)||void 0===d?void 0:d[1])&&void 0!==p?p:5;let I=t=>L;if(R){const[i,s]=R!==C?It(t.map(R)):[E,B],n=null!==(f=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==f?f:5,r=null!==(v=null===(m=e.radiusRange)||void 0===m?void 0:m[1])&&void 0!==v?v:5;i!==s&&(I=t=>n+(r-n)*(R(t)-i)/(s-i))}const O=Math.min(b,x),D=Math.max(b,x),F=lZ(O,D,t.length),z=[],j=(D-O)/60;return t.forEach(((t,e)=>{const i=P(w[e]),s=I(t);let n,r,a=F[e];for(let t=0;t<60&&(n=M[0]+i*Math.cos(a),r=M[1]+i*Math.sin(a),hZ({x:n,y:r,size:s},z)||n-s<y.x0||n+s>y.x1||r-s<y.y0||r+s>y.y1);t++)t<59&&(a+=j,a>D?a=O:a<O&&(a=D));z.push(Object.assign({[nZ]:n,[rZ]:r,[aZ]:s},t))})),z},lZ=(t,e,i)=>{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const c=[];let d=t;for(;l<i;)h<n&&(c.push(d+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*r*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,0===s?s=r/2:s/=2,d=-1===o?e-s:t+s,a>=2&&(r/=2,n*=2));return c},hZ=(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))),cZ=(t,e)=>{if(!t||!_(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[qD]:null==n?void 0:n[qD],[JD]:null==n?void 0:n[JD]}};class dZ extends gG{constructor(){super(...arguments),this.type=dZ.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)=>{const{ripple:s=i.attribute.ripple,size:n=i.attribute.size}=t,r=vt(s,0,1),a=.5*n;return{ripple0:{size:n+a*r,fillOpacity:.75-.25*r},ripple1:{size:n+a*(1+r),fillOpacity:.5-.25*r},ripple2:{size:n+a*(2+r),fillOpacity:.25-.25*r}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}}dZ.type="ripple";const uZ=()=>{fG(),HM(),AD.registerMark(dZ.type,dZ),AD.registerGraphicComponent("symbol",(t=>Cg(t)))},pZ=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class gZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class fZ extends $G{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.correlation,this.transformerConstructor=gZ,this._viewBox=new Ve}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){p(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){p(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){p(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;qF(this._dataSet,"correlation",oZ);const s=new Ea;ZF(s,"dataview",Ma),qF(s,"correlationCenter",cZ);const n=new Ba(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new Qz(this._option,n)}compileData(){var t;super.compileData(),null===(t=this._centerSeriesData)||void 0===t||t.compile()}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){const e=this._createMark(fZ.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:qD});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);const i=this._createMark(fZ.mark.ripplePoint,{key:qD,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);const s=this._createMark(fZ.mark.centerPoint,{key:qD,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});s&&(s.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=s)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var e,i,s,n;const r=this._nodePointMark;if(!r)return;const a=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(r,{x:t=>t[nZ],y:t=>t[rZ],size:t=>t[aZ],fill:null!==(s=a.fill)&&void 0!==s?s:this.getColorAttribute(),fillOpacity:null!==(n=a.fillOpacity)&&void 0!==n?n:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initRipplePointMarkStyle(){var e,i,s,n,r;const a=this._ripplePointMark;if(!a)return;const o=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(s=o.fill)&&void 0!==s?s:this.getColorAttribute(),opacity:null!==(n=o.fillOpacity)&&void 0!==n?n:.2,ripple:null!==(r=o.ripple)&&void 0!==r?r:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initCenterPointMarkStyle(){var e,i,s,n,r,a;const o=this._centerPointMark;o&&this.setMarkStyle(o,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(s=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),fillOpacity:null!==(a=null===(r=null===(n=this._spec.centerPoint)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(e){e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),SH("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()}}fZ.type=t.SeriesTypeEnum.correlation,fZ.mark=sZ,fZ.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},fZ.transformerConstructor=gZ;const mZ=()=>{aN(),uZ(),AD.registerSeries(fZ.type,fZ),AD.registerAnimation("correlation",((t,e)=>Object.assign({appear:pZ(0,e)},vj)))},vZ={duration:2e3,loop:!0,channel:{wave:{from:0,to:1}}},yZ=t=>({duration:2e3,channel:{wave:{from:0,to:1},height:t.height,dy:t.dy}}),_Z=yZ;function bZ(t,e){switch(e){case"wave":default:return vZ;case"grow":return yZ(t);case"waveGrow":return _Z(t)}}function xZ(t,e){switch(e){case"wave":default:return vZ;case"grow":case"waveGrow":return(t=>({duration:2e3,channel:{dy:t.dy}}))(t)}}const SZ=Object.assign(Object.assign({},pH),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}});class AZ extends gG{constructor(){super(...arguments),this.type=AZ.type,this._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},this._positionChannels=["wave","y","height"],this._positionEncoder=(t,e,i)=>{const{wave:s=i.attribute.wave,y:n=i.attribute.y,height:r=i.attribute.height}=t,a=[],o=[],l=[];for(let t=0;t<21;t++){const e=50*t-500,i=n+(t%2==0?20:0),h=n+r;a.push({x:e+100*s,y:i,y1:h}),o.push({x:e+200*s-40,y:i,y1:h}),l.push({x:e+300*s-20,y:i,y1:h})}return{wave0:{x:0,y:0,points:a},wave1:{x:0,y:0,points:o},wave2:{x:0,y:0,points:l}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{wave:0})}}AZ.type="liquid";const kZ=(t,e)=>"drop"===t?function(t,e,i){const s=4*i/3,n=Math.max(s,2*i),r=s/2,a=t,o=r+e-n/2,l=Math.asin(r/(.85*(n-r))),h=Math.sin(l)*r,c=Math.cos(l)*r,d=a-c,u=o+h,p=t,g=o+r/Math.sin(l);return`\n M ${d} ${u}\n A ${r} ${r} 0 1 1 ${d+2*c} ${u}\n Q ${p} ${g} ${t} ${e+n/2}\n Q ${p} ${g} ${d} ${u}\n Z \n `}(0,0,e):t;class TZ extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>this.series.getValueField(),this.markTooltipValueCallback=t=>t[this.series.getValueField()],this.shapeStrokeCallback=t=>this.series.getMarkInName("liquid").getAttribute("fill",t)}}class MZ extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.liquid,this.transformerConstructor=oN,this._liquidBackgroundMark=null,this._liquidOutlineMark=null,this._getLiquidPosY=()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?e*this._heightRatio:e*(1-this._heightRatio),t+i},this._getLiquidHeight=()=>{const{height:t}=this._getLiquidBackPosAndSize();return t*this._heightRatio},this._getLiquidBackPosAndSize=(t=!1)=>{var e,i;let{top:s=0,bottom:n=0,left:r=0,right:a=0}=this._marginSpec,{top:o=0,bottom:l=0,left:h=0,right:c=0}=t?{}:this._paddingSpec;"triangle"===this._maskShape&&(n/=Math.sqrt(3),s=s/Math.sqrt(3)*2,l/=Math.sqrt(3),o=o/Math.sqrt(3)*2);const{width:d,height:u}=null!==(i=null===(e=this._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},p=d/2+(r+h-(a+c))/2,g=u/2+(s+o-(n+l))/2;let f=d-(r+a+h+c),m=u-(s+n+o+l);const v=Math.min(f,m);return"rect"!==this._maskShape&&(f=v,m=v),{x:p,y:g,size:v,width:f,height:m,startX:p-f/2,startY:g-m/2,endX:p+f/2,endY:g+m/2}},this._getLiquidBackPath=(t=!1)=>{var e;let i;if("rect"===this._maskShape){const{x:e,y:s,width:n,height:r}=this._getLiquidBackPosAndSize(t);i=Ig({x:e-n/2,y:s-r/2,width:n,height:r,fill:!0})}else{const{x:s,y:n,size:r}=this._getLiquidBackPosAndSize(t);i=Cg({x:s,y:n,size:r,symbolType:kZ(null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle",r),fill:!0})}return[i]}}setValueField(t){p(t)&&(this._valueField=t)}getValueField(){return this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._marginSpec=hD(this._spec.outlineMargin),this._paddingSpec=hD(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}viewDataUpdate(t){super.viewDataUpdate(t),this._heightRatio=Yt(...this._data.getLatestData().map((t=>t[this._valueField])))}initMark(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}initMarkStyle(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}_initLiquidOutlineMark(){return this._liquidOutlineMark=this._createMark(MZ.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}_initLiquidBackgroundMark(){return this._liquidBackgroundMark=this._createMark(MZ.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}_initLiquidMark(){return this._liquidGroupMark=this._createMark(MZ.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(MZ.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}_initLiquidOutlineMarkStyle(){const e=this._liquidOutlineMark;e.created(),this.setMarkStyle(e,{stroke:this.getColorAttribute(),width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath(!0)},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}_initLiquidBackgroundMarkStyle(){const e=this._liquidBackgroundMark;e.created(),this.setMarkStyle(e,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath()},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}_initLiquidMarkStyle(){const e=this._liquidMark,i=this._liquidGroupMark;i&&this.setMarkStyle(i,{x:()=>this._region.getLayoutStartPoint().x+this._region.getLayoutRect().width/2,angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),e&&this.setMarkStyle(e,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}initTooltip(){this._tooltipHelper=new TZ(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}getInteractionTriggers(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}initAnimation(){var t,e,i,s;const n={height:{from:0,to:()=>this._getLiquidHeight()},dy:{from:()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?0:e,t+i}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("liquid"))||void 0===i?void 0:i(n,r),SH("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("liquidGroup"))||void 0===s?void 0:s(n,r),SH("liquidGroup",this._spec,this._markAttributeContext)))}initEvent(){super.initEvent(),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(()=>{this._option.getChart().getComponentsByKey("indicator").forEach((t=>{var e,i,s;const n=null===(e=this._liquidMark.getGraphics()[0].getSubGraphic())||void 0===e?void 0:e[0];let{y1:r,y2:a}=n.globalAABBBounds;r+=this._region.getLayoutStartPoint().y,a+=this._region.getLayoutStartPoint().y,null===(s=null===(i=null==t?void 0:t.getIndicatorComponent())||void 0===i?void 0:i.getChildren()[0])||void 0===s||s.getChildren().forEach((t=>{const{y1:e,y2:i}=t.globalAABBBounds;if(r<e&&a>i){const e=dC(t.attribute.fill,n.attribute.fill);t.setAttribute("fill",e)}}))}))}))}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}valueToPosition(t,e){return null}getStatisticFields(){return[]}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._liquidMark]}}MZ.type=t.SeriesTypeEnum.liquid,MZ.mark=SZ,MZ.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},MZ.transformerConstructor=oN;const CZ=()=>{fG(),yM(),AD.registerMark(AZ.type,AZ),AD.registerGraphicComponent("area",(t=>ef(t))),oj(),AD.registerAnimation("liquid",((t,e)=>({appear:bZ(t,e),enter:bZ(t,e),exit:bZ(t,e)}))),AD.registerAnimation("liquidGroup",((t,e)=>({appear:xZ(t,e),enter:xZ(t,e),exit:xZ(t,e)}))),AD.registerSeries(MZ.type,MZ)},wZ=t=>Y(t).join(",");class EZ extends eH{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>wZ(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>wZ(null==t?void 0:t[this.series.getDimensionField()[0]])}}const BZ=Object.assign(Object.assign({},pH),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),PZ=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},RZ=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class LZ extends cE{onBind(){var t,e;this.fromCircles={},null===(t=_$(this.target.attribute.arcs))||void 0===t||t.forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},null===(e=_$(this.target.getFinalAttribute().arcs))||void 0===e||e.forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=v$(s);this.target.setAttributes({arcs:n,path:y$(n)})}}class IZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}const OZ=(t,e)=>{const i=e.getViewBox();return i&&(null==t?void 0:t.length)?b$(Object.assign({setField:e.setField,valueField:e.valueField},i),t):[]};class DZ extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.venn,this.transformerConstructor=IZ,this._viewBox=new Ve}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:ZD)}initData(){var t;super.initData(),qF(this._dataSet,"venn",OZ),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:{getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},setField:this._categoryField,valueField:this._valueField}})}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(DZ.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(DZ.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}initLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:t=>t.labelX,y:t=>t.labelY,text:t=>wZ(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}initOverlapLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:t=>t.labelX,y:t=>t.labelY,text:t=>wZ(t.sets)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new EZ(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:wZ(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return wZ(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[wZ(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Y(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(wZ(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))}))}}DZ.type=t.SeriesTypeEnum.venn,DZ.mark=BZ,DZ.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},DZ.transformerConstructor=IZ;const FZ=()=>{oY(),xW(),AD.registerAnimation("vennCircle",((t,e)=>({appear:PZ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),AD.registerAnimation("vennOverlap",((t,e)=>({appear:RZ(e),update:{custom:LZ},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),bj(),AD.registerGrammarTransform("vennMark",{transform:x$}),AD.registerSeries(DZ.type,DZ)};class zZ extends JU{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.mosaic,this.transformerConstructor=ZU}get bandWidthField(){return this._bandWidthField}getStack(){return!0}getPercent(){return this._spec.percent}getGroupFields(){return"vertical"===this.direction?this._specXField:this._specYField}setAttrFromSpec(){super.setAttrFromSpec();const t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(uF),this.setFieldX2(dF)),this.setFieldY(gF),this.setFieldY2(pF)):(t&&(this.setFieldY(uF),this.setFieldY2(dF)),this.setFieldX(gF),this.setFieldX2(pF)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}parseLabelStyle(t,e){if((null==e?void 0:e.filterByGroup)&&u(t.dataFilter)){const i=this.getGroupFields(),{field:s,type:n="max",filter:r}=e.filterByGroup;delete t.filterField;const a=i.indexOf(s);if(a<0)return;const o=!!(a%2)?"min"===n?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===n?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,l="min"===n?(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])<(null===(s=e.data)||void 0===s?void 0:s[o])}:(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])>(null===(s=e.data)||void 0===s?void 0:s[o])};t.dataFilter=t=>{const e={};return t.forEach((t=>{const i=t.data,n=null==i?void 0:i[s];u(n)||r&&!r(t)||e[n]&&!l(t,e[n])||(e[n]=t)})),t.filter((t=>{var i;const n=null===(i=t.data)||void 0===i?void 0:i[s];return e[n]&&e[n]===t}))}}return t}}zZ.type=t.SeriesTypeEnum.mosaic,zZ.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},zZ.transformerConstructor=ZU;const jZ=()=>{XU(),RG(),bj(),uV(),AD.registerSeries(zZ.type,zZ)};class HZ extends UV{_isValidSeries(e){return e===t.SeriesTypeEnum.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 NZ extends NV{constructor(){super(...arguments),this.transformerConstructor=HZ,this.type="map",this.seriesType=t.SeriesTypeEnum.map}}NZ.type="map",NZ.seriesType=t.SeriesTypeEnum.map,NZ.transformerConstructor=HZ;const VZ=()=>{AU(),IW(),AD.registerChart(NZ.type,NZ)};class UZ extends UV{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Y(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return p(r)&&n.forEach((t=>{u(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["radius","outerRadius","innerRadius","startAngle","endAngle","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),_(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),p(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class WZ extends UZ{needAxes(){return!1}_getDefaultSeriesSpec(t){const 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,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),u(l.type)&&(l.type="linear"),u(o.type)&&(o.type="band");const h=_N(l,{min:0,max:1});u(l.min)&&(l.min=h.min),u(l.max)&&(l.max=h.max),s&&Object.assign(l,SD({},s,l)),n&&Object.assign(o,SD({},n,o))}}class GZ extends UZ{needAxes(){return!0}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.categoryField=t.categoryField||t.angleField,e.valueField=t.valueField||t.radiusField,e}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class YZ extends UZ{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;const 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?void 0:e.emptyCircle,i}}class XZ extends NV{constructor(){super(...arguments),this.transformerConstructor=YZ}}XZ.transformerConstructor=YZ;class $Z extends XZ{constructor(){super(...arguments),this.transformerConstructor=YZ,this.type="pie",this.seriesType=t.SeriesTypeEnum.pie}}$Z.type="pie",$Z.seriesType=t.SeriesTypeEnum.pie,$Z.transformerConstructor=YZ;const KZ=()=>{AU(),pY(),AD.registerChart($Z.type,$Z)};class qZ extends GZ{_getDefaultSeriesSpec(t){var e,i,s;const n=super._getDefaultSeriesSpec(t);return n.radius=null!==(e=t.radius)&&void 0!==e?e:ON,n.outerRadius=null!==(i=t.outerRadius)&&void 0!==i?i:ON,n.innerRadius=null!==(s=t.innerRadius)&&void 0!==s?s:0,n.stack=t.stack,n.percent=t.percent,n}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&u(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Y(t.crosshair||{}).map((t=>SD({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}const ZZ=(t,e)=>{if(!t)return null;const i=$H(t,(t=>"angle"===t.getOrient()),e),s=$H(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&TP(i.type)){const l=i.domain(),h=i.range(),c=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-c.x,y:o-t.getLayoutStartPoint().y-c.y};let p=wO({x:1,y:0},d);p=((t,e)=>{const i=2*Math.PI,s=K(e),n=$(e);return t<s?t+=Math.ceil((s-t)/i)*i:t>n&&(t-=Math.ceil((t-n)/i)*i),t})(p,h);const g=EO(d),f=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==f?void 0:f.range();if((p-(null==h?void 0:h[0]))*(p-(null==h?void 0:h[1]))>0||(g-(null==m?void 0:m[0]))*(g-(null==m?void 0:m[1]))>0)return;const v=t.invert(p);if(u(v))return;let y=l.findIndex((t=>(null==t?void 0:t.toString())===v.toString()));y<0&&(y=void 0);const _=YH(v,t,"polar",r);n.push({index:y,value:v,position:i.scale(v),axis:t,data:_})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&TP(s.type)){const h=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let d=wO({x:1,y:0},c);d<-Math.PI/2&&(d=2*Math.PI+d);const p=EO(c),g=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==g?void 0:g.range();if((d-(null==f?void 0:f[0]))*(d-(null==f?void 0:f[1]))>0||(p-(null==l?void 0:l[0]))*(p-(null==l?void 0:l[1]))>0)return;const m=s.invert(p);if(u(m))return;let v=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));v<0&&(v=void 0);const y=YH(m,t,"polar",r);n.push({index:v,value:m,position:s.scale(m),axis:t,data:y})}})),n.length?n:null};class JZ extends NV{constructor(){super(...arguments),this.transformerConstructor=qZ,this.type="rose",this.seriesType=t.SeriesTypeEnum.rose}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}JZ.type="rose",JZ.seriesType=t.SeriesTypeEnum.rose,JZ.transformerConstructor=qZ,G(JZ,$V);const QZ=()=>{xU(),AU(),JV(),ZV(),RY(),AD.registerChart(JZ.type,JZ)};class tJ extends GZ{_getDefaultSeriesSpec(t){var e;const i=super._getDefaultSeriesSpec(t);return i.line=t.line,i.point=t.point,i.stack=t.stack,i.percent=t.percent,i.area=SD({visible:!1},t.area),i.seriesMark=null!==(e=t.seriesMark)&&void 0!==e?e:"area",i.activePoint=t.activePoint,i.pointDis=t.pointDis,i.pointDisMul=t.pointDisMul,i.markOverlap=t.markOverlap,i}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Y(t.crosshair||{}).map((t=>SD({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class eJ extends NV{constructor(){super(...arguments),this.transformerConstructor=tJ,this.type="radar",this.seriesType=t.SeriesTypeEnum.radar}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}eJ.type="radar",eJ.seriesType=t.SeriesTypeEnum.radar,eJ.transformerConstructor=tJ,G(eJ,$V);const iJ=()=>{xU(),AU(),TU(),JV(),ZV(),NY(),AD.registerChart(eJ.type,eJ)};class sJ extends UV{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=g(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{R(e,"trimPadding")&&SD(e,Az(this.type,t))})),this._transformAxisSpec(t)}}class nJ extends NV{constructor(){super(...arguments),this.transformerConstructor=sJ,this.type="common"}_setModelOption(){this._modelOption.getDimensionInfo=(t,e,i)=>{var s,n;return[...null!==(s=nU(t,e,i))&&void 0!==s?s:[],...null!==(n=ZZ(t,e))&&void 0!==n?n:[]]},this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}nJ.type="common",nJ.transformerConstructor=sJ,G(nJ,$V);const rJ=()=>{xU(),AU(),TU(),JV(),AD.registerChart(nJ.type,nJ),ZV()};class aJ extends UV{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Y(e.data)[0];return t instanceof Ba?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Y(t.data).find(((t,i)=>e.dataId?t instanceof Ba?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof Ba?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(e){var i,s,n,r,a,o,l,h,c,d,u,p,g,f,m;super.transformSpec(e);let v=0;const y=[],_=[],b=[],x=[],S=[],A=this._option.getCompiler().getStage(),k=(A.viewWidth,A.viewHeight);let T=0;if(null==e?void 0:e.legends){y.push({modelId:`legendRow${v}`,col:1,row:v}),this.addAttrToComponentSpec(e.legends,"id",`legendRow${v}`);const t=Y(e.legends);let l=null!==(i=t[0].height)&&void 0!==i?i:40;if(t[0].padding){const e=hD(t[0].padding);l+=Number(null!==(s=null==e?void 0:e.bottom)&&void 0!==s?s:0),l+=Number(null!==(n=null==e?void 0:e.top)&&void 0!==n?n:0),t[0].offsetY=Number(null!==(a=null===(r=t[0])||void 0===r?void 0:r.offsetY)&&void 0!==a?a:0)+Number(null!==(o=null==e?void 0:e.top)&&void 0!==o?o:0)}S.push({index:v,size:l}),T+=l,v++}(null==e?void 0:e.dataZoom)&&(y.push({modelId:`dataZoomRow${v}`,col:1,row:v}),this.addAttrToComponentSpec(e.dataZoom,"id",`dataZoomRow${v}`),T+=60,v++,this.addPaddingRow(S,v,10),T+=10,v++),T+=60,null!==e.axes&&"top"!==(null===(h=null===(l=null==e?void 0:e.axes)||void 0===l?void 0:l[0])||void 0===h?void 0:h.orient)||(this.addOrientAxes(_,y,v,e),v++);const M=e.series.filter((e=>e.type!==t.SeriesTypeEnum.link)).length,C=(k-T-20*M)/M,w=(null===(c=null==e?void 0:e.appendPadding)||void 0===c?void 0:c.left)||0,E=(null===(d=null==e?void 0:e.appendPadding)||void 0===d?void 0:d.right)||0;null===(u=null==e?void 0:e.series)||void 0===u||u.forEach((i=>{var s,n;if([t.SeriesTypeEnum.bar,t.SeriesTypeEnum.line,t.SeriesTypeEnum.area,t.SeriesTypeEnum.dot].includes(i.type)){if(y.push({modelId:`${i.type}Row${v}`,col:1,row:v}),y.push({modelId:`axesLeftRow${v}`,col:0,row:v}),_.push({id:`${i.type}Row${v}`,clip:!1}),S.push({index:v,size:(null==i?void 0:i.height)||C}),b.push({orient:"left",id:`axesLeftRow${v}`,type:i.type===t.SeriesTypeEnum.dot?"band":"linear",visible:i.type!==t.SeriesTypeEnum.dot,title:{visible:!0,autoRotate:!1,style:{text:null==i?void 0:i.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(s=null==i?void 0:i.grid)||void 0===s?void 0:s.visible)||(null===(n=null==i?void 0:i.grid)||void 0===n?void 0:n.visible),style:(t,e)=>{var s,n,r,a,o;let l=0;if(0===e){const t=null===(s=null==i?void 0:i.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==i?void 0:i.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:_.length-1}),i.type===t.SeriesTypeEnum.dot){y.push({modelId:`scrollBarRightRow${v}`,col:2,row:v});const s=this._getSeriesDataLength(e,i);let n=0;s&&(n=((null==i?void 0:i.height)||C)/(30*s)),x.push(Object.assign({orient:"right",visible:i.type===t.SeriesTypeEnum.dot&&n<1,id:`scrollBarRightRow${v}`,start:0,end:Math.min(n,1),filterMode:"axis",regionIndex:_.length-1,axisId:`axesLeftRow${v}`},Y(null==e?void 0:e.scrollBar)[0]))}i.regionIndex=_.length-1,v++,this.addPaddingRow(S,v,(null==i?void 0:i.padding)||20),v++,i.leftAppendPadding=w,i.type===t.SeriesTypeEnum.dot&&(i.title.style.dx=-w,i.subTitle.style.dx=-w)}})),this.addPaddingRow(S,v,20),v++,null===(p=null==e?void 0:e.series)||void 0===p||p.forEach((i=>{if(i.type===t.SeriesTypeEnum.link){const t=i.dotSeriesIndex+1;y.push({modelId:`${i.type}Row${t}`,col:1,row:t-1}),i.regionIndex=e.series[i.dotSeriesIndex].regionIndex,i.leftAppendPadding=w,i.height=e.series[i.dotSeriesIndex].height,i.clipHeight=e.series[i.dotSeriesIndex].clipHeight}})),(null==e?void 0:e.legends)&&this.addAttrToComponentSpec(e.legends,"regionIndex",[_.length-1]),"bottom"===(null===(f=null===(g=null==e?void 0:e.axes)||void 0===g?void 0:g[0])||void 0===f?void 0:f.orient)&&(this.addOrientAxes(_,y,v,e),v++);const B={type:"grid",col:4,row:v,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:E}],rowHeight:S,elements:y};e.layout=B,e.region=_,null===(m=e.axes)||void 0===m||m.push(...b),e.scrollBar=x}}class oJ extends NV{constructor(){super(...arguments),this.transformerConstructor=aJ,this.type="sequence"}_createSeries(i,s){if(!i)return;const{spec:n}=s,r=e(s,["spec"]);let a;if(n.type===t.SeriesTypeEnum.link&&(n.dotSeriesSpec=this._spec.series[n.dotSeriesIndex]),n.regionId&&(a=this.getRegionsInUserId(n.regionId)),a||(a=this.getRegionsInIndex(n.regionIndex?[n.regionIndex]:void 0)[0]),!a)return;const o=new i(n,Object.assign(Object.assign(Object.assign({},this._modelOption),r),{region:a,specKey:"series",globalScale:this._globalScale}));o&&(o.created(),this._series.push(o),a.addSeries(o))}}oJ.type="sequence",oJ.transformerConstructor=aJ;const lJ=()=>{xU(),AU(),XY(),JY(),mV(),uV(),AD.registerChart(oJ.type,oJ)};class hJ extends WV{transformSpec(t){super.transformSpec(t),t.axes.forEach((t=>t.type="linear"))}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["x2Field","y2Field","barMinHeight","barBackground","barGap"])}}class cJ extends NV{constructor(){super(...arguments),this.transformerConstructor=hJ}}cJ.transformerConstructor=hJ,G(cJ,$V);class dJ extends hJ{transformSpec(t){super.transformSpec(t),bz(t)}}class uJ extends cJ{constructor(){super(...arguments),this.transformerConstructor=dJ,this.type="histogram",this.seriesType=t.SeriesTypeEnum.bar}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}uJ.type="histogram",uJ.seriesType=t.SeriesTypeEnum.bar,uJ.transformerConstructor=dJ;const pJ=()=>{xU(),AU(),TU(),JV(),ZV(),QU(),AD.registerChart(uJ.type,uJ)};class gJ extends WZ{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return s.progress=t.progress,s.track=t.track,s.tickMask=t.tickMask,s.cornerRadius=null!==(e=t.cornerRadius)&&void 0!==e?e:0,s.roundCap=null!==(i=t.roundCap)&&void 0!==i&&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 fJ extends NV{constructor(){super(...arguments),this.transformerConstructor=gJ,this.type="circularProgress",this.seriesType=t.SeriesTypeEnum.circularProgress}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}fJ.type="circularProgress",fJ.seriesType=t.SeriesTypeEnum.circularProgress,fJ.transformerConstructor=gJ,G(fJ,$V);const mJ=()=>{xU(),AU(),JV(),ZV(),oX(),AD.registerChart(fJ.type,fJ)};class vJ extends WZ{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}_getDefaultCircularProgressSeriesSpec(e){const i=super._getDefaultSeriesSpec(e);return i.type=t.SeriesTypeEnum.circularProgress,i}transformSpec(e){var i,s,n,r,a;super.transformSpec(e);let o=null===(i=e.series)||void 0===i?void 0:i.find((e=>e.type===t.SeriesTypeEnum.gauge||e.type===t.SeriesTypeEnum.circularProgress));u(o)&&(o=null!==(s=e.gauge)&&void 0!==s?s:this._getDefaultCircularProgressSeriesSpec(e),"circularProgress"===o.type&&(u(o.radiusField)&&u(o.categoryField)&&(o.radiusField=null!==(r=null!==(n=e.radiusField)&&void 0!==n?n:e.categoryField)&&void 0!==r?r:e.seriesField),u(o.valueField)&&u(o.angleField)&&(o.valueField=null!==(a=e.valueField)&&void 0!==a?a:e.angleField)),1===e.series.length?e.series.push(o):e.series.forEach((t=>{t.type===o.type&&Object.keys(o).forEach((e=>{e in t||(t[e]=o[e])}))}))),o.type===t.SeriesTypeEnum.circularProgress?this._transformProgressAxisSpec(e,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:t.LayoutZIndex.Region+50}):this._transformGaugeAxisSpec(e)}_transformGaugeAxisSpec(e){var i;e.axes||(e.axes=[]);const s={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(s.radius=t),"angle"===e&&(s.angle=t)})),s.angle||(s.angle={orient:"angle",visible:!0},e.axes.push(s.angle)),s.radius||(s.radius={orient:"radius",visible:!1},e.axes.push(s.radius)),u(s.angle.type)&&(s.angle.type="linear"),u(s.radius.type)&&(s.radius.type="linear"),u(s.angle.zIndex)&&(s.angle.zIndex=t.LayoutZIndex.Region+50)}}class yJ extends NV{constructor(){super(...arguments),this.transformerConstructor=vJ,this.type="gauge",this.seriesType=t.SeriesTypeEnum.gaugePointer}}yJ.type="gauge",yJ.seriesType=t.SeriesTypeEnum.gaugePointer,yJ.transformerConstructor=vJ;const _J=()=>{AU(),Yq(),Kq(),oX(),AD.registerChart(yJ.type,yJ)};class bJ extends UV{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 xJ extends NV{constructor(){super(...arguments),this.transformerConstructor=bJ,this.type="wordCloud",this.seriesType=t.SeriesTypeEnum.wordCloud}}xJ.transformerConstructor=bJ;class SJ extends xJ{constructor(){super(...arguments),this.transformerConstructor=bJ,this.type="wordCloud",this.seriesType=t.SeriesTypeEnum.wordCloud}}SJ.type="wordCloud",SJ.seriesType=t.SeriesTypeEnum.wordCloud,SJ.transformerConstructor=bJ;const AJ=()=>{AU(),vK(),AD.registerChart(SJ.type,SJ)},kJ=()=>{AD.registerGrammarTransform("wordcloudShape",{transform:fK}),vK(),AJ()};class TJ extends UV{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 MJ extends NV{constructor(){super(...arguments),this.transformerConstructor=TJ,this.type="funnel",this.seriesType=t.SeriesTypeEnum.funnel}}MJ.type="funnel",MJ.seriesType=t.SeriesTypeEnum.funnel,MJ.transformerConstructor=TJ;const CJ=()=>{AU(),FK(),AD.registerChart(MJ.type,MJ)};class wJ extends WV{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bandWidth","progress","track","clamp"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"horizontal",s.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,s}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="band"),u(i.type)&&(i.type="linear");const n=_N(i,{min:0,max:1});u(i.min)&&(i.min=n.min),u(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="linear"),u(e.type)&&(e.type="band");const n=_N(s,{min:0,max:1});u(s.min)&&(s.min=n.min),u(s.max)&&(s.max=n.max)}}}class EJ extends NV{constructor(){super(...arguments),this.transformerConstructor=wJ,this.type="linearProgress",this.seriesType=t.SeriesTypeEnum.linearProgress}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}EJ.type="linearProgress",EJ.seriesType=t.SeriesTypeEnum.linearProgress,EJ.transformerConstructor=wJ,G(EJ,$V);const BJ=()=>{xU(),AU(),JV(),ZV(),fX(),AD.registerChart(EJ.type,EJ)};class PJ extends WV{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),bz(t)}}class RJ extends NV{constructor(){super(...arguments),this.transformerConstructor=PJ,this.type="rangeColumn",this.seriesType=t.SeriesTypeEnum.rangeColumn}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}RJ.type="rangeColumn",RJ.seriesType=t.SeriesTypeEnum.rangeColumn,RJ.transformerConstructor=PJ;const LJ=()=>{xU(),AU(),JV(),ZV(),NG(),AD.registerChart(RJ.type,RJ)};class IJ extends UV{_getDefaultSeriesSpec(t){const e=p(t.startAngle)?t.startAngle:-90,i=p(t.endAngle)?t.endAngle:e+le(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 OJ extends NV{constructor(){super(...arguments),this.transformerConstructor=IJ,this.type="sunburst",this.seriesType=t.SeriesTypeEnum.sunburst}}OJ.type="sunburst",OJ.seriesType=t.SeriesTypeEnum.sunburst,OJ.transformerConstructor=IJ;const DJ=()=>{AU(),eq(),AD.registerChart(OJ.type,OJ)};class FJ extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class zJ extends NV{constructor(){super(...arguments),this.transformerConstructor=FJ,this.type="circlePacking",this.seriesType=t.SeriesTypeEnum.circlePacking}}zJ.type="circlePacking",zJ.seriesType=t.SeriesTypeEnum.circlePacking,zJ.transformerConstructor=FJ;const jJ=()=>{AU(),oq(),AD.registerChart(zJ.type,zJ)};class HJ extends UV{_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 NJ extends NV{constructor(){super(...arguments),this.transformerConstructor=HJ,this.type="treemap",this.seriesType=t.SeriesTypeEnum.treemap}}NJ.type="treemap",NJ.seriesType=t.SeriesTypeEnum.treemap,NJ.transformerConstructor=HJ;const VJ=()=>{AU(),Dq(),AD.registerChart(NJ.type,NJ)};class UJ extends tW{transformSpec(t){super.transformSpec(t),t.legends&&Y(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),bz(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.bar=t.bar,e.stackLabel=t.stackLabel,e.leaderLine=t.leaderLine,e.total=t.total,e}}class WJ extends eW{constructor(){super(...arguments),this.transformerConstructor=UJ,this.type="waterfall",this.seriesType=t.SeriesTypeEnum.waterfall}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}WJ.type="waterfall",WJ.seriesType=t.SeriesTypeEnum.waterfall,WJ.transformerConstructor=UJ;const GJ=()=>{xU(),AU(),TU(),JV(),ZV(),hG(),AD.registerChart(WJ.type,WJ)};class YJ extends WV{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=super._getDefaultSeriesSpec(t,["boxPlot","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"vertical",s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),bz(t)}}class XJ extends NV{constructor(){super(...arguments),this.transformerConstructor=YJ,this.type="boxPlot",this.seriesType=t.SeriesTypeEnum.boxPlot}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}XJ.type="boxPlot",XJ.seriesType=t.SeriesTypeEnum.boxPlot,XJ.transformerConstructor=YJ;const $J=()=>{xU(),AU(),JV(),ZV(),BG(),AD.registerChart(XJ.type,XJ)};class KJ extends UV{_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)}}class qJ extends NV{constructor(){super(...arguments),this.transformerConstructor=KJ,this.type="sankey",this.seriesType=t.SeriesTypeEnum.sankey}_setStateInDatum(t,e,i,s){const n=_(e)?e[0]:e;if(!n)return void this._interaction.clearByState(t);let r=null;this.filterGraphicsByDatum(n,{filter:(t,e)=>"text"!==e.type&&e.getProduct()&&(!i||i(t,e)),region:s,getDatum:t=>{var e;let i=null===(e=FF(t))||void 0===e?void 0:e.datum;return _(i)&&(i=i[0]),i},callback:(t,e,i,s)=>{var n,r;const a=e.getProductId();a&&(a.includes("node")||a.includes("link"))&&(null===(r=(n=i)._handleEmphasisElement)||void 0===r||r.call(n,{item:t,mark:e}))},regionCallback:(t,e)=>{n&&t.length&&(r=t[0])}}),r&&this._interaction.updateStateOfGraphics(t,[r])}}qJ.type="sankey",qJ.seriesType=t.SeriesTypeEnum.sankey,qJ.transformerConstructor=KJ;const ZJ=()=>{AU(),Lh.load(nC),Mq(),AD.registerChart(qJ.type,qJ)};class JJ extends WV{_getDefaultSeriesSpec(t){var e,i;const 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)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),bz(t)}}class QJ extends NV{constructor(){super(...arguments),this.transformerConstructor=JJ,this.type="rangeArea",this.seriesType=t.SeriesTypeEnum.rangeArea}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}QJ.type="rangeArea",QJ.seriesType=t.SeriesTypeEnum.rangeArea,QJ.transformerConstructor=JJ;const tQ=()=>{xU(),AU(),TU(),JV(),ZV(),XG(),AD.registerChart(QJ.type,QJ)};class eQ extends WV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","cell"])}}class iQ extends NV{constructor(){super(...arguments),this.transformerConstructor=eQ,this.type="heatmap",this.seriesType=t.SeriesTypeEnum.heatmap}}iQ.type="heatmap",iQ.seriesType=t.SeriesTypeEnum.heatmap,iQ.transformerConstructor=eQ;const sQ=()=>{AU(),iZ(),AD.registerChart(iQ.type,iQ)};class nQ extends UV{_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 rQ extends NV{constructor(){super(...arguments),this.transformerConstructor=nQ,this.type="correlation",this.seriesType=t.SeriesTypeEnum.correlation}}rQ.type="correlation",rQ.seriesType=t.SeriesTypeEnum.correlation,rQ.transformerConstructor=nQ;const aQ=()=>{AU(),mZ(),AD.registerChart(rQ.type,rQ)};function oQ(t){var e,i;const s=Object.assign({},t);return P(t.style)||(s.textStyle=OF(t.style)),P(t.textStyle)||SD(s.textStyle,OF(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&OF(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&OF(s.background.style),s}const lQ=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},hQ=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l,customFilter:h}=e,c=a(),d=l();if(0===c.length&&d.length)return[];if(c.length===d.length)return t;const u={};c.forEach((t=>{u[t]=!0}));const g=null!==(i=o())&&void 0!==i?i:JD;return h?h(t,c,g):(_(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===u[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===u[t.source]&&!0===u[t.target])))):p(g)&&(t=t.filter((t=>!0===u[r.getSeriesFieldValue(t,g)]))),t)};class cQ extends NN{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=t.LayoutZIndex.Legend,this.layoutLevel=t.LayoutLevel.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{PO(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),PO(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=sD(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;p(s)&&(this._seriesUserId=Y(s)),p(e)&&(this._regionUserId=Y(e)),p(n)&&(this._seriesIndex=Y(n)),p(i)&&(this._regionUserIndex=Y(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(U(e,t)||(i.reCompile=!0),i)}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}initData(){const e=this._initLegendData();e.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new Qz(this._option,e),this._initSelectedData(),PO(this._regions,(e=>{e.event.on(t.ChartEvent.rawDataUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===e.id},(()=>{this._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(e){var i,s,n;const r=this._selectedData;u(e)||JSON.stringify(r)===JSON.stringify(e)||(PO(this._regions,(t=>{t.legendSelectedFilter&&(e=t.legendSelectedFilter(this,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...e],null===(s=(i=this.effect).onSelectedDataChange)||void 0===s||s.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(n=this._legendComponent)||void 0===n||n.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;k(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)U(s,this._cacheAttrs)||this._legendComponent.setAttributes(SD({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(SD({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t;this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());U(t,this._cacheAttrs)||this._legendComponent.setAttributes(SD({},t,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}cQ.specKey="legends";class dQ extends cQ{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return Yj(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(e){super.init(e),PO(this._regions,(e=>{e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(e),data:()=>this.getLegendDefaultData(),customFilter:this._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){qF(this._option.dataSet,"discreteLegendFilter",hQ),qF(this._option.dataSet,"discreteLegendDataMake",lQ);const t=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return PO(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(u(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!ib(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return d(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=bF(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const i="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",s=Object.assign(Object.assign({layout:i,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,i){const{title:s={},item:n={},pager:r={},background:a={},type:o,id:l,visible:h,orient:c,position:d,data:u,filter:g,regionId:f,regionIndex:m,seriesIndex:v,seriesId:y,padding:_}=t,b=e(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return s.visible?b.title=oQ(s):b.title={visible:!1},P(n.focusIconStyle)||OF(n.focusIconStyle),n.shape&&(n.shape=RF(n.shape)),n.label&&(n.label=RF(n.label)),n.value&&(n.value=RF(n.value)),n.background&&(n.background=RF(n.background)),nD(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*i.width/100),nD(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*i.width/100),nD(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*i.width/100),b.item=n,"scrollbar"===r.type?(P(r.railStyle)||OF(r.railStyle),P(r.sliderStyle)||OF(r.sliderStyle)):(P(r.textStyle)||OF(r.textStyle),r.handler&&RF(r.handler)),b.pager=r,a.visible&&!P(a.style)&&(SD(b,a.style),p(a.padding)&&(b.padding=a.padding)),b}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(s),this._addLegendItemFormatMethods(s),s}_getLegendConstructor(){return jI}setSelectedData(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((e=>!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const e=!1!==this._spec.filter;this._legendComponent.addEventListener(RI.legendItemClick,(i=>{const s=R(i,"detail.currentSelected");e&&this.setSelectedData(s),this.event.emit(t.ChartEvent.legendItemClick,{model:this,value:s,event:i})})),this._legendComponent.addEventListener(RI.legendItemHover,(e=>{const i=R(e,"detail");this.event.emit(t.ChartEvent.legendItemHover,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(RI.legendItemUnHover,(e=>{const i=R(e,"detail");this.event.emit(t.ChartEvent.legendItemUnHover,{model:this,value:i,event:e})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:k(s)?s:1,strokeOpacity:k(n)?n:1,opacity:k(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return d(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=Gj(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:c}=Gj(o,l);l&&!o&&c&&(t.item.value.formatMethod=(t,e)=>c(l,t,e,a))}}dQ.specKey="legends",dQ.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},dQ.type=r.discreteLegend;const uQ=()=>{AD.registerComponent(dQ.type,dQ)},pQ=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;k(n)&&(t=Math.min(n,t)),k(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},gQ=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r,customFilter:a}=e,o=i(),l=s(),h=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!g(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(o===n())return t;if(l&&!P(o)){const[e,i]=o;return a?a(t,o,l):h(t)?PF(t,+e,+i,l):t.filter((t=>t[l]>=e&&t[l]<=i))}return t};const fQ={color:WI,size:YI},mQ={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}},vQ=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},mQ),{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"}}}})},yQ={horizontal:vQ(!0),vertical:vQ(!1)},_Q=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},mQ),{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"}}}})},bQ={horizontal:_Q(!0),vertical:_Q(!1)},xQ=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],SQ=[2,10];class AQ extends cQ{static getSpecInfo(t){const e=Yj(t,this.specKey,this.type,(t=>function(t){return"color"===t||"size"===t}(t.type)));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(e){super.init(e),PO(this._regions,(e=>{e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:e.isHierarchyData,customFilter:this._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){qF(this._option.dataSet,"continuousLegendFilter",gQ),qF(this._option.dataSet,"continuousLegendDataMake",pQ);const t=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>RO(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=bF(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!ib(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=bF(this._option.dataSet.getDataView(a.dataId),a.fields[0])}else;}_getLegendAttributes(t){var i,s;const n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",r="horizontal"===n?"bottom":this.layoutOrient;let a=[];const o=this._getScaleInGlobal();o&&"linear"===o.type&&(a=o.range()),P(a)&&(a="color"===this._legendType?xQ:SQ);let l=null!==(i=this._legendData.getLatestData()[0])&&void 0!==i?i:0,h=null!==(s=this._legendData.getLatestData()[1])&&void 0!==s?s:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),h=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const c=Object.assign({layout:n,align:r,zIndex:this.layoutZIndex,min:l,max:h,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:a},function(t){const i=SD({},t),{title:s={},handler:n={},rail:r={},track:a={},startText:o,endText:l,handlerText:h,sizeBackground:c,background:d={},type:u,id:g,visible:f,orient:m,position:v,data:y,defaultSelected:_,field:b,filter:x,regionId:S,regionIndex:A,seriesIndex:k,seriesId:T,padding:M}=i,C=e(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return s.visible?C.title=oQ(s):C.title={visible:!1},C.showHandler=!1!==n.visible,P(n.style)||(C.handlerStyle=OF(n.style)),p(r.width)&&(C.railWidth=r.width),p(r.height)&&(C.railHeight=r.height),P(r.style)||(C.railStyle=OF(r.style)),P(a.style)||(C.trackStyle=OF(a.style)),C.startText=RF(o),C.endText=RF(l),C.handlerText=RF(h),P(c)||(C.sizeBackground=OF(c)),d.visible&&!P(d.style)&&(SD(C,d.style),p(d.padding)&&(C.padding=d.padding)),C}(this._spec));return this._addDefaultTitleText(c),c}_getLegendConstructor(){return fQ[this._legendType]}_initEvent(){if(this._legendComponent){const e=!1!==this._spec.filter;this._legendComponent.addEventListener("change",xt((i=>{const s=R(i,"detail.value");e&&this.setSelectedData(s),this.event.emit(t.ChartEvent.legendFilter,{model:this,value:s,event:i})}),30))}}}AQ.specKey="legends",AQ.builtInTheme={colorLegend:yQ,sizeLegend:bQ},AQ.type=r.continuousLegend;const kQ=()=>{AD.registerComponent(AQ.type,AQ)},TQ=(t,e)=>p(e)?t.map((t=>e[t])):void 0,MQ=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),CQ=t=>!u(t)&&(_(t)?t.length>0&&t.every(p):Object.keys(t).length>0);function wQ(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(p(a.regionId)?[a.regionId]:void 0,p(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=EQ(t,l),c=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",d=l.getLayoutStartPoint(),g=l.getLayoutRect(),f=o.globalInstance.getContainer(),m=Object.assign({x:0,y:0},f?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(f):{}),v=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>MQ(i,s)(t)&&MQ(n,r)(t)&&(u(a)||MQ([a],[o])(t))));return l},y=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),g.width),y:Math.min(Math.max(t.y,0),g.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:d.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:d.y+s.y;return{canvasX:n,canvasY:r,clientX:m.x+n,clientY:m.y+r}};if("dimension"===c){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>v(t))))&&void 0!==i?i:[]}}))}];p(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:WF.chart,event:y({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return Hj.globalConfig.uniqueTooltip&&Hj.hideTooltip(l.id),c}if("mark"===c){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},v(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:WF.chart,event:y(e.pos),item:void 0};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return Hj.globalConfig.uniqueTooltip&&Hj.hideTooltip(l.id),c}return"none"}const EQ=(e,i)=>{const s=i.getSeries(),n=[];return s.forEach((i=>{var s,r,a,o,l,h,c;const d=i.getDimensionField(),g=i.getMeasureField(),f=i.getSeriesField(),m=p(f)?e[f]:void 0,v=p(f)&&null!==(o=null===(a=null===(r=null===(s=i.getViewDataStatistics)||void 0===s?void 0:s.call(i))||void 0===r?void 0:r.latestData[f])||void 0===a?void 0:a.values)&&void 0!==o?o:[],y=TQ(d,e);let _=TQ(g,e);const b=CQ(_),x=!b&&p(f)&&u(m)&&v.length>0,S=()=>{var e;const s=null===(e=i.getViewData())||void 0===e?void 0:e.latestData.find(MQ(d,y));if(!b&&(_=TQ(g,s),!CQ(_)))return;const r=i.type===t.SeriesTypeEnum.pie?i.dataToCentralPosition(s):i.dataToPosition(s);u(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:d,dimensionData:y,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:m},series:i})};if("cartesian"===i.coordinate){const t=i,e=TP(null===(h=null===(l=i.getYAxisHelper())||void 0===l?void 0:l.getScale(0))||void 0===h?void 0:h.type)?"y":"x",s=d.map(((t,e)=>[t,e])).filter((([,t])=>u(null==y?void 0:y[t])));let r=[null!=y?y:[]];s.length>0&&s.forEach((([t,e])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=i.getViewDataStatistics)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((i=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[e]=i,h.push(n)}))})),r=h})),r.forEach((s=>{var r,a;if(x){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(MQ(d,s));v.forEach((r=>{const o=a.find((t=>t[f]===r));if(_=TQ(g,o),!CQ(_))return;const l=t.dataToPosition(o);u(l)||isNaN(l.x)||isNaN(l.y)||n.push({pos:l,data:{dimensionFields:d,dimensionData:s,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:r},series:i,dimType:e})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(MQ(d,s));if(!b&&(_=TQ(g,r),!CQ(_)))return;const o=t.dataToPosition(r);if(u(o)||isNaN(o.x)||isNaN(o.y))return;n.push({pos:o,data:{dimensionFields:d,dimensionData:s,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:m},dimType:e,series:i})}}))}else if("polar"===i.coordinate)if(i.type===t.SeriesTypeEnum.pie)S();else{const t=i;if(x){const e=(null===(c=t.getViewData())||void 0===c?void 0:c.latestData.filter(MQ(d,y))).find((t=>t[f]===m));v.forEach((s=>{if(_=TQ(g,e),!CQ(_))return;const r=t.dataToPosition(e);u(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:d,dimensionData:y,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:s},series:i})}))}else S()}else"geo"===i.coordinate&&S()})),n},BQ=t=>p(t)&&!_(t),PQ=t=>p(t)&&_(t);class RQ extends HN{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i,s,n;const{spec:r,theme:a}=super._initTheme(t,e);return r.style=SD({},this._theme,r.style),r.offset=SD({},a.offset,t.offset),r.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:a.transitionDuration,r.trigger=null!==(s=t.trigger)&&void 0!==s?s:a.trigger,r.triggerOff=null!==(n=t.triggerOff)&&void 0!==n?n:a.triggerOff,{spec:r,theme:a}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return p(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:J_(this._option.mode)||!q_(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,p(t.parentElement)?y(t.parentElement)&&(t.parentElement=Ay.getElementById(t.parentElement)):q_(this._option.mode)&&(t.parentElement=null==K_?void 0:K_.body)}}const LQ={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}};class IQ extends NN{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=RQ,this.specKey="tooltip",this.layoutType="none",this._isReleased=!1,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?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;this._clickLock=!0}},this._getMouseOutHandler=t=>e=>{var i,s,n,r,a;if(this._isReleased)return;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const o=q_(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:l,clientY:h}=e.event;o&&t&&this._isPointerInChart({x:l,y:h})||(this._enterable?this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(a=null===(r=this._spec)||void 0===r?void 0:r.showDelay)&&void 0!==a?a:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{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,n,r;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?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(r=null===(n=this._spec)||void 0===n?void 0:n.showDelay)&&void 0!==r?r:50)):this._handleChartMouseMove(e,t)))},this._handleChartMouseMove=(t,e)=>{if(this._isReleased)return;const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1},a=["group","mark","dimension"];for(let s=0,n=a.length;s<n;s++){const n=a[s];if(!!this.processor[n]&&this._showTooltipByMouseEvent(n,i,t,e)){r[n]=!0;break}}Object.values(r).every((t=>!t))&&!function(t){return u(t.mark)&&u(t.model)&&u(t.datum)}(t)&&(n&&BQ(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):p(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),r.mark||r.group||r.dimension&&!u(s)?this._initEventOfTooltipContent():this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&Hj.globalConfig.uniqueTooltip&&l&&Hj.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=e=>{var i,s,n;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return 0;this.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},e),{source:WF.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const r=null!==(n=this._spec.handler)&&void 0!==n?n:this.tooltipHandler;if(r.hideTooltip){const t=r.hideTooltip.call(r,e);return t||(this._isTooltipShown=!1),t}return 1},this.hideTooltip=()=>{if(this._isReleased)return!1;const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:WF.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?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?mU.canvas:mU.dom,n=AD.getComponentPluginInType(t);n||Y_("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip)return;const i=null===(e=(t=this.tooltipHandler).getRootDom)||void 0===e?void 0:e.call(t);i&&(i.addEventListener("pointerenter",(()=>{var t;if(!this._enterable)return;this._isEnterTooltip=!0;const e=null===(t=i.getBoundingClientRect)||void 0===t?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)){const n=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);n&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===n[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(s=null===(e=this._spec)||void 0===e?void 0:e.showDelay)&&void 0!==s?s:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.forEach((t=>{const e=AD.createTooltipProcessor(t,this);e&&(this.processor[t]=e)}))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Y(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=Y(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),(Z_(s)||J_(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))):g(t)&&this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseMoveHandler(!0))}));i.filter((t=>g(t))).forEach((t=>{var e,i;this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseOutHandler(null!==(i=t.checkOutside)&&void 0!==i&&i))})),!e.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){let e;return e=S(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10,St(t,e)}reInit(t){var e,i,s;if(super.reInit(t),this.tooltipHandler){const t=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",n=this._spec.enterable&&"html"===t;n&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=n,null===(s=(i=this.tooltipHandler).reInit)||void 0===s||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?void 0:i.showTooltip))return!1;const s=wQ(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(u(this._cacheInfo)||u(t))return!1;if(PQ(t)){if(BQ(this._cacheInfo))return!1;const e=this._cacheInfo;return e.length===t.length&&t.every(((t,i)=>WH(t,e[i])))}if(PQ(this._cacheInfo))return!1;const 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;const n=this._cacheParams;return!u(n)&&!u(e)&&(n.mark===e.mark&&n.model===e.model&&n.datum===e.datum)}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}}IQ.type=r.tooltip,IQ.transformerConstructor=RQ,IQ.builtInTheme={tooltip:LQ},IQ.specKey="tooltip";const OQ=()=>{AD.registerComponent(IQ.type,IQ)};var DQ,FQ;t.TooltipResult=void 0,(DQ=t.TooltipResult||(t.TooltipResult={}))[DQ.success=0]="success",DQ[DQ.failed=1]="failed",function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(FQ||(FQ={}));const zQ={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]};class jQ extends NN{get enableRemain(){return"none"===this.triggerOff}constructor(e,i){super(e,i),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=t.LayoutZIndex.CrossHair_Grid,this.labelZIndex=t.LayoutZIndex.CrossHair,this.trigger="hover",this._handleIn=t=>{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),S(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=St((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(g(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_setAllAxisValues(t,e,i){let s=!1;if(t.forEach((t=>{TP(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!this.enable)return!1;const{currentValue:n}=this._stateByField[i];return t.forEach(((t,i)=>{const s=t.axis;n.set(i,{datum:this._getDatumAtPoint(s,e),axis:s})})),!0}clearAxisValue(){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=>{const{axis:e,value:i}=t;this.setAxisValue(i,e)})),this.layoutByValue(!1))}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshairBySpec(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t];if(e&&e.visible&&e.defaultSelect){const{axisIndex:i=0,datum:s}=e.defaultSelect,n=this._option.getComponentsByKey("axes").find((t=>t.getSpecIndex()===i));n&&(this._stateByField[t].currentValue.clear(),this._stateByField[t].currentValue.set(i,{axis:n,datum:s}))}}))}_updateVisibleCrosshair(){let t=!1;Object.keys(this._stateByField).forEach((e=>{const 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){const i=super._compareSpec(t,e);return i.reMake||U(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:GF.chart}:{source:WF.chart};_(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;_(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}onBeforeRender(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:e=t.RenderModeEnum["desktop-browser"]}=this._option,i=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:Z_(e)||J_(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(e);if(i){const t=Y(this.trigger||"hover"),e=t=>"click"===t?"none"===this.triggerOff?null:i.clickOut:i.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:i[t],out:e(t)})})),s}return null}_registerTooltipEvent(){this.event.on(t.ChartEvent.tooltipHide,{source:WF.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:WF.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:WF.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=R(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{zQ[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:c,y:d}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));if(!e)return;e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-c),o=Math.min(o,i-d),l=Math.max(l,e+t.getLayoutRect().width-c),h=Math.max(h,i+t.getLayoutRect().height-d)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e})})),r}onLayoutEnd(){const t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),super.onLayoutEnd()}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseFieldInfo(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t],{crosshairComp:i}=this._stateByField[t];if(e&&e.visible){if(this._stateByField[t].attributes=this._parseField(e,t),i){const{style:e,type:s}=this._stateByField[t].attributes,n="rect"===s?"rectStyle":"lineStyle";i.setAttributes({[n]:e})}}else i&&i.parent&&i.parent.removeChild(i)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||S(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,i){var s,n,r;const a={},{line:o={},label:l={},visible:h}=t;if(a.visible=h,a.type=o.type||"line",!1===o.visible)a.style={visible:!1};else{const i=o.style||{},{stroke:r,fill:l,lineWidth:h}=i,c=i,{strokeOpacity:d,fillOpacity:u,opacity:p}=c,g=e(c,["strokeOpacity","fillOpacity","opacity"]),f="line"===a.type;let m=f?d:u;if(S(p)&&(m=(null!=m?m:1)*p),a.style=Object.assign({opacity:m,pickable:!1,visible:!0},g),f)a.style.stroke=r||l,a.style.lineWidth=R(o,"width",h||2);else{a.style.fill=l||r,(null===(n=null===(s=null==t?void 0:t.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(a.style.stroke=t.line.style.stroke);const e=R(o,"width");if("string"==typeof e){const 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){const t=l.labelBackground||{},i=null!==(r=l.syncAxisLabelAngle)&&void 0!==r&&r,s=l.style||{},n=t.style||{},{fill:o="rgba(47, 59, 82, 0.9)",stroke:h,outerBorder:d}=n,u=e(n,["fill","stroke","outerBorder"]);a.label={visible:!0,formatMethod:l.formatMethod,formatter:l.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,syncAxisLabelAngle:i,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},s),{fill:s.fill||"#fff",stroke:R(s,"stroke")}),panel:(c(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:o,stroke:h,outerBorder:Object.assign({stroke:o,distance:0,lineWidth:3},d)},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=>{const n=s.axis;var r,a,o;if(a=e,o=i,((r=s).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(n.getSpecIndex()),n.type.startsWith("polarAxis")){const s=n.getCenter(),r=n.getInnerRadius(),a=n.getOuterRadius(),o=ae.distancePP({x:e,y:i},s);(o>a||o<r)&&t.delete(n.getSpecIndex())}})),t}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new BC(e),null==s||s.add(t),i(t)),function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:c=0,dy:d=0}=t.attribute;let u=0,p=0;a<i&&(u=i-a),o<s&&(p=s-o),l>n&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+c),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){const{crosshairComp:e,labelsComp:i}=this._stateByField[t];e&&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)=>{const{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}),[])}}jQ.specKey="crosshair";const HQ={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 NQ extends jQ{static getSpecInfo(t){return Yj(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._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){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const i=OH(t.getOrient())?"x":"y",s=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(s)}setAxisValue(t,e){OH(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 n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(p(t.dimType)?"y"===t.dimType:DH(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}this.clearAxisValue();const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else o&&o.size&&this._setAllAxisValues(o,{x:r,y:a},"xField"),l&&l.size&&this._setAllAxisValues(l,{x:r,y:a},"yField"),this.layoutByValue()}layoutByValue(t){if(!this.enable)return;const e=LO(this._regions,"cartesian");e&&(oU(this._stateByField,e,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){const{cacheInfo:e,attributes:i,labelsComp:s,bandSize:n,coordKey:r}=this._stateByField[t];if(!i||!e||e._isCache&&this.enableRemain)return;const{coord:a,labels:o,visible:l,labelsTextStyle:h}=e;if(l){const l=cU(this._stateByField[t]);this._updateCrosshairByField(t,l),Object.keys(o).forEach((l=>{var c,d,u;if(o[l].visible){const p=Object.assign(Object.assign(Object.assign({[r]:a+n/2},o[l]),i.label),{angle:i.label.syncAxisLabelAngle&&null!==(d=null===(c=e.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==d?d:0,textStyle:Object.assign(Object.assign({},null===(u=i.label)||void 0===u?void 0:u.textStyle),h[l]),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(s[l],p,(e=>{e.name=`crosshair-${t.replace("Field","")}-${l}-label`,s[l]=e}))}else s[l]&&s[l].hideAll()}))}else this._hideByField(t)}_updateCrosshairByField(t,e){const i=this.getContainer(),{attributes:s}=this._stateByField[t];let{crosshairComp:n}=this._stateByField[t];if(n)n.setAttributes(e);else{const r=s.style;"line"===s.type?n=new KC(Object.assign(Object.assign({},e),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===s.type&&(n=new qC(Object.assign(Object.assign({},e),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(n),this._stateByField[t].crosshairComp=n}}}NQ.specKey="crosshair",NQ.builtInTheme={crosshair:HQ},NQ.type=r.cartesianCrosshair;const VQ=()=>{AD.registerComponent(NQ.type,NQ)};class UQ extends jQ{static getSpecInfo(t){return Yj(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=r.polarCrosshair,this.name=r.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){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint();return t.positionToData({x:e.x-(i-n),y:e.y-(s-r)})}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}this.clearAxisValue();const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)a&&this._setAllAxisValues(a,{x:n,y:r},"categoryField"),o&&this._setAllAxisValues(o,{x:n,y:r},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}layoutByValue(t){if(!this.enable)return;const e=LO(this._regions,"polar");e&&(((t,e,i=!1)=>{Object.keys(t).forEach((s=>{const{attributes:n,currentValue:r,cacheInfo:a,coordKey:o}=t[s];if(n){const l=!!r.size,h=i&&!l&&p(a),c=h?a:{coord:0,axis:null,visible:l,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(a&&(a._isCache=h),"valueField"===s&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),r.forEach((({axis:t,datum:i=""})=>{var r;const a=t.niceLabelFormatter;if((null===(r=n.label)||void 0===r?void 0:r.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=a,c.labels.all.text=i,c.labels.all.offset=yN(t.getSpec())),"categoryField"===s){const s=e.angleAxisHelper.dataToPosition([i]),n=e.angleAxisHelper.getBandwidth(0),r=t.getOuterRadius();c.coord=s,c.coordRange=[s-n/2,s+n/2],c.sizeRange=[r,r]}else{const s=t.startAngle,n=e.radiusAxisHelper.dataToPosition([i]);c.coord=n,c.coordRange=[n,n],c.sizeRange=[s,s]}c.axis=t})),c&&!h&&c.labels.all.visible&&n&&n.label){const t=c.labels.all,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=Gj(e,i,t.text,{label:t.text,orient:o});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}t[s].cacheInfo=c}}))})(this._stateByField,e,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){var e,i,s;const{cacheInfo:n,attributes:r,crosshairComp:a,labelsComp:o,coordKey:l}=this._stateByField[t];if(!n||n._isCache&&this.enableRemain)return;const h=this.getContainer(),{visible:c,labels:d,coord:u,sizeRange:p,axis:g}=n;if(c){const n=this.getLayoutStartPoint(),c=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,f=((t,e,i)=>{const{cacheInfo:s,coordKey:n,attributes:r}=t,{axis:a,coord:o,sizeRange:l,coordRange:h}=s,c=a.getCenter(),d={x:c.x+e.x,y:c.y+e.y};if("angle"===n)return"sector"==("rect"===r.type?"sector":"line")?{center:d,innerRadius:a.getInnerRadius(),radius:a.getOuterRadius(),startAngle:h[0],endAngle:h[1]}:{start:ce(d,a.getInnerRadius(),o),end:ce(d,a.getOuterRadius(),o)};const u=a.startAngle,p=a.endAngle,g=s.sides;let f=o;if(!i){const t=a.getCenter(),e=a.coordToPoint({angle:l[0],radius:o}),i=ue(t,e),s=(p-u)/g,n=Math.floor((i-u)/s),r=n*s+u,h=Math.min((n+1)*s+u,p),c=ce(t,o,r),d=ce(t,o,h),m=ye([d.x,d.y],[c.x,c.y],[t.x,t.y],[e.x,e.y]);m&&(f=vt(ae.distancePN(e,m[0],m[1])+o,a.getInnerRadius(),a.getOuterRadius()))}return{center:d,startAngle:u,endAngle:p,radius:f,sides:g}})(this._stateByField[t],n,c);if(a)a.setAttributes(f);else{let e;if("angle"===l){const t="rect"===r.type?"sector":"line";"line"===t?e=new KC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===t&&(e=new JC(Object.assign(Object.assign({},f),{sectorStyle:r.style,zIndex:this.gridZIndex,pickable:!1})))}else{e="polygon"===(c?"circle":"polygon")?new QC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex+1})):new ZC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex}))}this._stateByField[t].crosshairComp=e,h.add(e)}const m=d.all;if(m.visible){const t=g.getCenter(),e={x:t.x+n.x,y:t.y+n.y},i="angle"===l?function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(u):function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(g.startAngle),a="angle"===l?ce(e,p[1]+m.offset,u):ce(e,f.radius,g.startAngle),h=Object.assign(Object.assign(Object.assign(Object.assign({},a),r.label),m),{textStyle:Object.assign(Object.assign({},null===(s=r.label)||void 0===s?void 0:s.textStyle),{textAlign:i.align,textBaseline:i.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(o.all,h,(t=>{t.name=`crosshair-${l}-label`,o.all=t}))}else o.all&&o.all.hideAll()}}}UQ.specKey="crosshair",UQ.builtInTheme={crosshair:HQ},UQ.type=r.polarCrosshair;const WQ=()=>{AD.registerComponent(UQ.type,UQ)},GQ=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n,originalFields:r}=e,a=n(),o=i();if(u(o)||u(a))return t;const l=r(),h=_(a)?a[0]:a;return t[h]&&l&&l[h]&&l[h].lockStatisticsByDomain&&!s()&&(t[h].values=o),t},YQ=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(u(a)||u(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Y(r).every((i=>{t[i]>=a[0]&&t[i]<=X(a)&&(e=!0)})),e}:t=>{let e=!1;return Y(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},XQ=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n,isCategoryState:r}=e.input,{stateField:a,valueField:o}=e.output,l={},h=[],c=[];let d=!1;n.forEach(((t,e)=>{var n;if(u(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&(d=!0,r.domain.forEach((t=>{u(l[t])&&(c.push(t),l[t]=0)}))),t.latestData.forEach((t=>{Y(i[e]).forEach((i=>{u(t[i])||(u(l[t[i]])&&(c.push(t[i]),l[t[i]]=0),u(s[e])||(l[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))}));const p=d?c:!1===r?c.sort(((t,e)=>t-e)):Object.keys(l);return p.forEach((t=>{const e={[a]:t};o&&(e[o]=l[t]),h.push(e)})),h};class $Q extends NN{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent,i=e.getScale(),s=this._isReverse(),n=s?[1-this._end,1-this._start]:[this._start,this._end];if(s)switch(t){case"startHandler":e.scaleRangeFactorEnd(n[1]);break;case"endHandler":e.scaleRangeFactorStart(n[0]);break;default:e.scaleRangeFactorStart(n[0],!0),e.scaleRangeFactorEnd(n[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(n[0]);break;case"endHandler":e.scaleRangeFactorEnd(n[1]);break;default:e.scaleRangeFactorEnd(n[1],!0),e.scaleRangeFactorStart(n[0])}const r=i.rangeFactor();r?(this._start=s?1-r[1]:r[0],this._end=s?1-r[0]:r[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else PO(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),PO(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=(t,e)=>{var i,s;if(!this._activeRoam||this._zoomAttr.filter&&!this._zoomAttr.filter(t,e))return;const{zoomDelta:n,zoomX:r,zoomY:a}=t,{x:o,y:l}=this._regions[0].getLayoutStartPoint(),{width:h,height:c}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),u=null!==(s=null===(i=this._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==s?s:1;if(d>=1&&n<1)return;if(d<=.01&&n>1)return;const p=this._isHorizontal?r:a,g=d*(n-1)*u;let f=g/2,m=g/2;if(p){const t=this._isHorizontal?o:l,e=this._isHorizontal?h:c;f=Math.abs(t-p)/Math.abs(e-t)*g,m=Math.abs(e-p)/Math.abs(e-t)*g}const v=vt(this._start+f,0,1),y=vt(this._end-m,0,1);this._handleChange(Math.min(v,y),Math.max(v,y),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam||this._scrollAttr.filter&&!this._scrollAttr.filter(t,e))return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?Ut(s/n)>=.5:Ut(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i,s;if(!this._activeRoam||this._dragAttr.filter&&!this._dragAttr.filter(t,e))return;(null===(i=this._spec.roamDrag)||void 0===i?void 0:i.autoVisible)&&this.show();const[n,r]=t;let a=this._isHorizontal?n:r;this._dragAttr.reverse&&(a=-a),this._handleChartMove(a,null!==(s=this._dragAttr.rate)&&void 0!==s?s:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=zH(t),this._isHorizontal="horizontal"===jH(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(p(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):p(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),u(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!AP(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(p(i)&&(p(i.userId)&&(this._seriesUserId=Y(i.userId)),p(i.specIndex)&&(this._seriesIndex=Y(i.specIndex))),p(this._spec.seriesId)){const t=Y(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(p(this._spec.seriesIndex)){const t=Y(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(p(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Y(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(p(this._spec.regionId)){const t=Y(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}else;}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(AP(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&!U(this._domainCache,e)&&(this._domainCache=e,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[K(t),$(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];let s;if(this._relatedAxisComponent){const n={};PO(this._regions,(r=>{var a,o;const l="cartesian"===r.coordinate?r.getXAxisHelper():"polar"===r.coordinate?r.angleAxisHelper:null,h="cartesian"===r.coordinate?r.getYAxisHelper():"polar"===r.coordinate?r.radiusAxisHelper:null;if(!l||!h)return;const c=l.getAxisId()===this._relatedAxisComponent.id?l:h.getAxisId()===this._relatedAxisComponent.id?h:this._isHorizontal?l:h,d=c===l?h:l;t.push(r.getRawData());const u=r.getSpec(),p="cartesian"===r.coordinate?Y(u.xField):Y(null!==(a=u.angleField)&&void 0!==a?a:u.categoryField),g="cartesian"===r.coordinate?Y(u.yField):Y(null!==(o=u.radiusField)&&void 0!==o?o:u.valueField);if(n[r.id]="link"===r.type?["from_xField"]:c===l?p:g,AP(c.getScale(0).type)?(s=!1,e.push(n[r.id])):e.push(n[r.id][0]),this._valueField){const t="link"===r.type?["from_yField"]:d===l?p:g;AP(d.getScale(0).type)&&i.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=n}else PO(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:n}=this._option;ZF(n,"dataview",Ma),qF(n,"dataFilterComputeDomain",XQ);const r=new Ba(n,{name:`${this.type}_${this.id}_data`});r.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i,isCategoryState:s},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new Qz(this._option,r),r.reRunAllTransform(),n.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=j({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=j({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=j({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}statePointToData(t){const e=this._stateScale,i=e.domain();if(AP(e.type))return this._isReverse()?i[0]+(X(i)-i[0])*(1-t):i[0]+(X(i)-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(X(s)-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&AP(e.type)&&(s=s.slice().reverse()),(i-s[0])/(X(s)-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&p(this._spec.start)||"value"===e&&p(this._spec.startValue):"percent"===e&&p(this._spec.end)||"value"===e&&p(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this.statePointToData(i),this._endValue=this.statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,AP(this._stateScale.type)&&this._stateScale.domain()[0]!==X(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(X(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(X(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=AP(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[K(e),$(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new $P,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(qF(this._option.dataSet,"dataFilterWithNewDomain",YQ),qF(this._option.dataSet,"lockStatisticsFilter",GQ),PO(this._regions,(e=>{e.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:()=>e.getViewDataStatistics().getFields(),getNewDomain:()=>this._newDomain,field:()=>{var t;return null!==(t=this._field)&&void 0!==t?t:this._parseFieldOfSeries(e)},isContinuous:()=>AP(this._stateScale.type)},level:1},!1),e.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var t;return null!==(t=this._field)&&void 0!==t?t:this._parseFieldOfSeries(e)},isContinuous:()=>AP(this._stateScale.type)},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||U(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])}))}))}_parseDomainFromState(t,e){if(AP(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a,o;const l={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:p(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,allowComponentZoom:!0};if(this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,l),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,l),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,l),null===(o=this._spec.roamDrag)||void 0===o?void 0:o.autoVisible){const t="panend";this._throttledHide=St((()=>this.hide()),300),this.event.on(t,(()=>{this._throttledHide()}))}}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}_autoVisible(e){if(!this._auto)return;e?this.show():this.hide();const i=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[i]:e?this[`_${i}`]:0},{[i]:t.AttributeLevel.Built_In})}onLayoutStart(t,e){super.onLayoutStart(t,e);const i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}onLayoutEnd(){const t=!(0===this._start&&1===this._end);this._autoVisible(t),super.onLayoutEnd()}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),c=null==l?void 0:l.getScale(),d=this._getAxisBandSize(h);if(!this._dataUpdating&&TP(c.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==d?void 0:d.bandSize))return this._cacheVisibility;let p=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?c.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&c.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==d?void 0:d.bandSize,TP(c.type)){d&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=c.rangeFactor())&&void 0!==a?a:[];p=(!u(t)||!u(e))&&!(0===t&&1===e)}else{const[t,e]=null!==(o=c.rangeFactor())&&void 0!==o?o:[this._start,this._end];p=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=p,p}_getNeedClearVRenderComponents(){return[this._component]}clear(){this._throttledHide=null}}G($Q,wW);class KQ extends HN{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=SD({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=_(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}const qQ=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),ZQ={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:qQ(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:qQ(!0)};class JQ extends $Q{constructor(e,i){var s;super(e,i),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=KQ,this.specKey="dataZoom",this.layoutZIndex=t.LayoutZIndex.DataZoom,this.layoutLevel=t.LayoutLevel.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),c(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),u(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),u(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,p=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=p?this._spec.endHandler.style.size:0}onLayoutEnd(){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd()}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new fR;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2],a=this._computeWidth(),o=this._computeHeight();this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,a-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([o-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,o-i+this._startHandlerSize/2]:r,this._stateScale.range(s),"left"===this.layoutOrient?this._valueScale.range([a-this._middleHandlerSize,0]):this._valueScale.range([0,a-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:a,height:o},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[K(e),$(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return(!AP(t.type)||e[0]!==X(e))&&(!TP(t.type)||1!==(i=e,i&&_(i)?Array.from(new Set(Y(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this._computeWidth(),height:this._computeHeight()},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:p(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new LL(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this.statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(e,i,s,n){if(super._handleChange(e,i,s),this._shouldChange){s&&this._component&&this._component.setStartAndEnd(e,i),this._start=e,this._end=i;const r=this.statePointToData(e),a=this.statePointToData(i);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,r,a):this._handleStateChange(r,a,n))&&this.event.emit(t.ChartEvent.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:e,end:i,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,c,d;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:f={},selectedBackgroundChart:m={}}=this._spec;return{backgroundStyle:OF(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:OF(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:OF(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:OF(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:OF(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:OF(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:OF(g.style)},selectedBackgroundStyle:OF(this._spec.selectedBackground.style),dragMaskStyle:OF(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:SD(OF(null===(l=f.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OF(null===(h=f.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:SD(OF(null===(c=m.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OF(null===(d=m.area)||void 0===d?void 0:d.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=Gj(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}JQ.type=r.dataZoom,JQ.transformerConstructor=KQ,JQ.builtInTheme={dataZoom:ZQ},JQ.specKey="dataZoom";const QQ=()=>{AD.registerComponent(JQ.type,JQ)},t0={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}};class e0 extends $Q{constructor(e,i){var s;super(e,i),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=t.LayoutZIndex.DataZoom,this.layoutLevel=t.LayoutLevel.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),c(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(){var t,e;this._updateScaleRange(),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t),super.onLayoutEnd()}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return S(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:p(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new tC(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),this._component.addEventListener("scrollUp",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(e,i,s){super._handleChange(e,i,s);const n=SO(this._start,e)&&SO(this._end,i);if(this._shouldChange&&(!n||!1===this._spec.realTime)){s&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;const n=this.statePointToData(e),r=this.statePointToData(i);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,n,r):this._handleStateChange(this.statePointToData(e),this.statePointToData(i)))&&this.event.emit(t.ChartEvent.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){if(this._spec.auto){this._data.getDataView().reRunAllTransform()}}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return u(i)||(s.padding=i),P(null==t?void 0:t.style)||(s.railStyle=OF(t.style)),P(null==e?void 0:e.style)||(s.sliderStyle=OF(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}e0.type=r.scrollBar,e0.builtInTheme={scrollBar:t0},e0.specKey="scrollBar";const i0=()=>{AD.registerComponent(e0.type,e0)},s0=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Y(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},n0=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),r0={title:{visible:!0,autoLimit:!1,autoFit:!1,style:n0("l1FontSize","primaryFontColor")},content:{visible:!0,style:n0("l2FontSize","tertiaryFontColor")}};class a0 extends NN{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.Indicator,this.layoutLevel=t.LayoutLevel.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return Yj(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=Y(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}initEvent(){if(this._option.disableTriggerEvent)return;"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(FF(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))):(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(FF(e))})),this.event.on("element-select:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){qF(this._option.dataSet,"indicatorFilter",s0);const t=new Ba(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 Qz(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:i,height:s}=t.getLayoutRect(),{x:n,y:r}=t.getLayoutStartPoint(),a=this._spec,{content:o,offsetX:l,offsetY:h,limitRatio:c,title:d}=a,u=e(a,["content","offsetX","offsetY","limitRatio","title"]),g=[];return Y(o).forEach((t=>{const e=SD({},this._theme.content,t);g.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({},IF(H(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:i,height:s},zIndex:this.layoutZIndex,x:n,y:r,dx:l?dD(l,this._computeLayoutRadius()):0,dy:h?dD(h,this._computeLayoutRadius()):0,limitRatio:c||1/0,title:{visible:!1!==d.visible&&(!p(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},IF(H(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:g},u)}_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)U(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new KI(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]:"":d(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>!!e.getSeriesInId(t.context.modelId)))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}a0.type=r.indicator,a0.builtInTheme={indicator:r0},a0.specKey="indicator";const o0=()=>{AD.registerComponent(a0.type,a0)},l0=["sum","average","min","max","variance","standardDeviation","median"];function h0(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=K(s),r=$(s);return e<n||e>r}function c0(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let h;return S(t.x)&&h0(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),h=nD(t.x)?g0(t.x,n)+r.x:f0(l.getXAxisHelper(),[t.x])+r.x,h}function d0(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let h;return S(t.y)&&h0(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),h=nD(t.y)?g0(t.y,n)+r.y:f0(l.getYAxisHelper(),[t.y])+r.y,h}function u0(t,e,i,s){var n,r;const{relativeSeries:a}=s;return S(t.angle)&&h0(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),f0(a.angleAxisHelper,[t.angle])}function p0(t,e,i,s){var n,r;const{relativeSeries:a}=s;return S(t.radius)&&h0(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),f0(a.radiusAxisHelper,[t.radius])}function g0(t,e){return Number(t.substring(0,t.length-1))*e/100}function f0(t,e){const i=t.getScale(0);return AP(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function m0(t){return l0.includes(t)}function v0(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),c=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),d={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],g=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,f=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return g.forEach((t=>{const e=p(t.x),i=p(t.y);if(e&&i){const e=c0(t,f,n,d,h,a),i=d0(t,m,n,d,c,a);u.push([{x:e,y:i}])}else if(e){const e=c0(t,f,n,d,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=d0(t,m,n,d,c,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function y0(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),c=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=p(t.angle),i=p(t.radius);if(e&&i){const e=u0(t,l,n,r),i=p0(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=u0(t,l,n,r);a.push([{angle:e,radius:-c},{angle:e,radius:c}])}else if(i){const e=p0(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function _0(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=_(s);return r.forEach(((t,r)=>{var o,l,h,c;const d=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,u=d.getRegion(),p=u.getLayoutStartPoint(),{width:g,height:f}=u.getLayoutRect();let m=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(m=nD(e)?Number(e.substring(0,e.length-1))*g/100:e),i&&(v=nD(i)?Number(i.substring(0,i.length-1))*f/100:i)}const y=d.getXAxisHelper().getScale(0).domain(),_=d.getYAxisHelper().getScale(0).domain(),b=Y(t.x),x=Y(t.y);1===b.length&&S(b[0])&&h0(y,b[0],i)&&(null===(l=null===(o=d.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",b[0])),1===x.length&&S(x[0])&&h0(_,x[0],i)&&(null===(c=null===(h=d.getYAxisHelper())||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,"marker_yAxis_extend",x[0])),n.push({x:f0(d.getXAxisHelper(),b)+p.x+m,y:f0(d.getYAxisHelper(),x)+p.y+v})})),n}function b0(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,h=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),d=Y(t.angle),u=Y(t.radius);1===d.length&&S(d[0])&&h0(h,d[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",d[0])),1===u.length&&S(u[0])&&h0(c,u[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",u[0])),s.push({angle:f0(l.angleAxisHelper,d),radius:f0(l.radiusAxisHelper,u)})})),s}function x0(t,e,i){let{x:s,y:n}=t;return nD(s)&&(s=g0(s,e)),nD(n)&&(n=g0(n,i)),{x:s,y:n}}function S0(t,e,i){let s;if(s=d(t)?Y(t(e.getData().getLatestData(),e)):Y(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=x0(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>x0(t,n,r)))}function A0(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.x<e&&(e=r.x),r.x+a.width>i&&(i=r.x+a.width),r.y<s&&(s=r.y),r.y+a.height>n&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function k0(t,i,s){const{labelBackground:n={},style:r,shape:a}=t,o=e(t,["labelBackground","style","shape"]);if(!1!==t.visible){const t=o;return(null==a?void 0:a.visible)?t.shape=Object.assign({visible:!0},OF(a.style)):t.shape={visible:!1},!1!==n.visible?(t.panel=Object.assign({visible:!0,customShape:n.customShape},M0(OF(n.style),i,s)),p(n.padding)&&(t.padding=oi(n.padding))):(t.panel={visible:!1},t.padding=0),r&&(t.textStyle=M0(OF(r),i,s)),t}return{visible:!1}}function T0(t,e,i){for(const s in t)d(t[s])&&(t[s]=t[s](e,i));return t}function M0(t,e,i){return d(t)?t(e,i):t}function C0(t,e){return d(t)?t(e):t}function w0(t,e,i){return p(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 E0(t){return{isXProcess:p(t.x),isYProcess:p(t.y),isX1Process:p(t.x1),isY1Process:p(t.y1),isAngleProcess:p(t.angle),isRadiusProcess:p(t.radius),isAngle1Process:p(t.angle1),isRadius1Process:p(t.radius1),isCoordinatesProcess:p(t.coordinates),isValidProcess:p(t.process)}}function B0(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h,isValidProcess:c}=E0(t);return{doXProcess:e&&!i&&!n,doXYY1Process:e&&i&&n,doYProcess:i&&!e&&!s,doYXX1Process:i&&e&&s,doXYProcess:e&&i&&s&&n,doAngleProcess:r&&!o&&!a&&!l,doRadiusProcess:a&&!l&&!r&&!o,doAngRadRad1Process:r&&!o&&a&&l,doRadAngAng1Process:a&&r&&o&&!l,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function P0(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h}=E0(t);return{doXProcess:e&&s&&!i&&!n,doYProcess:i&&n&&!e&&!s,doXYProcess:e&&s&&i&&n,doAngleProcess:r&&o&&!a&&!l,doRadiusProcess:a&&l&&!r&&!o,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h}}function R0(t){return{doXYProcess:p(t.x)&&p(t.y),doPolarProcess:p(t.angle)&&p(t.radius),doGeoProcess:p(t.areaName)}}function L0(t,i){let s;if(i.coordinates){const t=i,{coordinates:n,coordinateType:r,getSeriesByIdOrIndex:a}=t,o=e(t,["coordinates","coordinateType","getSeriesByIdOrIndex"]);let l,h;if(d(n)){const t=i.getRelativeSeries();l=n(t.getData().getLatestData(),t)}else l=n;l=Y(l),s=l.map((t=>{const e=a(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===r){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:a,yFieldIndex:l}=t;let c=i;p(r)&&(c=Y(i)[r]),n&&Y(i).includes(n)&&(c=n);let d=s;p(l)&&(d=Y(s)[l]),a&&Y(s).includes(a)&&(d=a),h=Object.assign({x:void 0,y:void 0},o),y(t[c])&&m0(t[c])?h.x={field:c,aggrType:t[c]}:h.x=Y(c).map((e=>t[e])),y(t[d])&&m0(t[d])?h.y={field:d,aggrType:t[d]}:h.y=Y(d).map((e=>t[e]))}else if("polar"===r){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let a=s;p(r)&&(a=Y(s)[r]),n&&Y(s).includes(n)&&(a=n);const l=i;h=Object.assign({angle:void 0,radius:void 0},o),y(t[a])&&m0(t[a])?h.angle={field:a,aggrType:t[a]}:h.angle=Y(a).map((e=>t[e])),y(t[l])&&m0(t[l])?h.radius={field:l,aggrType:t[l]}:h.radius=Y(l).map((e=>t[e]))}return h.getRefRelativeSeries=()=>e,h}))}else s=i;const n=[];return s.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(p(e.x)){const s=e.x;_(s)?i.x=s.map((i=>O0(i,t,e))):i.x=O0(s,t,e)}if(p(e.y)){const s=e.y;_(s)?i.y=s.map((i=>O0(i,t,e))):i.y=O0(s,t,e)}if(p(e.angle)){const s=e.angle;_(s)?i.angle=s.map((i=>O0(i,t,e))):i.angle=O0(s,t,e)}if(p(e.radius)){const s=e.radius;_(s)?i.radius=s.map((i=>O0(i,t,e))):i.radius=O0(s,t,e)}if(p(e.areaName)){const s=e.areaName;i.areaName=O0(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),n.push(i)})),n}const I0={min:(t,e)=>AO(t[0].latestData,e.field),max:(t,e)=>kO(t[0].latestData,e.field),sum:function(t,e){return TO(t[0].latestData,e.field)},average:function(t,e){return MO(t[0].latestData,e.field)},variance:function(t,e){return CO(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(CO(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return ct(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function O0(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(d(t))return t(a,o,l,s,n,r);if(m(t)){const{aggrType:i,field:s}=t;return I0[i](e,{field:s})}return t}function D0(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class F0 extends NN{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 Yj(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){const s={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return y(e)&&m0(e)?{field:i.getSpec()[s[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Y(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const e=new Ea;return e.registerParser("array",s),new Ba(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(p(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=LO(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e){u(this._spec.offsetX)||(this._layoutOffsetX=aD(this._spec.offsetX,e.width,e)),u(this._spec.offsetY)||(this._layoutOffsetY=aD(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e)}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}_initCommonDataView(){const{options:t}=this._computeOptions(),e=this._getRelativeDataView();qF(this._option.dataSet,"markerAggregation",L0),qF(this._option.dataSet,"markerFilter",D0);const i=new Ba(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 z0(t,e){return function(t,e,i){const{predict:s}=Ft(t,(t=>t[e]),(t=>t[i])),n=AO(t,e),r=kO(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}class j0 extends F0{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=t.LayoutZIndex.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=B0(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const{startSymbol:p={},endSymbol:g={}}=this._spec,f=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),m={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:M0(OF(null===(n=this._spec.line)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:f.map((t=>k0(t,this._markerData,this._markAttributeContext))),state:{line:T0(null!==(o=null===(a=this._spec.line)||void 0===a?void 0:a.state)&&void 0!==o?o:{},this._markerData,this._markAttributeContext),lineStartSymbol:T0(null!==(h=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),lineEndSymbol:T0(null!==(d=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==d?d:{},this._markerData,this._markAttributeContext),label:f.map((t=>{var e;return T0(null!==(e=t.state)&&void 0!==e?e:{},this._markerData,this._markAttributeContext)})),labelBackground:f.map((t=>{var e,i;return T0(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},this._markerData,this._markAttributeContext)}))},animation:null!==(u=this._spec.animation)&&void 0!==u&&u,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};p.visible?m.startSymbol=Object.assign(Object.assign({},p),{visible:!0,style:M0(OF(p.style),this._markerData,this._markAttributeContext)}):m.startSymbol={visible:!1},g.visible?m.endSymbol=Object.assign(Object.assign({},g),{visible:!0,style:M0(OF(g.style),this._markerData,this._markAttributeContext)}):m.endSymbol={visible:!1};return this._newMarkLineComponent(m)}_getUpdateMarkerAttrs(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=this._computePointsAttr(),l=a.getViewData().latestData,h=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData;let c;if(i.clip||Y(i.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:s}=A0([n.getRegion(),r.getRegion(),a.getRegion()]);c={x:t,y:i,width:e-t,height:s-i}}const d=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),u=Y(this._spec.label),p=d.map(((t,e)=>{const i=u[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,l):null==t?void 0:t.text})}));return Object.assign(Object.assign({},o),{label:p,limitRect:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d}=B0(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||c||d||e))return;qF(this._option.dataSet,"markerAggregation",L0),qF(this._option.dataSet,"markerRegression",z0),qF(this._option.dataSet,"markerFilter",D0);const{options:u,needAggr:p,needRegr:g,processData:f}=this._computeOptions(),m=new Ba(this._option.dataSet);m.parse([f],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:u}),g&&m.transform({type:"markerRegression",options:u}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),m.target.on("change",(()=>{this._markerLayout()})),this._markerData=m}}j0.specKey="markLine";const H0=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),N0={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"}}},refY:5},V0={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:H0(!1),endSymbol:H0(!0),label:N0};class U0 extends j0{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new yI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=p(e.coordinates),o=p(e.process),l=o&&p(e.process.x),h=o&&p(e.process.y),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:g,doXYY1Process:f,doYXX1Process:m,doXYProcess:v,doCoordinatesProcess:y}=B0(e);let _=[];if(u||f||g||m||v||a&&l||a&&h){const t=v0(i,s,n,r,d);_=1===t.length?t[0]:t.map((t=>t[0]))}else y?_=_0(i,r,d,e.coordinatesOffset):c&&(_=S0(e.positions,r,e.regionRelative));return{points:_}}_markerLayout(){var t,e,i,s;const n=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const s=this._startRelativeSeries,r=this._endRelativeSeries,{multiSegment:a,mainSegmentIndex:o}=this._spec.line||{},{connectDirection:l,expandDistance:h=0}=this._spec;let c;if(nD(h)){const t=s.getRegion(),e=t.getLayoutStartPoint(),i=r.getRegion(),n=i.getLayoutStartPoint();if("bottom"===l||"top"===l){const s=Math.abs(Math.min(e.y,n.y)-Math.max(e.y+t.getLayoutRect().height,n.y+i.getLayoutRect().height));c=Number(h.substring(0,h.length-1))*s/100}else{const s=Math.abs(Math.min(e.x,n.x)-Math.max(e.x+t.getLayoutRect().width,n.x+i.getLayoutRect().width));c=Number(h.substring(0,h.length-1))*s/100}}else c=h;const{points:d,limitRect:u}=n,g=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(d[0],d[1],l,c);let f;f=a&&p(o)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(d[0],d[1],l,c));const m=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),v=Y(n.label),y=Y(this._spec.label);null===(i=this._markerComponent)||void 0===i||i.setAttributes({points:a?[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]]]:g,label:v.map(((t,e)=>{var i,s,n,r;let a=0,o=0,l=null!==(i=f.dx)&&void 0!==i?i:0,h=null!==(s=f.dy)&&void 0!==s?s:0;const c=null!==(n=y[e])&&void 0!==n?n:y[0];return k(null==c?void 0:c.refX)&&(a+=c.refX),k(null==c?void 0:c.refY)&&(o+=c.refY),k(null==c?void 0:c.dx)&&(l+=c.dx),k(null==c?void 0:c.dy)&&(h+=c.dy),Object.assign(Object.assign(Object.assign({},t),f),{refX:a,refY:o,dx:l,dy:h,textStyle:Object.assign(Object.assign({},null===(r=m[e])||void 0===r?void 0:r.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:u,multiSegment:a,mainSegmentIndex:o,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(s=this._markerComponent)||void 0===s||s.setAttributes(n)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:c,doCoordinatesProcess:d}=B0(n);if(c)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(d){if(t=this._processSpecCoo(n),i=!1,e=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&p(n.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&p(n.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&p(n.process.xy)){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}U0.type=r.markLine,U0.coordinateType="cartesian",U0.builtInTheme={markLine:V0};const W0=()=>{AD.registerComponent(U0.type,U0),vI()};class G0 extends j0{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=B0(this._spec);return e||i?new xI(t):new yI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d,doCoordinatesProcess:u}=B0(e);let p=[],g={};const f={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||c||d){const t=y0(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:f}:{points:p.map((t=>ce(f,t.radius,t.angle)))}}else u&&(p=b0(i,r,a),g={points:p.map((t=>ce(f,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=B0(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}G0.type=r.polarMarkLine,G0.coordinateType="polar",G0.builtInTheme={polarMarkLine:V0};const Y0=()=>{AD.registerComponent(G0.type,G0),xI._animate=JL,vI()};class X0 extends NN{get orient(){return this._orient}constructor(e,i){super(e,i),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=t.LayoutZIndex.Title,this.layoutLevel=t.LayoutLevel.Title,this._orient="top",this._orient=sD(e.orient)?e.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return Yj(t,this.specKey,r.title,(t=>!1!==t.visible))}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}afterSetLayoutStartPoint(t){k(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),k(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:k(t.width())?t.width():0,height:this._spec.height?this._spec.height:k(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o;if(!1===this._spec.visible)return{visible:!1};const l=this.getLayoutRect(),h=aD(this._spec.width,l.width,null,l.width),c=aD(this._spec.maxWidth,l.width,null,l.width),d=Math.max(Math.min(h,c,l.width),0),u=Object.assign(Object.assign({},H(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:null!==(e=this._spec.text)&&void 0!==e?e:"",subtextType:null!==(i=this._spec.subtextType)&&void 0!==i?i:"text",subtext:null!==(s=this._spec.subtext)&&void 0!==s?s:"",x:null!==(n=this._spec.x)&&void 0!==n?n:0,y:null!==(r=this._spec.y)&&void 0!==r?r:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:d,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(a=this._spec.align)&&void 0!==a?a:"left",verticalAlign:null!==(o=this._spec.verticalAlign)&&void 0!==o?o:"top",textStyle:Object.assign({width:d,maxLineWidth:d},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:d},this._spec.subtextStyle)});return p(this._spec.width)&&(u.textStyle.width=Math.max(h,l.width),u.subtextStyle.width=u.textStyle.width),u}_createOrUpdateTitleComponent(t){if(this._titleComponent)U(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new XI(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}}X0.type=r.title,X0.specKey=r.title,X0.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"}}}};const $0=()=>{AD.registerComponent(X0.type,X0)};class K0 extends F0{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=t.LayoutZIndex.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=P0(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o;const l=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:M0(OF(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:l.map((t=>k0(t,this._markerData,this._markAttributeContext))),state:{area:T0(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData,this._markAttributeContext),label:l.map((t=>T0(t.state,this._markerData,this._markAttributeContext))),labelBackground:l.map((t=>{var e;return T0(null===(e=t.labelBackground)||void 0===e?void 0:e.state,this._markerData,this._markAttributeContext)}))},animation:null!==(o=this._spec.animation)&&void 0!==o&&o,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}_markerLayout(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=this._computePointsAttr(),o=this._getRelativeDataView().latestData,l=i?i.latestData[0]&&i.latestData[0].latestData?i.latestData[0].latestData:i.latestData:o;let h;if(e.clip||Y(e.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:a}=A0([s.getRegion(),n.getRegion(),r.getRegion()]);h={x:t,y:i,width:e-t,height:a-i}}if(this._markerComponent){const e=Y(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),i=Y(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},a),{label:e.map(((t,e)=>{const s=i[e]||{};return Object.assign(Object.assign({},t),{text:s.formatMethod?s.formatMethod(l,o):null==t?void 0:t.text})})),limitRect:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=P0(t);if(!(e||i||s||n||r||a||o))return null;this._initCommonDataView()}}K0.specKey="markArea";const q0={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}};class Z0 extends K0{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new bI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=P0(e),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],g=[];if(l){g=v0(i,s,n,r,d);const[t,e]=g;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){g=v0(i,s,n,r,d);const[t,e]=g;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=_0(i,r,d,e.coordinatesOffset):c&&(u=S0(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=P0(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}Z0.type=r.markArea,Z0.coordinateType="cartesian",Z0.builtInTheme={markArea:q0};const J0=()=>{AD.registerComponent(Z0.type,Z0),_I()};class Q0 extends K0{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=P0(this._spec);return i||e||s?new SI(t):new bI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=P0(e),c=null!==(t=e.autoRange)&&void 0!==t&&t;let d,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=y0(i,s,n,r,c);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(d=b0(i,r,c),u={points:d.map((t=>ce(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=P0(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}Q0.type=r.polarMarkArea,Q0.coordinateType="polar",Q0.builtInTheme={polarMarkArea:q0};const t1=()=>{AD.registerComponent(Q0.type,Q0),SI._animate=tI,_I()},e1=t=>OF(Object.assign({},t)),i1=t=>Object.assign(Object.assign({},t),{style:Object.assign({},OF(t.style))}),s1=t=>{var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;const m=e1(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),v=e1(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),y=(_=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},OF(Object.assign({},_)));var _;const b=i1(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),x=i1(null!==(c=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==c?c:{}),S=i1(null!==(u=null===(d=null==t?void 0:t.controller)||void 0===d?void 0:d.backward)&&void 0!==u?u:{}),A=i1(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),k=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(f=t.orient)&&void 0!==f?f:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:m,railStyle:v,handlerStyle:y}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:x,backward:S,forward:A})});return t.visible||(k.controller.visible=!1,k.slider.visible=!1),k},n1=t=>"left"===t||"right"===t,r1=t=>"top"===t||"bottom"===t,a1={visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}};class o1 extends NN{constructor(){super(...arguments),this.layoutZIndex=t.LayoutZIndex.Player,this.layoutLevel=t.LayoutLevel.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},s1(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},s1(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?U(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new hO(t):this._playerComponent=new uO(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Y(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Y(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Y(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Y(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=n1(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=n1(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max(...Y(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Y(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Y(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Y(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=c?h-c:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(t.ChartEvent.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&(this._playerComponent.pause(),this._playerComponent.play())})),this._playerComponent.addEventListener(sO.end,(()=>{var e;this.event.emit(t.ChartEvent.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===(e=this._spec)||void 0===e?void 0:e.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(sO.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(sO.backward,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerBackward,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.forward,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerForward,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.play,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerPlay,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.pause,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerPause,{model:this,value:{spec:s,index:i,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),k(t.x)){const e=n1(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(k(t.y)){const e=r1(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}_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 S(this._spec.width)?Math.min(t.width,Number(this._spec.width)):n1(this._orient)?this._maxSize():t.width}_computeHeight(t){return S(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):r1(this._orient)?this._maxSize():t.height}_computeDx(t){return n1(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return r1(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(e){const i=this._specs[e];this._option.globalInstance.updateFullData(i.data),this.event.emit(t.ChartEvent.playerChange,{model:this,value:{spec:i,index:e,specs:this._specs}})}}o1.builtInTheme={player:a1},o1.specKey="player",o1.type=r.player;const l1=()=>{AD.registerComponent(o1.type,o1)};class h1 extends NN{constructor(e,i){super(e,i),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.Label,this._regions=i.getRegionsInIndex(i.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,U(e,t)||(i.reMake=!0),i}_getDataLabelType(t,e){const 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})=>{const n=i(),r=GO({type:"palette",key:"secondaryFontColor"},this.getColorScheme());return{dataLabels:Y(e).map(((e,i)=>{const a=t(i),o=[],l=e.getGraphics();if(l)return a.data&&a.data.length?a.data.forEach(((t,e)=>{if(l[e]){const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}})):l.forEach((t=>{const{data:e,diffState:n}=t.context;n!==Wz.exit&&e.forEach(((t,{})=>{const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}))})),m(a.overlap)&&u(a.overlap.size)&&(a.overlap.size=Object.assign({},n)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:e.getProductId(),getBaseMarks:()=>l},a),{type:this._getDataLabelType(e,a.type),data:o})})),size:n}}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getComponent();i&&t.push(i)})),t}clear(){super.clear(),this.getMarks().forEach((t=>{t&&t.clearComponent()}))}}h1.type=r.label;class c1 extends PG{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(){}}c1.type="text",c1.constructorType="label";const d1=()=>{RG(),AD.registerMark(c1.constructorType,c1)};class u1 extends HN{_initTheme(t,e){return{spec:t,theme:this._theme}}}class p1 extends h1{constructor(e,i){super(e,i),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=u1,this.layoutZIndex=t.LayoutZIndex.Label,this._layoutRule=e.labelLayout||"series"}static getSpecInfo(t,e){const i=[],s=(null==e?void 0:e.region)||[];return s.forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&(this._labelInfoMap.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(t.ChartEvent.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.disableAnimation()})),this.event.on(NF.AFTER_MARK_RENDER_END,e)}));const e=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.enableAnimation()})),this.event.off(NF.AFTER_MARK_RENDER_END,e)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),PO(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n<i.length;n++){const r=i[n],a=t.getMarkInName(r);a&&e[r].forEach(((e,i)=>{var n,o,l;if(e.visible){const h=this._labelInfoMap.get(s),c=this._createMark({type:"label",name:`${null!==(n=t.userId)&&void 0!==n?n:t.id}-${r}-label-${i}`},{attributeContext:t.getMarkAttributeContext()});e.showRelatedMarkTooltip&&(null===(l=null===(o=t.tooltipHelper)||void 0===o?void 0:o.activeTriggerSet.mark)||void 0===l||l.add(c)),c.setTarget(a),h.push({labelMark:c,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){const t={};this._labelComponentMap.forEach(((e,i)=>{t[i.name]=i})),this._labelInfoMap.forEach(((e,i)=>{if("region"===this._layoutRule){let s=!1;const n=`${i.getGroupMark().name}-label-component`;let r=t[n];r||(s=!0,r=this._createMark({type:"component",name:n},{componentType:"label"},{support3d:this._spec.support3d})),r&&(s&&(r.setSkipBeforeLayouted(!0),this._marks.addMark(r),e.forEach((t=>{var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(r)}))),e[0]&&p(e[0].labelSpec.zIndex)&&r.setMarkConfig({zIndex:e[0].labelSpec.zIndex}),this._labelComponentMap.set(r,(()=>this._labelInfoMap.get(i))),t[n]=null)}else e.forEach(((e,s)=>{var n;let r=!1;const a=`${e.labelMark.name}-component`;let o=t[a];o||(r=!0,o=this._createMark({type:"component",name:a},{componentType:"label",noSeparateStyle:!0},{support3d:e.baseMark.getMarkConfig().support3d})),o&&(p(e.labelSpec.zIndex)&&o.setMarkConfig({zIndex:e.labelSpec.zIndex}),r&&(o.setSkipBeforeLayouted(!0),this._marks.addMark(o),null===(n=e.baseMark.getData())||void 0===n||n.addRelatedMark(o)),this._labelComponentMap.set(o,(()=>this._labelInfoMap.get(i)[s])),t[a]=null)}))})),Object.keys(t).forEach((e=>{const i=t[e];i&&(i.release(),this._labelComponentMap.delete(i))}))}_initTextMarkStyle(){this._labelComponentMap.forEach(((t,e)=>{Y(t()).forEach((({labelMark:t})=>{t.setComponent(e)}))})),this._labelInfoMap.forEach((e=>{e.forEach((e=>{var i,s;const{labelMark:n,labelSpec:r,series:a}=e;if(this.initMarkStyleWithSpec(n,r),d(null==r?void 0:r.getStyleHandler)){const t=r.getStyleHandler(a);null==t||t.call(a,n,r)}(null===(s=null===(i=n.stateStyle)||void 0===i?void 0:i.normal)||void 0===s?void 0:s.lineWidth)&&n.setAttribute("stroke",a.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();_(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e,t.map((({baseMark:t})=>t)),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e,i,[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:t=>{var e,n;const r=i[t],{labelSpec:a,labelMark:o,series:l}=r,h=o.getRule(),c=this._interactiveConfig(a),d=null!==(n=null===(e=this._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==n?n:0;let u=SD({textStyle:Object.assign({pickable:!0===a.interactive},a.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},ZW(h,r),Object.assign(Object.assign(Object.assign({},H(a,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),a.stackDataFilterType?{dataFilter:"min"===a.stackDataFilterType?t=>t.filter((t=>t.data[cF])):t=>t.filter((t=>t.data[hF]))}:{});return l&&l.parseLabelStyle&&(u=l.parseLabelStyle(u,a,o)),"line"!==h&&"area"!==h||(u.type=h),u},size:()=>{var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:(t,{labelIndex:e})=>i[e]&&!i[e].labelMark.skipEncode?JW(i[e],t,i[e].labelSpec.formatMethod,i[e].labelSpec.formatter):{data:t}}),this._setTransformOfComponent(t,e)}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=_(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i})}))}getLabelInfoByTextGraphic(t){let e;const i=null==t?void 0:t.parent,s=null==i?void 0:i.parent;if(s){const t=s.getChildren().indexOf(i);this._labelComponentMap.forEach(((i,n)=>{n.getComponent()===s&&(e=Y(i())[t])}))}return e}}p1.type=r.label,p1.specKey="label",p1.transformerConstructor=u1;const g1=()=>{AD.registerGraphicComponent(p1.type,(t=>new bL(t))),d1(),GN(),AD.registerComponent(p1.type,p1,!0,1/0)};class f1 extends h1{constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=t.LayoutZIndex.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var e;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[oF]},"normal",t.AttributeLevel.Default);const i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}_initLabelComponent(){var t;const e=this._getSeries(),i=this._createMark({type:"component",name:`${null!==(t=e.name)&&void 0!==t?t:e.type}-total-label-component`},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.setMarkConfig({interactive:!1}),e.setSimpleStyle({labelStyle:()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r,position:a="top"}=this._spec,o=this._interactiveConfig(this._spec);return SD({textStyle:{pickable:!0===this._spec.interactive},position:m1(t,this._baseMark.type,a),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>"bottom"===a?t.data[cF]:t.data[hF]))},o))}},size:()=>{var t;return Object.assign({padding:null===(t=this._spec.overlap)||void 0===t?void 0:t.padding},this._regions[0].getLayoutRect())},itemEncoder:e=>JW({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod)}),this._setTransformOfComponent(e,this._baseMark)}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function m1(t,e,i="top"){var s,n;let r;const{direction:a}=t;let o;o="bottom"===i?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};const l=("horizontal"===a?null===(s=t.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=o[a][l];break;default:r="top"}return r}f1.type=r.totalLabel,f1.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"}}}},f1.specKey="totalLabel";const v1=()=>{AD.registerGraphicComponent(f1.type,(t=>new bL(t))),d1(),GN(),AD.registerComponent(f1.type,f1,!0)};class y1 extends F0{constructor(){super(...arguments),this.specKey="markPoint",this.layoutZIndex=t.LayoutZIndex.MarkPoint}static _getMarkerCoordinateType(t){const{doPolarProcess:e,doGeoProcess:i}=R0(t);return"polar"===t.coordinateType||e?"polar":"geo"===t.coordinateType||i?"geo":"cartesian"}_createMarkerComponent(){var t,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x,S,A,k,T,M,C,w,E,B,P,R;const{itemContent:L={},itemLine:I={},targetSymbol:O={}}=this._spec,D=L,{type:F="text",text:z,symbol:H,image:N,richText:V,customMark:U,textStyle:W,symbolStyle:G,imageStyle:Y,richTextStyle:X,customMarkStyle:$,style:K={},state:q={}}=D,Z=e(D,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]);let J=null,Q=null,tt={};"text"===F?(J=null!==(t=null==z?void 0:z.state)&&void 0!==t?t:q,tt={dx:0,dy:0},Q=k0(j(tt,null!==(i=null!=z?z:W)&&void 0!==i?i:K),this._markerData,this._markAttributeContext)):"richText"===F?(J=null!==(s=null==V?void 0:V.state)&&void 0!==s?s:q,tt={width:100,height:100},Q=M0(j(tt,null!==(r=null!==(n=null==V?void 0:V.style)&&void 0!==n?n:X)&&void 0!==r?r:K),this._markerData,this._markAttributeContext)):"symbol"===F?(J=null!==(a=null==H?void 0:H.state)&&void 0!==a?a:q,tt={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},Q=OF(M0(j(tt,null!==(l=null!==(o=null==H?void 0:H.style)&&void 0!==o?o:G)&&void 0!==l?l:K),this._markerData,this._markAttributeContext))):"image"===F?(J=null!==(h=null==N?void 0:N.state)&&void 0!==h?h:q,tt={width:80,height:80},Q=M0(j(tt,null!==(d=null!==(c=null==N?void 0:N.style)&&void 0!==c?c:Y)&&void 0!==d?d:K),this._markerData,this._markAttributeContext)):"custom"===F&&(J=null!==(u=null==U?void 0:U.state)&&void 0!==u?u:q,Q=M0(null!==(g=null!==(p=null==U?void 0:U.style)&&void 0!==p?p:$)&&void 0!==g?g:K,this._markerData,this._markAttributeContext));const et={zIndex:this.layoutZIndex,interactive:null===(f=this._spec.interactive)||void 0===f||f,hover:null===(m=this._spec.interactive)||void 0===m||m,select:null===(v=this._spec.interactive)||void 0===v||v,position:{x:0,y:0},clipInRange:null!==(y=this._spec.clip)&&void 0!==y&&y,itemContent:Object.assign(Object.assign({type:F,offsetX:C0(L.offsetX,this._relativeSeries.getRegion()),offsetY:C0(L.offsetX,this._relativeSeries.getRegion())},Z),{style:M0(Q,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(_=O.offset)&&void 0!==_?_:0,visible:null!==(b=O.visible)&&void 0!==b&&b,size:null!==(x=O.size)&&void 0!==x?x:20,style:M0(O.style,this._markerData,this._markAttributeContext)},state:{line:T0(null!==(A=null===(S=this._spec.itemLine.line)||void 0===S?void 0:S.state)&&void 0!==A?A:{},this._markerData,this._markAttributeContext),lineStartSymbol:T0(null!==(T=null===(k=this._spec.itemLine.startSymbol)||void 0===k?void 0:k.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),lineEndSymbol:T0(null!==(C=null===(M=this._spec.itemLine.endSymbol)||void 0===M?void 0:M.state)&&void 0!==C?C:{},this._markerData,this._markAttributeContext),itemContent:T0(J,this._markerData,this._markAttributeContext),textBackground:T0(null===(E=null===(w=this._spec.itemContent.text)||void 0===w?void 0:w.labelBackground)||void 0===E?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:T0(null!==(P=null===(B=this._spec.targetSymbol)||void 0===B?void 0:B.state)&&void 0!==P?P:{},this._markerData,this._markAttributeContext)},animation:null!==(R=this._spec.animation)&&void 0!==R&&R,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},{visible:it,line:st={}}=I,nt=e(I,["visible","line"]);et.itemLine=!1!==it?Object.assign(Object.assign({},nt),{visible:!0,lineStyle:OF(st.style)}):{visible:!1};return new kI(et)}_markerLayout(){var t,e,i,s,n;const r=this._spec,a=this._markerData,o=this._relativeSeries,{point:l}=this._computePointsAttr(),h=this._getRelativeDataView().latestData,c=a?a.latestData[0]&&a.latestData[0].latestData?a.latestData[0].latestData:a.latestData:h;let d;if(r.clip||(null===(t=r.itemContent)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=A0([o.getRegion()]);d={x:t,y:i,width:e-t,height:s-i}}if(this._markerComponent){const t=null!==(e=this._markerComponent.attribute)&&void 0!==e?e:{},r=null!==(s=null===(i=t.itemContent)||void 0===i?void 0:i.textStyle)&&void 0!==s?s:{};this._markerComponent.setAttributes({position:void 0===l?{x:null,y:null}:l,itemContent:Object.assign(Object.assign({},t.itemContent),{textStyle:Object.assign(Object.assign({},r),{text:(null===(n=this._spec.itemContent.text)||void 0===n?void 0:n.formatMethod)?this._spec.itemContent.text.formatMethod(c,h):r.text}),offsetX:w0(l,t.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:w0(l,t.itemContent.offsetY,this._relativeSeries.getRegion())}),limitRect:d,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){const t=this._spec,{doXYProcess:e,doPolarProcess:i,doGeoProcess:s}=R0(t);(p(t.coordinate)||e||i||s)&&this._initCommonDataView()}}y1.specKey="markPoint";const _1={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 b1 extends y1{constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t,e,i;const s=this._spec,n=this._markerData,r=this._relativeSeries,a=p(s.x)&&p(s.y),o=p(s.coordinate),l=p(s.position),h=null!==(t=null==s?void 0:s.autoRange)&&void 0!==t&&t;let c;return a?c=null===(i=null===(e=v0(n,r,r,r,h))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:o?c=_0(n,r,h,s.coordinatesOffset)[0]:l&&(c=S0(s.position,r,s.regionRelative)[0]),{point:c}}_computeOptions(){const t=this._spec,{doXYProcess:e}=R0(t),i=p(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}b1.type=r.markPoint,b1.coordinateType="cartesian",b1.builtInTheme={markPoint:_1};const x1=()=>{AD.registerComponent(b1.type,b1),AI()};class S1 extends y1{constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=y0(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:ce({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}S1.type=r.polarMarkPoint,S1.coordinateType="polar",S1.builtInTheme={polarMarkPoint:_1};const A1=()=>{AD.registerComponent(S1.type,S1),AI()};class k1 extends y1{constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){const t=function(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{p(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}(this._markerData,this._relativeSeries)[0][0];return{point:t}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}k1.type=r.geoMarkPoint,k1.coordinateType="geo",k1.builtInTheme={geoMarkPoint:_1};const T1=()=>{AD.registerComponent(k1.type,k1),AI()},M1="inBrush",C1="outOfBrush";class w1 extends NN{constructor(){super(...arguments),this.layoutType="none",this.type=r.brush,this.name=r.brush,this.specKey="brush",this.layoutZIndex=t.LayoutZIndex.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 Yj(t,this.specKey,this.type,(t=>!1!==t.visible))}init(){const e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((s=>{s.getActiveMarks().forEach((n=>{n&&(s.setMarkStyle(n,Object.assign({},e),M1,t.AttributeLevel.Series),s.setMarkStyle(n,Object.assign({},i),C1,t.AttributeLevel.Series))}))}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Y(t).includes(n.userId.toString())||e&&Y(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_bindRegions(){p(this._spec.regionId)||p(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}_bindLinkedSeries(){(p(this._spec.brushLinkSeriesId)||p(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(Y(this._spec.brushLinkSeriesId),Y(this._spec.brushLinkSeriesIndex)))}_initRegionAxisMap(){p(this._spec.axisId)?Y(this._spec.axisId).forEach((t=>{this._releatedAxes.push(this._option.getComponentByUserId(t))})):p(this._spec.axisIndex)?Y(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)}));const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(){var t;if(super.onLayoutEnd(),this._option.disableTriggerEvent)return;(null===(t=this._spec.visible)||void 0===t||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){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild()}_createBrushComponent(e,i){var s,n;const r=this._getBrushInteractiveAttr(e),a=new mO(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:OF(null===(s=this._spec)||void 0===s?void 0:s.style)},r),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));a.id=null!==(n=this._spec.id)&&void 0!==n?n:`brush-${this.id}`,this.getContainer().add(a),this._brushComponents.push(a),this._cacheInteractiveRangeAttrs.push(r),a.addEventListener(cO.brushActive,(s=>{this._initMarkBrushState(i,C1),this._emitEvent(t.ChartEvent.brushActive,e)})),a.addEventListener(cO.drawStart,(i=>{this._setRegionMarkPickable(e,!0),this._emitEvent(t.ChartEvent.brushStart,e)})),a.addEventListener(cO.moveStart,(i=>{this._setRegionMarkPickable(e,!0),this._emitEvent(t.ChartEvent.brushStart,e)})),a.addEventListener(cO.drawing,(i=>{this._setRegionMarkPickable(e,!1),this._handleBrushChange(e,i),this._emitEvent(t.ChartEvent.brushChange,e)})),a.addEventListener(cO.moving,(i=>{this._setRegionMarkPickable(e,!1),this._handleBrushChange(e,i),this._emitEvent(t.ChartEvent.brushChange,e)})),a.addEventListener(cO.brushClear,(s=>{this._setRegionMarkPickable(e,!0),this._initMarkBrushState(i,""),this._emitEvent(t.ChartEvent.brushClear,e)})),a.addEventListener(cO.drawEnd,(s=>{var n;this._setRegionMarkPickable(e,!0);const{operateMask:r}=s.detail,{updateElementsState:a=!0}=this._spec;if(null===(n=this._spec)||void 0===n?void 0:n.onBrushEnd)!0===this._spec.onBrushEnd(s)?(this.clearGraphic(),this._initMarkBrushState(i,""),this._emitEvent(t.ChartEvent.brushClear,e)):(this._spec.onBrushEnd(s),this._emitEvent(t.ChartEvent.brushEnd,e));else{const i=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&i.length>0||!a)&&this._setAxisAndDataZoom(r,e),this._emitEvent(t.ChartEvent.brushEnd,e)}})),a.addEventListener(cO.moveEnd,(i=>{this._setRegionMarkPickable(e,!0);const{operateMask:s}=i.detail,{updateElementsState:n=!0}=this._spec,r=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&r.length>0||n)&&this._setAxisAndDataZoom(s,e),this._emitEvent(t.ChartEvent.brushEnd,e)}))}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},OF(t)),e)}_handleBrushChange(t,e){const{operateMask:i}=e.detail,{updateElementsState:s=!0}=this._spec;s&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}_extendDataInBrush(t){var e,i;const s=[];for(const n in t)for(const r in t[n])s.push(Object.assign({},null===(i=null===(e=t[n][r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return s}_extendDatumOutOfBrush(t){var e,i;const s=[];for(const n in t)s.push(null===(i=null===(e=t[n].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return s}_emitEvent(t,e){var i;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===(i=this._option)||void 0===i?void 0:i.globalInstance})}_reconfigItem(t,e){var i,s,n;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const r=null!==(n=null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points)&&void 0!==n?n:[],{a:a,b:o,c:l,d:h,e:c,f:d}=t.globalTransMatrix,u=r.map((t=>({x:a*t.x+l*t.y+c,y:o*t.x+h*t.y+d}))),{markTypeFilter:p=[]}=this._spec;this._itemMap[e.id].forEach((e=>{if(p.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;const a=e.id+"_"+i.context.key,o=this._isBrushContainItem(t.globalAABBBounds,u,i);(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[a])&&o?(i.addState(M1,!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][a]=i,delete this._outOfBrushElementsMap[a]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!o&&(i.removeState(M1),i.addState(C1,!0),this._outOfBrushElementsMap[a]=i,delete this._inBrushElementsMap[t.name][a])}))}))}_reconfigLinkedItem(t,e){var i;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const s=e.getLayoutStartPoint(),n=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{var i,r;if(!n.includes(e.id)){const n=e.getRegion().getLayoutStartPoint(),a=n.x-s.x,o=n.y-s.y,l=null!==(r=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==r?r:[],{a:h,b:c,c:d,d:u,e:p,f:g}=t.globalTransMatrix,f=a||0,m=o||0,v=l.map((t=>({x:h*t.x+d*t.y+p+f,y:c*t.x+u*t.y+g+m})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+f,t.globalAABBBounds.y1+m,t.globalAABBBounds.x2+f,t.globalAABBBounds.y2+m);const{markTypeFilter:y=[]}=this._spec;this._linkedItemMap[e.id].forEach((e=>{if(y.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;i.context;const a=e.id+"_"+i.context.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[a])&&this._isBrushContainItem(t.globalAABBBounds,v,i)?(i.addState(M1,!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][a]=i,delete this._linkedOutOfBrushElementsMap[a]):(null===(r=null===(n=this._linkedInBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!this._isBrushContainItem(t.globalAABBBounds,v,i)&&(i.removeState(M1),i.addState(C1,!0),this._linkedOutOfBrushElementsMap[a]=i)}))}))}}))}_isBrushContainItem(t,e,i){let s=[];if(["symbol","rect"].includes(i.type)){const{x1:t,x2:n,y1:r,y2:a}=null==i?void 0:i.globalAABBBounds;return s=[{x:t,y:r},{x:n,y:r},{x:n,y:a},{x:t,y:a}],function(t,e){for(let i=0;i<e.length;i++){if(Re(t,e[i].x,e[i].y))return!0;if(i>0&&Pe(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,s)}return t.intersects(i.globalAABBBounds)}_initItemMap(t,e,i){const{markTypeFilter:s=[]}=this._spec;Object.entries(t).forEach((([t,n])=>{n.forEach((t=>{if(s.includes(t.type))return;const n=t.getGraphics();n&&n.length&&n.forEach((s=>{const n=t.id+"_"+s.context.key;s.removeState(M1),s.removeState(C1),i&&s.addState(i,!0),e[n]=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){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:c}=s,d=r?"x":"y",u=r?o:h,p=r?l:c;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[d]),r=s.getScale().invert(p-e.getLayoutStartPoint()[d]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),c=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,c),Math.max(h,c),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:c,startValue:i.statePointToData(h),endValue:i.statePointToData(c)})}else{const i=t.getScale().range(),s=null!==(n=t.scaleRangeFactor())&&void 0!==n?n:[0,1],r=X(i)<i[0],o=u-e.getLayoutStartPoint()[d],l=p-e.getLayoutStartPoint()[d],h=r?Math.min(o,l):Math.max(o,l),c=r?Math.max(o,l):Math.min(o,l),g=(c-i[0])/(X(i)-i[0])*(s[1]-s[0])+s[0],f=(h-i[0])/(X(i)-i[0])*(s[1]-s[0])+s[0],m=this._stateClamp(g-a),v=this._stateClamp(f+a);t.scaleRangeFactor([m,v]),t.effect.scaleUpdate(),this._zoomRecord.push({operateComponent:t,start:m,end:v,startValue:t.getScale().invert(c),endValue:t.getScale().invert(h)})}}))}}_getNeedClearVRenderComponents(){return this._brushComponents}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach(((e,i)=>{this._initMarkBrushState(i,""),e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}w1.type=r.brush,w1.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},w1.specKey="brush";const E1=()=>{AD.registerComponent(w1.type,w1)};class B1 extends NN{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.CustomMark,this.layoutLevel=t.LayoutLevel.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;let t=null;if(this._spec.parent){const e=this.getChart().getAllMarks().find((t=>t.getUserId()===this._spec.parent));"group"===e.type&&(t=e)}this._createExtensionMark(this._spec,t,`${YD}_series_${this.id}_extensionMark`,0)}_createExtensionMark(t,e,i,s=0){var n,r;const a=this._createMark({type:t.type,name:p(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(p(t.id)&&a.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){const e=xH({},SH(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(u(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e)}))),p(t.dataId)||k(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(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?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Ve).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Ve;return this.getMarks().forEach((e=>{const 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);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}getVRenderComponents(){const t=[],e=i=>{if(i&&"group"===i.type)i.getMarks().forEach((t=>{e(t)}));else if("component"===i.type){const e=null==i?void 0:i.getComponent();e&&t.push(e)}};return this.getMarks().forEach((t=>{e(t)})),t}}B1.type=r.customMark,B1.specKey="customMark";const P1=()=>{AD.registerComponent(B1.type,B1)};class R1{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(k(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:d(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&p(e.modelId)){if(p(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&p(e.modelKey)&&"modelIndex"in e&&p(e.modelIndex)){if((null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0}return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r<t[e]+(null!==(i=t[`${e}Span`])&&void 0!==i?i:1);r++)n+=s[r].value;return n}getSizeFromUser(t,e){var i,s;const n="col"===e?this._colSize:this._rowSize;if(!(null===(i=n[t[e]])||void 0===i?void 0:i.isUserSetting))return;let r=0;for(let i=t[e];i<t[e]+(null!==(s=t[`${e}Span`])&&void 0!==s?s:1);i++){if(!n[i].isUserSetting)return;r+=n[i].value}return r}setItemLayoutSizeToGrid(t,e){if(L1(t)){if(e.colSpan&&e.colSpan>1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;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;const s=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(s,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(s,"row"))&&void 0!==i?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));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>L1(t))),a=n.filter((t=>!L1(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>L1(t))),h=o.filter((t=>!L1(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);k(h.width)||(h.width=l.width),k(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function L1(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}R1.type="grid";const I1=()=>{AD.registerLayout(R1.type,R1)},O1=()=>{Lh.load(XC)},D1="vchart-tooltip",F1=`${D1}-container`,z1=`${D1}-title`,j1=`${D1}-content-box`,H1={offsetX:10,offsetY:10},N1="99999999999999";function V1(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}const U1=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1,W1=t=>y(t)&&""!==(null==t?void 0:t.trim())||S(t)?V1(t):"",G1=(t,e)=>{let i;if(p(t))if(S(t))i=t;else if(d(t)){const s=t(e);S(s)&&(i=s)}return i},Y1={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]},X1=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=Y1[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i};class $1 extends fN{constructor(){super(...arguments),this._visible=!0,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this.changeTooltip=(t,e,i)=>this._isReleased?1:t?this.changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this.changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:c}=t;if(!h)return 1;const d=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,d,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,c));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[d])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let f=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(f=!1),this._updateTooltip(f,Object.assign(Object.assign({},t),{changePositionOnly:c})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,h,c,u;const f=this._chartOption.getRectByDimensionData,{tooltipSpec:m}=e,v={x:1/0,y:1/0};if(!m)return v;const y=e.event,{activeType:_,data:b}=t,x="dimension"===_?null===(n=null===(s=b[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==b?void 0:b[0],{offsetX:A,offsetY:T}=this._option,M=m[_],C=qj(null==M?void 0:M.position,b,e),w=null!==(r=qj(null==M?void 0:M.positionMode,b,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:E=0,height:B=0}=null!=i?i:{},P="canvas"===m.renderMode,R=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),L=null!==(o=null==R?void 0:R.width)&&void 0!==o?o:XD,I=null!==(l=null==R?void 0:R.height)&&void 0!==l?l:$D;let O=!1;const D={width:0,height:0};let F,z={x:0,y:0},j={x:0,y:0},H=1,N=1;const V=q_(this._env);if(V&&!m.confine?(D.width=window.innerWidth,D.height=window.innerHeight):(D.width=L,D.height=I),V&&!P){const t=this._getParentElement(m);j=null!==(c=null===(h=null==t?void 0:t.getBoundingClientRect)||void 0===h?void 0:h.call(t))&&void 0!==c?c:v;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer;F=null==e?void 0:e.getBoundingClientRect(),z={x:F.x-j.x,y:F.y-j.y},H=U1(e,F),N=U1(t,j)}const U=N/H,W={},G={x:C,y:C},Y={x:["left","right"],y:["top","bottom"]},X=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),c=null!=s?s:"x"===n?A:T;if("mark"===i){O=!0;const t=e.item,i=null==t?void 0:t.AABBBounds;i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if(f&&"crosshair"===i&&"cartesian"===(null===(r=null==x?void 0:x.series)||void 0===r?void 0:r.coordinate)&&x.datum&&x.datum.length){O=!0;const t=f(x,h);t&&(a=t.start[n],o=t.end[n])}else G[n]=t;if(O){const e=Y[n][0],i="x"===n?E:B;switch(X1(t,n)){case-2:W[e]=a-i*U-c;break;case-1.5:W[e]=a+c;break;case 0:W[e]=(a+o)/2-i*U/2;break;case-1:W[e]=(a+o)/2-i*U-c;break;case 1:W[e]=(a+o)/2+c;break;case 1.5:W[e]=o-i*U-c;break;case 2:W[e]=o+c}}},$=["x","y"];if(g(C))if(g(K=C)&&(p(K.left)||p(K.right)||p(K.top)||p(K.bottom))){const{left:t,right:e,top:i,bottom:s}=C;W.left=G1(t,y),W.top=G1(i,y),W.right=G1(e,y),W.bottom=G1(s,y)}else(t=>g(t)&&(p(t.x)||p(t.y)))(C)&&$.forEach((t=>{const e=C[t];S(e)||d(e)?W[Y[t][0]]=G1(e,y):X(e,t)}));else p(C)&&(X({orient:C,mode:w},"x"),X({orient:C,mode:w},"y"));var K;const q={x:null,y:null};return $.forEach((t=>{var e;const i="x"===t?E:B,s="x"===t?L:I,n="x"===t?A:T,r=X1(G[t],t);if(k(W[Y[t][0]]))q[t]=W[Y[t][0]];else if(k(W[Y[t][1]]))q[t]=s-i*U-W[Y[t][1]];else{const e="x"===t?y.canvasX:y.canvasY;q[t]=r>0?e+n:0===r?e-i*U/2:e-i*U-n}q[t]*=H,V&&(q[t]+=z[t]),q[t]/=N;const a="x"===t?D.width:D.height,o=m.confine?-(j[t]-(null!==(e=null==F?void 0:F[t])&&void 0!==e?e:0)/H)/N:-j[t]/N,l=a/N+o-i;2!==r&&q[t]<o?O?q[t]=o:(q[t]+=0===r?n+i/2:2*n+i,q[t]>l&&(q[t]=l)):-2!==r&&q[t]>l&&(O?q[t]=l:(q[t]-=0===r?n+i/2:2*n+i,q[t]<o&&(q[t]=o)))})),q}}get env(){return this._env}onAdd(t){super.onAdd(t);const 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;const n=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};n.handler?null===(s=(i=n.handler).release)||void 0===s||s.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:H1.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:H1.offsetY}:H1}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}$1.specKey="tooltip";const K1=(t,e)=>p(t)?_(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",q1=(t={},e={})=>{var i,s;p(t.fontFamily)&&(e.fontFamily=t.fontFamily);const n=null!==(i=t.fill)&&void 0!==i?i:t.fontColor;return p(n)&&(e.color=n),p(t.fontWeight)&&(e.fontWeight=t.fontWeight),p(t.textAlign)&&(e.textAlign=t.textAlign),p(t.fontSize)&&(e.fontSize=K1(t.fontSize)),p(t.maxWidth)&&(e.maxWidth=K1(t.maxWidth)),t.multiLine||p(t.maxWidth)&&!1!==t.multiLine?(e.whiteSpace="initial",e.wordBreak=null!==(s=t.wordBreak)&&void 0!==s?s:"break-word"):(e.wordBreak="normal",e.whiteSpace="nowrap"),e},Z1=(t={})=>{const{lineHeight:e}=t;return t.fontSize?aD(e,t.fontSize):0},J1=t=>{var e;const{backgroundColor:i,border:s,shadow:n,padding:r}=t,a={borderWidth:`${null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0}px`};let o=null;(null==s?void 0:s.color)&&(a.borderColor=s.color),i&&(a.backgroundColor=i),a.boxShadow=n?`${n.x}px ${n.y}px ${n.blur}px ${n.spread}px ${n.color}`:"initial";const{radius:l}=null!=s?s:{};return p(l)&&(a.borderRadius=k(l)?`${l}px`:`${l}`),r&&(o=oi(r),a.padding=K1(o)),{panelStyle:a,panelPadding:o}};function Q1(t,e){t&&t.style&&e&&Object.keys(e).forEach((i=>{t.style[i]=e[i]}))}const t2=t=>{AD.registerComponentPlugin(t.type,t)};class e2 extends $1{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(e2.type),this.type=mU.dom,this._tooltipContainer=null==K_?void 0:K_.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec().parentElement;if(K_&&t&&t.children&&t.children.length){for(let e=0;e<t.children.length;e++)if(t.children[e].classList.contains(F1)){this._container=t.children[e];break}this._container||(this._container=K_.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=N1,this._container.classList.add(F1),t.appendChild(this._container))}}initRootDom(){var t;const e=this._component.getSpec(),i=document.createElement("div"),s=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");Q1(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:N1,fontFamily:null!=s?s:fD.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);const s=null===(i=this._rootDom)||void 0===i?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){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r);const a=this._rootDom;if(a){const{x:o=0,y:l=0}=null!==(i=r.position)&&void 0!==i?i:{};let h={x:o,y:l};const c=this.getVisibility();n.updateElement&&(this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:o,y:l}),n.updateElement(a,r,e),h=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight}),this._cacheCustomTooltipPosition=h),!c&&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(){const t=this._component.getSpec();this._domStyle=((t={})=>{var e,i,s,n;const{style:r={},enterable:a,transitionDuration:o}=t,{panel:l={},titleLabel:h,shape:c,keyLabel:d,valueLabel:p,spaceRow:g,align:f}=r,{panelStyle:m,panelPadding:v}=J1(l),y={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=a?"auto":"none",o&&(m.transitionDuration=o?`${o}ms`:"initial",m.transitionProperty=o?"transform":"initial",m.transitionTimingFunction=o?"ease-out":"initial"),k(g)&&(y.marginBottom=`${g}px`);const _={width:K1(null!==(e=null==c?void 0:c.size)&&void 0!==e?e:8)},b=q1(h),x=q1(d),S=q1(p),A="right"===f?"marginLeft":"marginRight";"right"===f&&(m.direction="rtl"),u(b.textAlign)&&(b.textAlign="right"===f?"right":"left"),u(x.textAlign)&&(x.textAlign="right"===f?"right":"left"),u(S.textAlign)&&(S.textAlign="right"===f?"left":"right"),_[A]=K1(null!==(i=c.spacing)&&void 0!==i?i:8),x[A]=K1(null!==(s=d.spacing)&&void 0!==s?s:26),S[A]=K1(null!==(n=p.spacing)&&void 0!==n?n:0);const T=Math.max(Z1(p),Z1(d));return y.lineHeight=T>0?`${T}px`:"20px",{panelPadding:v,row:y,panel:m,title:b,shape:_,key:x,value:S}})(t)}_updateDomStringByCol(t){var e;const{title:i={},content:s}=t,n=s&&s.length,r=this._domStyle.row,a=[...this._rootDom.children];let o=a.find((t=>t.className.includes(z1))),l=a.find((t=>t.className.includes(j1)));if(!o&&!1!==i.visible){o=document.createElement("h2");const t=document.createElement("span");o.appendChild(t),o.classList.add(z1),this._rootDom.firstChild?this._rootDom.insertBefore(o,this._rootDom.firstChild):this._rootDom.appendChild(o)}o&&!1!==i.visible?(Q1(o,Object.assign(Object.assign(Object.assign({},this._domStyle.title),n?r:{marginBottom:"0px"}),{marginTop:"0px"})),o.firstChild.innerHTML=`${null!==(e=i.value)&&void 0!==e?e:""}`):o&&!1===i.visible&&o.parentNode.removeChild(o);const h=["shape","key","value"];if(!l&&n&&(l=document.createElement("div"),h.forEach((t=>{const e=document.createElement("div");e.classList.add(`${D1}-column`),e.classList.add(`${D1}-${t}-column`),e.setAttribute("data-col",t),l.appendChild(e)})),l.classList.add(j1),this._rootDom.appendChild(l)),l&&n){const t=[...l.children];Q1(l,{whiteSpace:"nowrap"}),t.forEach(((t,e)=>{const i=t.getAttribute("data-col");if(i&&h.includes(i)){const e="shape"===i&&s.every((t=>!t.hasShape||!t.shapeType));Q1(t,Object.assign(Object.assign({},this._domStyle[i]),{display:e?"none":"inline-block",verticalAlign:"top"}));const n=[...t.children];n.slice(s.length).forEach((t=>{t.parentNode.removeChild(t)})),s.forEach(((e,a)=>{let o=n[a];o||(o=document.createElement("div"),o.classList.add(`${D1}-${i}`),t.appendChild(o));const l=Object.assign({},r);a===s.length-1&&(l.marginBottom="0px"),l.display=!1===e.visible?"none":"block",l.height="initial","key"===i?(o.innerHTML=W1(e.key),e.keyStyle&&q1(e.keyStyle,l)):"value"===i?(o.innerHTML=W1(e.value),e.valueStyle&&q1(e.valueStyle,l)):"shape"===i&&(o.innerHTML=function(t,e){var i,s,n,r,a,o;if(!t||!t.hasShape||!t.shapeType)return"";const l='style="display:inline-block;vertical-align:middle;"',{shapeType:h,shapeFill:c,shapeStroke:d,shapeHollow:u=!1}=t,p=null!==(i=t.shapeSize)&&void 0!==i?i:8,f=t.shapeLineWidth?V1(t.shapeLineWidth)+"px":"0px";let m="currentColor";const v=()=>d?V1(d):m,_=p,b=t=>new Mg({symbolType:t,size:_,fill:!0});let x=b(h);const S=x.getParsedPath();let A,k;if(!S.path&&S.pathStr&&(x=b(S.pathStr)),x.getParsedPath().path){const t=x.getParsedPath().path;k=t.toString(),A=t.bounds}else S.isSvg&&S.svgCache&&(k=S.svgCache.map((t=>t.path.toString())).join(),A=S.svgCache.reduce(((t,e)=>t.union(e.path.bounds)),new Ve));let T=`${A.x1} ${A.y1} ${A.width()} ${A.height()}`;if("0px"!==f){const[t,e,i,s]=T.split(" ").map((t=>Number(t))),n=Number(f.slice(0,-2));T=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!c||y(c)||u)return m=u?"none":c?V1(c):"currentColor",`\n <svg ${l} width="${p}" height="${p}" viewBox="${T}">\n <path\n d="${k}"\n style="fill: ${m}; stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`;if(g(c)){m="gradientColor"+(null!=e?e:"");let t="";const i=(null!==(s=c.stops)&&void 0!==s?s:[]).map((t=>`<stop offset="${V1(t.offset.toString())}" stop-color="${V1(t.color)}"/>`)).join("");return"radial"===c.gradient?t=`<radialGradient id="${m}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${i}\n </radialGradient>`:"linear"===c.gradient&&(t=`<linearGradient id="${m}" x1="${100*(null!==(n=c.x0)&&void 0!==n?n:0)}%" y1="${100*(null!==(r=c.y0)&&void 0!==r?r:0)}%" x2="${100*(null!==(a=c.x1)&&void 0!==a?a:0)}%" y2="${100*(null!==(o=c.y1)&&void 0!==o?o:0)}%">\n ${i}\n </linearGradient>`),`\n <svg ${l} width="${p}" height="${p}" viewBox="-0.5 -0.5 1 1">\n ${t}\n <path\n d="${k}"\n style="fill: url(#${m}); stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`}return""}(e,`${this.id}_${a}`)),Q1(o,l)}))}}))}else l&&!n&&l.parentNode.removeChild(l)}_updateDomStyle(t="width",e){var i,s,n,r,a;const o=this._rootDom,l=[...o.children].find((t=>t.className.includes(j1))),h=[...o.children].find((t=>t.className.includes(z1)));if(l){const o=this._component.getSpec(),c={},d=null===(i=o.style)||void 0===i?void 0:i.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&h){const e=[...l.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(l.getBoundingClientRect().width)}px`)}if(p(null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.maxContentHeight)){const t=h&&h.className.includes(z1)?h.getBoundingClientRect().height+(null!==(n=o.style.spaceRow)&&void 0!==n?n:0):0,e=this._chartOption.getChartViewRect(),i=aD(o.style.maxContentHeight,Math.min(e.height,document.body.clientHeight)-t-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));i>0&&(c.maxHeight=`${i}px`,c.overflowY="auto",c.width=`calc(100% + ${this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px"})`,Q1(l,c))}const u=l.children,g=[];if(u){for(let i=0;i<u.length;i++){const s=null!==(r=u[i].children)&&void 0!==r?r:[];for(let i=0;i<s.length;i++){e&&(s[i].style[t]="initial");const n=s[i].getBoundingClientRect()[t];(void 0===g[i]||g[i]<n)&&(g[i]=n)}}for(let e=0;e<u.length;e++){const i=null!==(a=u[e].children)&&void 0!==a?a:[];for(let e=0;e<i.length;e++)i[e].style[t]=`${g[e]}px`}}}}_getParentElement(t){var e;return null!==(e=this._container)&&void 0!==e?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle(),this._rootDom&&Q1(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)))}}e2.type=mU.dom;const i2=()=>{t2(e2)},s2={fontFamily:fD.fontFamily,spacing:10,wordBreak:"break-word"},n2=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>e<s.length-1?t+"\n":t))):s=[t],n=s.map((t=>Object.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},pf||(pf=df.CreateGraphic("richtext",{})),pf.setAttributes(a),pf.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}};function r2(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:s2),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:e,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:p(t.maxWidth)?!1!==t.multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const a2=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return p(a)&&(r.cornerRadius=[a,a,a,a]),r};class o2 extends $1{constructor(){super(o2.type),this.type=mU.canvas,this._attributes=null}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new xO({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_getTooltipBoxSize(t,e){var i,s;if(!e||u(this._attributes)){const e=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:c}=e,{panel:d={},titleLabel:u,shape:g,keyLabel:f,valueLabel:m,spaceRow:v,align:y}=l,_=oi(d.padding),b=hD(d.padding),x=r2(Object.assign({textAlign:"right"===y?"right":"left"},u),i),S=r2(Object.assign({textAlign:"right"===y?"right":"left"},f),i),A=r2(m,i),k={fill:!0,size:null!==(s=null==g?void 0:g.size)&&void 0!==s?s:8,spacing:null!==(n=null==g?void 0:g.spacing)&&void 0!==n?n:6},T={panel:a2(d),padding:_,title:{},content:[],titleStyle:{value:x,spaceRow:v},contentStyle:{shape:k,key:S,value:A,spaceRow:v},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:y},{title:M={},content:C=[]}=t;let w=b.left+b.right,E=b.top+b.bottom,B=0;const P=!!C.length;let R=0,L=0,I=0,O=0;if(P){const t=[],e=[],i=[],s=[];let n=0;T.content=C.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:c="",shapeFill:d,shapeStroke:u,shapeLineWidth:g,shapeSize:f,value:m,isKeyAdaptive:y,spaceRow:_,keyStyle:b,valueStyle:x,shapeHollow:T}=r,M={height:0,spaceRow:null!=_?_:v};if(p(h)){const i=SD({},S,r2(b,void 0,{})),{width:s,height:n,text:r}=n2(h,i);M.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),y?e.push(s):t.push(s),o=Math.max(o,n)}if(p(m)){const t=SD({},A,r2(x,void 0,{})),{width:e,height:s,text:n}=n2(m,t);M.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:c};T?t.stroke=d:t.fill=d,t.stroke=null!=u?u:d,t.lineWidth=g,M.shape=t;const e=null!=f?f:k.size;o=Math.max(e,o),s.push(e)}else M.shape={visible:!1};return M.height=o,n+=o,a<C.length-1&&(n+=M.spaceRow),M})),E+=n,R=t.length?$(t):0,L=e.length?$(e):0,I=i.length?$(i):0,O=s.length?$(s)+k.spacing:0,B=Math.max(O+R+S.spacing+I+A.spacing,O+L,B),T.hasContentShape=!!s.length,T.keyWidth=R,T.valueWidth=I}let D=0,F=0,z=0;const{visible:j=!0,value:H="",valueStyle:N,spaceRow:V}=M;T.title.visible=j,T.title.spaceRow=null!=V?V:v;let U={};const W=()=>U.autoWidth&&!1!==U.multiLine;if(j){U=SD({},x,r2(N,void 0,{})),W()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:P?Math.ceil(B):void 0);const{text:t,width:e,height:i}=n2(H,U);T.title.value=Object.assign(Object.assign({width:W()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),D=T.title.value.width,F=T.title.value.height,z=F+(P?T.title.spaceRow:0)}return E+=z,T.title.width=D,T.title.height=F,W()?w+=B||D:w+=Math.max(D,B),P&&T.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=w-b.left-b.right-O-R-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),T.valueWidth=Math.max(T.valueWidth,i.width))})),T.panel.width=w,T.panel.height=E,T})(t,this._component.getSpec(),e)}const{panel:n}=null!==(s=this._attributes)&&void 0!==s?s:{};return{width:n.width+n.lineWidth,height:n.height+n.lineWidth}}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?p(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}o2.type=mU.canvas;const l2=()=>{t2(o2)},h2=t=>{AD.registerChartPlugin(t.type,t)},c2=/\{([^}]+)\}/,d2=/\{([^}]+)\}/g,u2=/:/;class p2 extends fN{constructor(){super(p2.type),this.type="formatterPlugin",this._timeModeFormat={utc:yi.getInstance().timeUTCFormat,local:yi.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=Mi.getInstance().format,this._numericSpecifier=Mi.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[p2.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;d(r)?this._formatter=r:(this._formatter=this._format.bind(this),d(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),AD.registerFormatter(this._formatter)}_format(t,e,i){return _(t)?t.map(((t,s)=>{const n=_(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):_(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;if(this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=c2.test(i),this._isNumericFormatterCache.set(i,s))),s){const t=i.replace(d2,((t,i)=>{if(!u2.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)}));return t}return this._formatSingleText(t,i)}_formatSingleText(t,e){if(Ai.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}p2.pluginType="chart",p2.specKey="formatter",p2.type="formatterPlugin";const g2=()=>{h2(p2)},f2={state:t.STATE_VALUE_ENUM.STATE_ACTIVE,trigger:"pointerover",triggerOff:"pointerout"};class m2 extends Rj{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({},f2,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){const{state:e,interaction:i}=this.options;this.isGraphicInStateMark(t,e)&&(t.addState(e,!0),i.setStatedGraphics(this,[t]))}}reset(t){const{interaction:e,state:i}=this.options,s=e.getStatedGraphics(this),n=null!=t?t:null==s?void 0:s[0];n&&s.includes(n)&&(n.removeState(i),e.setStatedGraphics(this,s.filter((t=>t!==n))))}}m2.type="element-active",m2.defaultOptions=f2;const v2=()=>{AD.registerInteractionTrigger(m2.type,m2)},y2="element-active-by-legend",_2={state:t.STATE_VALUE_ENUM.STATE_ACTIVE,filterType:"groupKey"};class b2 extends Rj{constructor(t){super(t),this.type=y2,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},_2,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:t.ChartEvent.legendItemHover,handler:this.handleStart},{type:t.ChartEvent.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(u(t))return;const{interaction:e,state:i}=this.options,s=Bj(this.options),n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{s(e)===t&&r.push(e)}))})),e.updateStates(this,r,n,i),e.setStatedGraphics(this,r)}resetAll(){const{interaction:t,state:e}=this.options;t.clearAllStatesOfTrigger(this,e),t.setStatedGraphics(this,[])}reset(t){const{state:e,interaction:i}=this.options;if(t){const s=i.getStatedGraphics(this);s&&s.includes(t)&&(t.removeState(e),i.setStatedGraphics(this,s.filter((e=>e!==t))))}else this.resetAll()}}b2.type=y2,b2.defaultOptions=_2;const x2=()=>{AD.registerInteractionTrigger(y2,b2)},S2="element-highlight-by-group";class A2 extends Rj{constructor(t){super(t),this.type=S2,this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{const e=t.item;e&&this.isGraphicInMark(e)&&this.resetAll()},this.options=Object.assign({},Pj,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(){const{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?void 0:e.groupKey}start(t){if(t&&this.isGraphicInMark(t)){const e=this._getHightlightKey(t);if(u(e))return;const{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{this._getHightlightKey(t)===e&&a.push(t)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}reset(t){if(t){if(this.isGraphicInMark(t)){const{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()}}A2.type=S2,A2.defaultOptions=Pj;const k2=()=>{AD.registerInteractionTrigger(S2,A2)},T2="element-highlight-by-key";class M2 extends A2{constructor(){super(...arguments),this.type=T2}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.key}}M2.type=T2;const C2=()=>{AD.registerInteractionTrigger(T2,M2)},w2="element-highlight-by-legend",E2={highlightState:t.STATE_VALUE_ENUM.STATE_HIGHLIGHT,blurState:t.STATE_VALUE_ENUM.STATE_BLUR,filterType:"groupKey"};class B2 extends Rj{constructor(t){super(t),this.type=w2,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},E2,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:t.ChartEvent.legendItemHover,handler:this.handleStart},{type:t.ChartEvent.legendItemUnHover,handler:this.handleReset}]}start(t){if(t){const e=Bj(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}B2.type=w2,B2.defaultOptions=E2;const P2=()=>{AD.registerInteractionTrigger(w2,B2)},R2="element-highlight-by-name",L2={highlightState:t.STATE_VALUE_ENUM.STATE_HIGHLIGHT,blurState:t.STATE_VALUE_ENUM.STATE_BLUR,filterType:"groupKey"};class I2 extends Rj{constructor(t){super(t),this.type=R2,this.handleStart=t=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const 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({},L2,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;const i=Y(this.options.graphicName);return(null===(e=null==t?void 0:t.node)||void 0===e?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){const e=Bj(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}I2.type=R2,I2.defaultOptions=L2;const O2=()=>{AD.registerInteractionTrigger(R2,I2)};class D2 extends nj{constructor(){super(...arguments),this.type=D2.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}D2.type="image";const F2=()=>{AD.registerMark(D2.type,D2),zM(),MM(),AD.registerGraphicComponent("image",Vg)},z2=()=>{oj(),nN(),aN(),WW(),RG(),BU(),XU(),xW(),oY(),LK(),F2(),uZ(),GN()};Hj.useRegisters([CU,jU,iW,fW,KZ,QZ,iJ,pJ,VZ,_J,AJ,kJ,CJ,GJ,$J,mJ,BJ,LJ,tQ,DJ,jJ,VJ,ZJ,sQ,lJ,aQ,rJ,uV,mV,yV,bV,SV,BY,wY,uQ,kQ,OQ,VQ,WQ,QQ,i0,o0,PW,W0,J0,x1,Y0,t1,A1,T1,$0,l1,g1,v1,E1,P1,O1,I1,z2,i2,l2,g2,v2,x2,P2,O2,k2,C2,Cj,N_,j_]);class j2 extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","maskShape","reverse","outlineMargin","outlinePadding","indicatorSmartInvert","liquidBackground","liquidOutline"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class H2 extends NV{constructor(){super(...arguments),this.transformerConstructor=j2,this.type="liquid",this.seriesType=t.SeriesTypeEnum.liquid}}H2.type="liquid",H2.seriesType=t.SeriesTypeEnum.liquid,H2.transformerConstructor=j2;class N2 extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","circle","overlap","overlapLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class V2 extends NV{constructor(){super(...arguments),this.transformerConstructor=N2,this.type="venn",this.seriesType=t.SeriesTypeEnum.venn}}V2.type="venn",V2.seriesType=t.SeriesTypeEnum.venn,V2.transformerConstructor=N2;class U2 extends WV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar","bandWidthField"])}transformSpec(t){super.transformSpec(t),bz(t)}_setDefaultXAxisSpec(t){return{orient:"bottom",type:"linear",label:{visible:!1}}}_setDefaultYAxisSpec(t){return{orient:"left",type:"linear"}}}class W2 extends NV{constructor(){super(...arguments),this.transformerConstructor=U2,this.type="mosaic",this.seriesType=t.SeriesTypeEnum.mosaic,this.handleAfterStackRegion=(t,e)=>{t.getSeries().forEach((t=>{const i=t.getStackData(),s=t.getStackValue(),n=t.getStackValueField();i&&n&&(kF(e[s],n),TF(t,e[s]))}))}}_beforeInit(){this._dataSet&&qF(this._dataSet,"stackSplit",YV)}_initStack(){this._stack=new XV(this,{afterStackRegion:this.handleAfterStackRegion}),this._stack.init()}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}W2.type="mosaic",W2.seriesType=t.SeriesTypeEnum.mosaic,W2.transformerConstructor=U2;const G2=(e="chart",i,s)=>{var n,a,o,l,h,c,d,u,p,g,f;const m={modelInfo:[]};if("chart"===e)m.isChart=!0,m.modelInfo.push({spec:i,type:"chart"});else if("region"===e)m.modelType="region",m.specKey="region",null===(n=i.region)||void 0===n||n.forEach(((t,e)=>{m.modelInfo.push({spec:t,specPath:["region",e],type:"region"})}));else if("series"===e)m.modelType="series",m.specKey="series",null===(a=i.series)||void 0===a||a.forEach(((t,e)=>{m.modelInfo.push({spec:t,specPath:["series",e],type:t.type})}));else if(Object.values(t.SeriesTypeEnum).includes(e))m.modelType="series",m.specKey="series",m.type=e,null===(o=i.series)||void 0===o||o.forEach(((t,i)=>{t.type===e&&m.modelInfo.push({spec:t,specPath:["series",i],type:e})}));else if(Object.values(r).includes(e)){m.modelType="component",m.type=e,m.specKey=null===(l=AD.getComponentInKey(e))||void 0===l?void 0:l.specKey;const{specKey:t}=m,n=Y(null!==(c=null===(h=s.component)||void 0===h?void 0:h[t])&&void 0!==c?c:[]);null===(u=Y(null!==(d=i[t])&&void 0!==d?d:[]))||void 0===u||u.forEach(((t,i)=>{const s=n[i];s&&s.type===e?m.modelInfo.push(Object.assign(Object.assign({},s),{spec:t})):t&&!1===t.visible&&m.modelInfo.push({type:e,spec:t})}))}else{const t=AD.getComponents().filter((({cmp:t})=>t.specKey===e)).map((({cmp:t})=>t.type));if(t.length>0){m.modelType="component";const n=e;m.specKey=n;const r=Y(null!==(g=null===(p=s.component)||void 0===p?void 0:p[n])&&void 0!==g?g:[]);Y(null!==(f=i[n])&&void 0!==f?f:[]).forEach(((e,i)=>{const s=r[i];s&&t.includes(s.type)&&m.modelInfo.push(Object.assign(Object.assign({},s),{spec:e}))}))}}return m},Y2=(t,e,i,s)=>{const{spec:n,filter:r,filterType:a,forceAppend:o}=t,{isChart:l,modelType:h,specKey:c,type:p,modelInfo:g}=((t="chart",e,i,s,n,r)=>{const a=G2(t,n,r);return Object.assign(Object.assign({},a),{modelInfo:a.modelInfo.filter((t=>!!u(e)||Y(e).some((e=>d(e)?e(t,i,s):yD(t.spec,e)))))})})(a,r,t,e,i,s);if(0===g.length&&!o)return{chartSpec:i,hasChanged:!1};const f=SD({},i),m=d(n)?n(g,t,e):n;for(const{spec:t,specPath:e}of g){if(l)return{chartSpec:SD(f,m),hasChanged:!0};const i=SD({},t,m);_D(f,e,i)}if(0===g.length&&o){const t=Object.assign({type:p},m);_(f[c])?f[c].push(t):u(f[c])?f[c]="component"===h?t:[t]:f[c]=[f[c],t]}return{chartSpec:f,hasChanged:!0}};class X2 extends fN{constructor(){super(X2.type),this.type="MediaQueryPlugin",this._currentMediaInfo={},this.currentActiveItems=new Set,this._initialized=!1}onInit(t,e){if(!(null==e?void 0:e[X2.specKey]))return;const{globalInstance:i}=t;this._option={globalInstance:t.globalInstance,updateSpec:(t,e,s)=>{s?i.updateSpecSync(t):e?i.updateSpecAndRecompile(t,!1,{transformSpec:!0}):i.setRuntimeSpec(t)}},this._spec=e[X2.specKey],this._initialized=!0}onBeforeResize(t,e,i){this._initialized&&this._changeSize(e,i,!0,!1)}onAfterChartSpecTransform(t,e,i){this._initialized&&"setCurrentTheme"===i&&this._reInit(!1,!1)}onAfterModelSpecTransform(t,e,i,s){this._initialized&&"updateSpec"===s&&this.onBeforeInitChart(t,e,"setCurrentTheme")}onBeforeInitChart(t,e,i){if(!this._initialized)return;let s,n;switch(i){case"render":case"updateModelSpec":s=!1,n=!0;break;case"setCurrentTheme":s=!0,n=!1;break;case"updateSpecAndRecompile":s=!1,n=!1}if(s&&this.release(),this._initialized||this.onInit(t,e),s||n){const{width:t,height:e}=this._option.globalInstance.getCurrentSize();this._changeSize(t,e,!1,!1)}}_changeSize(t,e,i,s){return(this._currentMediaInfo.width!==t||this._currentMediaInfo.height!==e)&&(this._currentMediaInfo.width=t,this._currentMediaInfo.height=e,this._applyQueries(i,s))}_applyQueries(t,e){const i=[],s=[];if(this._spec.forEach((t=>{const{hasChanged:e,isActive:n}=this._check(t);e&&(n?i.push(t):s.push(t))})),!i.length&&!s.length)return!1;let n,r;this._baseChartSpec||(this._baseChartSpec=xD(this._option.globalInstance.getSpec(),["data",X2.specKey]),this._baseChartSpecInfo=this._option.globalInstance.getSpecInfo());let a=!1;return s.length>0?(n=xD(this._baseChartSpec,["data",X2.specKey]),r=this._baseChartSpecInfo,Array.from(this.currentActiveItems).forEach((t=>{if(s.includes(t))return void this.currentActiveItems.delete(t);const e=this._apply(t,n,r);n=e.chartSpec})),a=!0):(n=this._option.globalInstance.getSpec(),r=this._option.globalInstance.getSpecInfo()),i.forEach((t=>{this.currentActiveItems.add(t);const e=this._apply(t,n,r);n=e.chartSpec,a||(a=e.hasChanged)})),a&&this._option.updateSpec(n,t,e),!0}_check(t){const{globalInstance:e}=this._option,i=((t,e,i)=>{for(const s in t)switch(s){case"maxHeight":if(p(t.maxHeight)&&e.height>t.maxHeight)return!1;break;case"minHeight":if(p(t.minHeight)&&e.height<t.minHeight)return!1;break;case"maxWidth":if(p(t.maxWidth)&&e.width>t.maxWidth)return!1;break;case"minWidth":if(p(t.minWidth)&&e.width<t.minWidth)return!1;break;case"onResize":if(p(t.onResize)&&!t.onResize(e,i))return!1}return!0})(t.query,this._currentMediaInfo,e);return{isActive:i,hasChanged:i!==this.currentActiveItems.has(t)}}_apply(t,e,i){const{query:s,action:n}=t;let r=!1;return Y(n).forEach((t=>{const n=Y2(t,s,e,i);e=n.chartSpec,r||(r=n.hasChanged)})),{chartSpec:e,hasChanged:r}}_reInit(t,e){let i=this._option.globalInstance.getSpec();this._baseChartSpec=xD(i,["data",X2.specKey]),this._baseChartSpecInfo=this._option.globalInstance.getSpecInfo();let s=!1;this.currentActiveItems.forEach((t=>{const e=this._apply(t,i,this._baseChartSpecInfo);i=e.chartSpec,s||(s=e.hasChanged)})),s&&this._option.updateSpec(i,t,e)}release(){super.release(),this._initialized=!1,this._spec=[],this._option=void 0,this._currentMediaInfo={},this.currentActiveItems.clear()}}X2.pluginType="chart",X2.specKey="media",X2.type="MediaQueryPlugin";class $2{constructor(t,e,i,s,n){this.state=t,this.graphics=e,this.config=i||[],this.beforeExecute=s,this.afterExecute=n}execute(t,e){if(!this.graphics.length||!this.config.length)return void(null==e||e());this.beforeExecute&&this.beforeExecute(this.graphics);let i=0;const s=this.graphics.length,n=()=>{i++,i>=s&&(this.afterExecute&&this.afterExecute(this.graphics),null==e||e())};this.graphics.forEach((t=>{if(!t)return void i++;"exit"===this.state&&(t.isExiting=!0);const e=this.config.length>1?this.config.map((e=>({name:this.state,animation:Object.assign(Object.assign({},e),{customParameters:t.context})}))):{name:this.state,animation:Object.assign(Object.assign({},this.config[0]),{customParameters:t.context})};t.applyAnimationState([this.state],[e],n)}))}executeOnGroup(t,e){if(!this.graphics.length||!this.config.length||!t)return void(null==e||e());this.beforeExecute&&this.beforeExecute(this.graphics);const i=this.config[0],s=[{name:this.state,animation:Object.assign({},i)}];s.forEach((t=>{t.animation.customParameters=(t,e)=>e.context})),t.applyAnimationState([this.state],s,(()=>{this.afterExecute&&this.afterExecute(this.graphics),null==e||e()}))}}class K2{constructor(){this.name="verticalBarSplit"}shouldApply(t,e){var i,s;const n="rect"===t.type,r="vertical"===(null===(i=t.model)||void 0===i?void 0:i.direction),a=(null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||{};return n&&r&&("x"in a||"width"in a||"x1"in a)&&("y"in a||"height"in a||"y1"in a)}split(t,e){var i;const s=(null===(i=e.context)||void 0===i?void 0:i.diffAttrs)||{},n={},r={};Object.entries(s).forEach((([t,e])=>{"x"===t||"width"===t||"x1"===t?n[t]=e:"y"===t||"height"===t||"y1"===t?r[t]=e:n[t]=e}));const a=e.context,o=a.fieldX,l=a.originalFieldX,h=Array.isArray(o)&&o.length>1,c=(l?!(Array.isArray(l)&&l.length>1):!h)&&h;return[{attrs:n,order:c?1:2},{attrs:r,order:c?2:1}]}}class q2{constructor(){this.name="horizontalBarSplit"}shouldApply(t,e){var i,s;const n="rect"===t.type,r="horizontal"===(null===(i=t.model)||void 0===i?void 0:i.direction),a=(null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||{};return n&&r&&("y"in a||"height"in a||"y1"in a)&&("x"in a||"width"in a||"x1"in a)}split(t,e){var i;const s=(null===(i=e.context)||void 0===i?void 0:i.diffAttrs)||{},n={},r={};Object.entries(s).forEach((([t,e])=>{"y"===t||"height"===t||"y1"===t?n[t]=e:"x"===t||"width"===t||"x1"===t?r[t]=e:n[t]=e}));const a=e.context,o=a.fieldY,l=a.originalFieldY,h=Array.isArray(o)&&o.length>1,c=!(l?!(Array.isArray(l)&&l.length>1):!h)&&!h;return[{attrs:n,order:c?2:1},{attrs:r,order:c?1:2}]}}class Z2{constructor(t){this.splitStrategies=[],this.mark=t,"rect"===t.type&&(this.registerStrategy(new K2),this.registerStrategy(new q2))}registerStrategy(t){this.splitStrategies.push(t)}detect(t,e){const i=[],s=[],n=[],r=[],a=this.mark.model.fieldX,o=this.mark.model.fieldY;return t.forEach((t=>{const e=t.context;e.fieldX&&(e.originalFieldX=e.fieldX),e.fieldY&&(e.originalFieldY=e.fieldY),e.fieldX=a,e.fieldY=o;switch(t.context.animationState){case"update":s.push(t);break;case"enter":n.push(t);break;case"appear":r.push(t);break;default:t.context.diffState===Wz.exit?i.push(t):t.context.diffState===Wz.enter?n.push(t):s.push(t)}})),e.size>t.length&&e.forEach(((t,e)=>{t.context.diffState!==Wz.exit||t.isExiting||i.push(t)})),{hasExit:i.length>0,hasUpdate:s.length>0,hasEnter:n.length>0,hasAppear:r.length>0,exitGraphics:i,updateGraphics:s,enterGraphics:n,appearGraphics:r}}createPlanners(t,e){const i=[];if(t.hasExit&&e.exit&&i.push(new $2("exit",t.exitGraphics,e.exit)),t.hasUpdate&&e.update){const s=new Map,n=[];t.updateGraphics.forEach((t=>{let e=!1;for(const i of this.splitStrategies)if(i.shouldApply(this.mark,t)){const n=i.split(this.mark,t),r={graphic:t,steps:n};n.forEach((t=>{const{order:e}=t;s.has(e)||s.set(e,[]),s.get(e).push(r)})),e=!0;break}e||n.push(t)})),n.length>0&&i.push(new $2("update",n,e.update));const r=Array.from(s.keys()).sort(((t,e)=>t-e));r.forEach((t=>{const n=s.get(t);if(n&&n.length>0){const s=n.map((({graphic:e,steps:i})=>{const s=i.find((e=>e.order===t));return{graphic:e,attrs:(null==s?void 0:s.attrs)||{}}}));i.push(new $2("update",s.map((t=>t.graphic)),e.update,(t=>{t.forEach(((t,e)=>{const i=s[e].attrs,n=t.context;n._originalDiffAttrs||(n._originalDiffAttrs=t.context.diffAttrs),t.context.diffAttrs=i}))}),(e=>{t===r[r.length-1]&&e.forEach((t=>{const e=t.context;e._originalDiffAttrs&&(t.context.diffAttrs=e._originalDiffAttrs,delete e._originalDiffAttrs)}))})))}}))}return t.hasEnter&&e.enter&&i.push(new $2("enter",t.enterGraphics,e.enter)),t.hasAppear&&e.appear&&i.push(new $2("appear",t.appearGraphics,e.appear)),i}}class J2{registerAnimationSplitStrategy(t){this._grammarDetector||(this._grammarDetector=new Z2(this)),this._grammarDetector.registerStrategy(t)}getGrammarDetector(){return this.initGrammarDetector(),this._grammarDetector}initGrammarDetector(){this._grammarDetector||(this._grammarDetector=new Z2(this))}_runSequentialAnimations(t){this.initGrammarDetector();const e=this.getAnimationConfig(),i=this._grammarDetector.detect(t,this._graphicMap),s=this._grammarDetector.createPlanners(i,e);this._executePlanners(s,0)}_executePlanners(t,e){if(e>=t.length)return;const i=t[e];i.execute(this._product,(()=>{this._executePlanners(t,e+1),"exit"===i.state&&i.graphics.forEach((t=>{t.isExiting&&(this._graphicMap.delete(t.context.uniqueKey),t.parent&&t.parent.removeChild(t),t.release&&t.release())}))}))}}t.ArcMark=aY,t.AreaChart=zU,t.AreaMark=EU,t.AreaSeries=OU,t.AxisSyncPlugin=mN,t.BandAxisMixin=pV,t.BarChart=eW,t.BarChartSpecTransformer=tW,t.BarSeries=JU,t.BarSeriesSpecTransformer=ZU,t.BaseArcMark=rY,t.BaseChart=NV,t.BaseChartSpecTransformer=UV,t.BaseComponent=NN,t.BaseComponentSpecTransformer=HN,t.BaseHistogramChart=cJ,t.BaseMark=nj,t.BasePieChart=XZ,t.BasePieChartSpecTransformer=YZ,t.BasePieSeries=dY,t.BasePlugin=fN,t.BasePolygonMark=PK,t.BaseSeries=BH,t.BaseSeriesSpecTransformer=EH,t.BaseSeriesTooltipHelper=eH,t.BaseWordCloudChart=xJ,t.BaseWordCloudChartSpecTransformer=bJ,t.BaseWordCloudSeries=kX,t.BoxPlotChart=XJ,t.BoxPlotSeries=EG,t.Brush=w1,t.CanvasTooltipHandler=o2,t.CartesianAxis=ZN,t.CartesianBandAxis=fV,t.CartesianChartSpecTransformer=WV,t.CartesianCrossHair=NQ,t.CartesianLinearAxis=dV,t.CartesianLogAxis=_V,t.CartesianMarkArea=Z0,t.CartesianMarkLine=U0,t.CartesianMarkPoint=b1,t.CartesianSeries=IH,t.CartesianSymlogAxis=xV,t.CartesianTimeAxis=vV,t.CirclePackingChart=zJ,t.CirclePackingSeries=aq,t.CircularProgressChart=fJ,t.CircularProgressSeries=aX,t.CommonChart=nJ,t.CommonChartSpecTransformer=sJ,t.CompilableData=Qz,t.ComponentMark=WN,t.ContinuousLegend=AQ,t.CorrelationChart=rQ,t.CorrelationSeries=fZ,t.CustomMark=B1,t.DEFAULT_ANIMATION_CONFIG=mj,t.DEFAULT_CHART_HEIGHT=$D,t.DEFAULT_CHART_WIDTH=XD,t.DEFAULT_CLOSE_STROKE_JOIN=Uj,t.DEFAULT_DATA_INDEX=qD,t.DEFAULT_DATA_KEY=ZD,t.DEFAULT_DATA_SERIES_FIELD=JD,t.DEFAULT_KEY=vF,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=Vj,t.DEFAULT_MEASURE_CANVAS_ID=KD,t.DEFAULT_SERIES_STYLE_NAME=QD,t.DEFAULT_SMOOTH_INTERPOLATE=Nj,t.DataZoom=JQ,t.DimensionClickEvent=UH,t.DimensionHoverEvent=KH,t.DiscreteLegend=dQ,t.DomTooltipHandler=e2,t.DotSeries=YY,t.ElementHighlight=Ij,t.ElementSelect=Fj,t.Event=HF,t.Factory=AD,t.FormatterPlugin=p2,t.FunnelChart=MJ,t.FunnelChartSpecTransformer=TJ,t.FunnelSeries=DK,t.FunnelSeriesSpecTransformer=OK,t.GaugeChart=yJ,t.GaugePointerSeries=Gq,t.GaugeSeries=$q,t.GeoCoordinate=BW,t.GeoMarkPoint=k1,t.GeoSeries=mW,t.GlyphMark=gG,t.GridLayout=R1,t.GroupMark=aj,t.HeatmapChart=iQ,t.HeatmapSeries=eZ,t.HistogramChart=uJ,t.HistogramChartSpecTransformer=dJ,t.ImageMark=D2,t.Indicator=a0,t.Label=p1,t.Layout=Uz,t.LineChart=MU,t.LineMark=sN,t.LineSeries=DV,t.LinearAxisMixin=aV,t.LinearProgressChart=EJ,t.LinearProgressSeries=gX,t.LinkSeries=ZY,t.LiquidChart=H2,t.LiquidSeries=MZ,t.MOSAIC_CAT_END_PERCENT=gF,t.MOSAIC_CAT_START_PERCENT=pF,t.MOSAIC_VALUE_END_PERCENT=uF,t.MOSAIC_VALUE_START_PERCENT=dF,t.ManualTicker=class extends qw{constructor(t){super(t),this.lastFrameTime=0,this.status=Bo.RUNNING}setupTickHandler(){const t=new Zw;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}checkSkip(t){return!1}getTime(){return this.tickerHandler.getTime()}tickAt(t){this.tickTo(t)}start(t=!1){if(this.status===Bo.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Bo.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Bo.RUNNING,!0}},t.MapChart=NZ,t.MapSeries=LW,t.MediaQuery=X2,t.MosaicChart=W2,t.MosaicSeries=zZ,t.PREFIX=YD,t.PathMark=bW,t.PieChart=$Z,t.PieSeries=uY,t.PieSeriesSpecTransformer=hY,t.Player=o1,t.PolarAxis=kY,t.PolarBandAxis=EY,t.PolarCrossHair=UQ,t.PolarLinearAxis=CY,t.PolarMarkArea=Q0,t.PolarMarkLine=G0,t.PolarMarkPoint=S1,t.PolarSeries=$G,t.PolygonMark=RK,t.ProgressLikeSeries=tX,t.RadarChart=eJ,t.RadarSeries=HY,t.RangeAreaChart=QJ,t.RangeAreaSeries=YG,t.RangeColumnChart=RJ,t.RangeColumnSeries=HG,t.RangeColumnSeriesSpecTransformer=jG,t.RectMark=YU,t.RippleMark=dZ,t.RoseChart=JZ,t.RoseLikeSeries=xY,t.RoseSeries=PY,t.RuleMark=UW,t.SEGMENT_FIELD_END=mF,t.SEGMENT_FIELD_START=fF,t.STACK_FIELD_END=iF,t.STACK_FIELD_END_OffsetSilhouette=aF,t.STACK_FIELD_END_PERCENT=nF,t.STACK_FIELD_KEY=tF,t.STACK_FIELD_START=eF,t.STACK_FIELD_START_OffsetSilhouette=rF,t.STACK_FIELD_START_PERCENT=sF,t.STACK_FIELD_TOTAL=oF,t.STACK_FIELD_TOTAL_BOTTOM=cF,t.STACK_FIELD_TOTAL_PERCENT=lF,t.STACK_FIELD_TOTAL_TOP=hF,t.SankeyChart=qJ,t.SankeySeries=Tq,t.ScatterChart=gW,t.ScatterSeries=dW,t.ScrollBar=e0,t.SequenceChart=oJ,t.StreamLight=XB,t.SunburstChart=OJ,t.SunburstSeries=tq,t.SymbolMark=rN,t.TextMark=PG,t.ThemeManager=jD,t.Title=X0,t.Tooltip=IQ,t.TotalLabel=f1,t.TreemapChart=NJ,t.TreemapSeries=Oq,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=Hj,t.VennChart=V2,t.VennSeries=DZ,t.WaterfallChart=WJ,t.WaterfallSeries=lG,t.WordCloudChart=SJ,t.WordCloudSeries=mK,t.alternatingWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=e/s,c=i/n,d=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)*Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.animationConfig=xH,t.barGrowIn=NU,t.barGrowOut=VU,t.barPresetAnimation=GU,t.baseSeriesMark=pH,t.boundsInRect=lD,t.builtinThemes=wD,t.calcLayoutNumber=aD,t.calcPadding=oD,t.centerToCorner=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=1-Math.min(d,1),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.columnCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=n/2,c=Math.abs(i-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.columnEdgeToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=n/2,c=1-Math.abs(i-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.columnLeftToRight=function(t,e,i,s,n,r,a,o=0,l=1){const h=i/n,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.columnRightToLeft=function(t,e,i,s,n,r,a,o=0,l=1){const h=(n-1-i)/n,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.computeActualDataScheme=UO,t.convertPoint=cD,t.cornerToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=Math.min(d,1),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.createArc=rf,t.createArea=ef,t.createGroup=Pp,t.createLine=Bg,t.createRect=Ig,t.createRichText=Kg,t.createScale=JO,t.createScaleWithSpec=QO,t.createSymbol=Cg,t.createText=kg,t.darkTheme=vD,t.dataScheme=uD,t.default=Hj,t.defaultThemeName=ED,t.diagonalCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/s,2)+Math.pow((i-c)/n,2)),u=o+l*(Math.sin(2*r*Math.PI-2*d*Math.PI)+1)/2;return Math.min(1,Math.max(0,u))},t.diagonalTopLeftToBottomRight=function(t,e,i,s,n,r,a,o=0,l=1){const h=(e/s+i/n)/2,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.findMarkGraphic=zF,t.functionTransform=WD,t.getActualColor=GO,t.getActualNumValue=dD,t.getCartesianCrosshairRect=uU,t.getCartesianDimensionInfo=nU,t.getColorSchemeBySeries=KO,t.getCombinedSizeOfRegions=KN,t.getDataScheme=VO,t.getDatumOfGraphic=FF,t.getDiffAttributesOfGraphic=jF,t.getDimensionInfoByValue=aU,t.getFieldAlias=bF,t.getFunnelTheme=MD,t.getGroupAnimationParams=LH,t.getMergedTheme=FD,t.getPolarDimensionInfo=ZZ,t.getRegionStackGroup=xF,t.getSpecInfo=Yj,t.getTheme=ID,t.hasThemeMerged=RD,t.isCollectionMark=DF,t.isColorKey=YO,t.isPercent=nD,t.isPercentOffset=rD,t.isPolarAxisSeries=PH,t.isProgressiveDataColorScheme=XO,t.isSpecValueWithScale=iD,t.isTokenKey=gD,t.isValidOrient=sD,t.isValueInScaleDomain=eD,t.isXAxis=OH,t.isYAxis=DH,t.isZAxis=FH,t.lightTheme=mD,t.lookup=Xj,t.measureText=GD,t.mergeFields=yF,t.normalizeLayoutPaddingSpec=hD,t.particleEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=e*n+i,c=2*UM(h,0)*Math.PI,d=.5*UM(h,1)+.5,u=2*UM(h,2)*Math.PI,p=s/2,g=n/2,f=Math.sqrt(Math.pow((e-p)/p,2)+Math.pow((i-g)/g,2)),m=Math.min(f,1),v=(r-.4)/.6,y=Math.sin(v*d*8*Math.PI+c+u*v),_=Math.cos(m*Math.PI+v*Math.PI),b=o+l*((y+1)/2*Math.max(0,1-1.2*v)*(.3+.7*_));return Math.min(1,Math.max(0,b))},t.pieDisappear=sY,t.pieEnter=eY,t.pieExit=iY,t.piePresetAnimation=nY,t.pulseWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=Math.min(d,1),p=2*r*Math.PI*3,g=Math.max(0,1-u),f=o+l*((Math.sin(p-4*u*Math.PI)+1)/2)*(.7*g+.3);return Math.min(1,Math.max(0,f))},t.queryColorFromColorScheme=WO,t.queryToken=pD,t.randomOpacity=function(t,e,i,s,n,r,a,o=0,l=1){const h=2*UM(e*n+i)*Math.PI,c=o+l*(Math.sin(2*r*Math.PI+h)+1)/2;return Math.min(1,Math.max(0,c))},t.registerAllEnv=()=>{pk()},t.registerAllMarks=z2,t.registerAnimate=Cj,t.registerArcAnimation=kj,t.registerArcMark=oY,t.registerAreaChart=jU,t.registerAreaMark=BU,t.registerAreaSeries=DU,t.registerBarChart=iW,t.registerBarSeries=QU,t.registerBoxplotChart=$J,t.registerBoxplotSeries=BG,t.registerBrowserEnv=cj,t.registerBrush=E1,t.registerCanvasTooltipHandler=l2,t.registerCartesianBandAxis=mV,t.registerCartesianCrossHair=VQ,t.registerCartesianLinearAxis=uV,t.registerCartesianLogAxis=bV,t.registerCartesianSymlogAxis=SV,t.registerCartesianTimeAxis=yV,t.registerChartPlugin=h2,t.registerCirclePackingChart=jJ,t.registerCirclePackingSeries=oq,t.registerCircularProgressChart=mJ,t.registerCircularProgressSeries=oX,t.registerCommonChart=rJ,t.registerComponentMark=GN,t.registerContinuousLegend=kQ,t.registerCorrelationChart=aQ,t.registerCustomAnimate=()=>{Qw.registerBuiltInAnimate("increaseCount",fE),Qw.registerBuiltInAnimate("fromTo",YB),Qw.registerBuiltInAnimate("scaleIn",SB),Qw.registerBuiltInAnimate("scaleOut",AB),Qw.registerBuiltInAnimate("growHeightIn",KE),Qw.registerBuiltInAnimate("growHeightOut",qE),Qw.registerBuiltInAnimate("growWidthIn",uB),Qw.registerBuiltInAnimate("growWidthOut",pB),Qw.registerBuiltInAnimate("growCenterIn",YE),Qw.registerBuiltInAnimate("growCenterOut",XE),Qw.registerBuiltInAnimate("clipIn",zE),Qw.registerBuiltInAnimate("clipOut",jE),Qw.registerBuiltInAnimate("fadeIn",HE),Qw.registerBuiltInAnimate("fadeOut",NE),Qw.registerBuiltInAnimate("growPointsIn",QE),Qw.registerBuiltInAnimate("growPointsOut",tB),Qw.registerBuiltInAnimate("growPointsXIn",iB),Qw.registerBuiltInAnimate("growPointsXOut",sB),Qw.registerBuiltInAnimate("growPointsYIn",rB),Qw.registerBuiltInAnimate("growPointsYOut",aB),Qw.registerBuiltInAnimate("growAngleIn",WE),Qw.registerBuiltInAnimate("growAngleOut",GE),Qw.registerBuiltInAnimate("growRadiusIn",hB),Qw.registerBuiltInAnimate("growRadiusOut",cB),Qw.registerBuiltInAnimate("moveIn",HB),Qw.registerBuiltInAnimate("moveOut",NB),Qw.registerBuiltInAnimate("rotateIn",UB),Qw.registerBuiltInAnimate("rotateOut",WB),Qw.registerBuiltInAnimate("update",zB),Qw.registerBuiltInAnimate("state",kB),Qw.registerBuiltInAnimate("labelItemAppear",gB),Qw.registerBuiltInAnimate("labelItemDisappear",fB),Qw.registerBuiltInAnimate("poptipAppear",mB),Qw.registerBuiltInAnimate("poptipDisappear",vB),Qw.registerBuiltInAnimate("inputText",PE),Qw.registerBuiltInAnimate("inputRichText",yB),Qw.registerBuiltInAnimate("outputRichText",_B),Qw.registerBuiltInAnimate("slideRichText",bB),Qw.registerBuiltInAnimate("slideOutRichText",xB),Qw.registerBuiltInAnimate("slideIn",TB),Qw.registerBuiltInAnimate("growIn",MB),Qw.registerBuiltInAnimate("spinIn",CB),Qw.registerBuiltInAnimate("moveScaleIn",BB),Qw.registerBuiltInAnimate("moveRotateIn",PB),Qw.registerBuiltInAnimate("strokeIn",wB),Qw.registerBuiltInAnimate("slideOut",RB),Qw.registerBuiltInAnimate("growOut",LB),Qw.registerBuiltInAnimate("spinOut",IB),Qw.registerBuiltInAnimate("moveScaleOut",OB),Qw.registerBuiltInAnimate("moveRotateOut",DB),Qw.registerBuiltInAnimate("strokeOut",EB),Qw.registerBuiltInAnimate("pulse",FB),Qw.registerBuiltInAnimate("MotionPath",GB),Qw.registerBuiltInAnimate("streamLight",XB),Qw.registerBuiltInAnimate("dissolve",QB),Qw.registerBuiltInAnimate("grayscale",tP),Qw.registerBuiltInAnimate("distortion",eP),Qw.registerBuiltInAnimate("particle",iP),Qw.registerBuiltInAnimate("glitch",sP),Qw.registerBuiltInAnimate("gaussianBlur",nP),Qw.registerBuiltInAnimate("pixelation",rP)},t.registerCustomMark=P1,t.registerDataSetInstanceParser=ZF,t.registerDataSetInstanceTransform=qF,t.registerDataZoom=QQ,t.registerDimensionEvents=JV,t.registerDimensionHover=ZV,t.registerDimensionTooltipProcessor=xU,t.registerDiscreteLegend=uQ,t.registerDomTooltipHandler=i2,t.registerDotSeries=XY,t.registerDragPlugin=()=>{AD.registerStageEventPlugin("drag",Pb)},t.registerElementActive=v2,t.registerElementActiveByLegend=x2,t.registerElementHighlight=Oj,t.registerElementHighlightByGroup=k2,t.registerElementHighlightByKey=C2,t.registerElementHighlightByLegend=P2,t.registerElementHighlightByName=O2,t.registerElementSelect=zj,t.registerFormatPlugin=g2,t.registerFunnelChart=CJ,t.registerFunnelSeries=FK,t.registerGaugeChart=_J,t.registerGaugePointerSeries=Yq,t.registerGaugeSeries=Kq,t.registerGeoCoordinate=PW,t.registerGeoMarkPoint=T1,t.registerGesturePlugin=wj,t.registerGlyphMark=fG,t.registerGridLayout=I1,t.registerGroupMark=oj,t.registerGroupTooltipProcessor=TU,t.registerHarmonyEnv=()=>{Xk(Lh)},t.registerHeatmapChart=sQ,t.registerHeatmapSeries=iZ,t.registerHistogramChart=pJ,t.registerHtmlAttributePlugin=j_,t.registerImageMark=F2,t.registerIndicator=o0,t.registerLabel=g1,t.registerLarkEnv=()=>{QS(Lh)},t.registerLineChart=CU,t.registerLineMark=nN,t.registerLineSeries=FV,t.registerLinearProgressChart=BJ,t.registerLinearProgressSeries=fX,t.registerLinkSeries=JY,t.registerLiquidChart=()=>{AU(),CZ(),AD.registerChart(H2.type,H2)},t.registerLiquidSeries=CZ,t.registerLynxEnv=()=>{mA(Lh)},t.registerMapChart=VZ,t.registerMapSeries=IW,t.registerMarkArea=J0,t.registerMarkFilterTransform=Rq,t.registerMarkLine=W0,t.registerMarkMapTransform=Lq,t.registerMarkPoint=x1,t.registerMarkTooltipProcessor=AU,t.registerMediaQuery=()=>{h2(X2)},t.registerMosaicChart=()=>{xU(),AU(),TU(),JV(),ZV(),jZ(),AD.registerChart(W2.type,W2)},t.registerMosaicSeries=jZ,t.registerNodeEnv=dj,t.registerPathMark=xW,t.registerPieChart=KZ,t.registerPieSeries=pY,t.registerPlayer=l1,t.registerPolarBandAxis=BY,t.registerPolarCrossHair=WQ,t.registerPolarLinearAxis=wY,t.registerPolarMarkArea=t1,t.registerPolarMarkLine=Y0,t.registerPolarMarkPoint=A1,t.registerPolygonAnimation=Mj,t.registerPolygonMark=LK,t.registerPoptip=O1,t.registerRadarChart=iJ,t.registerRadarSeries=NY,t.registerRangeAreaChart=tQ,t.registerRangeAreaSeries=XG,t.registerRangeColumnChart=LJ,t.registerRangeColumnSeries=NG,t.registerReactAttributePlugin=N_,t.registerRectAnimation=Aj,t.registerRectMark=XU,t.registerRippleMark=uZ,t.registerRoseChart=QZ,t.registerRoseSeries=RY,t.registerRuleMark=WW,t.registerSankeyChart=ZJ,t.registerSankeySeries=Mq,t.registerScaleInOutAnimation=_j,t.registerScatterChart=fW,t.registerScatterSeries=uW,t.registerScrollBar=i0,t.registerSequenceChart=lJ,t.registerSequentialAnimate=function(){G(nj,J2)},t.registerStateTransition=function(){const t=Jw.getInstance();t.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),t.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),t.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))},t.registerSunBurstSeries=eq,t.registerSunburstChart=DJ,t.registerSymbolMark=aN,t.registerTTEnv=()=>{Bk(Lh)},t.registerTaroEnv=()=>{$A(Lh)},t.registerTextMark=RG,t.registerTheme=LD,t.registerTitle=$0,t.registerTooltip=OQ,t.registerTotalLabel=v1,t.registerTreemapChart=VJ,t.registerTreemapSeries=Dq,t.registerVRenderAnimate=hE,t.registerVennChart=()=>{AU(),FZ(),AD.registerChart(V2.type,V2)},t.registerVennSeries=FZ,t.registerWXEnv=()=>{dk(Lh)},t.registerWaterfallChart=GJ,t.registerWaterfallSeries=hG,t.registerWordCloudChart=AJ,t.registerWordCloudSeries=vK,t.registerWordCloudShapeChart=kJ,t.removeTheme=OD,t.rippleEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow(e-h,2)+Math.pow(i-c,2))/Math.sqrt(Math.pow(s/2,2)+Math.pow(n/2,2)),u=o+l*(Math.sin(2*r*Math.PI*3-2*d*Math.PI)+1)/2;return Math.min(1,Math.max(0,u))},t.rotationScan=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.atan2(e-h,i-c),u=(d<0?d+2*Math.PI:d)/(2*Math.PI),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.rowBottomToTop=function(t,e,i,s,n,r,a,o=0,l=1){const h=(s-1-e)/s,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.rowCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=Math.abs(e-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.rowEdgeToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=1-Math.abs(e-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.rowTopToBottom=function(t,e,i,s,n,r,a,o=0,l=1){const h=e/s,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.setDefaultCrosshairForCartesianChart=bz,t.shouldMarkDoMorph=TH,t.snakeWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=(e+i)%(s+n)/(s+n),c=o+l*(Math.sin(2*r*Math.PI-4*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.sortDataInAxisHelper=RH,t.sortStackValueGroup=SF,t.specTransform=UD,t.spiralEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow(e-h,2)+Math.pow(i-c,2)),u=Math.atan2(e-h,i-c),p=(d/Math.sqrt(Math.pow(s/2,2)+Math.pow(n/2,2))+u/(2*Math.PI))/2,g=o+l*(Math.sin(2*r*Math.PI-4*p*Math.PI)+1)/2;return Math.min(1,Math.max(0,g))},t.stack=CF,t.stackGroup=wF,t.stackMosaic=TF,t.stackMosaicTotal=kF,t.stackOffsetSilhouette=MF,t.stackTotal=AF,t.themeExist=DD,t.themes=BD,t.token=fD,t.transformColorSchemeToStandardStruct=$O,t.transformToGraphic=OF,t.userAnimationConfig=SH,t.valueInScaleRange=tD,t.version="2.0.5-alpha.4",t.vglobal=Ay,t.warn=G_,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
23
|
+
let U$=class t extends w${constructor(e){super(j({},t.defaultOptions,e)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,c=this.getTextFontFamily(t),d=this.options.createCanvas({width:1,height:1}),u=d.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+c;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let f=p+2*g,m=3*g;const v=Math.ceil(f/this.gridSize),y=Math.ceil(m/this.gridSize);f=v*this.gridSize,m=y*this.gridSize;const _=-p/2,b=.4*-g,x=Math.ceil((f*Math.abs(Math.sin(h))+m*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),u.scale(1,1),u.translate(A/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+c,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,_,b);const T=u.getImageData(0,0,A,k).data;if(this.exceedTime())return null;const M=[];let C,w=S;const E=[x/2,S/2,x/2,S/2],B=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(T[4*((e*this.gridSize+s)*A+(t*this.gridSize+n))+3])return i.push([t,e]),t<E[3]&&(E[3]=t),t>E[1]&&(E[1]=t),e<E[0]&&(E[0]=e),void(e>E[2]&&(E[2]=e))}};for(;w--;)for(C=x;C--;)B(w,C,M);return{datum:t,occupied:M,bounds:E,gw:S,gh:x,fillTextOffsetX:_,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:c,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let 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,n){let r=n.length;for(;r--;){const i=t+n[r][0],s=e+n[r][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){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),Z(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(g(e)){const i=F$(e,t.width,t.height,void 0,!1,this.options.createCanvas);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n=D$(e.backgroundColor,void 0,this.options.createCanvas);const r=(t,e)=>{let i=this.gridSize;for(;i--;){let r=this.gridSize;for(;r--;)if(!n(s,e*this.gridSize+i,t*this.gridSize+r))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let a=this.ngx;for(;a--;){this.grid[a]=[];let t=this.ngy;for(;t--;)r(a,t),!1!==this.grid[a][t]&&(this.grid[a][t]=!0)}s=n=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=k$(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()}};U$.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class W$ extends w${constructor(t){super(j({},W$.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let e=0,i=this.result.length;e<i;e++)if(G$(t,this.result[e]))return!1;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=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){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s<this.maxRadius;)s+=.5,l=this.shape(s/this.maxRadius*2*Math.PI),i+=.5*(this.options.random?this.random()>.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i<t.length&&(this.layoutWord(i),i++,this.progressiveIndex=i,!this.exceedTime()););return this.result}}function G$(t,e){return!(t.left+t.width<e.left||t.top+t.height<e.top||t.left>e.left+e.width||t.top>e.top+e.height)}W$.defaultOptions={enlarge:!1};const Y$={x:"x",y:"y",z:"z",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle"},X$=(t,e)=>{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return at.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,h=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();h[0]=Math.floor(h[0]),h[1]=Math.floor(h[1]);const c=t.fontFamily?$$(t.fontFamily):"sans-serif",d=t.fontStyle?$$(t.fontStyle):"normal",u=t.fontWeight?$$(t.fontWeight):"normal",p=t.rotate?$$(t.rotate):0,g=$$(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",m=t.padding?$$(t.padding):1,v=null!==(n=t.shape)&&void 0!==n?n:"square",y=null!==(r=t.shrink)&&void 0!==r&&r,_=null!==(a=t.enlarge)&&void 0!==a&&a,b=null!==(o=t.clip)&&void 0!==o&&o,x=t.minFontSize,A=t.randomVisible,k=t.as?Object.assign(Object.assign({},Y$),t.as):Y$,T=t.depth_3d,M=t.postProjection;let C=t.fontSize?$$(t.fontSize):14;const w=t.fontSizeRange;if(w&&!S(C)){const t=C,e=q$(Z$(t,l),w);C=i=>e(t(i))}let E=B$;"fast"===t.layoutType?E=W$:"grid"===t.layoutType&&(E=U$);const B=new E(Object.assign(Object.assign({},t),{text:g,padding:m,spiral:f,shape:v,rotate:p,fontFamily:c,fontStyle:d,fontWeight:u,fontSize:C,shrink:y,clip:b,enlarge:_,minFontSize:x,random:A,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r<a;r++)n=e[r],s=n.datum,s[k.x]=n.x,s[k.y]=n.y,s[k.fontFamily]=n.fontFamily,s[k.fontSize]=n.fontSize,s[k.fontStyle]=n.fontStyle,s[k.fontWeight]=n.fontWeight,s[k.angle]=n.angle,"StereographicProjection"===M&&J$(h,n,s,k,T),t.dataIndexKey&&(s[t.dataIndexKey]=`${r}`),i.push(s);return i}}));return B.layout(l,{width:h[0],height:h[1]}),t.progressiveStep>0||t.progressiveTime>0?{progressive:B}:B.output()},$$=t=>y(t)||S(t)||d(t)||_(t)?t:e=>e[t.field],K$=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),q$=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=K$(t[0]),n=K$(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(K$(t)-r)/(a-r)*(e[1]-e[0])+e[0]},Z$=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=it(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function J$(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l<Math.PI/2?1:-1)*Math.pow(Math.min(l-Math.PI/2,1),2)/5,{x:i*Math.sin(l)*Math.cos(o)+s.x,y:i*Math.cos(l)+s.y,z:i*Math.sin(l)*Math.sin(o)+s.z}}(t[0],t[1],r,{x:r,y:r,z:null!=n?n:r},e);i[s.x]=a.x,i[s.y]=a.y,i[s.z]=a.z}var Q$;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(Q$||(Q$={}));const tK=t=>/^[\u4e00-\u9fa5]+$/.test(t),eK=(t,e)=>{if(u(t))return 0;let i=0;for(const e of t)tK(e)?i+=1:i+=.53;return i};function iK(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:c,shapeMaxR:d,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=oK(i);let f=g.slice(0);const m=e.fontSizeShrinkFactor;let v=null,y=1,_=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;e<o.length;e++){const i=o[e],{words:n,center:c,maxR:d,ratio:u}=i;let b=!1;for(let e=0;e<n.length;e++){aK(l,p,t,e);const i=n[e];if(i.x=c[0],i.y=c[1],!i.skip&&i.hasText&&i.sprite&&sK(f,i,d,u,a,h,s))i.hasPlaced=!0;else{if(!i.skip&&i.weight>x&&_>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==v&&(v=e,y=_),_*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),f=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===v){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/_})),i.skip=!0,_=y,v=null,f=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(l,p,i,t),e.x=c[0],e.y=c[1],e.hasText&&sK(f,e,d,u,a,h,s)&&(e.hasPlaced=!0)}}e.board=f}function sK(t,e,i,s,n,r,a){const o=e.x,l=e.y,h=function(t){return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}(s),c=1*a;let d,u,p,g=-c;for(;d=h(g+=c);){const{wordSize:s,bounds:{dTop:a,dBottom:h,dLeft:c,dRight:g}}=e;if(u=d[0],p=d[1],Math.min(Math.abs(u),Math.abs(p))>=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-c<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||rK(e,t,r)))return nK(e,t,r),!0}return!1}function nK(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,c=s[1];let d,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<r;i++)e[u+i]|=n[t*r+i];u+=a}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=r;i++)e[u+i]|=d<<h|(i<r?(d=n[t*r+i])>>>l:0);u+=a}}function rK(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,c=n[1];let d,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t<c;t++){for(let i=0;i<a;i++)if(e[u+i]&s[t*a+i])return!0;u+=r}else for(let t=0;t<c;t++){d=0;for(let i=0;i<=a;i++)if((d<<h|(i<a?(d=s[t*a+i])>>>l:0))&e[u+i])return!0;u+=r}return!1}function aK(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,c=0,d=0,u=0;const p=s;for(--s;++s<a;){const t=i[s],a=Math.max(t.fontSize,2);if(e.save(),e.font=t.fontStyle+" "+t.fontWeight+" "+a+"px "+t.fontFamily,o=e.measureText(t.text+"m").width+2*t.padding,l=2*a+2*t.padding,0!==t.rotate){const e=Math.sin(t.rotate*r),i=Math.cos(t.rotate*r),s=o*i,n=o*e,a=l*i,h=l*e;o=Math.max(Math.abs(s+h),Math.abs(s-h)),l=~~Math.max(Math.abs(n+a),Math.abs(n-a))}if(o=o+31>>5<<5,l=Math.ceil(l),l>d&&(d=l),h+o>=n&&(h=0,c+=d,d=l),c+l>=2048){if(0===c){t.hasText=!1;continue}break}c+l>=u&&(u=c+l),e.translate(h+(o>>1),c+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,c],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let f,m;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,c]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,d,u,p]=[1/0,-1/0,1/0,-1/0];for(m=0;m<r[1];m++){let t;for(f=0;f<r[0];f++)if(g[4*((c+m)*n+(h+f))+3]>0){const e=1<<31-f%32;o[a*m+(f>>5)]|=e,f<u&&(u=f),f>p&&(p=f),t|=e}t&&(m<l&&(l=m),m>d&&(d=m))}t.bounds={dTop:(r[1]>>1)-l,dBottom:d-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function oK(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t<s[1];t++)for(let i=0;i<s[0];i++)if(0===e[t*s[0]+i]){const e=1<<31-i%32;r[n*t+(i>>5)]|=e}if(i[0]>s[0]){const t=(1<<i[0]-s[0])-1;for(let e=0;e<s[1];e++)r[n*e+n-1]|=t}return r}function lK(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),a<t.length&&(i[r].wordsNum+=t.length-a);let o=r;const l=i.map((t=>t.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?iK(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:c,shapeRatio:d}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=oK(i);let g=p.slice(0);const f=e.fontSizeEnlargeFactor,m=Math.min(r,t.length);let v=0;t.length>m&&(v=t.sort(((t,e)=>e.weight-t.weight))[m-1].weight);let y=0,_=1,b=!1;for(let r=0;r<a.length;r++){const h=a[r],{words:c,center:d,maxR:x,ratio:S}=h;let A=!1;for(let r=0;r<c.length;r++){aK(o,u,t,r);const a=c[r];if(a.x=d[0],a.y=d[1],a.hasText&&a.sprite&&sK(g,a,x,S,s,l,n)){if(a.hasPlaced=!0,a.weight>=v&&y++,y>=m&&!b){_*=f,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*f})),g=p.slice(0),A=!0,y=0;break}}else{if(a.weight>=v&&_>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/f})),_/=f,b=!0,g=p.slice(0),A=!0;break}if(a.weight>=v)return iK(t,e,i)}}A&&(r=-1)}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(o,u,i,t),e.x=h[0],e.y=h[1],e.hasText&&sK(g,e,c,d,s,l,n)&&(e.hasPlaced=!0)}}e.board=g}(t,e,i):function(t,e,i){const{size:s,stepFactor:n}=e,{segmentation:{regions:r},tempCanvas:a,boardSize:o,shapeCenter:l,shapeMaxR:h,shapeRatio:c}=i,d=oK(i),u=a.getContext("2d",{willReadFrequently:!0});for(const e of r){const{words:i,center:r,maxR:l,ratio:h}=e;for(let e=0;e<i.length;e++){aK(a,u,t,e);const c=i[e];c.x=r[0],c.y=r[1],c.hasText&&c.sprite&&sK(d,c,l,h,s,o,n)&&(c.hasPlaced=!0)}}for(let i=0;i<e.textLayoutTimes;i++){const 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++){const e=i[t];aK(a,u,i,t),e.x=l[0],e.y=l[1],e.hasText&&sK(d,e,h,c,s,o,n)&&(e.hasPlaced=!0)}}e.board=d}(t,e,i);const s=function(t,e,i){const{size:s,fillingTimes:n,fillingXStep:r,fillingYStep:a,getFillingFontStyle:o,getFillingFontWeight:l,getFillingFontFamily:h,fillingInitialFontSize:c,fillingDeltaFontSize:d,fillingInitialOpacity:u,fillingDeltaOpacity:p,fillingRotateList:g,getFillingPadding:f,random:m,board:v,minFillFontSize:y}=e,{boardSize:_,shapeBounds:b,tempCanvas:x,randomGenerator:S}=i,A=x.getContext("2d",{willReadFrequently:!0});let k=c,T=u;const M=[];for(let t=0;t<n;t++)C(k,T),k=Math.max(k>d?k-d:d,y),T=T>p?T-p:p;return M;function C(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:c}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(c),fontStyle:o(c),fontWeight:l(c),fontSize:e,rotate:g[~~(S()*g.length)],padding:f(c),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:c}}));w(n);let c=0;const{x1:d,y1:u,x2:p,y2:y}=b,[k,T]=[d+~~(S()*r*2),u+~~(S()*a*2)];for(let t=T;t<=y;t+=a)for(let e=k;e<=p;e+=r){aK(x,A,n,c);const i=n[c];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++c===n.length&&(c=0,m&&w(n));continue}const{dTop:l,dBottom:h,dLeft:d,dRight:u}=a;i.x-d<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!rK(i,v,_)&&(nK(i,v,_),M.push(Object.assign({},i)),++c===n.length&&(c=0,m&&w(n)))}}function w(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;e<t.length;e++)t[e].hasPlaced?r.push(t[e]):n.push(t[e]);return n.forEach((t=>t.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}const hK={x:"x",y:"y",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",angle:"angle",opacity:"opacity",visible:"visible",isFillingWord:"isFillingWord",color:"color"};class cK{constructor(t){this.progressiveResult=[],this.options=t}layout(t){this.data=t;const e=this.options,i={shapeUrl:e.shape,size:e.size,ratio:e.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0},s=this.options.createCanvas({width:e.size[0],height:e.size[1]}),n=s.getContext("2d",{willReadFrequently:!0});n.textAlign="center",n.textBaseline="middle",i.tempCanvas=s;const r=e.size[0]+31>>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,y(i.shapeUrl)){i.isEmptyPixel=D$(void 0,void 0,this.options.createCanvas);const t=function(t,e){return t&&(T(t)||M(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}(i.shapeUrl,this.options.createImage);t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=this.options.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},d=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&d(l,a,o);)++l;for(;h-1>l&&d(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=D$(i.shapeUrl.backgroundColor,void 0,this.options.createCanvas);const t=F$(i.shapeUrl,e.size[0],e.size[1],void 0,!1,this.options.createCanvas);i.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,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b;const x=this.segmentationInput,S=V$(x);if(!S.segmentation.regions.length)return;const A=this.options,k=this.data,T=A.colorMode||"ordinal",M={getText:Pt(A.text),getFontSize:Pt(A.fontSize),fontSizeRange:A.fontSizeRange,colorMode:T,getColor:A.colorField?Pt(A.colorField):Pt(A.text),getFillingColor:Pt(A.fillingColorField),colorList:A.colorList||("ordinal"===T?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:Pt(A.colorHexField),getFontFamily:Pt(A.fontFamily||"sans-serif"),rotateList:A.rotateList||[0],getPadding:Pt(A.padding||1),getFontStyle:Pt(A.fontStyle||"normal"),getFontWeight:Pt(A.fontWeight||"normal"),getFontOpacity:A.fontOpacity?Pt(A.fontOpacity):()=>1};uK(k,M,S);const C={size:A.size,ratio:A.ratio||.8,shapeUrl:A.shape,random:void 0===A.random||A.random,textLayoutTimes:null!==(t=A.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:A.removeWhiteBorder,layoutMode:null!==(e=A.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=A.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=A.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=A.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:A.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=A.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=A.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=A.fillingTimes)&&void 0!==o?o:4,fillingXStep:A.fillingXRatioStep?Math.max(Math.floor(A.size[0]*A.fillingXRatioStep),1):null!==(l=A.fillingXStep)&&void 0!==l?l:4,fillingYStep:A.fillingYRatioStep?Math.max(Math.floor(A.size[1]*A.fillingYRatioStep),1):null!==(h=A.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:A.fillingInitialFontSize,fillingDeltaFontSize:A.fillingDeltaFontSize,fillingInitialOpacity:null!==(c=A.fillingInitialOpacity)&&void 0!==c?c:.8,fillingDeltaOpacity:null!==(d=A.fillingDeltaOpacity)&&void 0!==d?d:.05,getFillingFontFamily:Pt(A.fillingFontFamily||"sans-serif"),getFillingFontStyle:Pt(A.fillingFontStyle||"normal"),getFillingFontWeight:Pt(A.fillingFontWeight||"normal"),getFillingPadding:Pt(null!==(u=A.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=A.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=A.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:A.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(f=A.minInitFontSize)&&void 0!==f?f:10,minFontSize:null!==(m=A.minFontSize)&&void 0!==m?m:4,minFillFontSize:null!==(v=A.minFillFontSize)&&void 0!==v?v:2},w=((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})(M.colorList,C.fillingColorList);C.sameColorList=w,dK(k,M,C,A),function(t,e,i,s){const{getText:n}=e;let{fillingInitialFontSize:r,fillingDeltaFontSize:a}=i;const{fillingRatio:o}=i,l=Math.ceil(Math.sqrt(s.shapeArea)/4);if(!r||!a){const e=o/100,h=t.reduce(((t,e)=>{const i=eK(n(e));return i>l?t:t+i}),0)/t.length;let c;if(0===h)c=8;else{const t=.2*s.shapeArea;c=Math.sqrt(e*(t/h))}r=~~c,a=c*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(k,M,C,S);const{getText:E,getFontFamily:B,getFontStyle:P,getFontWeight:R,getPadding:L,getColor:I,getFillingColor:O,getColorHex:D,fontSizeScale:F,colorScale:z,fillingColorScale:j,getFontOpacity:H,rotateList:N}=M,V=k.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:B(t),fontWeight:R(t),fontStyle:P(t),rotate:N[~~(x.randomGenerator()*N.length)],fontSize:Math.max(C.minInitFontSize,~~F(t)),opacity:H(t),padding:L(t),color:D&&D(t)||z&&z(I(t))||"black",fillingColor:!O||(null===(e=A.colorField)||void 0===e?void 0:e.field)===(null===(i=A.fillingColorField)||void 0===i?void 0:i.field)&&w?void 0:D&&D(t)||j&&j(O(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),U=$(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/U)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:W,successedWords:G,failedWords:Y}=lK(V,C,S),X=null!==(_=null===(y=A.text)||void 0===y?void 0:y.field)&&void 0!==_?_:"textKey",K=null!==(b=A.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=A.as?Object.assign(Object.assign({},hK),A.as):hK;let Z,J;const Q=[];for(let t=0;t<V.length;++t)Z=V[t],J=Z.datum,J[q.x]=Z.x,J[q.y]=Z.y,J[q.fontFamily]=Z.fontFamily,J[q.fontSize]=Z.fontSize,J[q.fontStyle]=Z.fontStyle,J[q.fontWeight]=Z.fontWeight,J[q.angle]=oe(Z.rotate),J[q.opacity]=Z.opacity,J[q.visible]=Z.visible,J[q.isFillingWord]=!1,J[q.color]=Z.color,J[K]=`${Z.text}_${t}_keyword`,Q.push(J);const tt=[];W.forEach(((t,e)=>{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=oe(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=O?(null===(i=A.colorField)||void 0===i?void 0:i.field)===(null===(s=A.fillingColorField)||void 0===s?void 0:s.field)&&w?t.color:t.fillingColor:C.fillingColorList[~~(x.randomGenerator()*C.fillingColorList.length)],n[X]=t.text,n[K]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.options.onLayoutFinished&&this.options.onLayoutFinished({successedWords:G,failedWords:Y}),this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const dK=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:c}=e,{sameColorList:d}=i;let u,p,g=e.colorList,f=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new GP).domain(e).range(g).scale(t),c&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!d)){const e=t.map((t=>c(t)));p=t=>(new GP).domain(e).range(f).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new fR).domain(gK(h,t)).range(g);if(u=t=>e.scale(t),c&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!d)){1===f.length&&(f=[f[0],f[0]]);const e=(new fR).domain(gK(c,t)).range(f);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},uK=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new bR).domain(gK(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&d(n)&&!s){const e=.5,[o,l]=gK(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),c=pK(h,i,!0);s=[~~(e*c),~~c];const d=(new bR).domain(gK(n,t)).range(s);a=t=>d.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=pK(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},pK=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=eK(e.text);return s<a?t+s*(i?(.5+.5*e.weight)**2:1):t}),0);if(0===o)return 12;let l=20;if(1===r.length)l=Math.sqrt(n*(s/(1.7*o)));else{const t=[];for(let e=0;e<r.length;e++){const i=r[e].area,a=r[e].ratio,l=i/s;if(l<.1)continue;const h=l*(o*(a<1?2.7-a:1.7)),c=Math.sqrt(n*(i/h));t.push(c)}l=t.length?Math.min(...t):Math.sqrt(n*(s/(1.7*o)))}return l};const gK=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;a<n;++a)r=it(t(e[a])),r<i&&(i=r),r>s&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},fK=(t,e,i)=>{if(!t.size||u(t.size[0])||u(t.size[1])||t.size[0]<=0||t.size[1]<=0)return at.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||at.getInstance().error("WordcloudShape shape must be specified."),t.text||at.getInstance().error("WordcloudShape text must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];const s=new cK(t);return s.layout(e),s.unfinished()?{progressive:s}:s.output()};class mK extends kX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.wordCloud}}mK.type=t.SeriesTypeEnum.wordCloud;const vK=()=>{AD.registerGrammarTransform("wordcloud",{transform:X$}),RG(),AD.registerAnimation("wordCloud",((t,e)=>({appear:TX(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),AD.registerSeries(mK.type,mK)},yK=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:c,asLastValueRatio:d,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:f=!1,isCone:m=!0,range:v}=e,y=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),_=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==v?void 0:v.min)&&void 0!==i?i:_,null!==(s=null==v?void 0:v.max)&&void 0!==s?s:y];return n.forEach(((t,e)=>{var i,s;const v=Number.parseFloat(t[r]),y=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),_=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=k(_*v)&&0!==v?_/v:0,S=k(v*y)&&0!==y?v/y:0;u&&(t[u]=y),g&&(t[g]=_),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===f?x:1/n.length),h&&(t[h]=v/b[1]),c&&(t[c]=e===n.length-1?m?0:t[h]:_/b[1]),d&&(t[d]=0===e?1:y/b[1]),p&&(t[p]=v)})),n},_K=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},bK=`${YD}_FUNNEL_TRANSFORM_RATIO`,xK=`${YD}_FUNNEL_REACH_RATIO`,SK=`${YD}_FUNNEL_HEIGHT_RATIO`,AK=`${YD}_FUNNEL_VALUE_RATIO`,kK=`${YD}_FUNNEL_LAST_VALUE_RATIO`,TK=`${YD}_FUNNEL_NEXT_VALUE_RATIO`,MK=`${YD}_FUNNEL_LAST_VALUE`,CK=`${YD}_FUNNEL_CURRENT_VALUE`,wK=`${YD}_FUNNEL_NEXT_VALUE`,EK=`${YD}_FUNNEL_TRANSFORM_LEVEL`;class BK extends eH{constructor(t){var e,i;super(t),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?this._transformRatioText:null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)){return`${(100*(null==t?void 0:t[xK])).toFixed(1)}%`}return this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return this._transformRatioText;const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return p(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]},this._transformRatioText=null!==(i=null===(e=t.getSpec())||void 0===e?void 0:e.transformRatioText)&&void 0!==i?i:"转化率"}}class PK extends nj{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class RK extends PK{constructor(){super(...arguments),this.type=RK.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}RK.type="polygon";const LK=()=>{AD.registerMark(RK.type,RK),zM(),RM(),Mj(),AD.registerGraphicComponent("polygon",lf)},IK=Object.assign(Object.assign({},pH),{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 OK extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class DK extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=OK,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._minLabelLineWidth=null!==(n=null===(s=null===(i=this._spec.outerLabel)||void 0===i?void 0:i.line)||void 0===s?void 0:s.minLength)&&void 0!==n?n:20,this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;qF(this._dataSet,"funnel",yK),qF(this._dataSet,"funnelTransform",_K);const t=new Ba(this._dataSet,{name:`${YD}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new Qz(this._option,t)}compile(){var t,e;super.compile(),this._funnelOuterLabelMark&&(null===(t=this._funnelOuterLabelMark.label)||void 0===t||t.compile({group:this._rootMark.getProduct()}),null===(e=this._funnelOuterLabelMark.line)||void 0===e||e.compile({group:this._rootMark.getProduct()}))}compileData(){var t;super.compileData(),null===(t=this._viewDataTransform)||void 0===t||t.compile()}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:CK,asTransformRatio:bK,asReachRatio:xK,asHeightRatio:SK,asValueRatio:AK,asNextValueRatio:TK,asLastValueRatio:kK,asLastValue:MK,asNextValue:wK,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:EK}})}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},DK.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,groupKey:this._seriesField,isSeriesMark:!0,noSeparateStyle:!0},{morph:TH(this._spec,this._funnelMarkName),morphElementKey:this._seriesField}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},DK.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform,noSeparateStyle:!0}),this._funnelTransformMark&&this._funnelTransformMark.setData(this._viewDataTransform)),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(DK.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,markSpec:this._spec.outerLabel,noSeparateStyle:!0,parent:!1}),this._funnelOuterLabelMark.line=this._createMark(DK.mark.outerLabelLine,{themeSpec:e,markSpec:t,noSeparateStyle:!0,parent:!1})}}initTooltip(){this._tooltipHelper=new BK(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 e,i,s,n;const r=this._funnelMark;r&&this.setMarkStyle(r,{points:t=>this.getPoints(t),visible:t=>p(t[this._valueField]),fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series);const a=this._funnelTransformMark;a&&this.setMarkStyle(a,{points:t=>this.getPoints(t)},"normal",t.AttributeLevel.Series);const o=this._funnelOuterLabelMark.label;o&&(this.setMarkStyle(o,{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",t.AttributeLevel.Series),d(this._spec.outerLabel.formatMethod)&&this.setMarkStyle(o,{text:t=>this._spec.outerLabel.formatMethod(`${t[this.getCategoryField()]}`,t)},"normal",t.AttributeLevel.User_Mark));const l=this._funnelOuterLabelMark.line;if(l&&o){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",t.AttributeLevel.Series);const r=null!==(s=null===(i=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.line)||void 0===i?void 0:i.visible)&&void 0!==s?s:null===(n=this._spec.outerLabel)||void 0===n?void 0:n.visible;p(r)&&l.setVisible(r)}}initLabelMarkStyle(e){var i;if(!e)return;const s=e.getTarget(),n=e.getComponent();if(s===this._funnelMark){this._labelMark=e,this.setMarkStyle(e,{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",t.AttributeLevel.Series);const s=this.getCompiler().getRootMarks();this._funnelOuterLabelMark.label&&U_(s,this._funnelOuterLabelMark.label,n),this._funnelOuterLabelMark.line&&U_(s,this._funnelOuterLabelMark.line,null!==(i=this._funnelOuterLabelMark.label)&&void 0!==i?i:n)}else this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=e,this.setMarkStyle(e,{text:t=>`${(100*IO(xK).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",t.AttributeLevel.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.AABBBounds;return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),SH("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(xH(AD.getAnimationInKey("fadeInOut")(),SH(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(xH(AD.getAnimationInKey("funnel")({},o),SH(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(xH(null===(a=AD.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),SH("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[kK])/2:this._getSecondaryAxisLength(t[AK])/2,n=this._getSecondaryAxisLength(t[AK])/2):(s=this._getSecondaryAxisLength(t[AK])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[TK])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[EK])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return p(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[ZD]===t[ZD]));if(!p(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),c=this._getMainAxisLength(!0);return l+=i*(h+c),l+=s?-c/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(S(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r,a;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const o=this.getPoints(t),l=(Math.abs(o[0].x-o[1].x)+Math.abs(o[2].x-o[3].x))/2,h=this.getCategoryField(),c=null===(n=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[h])===t[h]}),!0))||void 0===n?void 0:n.AABBBounds,d=c?c.x2-c.x1:0,u=this._funnelOuterLabelMark.line?this._minLabelLineWidth:0;let p=this.getLayoutRect().width-Math.max(l,d);return"center"===this._funnelAlign&&(p/=2),p-u-(null!==(a=null===(r=this._spec.outerLabel)||void 0===r?void 0:r.spaceWidth)&&void 0!==a?a:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,c;const d=this.getCategoryField(),u=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getGraphics())||void 0===s?void 0:s.find((e=>{var i;return(null===(i=e.context.data[0])||void 0===i?void 0:i[d])===t[d]})))||void 0===n?void 0:n.AABBBounds,p=null===(a=null===(r=this._labelMark)||void 0===r?void 0:r.getComponent())||void 0===a?void 0:a.getComponent(),g=null===(o=null==p?void 0:p.find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[d])===t[d]}),!0))||void 0===o?void 0:o.AABBBounds,f=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{};let m,v,y,_;if(this._isHorizontal()){const e=null!==(h=f.spaceWidth)&&void 0!==h?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?(y=this._getPolygonCenter(i).y-s/2-e,_=!1!==f.alignLabel?(null==u?void 0:u.y2)+e:y-e,m=this._getPolygonCenter(i).x,y-_<this._minLabelLineWidth&&(_=y-this._minLabelLineWidth),v=m):(y=this._getPolygonCenter(i).y+s/2+e,_=!1!==f.alignLabel?(null==u?void 0:u.y1)-e:y+e,m=this._getPolygonCenter(i).x,_-y<this._minLabelLineWidth&&(_=y+this._minLabelLineWidth),v=m),{x1:m,x2:v,y1:y,y2:_}}const b=this.getPoints(t),x=(Math.abs(b[0].x-b[1].x)+Math.abs(b[2].x-b[3].x))/2,S=(null==g?void 0:g.x2)-(null==g?void 0:g.x1)||0,A=null!==(c=f.spaceWidth)&&void 0!==c?c:5;return"right"===this._spec.outerLabel.position||"left"===this._funnelAlign?(m=this._getPolygonCenter(b).x+Math.max(S/2,x/2)+A,v=!1!==f.alignLabel?(null==u?void 0:u.x1)-A:m+A,y=this._getPolygonCenter(b).y,v-m<this._minLabelLineWidth&&(v=m+this._minLabelLineWidth),_=y):(m=this._getPolygonCenter(b).x-Math.max(S/2,x/2)-A,v=!1!==f.alignLabel?(null==u?void 0:u.x2)+A:m-A,y=this._getPolygonCenter(b).y,m-v<this._minLabelLineWidth&&(v=m-this._minLabelLineWidth),_=y),{x1:m,x2:v,y1:y,y2:_}}_computeMaxSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return aD(null!==(t=this._spec.maxSize)&&void 0!==t?t:"80%",e)}_computeMinSize(){var t;const e=this._isHorizontal()?this.getLayoutRect().height:this.getLayoutRect().width;return aD(null!==(t=this._spec.minSize)&&void 0!==t?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]}}DK.type=t.SeriesTypeEnum.funnel,DK.mark=IK,DK.builtInTheme={funnel:CD},DK.transformerConstructor=OK;const FK=()=>{LK(),RG(),WW(),AD.registerSeries(DK.type,DK),AD.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},yj))),AD.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:IE,customParameters:(e,i)=>({animationType:"in",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:IE,customParameters:(e,i)=>({animationType:"out",group:i,direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),bj()},zK=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},jK=t=>{const e=t.filter((t=>t.context.diffState===Wz.update)),i=K(e.map((t=>{var e,i;return null===(i=null===(e=null==t?void 0:t.context)||void 0===e?void 0:e.data)||void 0===i?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?void 0:e.data)||void 0===s?void 0:s[0].depth)===i}))},HK=(t,e,i)=>{if(P(t))return[e,i];const s=K(t.map((t=>1*t.getFinalAttribute().startAngle))),n=$(t.map((t=>1*t.getFinalAttribute().endAngle)));return[s,n]},NK=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=HK(r,s,n);return zK(i.getFinalAttribute().startAngle,a)*(n-s)+s},to:(t,e)=>e.getFinalAttribute().startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=HK(r,s,n);return zK(i.getFinalAttribute().endAngle,a)*(n-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}}}),VK=t=>{const e=K(t.map((t=>1*t.getFinalAttribute().startAngle))),i=$(t.map((t=>1*t.getFinalAttribute().endAngle)));return[e,i]},UK=t=>({channel:{startAngle:{from:(t,e)=>e.getFinalAttribute().startAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=VK(r);return zK(i.getFinalAttribute().startAngle,a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getFinalAttribute().endAngle,to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=jK(i.parent.children),a=VK(r);return zK(i.getFinalAttribute().endAngle,a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getFinalAttribute().outerRadius,to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getFinalAttribute().innerRadius,to:()=>t.animationInfo().innerRadius}}}),WK=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},GK=(t,e={})=>{if(!t)return[];const i=[];return EX(t,i,e),i},YK=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new i$(i).layout(t,{width:s,height:n})};class XK extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}var $K;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}($K||($K={}));const KK=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(u(n))return t;if(i.type===$K.DrillDown){return Y(EF(t,n,s,"children"))}if(i.type===$K.DrillUp){const e=BF(t,n,s,"children");if(e)return Y(e)}return t};class qK{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=MW(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;qF(t,"drillFilter",KK),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(u(t.datum)||u(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(e=[]){const{getRawData:i,event:s}=this._drillParams;if(!_(e)||P(e))return e;const n=e[e.length-1];return this._drillInfo={key:n,path:e,type:$K.DrillDown},i().reRunAllTransform(),s.emit(t.ChartEvent.drill,{value:{path:e,type:$K.DrillDown},model:this}),e}drillUp(){var e,i;const{getRawData:s,event:n}=this._drillParams,r=null!==(i=null===(e=this._drillInfo)||void 0===e?void 0:e.path)&&void 0!==i?i:[];if(!_(r)||P(r))return r;const a=r.pop();return this._drillInfo={key:a,path:r,type:$K.DrillUp},s().reRunAllTransform(),n.emit(t.ChartEvent.drill,{value:{path:r,type:$K.DrillUp},model:this}),r}}const ZK=Object.assign(Object.assign({},pH),{sunburst:{name:"sunburst",type:"arc"}}),JK=(t,e,i)=>(t.push({key:e,operations:["values"]}),t.push({key:i,operations:["max","min"]}),t.push({key:aH,operations:["max","min","values"]}),t.push({key:oH,operations:["values"]}),t),QK={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"}}}};class tq extends $G{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:ZD},getRawData:()=>this.getRawData()}),this._startAngle=oe(this._spec.startAngle),this._endAngle=oe(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),qF(this._dataSet,"sunburstLayout",YK),qF(this._dataSet,"flatten",GK),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[p(this._centerX)?this._centerX:this.getLayoutRect().width/2,p(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(qF(t.dataSet,"addVChartProperty",$j),t.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){if(!1===this._sunburst.visible)return;const t=this._createMark(tq.mark.sunburst,{isSeriesMark:!0});this._sunburstMark=t}_initArcMarkStyle(){u(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(p(this._offsetX)?this._offsetX:0),y:t=>t.y+(p(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(tq.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return g(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(p(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(p(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initTooltip(){this._tooltipHelper=new XK(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Y(this.__innerRadius))[0],outerRadius:this._computeRadius(Y(this.__outerRadius))[0],startAngle:Y(this._startAngle)[0],endAngle:Y(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(){super.onLayoutEnd(),this._rawData.reRunAllTransform()}_computeRadius(t){return _(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}}tq.type=t.SeriesTypeEnum.sunburst,tq.mark=ZK,tq.builtInTheme={sunburst:QK},G(tq,qK);const eq=()=>{AD.registerSeries(tq.type,tq),oY(),RG(),bj(),AD.registerAnimation("sunburst",((t,e)=>({appear:WK(0,e),enter:NK(t),exit:UK(t),disappear:UK(t)})))},iq=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;if(0===s||0===n)return t;return new GX(i).layout(t,{width:s,height:n})};class sq extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const nq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},rq=Object.assign(Object.assign({},pH),{circlePacking:{name:"circlePacking",type:"arc"}});class aq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:ZD},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();u(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),qF(this._dataSet,"circlePackingLayout",iq),qF(this._dataSet,"flatten",GK),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();u(null==t?void 0:t.dataSet)||(qF(t.dataSet,"addVChartProperty",$j),t.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const e=this._createMark(aq.mark.circlePacking,{isSeriesMark:!0});this._circlePackingMark=e}_initCirclePackingMarkStyle(){u(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},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(aq.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){u(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}initTooltip(){this._tooltipHelper=new sq(this),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),SH(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}}aq.type=t.SeriesTypeEnum.circlePacking,aq.mark=rq,aq.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"}}}}},G(aq,qK);const oq=()=>{AD.registerSeries(aq.type,aq),oY(),RG(),_j(),AD.registerAnimation("circlePacking",((t,e)=>({appear:nq(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}})))},lq=(t,e,i)=>{e.forEach((e=>{u(e[i])||t.add(e[i]),e.children&&e.children.length>0&&lq(t,e.children,i)}))},hq=t=>{var e;if(!t||!_(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},cq=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new QX(e),r=[];return r.push(n.layout(s,i)),r},dq=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},uq=t=>{var e,i;return t&&_(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class pq extends eH{constructor(){super(...arguments),this._getDimensionData=t=>{if(t.source){if(S(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},this.markTooltipValueCallback=t=>t.value}}const gq=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}),fq=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:gq(t),mq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"};class vq extends cE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s,a=this.target.getFinalAttribute();a&&Object.assign(this.target.attribute,a),this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const 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 yq extends cE{onBind(){var t,e,i;super.onBind(),(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:s,to:n}=((t,e,i)=>{const s={x0:t.getFinalAttribute().x0,x1:t.getFinalAttribute().x1,y0:t.getFinalAttribute().y0,y1:t.getFinalAttribute().y1,thickness:t.getFinalAttribute().thickness};return{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}})(this.target,this.params.options,this.params),r=null!==(i=null===(e=this.target.context)||void 0===e?void 0:e.lastAttrs)&&void 0!==i?i:s;this.props=n,this.propKeys=Object.keys(n).filter((t=>null!=n[t])),this.animate.reSyncProps(),this.from=r,this.to=n,this.target.setAttributes(r)}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const _q=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c),d=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.y0-n/2),l=d(t.y1-n/2)):"end"===t.align?(o=d(t.y0+t.thickness/2-n),l=d(t.y1+t.thickness/2-n)):(o=d(t.y0-t.thickness/2),l=d(t.y1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${a},${d(l-n/2)}L${d(a+n)},${d((l+p)/2)}L${a},${d(p+n/2)}`:"",m=t.startArrow&&g?`L${r},${d(u+n/2)}L${d(r-n)},${d((o+u)/2)}L${r},${d(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${f}L${a},${p}L${r},${u}${m}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${f}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${m}Z`:`M${r},${o}C${h},${o},${c},${l},${a},${l}\n ${f}L${a},${p}C${c},${p},${h},${u},${r},${u}${m}Z`},bq=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),c=a+s*(r-a),d=t=>t;!1!==t.round&&(d=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),c=Math.round(c)),"line"===t.pathType||t.pathType,"center"===t.align?(o=d(t.x0-n/2),l=d(t.x1-n/2)):"end"===t.align?(o=d(t.x0+t.thickness/2-n),l=d(t.x1+t.thickness/2-n)):(o=d(t.x0-t.thickness/2),l=d(t.x1-t.thickness/2));const u=d(o+n),p=d(l+n),g=Math.abs(a-r)>1e-6,f=t.endArrow&&g?`L${d(l-n/2)},${a}L${d((l+p)/2)},${d(a+n)}L${d(p+n/2)},${a}`:"",m=t.startArrow&&g?`L${d(u+n/2)},${r}L${d((u+o)/2)},${d(r-n)}L${d(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${f}L${p},${a}L${u},${r}${m}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${f}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${m}Z`:`M${o},${r}C${o},${h},${l},${c},${l},${a}\n ${f}L${p},${a}C${p},${c},${u},${h},${u},${r}${m}Z`};class xq extends gG{constructor(){super(...arguments),this.type=xq.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,n;const r=Object.assign(Object.assign({},i.attribute),t),a=null!==(s=r.direction)&&void 0!==s?s:null===(n=this._glyphConfig)||void 0===n?void 0:n.direction,o=["vertical","TB","BT"].includes(a)?bq:_q,l="number"==typeof r.ratio&&r.ratio>=0&&r.ratio<=1;return{back:{path:l?o(r,1):""},front:{path:o(r,l?r.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})}}xq.type="linkPath";const Sq=Object.assign(Object.assign({},pH),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class Aq extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}const kq=(t,e,i,s=!0,n)=>{t.runtimeStateCache||(t.runtimeStateCache={}),t.runtimeStateCache[e]=i,t.hasState(e)&&t.removeState(e),t.addState(e,s,n)};class Tq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.sankey,this.transformerConstructor=Aq,this._nodeLayoutZIndex=t.LayoutZIndex.Node,this._labelLayoutZIndex=t.LayoutZIndex.Label,this._viewBox=new Ve,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(p(a))return a;if(p(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a;const o=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(o)return o;if(p(this._spec.seriesField)){const e=null===(s=this._nodesSeriesData.latestData)||void 0===s?void 0:s.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,a=null===(r=null===(n=this._option)||void 0===n?void 0:n.globalScale)||void 0===r?void 0:r.getScale("color");return null==a?void 0:a.scale(null==i?void 0:i[this._spec.seriesField])}const l=S(t.source)?this.getNodeList()[t.source]:t.source;return null===(a=this._colorScale)||void 0===a?void 0:a.scale(l)},this._handleEmphasisElement=t=>{var e;const i=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},s=t.item;"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 e,i;if(!this._needClear)return;const s=null===(e=this._nodeMark)||void 0===e?void 0:e.getGraphics();if(!s||!s.length)return;const n=null===(i=this._linkMark)||void 0===i?void 0:i.getGraphics();n&&n.length&&(s.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),n.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),this._needClear=!1)},this._handleNodeAdjacencyClick=e=>{const i=FF(e),s=[i.key];if(this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach(((e,n)=>{const r=FF(e);r.source===i.key?(s.includes(r.target)||s.push(r.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):r.target===i.key?(s.includes(r.source)||s.push(r.source),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),s),this._needClear=!0},this._handleLinkAdjacencyClick=e=>{const i=FF(e),s=[i.source,i.target];if(this._linkMark){const i=this._linkMark.getGraphics();if(!i||!i.length)return;i.forEach((i=>{i===e?(i.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),kq(i,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1})):(i.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),i.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),s),this._needClear=!0},this._handleNodeRelatedClick=e=>{var i;const s=FF(e),n=this._nodeMark.getGraphics();if(!n||!n.length)return;const r=this._linkMark.getGraphics();if(!r||!r.length)return;const a=(null===(i=FF(r[0]))||void 0===i?void 0:i.parents)?"parents":"source";if("source"===a){const e=[s.key],i=[];if(r.forEach(((t,r)=>{var a,o,l,h;const c=FF(t),d=(null==c?void 0:c.parents)?"parents":"source";if(Y(c[d]).includes(s.key)){if(i.includes(null!==(a=c.key)&&void 0!==a?a:c.index)||i.push(null!==(o=c.key)&&void 0!==o?o:c.index),e.includes(c.source)||e.push(c.source),!e.includes(c.target)){e.push(c.target);let t=n.find((t=>t.data[0].key===c.target)).data[0].sourceLinks;for(;(null==t?void 0:t.length)>0;){const s=[];return t.forEach((t=>{var r,a;if(!i.includes(null!==(r=t.key)&&void 0!==r?r:t.index)&&(i.push(null!==(a=t.key)&&void 0!==a?a:t.index),!e.includes(t.target))){e.push(t.target);const i=n.find((e=>e.data[0].key===t.target));s.push(i.data[0].targetLinks)}})),void(t=s)}}}else if(c.target===s.key&&(i.includes(null!==(l=c.key)&&void 0!==l?l:c.index)||i.push(null!==(h=c.key)&&void 0!==h?h:c.index),!e.includes(c.source))){e.push(c.source);let t=n.find((t=>t.data[0].key===c.source)).data[0].targetLinks;for(;(null==t?void 0:t.length)>0;){const s=[];return t.forEach((t=>{var r,a;if(!i.includes(null!==(r=t.key)&&void 0!==r?r:t.index)&&(i.push(null!==(a=t.key)&&void 0!==a?a:t.index),!e.includes(t.source))){e.push(t.source);const i=n.find((e=>e.data[0].key===t.source));s.push(i.data[0].targetLinks)}})),void(t=s)}}})),this._linkMark){const e=this._linkMark.getGraphics();if(!e||!e.length)return;e.forEach(((e,s)=>{var n;const r=FF(e);i.includes(null!==(n=r.key)&&void 0!==n?n:r.index)?(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0)):(e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),e)}else{const e=[s.key],i=s.targetLinks.reduce(((t,e)=>(Y(e.datum).forEach((e=>{const i=e.parents,n=i.length;for(let r=0;r<n;r++){const n=i[r].key,a=i[r+1]?i[r+1].key:s.key,o=e.value,l=t.find((t=>t.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);r.forEach(((n,r)=>{const o=FF(n),l=o.datum,h=l?l.filter((t=>t[a].some((t=>t.key===s.key)))):null,c=i.find((t=>t.source===o.source&&t.target===o.target));if(h&&h.length){e.includes(o.source)||e.push(o.source),e.includes(o.target)||e.push(o.target);const i=h.reduce(((t,e)=>t+e.value),0),s=i/o.value;return n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(n,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:s})}if(c)return e.includes(o.source)||e.push(o.source),e.includes(o.target)||e.push(o.target),n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(n,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:c.value/o.value});n.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),n.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._nodeMark&&this._highLightElements(this._nodeMark.getGraphics(),e)}this._needClear=!0},this._handleLinkRelatedClick=e=>{const i=this._nodeMark.getGraphics();if(!i||!i.length)return;const s=this._linkMark.getGraphics();if(!s||!s.length)return;if("source"===(FF(e)?"parents":"source"))this._linkMark&&s.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&i.forEach((e=>{e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE)}));else{const n=FF(e),r=[n.source,n.target],a=[];Y(n.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;s<i-1;s++){const i=e[s].key,n=e[s+1].key,r=t.value,o=a.find((t=>t.source===i&&t.target===n));a.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=r:a.push({source:i,target:n,value:r})}})),s.forEach((e=>{const i=FF(e),s=i.datum;if(i.source===n.source&&i.target===n.target)return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:1});const o=s?s.filter((t=>{const e=t.parents.map((t=>t.key));return e.includes(n.source)&&e.includes(n.target)})):null;if(o&&o.length){r.includes(i.source)||r.push(i.source),r.includes(i.target)||r.push(i.target);const s=o.filter((t=>t.parents.some(((e,i)=>{var s;return e.key===n.source&&(null===(s=t.parents[i+1])||void 0===s?void 0:s.key)===n.target})))).reduce(((t,e)=>t+e.value),0),a=s/i.value;return e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:a})}const l=a.find((t=>t.source===i.source&&t.target===i.target));if(l)return r.includes(i.source)||r.push(i.source),r.includes(i.target)||r.push(i.target),e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE),void kq(e,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,{ratio:l.value/i.value});e.removeState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS),e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)})),this._highLightElements(i,r)}this._needClear=!0}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var e,i,s,n;super.initData();const r=this.getViewData(),a=this.getRawData();if(a&&r){qF(this._dataSet,"sankeyLayout",cq),qF(this._dataSet,"sankeyFormat",hq),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!==(e=this._spec.nodeAlign)&&void 0!==e?e:"justify",nodeGap:null!==(i=this._spec.nodeGap)&&void 0!==i?i:8,nodeWidth:null!==(s=this._spec.nodeWidth)&&void 0!==s?s:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(n=this._spec.minNodeHeight)&&void 0!==n?n: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:t.TransformLevel.sankeyLayout});const{dataSet:o}=this._option;qF(o,"sankeyNodes",dq),qF(o,"flatten",GK);const l=new Ba(o,{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){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),l.transform({type:"addVChartProperty",options:{beforeCall:hH.bind(this),call:cH}},!1),this._nodesSeriesData=l,qF(o,"sankeyLinks",uq);const h=new Ba(o,{name:`sankey-link-${this.id}-data`});h.parse([this.getViewData()],{type:"dataview"}),h.transform({type:"sankeyLinks"}),h.transform({type:"addVChartProperty",options:{beforeCall:hH.bind(this),call:cH}},!1),this._linksSeriesData=h}}compileData(){var t,e;super.compileData(),null===(t=this._linkMark)||void 0===t||t.compileData(),null===(e=this._nodeMark)||void 0===e||e.compileData()}initMark(){this._rootMark.setMarkConfig({overflow:this._spec.overflow,interactive:!!this._spec.overflow});const t=this._createMark(Tq.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData});t&&(t.setMarkConfig({zIndex:this._nodeLayoutZIndex}),this._nodeMark=t);const e=this._createMark(Tq.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){const e=this._nodesSeriesData.latestData,i=Y(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.latestData,i=Y(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var e,i;const s=this._nodeMark;s&&(this.setMarkStyle(s,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Mark),this.setMarkStyle(s,{fill:null!==(i=null===(e=this._spec.node.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByNode},"normal",t.AttributeLevel.User_Mark))}_initLinkMarkStyle(){var e,i;const s=this._linkMark;s&&(s.setGlyphConfig({direction:this.direction}),this.setMarkStyle(s,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(s,{fill:null!==(i=null===(e=this._spec.link.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this._fillByLink},"normal",t.AttributeLevel.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setMarkConfig({zIndex:this._labelLayoutZIndex})}_createText(t,e){if(u(t)||u(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=Gj(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),SH("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),SH("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData)||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData)||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:GF.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodeMark.getData().updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linkMark.getData().updateData()}_highLightElements(e,i){e&&e.length&&e.forEach((e=>{e.removeState([t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS]),i.includes(FF(e).key)?e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS,!0):e.addState(t.STATE_VALUE_ENUM.STATE_SANKEY_EMPHASIS_REVERSE,!0)}))}initTooltip(){this._tooltipHelper=new pq(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!u(a[0])||(a=this.getNodeList(),a&&a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new qO;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{if(i.add(t[e]),t.children){this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))}})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{p(t[i])&&e.add(t[i]),p(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]){this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})}return this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return lq(t,r.nodes,this._seriesField),Array.from(t)}return n}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?_(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}Tq.type=t.SeriesTypeEnum.sankey,Tq.transformerConstructor=Aq,Tq.mark=Sq,Tq.builtInTheme={sankey:{link:{style:{fillOpacity:.15,round:!0}}}};const Mq=()=>{XU(),fG(),BM(),AD.registerGraphicComponent("path",(t=>Jg(t))),AD.registerMark(xq.type,xq),RG(),AD.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:fq(t,e)},yj))),AD.registerAnimation("sankeyLinkPath",((t,e)=>({appear:mq(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),Qw.registerBuiltInAnimate("linkPathGrowOut",yq),Qw.registerBuiltInAnimate("linkPathGrowIn",vq),bj(),AD.registerSeries(Tq.type,Tq)},Cq=(t,e)=>{let i={},s=e.fields;if(d(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=GK(n);return i=sH([{latestData:r}],e),i};class wq extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const Eq=Object.assign(Object.assign({},pH),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),Bq=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class Pq extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}const Rq=()=>{AD.registerGrammarTransform("filter",{transform:(t,e)=>null==e?void 0:e.filter(t.callback)})},Lq=()=>{AD.registerGrammarTransform("map",{transform:(t,e)=>(null==e||e.forEach(((e,i)=>{t.callback(e)})),e)})},Iq=(t,e)=>{if(e.getViewBox()){const i=new a$(e).layout(t,e.getViewBox()),s=[];return EX(i,s,{maxDepth:null==e?void 0:e.maxDepth}),s.forEach(((t,i)=>{t&&[oH,"name"].forEach((i=>{t[i]=t.datum[t.depth][e.nameField]}))})),s}return[]};class Oq extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.treemap,this.transformerConstructor=Pq,this._categoryField="name",this._valueField="value",this._viewBox=new Ve,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:oH),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Ge),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:ZD},getRawData:()=>this.getRawData()}),k(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){var t,e,i,s,n;super.initData(),qF(this._dataSet,"treemap",Iq),null===(t=this._data.getDataView())||void 0===t||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?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize}}),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?void 0:t.dataSet)&&(qF(this._rawData.dataSet,"addVChartProperty",$j),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:dH.bind(this),call:uH}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=Cq([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=j(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){qF(this._dataSet,"hierarchyDimensionStatistics",Cq),qF(this._dataSet,"flatten",GK);const i=new Ba(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return JK(super.getStatisticFields(),this._categoryField,this._valueField)}initMark(){const t=this._createMark(Oq.mark.nonLeaf,{isSeriesMark:!0});t&&(t.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=t);const e=this._createMark(Oq.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()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.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()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initRichStyleOfLabelMark(e){"rich"===e.getTextType()&&this.setMarkStyle(e,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}initNonLeafLabelMarkStyle(e){e&&(this._nonLeafLabelMark=e,e.setRule("treemap"),this.setMarkStyle(e,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._initRichStyleOfLabelMark(e))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("treemap"))||void 0===e?void 0:e(),SH(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 wq(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:c}=this._matrix;this._matrix.multiply(r,a,o,l,h,c),this.disableMarkAnimation(),this.event.on(NF.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(NF.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}}Oq.type=t.SeriesTypeEnum.treemap,Oq.mark=Eq,Oq.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"}}}},Oq.transformerConstructor=Pq,G(Oq,qK),G(Oq,wW);const Dq=()=>{Rq(),Lq(),XU(),RG(),AD.registerAnimation("treemap",((t,e)=>({appear:Bq(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),bj(),AD.registerSeries(Oq.type,Oq)},Fq=Object.assign(Object.assign({},QY),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),zq=Object.assign(Object.assign({},pH),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),jq={type:"fadeIn"};function Hq(t,e){return"fadeIn"===e?jq:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}class Nq extends EH{constructor(){super(...arguments),this._supportStack=!1}}class Vq extends eH{enableByType(t){return"dimension"!==t}}const Uq="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",Wq={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:Uq,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:Uq,fill:"#ddd"}}};class Gq extends tX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.gaugePointer,this.transformerConstructor=Nq,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(Gq.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},Gq.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(Gq.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new Vq(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return p(this.radiusAxisHelper)&&p(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=$(e),s=K(e),n=vt(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),c=Math.sin(l);return{x:a*h+o*c,y:-(o*h-a*c)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}getInteractionTriggers(){return this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),SH("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}Gq.type=t.SeriesTypeEnum.gaugePointer,Gq.mark=zq,Gq.builtInTheme={gaugePointer:Wq},Gq.transformerConstructor=Nq;const Yq=()=>{AD.registerSeries(Gq.type,Gq),xW(),XU(),AD.registerAnimation("gaugePointer",((t,e)=>{const i=Hq(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),BY(),wY()};class Xq extends EH{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class $q extends tX{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.gauge,this.transformerConstructor=Xq,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=oe(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData();qF(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[mF]=t[this._angleField[0]],t[fF]=e>0?i[e-1][mF]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark($q.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark($q.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),e}initMarkStyleWithSpec(e,i){if(super.initMarkStyleWithSpec(e,i),e&&"segment"===e.name){const i=this.getSpec().segment;if(i)for(const s in i.state||{})this.setMarkStyle(e,this.generateRadiusStyle(i.state[s]),s,t.AttributeLevel.User_Mark)}}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?tD(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t),s=_t(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2));return this._spec.clamp?tD(s,this.angleAxisHelper.getScale(0)):s}_getAngleValueStartWithoutPadAngle(t){return p(t[fF])?this.angleAxisHelper.dataToPosition([t[fF]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[mF]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),SH("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}$q.type=t.SeriesTypeEnum.gauge,$q.mark=Fq,$q.builtInTheme={gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}}},$q.transformerConstructor=Xq;const Kq=()=>{AD.registerSeries($q.type,$q),oY(),nX(),wY()};class qq extends nj{constructor(){super(...arguments),this.type=qq.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{fill:void 0,lineWidth:0,padding:0})}_createGraphic(t={}){return Cg(t)}_transformGraphicAttributes(t,e,i){var s,n,r;const a=super._transformGraphicAttributes(t,e,i),o=null!==(n=null!==(s=a.shape)&&void 0!==s?s:a.symbolType)&&void 0!==n?n:null===(r=t.attribute)||void 0===r?void 0:r.symbolType;return u(o)?a.symbolType="rect":a.symbolType=o,a}}qq.type="cell";function Zq(t){return!1===t?{}:{type:"fadeIn"}}class Jq extends eH{enableByType(t){return"dimension"!==t}}const Qq=Object.assign(Object.assign({},pH),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class tZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class eZ extends IH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.heatmap,this.transformerConstructor=tZ}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Y(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){this._cellMark=this._createMark(eZ.mark.cell,{isSeriesMark:!0},{morph:TH(this._spec,eZ.mark.cell.name),morphElementKey:this.getDimensionField()[0]}),this._backgroundMark=this._createMark(eZ.mark.cellBackground)}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",t.AttributeLevel.Series)}initCellBackgroundMarkStyle(){var e,i,s;const n=oi(null!==(s=null===(i=null===(e=this._spec.cellBackground)||void 0===e?void 0:e.style)||void 0===i?void 0:i.padding)&&void 0!==s?s:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+n[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+n[0]},width:()=>this.getCellSize(this._xAxisHelper)-n[1]-n[3],height:()=>this.getCellSize(this._yAxisHelper)-n[0]-n[2]},"normal",t.AttributeLevel.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}getInteractionTriggers(){return this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=LH(this);this._cellMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),SH("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new Jq(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}eZ.type=t.SeriesTypeEnum.heatmap,eZ.mark=Qq,eZ.builtInTheme={heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}}},eZ.transformerConstructor=tZ;const iZ=()=>{RG(),AD.registerMark(qq.type,qq),AD.registerGraphicComponent("symbol",Cg),zM(),HM(),cL(),AD.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},yj),{appear:Zq(e)}))),mV(),uV(),AD.registerSeries(eZ.type,eZ)},sZ=Object.assign(Object.assign({},pH),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),nZ=`${YD}_CORRELATION_X`,rZ=`${YD}_CORRELATION_Y`,aZ=`${YD}_CORRELATION_SIZE`,oZ=(t,e)=>{var i,s,n,r,a,o,l,h,c,d,p,g,f,m,v;if(!t||!(null==e?void 0:e.view)||!_(t))return t;const y=e.view();if(y.x1-y.x0==0||y.y1-y.y0==0||y.x1-y.x0==-1/0||y.x1-y.x0==1/0||y.y1-y.y0==-1/0||y.y1-y.y0==1/0)return t;const b=oe(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=oe(null!==(s=e.endAngle)&&void 0!==s?s:270),A=Math.max((y.x1-y.x0)/2,(y.y1-y.y0)/2),k=Rt(null!==(n=e.innerRadius)&&void 0!==n?n:0,A),T=Rt(e.outerRadius,A),M=[S(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:y.x0+Rt(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",y.x1-y.x0),S(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:y.y0+Rt(null!==(c=null===(h=e.center)||void 0===h?void 0:h[1])&&void 0!==c?c:"50%",y.y1-y.y0)],C=Bt(e.field),w=t.map(C),[E,B]=It(w),P=E===B?t=>(k+T)/2:t=>k+(T-k)*(t-E)/(B-E),R=u(e.radiusField)?C:Bt(e.radiusField),L=null!==(p=null===(d=null==e?void 0:e.radiusRange)||void 0===d?void 0:d[1])&&void 0!==p?p:5;let I=t=>L;if(R){const[i,s]=R!==C?It(t.map(R)):[E,B],n=null!==(f=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==f?f:5,r=null!==(v=null===(m=e.radiusRange)||void 0===m?void 0:m[1])&&void 0!==v?v:5;i!==s&&(I=t=>n+(r-n)*(R(t)-i)/(s-i))}const O=Math.min(b,x),D=Math.max(b,x),F=lZ(O,D,t.length),z=[],j=(D-O)/60;return t.forEach(((t,e)=>{const i=P(w[e]),s=I(t);let n,r,a=F[e];for(let t=0;t<60&&(n=M[0]+i*Math.cos(a),r=M[1]+i*Math.sin(a),hZ({x:n,y:r,size:s},z)||n-s<y.x0||n+s>y.x1||r-s<y.y0||r+s>y.y1);t++)t<59&&(a+=j,a>D?a=O:a<O&&(a=D));z.push(Object.assign({[nZ]:n,[rZ]:r,[aZ]:s},t))})),z},lZ=(t,e,i)=>{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const c=[];let d=t;for(;l<i;)h<n&&(c.push(d+(h%2?Math.floor(h/2)+Math.floor(n/2):h/2)*r*o),h++),l++,h===n&&(h=0,a+=1,o*=-1,0===s?s=r/2:s/=2,d=-1===o?e-s:t+s,a>=2&&(r/=2,n*=2));return c},hZ=(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))),cZ=(t,e)=>{if(!t||!_(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[qD]:null==n?void 0:n[qD],[JD]:null==n?void 0:n[JD]}};class dZ extends gG{constructor(){super(...arguments),this.type=dZ.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)=>{const{ripple:s=i.attribute.ripple,size:n=i.attribute.size}=t,r=vt(s,0,1),a=.5*n;return{ripple0:{size:n+a*r,fillOpacity:.75-.25*r},ripple1:{size:n+a*(1+r),fillOpacity:.5-.25*r},ripple2:{size:n+a*(2+r),fillOpacity:.25-.25*r}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}}dZ.type="ripple";const uZ=()=>{fG(),HM(),AD.registerMark(dZ.type,dZ),AD.registerGraphicComponent("symbol",(t=>Cg(t)))},pZ=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class gZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class fZ extends $G{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.correlation,this.transformerConstructor=gZ,this._viewBox=new Ve}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){p(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){p(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){p(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;qF(this._dataSet,"correlation",oZ);const s=new Ea;ZF(s,"dataview",Ma),qF(s,"correlationCenter",cZ);const n=new Ba(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new Qz(this._option,n)}compileData(){var t;super.compileData(),null===(t=this._centerSeriesData)||void 0===t||t.compile()}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){const e=this._createMark(fZ.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:qD});e&&(e.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._nodePointMark=e);const i=this._createMark(fZ.mark.ripplePoint,{key:qD,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});i&&(this._ripplePointMark=i);const s=this._createMark(fZ.mark.centerPoint,{key:qD,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});s&&(s.setMarkConfig({zIndex:t.LayoutZIndex.Node}),this._centerPointMark=s)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var e,i,s,n;const r=this._nodePointMark;if(!r)return;const a=null!==(i=null===(e=this._spec.nodePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(r,{x:t=>t[nZ],y:t=>t[rZ],size:t=>t[aZ],fill:null!==(s=a.fill)&&void 0!==s?s:this.getColorAttribute(),fillOpacity:null!==(n=a.fillOpacity)&&void 0!==n?n:1,lineWidth:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initRipplePointMarkStyle(){var e,i,s,n,r;const a=this._ripplePointMark;if(!a)return;const o=null!==(i=null===(e=this._spec.ripplePoint)||void 0===e?void 0:e.style)&&void 0!==i?i:{};this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(s=o.fill)&&void 0!==s?s:this.getColorAttribute(),opacity:null!==(n=o.fillOpacity)&&void 0!==n?n:.2,ripple:null!==(r=o.ripple)&&void 0!==r?r:0},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initCenterPointMarkStyle(){var e,i,s,n,r,a;const o=this._centerPointMark;o&&this.setMarkStyle(o,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(s=null===(i=null===(e=this._spec.centerPoint)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),fillOpacity:null!==(a=null===(r=null===(n=this._spec.centerPoint)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(e){e&&this.setMarkStyle(e,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),SH("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()}}fZ.type=t.SeriesTypeEnum.correlation,fZ.mark=sZ,fZ.builtInTheme={correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}}},fZ.transformerConstructor=gZ;const mZ=()=>{aN(),uZ(),AD.registerSeries(fZ.type,fZ),AD.registerAnimation("correlation",((t,e)=>Object.assign({appear:pZ(0,e)},vj)))},vZ={duration:2e3,loop:!0,channel:{wave:{from:0,to:1}}},yZ=t=>({duration:2e3,channel:{wave:{from:0,to:1},height:t.height,dy:t.dy}}),_Z=yZ;function bZ(t,e){switch(e){case"wave":default:return vZ;case"grow":return yZ(t);case"waveGrow":return _Z(t)}}function xZ(t,e){switch(e){case"wave":default:return vZ;case"grow":case"waveGrow":return(t=>({duration:2e3,channel:{dy:t.dy}}))(t)}}const SZ=Object.assign(Object.assign({},pH),{liquidGroup:{name:"liquidGroup",type:"group"},liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"group"}});class AZ extends gG{constructor(){super(...arguments),this.type=AZ.type,this._subMarks={wave0:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:1}},wave1:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.66}},wave2:{type:"area",defaultAttributes:{curveType:"monotoneX",fillOpacity:.33}}},this._positionChannels=["wave","y","height"],this._positionEncoder=(t,e,i)=>{const{wave:s=i.attribute.wave,y:n=i.attribute.y,height:r=i.attribute.height}=t,a=[],o=[],l=[];for(let t=0;t<21;t++){const e=50*t-500,i=n+(t%2==0?20:0),h=n+r;a.push({x:e+100*s,y:i,y1:h}),o.push({x:e+200*s-40,y:i,y1:h}),l.push({x:e+300*s-20,y:i,y1:h})}return{wave0:{x:0,y:0,points:a},wave1:{x:0,y:0,points:o},wave2:{x:0,y:0,points:l}}}}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{wave:0})}}AZ.type="liquid";const kZ=(t,e)=>"drop"===t?function(t,e,i){const s=4*i/3,n=Math.max(s,2*i),r=s/2,a=t,o=r+e-n/2,l=Math.asin(r/(.85*(n-r))),h=Math.sin(l)*r,c=Math.cos(l)*r,d=a-c,u=o+h,p=t,g=o+r/Math.sin(l);return`\n M ${d} ${u}\n A ${r} ${r} 0 1 1 ${d+2*c} ${u}\n Q ${p} ${g} ${t} ${e+n/2}\n Q ${p} ${g} ${d} ${u}\n Z \n `}(0,0,e):t;class TZ extends eH{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>this.series.getValueField(),this.markTooltipValueCallback=t=>t[this.series.getValueField()],this.shapeStrokeCallback=t=>this.series.getMarkInName("liquid").getAttribute("fill",t)}}class MZ extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.liquid,this.transformerConstructor=oN,this._liquidBackgroundMark=null,this._liquidOutlineMark=null,this._getLiquidPosY=()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?e*this._heightRatio:e*(1-this._heightRatio),t+i},this._getLiquidHeight=()=>{const{height:t}=this._getLiquidBackPosAndSize();return t*this._heightRatio},this._getLiquidBackPosAndSize=(t=!1)=>{var e,i;let{top:s=0,bottom:n=0,left:r=0,right:a=0}=this._marginSpec,{top:o=0,bottom:l=0,left:h=0,right:c=0}=t?{}:this._paddingSpec;"triangle"===this._maskShape&&(n/=Math.sqrt(3),s=s/Math.sqrt(3)*2,l/=Math.sqrt(3),o=o/Math.sqrt(3)*2);const{width:d,height:u}=null!==(i=null===(e=this._region)||void 0===e?void 0:e.getLayoutRect())&&void 0!==i?i:{width:0,height:0},p=d/2+(r+h-(a+c))/2,g=u/2+(s+o-(n+l))/2;let f=d-(r+a+h+c),m=u-(s+n+o+l);const v=Math.min(f,m);return"rect"!==this._maskShape&&(f=v,m=v),{x:p,y:g,size:v,width:f,height:m,startX:p-f/2,startY:g-m/2,endX:p+f/2,endY:g+m/2}},this._getLiquidBackPath=(t=!1)=>{var e;let i;if("rect"===this._maskShape){const{x:e,y:s,width:n,height:r}=this._getLiquidBackPosAndSize(t);i=Ig({x:e-n/2,y:s-r/2,width:n,height:r,fill:!0})}else{const{x:s,y:n,size:r}=this._getLiquidBackPosAndSize(t);i=Cg({x:s,y:n,size:r,symbolType:kZ(null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle",r),fill:!0})}return[i]}}setValueField(t){p(t)&&(this._valueField=t)}getValueField(){return this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._marginSpec=hD(this._spec.outlineMargin),this._paddingSpec=hD(this._spec.outlinePadding),this.setValueField(this._spec.valueField),this._reverse=null!==(t=this._spec.reverse)&&void 0!==t&&t,this._maskShape=null!==(e=this._spec.maskShape)&&void 0!==e?e:"circle"}viewDataUpdate(t){super.viewDataUpdate(t),this._heightRatio=Yt(...this._data.getLatestData().map((t=>t[this._valueField])))}initMark(){this._initLiquidOutlineMark(),this._initLiquidBackgroundMark(),this._initLiquidMark()}initMarkStyle(){this._initLiquidOutlineMarkStyle(),this._initLiquidBackgroundMarkStyle(),this._initLiquidMarkStyle()}_initLiquidOutlineMark(){return this._liquidOutlineMark=this._createMark(MZ.mark.liquidOutline,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidOutlineMark}_initLiquidBackgroundMark(){return this._liquidBackgroundMark=this._createMark(MZ.mark.liquidBackground,{isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidBackgroundMark}_initLiquidMark(){return this._liquidGroupMark=this._createMark(MZ.mark.liquidGroup,{parent:this._liquidBackgroundMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark=this._createMark(MZ.mark.liquid,{parent:this._liquidGroupMark,isSeriesMark:!0,skipBeforeLayouted:!1}),this._liquidMark}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getLiquidBackPosAndSize=this._getLiquidBackPosAndSize,this._markAttributeContext.getLiquidPosY=this._getLiquidPosY,this._markAttributeContext.getLiquidHeight=this._getLiquidHeight}_initLiquidOutlineMarkStyle(){const e=this._liquidOutlineMark;e.created(),this.setMarkStyle(e,{stroke:this.getColorAttribute(),width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath(!0)},"normal",t.AttributeLevel.Series),this._liquidOutlineMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex})}_initLiquidBackgroundMarkStyle(){const e=this._liquidBackgroundMark;e.created(),this.setMarkStyle(e,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,path:()=>this._getLiquidBackPath()},"normal",t.AttributeLevel.Series),this._liquidBackgroundMark.setMarkConfig({interactive:!1,zIndex:this.layoutZIndex,clip:!0})}_initLiquidMarkStyle(){const e=this._liquidMark,i=this._liquidGroupMark;i&&this.setMarkStyle(i,{x:()=>this._region.getLayoutStartPoint().x+this._region.getLayoutRect().width/2,angle:this._reverse?-Math.PI:0,y:0,dy:this._getLiquidPosY}),e&&this.setMarkStyle(e,{y:0,dy:0,height:this._getLiquidHeight,fill:this.getColorAttribute(),wave:0},"normal",t.AttributeLevel.Series)}initTooltip(){this._tooltipHelper=new TZ(this),this._liquidMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._liquidMark)}getInteractionTriggers(){return this._parseInteractionConfig(this._liquidMark?[this._liquidMark]:[])}initAnimation(){var t,e,i,s;const n={height:{from:0,to:()=>this._getLiquidHeight()},dy:{from:()=>{let t=0;const{height:e,startY:i}=this._getLiquidBackPosAndSize();return t=this._reverse?0:e,t+i}}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._liquidMark.setAnimationConfig(xH(null===(i=AD.getAnimationInKey("liquid"))||void 0===i?void 0:i(n,r),SH("liquid",this._spec,this._markAttributeContext))),this._liquidGroupMark.setAnimationConfig(xH(null===(s=AD.getAnimationInKey("liquidGroup"))||void 0===s?void 0:s(n,r),SH("liquidGroup",this._spec,this._markAttributeContext)))}initEvent(){super.initEvent(),this._spec.indicatorSmartInvert&&this._option.getChart().getComponentsByKey("indicator")&&this.event.on(t.ChartEvent.renderFinished,(()=>{this._option.getChart().getComponentsByKey("indicator").forEach((t=>{var e,i,s;const n=null===(e=this._liquidMark.getGraphics()[0].getSubGraphic())||void 0===e?void 0:e[0];let{y1:r,y2:a}=n.globalAABBBounds;r+=this._region.getLayoutStartPoint().y,a+=this._region.getLayoutStartPoint().y,null===(s=null===(i=null==t?void 0:t.getIndicatorComponent())||void 0===i?void 0:i.getChildren()[0])||void 0===s||s.getChildren().forEach((t=>{const{y1:e,y2:i}=t.globalAABBBounds;if(r<e&&a>i){const e=dC(t.attribute.fill,n.attribute.fill);t.setAttribute("fill",e)}}))}))}))}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}valueToPosition(t,e){return null}getStatisticFields(){return[]}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._liquidMark]}}MZ.type=t.SeriesTypeEnum.liquid,MZ.mark=SZ,MZ.builtInTheme={liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}}},MZ.transformerConstructor=oN;const CZ=()=>{fG(),yM(),AD.registerMark(AZ.type,AZ),AD.registerGraphicComponent("area",(t=>ef(t))),oj(),AD.registerAnimation("liquid",((t,e)=>({appear:bZ(t,e),enter:bZ(t,e),exit:bZ(t,e)}))),AD.registerAnimation("liquidGroup",((t,e)=>({appear:xZ(t,e),enter:xZ(t,e),exit:xZ(t,e)}))),AD.registerSeries(MZ.type,MZ)},wZ=t=>Y(t).join(",");class EZ extends eH{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>wZ(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>wZ(null==t?void 0:t[this.series.getDimensionField()[0]])}}const BZ=Object.assign(Object.assign({},pH),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),PZ=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},RZ=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class LZ extends cE{onBind(){var t,e;this.fromCircles={},null===(t=_$(this.target.attribute.arcs))||void 0===t||t.forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},null===(e=_$(this.target.getFinalAttribute().arcs))||void 0===e||e.forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=v$(s);this.target.setAttributes({arcs:n,path:y$(n)})}}class IZ extends EH{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}const OZ=(t,e)=>{const i=e.getViewBox();return i&&(null==t?void 0:t.length)?b$(Object.assign({setField:e.setField,valueField:e.valueField},i),t):[]};class DZ extends BH{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.venn,this.transformerConstructor=IZ,this._viewBox=new Ve}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:ZD)}initData(){var t;super.initData(),qF(this._dataSet,"venn",OZ),null===(t=this._data.getDataView())||void 0===t||t.transform({type:"venn",options:{getViewBox:()=>this._viewBox.empty()?null:{x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2},setField:this._categoryField,valueField:this._valueField}})}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){this._data.getDataView().reRunAllTransform(),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(DZ.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(DZ.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},t.STATE_VALUE_ENUM.STATE_HOVER,t.AttributeLevel.Series))}initLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:t=>t.labelX,y:t=>t.labelY,text:t=>wZ(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}initOverlapLabelMarkStyle(e){e&&(this._labelMark=e,e.setRule("venn"),this.setMarkStyle(e,{x:t=>t.labelX,y:t=>t.labelY,text:t=>wZ(t.sets)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new EZ(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(){super.onLayoutEnd(),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:wZ(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return wZ(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[wZ(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Y(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(wZ(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(xH(null===(e=AD.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),SH(t.name,this._spec,this._markAttributeContext)))}))}}DZ.type=t.SeriesTypeEnum.venn,DZ.mark=BZ,DZ.builtInTheme={venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},DZ.transformerConstructor=IZ;const FZ=()=>{oY(),xW(),AD.registerAnimation("vennCircle",((t,e)=>({appear:PZ(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),AD.registerAnimation("vennOverlap",((t,e)=>({appear:RZ(e),update:{custom:LZ},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),bj(),AD.registerGrammarTransform("vennMark",{transform:x$}),AD.registerSeries(DZ.type,DZ)};class zZ extends JU{constructor(){super(...arguments),this.type=t.SeriesTypeEnum.mosaic,this.transformerConstructor=ZU}get bandWidthField(){return this._bandWidthField}getStack(){return!0}getPercent(){return this._spec.percent}getGroupFields(){return"vertical"===this.direction?this._specXField:this._specYField}setAttrFromSpec(){super.setAttrFromSpec();const t=this.getPercent();"horizontal"===this.direction?(t&&(this.setFieldX(uF),this.setFieldX2(dF)),this.setFieldY(gF),this.setFieldY2(pF)):(t&&(this.setFieldY(uF),this.setFieldY2(dF)),this.setFieldX(gF),this.setFieldX2(pF)),this._spec.bandWidthField&&(this._bandWidthField=this._spec.bandWidthField)}parseLabelStyle(t,e){if((null==e?void 0:e.filterByGroup)&&u(t.dataFilter)){const i=this.getGroupFields(),{field:s,type:n="max",filter:r}=e.filterByGroup;delete t.filterField;const a=i.indexOf(s);if(a<0)return;const o=!!(a%2)?"min"===n?"horizontal"===this.direction?this._fieldY2:this._fieldX2:"horizontal"===this.direction?this._fieldY:this._fieldX:"min"===n?"horizontal"===this.direction?this._fieldX2:this._fieldY2:"horizontal"===this.direction?this._fieldX:this._fieldY,l="min"===n?(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])<(null===(s=e.data)||void 0===s?void 0:s[o])}:(t,e)=>{var i,s;return(null===(i=t.data)||void 0===i?void 0:i[o])>(null===(s=e.data)||void 0===s?void 0:s[o])};t.dataFilter=t=>{const e={};return t.forEach((t=>{const i=t.data,n=null==i?void 0:i[s];u(n)||r&&!r(t)||e[n]&&!l(t,e[n])||(e[n]=t)})),t.filter((t=>{var i;const n=null===(i=t.data)||void 0===i?void 0:i[s];return e[n]&&e[n]===t}))}}return t}}zZ.type=t.SeriesTypeEnum.mosaic,zZ.builtInTheme={mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},zZ.transformerConstructor=ZU;const jZ=()=>{XU(),RG(),bj(),uV(),AD.registerSeries(zZ.type,zZ)};class HZ extends UV{_isValidSeries(e){return e===t.SeriesTypeEnum.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 NZ extends NV{constructor(){super(...arguments),this.transformerConstructor=HZ,this.type="map",this.seriesType=t.SeriesTypeEnum.map}}NZ.type="map",NZ.seriesType=t.SeriesTypeEnum.map,NZ.transformerConstructor=HZ;const VZ=()=>{AU(),IW(),AD.registerChart(NZ.type,NZ)};class UZ extends UV{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Y(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return p(r)&&n.forEach((t=>{u(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t,e){return super._getDefaultSeriesSpec(t,["radius","outerRadius","innerRadius","startAngle","endAngle","sortDataByAxis"],e)}transformSpec(t){super.transformSpec(t),_(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),p(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class WZ extends UZ{needAxes(){return!1}_getDefaultSeriesSpec(t){const 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,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),u(l.type)&&(l.type="linear"),u(o.type)&&(o.type="band");const h=_N(l,{min:0,max:1});u(l.min)&&(l.min=h.min),u(l.max)&&(l.max=h.max),s&&Object.assign(l,SD({},s,l)),n&&Object.assign(o,SD({},n,o))}}class GZ extends UZ{needAxes(){return!0}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.categoryField=t.categoryField||t.angleField,e.valueField=t.valueField||t.radiusField,e}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class YZ extends UZ{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;const 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?void 0:e.emptyCircle,i}}class XZ extends NV{constructor(){super(...arguments),this.transformerConstructor=YZ}}XZ.transformerConstructor=YZ;class $Z extends XZ{constructor(){super(...arguments),this.transformerConstructor=YZ,this.type="pie",this.seriesType=t.SeriesTypeEnum.pie}}$Z.type="pie",$Z.seriesType=t.SeriesTypeEnum.pie,$Z.transformerConstructor=YZ;const KZ=()=>{AU(),pY(),AD.registerChart($Z.type,$Z)};class qZ extends GZ{_getDefaultSeriesSpec(t){var e,i,s;const n=super._getDefaultSeriesSpec(t);return n.radius=null!==(e=t.radius)&&void 0!==e?e:ON,n.outerRadius=null!==(i=t.outerRadius)&&void 0!==i?i:ON,n.innerRadius=null!==(s=t.innerRadius)&&void 0!==s?s:0,n.stack=t.stack,n.percent=t.percent,n}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&u(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Y(t.crosshair||{}).map((t=>SD({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}const ZZ=(t,e)=>{if(!t)return null;const i=$H(t,(t=>"angle"===t.getOrient()),e),s=$H(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&TP(i.type)){const l=i.domain(),h=i.range(),c=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-c.x,y:o-t.getLayoutStartPoint().y-c.y};let p=wO({x:1,y:0},d);p=((t,e)=>{const i=2*Math.PI,s=K(e),n=$(e);return t<s?t+=Math.ceil((s-t)/i)*i:t>n&&(t-=Math.ceil((t-n)/i)*i),t})(p,h);const g=EO(d),f=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==f?void 0:f.range();if((p-(null==h?void 0:h[0]))*(p-(null==h?void 0:h[1]))>0||(g-(null==m?void 0:m[0]))*(g-(null==m?void 0:m[1]))>0)return;const v=t.invert(p);if(u(v))return;let y=l.findIndex((t=>(null==t?void 0:t.toString())===v.toString()));y<0&&(y=void 0);const _=YH(v,t,"polar",r);n.push({index:y,value:v,position:i.scale(v),axis:t,data:_})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&TP(s.type)){const h=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let d=wO({x:1,y:0},c);d<-Math.PI/2&&(d=2*Math.PI+d);const p=EO(c),g=null===(e=i[0])||void 0===e?void 0:e.getScale(),f=null==g?void 0:g.range();if((d-(null==f?void 0:f[0]))*(d-(null==f?void 0:f[1]))>0||(p-(null==l?void 0:l[0]))*(p-(null==l?void 0:l[1]))>0)return;const m=s.invert(p);if(u(m))return;let v=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));v<0&&(v=void 0);const y=YH(m,t,"polar",r);n.push({index:v,value:m,position:s.scale(m),axis:t,data:y})}})),n.length?n:null};class JZ extends NV{constructor(){super(...arguments),this.transformerConstructor=qZ,this.type="rose",this.seriesType=t.SeriesTypeEnum.rose}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}JZ.type="rose",JZ.seriesType=t.SeriesTypeEnum.rose,JZ.transformerConstructor=qZ,G(JZ,$V);const QZ=()=>{xU(),AU(),JV(),ZV(),RY(),AD.registerChart(JZ.type,JZ)};class tJ extends GZ{_getDefaultSeriesSpec(t){var e;const i=super._getDefaultSeriesSpec(t);return i.line=t.line,i.point=t.point,i.stack=t.stack,i.percent=t.percent,i.area=SD({visible:!1},t.area),i.seriesMark=null!==(e=t.seriesMark)&&void 0!==e?e:"area",i.activePoint=t.activePoint,i.pointDis=t.pointDis,i.pointDisMul=t.pointDisMul,i.markOverlap=t.markOverlap,i}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Y(t.crosshair||{}).map((t=>SD({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class eJ extends NV{constructor(){super(...arguments),this.transformerConstructor=tJ,this.type="radar",this.seriesType=t.SeriesTypeEnum.radar}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}eJ.type="radar",eJ.seriesType=t.SeriesTypeEnum.radar,eJ.transformerConstructor=tJ,G(eJ,$V);const iJ=()=>{xU(),AU(),TU(),JV(),ZV(),NY(),AD.registerChart(eJ.type,eJ)};class sJ extends UV{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=g(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{R(e,"trimPadding")&&SD(e,Az(this.type,t))})),this._transformAxisSpec(t)}}class nJ extends NV{constructor(){super(...arguments),this.transformerConstructor=sJ,this.type="common"}_setModelOption(){this._modelOption.getDimensionInfo=(t,e,i)=>{var s,n;return[...null!==(s=nU(t,e,i))&&void 0!==s?s:[],...null!==(n=ZZ(t,e))&&void 0!==n?n:[]]},this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}nJ.type="common",nJ.transformerConstructor=sJ,G(nJ,$V);const rJ=()=>{xU(),AU(),TU(),JV(),AD.registerChart(nJ.type,nJ),ZV()};class aJ extends UV{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Y(e.data)[0];return t instanceof Ba?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Y(t.data).find(((t,i)=>e.dataId?t instanceof Ba?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof Ba?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(e){var i,s,n,r,a,o,l,h,c,d,u,p,g,f,m;super.transformSpec(e);let v=0;const y=[],_=[],b=[],x=[],S=[],A=this._option.getCompiler().getStage(),k=(A.viewWidth,A.viewHeight);let T=0;if(null==e?void 0:e.legends){y.push({modelId:`legendRow${v}`,col:1,row:v}),this.addAttrToComponentSpec(e.legends,"id",`legendRow${v}`);const t=Y(e.legends);let l=null!==(i=t[0].height)&&void 0!==i?i:40;if(t[0].padding){const e=hD(t[0].padding);l+=Number(null!==(s=null==e?void 0:e.bottom)&&void 0!==s?s:0),l+=Number(null!==(n=null==e?void 0:e.top)&&void 0!==n?n:0),t[0].offsetY=Number(null!==(a=null===(r=t[0])||void 0===r?void 0:r.offsetY)&&void 0!==a?a:0)+Number(null!==(o=null==e?void 0:e.top)&&void 0!==o?o:0)}S.push({index:v,size:l}),T+=l,v++}(null==e?void 0:e.dataZoom)&&(y.push({modelId:`dataZoomRow${v}`,col:1,row:v}),this.addAttrToComponentSpec(e.dataZoom,"id",`dataZoomRow${v}`),T+=60,v++,this.addPaddingRow(S,v,10),T+=10,v++),T+=60,null!==e.axes&&"top"!==(null===(h=null===(l=null==e?void 0:e.axes)||void 0===l?void 0:l[0])||void 0===h?void 0:h.orient)||(this.addOrientAxes(_,y,v,e),v++);const M=e.series.filter((e=>e.type!==t.SeriesTypeEnum.link)).length,C=(k-T-20*M)/M,w=(null===(c=null==e?void 0:e.appendPadding)||void 0===c?void 0:c.left)||0,E=(null===(d=null==e?void 0:e.appendPadding)||void 0===d?void 0:d.right)||0;null===(u=null==e?void 0:e.series)||void 0===u||u.forEach((i=>{var s,n;if([t.SeriesTypeEnum.bar,t.SeriesTypeEnum.line,t.SeriesTypeEnum.area,t.SeriesTypeEnum.dot].includes(i.type)){if(y.push({modelId:`${i.type}Row${v}`,col:1,row:v}),y.push({modelId:`axesLeftRow${v}`,col:0,row:v}),_.push({id:`${i.type}Row${v}`,clip:!1}),S.push({index:v,size:(null==i?void 0:i.height)||C}),b.push({orient:"left",id:`axesLeftRow${v}`,type:i.type===t.SeriesTypeEnum.dot?"band":"linear",visible:i.type!==t.SeriesTypeEnum.dot,title:{visible:!0,autoRotate:!1,style:{text:null==i?void 0:i.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(s=null==i?void 0:i.grid)||void 0===s?void 0:s.visible)||(null===(n=null==i?void 0:i.grid)||void 0===n?void 0:n.visible),style:(t,e)=>{var s,n,r,a,o;let l=0;if(0===e){const t=null===(s=null==i?void 0:i.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==i?void 0:i.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:_.length-1}),i.type===t.SeriesTypeEnum.dot){y.push({modelId:`scrollBarRightRow${v}`,col:2,row:v});const s=this._getSeriesDataLength(e,i);let n=0;s&&(n=((null==i?void 0:i.height)||C)/(30*s)),x.push(Object.assign({orient:"right",visible:i.type===t.SeriesTypeEnum.dot&&n<1,id:`scrollBarRightRow${v}`,start:0,end:Math.min(n,1),filterMode:"axis",regionIndex:_.length-1,axisId:`axesLeftRow${v}`},Y(null==e?void 0:e.scrollBar)[0]))}i.regionIndex=_.length-1,v++,this.addPaddingRow(S,v,(null==i?void 0:i.padding)||20),v++,i.leftAppendPadding=w,i.type===t.SeriesTypeEnum.dot&&(i.title.style.dx=-w,i.subTitle.style.dx=-w)}})),this.addPaddingRow(S,v,20),v++,null===(p=null==e?void 0:e.series)||void 0===p||p.forEach((i=>{if(i.type===t.SeriesTypeEnum.link){const t=i.dotSeriesIndex+1;y.push({modelId:`${i.type}Row${t}`,col:1,row:t-1}),i.regionIndex=e.series[i.dotSeriesIndex].regionIndex,i.leftAppendPadding=w,i.height=e.series[i.dotSeriesIndex].height,i.clipHeight=e.series[i.dotSeriesIndex].clipHeight}})),(null==e?void 0:e.legends)&&this.addAttrToComponentSpec(e.legends,"regionIndex",[_.length-1]),"bottom"===(null===(f=null===(g=null==e?void 0:e.axes)||void 0===g?void 0:g[0])||void 0===f?void 0:f.orient)&&(this.addOrientAxes(_,y,v,e),v++);const B={type:"grid",col:4,row:v,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:E}],rowHeight:S,elements:y};e.layout=B,e.region=_,null===(m=e.axes)||void 0===m||m.push(...b),e.scrollBar=x}}class oJ extends NV{constructor(){super(...arguments),this.transformerConstructor=aJ,this.type="sequence"}_createSeries(i,s){if(!i)return;const{spec:n}=s,r=e(s,["spec"]);let a;if(n.type===t.SeriesTypeEnum.link&&(n.dotSeriesSpec=this._spec.series[n.dotSeriesIndex]),n.regionId&&(a=this.getRegionsInUserId(n.regionId)),a||(a=this.getRegionsInIndex(n.regionIndex?[n.regionIndex]:void 0)[0]),!a)return;const o=new i(n,Object.assign(Object.assign(Object.assign({},this._modelOption),r),{region:a,specKey:"series",globalScale:this._globalScale}));o&&(o.created(),this._series.push(o),a.addSeries(o))}}oJ.type="sequence",oJ.transformerConstructor=aJ;const lJ=()=>{xU(),AU(),XY(),JY(),mV(),uV(),AD.registerChart(oJ.type,oJ)};class hJ extends WV{transformSpec(t){super.transformSpec(t),t.axes.forEach((t=>t.type="linear"))}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["x2Field","y2Field","barMinHeight","barBackground","barGap"])}}class cJ extends NV{constructor(){super(...arguments),this.transformerConstructor=hJ}}cJ.transformerConstructor=hJ,G(cJ,$V);class dJ extends hJ{transformSpec(t){super.transformSpec(t),bz(t)}}class uJ extends cJ{constructor(){super(...arguments),this.transformerConstructor=dJ,this.type="histogram",this.seriesType=t.SeriesTypeEnum.bar}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}uJ.type="histogram",uJ.seriesType=t.SeriesTypeEnum.bar,uJ.transformerConstructor=dJ;const pJ=()=>{xU(),AU(),TU(),JV(),ZV(),QU(),AD.registerChart(uJ.type,uJ)};class gJ extends WZ{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return s.progress=t.progress,s.track=t.track,s.tickMask=t.tickMask,s.cornerRadius=null!==(e=t.cornerRadius)&&void 0!==e?e:0,s.roundCap=null!==(i=t.roundCap)&&void 0!==i&&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 fJ extends NV{constructor(){super(...arguments),this.transformerConstructor=gJ,this.type="circularProgress",this.seriesType=t.SeriesTypeEnum.circularProgress}_setModelOption(){this._modelOption.getDimensionInfo=ZZ}}fJ.type="circularProgress",fJ.seriesType=t.SeriesTypeEnum.circularProgress,fJ.transformerConstructor=gJ,G(fJ,$V);const mJ=()=>{xU(),AU(),JV(),ZV(),oX(),AD.registerChart(fJ.type,fJ)};class vJ extends WZ{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.radiusField=t.radiusField,e.pin=t.pin,e.pinBackground=t.pinBackground,e.pointer=t.pointer,e}_getDefaultCircularProgressSeriesSpec(e){const i=super._getDefaultSeriesSpec(e);return i.type=t.SeriesTypeEnum.circularProgress,i}transformSpec(e){var i,s,n,r,a;super.transformSpec(e);let o=null===(i=e.series)||void 0===i?void 0:i.find((e=>e.type===t.SeriesTypeEnum.gauge||e.type===t.SeriesTypeEnum.circularProgress));u(o)&&(o=null!==(s=e.gauge)&&void 0!==s?s:this._getDefaultCircularProgressSeriesSpec(e),"circularProgress"===o.type&&(u(o.radiusField)&&u(o.categoryField)&&(o.radiusField=null!==(r=null!==(n=e.radiusField)&&void 0!==n?n:e.categoryField)&&void 0!==r?r:e.seriesField),u(o.valueField)&&u(o.angleField)&&(o.valueField=null!==(a=e.valueField)&&void 0!==a?a:e.angleField)),1===e.series.length?e.series.push(o):e.series.forEach((t=>{t.type===o.type&&Object.keys(o).forEach((e=>{e in t||(t[e]=o[e])}))}))),o.type===t.SeriesTypeEnum.circularProgress?this._transformProgressAxisSpec(e,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:t.LayoutZIndex.Region+50}):this._transformGaugeAxisSpec(e)}_transformGaugeAxisSpec(e){var i;e.axes||(e.axes=[]);const s={radius:null,angle:null};(null!==(i=e.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(s.radius=t),"angle"===e&&(s.angle=t)})),s.angle||(s.angle={orient:"angle",visible:!0},e.axes.push(s.angle)),s.radius||(s.radius={orient:"radius",visible:!1},e.axes.push(s.radius)),u(s.angle.type)&&(s.angle.type="linear"),u(s.radius.type)&&(s.radius.type="linear"),u(s.angle.zIndex)&&(s.angle.zIndex=t.LayoutZIndex.Region+50)}}class yJ extends NV{constructor(){super(...arguments),this.transformerConstructor=vJ,this.type="gauge",this.seriesType=t.SeriesTypeEnum.gaugePointer}}yJ.type="gauge",yJ.seriesType=t.SeriesTypeEnum.gaugePointer,yJ.transformerConstructor=vJ;const _J=()=>{AU(),Yq(),Kq(),oX(),AD.registerChart(yJ.type,yJ)};class bJ extends UV{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 xJ extends NV{constructor(){super(...arguments),this.transformerConstructor=bJ,this.type="wordCloud",this.seriesType=t.SeriesTypeEnum.wordCloud}}xJ.transformerConstructor=bJ;class SJ extends xJ{constructor(){super(...arguments),this.transformerConstructor=bJ,this.type="wordCloud",this.seriesType=t.SeriesTypeEnum.wordCloud}}SJ.type="wordCloud",SJ.seriesType=t.SeriesTypeEnum.wordCloud,SJ.transformerConstructor=bJ;const AJ=()=>{AU(),vK(),AD.registerChart(SJ.type,SJ)},kJ=()=>{AD.registerGrammarTransform("wordcloudShape",{transform:fK}),vK(),AJ()};class TJ extends UV{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 MJ extends NV{constructor(){super(...arguments),this.transformerConstructor=TJ,this.type="funnel",this.seriesType=t.SeriesTypeEnum.funnel}}MJ.type="funnel",MJ.seriesType=t.SeriesTypeEnum.funnel,MJ.transformerConstructor=TJ;const CJ=()=>{AU(),FK(),AD.registerChart(MJ.type,MJ)};class wJ extends WV{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bandWidth","progress","track","clamp"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"horizontal",s.cornerRadius=null!==(i=t.cornerRadius)&&void 0!==i?i:0,s}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="band"),u(i.type)&&(i.type="linear");const n=_N(i,{min:0,max:1});u(i.min)&&(i.min=n.min),u(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),u(s.type)&&(s.type="linear"),u(e.type)&&(e.type="band");const n=_N(s,{min:0,max:1});u(s.min)&&(s.min=n.min),u(s.max)&&(s.max=n.max)}}}class EJ extends NV{constructor(){super(...arguments),this.transformerConstructor=wJ,this.type="linearProgress",this.seriesType=t.SeriesTypeEnum.linearProgress}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}EJ.type="linearProgress",EJ.seriesType=t.SeriesTypeEnum.linearProgress,EJ.transformerConstructor=wJ,G(EJ,$V);const BJ=()=>{xU(),AU(),JV(),ZV(),fX(),AD.registerChart(EJ.type,EJ)};class PJ extends WV{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),bz(t)}}class RJ extends NV{constructor(){super(...arguments),this.transformerConstructor=PJ,this.type="rangeColumn",this.seriesType=t.SeriesTypeEnum.rangeColumn}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}RJ.type="rangeColumn",RJ.seriesType=t.SeriesTypeEnum.rangeColumn,RJ.transformerConstructor=PJ;const LJ=()=>{xU(),AU(),JV(),ZV(),NG(),AD.registerChart(RJ.type,RJ)};class IJ extends UV{_getDefaultSeriesSpec(t){const e=p(t.startAngle)?t.startAngle:-90,i=p(t.endAngle)?t.endAngle:e+le(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 OJ extends NV{constructor(){super(...arguments),this.transformerConstructor=IJ,this.type="sunburst",this.seriesType=t.SeriesTypeEnum.sunburst}}OJ.type="sunburst",OJ.seriesType=t.SeriesTypeEnum.sunburst,OJ.transformerConstructor=IJ;const DJ=()=>{AU(),eq(),AD.registerChart(OJ.type,OJ)};class FJ extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","layoutPadding","circlePacking","drill","drillField"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class zJ extends NV{constructor(){super(...arguments),this.transformerConstructor=FJ,this.type="circlePacking",this.seriesType=t.SeriesTypeEnum.circlePacking}}zJ.type="circlePacking",zJ.seriesType=t.SeriesTypeEnum.circlePacking,zJ.transformerConstructor=FJ;const jJ=()=>{AU(),oq(),AD.registerChart(zJ.type,zJ)};class HJ extends UV{_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 NJ extends NV{constructor(){super(...arguments),this.transformerConstructor=HJ,this.type="treemap",this.seriesType=t.SeriesTypeEnum.treemap}}NJ.type="treemap",NJ.seriesType=t.SeriesTypeEnum.treemap,NJ.transformerConstructor=HJ;const VJ=()=>{AU(),Dq(),AD.registerChart(NJ.type,NJ)};class UJ extends tW{transformSpec(t){super.transformSpec(t),t.legends&&Y(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),bz(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.bar=t.bar,e.stackLabel=t.stackLabel,e.leaderLine=t.leaderLine,e.total=t.total,e}}class WJ extends eW{constructor(){super(...arguments),this.transformerConstructor=UJ,this.type="waterfall",this.seriesType=t.SeriesTypeEnum.waterfall}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}WJ.type="waterfall",WJ.seriesType=t.SeriesTypeEnum.waterfall,WJ.transformerConstructor=UJ;const GJ=()=>{xU(),AU(),TU(),JV(),ZV(),hG(),AD.registerChart(WJ.type,WJ)};class YJ extends WV{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=super._getDefaultSeriesSpec(t,["boxPlot","minField","maxField","q1Field","medianField","q3Field","outliersField","outliersStyle"]);return s.direction=null!==(e=t.direction)&&void 0!==e?e:"vertical",s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),bz(t)}}class XJ extends NV{constructor(){super(...arguments),this.transformerConstructor=YJ,this.type="boxPlot",this.seriesType=t.SeriesTypeEnum.boxPlot}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}XJ.type="boxPlot",XJ.seriesType=t.SeriesTypeEnum.boxPlot,XJ.transformerConstructor=YJ;const $J=()=>{xU(),AU(),JV(),ZV(),BG(),AD.registerChart(XJ.type,XJ)};class KJ extends UV{_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)}}class qJ extends NV{constructor(){super(...arguments),this.transformerConstructor=KJ,this.type="sankey",this.seriesType=t.SeriesTypeEnum.sankey}_setStateInDatum(t,e,i,s){const n=_(e)?e[0]:e;if(!n)return void this._interaction.clearByState(t);let r=null;this.filterGraphicsByDatum(n,{filter:(t,e)=>"text"!==e.type&&e.getProduct()&&(!i||i(t,e)),region:s,getDatum:t=>{var e;let i=null===(e=FF(t))||void 0===e?void 0:e.datum;return _(i)&&(i=i[0]),i},callback:(t,e,i,s)=>{var n,r;const a=e.getProductId();a&&(a.includes("node")||a.includes("link"))&&(null===(r=(n=i)._handleEmphasisElement)||void 0===r||r.call(n,{item:t,mark:e}))},regionCallback:(t,e)=>{n&&t.length&&(r=t[0])}}),r&&this._interaction.updateStateOfGraphics(t,[r])}}qJ.type="sankey",qJ.seriesType=t.SeriesTypeEnum.sankey,qJ.transformerConstructor=KJ;const ZJ=()=>{AU(),Lh.load(nC),Mq(),AD.registerChart(qJ.type,qJ)};class JJ extends WV{_getDefaultSeriesSpec(t){var e,i;const 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)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),bz(t)}}class QJ extends NV{constructor(){super(...arguments),this.transformerConstructor=JJ,this.type="rangeArea",this.seriesType=t.SeriesTypeEnum.rangeArea}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}QJ.type="rangeArea",QJ.seriesType=t.SeriesTypeEnum.rangeArea,QJ.transformerConstructor=JJ;const tQ=()=>{xU(),AU(),TU(),JV(),ZV(),XG(),AD.registerChart(QJ.type,QJ)};class eQ extends WV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","cell"])}}class iQ extends NV{constructor(){super(...arguments),this.transformerConstructor=eQ,this.type="heatmap",this.seriesType=t.SeriesTypeEnum.heatmap}}iQ.type="heatmap",iQ.seriesType=t.SeriesTypeEnum.heatmap,iQ.transformerConstructor=eQ;const sQ=()=>{AU(),iZ(),AD.registerChart(iQ.type,iQ)};class nQ extends UV{_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 rQ extends NV{constructor(){super(...arguments),this.transformerConstructor=nQ,this.type="correlation",this.seriesType=t.SeriesTypeEnum.correlation}}rQ.type="correlation",rQ.seriesType=t.SeriesTypeEnum.correlation,rQ.transformerConstructor=nQ;const aQ=()=>{AU(),mZ(),AD.registerChart(rQ.type,rQ)};function oQ(t){var e,i;const s=Object.assign({},t);return P(t.style)||(s.textStyle=OF(t.style)),P(t.textStyle)||SD(s.textStyle,OF(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&OF(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&OF(s.background.style),s}const lQ=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},hQ=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l,customFilter:h}=e,c=a(),d=l();if(0===c.length&&d.length)return[];if(c.length===d.length)return t;const u={};c.forEach((t=>{u[t]=!0}));const g=null!==(i=o())&&void 0!==i?i:JD;return h?h(t,c,g):(_(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===u[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===u[t.source]&&!0===u[t.target])))):p(g)&&(t=t.filter((t=>!0===u[r.getSeriesFieldValue(t,g)]))),t)};class cQ extends NN{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=t.LayoutZIndex.Legend,this.layoutLevel=t.LayoutLevel.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{PO(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),PO(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=sD(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;p(s)&&(this._seriesUserId=Y(s)),p(e)&&(this._regionUserId=Y(e)),p(n)&&(this._seriesIndex=Y(n)),p(i)&&(this._regionUserIndex=Y(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(U(e,t)||(i.reCompile=!0),i)}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData(),this._forceLayout()}initData(){const e=this._initLegendData();e.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new Qz(this._option,e),this._initSelectedData(),PO(this._regions,(e=>{e.event.on(t.ChartEvent.rawDataUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===e.id},(()=>{this._legendData.getDataView().reRunAllTransform({skipEqual:!0})}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(e){var i,s,n;const r=this._selectedData;u(e)||JSON.stringify(r)===JSON.stringify(e)||(PO(this._regions,(t=>{t.legendSelectedFilter&&(e=t.legendSelectedFilter(this,e))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...e],null===(s=(i=this.effect).onSelectedDataChange)||void 0===s||s.call(i),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this}),null===(n=this._legendComponent)||void 0===n||n.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;k(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)U(s,this._cacheAttrs)||this._legendComponent.setAttributes(SD({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(SD({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t;this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());U(t,this._cacheAttrs)||this._legendComponent.setAttributes(SD({},t,{defaultSelected:this._selectedData}))}null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(t.ChartEvent.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}cQ.specKey="legends";class dQ extends cQ{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return Yj(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(e){super.init(e),PO(this._regions,(e=>{e.addViewDataFilter({type:"discreteLegendFilter",options:{series:e,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(e),data:()=>this.getLegendDefaultData(),customFilter:this._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){qF(this._option.dataSet,"discreteLegendFilter",hQ),qF(this._option.dataSet,"discreteLegendDataMake",lQ);const t=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return PO(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(u(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!ib(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return d(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=bF(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const i="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",s=Object.assign(Object.assign({layout:i,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,i){const{title:s={},item:n={},pager:r={},background:a={},type:o,id:l,visible:h,orient:c,position:d,data:u,filter:g,regionId:f,regionIndex:m,seriesIndex:v,seriesId:y,padding:_}=t,b=e(t,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return s.visible?b.title=oQ(s):b.title={visible:!1},P(n.focusIconStyle)||OF(n.focusIconStyle),n.shape&&(n.shape=RF(n.shape)),n.label&&(n.label=RF(n.label)),n.value&&(n.value=RF(n.value)),n.background&&(n.background=RF(n.background)),nD(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*i.width/100),nD(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*i.width/100),nD(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*i.width/100),b.item=n,"scrollbar"===r.type?(P(r.railStyle)||OF(r.railStyle),P(r.sliderStyle)||OF(r.sliderStyle)):(P(r.textStyle)||OF(r.textStyle),r.handler&&RF(r.handler)),b.pager=r,a.visible&&!P(a.style)&&(SD(b,a.style),p(a.padding)&&(b.padding=a.padding)),b}(this._spec,t)),{maxWidth:t.width,maxHeight:t.height});return this._addDefaultTitleText(s),this._addLegendItemFormatMethods(s),s}_getLegendConstructor(){return jI}setSelectedData(t){t&&(this._unselectedData=this.getLegendDefaultData().filter((e=>!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const e=!1!==this._spec.filter;this._legendComponent.addEventListener(RI.legendItemClick,(i=>{const s=R(i,"detail.currentSelected");e&&this.setSelectedData(s),this.event.emit(t.ChartEvent.legendItemClick,{model:this,value:s,event:i})})),this._legendComponent.addEventListener(RI.legendItemHover,(e=>{const i=R(e,"detail");this.event.emit(t.ChartEvent.legendItemHover,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(RI.legendItemUnHover,(e=>{const i=R(e,"detail");this.event.emit(t.ChartEvent.legendItemUnHover,{model:this,value:i,event:e})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:k(s)?s:1,strokeOpacity:k(n)?n:1,opacity:k(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return d(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=Gj(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:c}=Gj(o,l);l&&!o&&c&&(t.item.value.formatMethod=(t,e)=>c(l,t,e,a))}}dQ.specKey="legends",dQ.builtInTheme={discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1}},dQ.type=r.discreteLegend;const uQ=()=>{AD.registerComponent(dQ.type,dQ)},pQ=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;k(n)&&(t=Math.min(n,t)),k(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},gQ=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r,customFilter:a}=e,o=i(),l=s(),h=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!g(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(o===n())return t;if(l&&!P(o)){const[e,i]=o;return a?a(t,o,l):h(t)?PF(t,+e,+i,l):t.filter((t=>t[l]>=e&&t[l]<=i))}return t};const fQ={color:WI,size:YI},mQ={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}},vQ=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},mQ),{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"}}}})},yQ={horizontal:vQ(!0),vertical:vQ(!1)},_Q=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},mQ),{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"}}}})},bQ={horizontal:_Q(!0),vertical:_Q(!1)},xQ=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],SQ=[2,10];class AQ extends cQ{static getSpecInfo(t){const e=Yj(t,this.specKey,this.type,(t=>function(t){return"color"===t||"size"===t}(t.type)));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(e){super.init(e),PO(this._regions,(e=>{e.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:e.isHierarchyData,customFilter:this._spec.customFilter},level:t.TransformLevel.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){qF(this._option.dataSet,"continuousLegendFilter",gQ),qF(this._option.dataSet,"continuousLegendDataMake",pQ);const t=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>RO(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&u(t.title.text)&&u(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=bF(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!ib(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=bF(this._option.dataSet.getDataView(a.dataId),a.fields[0])}else;}_getLegendAttributes(t){var i,s;const n="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",r="horizontal"===n?"bottom":this.layoutOrient;let a=[];const o=this._getScaleInGlobal();o&&"linear"===o.type&&(a=o.range()),P(a)&&(a="color"===this._legendType?xQ:SQ);let l=null!==(i=this._legendData.getLatestData()[0])&&void 0!==i?i:0,h=null!==(s=this._legendData.getLatestData()[1])&&void 0!==s?s:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(l=Math.min(0,this._legendData.getLatestData()[0]),h=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const c=Object.assign({layout:n,align:r,zIndex:this.layoutZIndex,min:l,max:h,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:a},function(t){const i=SD({},t),{title:s={},handler:n={},rail:r={},track:a={},startText:o,endText:l,handlerText:h,sizeBackground:c,background:d={},type:u,id:g,visible:f,orient:m,position:v,data:y,defaultSelected:_,field:b,filter:x,regionId:S,regionIndex:A,seriesIndex:k,seriesId:T,padding:M}=i,C=e(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return s.visible?C.title=oQ(s):C.title={visible:!1},C.showHandler=!1!==n.visible,P(n.style)||(C.handlerStyle=OF(n.style)),p(r.width)&&(C.railWidth=r.width),p(r.height)&&(C.railHeight=r.height),P(r.style)||(C.railStyle=OF(r.style)),P(a.style)||(C.trackStyle=OF(a.style)),C.startText=RF(o),C.endText=RF(l),C.handlerText=RF(h),P(c)||(C.sizeBackground=OF(c)),d.visible&&!P(d.style)&&(SD(C,d.style),p(d.padding)&&(C.padding=d.padding)),C}(this._spec));return this._addDefaultTitleText(c),c}_getLegendConstructor(){return fQ[this._legendType]}_initEvent(){if(this._legendComponent){const e=!1!==this._spec.filter;this._legendComponent.addEventListener("change",xt((i=>{const s=R(i,"detail.value");e&&this.setSelectedData(s),this.event.emit(t.ChartEvent.legendFilter,{model:this,value:s,event:i})}),30))}}}AQ.specKey="legends",AQ.builtInTheme={colorLegend:yQ,sizeLegend:bQ},AQ.type=r.continuousLegend;const kQ=()=>{AD.registerComponent(AQ.type,AQ)},TQ=(t,e)=>p(e)?t.map((t=>e[t])):void 0,MQ=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),CQ=t=>!u(t)&&(_(t)?t.length>0&&t.every(p):Object.keys(t).length>0);function wQ(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(p(a.regionId)?[a.regionId]:void 0,p(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=EQ(t,l),c=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",d=l.getLayoutStartPoint(),g=l.getLayoutRect(),f=o.globalInstance.getContainer(),m=Object.assign({x:0,y:0},f?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(f):{}),v=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>MQ(i,s)(t)&&MQ(n,r)(t)&&(u(a)||MQ([a],[o])(t))));return l},y=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),g.width),y:Math.min(Math.max(t.y,0),g.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:d.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:d.y+s.y;return{canvasX:n,canvasY:r,clientX:m.x+n,clientY:m.y+r}};if("dimension"===c){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>v(t))))&&void 0!==i?i:[]}}))}];p(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:WF.chart,event:y({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return Hj.globalConfig.uniqueTooltip&&Hj.hideTooltip(l.id),c}if("mark"===c){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},v(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:WF.chart,event:y(e.pos),item:void 0};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return Hj.globalConfig.uniqueTooltip&&Hj.hideTooltip(l.id),c}return"none"}const EQ=(e,i)=>{const s=i.getSeries(),n=[];return s.forEach((i=>{var s,r,a,o,l,h,c;const d=i.getDimensionField(),g=i.getMeasureField(),f=i.getSeriesField(),m=p(f)?e[f]:void 0,v=p(f)&&null!==(o=null===(a=null===(r=null===(s=i.getViewDataStatistics)||void 0===s?void 0:s.call(i))||void 0===r?void 0:r.latestData[f])||void 0===a?void 0:a.values)&&void 0!==o?o:[],y=TQ(d,e);let _=TQ(g,e);const b=CQ(_),x=!b&&p(f)&&u(m)&&v.length>0,S=()=>{var e;const s=null===(e=i.getViewData())||void 0===e?void 0:e.latestData.find(MQ(d,y));if(!b&&(_=TQ(g,s),!CQ(_)))return;const r=i.type===t.SeriesTypeEnum.pie?i.dataToCentralPosition(s):i.dataToPosition(s);u(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:d,dimensionData:y,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:m},series:i})};if("cartesian"===i.coordinate){const t=i,e=TP(null===(h=null===(l=i.getYAxisHelper())||void 0===l?void 0:l.getScale(0))||void 0===h?void 0:h.type)?"y":"x",s=d.map(((t,e)=>[t,e])).filter((([,t])=>u(null==y?void 0:y[t])));let r=[null!=y?y:[]];s.length>0&&s.forEach((([t,e])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=i.getViewDataStatistics)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((i=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[e]=i,h.push(n)}))})),r=h})),r.forEach((s=>{var r,a;if(x){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(MQ(d,s));v.forEach((r=>{const o=a.find((t=>t[f]===r));if(_=TQ(g,o),!CQ(_))return;const l=t.dataToPosition(o);u(l)||isNaN(l.x)||isNaN(l.y)||n.push({pos:l,data:{dimensionFields:d,dimensionData:s,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:r},series:i,dimType:e})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(MQ(d,s));if(!b&&(_=TQ(g,r),!CQ(_)))return;const o=t.dataToPosition(r);if(u(o)||isNaN(o.x)||isNaN(o.y))return;n.push({pos:o,data:{dimensionFields:d,dimensionData:s,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:m},dimType:e,series:i})}}))}else if("polar"===i.coordinate)if(i.type===t.SeriesTypeEnum.pie)S();else{const t=i;if(x){const e=(null===(c=t.getViewData())||void 0===c?void 0:c.latestData.filter(MQ(d,y))).find((t=>t[f]===m));v.forEach((s=>{if(_=TQ(g,e),!CQ(_))return;const r=t.dataToPosition(e);u(r)||isNaN(r.x)||isNaN(r.y)||n.push({pos:r,data:{dimensionFields:d,dimensionData:y,measureFields:g,measureData:_,hasMeasureData:b,groupField:f,groupData:s},series:i})}))}else S()}else"geo"===i.coordinate&&S()})),n},BQ=t=>p(t)&&!_(t),PQ=t=>p(t)&&_(t);class RQ extends HN{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i,s,n;const{spec:r,theme:a}=super._initTheme(t,e);return r.style=SD({},this._theme,r.style),r.offset=SD({},a.offset,t.offset),r.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:a.transitionDuration,r.trigger=null!==(s=t.trigger)&&void 0!==s?s:a.trigger,r.triggerOff=null!==(n=t.triggerOff)&&void 0!==n?n:a.triggerOff,{spec:r,theme:a}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return p(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:J_(this._option.mode)||!q_(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.confine=null!==(h=t.confine)&&void 0!==h?h:"canvas"===t.renderMode,p(t.parentElement)?y(t.parentElement)&&(t.parentElement=Ay.getElementById(t.parentElement)):q_(this._option.mode)&&(t.parentElement=null==K_?void 0:K_.body)}}const LQ={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}};class IQ extends NN{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=RQ,this.specKey="tooltip",this.layoutType="none",this._isReleased=!1,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?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return;this._clickLock=!0}},this._getMouseOutHandler=t=>e=>{var i,s,n,r,a;if(this._isReleased)return;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const o=q_(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:l,clientY:h}=e.event;o&&t&&this._isPointerInChart({x:l,y:h})||(this._enterable?this._outTimer=setTimeout((()=>{this._handleChartMouseOut(e)}),null!==(a=null===(r=this._spec)||void 0===r?void 0:r.showDelay)&&void 0!==a?a:50):this._handleChartMouseOut(e))},this._handleChartMouseOut=t=>{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,n,r;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?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i))?(this._showTimer&&clearTimeout(this._showTimer),this._showTimer=setTimeout((()=>{this._handleChartMouseMove(e,t)}),null!==(r=null===(n=this._spec)||void 0===n?void 0:n.showDelay)&&void 0!==r?r:50)):this._handleChartMouseMove(e,t)))},this._handleChartMouseMove=(t,e)=>{if(this._isReleased)return;const i=this._getMouseEventData(t),{tooltipInfo:{dimension:s},ignore:{mark:n}}=i,r={mark:!1,dimension:!1,group:!1},a=["group","mark","dimension"];for(let s=0,n=a.length;s<n;s++){const n=a[s];if(!!this.processor[n]&&this._showTooltipByMouseEvent(n,i,t,e)){r[n]=!0;break}}Object.values(r).every((t=>!t))&&!function(t){return u(t.mark)&&u(t.model)&&u(t.datum)}(t)&&(n&&BQ(this._cacheInfo)?r.mark=this._showTooltipByMouseEvent("mark",i,t,e,!0):p(s)&&(r.dimension=this._showTooltipByMouseEvent("dimension",i,t,e))),r.mark||r.group||r.dimension&&!u(s)?this._initEventOfTooltipContent():this._handleChartMouseOut(t)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._hideTimer&&clearTimeout(this._hideTimer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._hideTimer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&Hj.globalConfig.uniqueTooltip&&l&&Hj.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=e=>{var i,s,n;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return 0;this.event.emit(t.ChartEvent.tooltipHide,Object.assign(Object.assign({},e),{source:WF.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const r=null!==(n=this._spec.handler)&&void 0!==n?n:this.tooltipHandler;if(r.hideTooltip){const t=r.hideTooltip.call(r,e);return t||(this._isTooltipShown=!1),t}return 1},this.hideTooltip=()=>{if(this._isReleased)return!1;const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:WF.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?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(t.ChartEvent.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(t.ChartEvent.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n,this._enterable=!1;else{const t="canvas"===s?mU.canvas:mU.dom,n=AD.getComponentPluginInType(t);n||Y_("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r,this._spec.enterable&&"html"===s&&this.tooltipHandler?(this._enterable=!0,this._needInitEventOfTooltip=!0):this._enterable=!1}}_initEventOfTooltipContent(){var t,e;if(!this._needInitEventOfTooltip)return;const i=null===(e=(t=this.tooltipHandler).getRootDom)||void 0===e?void 0:e.call(t);i&&(i.addEventListener("pointerenter",(()=>{var t;if(!this._enterable)return;this._isEnterTooltip=!0;const e=null===(t=i.getBoundingClientRect)||void 0===t?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)){const n=null===(t=i.getBoundingClientRect)||void 0===t?void 0:t.call(i);n&&Object.keys(this._cacheEnterableRect).every((t=>this._cacheEnterableRect[t]===n[t]))&&(this._cacheEnterableRect=null,this._outTimer=setTimeout(this.hideTooltip,null!==(s=null===(e=this._spec)||void 0===e?void 0:e.showDelay)&&void 0!==s?s:50))}})),this._needInitEventOfTooltip=!1)}_initProcessor(){const t=this._spec.activeType;this.processor={},t.forEach((t=>{const e=AD.createTooltipProcessor(t,this);e&&(this.processor[t]=e)}))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Y(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=Y(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),(Z_(s)||J_(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))):g(t)&&this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseMoveHandler(!0))}));i.filter((t=>g(t))).forEach((t=>{var e,i;this._mountEvent(t.eventType,{source:null!==(e=t.source)&&void 0!==e?e:"chart",consume:t.consume},this._getMouseOutHandler(null!==(i=t.checkOutside)&&void 0!==i&&i))})),!e.includes("click")&&this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}_throttle(t){let e;return e=S(this._spec.throttleInterval)?this._spec.throttleInterval:"html"===this._spec.renderMode&&this._spec.transitionDuration?50:10,St(t,e)}reInit(t){var e,i,s;if(super.reInit(t),this.tooltipHandler){const t=null!==(e=this._spec.renderMode)&&void 0!==e?e:"html",n=this._spec.enterable&&"html"===t;n&&!this._enterable&&(this._needInitEventOfTooltip=!0),this._enterable=n,null===(s=(i=this.tooltipHandler).reInit)||void 0===s||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?void 0:i.showTooltip))return!1;const s=wQ(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(u(this._cacheInfo)||u(t))return!1;if(PQ(t)){if(BQ(this._cacheInfo))return!1;const e=this._cacheInfo;return e.length===t.length&&t.every(((t,i)=>WH(t,e[i])))}if(PQ(this._cacheInfo))return!1;const 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;const n=this._cacheParams;return!u(n)&&!u(e)&&(n.mark===e.mark&&n.model===e.model&&n.datum===e.datum)}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}getVisible(){return!1!==this._spec.visible}}IQ.type=r.tooltip,IQ.transformerConstructor=RQ,IQ.builtInTheme={tooltip:LQ},IQ.specKey="tooltip";const OQ=()=>{AD.registerComponent(IQ.type,IQ)};var DQ,FQ;t.TooltipResult=void 0,(DQ=t.TooltipResult||(t.TooltipResult={}))[DQ.success=0]="success",DQ[DQ.failed=1]="failed",function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(FQ||(FQ={}));const zQ={x:["top","bottom"],y:["left","right"],category:["angle"],value:["radius"]};class jQ extends NN{get enableRemain(){return"none"===this.triggerOff}constructor(e,i){super(e,i),this.specKey="crosshair",this.layoutType="none",this.gridZIndex=t.LayoutZIndex.CrossHair_Grid,this.labelZIndex=t.LayoutZIndex.CrossHair,this.trigger="hover",this._handleIn=t=>{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),S(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=St((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(g(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_setAllAxisValues(t,e,i){let s=!1;if(t.forEach((t=>{TP(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!this.enable)return!1;const{currentValue:n}=this._stateByField[i];return t.forEach(((t,i)=>{const s=t.axis;n.set(i,{datum:this._getDatumAtPoint(s,e),axis:s})})),!0}clearAxisValue(){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=>{const{axis:e,value:i}=t;this.setAxisValue(i,e)})),this.layoutByValue(!1))}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshairBySpec(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t];if(e&&e.visible&&e.defaultSelect){const{axisIndex:i=0,datum:s}=e.defaultSelect,n=this._option.getComponentsByKey("axes").find((t=>t.getSpecIndex()===i));n&&(this._stateByField[t].currentValue.clear(),this._stateByField[t].currentValue.set(i,{axis:n,datum:s}))}}))}_updateVisibleCrosshair(){let t=!1;Object.keys(this._stateByField).forEach((e=>{const 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){const i=super._compareSpec(t,e);return i.reMake||U(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:GF.chart}:{source:WF.chart};_(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;_(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}onBeforeRender(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:e=t.RenderModeEnum["desktop-browser"]}=this._option,i=function(e){return e===t.RenderModeEnum["desktop-browser"]||e===t.RenderModeEnum["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:Z_(e)||J_(e)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(e);if(i){const t=Y(this.trigger||"hover"),e=t=>"click"===t?"none"===this.triggerOff?null:i.clickOut:i.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:i[t],out:e(t)})})),s}return null}_registerTooltipEvent(){this.event.on(t.ChartEvent.tooltipHide,{source:WF.chart},this._handleTooltipHideOrRelease),this.event.on(t.ChartEvent.tooltipShow,{source:WF.chart},this._handleTooltipShow),this.event.on(t.ChartEvent.tooltipRelease,{source:WF.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=R(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{zQ[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:c,y:d}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));if(!e)return;e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-c),o=Math.min(o,i-d),l=Math.max(l,e+t.getLayoutRect().width-c),h=Math.max(h,i+t.getLayoutRect().height-d)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e})})),r}onLayoutEnd(){const t=this._regions[0];this.setLayoutRect(t.getLayoutRect()),this.setLayoutStartPosition(t.getLayoutStartPoint()),super.onLayoutEnd()}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseFieldInfo(){Object.keys(this._stateByField).forEach((t=>{const e=this._spec[t],{crosshairComp:i}=this._stateByField[t];if(e&&e.visible){if(this._stateByField[t].attributes=this._parseField(e,t),i){const{style:e,type:s}=this._stateByField[t].attributes,n="rect"===s?"rectStyle":"lineStyle";i.setAttributes({[n]:e})}}else i&&i.parent&&i.parent.removeChild(i)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||S(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,i){var s,n,r;const a={},{line:o={},label:l={},visible:h}=t;if(a.visible=h,a.type=o.type||"line",!1===o.visible)a.style={visible:!1};else{const i=o.style||{},{stroke:r,fill:l,lineWidth:h}=i,c=i,{strokeOpacity:d,fillOpacity:u,opacity:p}=c,g=e(c,["strokeOpacity","fillOpacity","opacity"]),f="line"===a.type;let m=f?d:u;if(S(p)&&(m=(null!=m?m:1)*p),a.style=Object.assign({opacity:m,pickable:!1,visible:!0},g),f)a.style.stroke=r||l,a.style.lineWidth=R(o,"width",h||2);else{a.style.fill=l||r,(null===(n=null===(s=null==t?void 0:t.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(a.style.stroke=t.line.style.stroke);const e=R(o,"width");if("string"==typeof e){const 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){const t=l.labelBackground||{},i=null!==(r=l.syncAxisLabelAngle)&&void 0!==r&&r,s=l.style||{},n=t.style||{},{fill:o="rgba(47, 59, 82, 0.9)",stroke:h,outerBorder:d}=n,u=e(n,["fill","stroke","outerBorder"]);a.label={visible:!0,formatMethod:l.formatMethod,formatter:l.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,syncAxisLabelAngle:i,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},s),{fill:s.fill||"#fff",stroke:R(s,"stroke")}),panel:(c(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:o,stroke:h,outerBorder:Object.assign({stroke:o,distance:0,lineWidth:3},d)},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=>{const n=s.axis;var r,a,o;if(a=e,o=i,((r=s).x1>a||r.x2<a||r.y1>o||r.y2<o)&&t.delete(n.getSpecIndex()),n.type.startsWith("polarAxis")){const s=n.getCenter(),r=n.getInnerRadius(),a=n.getOuterRadius(),o=ae.distancePP({x:e,y:i},s);(o>a||o<r)&&t.delete(n.getSpecIndex())}})),t}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new BC(e),null==s||s.add(t),i(t)),function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:c=0,dy:d=0}=t.attribute;let u=0,p=0;a<i&&(u=i-a),o<s&&(p=s-o),l>n&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+c),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){const{crosshairComp:e,labelsComp:i}=this._stateByField[t];e&&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)=>{const{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}),[])}}jQ.specKey="crosshair";const HQ={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 NQ extends jQ{static getSpecInfo(t){return Yj(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._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){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const i=OH(t.getOrient())?"x":"y",s=e[i]-(t.getLayoutStartPoint()[i]-this.getLayoutStartPoint()[i]);return t.getScale().invert(s)}setAxisValue(t,e){OH(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 n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(p(t.dimType)?"y"===t.dimType:DH(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}this.clearAxisValue();const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else o&&o.size&&this._setAllAxisValues(o,{x:r,y:a},"xField"),l&&l.size&&this._setAllAxisValues(l,{x:r,y:a},"yField"),this.layoutByValue()}layoutByValue(t){if(!this.enable)return;const e=LO(this._regions,"cartesian");e&&(oU(this._stateByField,e,this.getLayoutStartPoint(),null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){const{cacheInfo:e,attributes:i,labelsComp:s,bandSize:n,coordKey:r}=this._stateByField[t];if(!i||!e||e._isCache&&this.enableRemain)return;const{coord:a,labels:o,visible:l,labelsTextStyle:h}=e;if(l){const l=cU(this._stateByField[t]);this._updateCrosshairByField(t,l),Object.keys(o).forEach((l=>{var c,d,u;if(o[l].visible){const p=Object.assign(Object.assign(Object.assign({[r]:a+n/2},o[l]),i.label),{angle:i.label.syncAxisLabelAngle&&null!==(d=null===(c=e.axisLabel)||void 0===c?void 0:c.attribute.angle)&&void 0!==d?d:0,textStyle:Object.assign(Object.assign({},null===(u=i.label)||void 0===u?void 0:u.textStyle),h[l]),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(s[l],p,(e=>{e.name=`crosshair-${t.replace("Field","")}-${l}-label`,s[l]=e}))}else s[l]&&s[l].hideAll()}))}else this._hideByField(t)}_updateCrosshairByField(t,e){const i=this.getContainer(),{attributes:s}=this._stateByField[t];let{crosshairComp:n}=this._stateByField[t];if(n)n.setAttributes(e);else{const r=s.style;"line"===s.type?n=new KC(Object.assign(Object.assign({},e),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===s.type&&(n=new qC(Object.assign(Object.assign({},e),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==i||i.add(n),this._stateByField[t].crosshairComp=n}}}NQ.specKey="crosshair",NQ.builtInTheme={crosshair:HQ},NQ.type=r.cartesianCrosshair;const VQ=()=>{AD.registerComponent(NQ.type,NQ)};class UQ extends jQ{static getSpecInfo(t){return Yj(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=r.polarCrosshair,this.name=r.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){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getDatumAtPoint(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint();return t.positionToData({x:e.x-(i-n),y:e.y-(s-r)})}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}this.clearAxisValue();const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)a&&this._setAllAxisValues(a,{x:n,y:r},"categoryField"),o&&this._setAllAxisValues(o,{x:n,y:r},"valueField"),this.layoutByValue();else{if(this.enableRemain)return;this.hide()}}layoutByValue(t){if(!this.enable)return;const e=LO(this._regions,"polar");e&&(((t,e,i=!1)=>{Object.keys(t).forEach((s=>{const{attributes:n,currentValue:r,cacheInfo:a,coordKey:o}=t[s];if(n){const l=!!r.size,h=i&&!l&&p(a),c=h?a:{coord:0,axis:null,visible:l,coordRange:[0,0],sizeRange:[0,0],labels:{all:{visible:!1,text:"",offset:0}}};if(a&&(a._isCache=h),"valueField"===s&&(c.sides=e.angleAxisHelper.getScale(0).domain().length),r.forEach((({axis:t,datum:i=""})=>{var r;const a=t.niceLabelFormatter;if((null===(r=n.label)||void 0===r?void 0:r.visible)&&(c.labels.all.visible=!0,c.labels.all.defaultFormatter=a,c.labels.all.text=i,c.labels.all.offset=yN(t.getSpec())),"categoryField"===s){const s=e.angleAxisHelper.dataToPosition([i]),n=e.angleAxisHelper.getBandwidth(0),r=t.getOuterRadius();c.coord=s,c.coordRange=[s-n/2,s+n/2],c.sizeRange=[r,r]}else{const s=t.startAngle,n=e.radiusAxisHelper.dataToPosition([i]);c.coord=n,c.coordRange=[n,n],c.sizeRange=[s,s]}c.axis=t})),c&&!h&&c.labels.all.visible&&n&&n.label){const t=c.labels.all,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=Gj(e,i,t.text,{label:t.text,orient:o});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}t[s].cacheInfo=c}}))})(this._stateByField,e,null!=t?t:this.enableRemain),Object.keys(this._stateByField).forEach((t=>{this._layoutByField(t)})))}_layoutByField(t){var e,i,s;const{cacheInfo:n,attributes:r,crosshairComp:a,labelsComp:o,coordKey:l}=this._stateByField[t];if(!n||n._isCache&&this.enableRemain)return;const h=this.getContainer(),{visible:c,labels:d,coord:u,sizeRange:p,axis:g}=n;if(c){const n=this.getLayoutStartPoint(),c=null===(i=null===(e=this._spec.valueField)||void 0===e?void 0:e.line)||void 0===i?void 0:i.smooth,f=((t,e,i)=>{const{cacheInfo:s,coordKey:n,attributes:r}=t,{axis:a,coord:o,sizeRange:l,coordRange:h}=s,c=a.getCenter(),d={x:c.x+e.x,y:c.y+e.y};if("angle"===n)return"sector"==("rect"===r.type?"sector":"line")?{center:d,innerRadius:a.getInnerRadius(),radius:a.getOuterRadius(),startAngle:h[0],endAngle:h[1]}:{start:ce(d,a.getInnerRadius(),o),end:ce(d,a.getOuterRadius(),o)};const u=a.startAngle,p=a.endAngle,g=s.sides;let f=o;if(!i){const t=a.getCenter(),e=a.coordToPoint({angle:l[0],radius:o}),i=ue(t,e),s=(p-u)/g,n=Math.floor((i-u)/s),r=n*s+u,h=Math.min((n+1)*s+u,p),c=ce(t,o,r),d=ce(t,o,h),m=ye([d.x,d.y],[c.x,c.y],[t.x,t.y],[e.x,e.y]);m&&(f=vt(ae.distancePN(e,m[0],m[1])+o,a.getInnerRadius(),a.getOuterRadius()))}return{center:d,startAngle:u,endAngle:p,radius:f,sides:g}})(this._stateByField[t],n,c);if(a)a.setAttributes(f);else{let e;if("angle"===l){const t="rect"===r.type?"sector":"line";"line"===t?e=new KC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===t&&(e=new JC(Object.assign(Object.assign({},f),{sectorStyle:r.style,zIndex:this.gridZIndex,pickable:!1})))}else{e="polygon"===(c?"circle":"polygon")?new QC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex+1})):new ZC(Object.assign(Object.assign({},f),{lineStyle:r.style,zIndex:this.gridZIndex}))}this._stateByField[t].crosshairComp=e,h.add(e)}const m=d.all;if(m.visible){const t=g.getCenter(),e={x:t.x+n.x,y:t.y+n.y},i="angle"===l?function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(u):function(t){let e="center",i="middle";return e=(t=pe(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(g.startAngle),a="angle"===l?ce(e,p[1]+m.offset,u):ce(e,f.radius,g.startAngle),h=Object.assign(Object.assign(Object.assign(Object.assign({},a),r.label),m),{textStyle:Object.assign(Object.assign({},null===(s=r.label)||void 0===s?void 0:s.textStyle),{textAlign:i.align,textBaseline:i.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(o.all,h,(t=>{t.name=`crosshair-${l}-label`,o.all=t}))}else o.all&&o.all.hideAll()}}}UQ.specKey="crosshair",UQ.builtInTheme={crosshair:HQ},UQ.type=r.polarCrosshair;const WQ=()=>{AD.registerComponent(UQ.type,UQ)},GQ=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n,originalFields:r}=e,a=n(),o=i();if(u(o)||u(a))return t;const l=r(),h=_(a)?a[0]:a;return t[h]&&l&&l[h]&&l[h].lockStatisticsByDomain&&!s()&&(t[h].values=o),t},YQ=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(u(a)||u(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>{let e=!1;return Y(r).every((i=>{t[i]>=a[0]&&t[i]<=X(a)&&(e=!0)})),e}:t=>{let e=!1;return Y(r).every((i=>{(o[t[i]+""]||o[t[i]])&&(e=!0)})),e},t.filter(l)},XQ=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n,isCategoryState:r}=e.input,{stateField:a,valueField:o}=e.output,l={},h=[],c=[];let d=!1;n.forEach(((t,e)=>{var n;if(u(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&(d=!0,r.domain.forEach((t=>{u(l[t])&&(c.push(t),l[t]=0)}))),t.latestData.forEach((t=>{Y(i[e]).forEach((i=>{u(t[i])||(u(l[t[i]])&&(c.push(t[i]),l[t[i]]=0),u(s[e])||(l[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))}));const p=d?c:!1===r?c.sort(((t,e)=>t-e)):Object.keys(l);return p.forEach((t=>{const e={[a]:t};o&&(e[o]=l[t]),h.push(e)})),h};class $Q extends NN{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-t<this._minSpan||e-t>this._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent,i=e.getScale(),s=this._isReverse(),n=s?[1-this._end,1-this._start]:[this._start,this._end];if(s)switch(t){case"startHandler":e.scaleRangeFactorEnd(n[1]);break;case"endHandler":e.scaleRangeFactorStart(n[0]);break;default:e.scaleRangeFactorStart(n[0],!0),e.scaleRangeFactorEnd(n[1])}else switch(t){case"startHandler":e.scaleRangeFactorStart(n[0]);break;case"endHandler":e.scaleRangeFactorEnd(n[1]);break;default:e.scaleRangeFactorEnd(n[1],!0),e.scaleRangeFactorStart(n[0])}const r=i.rangeFactor();r?(this._start=s?1-r[1]:r[0],this._end=s?1-r[0]:r[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate({value:"force"})}else PO(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),PO(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=(t,e)=>{var i,s;if(!this._activeRoam||this._zoomAttr.filter&&!this._zoomAttr.filter(t,e))return;const{zoomDelta:n,zoomX:r,zoomY:a}=t,{x:o,y:l}=this._regions[0].getLayoutStartPoint(),{width:h,height:c}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),u=null!==(s=null===(i=this._spec.roamZoom)||void 0===i?void 0:i.rate)&&void 0!==s?s:1;if(d>=1&&n<1)return;if(d<=.01&&n>1)return;const p=this._isHorizontal?r:a,g=d*(n-1)*u;let f=g/2,m=g/2;if(p){const t=this._isHorizontal?o:l,e=this._isHorizontal?h:c;f=Math.abs(t-p)/Math.abs(e-t)*g,m=Math.abs(e-p)/Math.abs(e-t)*g}const v=vt(this._start+f,0,1),y=vt(this._end-m,0,1);this._handleChange(Math.min(v,y),Math.max(v,y),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam||this._scrollAttr.filter&&!this._scrollAttr.filter(t,e))return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?Ut(s/n)>=.5:Ut(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i,s;if(!this._activeRoam||this._dragAttr.filter&&!this._dragAttr.filter(t,e))return;(null===(i=this._spec.roamDrag)||void 0===i?void 0:i.autoVisible)&&this.show();const[n,r]=t;let a=this._isHorizontal?n:r;this._dragAttr.reverse&&(a=-a),this._handleChartMove(a,null!==(s=this._dragAttr.rate)&&void 0!==s?s:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=zH(t),this._isHorizontal="horizontal"===jH(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(p(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):p(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),u(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!AP(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(p(i)&&(p(i.userId)&&(this._seriesUserId=Y(i.userId)),p(i.specIndex)&&(this._seriesIndex=Y(i.specIndex))),p(this._spec.seriesId)){const t=Y(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(p(this._spec.seriesIndex)){const t=Y(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(p(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Y(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(p(this._spec.regionId)){const t=Y(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}else;}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(AP(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&!U(this._domainCache,e)&&(this._domainCache=e,this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[K(t),$(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];let s;if(this._relatedAxisComponent){const n={};PO(this._regions,(r=>{var a,o;const l="cartesian"===r.coordinate?r.getXAxisHelper():"polar"===r.coordinate?r.angleAxisHelper:null,h="cartesian"===r.coordinate?r.getYAxisHelper():"polar"===r.coordinate?r.radiusAxisHelper:null;if(!l||!h)return;const c=l.getAxisId()===this._relatedAxisComponent.id?l:h.getAxisId()===this._relatedAxisComponent.id?h:this._isHorizontal?l:h,d=c===l?h:l;t.push(r.getRawData());const u=r.getSpec(),p="cartesian"===r.coordinate?Y(u.xField):Y(null!==(a=u.angleField)&&void 0!==a?a:u.categoryField),g="cartesian"===r.coordinate?Y(u.yField):Y(null!==(o=u.radiusField)&&void 0!==o?o:u.valueField);if(n[r.id]="link"===r.type?["from_xField"]:c===l?p:g,AP(c.getScale(0).type)?(s=!1,e.push(n[r.id])):e.push(n[r.id][0]),this._valueField){const t="link"===r.type?["from_yField"]:d===l?p:g;AP(d.getScale(0).type)&&i.push(...t)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=n}else PO(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:n}=this._option;ZF(n,"dataview",Ma),qF(n,"dataFilterComputeDomain",XQ);const r=new Ba(n,{name:`${this.type}_${this.id}_data`});r.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i,isCategoryState:s},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new Qz(this._option,r),r.reRunAllTransform(),n.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=j({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=j({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=j({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}statePointToData(t){const e=this._stateScale,i=e.domain();if(AP(e.type))return this._isReverse()?i[0]+(X(i)-i[0])*(1-t):i[0]+(X(i)-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(X(s)-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&AP(e.type)&&(s=s.slice().reverse()),(i-s[0])/(X(s)-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&p(this._spec.start)||"value"===e&&p(this._spec.startValue):"percent"===e&&p(this._spec.end)||"value"===e&&p(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this.statePointToData(i),this._endValue=this.statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,AP(this._stateScale.type)&&this._stateScale.domain()[0]!==X(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(X(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(X(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=AP(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[K(e),$(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new $P,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(qF(this._option.dataSet,"dataFilterWithNewDomain",YQ),qF(this._option.dataSet,"lockStatisticsFilter",GQ),PO(this._regions,(e=>{e.getViewDataStatistics().transform({type:"lockStatisticsFilter",options:{originalFields:()=>e.getViewDataStatistics().getFields(),getNewDomain:()=>this._newDomain,field:()=>{var t;return null!==(t=this._field)&&void 0!==t?t:this._parseFieldOfSeries(e)},isContinuous:()=>AP(this._stateScale.type)},level:1},!1),e.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var t;return null!==(t=this._field)&&void 0!==t?t:this._parseFieldOfSeries(e)},isContinuous:()=>AP(this._stateScale.type)},level:t.TransformLevel.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||U(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])}))}))}_parseDomainFromState(t,e){if(AP(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a,o;const l={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:p(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a,allowComponentZoom:!0};if(this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,l),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,l),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,l),null===(o=this._spec.roamDrag)||void 0===o?void 0:o.autoVisible){const t="panend";this._throttledHide=St((()=>this.hide()),300),this.event.on(t,(()=>{this._throttledHide()}))}}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}_autoVisible(e){if(!this._auto)return;e?this.show():this.hide();const i=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[i]:e?this[`_${i}`]:0},{[i]:t.AttributeLevel.Built_In})}onLayoutStart(t,e){super.onLayoutStart(t,e);const i=this._autoUpdate(t);this._autoVisible(i),this._dataUpdating=!1}onLayoutEnd(){const t=!(0===this._start&&1===this._end);this._autoVisible(t),super.onLayoutEnd()}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),c=null==l?void 0:l.getScale(),d=this._getAxisBandSize(h);if(!this._dataUpdating&&TP(c.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==d?void 0:d.bandSize))return this._cacheVisibility;let p=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?c.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&c.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==d?void 0:d.bandSize,TP(c.type)){d&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=c.rangeFactor())&&void 0!==a?a:[];p=(!u(t)||!u(e))&&!(0===t&&1===e)}else{const[t,e]=null!==(o=c.rangeFactor())&&void 0!==o?o:[this._start,this._end];p=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),this._cacheVisibility=p,p}_getNeedClearVRenderComponents(){return[this._component]}clear(){this._throttledHide=null}}G($Q,wW);class KQ extends HN{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=SD({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=_(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}const qQ=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),ZQ={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:qQ(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:qQ(!0)};class JQ extends $Q{constructor(e,i){var s;super(e,i),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=KQ,this.specKey="dataZoom",this.layoutZIndex=t.LayoutZIndex.DataZoom,this.layoutLevel=t.LayoutLevel.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),c(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),u(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),u(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,p=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=p?this._spec.endHandler.style.size:0}onLayoutEnd(){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd()}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new fR;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2],a=this._computeWidth(),o=this._computeHeight();this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,a-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([o-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,o-i+this._startHandlerSize/2]:r,this._stateScale.range(s),"left"===this.layoutOrient?this._valueScale.range([a-this._middleHandlerSize,0]):this._valueScale.range([0,a-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:a,height:o},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[K(e),$(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:S(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return(!AP(t.type)||e[0]!==X(e))&&(!TP(t.type)||1!==(i=e,i&&_(i)?Array.from(new Set(Y(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this._computeWidth(),height:this._computeHeight()},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:p(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new LL(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this.statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(e,i,s,n){if(super._handleChange(e,i,s),this._shouldChange){s&&this._component&&this._component.setStartAndEnd(e,i),this._start=e,this._end=i;const r=this.statePointToData(e),a=this.statePointToData(i);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,r,a):this._handleStateChange(r,a,n))&&this.event.emit(t.ChartEvent.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:e,end:i,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,c,d;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:f={},selectedBackgroundChart:m={}}=this._spec;return{backgroundStyle:OF(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:OF(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:OF(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:OF(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:OF(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:OF(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:OF(g.style)},selectedBackgroundStyle:OF(this._spec.selectedBackground.style),dragMaskStyle:OF(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:SD(OF(null===(l=f.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OF(null===(h=f.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:SD(OF(null===(c=m.line)||void 0===c?void 0:c.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OF(null===(d=m.area)||void 0===d?void 0:d.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=Gj(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}JQ.type=r.dataZoom,JQ.transformerConstructor=KQ,JQ.builtInTheme={dataZoom:ZQ},JQ.specKey="dataZoom";const QQ=()=>{AD.registerComponent(JQ.type,JQ)},t0={horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}};class e0 extends $Q{constructor(e,i){var s;super(e,i),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=t.LayoutZIndex.DataZoom,this.layoutLevel=t.LayoutLevel.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(s=e.filterMode)&&void 0!==s?s:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),c(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(){var t,e;this._updateScaleRange(),null===(e=(t=this.effect).onZoomChange)||void 0===e||e.call(t),super.onLayoutEnd()}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return S(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return S(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:p(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new tC(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),this._component.addEventListener("scrollUp",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(e,i,s){super._handleChange(e,i,s);const n=SO(this._start,e)&&SO(this._end,i);if(this._shouldChange&&(!n||!1===this._spec.realTime)){s&&this._component&&this._component.setAttribute("range",[e,i]),this._start=e,this._end=i;const n=this.statePointToData(e),r=this.statePointToData(i);(d(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(e,i,n,r):this._handleStateChange(this.statePointToData(e),this.statePointToData(i)))&&this.event.emit(t.ChartEvent.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){if(this._spec.auto){this._data.getDataView().reRunAllTransform()}}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return u(i)||(s.padding=i),P(null==t?void 0:t.style)||(s.railStyle=OF(t.style)),P(null==e?void 0:e.style)||(s.sliderStyle=OF(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}e0.type=r.scrollBar,e0.builtInTheme={scrollBar:t0},e0.specKey="scrollBar";const i0=()=>{AD.registerComponent(e0.type,e0)},s0=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Y(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},n0=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),r0={title:{visible:!0,autoLimit:!1,autoFit:!1,style:n0("l1FontSize","primaryFontColor")},content:{visible:!0,style:n0("l2FontSize","tertiaryFontColor")}};class a0 extends NN{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.Indicator,this.layoutLevel=t.LayoutLevel.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return Yj(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=Y(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex))}initEvent(){if(this._option.disableTriggerEvent)return;"none"!==this._spec.trigger&&("hover"===this._spec.trigger?(this.event.on("element-highlight:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(FF(e))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))):(this.event.on("element-select:start",(t=>{const e=t.graphics[0];this.isRelativeModel(e)&&this.updateDatum(FF(e))})),this.event.on("element-select:reset",(t=>{this._activeDatum&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){qF(this._option.dataSet,"indicatorFilter",s0);const t=new Ba(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 Qz(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:i,height:s}=t.getLayoutRect(),{x:n,y:r}=t.getLayoutStartPoint(),a=this._spec,{content:o,offsetX:l,offsetY:h,limitRatio:c,title:d}=a,u=e(a,["content","offsetX","offsetY","limitRatio","title"]),g=[];return Y(o).forEach((t=>{const e=SD({},this._theme.content,t);g.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({},IF(H(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:i,height:s},zIndex:this.layoutZIndex,x:n,y:r,dx:l?dD(l,this._computeLayoutRadius()):0,dy:h?dD(h,this._computeLayoutRadius()):0,limitRatio:c||1/0,title:{visible:!1!==d.visible&&(!p(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},IF(H(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:g},u)}_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)U(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new KI(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]:"":d(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>!!e.getSeriesInId(t.context.modelId)))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}a0.type=r.indicator,a0.builtInTheme={indicator:r0},a0.specKey="indicator";const o0=()=>{AD.registerComponent(a0.type,a0)},l0=["sum","average","min","max","variance","standardDeviation","median"];function h0(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=K(s),r=$(s);return e<n||e>r}function c0(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let h;return S(t.x)&&h0(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),h=nD(t.x)?g0(t.x,n)+r.x:f0(l.getXAxisHelper(),[t.x])+r.x,h}function d0(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let h;return S(t.y)&&h0(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),h=nD(t.y)?g0(t.y,n)+r.y:f0(l.getYAxisHelper(),[t.y])+r.y,h}function u0(t,e,i,s){var n,r;const{relativeSeries:a}=s;return S(t.angle)&&h0(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),f0(a.angleAxisHelper,[t.angle])}function p0(t,e,i,s){var n,r;const{relativeSeries:a}=s;return S(t.radius)&&h0(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),f0(a.radiusAxisHelper,[t.radius])}function g0(t,e){return Number(t.substring(0,t.length-1))*e/100}function f0(t,e){const i=t.getScale(0);return AP(i.type)&&i.domain()[0]===i.domain()[1]&&e[0]!==i.domain()[0]?NaN:t.dataToPosition(e)}function m0(t){return l0.includes(t)}function v0(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),c=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),d={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],g=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,f=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return g.forEach((t=>{const e=p(t.x),i=p(t.y);if(e&&i){const e=c0(t,f,n,d,h,a),i=d0(t,m,n,d,c,a);u.push([{x:e,y:i}])}else if(e){const e=c0(t,f,n,d,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=d0(t,m,n,d,c,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function y0(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),c=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=p(t.angle),i=p(t.radius);if(e&&i){const e=u0(t,l,n,r),i=p0(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=u0(t,l,n,r);a.push([{angle:e,radius:-c},{angle:e,radius:c}])}else if(i){const e=p0(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function _0(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=_(s);return r.forEach(((t,r)=>{var o,l,h,c;const d=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,u=d.getRegion(),p=u.getLayoutStartPoint(),{width:g,height:f}=u.getLayoutRect();let m=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(m=nD(e)?Number(e.substring(0,e.length-1))*g/100:e),i&&(v=nD(i)?Number(i.substring(0,i.length-1))*f/100:i)}const y=d.getXAxisHelper().getScale(0).domain(),_=d.getYAxisHelper().getScale(0).domain(),b=Y(t.x),x=Y(t.y);1===b.length&&S(b[0])&&h0(y,b[0],i)&&(null===(l=null===(o=d.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",b[0])),1===x.length&&S(x[0])&&h0(_,x[0],i)&&(null===(c=null===(h=d.getYAxisHelper())||void 0===h?void 0:h.setExtendDomain)||void 0===c||c.call(h,"marker_yAxis_extend",x[0])),n.push({x:f0(d.getXAxisHelper(),b)+p.x+m,y:f0(d.getYAxisHelper(),x)+p.y+v})})),n}function b0(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,h=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),d=Y(t.angle),u=Y(t.radius);1===d.length&&S(d[0])&&h0(h,d[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",d[0])),1===u.length&&S(u[0])&&h0(c,u[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",u[0])),s.push({angle:f0(l.angleAxisHelper,d),radius:f0(l.radiusAxisHelper,u)})})),s}function x0(t,e,i){let{x:s,y:n}=t;return nD(s)&&(s=g0(s,e)),nD(n)&&(n=g0(n,i)),{x:s,y:n}}function S0(t,e,i){let s;if(s=d(t)?Y(t(e.getData().getLatestData(),e)):Y(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=x0(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>x0(t,n,r)))}function A0(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.x<e&&(e=r.x),r.x+a.width>i&&(i=r.x+a.width),r.y<s&&(s=r.y),r.y+a.height>n&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function k0(t,i,s){const{labelBackground:n={},style:r,shape:a}=t,o=e(t,["labelBackground","style","shape"]);if(!1!==t.visible){const t=o;return(null==a?void 0:a.visible)?t.shape=Object.assign({visible:!0},OF(a.style)):t.shape={visible:!1},!1!==n.visible?(t.panel=Object.assign({visible:!0,customShape:n.customShape},M0(OF(n.style),i,s)),p(n.padding)&&(t.padding=oi(n.padding))):(t.panel={visible:!1},t.padding=0),r&&(t.textStyle=M0(OF(r),i,s)),t}return{visible:!1}}function T0(t,e,i){for(const s in t)d(t[s])&&(t[s]=t[s](e,i));return t}function M0(t,e,i){return d(t)?t(e,i):t}function C0(t,e){return d(t)?t(e):t}function w0(t,e,i){return p(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 E0(t){return{isXProcess:p(t.x),isYProcess:p(t.y),isX1Process:p(t.x1),isY1Process:p(t.y1),isAngleProcess:p(t.angle),isRadiusProcess:p(t.radius),isAngle1Process:p(t.angle1),isRadius1Process:p(t.radius1),isCoordinatesProcess:p(t.coordinates),isValidProcess:p(t.process)}}function B0(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h,isValidProcess:c}=E0(t);return{doXProcess:e&&!i&&!n,doXYY1Process:e&&i&&n,doYProcess:i&&!e&&!s,doYXX1Process:i&&e&&s,doXYProcess:e&&i&&s&&n,doAngleProcess:r&&!o&&!a&&!l,doRadiusProcess:a&&!l&&!r&&!o,doAngRadRad1Process:r&&!o&&a&&l,doRadAngAng1Process:a&&r&&o&&!l,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h&&(!c||"process"in t&&"xy"in t.process)}}function P0(t){const{isXProcess:e,isYProcess:i,isX1Process:s,isY1Process:n,isAngleProcess:r,isRadiusProcess:a,isAngle1Process:o,isRadius1Process:l,isCoordinatesProcess:h}=E0(t);return{doXProcess:e&&s&&!i&&!n,doYProcess:i&&n&&!e&&!s,doXYProcess:e&&s&&i&&n,doAngleProcess:r&&o&&!a&&!l,doRadiusProcess:a&&l&&!r&&!o,doRadAngProcess:r&&a&&o&&l,doCoordinatesProcess:h}}function R0(t){return{doXYProcess:p(t.x)&&p(t.y),doPolarProcess:p(t.angle)&&p(t.radius),doGeoProcess:p(t.areaName)}}function L0(t,i){let s;if(i.coordinates){const t=i,{coordinates:n,coordinateType:r,getSeriesByIdOrIndex:a}=t,o=e(t,["coordinates","coordinateType","getSeriesByIdOrIndex"]);let l,h;if(d(n)){const t=i.getRelativeSeries();l=n(t.getData().getLatestData(),t)}else l=n;l=Y(l),s=l.map((t=>{const e=a(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===r){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:a,yFieldIndex:l}=t;let c=i;p(r)&&(c=Y(i)[r]),n&&Y(i).includes(n)&&(c=n);let d=s;p(l)&&(d=Y(s)[l]),a&&Y(s).includes(a)&&(d=a),h=Object.assign({x:void 0,y:void 0},o),y(t[c])&&m0(t[c])?h.x={field:c,aggrType:t[c]}:h.x=Y(c).map((e=>t[e])),y(t[d])&&m0(t[d])?h.y={field:d,aggrType:t[d]}:h.y=Y(d).map((e=>t[e]))}else if("polar"===r){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let a=s;p(r)&&(a=Y(s)[r]),n&&Y(s).includes(n)&&(a=n);const l=i;h=Object.assign({angle:void 0,radius:void 0},o),y(t[a])&&m0(t[a])?h.angle={field:a,aggrType:t[a]}:h.angle=Y(a).map((e=>t[e])),y(t[l])&&m0(t[l])?h.radius={field:l,aggrType:t[l]}:h.radius=Y(l).map((e=>t[e]))}return h.getRefRelativeSeries=()=>e,h}))}else s=i;const n=[];return s.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(p(e.x)){const s=e.x;_(s)?i.x=s.map((i=>O0(i,t,e))):i.x=O0(s,t,e)}if(p(e.y)){const s=e.y;_(s)?i.y=s.map((i=>O0(i,t,e))):i.y=O0(s,t,e)}if(p(e.angle)){const s=e.angle;_(s)?i.angle=s.map((i=>O0(i,t,e))):i.angle=O0(s,t,e)}if(p(e.radius)){const s=e.radius;_(s)?i.radius=s.map((i=>O0(i,t,e))):i.radius=O0(s,t,e)}if(p(e.areaName)){const s=e.areaName;i.areaName=O0(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),n.push(i)})),n}const I0={min:(t,e)=>AO(t[0].latestData,e.field),max:(t,e)=>kO(t[0].latestData,e.field),sum:function(t,e){return TO(t[0].latestData,e.field)},average:function(t,e){return MO(t[0].latestData,e.field)},variance:function(t,e){return CO(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(CO(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return ct(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function O0(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(d(t))return t(a,o,l,s,n,r);if(m(t)){const{aggrType:i,field:s}=t;return I0[i](e,{field:s})}return t}function D0(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class F0 extends NN{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 Yj(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){const s={x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"};return y(e)&&m0(e)?{field:i.getSpec()[s[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Y(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const e=new Ea;return e.registerParser("array",s),new Ba(e).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(p(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=LO(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e){u(this._spec.offsetX)||(this._layoutOffsetX=aD(this._spec.offsetX,e.width,e)),u(this._spec.offsetY)||(this._layoutOffsetY=aD(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e)}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}_initCommonDataView(){const{options:t}=this._computeOptions(),e=this._getRelativeDataView();qF(this._option.dataSet,"markerAggregation",L0),qF(this._option.dataSet,"markerFilter",D0);const i=new Ba(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 z0(t,e){return function(t,e,i){const{predict:s}=Ft(t,(t=>t[e]),(t=>t[i])),n=AO(t,e),r=kO(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}class j0 extends F0{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=t.LayoutZIndex.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=B0(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,c,d,u;const{startSymbol:p={},endSymbol:g={}}=this._spec,f=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),m={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:M0(OF(null===(n=this._spec.line)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:f.map((t=>k0(t,this._markerData,this._markAttributeContext))),state:{line:T0(null!==(o=null===(a=this._spec.line)||void 0===a?void 0:a.state)&&void 0!==o?o:{},this._markerData,this._markAttributeContext),lineStartSymbol:T0(null!==(h=null===(l=this._spec.startSymbol)||void 0===l?void 0:l.state)&&void 0!==h?h:{},this._markerData,this._markAttributeContext),lineEndSymbol:T0(null!==(d=null===(c=this._spec.endSymbol)||void 0===c?void 0:c.state)&&void 0!==d?d:{},this._markerData,this._markAttributeContext),label:f.map((t=>{var e;return T0(null!==(e=t.state)&&void 0!==e?e:{},this._markerData,this._markAttributeContext)})),labelBackground:f.map((t=>{var e,i;return T0(null!==(i=null===(e=t.labelBackground)||void 0===e?void 0:e.state)&&void 0!==i?i:{},this._markerData,this._markAttributeContext)}))},animation:null!==(u=this._spec.animation)&&void 0!==u&&u,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};p.visible?m.startSymbol=Object.assign(Object.assign({},p),{visible:!0,style:M0(OF(p.style),this._markerData,this._markAttributeContext)}):m.startSymbol={visible:!1},g.visible?m.endSymbol=Object.assign(Object.assign({},g),{visible:!0,style:M0(OF(g.style),this._markerData,this._markAttributeContext)}):m.endSymbol={visible:!1};return this._newMarkLineComponent(m)}_getUpdateMarkerAttrs(){var t,e;const i=this._spec,s=this._markerData,n=this._startRelativeSeries,r=this._endRelativeSeries,a=this._relativeSeries,o=this._computePointsAttr(),l=a.getViewData().latestData,h=s.latestData[0]&&s.latestData[0].latestData?s.latestData[0].latestData:s.latestData;let c;if(i.clip||Y(i.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:s}=A0([n.getRegion(),r.getRegion(),a.getRegion()]);c={x:t,y:i,width:e-t,height:s-i}}const d=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),u=Y(this._spec.label),p=d.map(((t,e)=>{const i=u[e]||{};return Object.assign(Object.assign({},t),{text:i.formatMethod?i.formatMethod(h,l):null==t?void 0:t.text})}));return Object.assign(Object.assign({},o),{label:p,limitRect:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d}=B0(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||c||d||e))return;qF(this._option.dataSet,"markerAggregation",L0),qF(this._option.dataSet,"markerRegression",z0),qF(this._option.dataSet,"markerFilter",D0);const{options:u,needAggr:p,needRegr:g,processData:f}=this._computeOptions(),m=new Ba(this._option.dataSet);m.parse([f],{type:"dataview"}),p&&m.transform({type:"markerAggregation",options:u}),g&&m.transform({type:"markerRegression",options:u}),m.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),m.target.on("change",(()=>{this._markerLayout()})),this._markerData=m}}j0.specKey="markLine";const H0=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),N0={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"}}},refY:5},V0={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:H0(!1),endSymbol:H0(!0),label:N0};class U0 extends j0{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new yI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=p(e.coordinates),o=p(e.process),l=o&&p(e.process.x),h=o&&p(e.process.y),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:g,doXYY1Process:f,doYXX1Process:m,doXYProcess:v,doCoordinatesProcess:y}=B0(e);let _=[];if(u||f||g||m||v||a&&l||a&&h){const t=v0(i,s,n,r,d);_=1===t.length?t[0]:t.map((t=>t[0]))}else y?_=_0(i,r,d,e.coordinatesOffset):c&&(_=S0(e.positions,r,e.regionRelative));return{points:_}}_markerLayout(){var t,e,i,s;const n=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const s=this._startRelativeSeries,r=this._endRelativeSeries,{multiSegment:a,mainSegmentIndex:o}=this._spec.line||{},{connectDirection:l,expandDistance:h=0}=this._spec;let c;if(nD(h)){const t=s.getRegion(),e=t.getLayoutStartPoint(),i=r.getRegion(),n=i.getLayoutStartPoint();if("bottom"===l||"top"===l){const s=Math.abs(Math.min(e.y,n.y)-Math.max(e.y+t.getLayoutRect().height,n.y+i.getLayoutRect().height));c=Number(h.substring(0,h.length-1))*s/100}else{const s=Math.abs(Math.min(e.x,n.x)-Math.max(e.x+t.getLayoutRect().width,n.x+i.getLayoutRect().width));c=Number(h.substring(0,h.length-1))*s/100}}else c=h;const{points:d,limitRect:u}=n,g=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(d[0],d[1],l,c);let f;f=a&&p(o)?{position:"middle",autoRotate:!1}:Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(d[0],d[1],l,c));const m=Y((null!==(e=null===(t=this._markerComponent)||void 0===t?void 0:t.attribute)&&void 0!==e?e:{}).label),v=Y(n.label),y=Y(this._spec.label);null===(i=this._markerComponent)||void 0===i||i.setAttributes({points:a?[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]]]:g,label:v.map(((t,e)=>{var i,s,n,r;let a=0,o=0,l=null!==(i=f.dx)&&void 0!==i?i:0,h=null!==(s=f.dy)&&void 0!==s?s:0;const c=null!==(n=y[e])&&void 0!==n?n:y[0];return k(null==c?void 0:c.refX)&&(a+=c.refX),k(null==c?void 0:c.refY)&&(o+=c.refY),k(null==c?void 0:c.dx)&&(l+=c.dx),k(null==c?void 0:c.dy)&&(h+=c.dy),Object.assign(Object.assign(Object.assign({},t),f),{refX:a,refY:o,dx:l,dy:h,textStyle:Object.assign(Object.assign({},null===(r=m[e])||void 0===r?void 0:r.textStyle),{textAlign:"center",textBaseline:"middle"})})})),limitRect:u,multiSegment:a,mainSegmentIndex:o,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(s=this._markerComponent)||void 0===s||s.setAttributes(n)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:c,doCoordinatesProcess:d}=B0(n);if(c)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(d){if(t=this._processSpecCoo(n),i=!1,e=new Ba(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&p(n.process.x)&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&p(n.process.y)&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&p(n.process.xy)){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}U0.type=r.markLine,U0.coordinateType="cartesian",U0.builtInTheme={markLine:V0};const W0=()=>{AD.registerComponent(U0.type,U0),vI()};class G0 extends j0{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=B0(this._spec);return e||i?new xI(t):new yI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:c,doRadAngProcess:d,doCoordinatesProcess:u}=B0(e);let p=[],g={};const f={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||c||d){const t=y0(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:f}:{points:p.map((t=>ce(f,t.radius,t.angle)))}}else u&&(p=b0(i,r,a),g={points:p.map((t=>ce(f,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=B0(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}G0.type=r.polarMarkLine,G0.coordinateType="polar",G0.builtInTheme={polarMarkLine:V0};const Y0=()=>{AD.registerComponent(G0.type,G0),xI._animate=JL,vI()};class X0 extends NN{get orient(){return this._orient}constructor(e,i){super(e,i),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=t.LayoutZIndex.Title,this.layoutLevel=t.LayoutLevel.Title,this._orient="top",this._orient=sD(e.orient)?e.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return Yj(t,this.specKey,r.title,(t=>!1!==t.visible))}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}afterSetLayoutStartPoint(t){k(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),k(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:k(t.width())?t.width():0,height:this._spec.height?this._spec.height:k(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o;if(!1===this._spec.visible)return{visible:!1};const l=this.getLayoutRect(),h=aD(this._spec.width,l.width,null,l.width),c=aD(this._spec.maxWidth,l.width,null,l.width),d=Math.max(Math.min(h,c,l.width),0),u=Object.assign(Object.assign({},H(this._spec,["padding"])),{textType:null!==(t=this._spec.textType)&&void 0!==t?t:"text",text:null!==(e=this._spec.text)&&void 0!==e?e:"",subtextType:null!==(i=this._spec.subtextType)&&void 0!==i?i:"text",subtext:null!==(s=this._spec.subtext)&&void 0!==s?s:"",x:null!==(n=this._spec.x)&&void 0!==n?n:0,y:null!==(r=this._spec.y)&&void 0!==r?r:0,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:d,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(a=this._spec.align)&&void 0!==a?a:"left",verticalAlign:null!==(o=this._spec.verticalAlign)&&void 0!==o?o:"top",textStyle:Object.assign({width:d,maxLineWidth:d},this._spec.textStyle),subtextStyle:Object.assign({maxLineWidth:d},this._spec.subtextStyle)});return p(this._spec.width)&&(u.textStyle.width=Math.max(h,l.width),u.subtextStyle.width=u.textStyle.width),u}_createOrUpdateTitleComponent(t){if(this._titleComponent)U(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new XI(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}}X0.type=r.title,X0.specKey=r.title,X0.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"}}}};const $0=()=>{AD.registerComponent(X0.type,X0)};class K0 extends F0{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=t.LayoutZIndex.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=P0(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o;const l=Y(null!==(t=this._spec.label)&&void 0!==t?t:{}),h={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:M0(OF(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData,this._markAttributeContext),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:l.map((t=>k0(t,this._markerData,this._markAttributeContext))),state:{area:T0(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData,this._markAttributeContext),label:l.map((t=>T0(t.state,this._markerData,this._markAttributeContext))),labelBackground:l.map((t=>{var e;return T0(null===(e=t.labelBackground)||void 0===e?void 0:e.state,this._markerData,this._markAttributeContext)}))},animation:null!==(o=this._spec.animation)&&void 0!==o&&o,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(h)}_markerLayout(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=this._computePointsAttr(),o=this._getRelativeDataView().latestData,l=i?i.latestData[0]&&i.latestData[0].latestData?i.latestData[0].latestData:i.latestData:o;let h;if(e.clip||Y(e.label).some((t=>null==t?void 0:t.confine))){const{minX:t,maxX:e,minY:i,maxY:a}=A0([s.getRegion(),n.getRegion(),r.getRegion()]);h={x:t,y:i,width:e-t,height:a-i}}if(this._markerComponent){const e=Y(null===(t=this._markerComponent.attribute)||void 0===t?void 0:t.label),i=Y(this._spec.label);this._markerComponent.setAttributes(Object.assign(Object.assign({},a),{label:e.map(((t,e)=>{const s=i[e]||{};return Object.assign(Object.assign({},t),{text:s.formatMethod?s.formatMethod(l,o):null==t?void 0:t.text})})),limitRect:h,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=P0(t);if(!(e||i||s||n||r||a||o))return null;this._initCommonDataView()}}K0.specKey="markArea";const q0={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}};class Z0 extends K0{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new bI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=P0(e),c=p(e.positions),d=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],g=[];if(l){g=v0(i,s,n,r,d);const[t,e]=g;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){g=v0(i,s,n,r,d);const[t,e]=g;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=_0(i,r,d,e.coordinatesOffset):c&&(u=S0(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=P0(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}Z0.type=r.markArea,Z0.coordinateType="cartesian",Z0.builtInTheme={markArea:q0};const J0=()=>{AD.registerComponent(Z0.type,Z0),_I()};class Q0 extends K0{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=P0(this._spec);return i||e||s?new SI(t):new bI(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=P0(e),c=null!==(t=e.autoRange)&&void 0!==t&&t;let d,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=y0(i,s,n,r,c);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(d=b0(i,r,c),u={points:d.map((t=>ce(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=P0(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}Q0.type=r.polarMarkArea,Q0.coordinateType="polar",Q0.builtInTheme={polarMarkArea:q0};const t1=()=>{AD.registerComponent(Q0.type,Q0),SI._animate=tI,_I()},e1=t=>OF(Object.assign({},t)),i1=t=>Object.assign(Object.assign({},t),{style:Object.assign({},OF(t.style))}),s1=t=>{var e,i,s,n,r,a,o,l,h,c,d,u,p,g,f;const m=e1(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),v=e1(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),y=(_=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},OF(Object.assign({},_)));var _;const b=i1(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),x=i1(null!==(c=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==c?c:{}),S=i1(null!==(u=null===(d=null==t?void 0:t.controller)||void 0===d?void 0:d.backward)&&void 0!==u?u:{}),A=i1(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),k=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(f=t.orient)&&void 0!==f?f:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:m,railStyle:v,handlerStyle:y}),controller:Object.assign(Object.assign({},t.controller),{start:b,pause:x,backward:S,forward:A})});return t.visible||(k.controller.visible=!1,k.slider.visible=!1),k},n1=t=>"left"===t||"right"===t,r1=t=>"top"===t||"bottom"===t,a1={visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}};class o1 extends NN{constructor(){super(...arguments),this.layoutZIndex=t.LayoutZIndex.Player,this.layoutLevel=t.LayoutLevel.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},s1(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},s1(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?U(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new hO(t):this._playerComponent=new uO(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Y(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Y(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Y(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Y(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=n1(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=n1(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,c=Math.max(...Y(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Y(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Y(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Y(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=c?h-c:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(t.ChartEvent.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&(this._playerComponent.pause(),this._playerComponent.play())})),this._playerComponent.addEventListener(sO.end,(()=>{var e;this.event.emit(t.ChartEvent.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===(e=this._spec)||void 0===e?void 0:e.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(sO.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(sO.backward,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerBackward,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.forward,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerForward,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.play,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerPlay,{model:this,value:{spec:s,index:i,specs:this._specs}})})),this._playerComponent.addEventListener(sO.pause,(e=>{const{index:i}=e.detail,s=this._specs[i];this.event.emit(t.ChartEvent.playerPause,{model:this,value:{spec:s,index:i,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),k(t.x)){const e=n1(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(k(t.y)){const e=r1(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}_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 S(this._spec.width)?Math.min(t.width,Number(this._spec.width)):n1(this._orient)?this._maxSize():t.width}_computeHeight(t){return S(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):r1(this._orient)?this._maxSize():t.height}_computeDx(t){return n1(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return r1(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(e){const i=this._specs[e];this._option.globalInstance.updateFullData(i.data),this.event.emit(t.ChartEvent.playerChange,{model:this,value:{spec:i,index:e,specs:this._specs}})}}o1.builtInTheme={player:a1},o1.specKey="player",o1.type=r.player;const l1=()=>{AD.registerComponent(o1.type,o1)};class h1 extends NN{constructor(e,i){super(e,i),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.Label,this._regions=i.getRegionsInIndex(i.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,U(e,t)||(i.reMake=!0),i}_getDataLabelType(t,e){const 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})=>{const n=i(),r=GO({type:"palette",key:"secondaryFontColor"},this.getColorScheme());return{dataLabels:Y(e).map(((e,i)=>{const a=t(i),o=[],l=e.getGraphics();if(l)return a.data&&a.data.length?a.data.forEach(((t,e)=>{if(l[e]){const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}})):l.forEach((t=>{const{data:e,diffState:n}=t.context;n!==Wz.exit&&e.forEach(((t,{})=>{const e=s(t,{labelIndex:i});u(e.fill)&&(e.fill=r),u(e.data)&&(e.data=t),o.push(e)}))})),m(a.overlap)&&u(a.overlap.size)&&(a.overlap.size=Object.assign({},n)),Object.assign(Object.assign({smartInvert:!1,baseMarkGroupName:e.getProductId(),getBaseMarks:()=>l},a),{type:this._getDataLabelType(e,a.type),data:o})})),size:n}}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getComponent();i&&t.push(i)})),t}clear(){super.clear(),this.getMarks().forEach((t=>{t&&t.clearComponent()}))}}h1.type=r.label;class c1 extends PG{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(){}}c1.type="text",c1.constructorType="label";const d1=()=>{RG(),AD.registerMark(c1.constructorType,c1)};class u1 extends HN{_initTheme(t,e){return{spec:t,theme:this._theme}}}class p1 extends h1{constructor(e,i){super(e,i),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=u1,this.layoutZIndex=t.LayoutZIndex.Label,this._layoutRule=e.labelLayout||"series"}static getSpecInfo(t,e){const i=[],s=(null==e?void 0:e.region)||[];return s.forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&(this._labelInfoMap.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(t.ChartEvent.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.disableAnimation()})),this.event.on(NF.AFTER_MARK_RENDER_END,e)}));const e=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getComponent();i&&i.enableAnimation()})),this.event.off(NF.AFTER_MARK_RENDER_END,e)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),PO(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n<i.length;n++){const r=i[n],a=t.getMarkInName(r);a&&e[r].forEach(((e,i)=>{var n,o,l;if(e.visible){const h=this._labelInfoMap.get(s),c=this._createMark({type:"label",name:`${null!==(n=t.userId)&&void 0!==n?n:t.id}-${r}-label-${i}`},{attributeContext:t.getMarkAttributeContext()});e.showRelatedMarkTooltip&&(null===(l=null===(o=t.tooltipHelper)||void 0===o?void 0:o.activeTriggerSet.mark)||void 0===l||l.add(c)),c.setTarget(a),h.push({labelMark:c,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){const t={};this._labelComponentMap.forEach(((e,i)=>{t[i.name]=i})),this._labelInfoMap.forEach(((e,i)=>{if("region"===this._layoutRule){let s=!1;const n=`${i.getGroupMark().name}-label-component`;let r=t[n];r||(s=!0,r=this._createMark({type:"component",name:n},{componentType:"label"},{support3d:this._spec.support3d})),r&&(s&&(r.setSkipBeforeLayouted(!0),this._marks.addMark(r),e.forEach((t=>{var e;null===(e=t.baseMark.getData())||void 0===e||e.addRelatedMark(r)}))),e[0]&&p(e[0].labelSpec.zIndex)&&r.setMarkConfig({zIndex:e[0].labelSpec.zIndex}),this._labelComponentMap.set(r,(()=>this._labelInfoMap.get(i))),t[n]=null)}else e.forEach(((e,s)=>{var n;let r=!1;const a=`${e.labelMark.name}-component`;let o=t[a];o||(r=!0,o=this._createMark({type:"component",name:a},{componentType:"label",noSeparateStyle:!0},{support3d:e.baseMark.getMarkConfig().support3d})),o&&(p(e.labelSpec.zIndex)&&o.setMarkConfig({zIndex:e.labelSpec.zIndex}),r&&(o.setSkipBeforeLayouted(!0),this._marks.addMark(o),null===(n=e.baseMark.getData())||void 0===n||n.addRelatedMark(o)),this._labelComponentMap.set(o,(()=>this._labelInfoMap.get(i)[s])),t[a]=null)}))})),Object.keys(t).forEach((e=>{const i=t[e];i&&(i.release(),this._labelComponentMap.delete(i))}))}_initTextMarkStyle(){this._labelComponentMap.forEach(((t,e)=>{Y(t()).forEach((({labelMark:t})=>{t.setComponent(e)}))})),this._labelInfoMap.forEach((e=>{e.forEach((e=>{var i,s;const{labelMark:n,labelSpec:r,series:a}=e;if(this.initMarkStyleWithSpec(n,r),d(null==r?void 0:r.getStyleHandler)){const t=r.getStyleHandler(a);null==t||t.call(a,n,r)}(null===(s=null===(i=n.stateStyle)||void 0===i?void 0:i.normal)||void 0===s?void 0:s.lineWidth)&&n.setAttribute("stroke",a.getColorAttribute(),"normal",t.AttributeLevel.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();_(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e,t.map((({baseMark:t})=>t)),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e,i,[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.setMarkConfig({interactive:!1}),t.setSimpleStyle({labelStyle:t=>{var e,n;const r=i[t],{labelSpec:a,labelMark:o,series:l}=r,h=o.getRule(),c=this._interactiveConfig(a),d=null!==(n=null===(e=this._spec)||void 0===e?void 0:e.centerOffset)&&void 0!==n?n:0;let u=SD({textStyle:Object.assign({pickable:!0===a.interactive},a.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},ZW(h,r),Object.assign(Object.assign(Object.assign({},H(a,["position","style","state","type","stackDataFilterType","getStyleHandler"])),c),{centerOffset:d}),a.stackDataFilterType?{dataFilter:"min"===a.stackDataFilterType?t=>t.filter((t=>t.data[cF])):t=>t.filter((t=>t.data[hF]))}:{});return l&&l.parseLabelStyle&&(u=l.parseLabelStyle(u,a,o)),"line"!==h&&"area"!==h||(u.type=h),u},size:()=>{var t;return Object.assign({padding:null===(t=i[0].labelSpec.overlap)||void 0===t?void 0:t.padding},i[0].series.getRegion().getLayoutRect())},itemEncoder:(t,{labelIndex:e})=>i[e]&&!i[e].labelMark.skipEncode?JW(i[e],t,i[e].labelSpec.formatMethod,i[e].labelSpec.formatter):{data:t}}),this._setTransformOfComponent(t,e)}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=_(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i})}))}getLabelInfoByTextGraphic(t){let e;const i=null==t?void 0:t.parent,s=null==i?void 0:i.parent;if(s){const t=s.getChildren().indexOf(i);this._labelComponentMap.forEach(((i,n)=>{n.getComponent()===s&&(e=Y(i())[t])}))}return e}}p1.type=r.label,p1.specKey="label",p1.transformerConstructor=u1;const g1=()=>{AD.registerGraphicComponent(p1.type,(t=>new bL(t))),d1(),GN(),AD.registerComponent(p1.type,p1,!0,1/0)};class f1 extends h1{constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=t.LayoutZIndex.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var e;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[oF]},"normal",t.AttributeLevel.Default);const i=this._getSeries();null===(e=i.initTotalLabelMarkStyle)||void 0===e||e.call(i,this._textMark)}_initLabelComponent(){var t;const e=this._getSeries(),i=this._createMark({type:"component",name:`${null!==(t=e.name)&&void 0!==t?t:e.type}-total-label-component`},{componentType:"label"},{support3d:this._spec.support3d});i&&(this._marks.addMark(i),e.getData().addRelatedMark(i))}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.setMarkConfig({interactive:!1}),e.setSimpleStyle({labelStyle:()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r,position:a="top"}=this._spec,o=this._interactiveConfig(this._spec);return SD({textStyle:{pickable:!0===this._spec.interactive},position:m1(t,this._baseMark.type,a),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>"bottom"===a?t.data[cF]:t.data[hF]))},o))}},size:()=>{var t;return Object.assign({padding:null===(t=this._spec.overlap)||void 0===t?void 0:t.padding},this._regions[0].getLayoutRect())},itemEncoder:e=>JW({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod)}),this._setTransformOfComponent(e,this._baseMark)}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function m1(t,e,i="top"){var s,n;let r;const{direction:a}=t;let o;o="bottom"===i?{vertical:["bottom","top"],horizontal:["left","right"]}:{vertical:["top","bottom"],horizontal:["right","left"]};const l=("horizontal"===a?null===(s=t.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=t.getYAxisHelper())||void 0===n?void 0:n.isInverse())?1:0;switch(e){case"rect":case"symbol":r=o[a][l];break;default:r="top"}return r}f1.type=r.totalLabel,f1.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"}}}},f1.specKey="totalLabel";const v1=()=>{AD.registerGraphicComponent(f1.type,(t=>new bL(t))),d1(),GN(),AD.registerComponent(f1.type,f1,!0)};class y1 extends F0{constructor(){super(...arguments),this.specKey="markPoint",this.layoutZIndex=t.LayoutZIndex.MarkPoint}static _getMarkerCoordinateType(t){const{doPolarProcess:e,doGeoProcess:i}=R0(t);return"polar"===t.coordinateType||e?"polar":"geo"===t.coordinateType||i?"geo":"cartesian"}_createMarkerComponent(){var t,i,s,n,r,a,o,l,h,c,d,u,p,g,f,m,v,y,_,b,x,S,A,k,T,M,C,w,E,B,P,R;const{itemContent:L={},itemLine:I={},targetSymbol:O={}}=this._spec,D=L,{type:F="text",text:z,symbol:H,image:N,richText:V,customMark:U,textStyle:W,symbolStyle:G,imageStyle:Y,richTextStyle:X,customMarkStyle:$,style:K={},state:q={}}=D,Z=e(D,["type","text","symbol","image","richText","customMark","textStyle","symbolStyle","imageStyle","richTextStyle","customMarkStyle","style","state"]);let J=null,Q=null,tt={};"text"===F?(J=null!==(t=null==z?void 0:z.state)&&void 0!==t?t:q,tt={dx:0,dy:0},Q=k0(j(tt,null!==(i=null!=z?z:W)&&void 0!==i?i:K),this._markerData,this._markAttributeContext)):"richText"===F?(J=null!==(s=null==V?void 0:V.state)&&void 0!==s?s:q,tt={width:100,height:100},Q=M0(j(tt,null!==(r=null!==(n=null==V?void 0:V.style)&&void 0!==n?n:X)&&void 0!==r?r:K),this._markerData,this._markAttributeContext)):"symbol"===F?(J=null!==(a=null==H?void 0:H.state)&&void 0!==a?a:q,tt={symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},Q=OF(M0(j(tt,null!==(l=null!==(o=null==H?void 0:H.style)&&void 0!==o?o:G)&&void 0!==l?l:K),this._markerData,this._markAttributeContext))):"image"===F?(J=null!==(h=null==N?void 0:N.state)&&void 0!==h?h:q,tt={width:80,height:80},Q=M0(j(tt,null!==(d=null!==(c=null==N?void 0:N.style)&&void 0!==c?c:Y)&&void 0!==d?d:K),this._markerData,this._markAttributeContext)):"custom"===F&&(J=null!==(u=null==U?void 0:U.state)&&void 0!==u?u:q,Q=M0(null!==(g=null!==(p=null==U?void 0:U.style)&&void 0!==p?p:$)&&void 0!==g?g:K,this._markerData,this._markAttributeContext));const et={zIndex:this.layoutZIndex,interactive:null===(f=this._spec.interactive)||void 0===f||f,hover:null===(m=this._spec.interactive)||void 0===m||m,select:null===(v=this._spec.interactive)||void 0===v||v,position:{x:0,y:0},clipInRange:null!==(y=this._spec.clip)&&void 0!==y&&y,itemContent:Object.assign(Object.assign({type:F,offsetX:C0(L.offsetX,this._relativeSeries.getRegion()),offsetY:C0(L.offsetX,this._relativeSeries.getRegion())},Z),{style:M0(Q,this._markerData,this._markAttributeContext)}),targetSymbol:{offset:null!==(_=O.offset)&&void 0!==_?_:0,visible:null!==(b=O.visible)&&void 0!==b&&b,size:null!==(x=O.size)&&void 0!==x?x:20,style:M0(O.style,this._markerData,this._markAttributeContext)},state:{line:T0(null!==(A=null===(S=this._spec.itemLine.line)||void 0===S?void 0:S.state)&&void 0!==A?A:{},this._markerData,this._markAttributeContext),lineStartSymbol:T0(null!==(T=null===(k=this._spec.itemLine.startSymbol)||void 0===k?void 0:k.state)&&void 0!==T?T:{},this._markerData,this._markAttributeContext),lineEndSymbol:T0(null!==(C=null===(M=this._spec.itemLine.endSymbol)||void 0===M?void 0:M.state)&&void 0!==C?C:{},this._markerData,this._markAttributeContext),itemContent:T0(J,this._markerData,this._markAttributeContext),textBackground:T0(null===(E=null===(w=this._spec.itemContent.text)||void 0===w?void 0:w.labelBackground)||void 0===E?void 0:E.state,this._markerData,this._markAttributeContext),targetItem:T0(null!==(P=null===(B=this._spec.targetSymbol)||void 0===B?void 0:B.state)&&void 0!==P?P:{},this._markerData,this._markAttributeContext)},animation:null!==(R=this._spec.animation)&&void 0!==R&&R,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate},{visible:it,line:st={}}=I,nt=e(I,["visible","line"]);et.itemLine=!1!==it?Object.assign(Object.assign({},nt),{visible:!0,lineStyle:OF(st.style)}):{visible:!1};return new kI(et)}_markerLayout(){var t,e,i,s,n;const r=this._spec,a=this._markerData,o=this._relativeSeries,{point:l}=this._computePointsAttr(),h=this._getRelativeDataView().latestData,c=a?a.latestData[0]&&a.latestData[0].latestData?a.latestData[0].latestData:a.latestData:h;let d;if(r.clip||(null===(t=r.itemContent)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=A0([o.getRegion()]);d={x:t,y:i,width:e-t,height:s-i}}if(this._markerComponent){const t=null!==(e=this._markerComponent.attribute)&&void 0!==e?e:{},r=null!==(s=null===(i=t.itemContent)||void 0===i?void 0:i.textStyle)&&void 0!==s?s:{};this._markerComponent.setAttributes({position:void 0===l?{x:null,y:null}:l,itemContent:Object.assign(Object.assign({},t.itemContent),{textStyle:Object.assign(Object.assign({},r),{text:(null===(n=this._spec.itemContent.text)||void 0===n?void 0:n.formatMethod)?this._spec.itemContent.text.formatMethod(c,h):r.text}),offsetX:w0(l,t.itemContent.offsetX,this._relativeSeries.getRegion()),offsetY:w0(l,t.itemContent.offsetY,this._relativeSeries.getRegion())}),limitRect:d,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}}_initDataView(){const t=this._spec,{doXYProcess:e,doPolarProcess:i,doGeoProcess:s}=R0(t);(p(t.coordinate)||e||i||s)&&this._initCommonDataView()}}y1.specKey="markPoint";const _1={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 b1 extends y1{constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t,e,i;const s=this._spec,n=this._markerData,r=this._relativeSeries,a=p(s.x)&&p(s.y),o=p(s.coordinate),l=p(s.position),h=null!==(t=null==s?void 0:s.autoRange)&&void 0!==t&&t;let c;return a?c=null===(i=null===(e=v0(n,r,r,r,h))||void 0===e?void 0:e[0])||void 0===i?void 0:i[0]:o?c=_0(n,r,h,s.coordinatesOffset)[0]:l&&(c=S0(s.position,r,s.regionRelative)[0]),{point:c}}_computeOptions(){const t=this._spec,{doXYProcess:e}=R0(t),i=p(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}b1.type=r.markPoint,b1.coordinateType="cartesian",b1.builtInTheme={markPoint:_1};const x1=()=>{AD.registerComponent(b1.type,b1),AI()};class S1 extends y1{constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=y0(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:ce({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}S1.type=r.polarMarkPoint,S1.coordinateType="polar",S1.builtInTheme={polarMarkPoint:_1};const A1=()=>{AD.registerComponent(S1.type,S1),AI()};class k1 extends y1{constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){const t=function(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{p(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}(this._markerData,this._relativeSeries)[0][0];return{point:t}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}k1.type=r.geoMarkPoint,k1.coordinateType="geo",k1.builtInTheme={geoMarkPoint:_1};const T1=()=>{AD.registerComponent(k1.type,k1),AI()},M1="inBrush",C1="outOfBrush";class w1 extends NN{constructor(){super(...arguments),this.layoutType="none",this.type=r.brush,this.name=r.brush,this.specKey="brush",this.layoutZIndex=t.LayoutZIndex.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 Yj(t,this.specKey,this.type,(t=>!1!==t.visible))}init(){const e=this._transformBrushedMarkAttr(this._spec.inBrush),i=this._transformBrushedMarkAttr(this._spec.outOfBrush);this._option.getAllSeries().forEach((s=>{s.getActiveMarks().forEach((n=>{n&&(s.setMarkStyle(n,Object.assign({},e),M1,t.AttributeLevel.Series),s.setMarkStyle(n,Object.assign({},i),C1,t.AttributeLevel.Series))}))}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Y(t).includes(n.userId.toString())||e&&Y(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_bindRegions(){p(this._spec.regionId)||p(this._spec.regionIndex)?this._relativeRegions=this._option.getRegionsInUserIdOrIndex(Y(this._spec.regionId),Y(this._spec.regionIndex)):this._relativeRegions=this._option.getAllRegions()}_bindLinkedSeries(){(p(this._spec.brushLinkSeriesId)||p(this._spec.brushLinkSeriesIndex))&&(this._linkedSeries=this._option.getSeriesInUserIdOrIndex(Y(this._spec.brushLinkSeriesId),Y(this._spec.brushLinkSeriesIndex)))}_initRegionAxisMap(){p(this._spec.axisId)?Y(this._spec.axisId).forEach((t=>{this._releatedAxes.push(this._option.getComponentByUserId(t))})):p(this._spec.axisIndex)?Y(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)}));const i=super._compareSpec(t,e);return U(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(){var t;if(super.onLayoutEnd(),this._option.disableTriggerEvent)return;(null===(t=this._spec.visible)||void 0===t||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){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild()}_createBrushComponent(e,i){var s,n;const r=this._getBrushInteractiveAttr(e),a=new mO(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:OF(null===(s=this._spec)||void 0===s?void 0:s.style)},r),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));a.id=null!==(n=this._spec.id)&&void 0!==n?n:`brush-${this.id}`,this.getContainer().add(a),this._brushComponents.push(a),this._cacheInteractiveRangeAttrs.push(r),a.addEventListener(cO.brushActive,(s=>{this._initMarkBrushState(i,C1),this._emitEvent(t.ChartEvent.brushActive,e)})),a.addEventListener(cO.drawStart,(i=>{this._setRegionMarkPickable(e,!0),this._emitEvent(t.ChartEvent.brushStart,e)})),a.addEventListener(cO.moveStart,(i=>{this._setRegionMarkPickable(e,!0),this._emitEvent(t.ChartEvent.brushStart,e)})),a.addEventListener(cO.drawing,(i=>{this._setRegionMarkPickable(e,!1),this._handleBrushChange(e,i),this._emitEvent(t.ChartEvent.brushChange,e)})),a.addEventListener(cO.moving,(i=>{this._setRegionMarkPickable(e,!1),this._handleBrushChange(e,i),this._emitEvent(t.ChartEvent.brushChange,e)})),a.addEventListener(cO.brushClear,(s=>{this._setRegionMarkPickable(e,!0),this._initMarkBrushState(i,""),this._emitEvent(t.ChartEvent.brushClear,e)})),a.addEventListener(cO.drawEnd,(s=>{var n;this._setRegionMarkPickable(e,!0);const{operateMask:r}=s.detail,{updateElementsState:a=!0}=this._spec;if(null===(n=this._spec)||void 0===n?void 0:n.onBrushEnd)!0===this._spec.onBrushEnd(s)?(this.clearGraphic(),this._initMarkBrushState(i,""),this._emitEvent(t.ChartEvent.brushClear,e)):(this._spec.onBrushEnd(s),this._emitEvent(t.ChartEvent.brushEnd,e));else{const i=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&i.length>0||!a)&&this._setAxisAndDataZoom(r,e),this._emitEvent(t.ChartEvent.brushEnd,e)}})),a.addEventListener(cO.moveEnd,(i=>{this._setRegionMarkPickable(e,!0);const{operateMask:s}=i.detail,{updateElementsState:n=!0}=this._spec,r=this._extendDataInBrush(this._inBrushElementsMap);(!this._spec.zoomWhenEmpty&&r.length>0||n)&&this._setAxisAndDataZoom(s,e),this._emitEvent(t.ChartEvent.brushEnd,e)}))}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},OF(t)),e)}_handleBrushChange(t,e){const{operateMask:i}=e.detail,{updateElementsState:s=!0}=this._spec;s&&(this._reconfigItem(i,t),this._reconfigLinkedItem(i,t))}_extendDataInBrush(t){var e,i;const s=[];for(const n in t)for(const r in t[n])s.push(Object.assign({},null===(i=null===(e=t[n][r].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]));return s}_extendDatumOutOfBrush(t){var e,i;const s=[];for(const n in t)s.push(null===(i=null===(e=t[n].context)||void 0===e?void 0:e.data)||void 0===i?void 0:i[0]);return s}_emitEvent(t,e){var i;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===(i=this._option)||void 0===i?void 0:i.globalInstance})}_reconfigItem(t,e){var i,s,n;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const r=null!==(n=null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points)&&void 0!==n?n:[],{a:a,b:o,c:l,d:h,e:c,f:d}=t.globalTransMatrix,u=r.map((t=>({x:a*t.x+l*t.y+c,y:o*t.x+h*t.y+d}))),{markTypeFilter:p=[]}=this._spec;this._itemMap[e.id].forEach((e=>{if(p.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;const a=e.id+"_"+i.context.key,o=this._isBrushContainItem(t.globalAABBBounds,u,i);(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[a])&&o?(i.addState(M1,!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][a]=i,delete this._outOfBrushElementsMap[a]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!o&&(i.removeState(M1),i.addState(C1,!0),this._outOfBrushElementsMap[a]=i,delete this._inBrushElementsMap[t.name][a])}))}))}_reconfigLinkedItem(t,e){var i;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points))return;const s=e.getLayoutStartPoint(),n=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{var i,r;if(!n.includes(e.id)){const n=e.getRegion().getLayoutStartPoint(),a=n.x-s.x,o=n.y-s.y,l=null!==(r=null===(i=null==t?void 0:t.attribute)||void 0===i?void 0:i.points)&&void 0!==r?r:[],{a:h,b:c,c:d,d:u,e:p,f:g}=t.globalTransMatrix,f=a||0,m=o||0,v=l.map((t=>({x:h*t.x+d*t.y+p+f,y:c*t.x+u*t.y+g+m})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+f,t.globalAABBBounds.y1+m,t.globalAABBBounds.x2+f,t.globalAABBBounds.y2+m);const{markTypeFilter:y=[]}=this._spec;this._linkedItemMap[e.id].forEach((e=>{if(y.includes(e.type))return;const i=e.getGraphics();i&&i.length&&i.forEach((i=>{var s,n,r;i.context;const a=e.id+"_"+i.context.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[a])&&this._isBrushContainItem(t.globalAABBBounds,v,i)?(i.addState(M1,!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][a]=i,delete this._linkedOutOfBrushElementsMap[a]):(null===(r=null===(n=this._linkedInBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[a])&&!this._isBrushContainItem(t.globalAABBBounds,v,i)&&(i.removeState(M1),i.addState(C1,!0),this._linkedOutOfBrushElementsMap[a]=i)}))}))}}))}_isBrushContainItem(t,e,i){let s=[];if(["symbol","rect"].includes(i.type)){const{x1:t,x2:n,y1:r,y2:a}=null==i?void 0:i.globalAABBBounds;return s=[{x:t,y:r},{x:n,y:r},{x:n,y:a},{x:t,y:a}],function(t,e){for(let i=0;i<e.length;i++){if(Re(t,e[i].x,e[i].y))return!0;if(i>0&&Pe(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}(e,s)}return t.intersects(i.globalAABBBounds)}_initItemMap(t,e,i){const{markTypeFilter:s=[]}=this._spec;Object.entries(t).forEach((([t,n])=>{n.forEach((t=>{if(s.includes(t.type))return;const n=t.getGraphics();n&&n.length&&n.forEach((s=>{const n=t.id+"_"+s.context.key;s.removeState(M1),s.removeState(C1),i&&s.addState(i,!0),e[n]=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){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:c}=s,d=r?"x":"y",u=r?o:h,p=r?l:c;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[d]),r=s.getScale().invert(p-e.getLayoutStartPoint()[d]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),c=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,c),Math.max(h,c),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:c,startValue:i.statePointToData(h),endValue:i.statePointToData(c)})}else{const i=t.getScale().range(),s=null!==(n=t.scaleRangeFactor())&&void 0!==n?n:[0,1],r=X(i)<i[0],o=u-e.getLayoutStartPoint()[d],l=p-e.getLayoutStartPoint()[d],h=r?Math.min(o,l):Math.max(o,l),c=r?Math.max(o,l):Math.min(o,l),g=(c-i[0])/(X(i)-i[0])*(s[1]-s[0])+s[0],f=(h-i[0])/(X(i)-i[0])*(s[1]-s[0])+s[0],m=this._stateClamp(g-a),v=this._stateClamp(f+a);t.scaleRangeFactor([m,v]),t.effect.scaleUpdate(),this._zoomRecord.push({operateComponent:t,start:m,end:v,startValue:t.getScale().invert(c),endValue:t.getScale().invert(h)})}}))}}_getNeedClearVRenderComponents(){return this._brushComponents}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach(((e,i)=>{this._initMarkBrushState(i,""),e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}w1.type=r.brush,w1.builtInTheme={brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0}},w1.specKey="brush";const E1=()=>{AD.registerComponent(w1.type,w1)};class B1 extends NN{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.CustomMark,this.layoutLevel=t.LayoutLevel.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;let t=null;if(this._spec.parent){const e=this.getChart().getAllMarks().find((t=>t.getUserId()===this._spec.parent));"group"===e.type&&(t=e)}this._createExtensionMark(this._spec,t,`${YD}_series_${this.id}_extensionMark`,0)}_createExtensionMark(t,e,i,s=0){var n,r;const a=this._createMark({type:t.type,name:p(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(p(t.id)&&a.setUserId(t.id),(null===(n=this._option.globalInstance)||void 0===n?void 0:n.isAnimationEnable())&&t.animation){const e=xH({},SH(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(u(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e)}))),p(t.dataId)||k(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return U(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?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Ve).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Ve;return this.getMarks().forEach((e=>{const 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);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}getVRenderComponents(){const t=[],e=i=>{if(i&&"group"===i.type)i.getMarks().forEach((t=>{e(t)}));else if("component"===i.type){const e=null==i?void 0:i.getComponent();e&&t.push(e)}};return this.getMarks().forEach((t=>{e(t)})),t}}B1.type=r.customMark,B1.specKey="customMark";const P1=()=>{AD.registerComponent(B1.type,B1)};class R1{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(k(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:d(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&p(e.modelId)){if(p(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&p(e.modelKey)&&"modelIndex"in e&&p(e.modelIndex)){if((null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0}return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r<t[e]+(null!==(i=t[`${e}Span`])&&void 0!==i?i:1);r++)n+=s[r].value;return n}getSizeFromUser(t,e){var i,s;const n="col"===e?this._colSize:this._rowSize;if(!(null===(i=n[t[e]])||void 0===i?void 0:i.isUserSetting))return;let r=0;for(let i=t[e];i<t[e]+(null!==(s=t[`${e}Span`])&&void 0!==s?s:1);i++){if(!n[i].isUserSetting)return;r+=n[i].value}return r}setItemLayoutSizeToGrid(t,e){if(L1(t)){if(e.colSpan&&e.colSpan>1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;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;const s=this.getItemGridInfo(t);return{width:(null!==(e=this.getSizeFromGrid(s,"col"))&&void 0!==e?e:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(i=this.getSizeFromGrid(s,"row"))&&void 0!==i?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));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>L1(t))),a=n.filter((t=>!L1(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>L1(t))),h=o.filter((t=>!L1(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);k(h.width)||(h.width=l.width),k(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function L1(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}R1.type="grid";const I1=()=>{AD.registerLayout(R1.type,R1)},O1=()=>{Lh.load(XC)},D1="vchart-tooltip",F1=`${D1}-container`,z1=`${D1}-title`,j1=`${D1}-content-box`,H1={offsetX:10,offsetY:10},N1="99999999999999";function V1(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\(/g,"(").replace(/ /g," ")}const U1=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:t.offsetHeight>0?e.height/t.offsetHeight:1):1,W1=t=>y(t)&&""!==(null==t?void 0:t.trim())||S(t)?V1(t):"",G1=(t,e)=>{let i;if(p(t))if(S(t))i=t;else if(d(t)){const s=t(e);S(s)&&(i=s)}return i},Y1={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]},X1=(t,e,i=2)=>{var s,n;return null!==(n=null===(s=Y1[t])||void 0===s?void 0:s["x"===e?0:1])&&void 0!==n?n:i};class $1 extends fN{constructor(){super(...arguments),this._visible=!0,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this.changeTooltip=(t,e,i)=>this._isReleased?1:t?this.changeTooltipPosition(e,i):(this._updateTooltip(!1,e),0),this.changeTooltipPosition=(t,e)=>{var i,s,n,r,a;if(this._isReleased)return 1;const o=t.event,{tooltipSpec:l,activeTooltipSpec:h,changePositionOnly:c}=t;if(!h)return 1;const d=h.activeType;if(h.handler)return null!==(n=null===(s=(i=h.handler).showTooltip)||void 0===s?void 0:s.call(i,d,e,t))&&void 0!==n?n:0;const u=h,p=this._getActualTooltipPosition(h,t,this._getTooltipBoxSize(h,c));h.position=p;const g=null!==(r=h.updatePosition)&&void 0!==r?r:null===(a=l[d])||void 0===a?void 0:a.updatePosition;g&&(h.position=g(h.position,e,t));let f=!1!==(null==u?void 0:u.visible);return e&&"pointerout"!==o.type&&h.visible&&(h.title||h.content)||(f=!1),this._updateTooltip(f,Object.assign(Object.assign({},t),{changePositionOnly:c})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,h,c,u;const f=this._chartOption.getRectByDimensionData,{tooltipSpec:m}=e,v={x:1/0,y:1/0};if(!m)return v;const y=e.event,{activeType:_,data:b}=t,x="dimension"===_?null===(n=null===(s=b[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==b?void 0:b[0],{offsetX:A,offsetY:T}=this._option,M=m[_],C=qj(null==M?void 0:M.position,b,e),w=null!==(r=qj(null==M?void 0:M.positionMode,b,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:E=0,height:B=0}=null!=i?i:{},P="canvas"===m.renderMode,R=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),L=null!==(o=null==R?void 0:R.width)&&void 0!==o?o:XD,I=null!==(l=null==R?void 0:R.height)&&void 0!==l?l:$D;let O=!1;const D={width:0,height:0};let F,z={x:0,y:0},j={x:0,y:0},H=1,N=1;const V=q_(this._env);if(V&&!m.confine?(D.width=window.innerWidth,D.height=window.innerHeight):(D.width=L,D.height=I),V&&!P){const t=this._getParentElement(m);j=null!==(c=null===(h=null==t?void 0:t.getBoundingClientRect)||void 0===h?void 0:h.call(t))&&void 0!==c?c:v;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer;F=null==e?void 0:e.getBoundingClientRect(),z={x:F.x-j.x,y:F.y-j.y},H=U1(e,F),N=U1(t,j)}const U=N/H,W={},G={x:C,y:C},Y={x:["left","right"],y:["top","bottom"]},X=({orient:t,mode:i,offset:s},n)=>{var r;let a,o;const l=e.model,h=null==l?void 0:l.getLayoutStartPoint(),c=null!=s?s:"x"===n?A:T;if("mark"===i){O=!0;const t=e.item,i=null==t?void 0:t.AABBBounds;i&&h&&(a=("x"===n?i.x1:i.y1)+h[n],o=("x"===n?i.x2:i.y2)+h[n])}else if(f&&"crosshair"===i&&"cartesian"===(null===(r=null==x?void 0:x.series)||void 0===r?void 0:r.coordinate)&&x.datum&&x.datum.length){O=!0;const t=f(x,h);t&&(a=t.start[n],o=t.end[n])}else G[n]=t;if(O){const e=Y[n][0],i="x"===n?E:B;switch(X1(t,n)){case-2:W[e]=a-i*U-c;break;case-1.5:W[e]=a+c;break;case 0:W[e]=(a+o)/2-i*U/2;break;case-1:W[e]=(a+o)/2-i*U-c;break;case 1:W[e]=(a+o)/2+c;break;case 1.5:W[e]=o-i*U-c;break;case 2:W[e]=o+c}}},$=["x","y"];if(g(C))if(g(K=C)&&(p(K.left)||p(K.right)||p(K.top)||p(K.bottom))){const{left:t,right:e,top:i,bottom:s}=C;W.left=G1(t,y),W.top=G1(i,y),W.right=G1(e,y),W.bottom=G1(s,y)}else(t=>g(t)&&(p(t.x)||p(t.y)))(C)&&$.forEach((t=>{const e=C[t];S(e)||d(e)?W[Y[t][0]]=G1(e,y):X(e,t)}));else p(C)&&(X({orient:C,mode:w},"x"),X({orient:C,mode:w},"y"));var K;const q={x:null,y:null};return $.forEach((t=>{var e;const i="x"===t?E:B,s="x"===t?L:I,n="x"===t?A:T,r=X1(G[t],t);if(k(W[Y[t][0]]))q[t]=W[Y[t][0]];else if(k(W[Y[t][1]]))q[t]=s-i*U-W[Y[t][1]];else{const e="x"===t?y.canvasX:y.canvasY;q[t]=r>0?e+n:0===r?e-i*U/2:e-i*U-n}q[t]*=H,V&&(q[t]+=z[t]),q[t]/=N;const a="x"===t?D.width:D.height,o=m.confine?-(j[t]-(null!==(e=null==F?void 0:F[t])&&void 0!==e?e:0)/H)/N:-j[t]/N,l=a/N+o-i;2!==r&&q[t]<o?O?q[t]=o:(q[t]+=0===r?n+i/2:2*n+i,q[t]>l&&(q[t]=l)):-2!==r&&q[t]>l&&(O?q[t]=l:(q[t]-=0===r?n+i/2:2*n+i,q[t]<o&&(q[t]=o)))})),q}}get env(){return this._env}onAdd(t){super.onAdd(t);const 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;const n=null!==(e=null===(t=this._component)||void 0===t?void 0:t.getSpec())&&void 0!==e?e:{};n.handler?null===(s=(i=n.handler).release)||void 0===s||s.call(i):(this._removeTooltip(),this._isReleased=!0,this._chartOption=null,this._component=null)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return i?{offsetX:null!==(t=i.x)&&void 0!==t?t:H1.offsetX,offsetY:null!==(e=i.y)&&void 0!==e?e:H1.offsetY}:H1}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption()}reInit(){this._initFromSpec()}}$1.specKey="tooltip";const K1=(t,e)=>p(t)?_(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",q1=(t={},e={})=>{var i,s;p(t.fontFamily)&&(e.fontFamily=t.fontFamily);const n=null!==(i=t.fill)&&void 0!==i?i:t.fontColor;return p(n)&&(e.color=n),p(t.fontWeight)&&(e.fontWeight=t.fontWeight),p(t.textAlign)&&(e.textAlign=t.textAlign),p(t.fontSize)&&(e.fontSize=K1(t.fontSize)),p(t.maxWidth)&&(e.maxWidth=K1(t.maxWidth)),t.multiLine||p(t.maxWidth)&&!1!==t.multiLine?(e.whiteSpace="initial",e.wordBreak=null!==(s=t.wordBreak)&&void 0!==s?s:"break-word"):(e.wordBreak="normal",e.whiteSpace="nowrap"),e},Z1=(t={})=>{const{lineHeight:e}=t;return t.fontSize?aD(e,t.fontSize):0},J1=t=>{var e;const{backgroundColor:i,border:s,shadow:n,padding:r}=t,a={borderWidth:`${null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0}px`};let o=null;(null==s?void 0:s.color)&&(a.borderColor=s.color),i&&(a.backgroundColor=i),a.boxShadow=n?`${n.x}px ${n.y}px ${n.blur}px ${n.spread}px ${n.color}`:"initial";const{radius:l}=null!=s?s:{};return p(l)&&(a.borderRadius=k(l)?`${l}px`:`${l}`),r&&(o=oi(r),a.padding=K1(o)),{panelStyle:a,panelPadding:o}};function Q1(t,e){t&&t.style&&e&&Object.keys(e).forEach((i=>{t.style[i]=e[i]}))}const t2=t=>{AD.registerComponentPlugin(t.type,t)};class e2 extends $1{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(e2.type),this.type=mU.dom,this._tooltipContainer=null==K_?void 0:K_.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec().parentElement;if(K_&&t&&t.children&&t.children.length){for(let e=0;e<t.children.length;e++)if(t.children[e].classList.contains(F1)){this._container=t.children[e];break}this._container||(this._container=K_.createElement("div"),this._container.style.position="relative",this._container.style.zIndex=N1,this._container.classList.add(F1),t.appendChild(this._container))}}initRootDom(){var t;const e=this._component.getSpec(),i=document.createElement("div"),s=null===(t=this._chartOption)||void 0===t?void 0:t.getTheme("fontFamily");Q1(i,Object.assign({left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:N1,fontFamily:null!=s?s:fD.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);const s=null===(i=this._rootDom)||void 0===i?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){const{tooltipSpec:n,activeTooltipSpec:r}=e;e.changePositionOnly||(this._tooltipActual=r);const a=this._rootDom;if(a){const{x:o=0,y:l=0}=null!==(i=r.position)&&void 0!==i?i:{};let h={x:o,y:l};const c=this.getVisibility();n.updateElement&&(this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:o,y:l}),n.updateElement(a,r,e),h=this._getActualTooltipPosition(r,e,{width:a.offsetWidth,height:a.offsetHeight}),this._cacheCustomTooltipPosition=h),!c&&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(){const t=this._component.getSpec();this._domStyle=((t={})=>{var e,i,s,n;const{style:r={},enterable:a,transitionDuration:o}=t,{panel:l={},titleLabel:h,shape:c,keyLabel:d,valueLabel:p,spaceRow:g,align:f}=r,{panelStyle:m,panelPadding:v}=J1(l),y={marginTop:"0px",marginBottom:"0px"};m.pointerEvents=a?"auto":"none",o&&(m.transitionDuration=o?`${o}ms`:"initial",m.transitionProperty=o?"transform":"initial",m.transitionTimingFunction=o?"ease-out":"initial"),k(g)&&(y.marginBottom=`${g}px`);const _={width:K1(null!==(e=null==c?void 0:c.size)&&void 0!==e?e:8)},b=q1(h),x=q1(d),S=q1(p),A="right"===f?"marginLeft":"marginRight";"right"===f&&(m.direction="rtl"),u(b.textAlign)&&(b.textAlign="right"===f?"right":"left"),u(x.textAlign)&&(x.textAlign="right"===f?"right":"left"),u(S.textAlign)&&(S.textAlign="right"===f?"left":"right"),_[A]=K1(null!==(i=c.spacing)&&void 0!==i?i:8),x[A]=K1(null!==(s=d.spacing)&&void 0!==s?s:26),S[A]=K1(null!==(n=p.spacing)&&void 0!==n?n:0);const T=Math.max(Z1(p),Z1(d));return y.lineHeight=T>0?`${T}px`:"20px",{panelPadding:v,row:y,panel:m,title:b,shape:_,key:x,value:S}})(t)}_updateDomStringByCol(t){var e;const{title:i={},content:s}=t,n=s&&s.length,r=this._domStyle.row,a=[...this._rootDom.children];let o=a.find((t=>t.className.includes(z1))),l=a.find((t=>t.className.includes(j1)));if(!o&&!1!==i.visible){o=document.createElement("h2");const t=document.createElement("span");o.appendChild(t),o.classList.add(z1),this._rootDom.firstChild?this._rootDom.insertBefore(o,this._rootDom.firstChild):this._rootDom.appendChild(o)}o&&!1!==i.visible?(Q1(o,Object.assign(Object.assign(Object.assign({},this._domStyle.title),n?r:{marginBottom:"0px"}),{marginTop:"0px"})),o.firstChild.innerHTML=`${null!==(e=i.value)&&void 0!==e?e:""}`):o&&!1===i.visible&&o.parentNode.removeChild(o);const h=["shape","key","value"];if(!l&&n&&(l=document.createElement("div"),h.forEach((t=>{const e=document.createElement("div");e.classList.add(`${D1}-column`),e.classList.add(`${D1}-${t}-column`),e.setAttribute("data-col",t),l.appendChild(e)})),l.classList.add(j1),this._rootDom.appendChild(l)),l&&n){const t=[...l.children];Q1(l,{whiteSpace:"nowrap"}),t.forEach(((t,e)=>{const i=t.getAttribute("data-col");if(i&&h.includes(i)){const e="shape"===i&&s.every((t=>!t.hasShape||!t.shapeType));Q1(t,Object.assign(Object.assign({},this._domStyle[i]),{display:e?"none":"inline-block",verticalAlign:"top"}));const n=[...t.children];n.slice(s.length).forEach((t=>{t.parentNode.removeChild(t)})),s.forEach(((e,a)=>{let o=n[a];o||(o=document.createElement("div"),o.classList.add(`${D1}-${i}`),t.appendChild(o));const l=Object.assign({},r);a===s.length-1&&(l.marginBottom="0px"),l.display=!1===e.visible?"none":"block",l.height="initial","key"===i?(o.innerHTML=W1(e.key),e.keyStyle&&q1(e.keyStyle,l)):"value"===i?(o.innerHTML=W1(e.value),e.valueStyle&&q1(e.valueStyle,l)):"shape"===i&&(o.innerHTML=function(t,e){var i,s,n,r,a,o;if(!t||!t.hasShape||!t.shapeType)return"";const l='style="display:inline-block;vertical-align:middle;"',{shapeType:h,shapeFill:c,shapeStroke:d,shapeHollow:u=!1}=t,p=null!==(i=t.shapeSize)&&void 0!==i?i:8,f=t.shapeLineWidth?V1(t.shapeLineWidth)+"px":"0px";let m="currentColor";const v=()=>d?V1(d):m,_=p,b=t=>new Mg({symbolType:t,size:_,fill:!0});let x=b(h);const S=x.getParsedPath();let A,k;if(!S.path&&S.pathStr&&(x=b(S.pathStr)),x.getParsedPath().path){const t=x.getParsedPath().path;k=t.toString(),A=t.bounds}else S.isSvg&&S.svgCache&&(k=S.svgCache.map((t=>t.path.toString())).join(),A=S.svgCache.reduce(((t,e)=>t.union(e.path.bounds)),new Ve));let T=`${A.x1} ${A.y1} ${A.width()} ${A.height()}`;if("0px"!==f){const[t,e,i,s]=T.split(" ").map((t=>Number(t))),n=Number(f.slice(0,-2));T=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!c||y(c)||u)return m=u?"none":c?V1(c):"currentColor",`\n <svg ${l} width="${p}" height="${p}" viewBox="${T}">\n <path\n d="${k}"\n style="fill: ${m}; stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`;if(g(c)){m="gradientColor"+(null!=e?e:"");let t="";const i=(null!==(s=c.stops)&&void 0!==s?s:[]).map((t=>`<stop offset="${V1(t.offset.toString())}" stop-color="${V1(t.color)}"/>`)).join("");return"radial"===c.gradient?t=`<radialGradient id="${m}" cx="50%" cy="50%" r="50%" fx="0%" fy="0%">\n ${i}\n </radialGradient>`:"linear"===c.gradient&&(t=`<linearGradient id="${m}" x1="${100*(null!==(n=c.x0)&&void 0!==n?n:0)}%" y1="${100*(null!==(r=c.y0)&&void 0!==r?r:0)}%" x2="${100*(null!==(a=c.x1)&&void 0!==a?a:0)}%" y2="${100*(null!==(o=c.y1)&&void 0!==o?o:0)}%">\n ${i}\n </linearGradient>`),`\n <svg ${l} width="${p}" height="${p}" viewBox="-0.5 -0.5 1 1">\n ${t}\n <path\n d="${k}"\n style="fill: url(#${m}); stroke: ${v()}; stroke-width: ${f}"\n >\n </path>\n </svg>`}return""}(e,`${this.id}_${a}`)),Q1(o,l)}))}}))}else l&&!n&&l.parentNode.removeChild(l)}_updateDomStyle(t="width",e){var i,s,n,r,a;const o=this._rootDom,l=[...o.children].find((t=>t.className.includes(j1))),h=[...o.children].find((t=>t.className.includes(z1)));if(l){const o=this._component.getSpec(),c={},d=null===(i=o.style)||void 0===i?void 0:i.titleLabel;if(d&&d.autoWidth&&!1!==d.multiLine&&h){const e=[...l.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(l.getBoundingClientRect().width)}px`)}if(p(null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.maxContentHeight)){const t=h&&h.className.includes(z1)?h.getBoundingClientRect().height+(null!==(n=o.style.spaceRow)&&void 0!==n?n:0):0,e=this._chartOption.getChartViewRect(),i=aD(o.style.maxContentHeight,Math.min(e.height,document.body.clientHeight)-t-(this._domStyle.panelPadding?this._domStyle.panelPadding[0]+this._domStyle.panelPadding[1]:0));i>0&&(c.maxHeight=`${i}px`,c.overflowY="auto",c.width=`calc(100% + ${this._domStyle.panelPadding?this._domStyle.panelPadding[1]+"px":"10px"})`,Q1(l,c))}const u=l.children,g=[];if(u){for(let i=0;i<u.length;i++){const s=null!==(r=u[i].children)&&void 0!==r?r:[];for(let i=0;i<s.length;i++){e&&(s[i].style[t]="initial");const n=s[i].getBoundingClientRect()[t];(void 0===g[i]||g[i]<n)&&(g[i]=n)}}for(let e=0;e<u.length;e++){const i=null!==(a=u[e].children)&&void 0!==a?a:[];for(let e=0;e<i.length;e++)i[e].style[t]=`${g[e]}px`}}}}_getParentElement(t){var e;return null!==(e=this._container)&&void 0!==e?e:super._getParentElement(t)}isTooltipShown(){return this.getVisibility()}reInit(){super.reInit(),this._initStyle(),this._rootDom&&Q1(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)))}}e2.type=mU.dom;const i2=()=>{t2(e2)},s2={fontFamily:fD.fontFamily,spacing:10,wordBreak:"break-word"},n2=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>e<s.length-1?t+"\n":t))):s=[t],n=s.map((t=>Object.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},pf||(pf=df.CreateGraphic("richtext",{})),pf.setAttributes(a),pf.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}};function r2(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:s2),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:e,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:p(t.maxWidth)?!1!==t.multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const a2=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return p(a)&&(r.cornerRadius=[a,a,a,a]),r};class o2 extends $1{constructor(){super(o2.type),this.type=mU.canvas,this._attributes=null}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new xO({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_getTooltipBoxSize(t,e){var i,s;if(!e||u(this._attributes)){const e=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme("fontFamily");this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:c}=e,{panel:d={},titleLabel:u,shape:g,keyLabel:f,valueLabel:m,spaceRow:v,align:y}=l,_=oi(d.padding),b=hD(d.padding),x=r2(Object.assign({textAlign:"right"===y?"right":"left"},u),i),S=r2(Object.assign({textAlign:"right"===y?"right":"left"},f),i),A=r2(m,i),k={fill:!0,size:null!==(s=null==g?void 0:g.size)&&void 0!==s?s:8,spacing:null!==(n=null==g?void 0:g.spacing)&&void 0!==n?n:6},T={panel:a2(d),padding:_,title:{},content:[],titleStyle:{value:x,spaceRow:v},contentStyle:{shape:k,key:S,value:A,spaceRow:v},hasContentShape:!1,keyWidth:0,valueWidth:0,enterable:h,transitionDuration:c,align:y},{title:M={},content:C=[]}=t;let w=b.left+b.right,E=b.top+b.bottom,B=0;const P=!!C.length;let R=0,L=0,I=0,O=0;if(P){const t=[],e=[],i=[],s=[];let n=0;T.content=C.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:c="",shapeFill:d,shapeStroke:u,shapeLineWidth:g,shapeSize:f,value:m,isKeyAdaptive:y,spaceRow:_,keyStyle:b,valueStyle:x,shapeHollow:T}=r,M={height:0,spaceRow:null!=_?_:v};if(p(h)){const i=SD({},S,r2(b,void 0,{})),{width:s,height:n,text:r}=n2(h,i);M.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),y?e.push(s):t.push(s),o=Math.max(o,n)}if(p(m)){const t=SD({},A,r2(x,void 0,{})),{width:e,height:s,text:n}=n2(m,t);M.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:c};T?t.stroke=d:t.fill=d,t.stroke=null!=u?u:d,t.lineWidth=g,M.shape=t;const e=null!=f?f:k.size;o=Math.max(e,o),s.push(e)}else M.shape={visible:!1};return M.height=o,n+=o,a<C.length-1&&(n+=M.spaceRow),M})),E+=n,R=t.length?$(t):0,L=e.length?$(e):0,I=i.length?$(i):0,O=s.length?$(s)+k.spacing:0,B=Math.max(O+R+S.spacing+I+A.spacing,O+L,B),T.hasContentShape=!!s.length,T.keyWidth=R,T.valueWidth=I}let D=0,F=0,z=0;const{visible:j=!0,value:H="",valueStyle:N,spaceRow:V}=M;T.title.visible=j,T.title.spaceRow=null!=V?V:v;let U={};const W=()=>U.autoWidth&&!1!==U.multiLine;if(j){U=SD({},x,r2(N,void 0,{})),W()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:P?Math.ceil(B):void 0);const{text:t,width:e,height:i}=n2(H,U);T.title.value=Object.assign(Object.assign({width:W()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),D=T.title.value.width,F=T.title.value.height,z=F+(P?T.title.spaceRow:0)}return E+=z,T.title.width=D,T.title.height=F,W()?w+=B||D:w+=Math.max(D,B),P&&T.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=w-b.left-b.right-O-R-S.spacing-A.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),T.valueWidth=Math.max(T.valueWidth,i.width))})),T.panel.width=w,T.panel.height=E,T})(t,this._component.getSpec(),e)}const{panel:n}=null!==(s=this._attributes)&&void 0!==s?s:{};return{width:n.width+n.lineWidth,height:n.height+n.lineWidth}}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{activeTooltipSpec:s}=e,n=s.position;e.changePositionOnly?p(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}o2.type=mU.canvas;const l2=()=>{t2(o2)},h2=t=>{AD.registerChartPlugin(t.type,t)},c2=/\{([^}]+)\}/,d2=/\{([^}]+)\}/g,u2=/:/;class p2 extends fN{constructor(){super(p2.type),this.type="formatterPlugin",this._timeModeFormat={utc:yi.getInstance().timeUTCFormat,local:yi.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=Mi.getInstance().format,this._numericSpecifier=Mi.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[p2.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;d(r)?this._formatter=r:(this._formatter=this._format.bind(this),d(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),AD.registerFormatter(this._formatter)}_format(t,e,i){return _(t)?t.map(((t,s)=>{const n=_(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):_(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;if(this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=c2.test(i),this._isNumericFormatterCache.set(i,s))),s){const t=i.replace(d2,((t,i)=>{if(!u2.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)}));return t}return this._formatSingleText(t,i)}_formatSingleText(t,e){if(Ai.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}p2.pluginType="chart",p2.specKey="formatter",p2.type="formatterPlugin";const g2=()=>{h2(p2)},f2={state:t.STATE_VALUE_ENUM.STATE_ACTIVE,trigger:"pointerover",triggerOff:"pointerout"};class m2 extends Rj{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({},f2,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){const{state:e,interaction:i}=this.options;this.isGraphicInStateMark(t,e)&&(t.addState(e,!0),i.setStatedGraphics(this,[t]))}}reset(t){const{interaction:e,state:i}=this.options,s=e.getStatedGraphics(this),n=null!=t?t:null==s?void 0:s[0];n&&s.includes(n)&&(n.removeState(i),e.setStatedGraphics(this,s.filter((t=>t!==n))))}}m2.type="element-active",m2.defaultOptions=f2;const v2=()=>{AD.registerInteractionTrigger(m2.type,m2)},y2="element-active-by-legend",_2={state:t.STATE_VALUE_ENUM.STATE_ACTIVE,filterType:"groupKey"};class b2 extends Rj{constructor(t){super(t),this.type=y2,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},_2,t),this.updateMarkIdByState([this.options.state])}getEvents(){return[{type:t.ChartEvent.legendItemHover,handler:this.handleStart},{type:t.ChartEvent.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){if(u(t))return;const{interaction:e,state:i}=this.options,s=Bj(this.options),n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{s(e)===t&&r.push(e)}))})),e.updateStates(this,r,n,i),e.setStatedGraphics(this,r)}resetAll(){const{interaction:t,state:e}=this.options;t.clearAllStatesOfTrigger(this,e),t.setStatedGraphics(this,[])}reset(t){const{state:e,interaction:i}=this.options;if(t){const s=i.getStatedGraphics(this);s&&s.includes(t)&&(t.removeState(e),i.setStatedGraphics(this,s.filter((e=>e!==t))))}else this.resetAll()}}b2.type=y2,b2.defaultOptions=_2;const x2=()=>{AD.registerInteractionTrigger(y2,b2)},S2="element-highlight-by-group";class A2 extends Rj{constructor(t){super(t),this.type=S2,this.handleStart=t=>{this.start(t.item)},this.handleReset=t=>{const e=t.item;e&&this.isGraphicInMark(e)&&this.resetAll()},this.options=Object.assign({},Pj,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(){const{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?void 0:e.groupKey}start(t){if(t&&this.isGraphicInMark(t)){const e=this._getHightlightKey(t);if(u(e))return;const{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{this._getHightlightKey(t)===e&&a.push(t)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}reset(t){if(t){if(this.isGraphicInMark(t)){const{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()}}A2.type=S2,A2.defaultOptions=Pj;const k2=()=>{AD.registerInteractionTrigger(S2,A2)},T2="element-highlight-by-key";class M2 extends A2{constructor(){super(...arguments),this.type=T2}_getHightlightKey(t){var e;return null===(e=t.context)||void 0===e?void 0:e.key}}M2.type=T2;const C2=()=>{AD.registerInteractionTrigger(T2,M2)},w2="element-highlight-by-legend",E2={highlightState:t.STATE_VALUE_ENUM.STATE_HIGHLIGHT,blurState:t.STATE_VALUE_ENUM.STATE_BLUR,filterType:"groupKey"};class B2 extends Rj{constructor(t){super(t),this.type=w2,this.handleStart=t=>{var e,i;const s=t.event;s&&this.start(null===(i=null===(e=s.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.resetAll()},this.options=Object.assign({},E2,t),this.updateMarkIdByState([this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getResetState(){return this.options.blurState}getEvents(){return[{type:t.ChartEvent.legendItemHover,handler:this.handleStart},{type:t.ChartEvent.legendItemUnHover,handler:this.handleReset}]}start(t){if(t){const e=Bj(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}B2.type=w2,B2.defaultOptions=E2;const P2=()=>{AD.registerInteractionTrigger(w2,B2)},R2="element-highlight-by-name",L2={highlightState:t.STATE_VALUE_ENUM.STATE_HIGHLIGHT,blurState:t.STATE_VALUE_ENUM.STATE_BLUR,filterType:"groupKey"};class I2 extends Rj{constructor(t){super(t),this.type=R2,this.handleStart=t=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const 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({},L2,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;const i=Y(this.options.graphicName);return(null===(e=null==t?void 0:t.node)||void 0===e?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){const e=Bj(this.options),{interaction:i,highlightState:s,blurState:n}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((i=>{var s;null===(s=i.getGraphics())||void 0===s||s.forEach((i=>{e(i)===t&&a.push(i)}))})),i.updateStates(this,a,r,s,n),i.setStatedGraphics(this,a)}}resetAll(){const{interaction:t,highlightState:e,blurState:i}=this.options;t.clearAllStatesOfTrigger(this,e,i),t.setStatedGraphics(this,[])}reset(t){const{highlightState:e,blurState:i,interaction:s}=this.options;if(t){const n=s.getStatedGraphics(this);n&&n.includes(t)&&(t.removeState([e,i]),s.setStatedGraphics(this,n.filter((e=>e!==t))))}else this.resetAll()}}I2.type=R2,I2.defaultOptions=L2;const O2=()=>{AD.registerInteractionTrigger(R2,I2)};class D2 extends nj{constructor(){super(...arguments),this.type=D2.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}D2.type="image";const F2=()=>{AD.registerMark(D2.type,D2),zM(),MM(),AD.registerGraphicComponent("image",Vg)},z2=()=>{oj(),nN(),aN(),WW(),RG(),BU(),XU(),xW(),oY(),LK(),F2(),uZ(),GN()};Hj.useRegisters([CU,jU,iW,fW,KZ,QZ,iJ,pJ,VZ,_J,AJ,kJ,CJ,GJ,$J,mJ,BJ,LJ,tQ,DJ,jJ,VJ,ZJ,sQ,lJ,aQ,rJ,uV,mV,yV,bV,SV,BY,wY,uQ,kQ,OQ,VQ,WQ,QQ,i0,o0,PW,W0,J0,x1,Y0,t1,A1,T1,$0,l1,g1,v1,E1,P1,O1,I1,z2,i2,l2,g2,v2,x2,P2,O2,k2,C2,Cj,N_,j_]);class j2 extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["valueField","maskShape","reverse","outlineMargin","outlinePadding","indicatorSmartInvert","liquidBackground","liquidOutline"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class H2 extends NV{constructor(){super(...arguments),this.transformerConstructor=j2,this.type="liquid",this.seriesType=t.SeriesTypeEnum.liquid}}H2.type="liquid",H2.seriesType=t.SeriesTypeEnum.liquid,H2.transformerConstructor=j2;class N2 extends UV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["categoryField","valueField","circle","overlap","overlapLabel"])}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class V2 extends NV{constructor(){super(...arguments),this.transformerConstructor=N2,this.type="venn",this.seriesType=t.SeriesTypeEnum.venn}}V2.type="venn",V2.seriesType=t.SeriesTypeEnum.venn,V2.transformerConstructor=N2;class U2 extends WV{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["barWidth","barMaxWidth","barMinWidth","barGapInGroup","barBackground","barMinHeight","stackCornerRadius","bar","bandWidthField"])}transformSpec(t){super.transformSpec(t),bz(t)}_setDefaultXAxisSpec(t){return{orient:"bottom",type:"linear",label:{visible:!1}}}_setDefaultYAxisSpec(t){return{orient:"left",type:"linear"}}}class W2 extends NV{constructor(){super(...arguments),this.transformerConstructor=U2,this.type="mosaic",this.seriesType=t.SeriesTypeEnum.mosaic,this.handleAfterStackRegion=(t,e)=>{t.getSeries().forEach((t=>{const i=t.getStackData(),s=t.getStackValue(),n=t.getStackValueField();i&&n&&(kF(e[s],n),TF(t,e[s]))}))}}_beforeInit(){this._dataSet&&qF(this._dataSet,"stackSplit",YV)}_initStack(){this._stack=new XV(this,{afterStackRegion:this.handleAfterStackRegion}),this._stack.init()}_setModelOption(){this._modelOption.getDimensionInfo=nU,this._modelOption.getDimensionInfoByValue=aU,this._modelOption.getRectByDimensionData=uU}}W2.type="mosaic",W2.seriesType=t.SeriesTypeEnum.mosaic,W2.transformerConstructor=U2;const G2=(e="chart",i,s)=>{var n,a,o,l,h,c,d,u,p,g,f;const m={modelInfo:[]};if("chart"===e)m.isChart=!0,m.modelInfo.push({spec:i,type:"chart"});else if("region"===e)m.modelType="region",m.specKey="region",null===(n=i.region)||void 0===n||n.forEach(((t,e)=>{m.modelInfo.push({spec:t,specPath:["region",e],type:"region"})}));else if("series"===e)m.modelType="series",m.specKey="series",null===(a=i.series)||void 0===a||a.forEach(((t,e)=>{m.modelInfo.push({spec:t,specPath:["series",e],type:t.type})}));else if(Object.values(t.SeriesTypeEnum).includes(e))m.modelType="series",m.specKey="series",m.type=e,null===(o=i.series)||void 0===o||o.forEach(((t,i)=>{t.type===e&&m.modelInfo.push({spec:t,specPath:["series",i],type:e})}));else if(Object.values(r).includes(e)){m.modelType="component",m.type=e,m.specKey=null===(l=AD.getComponentInKey(e))||void 0===l?void 0:l.specKey;const{specKey:t}=m,n=Y(null!==(c=null===(h=s.component)||void 0===h?void 0:h[t])&&void 0!==c?c:[]);null===(u=Y(null!==(d=i[t])&&void 0!==d?d:[]))||void 0===u||u.forEach(((t,i)=>{const s=n[i];s&&s.type===e?m.modelInfo.push(Object.assign(Object.assign({},s),{spec:t})):t&&!1===t.visible&&m.modelInfo.push({type:e,spec:t})}))}else{const t=AD.getComponents().filter((({cmp:t})=>t.specKey===e)).map((({cmp:t})=>t.type));if(t.length>0){m.modelType="component";const n=e;m.specKey=n;const r=Y(null!==(g=null===(p=s.component)||void 0===p?void 0:p[n])&&void 0!==g?g:[]);Y(null!==(f=i[n])&&void 0!==f?f:[]).forEach(((e,i)=>{const s=r[i];s&&t.includes(s.type)&&m.modelInfo.push(Object.assign(Object.assign({},s),{spec:e}))}))}}return m},Y2=(t,e,i,s)=>{const{spec:n,filter:r,filterType:a,forceAppend:o}=t,{isChart:l,modelType:h,specKey:c,type:p,modelInfo:g}=((t="chart",e,i,s,n,r)=>{const a=G2(t,n,r);return Object.assign(Object.assign({},a),{modelInfo:a.modelInfo.filter((t=>!!u(e)||Y(e).some((e=>d(e)?e(t,i,s):yD(t.spec,e)))))})})(a,r,t,e,i,s);if(0===g.length&&!o)return{chartSpec:i,hasChanged:!1};const f=SD({},i),m=d(n)?n(g,t,e):n;for(const{spec:t,specPath:e}of g){if(l)return{chartSpec:SD(f,m),hasChanged:!0};const i=SD({},t,m);_D(f,e,i)}if(0===g.length&&o){const t=Object.assign({type:p},m);_(f[c])?f[c].push(t):u(f[c])?f[c]="component"===h?t:[t]:f[c]=[f[c],t]}return{chartSpec:f,hasChanged:!0}};class X2 extends fN{constructor(){super(X2.type),this.type="MediaQueryPlugin",this._currentMediaInfo={},this.currentActiveItems=new Set,this._initialized=!1}onInit(t,e){if(!(null==e?void 0:e[X2.specKey]))return;const{globalInstance:i}=t;this._option={globalInstance:t.globalInstance,updateSpec:(t,e,s)=>{s?i.updateSpecSync(t):e?i.updateSpecAndRecompile(t,!1,{transformSpec:!0}):i.setRuntimeSpec(t)}},this._spec=e[X2.specKey],this._initialized=!0}onBeforeResize(t,e,i){this._initialized&&this._changeSize(e,i,!0,!1)}onAfterChartSpecTransform(t,e,i){this._initialized&&"setCurrentTheme"===i&&this._reInit(!1,!1)}onAfterModelSpecTransform(t,e,i,s){this._initialized&&"updateSpec"===s&&this.onBeforeInitChart(t,e,"setCurrentTheme")}onBeforeInitChart(t,e,i){if(!this._initialized)return;let s,n;switch(i){case"render":case"updateModelSpec":s=!1,n=!0;break;case"setCurrentTheme":s=!0,n=!1;break;case"updateSpecAndRecompile":s=!1,n=!1}if(s&&this.release(),this._initialized||this.onInit(t,e),s||n){const{width:t,height:e}=this._option.globalInstance.getCurrentSize();this._changeSize(t,e,!1,!1)}}_changeSize(t,e,i,s){return(this._currentMediaInfo.width!==t||this._currentMediaInfo.height!==e)&&(this._currentMediaInfo.width=t,this._currentMediaInfo.height=e,this._applyQueries(i,s))}_applyQueries(t,e){const i=[],s=[];if(this._spec.forEach((t=>{const{hasChanged:e,isActive:n}=this._check(t);e&&(n?i.push(t):s.push(t))})),!i.length&&!s.length)return!1;let n,r;this._baseChartSpec||(this._baseChartSpec=xD(this._option.globalInstance.getSpec(),["data",X2.specKey]),this._baseChartSpecInfo=this._option.globalInstance.getSpecInfo());let a=!1;return s.length>0?(n=xD(this._baseChartSpec,["data",X2.specKey]),r=this._baseChartSpecInfo,Array.from(this.currentActiveItems).forEach((t=>{if(s.includes(t))return void this.currentActiveItems.delete(t);const e=this._apply(t,n,r);n=e.chartSpec})),a=!0):(n=this._option.globalInstance.getSpec(),r=this._option.globalInstance.getSpecInfo()),i.forEach((t=>{this.currentActiveItems.add(t);const e=this._apply(t,n,r);n=e.chartSpec,a||(a=e.hasChanged)})),a&&this._option.updateSpec(n,t,e),!0}_check(t){const{globalInstance:e}=this._option,i=((t,e,i)=>{for(const s in t)switch(s){case"maxHeight":if(p(t.maxHeight)&&e.height>t.maxHeight)return!1;break;case"minHeight":if(p(t.minHeight)&&e.height<t.minHeight)return!1;break;case"maxWidth":if(p(t.maxWidth)&&e.width>t.maxWidth)return!1;break;case"minWidth":if(p(t.minWidth)&&e.width<t.minWidth)return!1;break;case"onResize":if(p(t.onResize)&&!t.onResize(e,i))return!1}return!0})(t.query,this._currentMediaInfo,e);return{isActive:i,hasChanged:i!==this.currentActiveItems.has(t)}}_apply(t,e,i){const{query:s,action:n}=t;let r=!1;return Y(n).forEach((t=>{const n=Y2(t,s,e,i);e=n.chartSpec,r||(r=n.hasChanged)})),{chartSpec:e,hasChanged:r}}_reInit(t,e){let i=this._option.globalInstance.getSpec();this._baseChartSpec=xD(i,["data",X2.specKey]),this._baseChartSpecInfo=this._option.globalInstance.getSpecInfo();let s=!1;this.currentActiveItems.forEach((t=>{const e=this._apply(t,i,this._baseChartSpecInfo);i=e.chartSpec,s||(s=e.hasChanged)})),s&&this._option.updateSpec(i,t,e)}release(){super.release(),this._initialized=!1,this._spec=[],this._option=void 0,this._currentMediaInfo={},this.currentActiveItems.clear()}}X2.pluginType="chart",X2.specKey="media",X2.type="MediaQueryPlugin";class $2{constructor(t,e,i,s,n){this.state=t,this.graphics=e,this.config=i||[],this.beforeExecute=s,this.afterExecute=n}execute(t,e){if(!this.graphics.length||!this.config.length)return void(null==e||e());this.beforeExecute&&this.beforeExecute(this.graphics);let i=0;const s=this.graphics.length,n=()=>{i++,i>=s&&(this.afterExecute&&this.afterExecute(this.graphics),null==e||e())};this.graphics.forEach((t=>{if(!t)return void i++;"exit"===this.state&&(t.isExiting=!0);const e=this.config.length>1?this.config.map((e=>({name:this.state,animation:Object.assign(Object.assign({},e),{customParameters:t.context})}))):{name:this.state,animation:Object.assign(Object.assign({},this.config[0]),{customParameters:t.context})};t.applyAnimationState([this.state],[e],n)}))}executeOnGroup(t,e){if(!this.graphics.length||!this.config.length||!t)return void(null==e||e());this.beforeExecute&&this.beforeExecute(this.graphics);const i=this.config[0],s=[{name:this.state,animation:Object.assign({},i)}];s.forEach((t=>{t.animation.customParameters=(t,e)=>e.context})),t.applyAnimationState([this.state],s,(()=>{this.afterExecute&&this.afterExecute(this.graphics),null==e||e()}))}}class K2{constructor(){this.name="verticalBarSplit"}shouldApply(t,e){var i,s;const n="rect"===t.type,r="vertical"===(null===(i=t.model)||void 0===i?void 0:i.direction),a=(null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||{};return n&&r&&("x"in a||"width"in a||"x1"in a)&&("y"in a||"height"in a||"y1"in a)}split(t,e){var i;const s=(null===(i=e.context)||void 0===i?void 0:i.diffAttrs)||{},n={},r={};Object.entries(s).forEach((([t,e])=>{"x"===t||"width"===t||"x1"===t?n[t]=e:"y"===t||"height"===t||"y1"===t?r[t]=e:n[t]=e}));const a=e.context,o=a.fieldX,l=a.originalFieldX,h=Array.isArray(o)&&o.length>1,c=(l?!(Array.isArray(l)&&l.length>1):!h)&&h;return[{attrs:n,order:c?1:2},{attrs:r,order:c?2:1}]}}class q2{constructor(){this.name="horizontalBarSplit"}shouldApply(t,e){var i,s;const n="rect"===t.type,r="horizontal"===(null===(i=t.model)||void 0===i?void 0:i.direction),a=(null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||{};return n&&r&&("y"in a||"height"in a||"y1"in a)&&("x"in a||"width"in a||"x1"in a)}split(t,e){var i;const s=(null===(i=e.context)||void 0===i?void 0:i.diffAttrs)||{},n={},r={};Object.entries(s).forEach((([t,e])=>{"y"===t||"height"===t||"y1"===t?n[t]=e:"x"===t||"width"===t||"x1"===t?r[t]=e:n[t]=e}));const a=e.context,o=a.fieldY,l=a.originalFieldY,h=Array.isArray(o)&&o.length>1,c=!(l?!(Array.isArray(l)&&l.length>1):!h)&&!h;return[{attrs:n,order:c?2:1},{attrs:r,order:c?1:2}]}}class Z2{constructor(t){this.splitStrategies=[],this.mark=t,"rect"===t.type&&(this.registerStrategy(new K2),this.registerStrategy(new q2))}registerStrategy(t){this.splitStrategies.push(t)}detect(t,e){const i=[],s=[],n=[],r=[],a=this.mark.model.fieldX,o=this.mark.model.fieldY;return t.forEach((t=>{const e=t.context;e.fieldX&&(e.originalFieldX=e.fieldX),e.fieldY&&(e.originalFieldY=e.fieldY),e.fieldX=a,e.fieldY=o;switch(t.context.animationState){case"update":s.push(t);break;case"enter":n.push(t);break;case"appear":r.push(t);break;default:t.context.diffState===Wz.exit?i.push(t):t.context.diffState===Wz.enter?n.push(t):s.push(t)}})),e.size>t.length&&e.forEach(((t,e)=>{t.context.diffState!==Wz.exit||t.isExiting||i.push(t)})),{hasExit:i.length>0,hasUpdate:s.length>0,hasEnter:n.length>0,hasAppear:r.length>0,exitGraphics:i,updateGraphics:s,enterGraphics:n,appearGraphics:r}}createPlanners(t,e){const i=[];if(t.hasExit&&e.exit&&i.push(new $2("exit",t.exitGraphics,e.exit)),t.hasUpdate&&e.update){const s=new Map,n=[];t.updateGraphics.forEach((t=>{let e=!1;for(const i of this.splitStrategies)if(i.shouldApply(this.mark,t)){const n=i.split(this.mark,t),r={graphic:t,steps:n};n.forEach((t=>{const{order:e}=t;s.has(e)||s.set(e,[]),s.get(e).push(r)})),e=!0;break}e||n.push(t)})),n.length>0&&i.push(new $2("update",n,e.update));const r=Array.from(s.keys()).sort(((t,e)=>t-e));r.forEach((t=>{const n=s.get(t);if(n&&n.length>0){const s=n.map((({graphic:e,steps:i})=>{const s=i.find((e=>e.order===t));return{graphic:e,attrs:(null==s?void 0:s.attrs)||{}}}));i.push(new $2("update",s.map((t=>t.graphic)),e.update,(t=>{t.forEach(((t,e)=>{const i=s[e].attrs,n=t.context;n._originalDiffAttrs||(n._originalDiffAttrs=t.context.diffAttrs),t.context.diffAttrs=i}))}),(e=>{t===r[r.length-1]&&e.forEach((t=>{const e=t.context;e._originalDiffAttrs&&(t.context.diffAttrs=e._originalDiffAttrs,delete e._originalDiffAttrs)}))})))}}))}return t.hasEnter&&e.enter&&i.push(new $2("enter",t.enterGraphics,e.enter)),t.hasAppear&&e.appear&&i.push(new $2("appear",t.appearGraphics,e.appear)),i}}class J2{registerAnimationSplitStrategy(t){this._grammarDetector||(this._grammarDetector=new Z2(this)),this._grammarDetector.registerStrategy(t)}getGrammarDetector(){return this.initGrammarDetector(),this._grammarDetector}initGrammarDetector(){this._grammarDetector||(this._grammarDetector=new Z2(this))}_runSequentialAnimations(t){this.initGrammarDetector();const e=this.getAnimationConfig(),i=this._grammarDetector.detect(t,this._graphicMap),s=this._grammarDetector.createPlanners(i,e);this._executePlanners(s,0)}_executePlanners(t,e){if(e>=t.length)return;const i=t[e];i.execute(this._product,(()=>{this._executePlanners(t,e+1),"exit"===i.state&&i.graphics.forEach((t=>{t.isExiting&&(this._graphicMap.delete(t.context.uniqueKey),t.parent&&t.parent.removeChild(t),t.release&&t.release())}))}))}}t.ArcMark=aY,t.AreaChart=zU,t.AreaMark=EU,t.AreaSeries=OU,t.AxisSyncPlugin=mN,t.BandAxisMixin=pV,t.BarChart=eW,t.BarChartSpecTransformer=tW,t.BarSeries=JU,t.BarSeriesSpecTransformer=ZU,t.BaseArcMark=rY,t.BaseChart=NV,t.BaseChartSpecTransformer=UV,t.BaseComponent=NN,t.BaseComponentSpecTransformer=HN,t.BaseHistogramChart=cJ,t.BaseMark=nj,t.BasePieChart=XZ,t.BasePieChartSpecTransformer=YZ,t.BasePieSeries=dY,t.BasePlugin=fN,t.BasePolygonMark=PK,t.BaseSeries=BH,t.BaseSeriesSpecTransformer=EH,t.BaseSeriesTooltipHelper=eH,t.BaseWordCloudChart=xJ,t.BaseWordCloudChartSpecTransformer=bJ,t.BaseWordCloudSeries=kX,t.BoxPlotChart=XJ,t.BoxPlotSeries=EG,t.Brush=w1,t.CanvasTooltipHandler=o2,t.CartesianAxis=ZN,t.CartesianBandAxis=fV,t.CartesianChartSpecTransformer=WV,t.CartesianCrossHair=NQ,t.CartesianLinearAxis=dV,t.CartesianLogAxis=_V,t.CartesianMarkArea=Z0,t.CartesianMarkLine=U0,t.CartesianMarkPoint=b1,t.CartesianSeries=IH,t.CartesianSymlogAxis=xV,t.CartesianTimeAxis=vV,t.CirclePackingChart=zJ,t.CirclePackingSeries=aq,t.CircularProgressChart=fJ,t.CircularProgressSeries=aX,t.CommonChart=nJ,t.CommonChartSpecTransformer=sJ,t.CompilableData=Qz,t.ComponentMark=WN,t.ContinuousLegend=AQ,t.CorrelationChart=rQ,t.CorrelationSeries=fZ,t.CustomMark=B1,t.DEFAULT_ANIMATION_CONFIG=mj,t.DEFAULT_CHART_HEIGHT=$D,t.DEFAULT_CHART_WIDTH=XD,t.DEFAULT_CLOSE_STROKE_JOIN=Uj,t.DEFAULT_DATA_INDEX=qD,t.DEFAULT_DATA_KEY=ZD,t.DEFAULT_DATA_SERIES_FIELD=JD,t.DEFAULT_KEY=vF,t.DEFAULT_LAYOUT_RECT_LEVEL=0,t.DEFAULT_LAYOUT_RECT_LEVEL_MIN=-1,t.DEFAULT_LINEAR_INTERPOLATE=Vj,t.DEFAULT_MEASURE_CANVAS_ID=KD,t.DEFAULT_SERIES_STYLE_NAME=QD,t.DEFAULT_SMOOTH_INTERPOLATE=Nj,t.DataZoom=JQ,t.DimensionClickEvent=UH,t.DimensionHoverEvent=KH,t.DiscreteLegend=dQ,t.DomTooltipHandler=e2,t.DotSeries=YY,t.ElementHighlight=Ij,t.ElementSelect=Fj,t.Event=HF,t.Factory=AD,t.FormatterPlugin=p2,t.FunnelChart=MJ,t.FunnelChartSpecTransformer=TJ,t.FunnelSeries=DK,t.FunnelSeriesSpecTransformer=OK,t.GaugeChart=yJ,t.GaugePointerSeries=Gq,t.GaugeSeries=$q,t.GeoCoordinate=BW,t.GeoMarkPoint=k1,t.GeoSeries=mW,t.GlyphMark=gG,t.GridLayout=R1,t.GroupMark=aj,t.HeatmapChart=iQ,t.HeatmapSeries=eZ,t.HistogramChart=uJ,t.HistogramChartSpecTransformer=dJ,t.ImageMark=D2,t.Indicator=a0,t.Label=p1,t.Layout=Uz,t.LineChart=MU,t.LineMark=sN,t.LineSeries=DV,t.LinearAxisMixin=aV,t.LinearProgressChart=EJ,t.LinearProgressSeries=gX,t.LinkSeries=ZY,t.LiquidChart=H2,t.LiquidSeries=MZ,t.MOSAIC_CAT_END_PERCENT=gF,t.MOSAIC_CAT_START_PERCENT=pF,t.MOSAIC_VALUE_END_PERCENT=uF,t.MOSAIC_VALUE_START_PERCENT=dF,t.ManualTicker=class extends qw{constructor(t){super(t),this.lastFrameTime=0,this.status=Bo.RUNNING}setupTickHandler(){const t=new Zw;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}checkSkip(t){return!1}getTime(){return this.tickerHandler.getTime()}tickAt(t){this.tickTo(t)}start(t=!1){if(this.status===Bo.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Bo.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=Bo.RUNNING,!0}},t.MapChart=NZ,t.MapSeries=LW,t.MediaQuery=X2,t.MosaicChart=W2,t.MosaicSeries=zZ,t.PREFIX=YD,t.PathMark=bW,t.PieChart=$Z,t.PieSeries=uY,t.PieSeriesSpecTransformer=hY,t.Player=o1,t.PolarAxis=kY,t.PolarBandAxis=EY,t.PolarCrossHair=UQ,t.PolarLinearAxis=CY,t.PolarMarkArea=Q0,t.PolarMarkLine=G0,t.PolarMarkPoint=S1,t.PolarSeries=$G,t.PolygonMark=RK,t.ProgressLikeSeries=tX,t.RadarChart=eJ,t.RadarSeries=HY,t.RangeAreaChart=QJ,t.RangeAreaSeries=YG,t.RangeColumnChart=RJ,t.RangeColumnSeries=HG,t.RangeColumnSeriesSpecTransformer=jG,t.RectMark=YU,t.RippleMark=dZ,t.RoseChart=JZ,t.RoseLikeSeries=xY,t.RoseSeries=PY,t.RuleMark=UW,t.SEGMENT_FIELD_END=mF,t.SEGMENT_FIELD_START=fF,t.STACK_FIELD_END=iF,t.STACK_FIELD_END_OffsetSilhouette=aF,t.STACK_FIELD_END_PERCENT=nF,t.STACK_FIELD_KEY=tF,t.STACK_FIELD_START=eF,t.STACK_FIELD_START_OffsetSilhouette=rF,t.STACK_FIELD_START_PERCENT=sF,t.STACK_FIELD_TOTAL=oF,t.STACK_FIELD_TOTAL_BOTTOM=cF,t.STACK_FIELD_TOTAL_PERCENT=lF,t.STACK_FIELD_TOTAL_TOP=hF,t.SankeyChart=qJ,t.SankeySeries=Tq,t.ScatterChart=gW,t.ScatterSeries=dW,t.ScrollBar=e0,t.SequenceChart=oJ,t.StreamLight=XB,t.SunburstChart=OJ,t.SunburstSeries=tq,t.SymbolMark=rN,t.TextMark=PG,t.ThemeManager=jD,t.Title=X0,t.Tooltip=IQ,t.TotalLabel=f1,t.TreemapChart=NJ,t.TreemapSeries=Oq,t.USER_LAYOUT_RECT_LEVEL=9,t.VChart=Hj,t.VennChart=V2,t.VennSeries=DZ,t.WaterfallChart=WJ,t.WaterfallSeries=lG,t.WordCloudChart=SJ,t.WordCloudSeries=mK,t.alternatingWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=e/s,c=i/n,d=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)*Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.animationConfig=xH,t.barGrowIn=NU,t.barGrowOut=VU,t.barPresetAnimation=GU,t.baseSeriesMark=pH,t.boundsInRect=lD,t.builtinThemes=wD,t.calcLayoutNumber=aD,t.calcPadding=oD,t.centerToCorner=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=1-Math.min(d,1),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.columnCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=n/2,c=Math.abs(i-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.columnEdgeToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=n/2,c=1-Math.abs(i-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.columnLeftToRight=function(t,e,i,s,n,r,a,o=0,l=1){const h=i/n,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.columnRightToLeft=function(t,e,i,s,n,r,a,o=0,l=1){const h=(n-1-i)/n,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.computeActualDataScheme=UO,t.convertPoint=cD,t.cornerToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=Math.min(d,1),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.createArc=rf,t.createArea=ef,t.createGroup=Pp,t.createLine=Bg,t.createRect=Ig,t.createRichText=Kg,t.createScale=JO,t.createScaleWithSpec=QO,t.createSymbol=Cg,t.createText=kg,t.darkTheme=vD,t.dataScheme=uD,t.default=Hj,t.defaultThemeName=ED,t.diagonalCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/s,2)+Math.pow((i-c)/n,2)),u=o+l*(Math.sin(2*r*Math.PI-2*d*Math.PI)+1)/2;return Math.min(1,Math.max(0,u))},t.diagonalTopLeftToBottomRight=function(t,e,i,s,n,r,a,o=0,l=1){const h=(e/s+i/n)/2,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.findMarkGraphic=zF,t.functionTransform=WD,t.getActualColor=GO,t.getActualNumValue=dD,t.getCartesianCrosshairRect=uU,t.getCartesianDimensionInfo=nU,t.getColorSchemeBySeries=KO,t.getCombinedSizeOfRegions=KN,t.getDataScheme=VO,t.getDatumOfGraphic=FF,t.getDiffAttributesOfGraphic=jF,t.getDimensionInfoByValue=aU,t.getFieldAlias=bF,t.getFunnelTheme=MD,t.getGroupAnimationParams=LH,t.getMergedTheme=FD,t.getPolarDimensionInfo=ZZ,t.getRegionStackGroup=xF,t.getSpecInfo=Yj,t.getTheme=ID,t.hasThemeMerged=RD,t.isCollectionMark=DF,t.isColorKey=YO,t.isPercent=nD,t.isPercentOffset=rD,t.isPolarAxisSeries=PH,t.isProgressiveDataColorScheme=XO,t.isSpecValueWithScale=iD,t.isTokenKey=gD,t.isValidOrient=sD,t.isValueInScaleDomain=eD,t.isXAxis=OH,t.isYAxis=DH,t.isZAxis=FH,t.lightTheme=mD,t.lookup=Xj,t.measureText=GD,t.mergeFields=yF,t.normalizeLayoutPaddingSpec=hD,t.particleEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=e*n+i,c=2*UM(h,0)*Math.PI,d=.5*UM(h,1)+.5,u=2*UM(h,2)*Math.PI,p=s/2,g=n/2,f=Math.sqrt(Math.pow((e-p)/p,2)+Math.pow((i-g)/g,2)),m=Math.min(f,1),v=(r-.4)/.6,y=Math.sin(v*d*8*Math.PI+c+u*v),_=Math.cos(m*Math.PI+v*Math.PI),b=o+l*((y+1)/2*Math.max(0,1-1.2*v)*(.3+.7*_));return Math.min(1,Math.max(0,b))},t.pieDisappear=sY,t.pieEnter=eY,t.pieExit=iY,t.piePresetAnimation=nY,t.pulseWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow((e-h)/h,2)+Math.pow((i-c)/c,2)),u=Math.min(d,1),p=2*r*Math.PI*3,g=Math.max(0,1-u),f=o+l*((Math.sin(p-4*u*Math.PI)+1)/2)*(.7*g+.3);return Math.min(1,Math.max(0,f))},t.queryColorFromColorScheme=WO,t.queryToken=pD,t.randomOpacity=function(t,e,i,s,n,r,a,o=0,l=1){const h=2*UM(e*n+i)*Math.PI,c=o+l*(Math.sin(2*r*Math.PI+h)+1)/2;return Math.min(1,Math.max(0,c))},t.registerAllEnv=()=>{pk()},t.registerAllMarks=z2,t.registerAnimate=Cj,t.registerArcAnimation=kj,t.registerArcMark=oY,t.registerAreaChart=jU,t.registerAreaMark=BU,t.registerAreaSeries=DU,t.registerBarChart=iW,t.registerBarSeries=QU,t.registerBoxplotChart=$J,t.registerBoxplotSeries=BG,t.registerBrowserEnv=cj,t.registerBrush=E1,t.registerCanvasTooltipHandler=l2,t.registerCartesianBandAxis=mV,t.registerCartesianCrossHair=VQ,t.registerCartesianLinearAxis=uV,t.registerCartesianLogAxis=bV,t.registerCartesianSymlogAxis=SV,t.registerCartesianTimeAxis=yV,t.registerChartPlugin=h2,t.registerCirclePackingChart=jJ,t.registerCirclePackingSeries=oq,t.registerCircularProgressChart=mJ,t.registerCircularProgressSeries=oX,t.registerCommonChart=rJ,t.registerComponentMark=GN,t.registerContinuousLegend=kQ,t.registerCorrelationChart=aQ,t.registerCustomAnimate=()=>{Qw.registerBuiltInAnimate("increaseCount",fE),Qw.registerBuiltInAnimate("fromTo",YB),Qw.registerBuiltInAnimate("scaleIn",SB),Qw.registerBuiltInAnimate("scaleOut",AB),Qw.registerBuiltInAnimate("growHeightIn",KE),Qw.registerBuiltInAnimate("growHeightOut",qE),Qw.registerBuiltInAnimate("growWidthIn",uB),Qw.registerBuiltInAnimate("growWidthOut",pB),Qw.registerBuiltInAnimate("growCenterIn",YE),Qw.registerBuiltInAnimate("growCenterOut",XE),Qw.registerBuiltInAnimate("clipIn",zE),Qw.registerBuiltInAnimate("clipOut",jE),Qw.registerBuiltInAnimate("fadeIn",HE),Qw.registerBuiltInAnimate("fadeOut",NE),Qw.registerBuiltInAnimate("growPointsIn",QE),Qw.registerBuiltInAnimate("growPointsOut",tB),Qw.registerBuiltInAnimate("growPointsXIn",iB),Qw.registerBuiltInAnimate("growPointsXOut",sB),Qw.registerBuiltInAnimate("growPointsYIn",rB),Qw.registerBuiltInAnimate("growPointsYOut",aB),Qw.registerBuiltInAnimate("growAngleIn",WE),Qw.registerBuiltInAnimate("growAngleOut",GE),Qw.registerBuiltInAnimate("growRadiusIn",hB),Qw.registerBuiltInAnimate("growRadiusOut",cB),Qw.registerBuiltInAnimate("moveIn",HB),Qw.registerBuiltInAnimate("moveOut",NB),Qw.registerBuiltInAnimate("rotateIn",UB),Qw.registerBuiltInAnimate("rotateOut",WB),Qw.registerBuiltInAnimate("update",zB),Qw.registerBuiltInAnimate("state",kB),Qw.registerBuiltInAnimate("labelItemAppear",gB),Qw.registerBuiltInAnimate("labelItemDisappear",fB),Qw.registerBuiltInAnimate("poptipAppear",mB),Qw.registerBuiltInAnimate("poptipDisappear",vB),Qw.registerBuiltInAnimate("inputText",PE),Qw.registerBuiltInAnimate("inputRichText",yB),Qw.registerBuiltInAnimate("outputRichText",_B),Qw.registerBuiltInAnimate("slideRichText",bB),Qw.registerBuiltInAnimate("slideOutRichText",xB),Qw.registerBuiltInAnimate("slideIn",TB),Qw.registerBuiltInAnimate("growIn",MB),Qw.registerBuiltInAnimate("spinIn",CB),Qw.registerBuiltInAnimate("moveScaleIn",BB),Qw.registerBuiltInAnimate("moveRotateIn",PB),Qw.registerBuiltInAnimate("strokeIn",wB),Qw.registerBuiltInAnimate("slideOut",RB),Qw.registerBuiltInAnimate("growOut",LB),Qw.registerBuiltInAnimate("spinOut",IB),Qw.registerBuiltInAnimate("moveScaleOut",OB),Qw.registerBuiltInAnimate("moveRotateOut",DB),Qw.registerBuiltInAnimate("strokeOut",EB),Qw.registerBuiltInAnimate("pulse",FB),Qw.registerBuiltInAnimate("MotionPath",GB),Qw.registerBuiltInAnimate("streamLight",XB),Qw.registerBuiltInAnimate("dissolve",QB),Qw.registerBuiltInAnimate("grayscale",tP),Qw.registerBuiltInAnimate("distortion",eP),Qw.registerBuiltInAnimate("particle",iP),Qw.registerBuiltInAnimate("glitch",sP),Qw.registerBuiltInAnimate("gaussianBlur",nP),Qw.registerBuiltInAnimate("pixelation",rP)},t.registerCustomMark=P1,t.registerDataSetInstanceParser=ZF,t.registerDataSetInstanceTransform=qF,t.registerDataZoom=QQ,t.registerDimensionEvents=JV,t.registerDimensionHover=ZV,t.registerDimensionTooltipProcessor=xU,t.registerDiscreteLegend=uQ,t.registerDomTooltipHandler=i2,t.registerDotSeries=XY,t.registerDragPlugin=()=>{AD.registerStageEventPlugin("drag",Pb)},t.registerElementActive=v2,t.registerElementActiveByLegend=x2,t.registerElementHighlight=Oj,t.registerElementHighlightByGroup=k2,t.registerElementHighlightByKey=C2,t.registerElementHighlightByLegend=P2,t.registerElementHighlightByName=O2,t.registerElementSelect=zj,t.registerFormatPlugin=g2,t.registerFunnelChart=CJ,t.registerFunnelSeries=FK,t.registerGaugeChart=_J,t.registerGaugePointerSeries=Yq,t.registerGaugeSeries=Kq,t.registerGeoCoordinate=PW,t.registerGeoMarkPoint=T1,t.registerGesturePlugin=wj,t.registerGlyphMark=fG,t.registerGridLayout=I1,t.registerGroupMark=oj,t.registerGroupTooltipProcessor=TU,t.registerHarmonyEnv=()=>{Xk(Lh)},t.registerHeatmapChart=sQ,t.registerHeatmapSeries=iZ,t.registerHistogramChart=pJ,t.registerHtmlAttributePlugin=j_,t.registerImageMark=F2,t.registerIndicator=o0,t.registerLabel=g1,t.registerLarkEnv=()=>{QS(Lh)},t.registerLineChart=CU,t.registerLineMark=nN,t.registerLineSeries=FV,t.registerLinearProgressChart=BJ,t.registerLinearProgressSeries=fX,t.registerLinkSeries=JY,t.registerLiquidChart=()=>{AU(),CZ(),AD.registerChart(H2.type,H2)},t.registerLiquidSeries=CZ,t.registerLynxEnv=()=>{mA(Lh)},t.registerMapChart=VZ,t.registerMapSeries=IW,t.registerMarkArea=J0,t.registerMarkFilterTransform=Rq,t.registerMarkLine=W0,t.registerMarkMapTransform=Lq,t.registerMarkPoint=x1,t.registerMarkTooltipProcessor=AU,t.registerMediaQuery=()=>{h2(X2)},t.registerMosaicChart=()=>{xU(),AU(),TU(),JV(),ZV(),jZ(),AD.registerChart(W2.type,W2)},t.registerMosaicSeries=jZ,t.registerNodeEnv=dj,t.registerPathMark=xW,t.registerPieChart=KZ,t.registerPieSeries=pY,t.registerPlayer=l1,t.registerPolarBandAxis=BY,t.registerPolarCrossHair=WQ,t.registerPolarLinearAxis=wY,t.registerPolarMarkArea=t1,t.registerPolarMarkLine=Y0,t.registerPolarMarkPoint=A1,t.registerPolygonAnimation=Mj,t.registerPolygonMark=LK,t.registerPoptip=O1,t.registerRadarChart=iJ,t.registerRadarSeries=NY,t.registerRangeAreaChart=tQ,t.registerRangeAreaSeries=XG,t.registerRangeColumnChart=LJ,t.registerRangeColumnSeries=NG,t.registerReactAttributePlugin=N_,t.registerRectAnimation=Aj,t.registerRectMark=XU,t.registerRippleMark=uZ,t.registerRoseChart=QZ,t.registerRoseSeries=RY,t.registerRuleMark=WW,t.registerSankeyChart=ZJ,t.registerSankeySeries=Mq,t.registerScaleInOutAnimation=_j,t.registerScatterChart=fW,t.registerScatterSeries=uW,t.registerScrollBar=i0,t.registerSequenceChart=lJ,t.registerSequentialAnimate=function(){G(nj,J2)},t.registerStateTransition=function(){const t=Jw.getInstance();t.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),t.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),t.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),t.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))},t.registerSunBurstSeries=eq,t.registerSunburstChart=DJ,t.registerSymbolMark=aN,t.registerTTEnv=()=>{Bk(Lh)},t.registerTaroEnv=()=>{$A(Lh)},t.registerTextMark=RG,t.registerTheme=LD,t.registerTitle=$0,t.registerTooltip=OQ,t.registerTotalLabel=v1,t.registerTreemapChart=VJ,t.registerTreemapSeries=Dq,t.registerVRenderAnimate=hE,t.registerVennChart=()=>{AU(),FZ(),AD.registerChart(V2.type,V2)},t.registerVennSeries=FZ,t.registerWXEnv=()=>{dk(Lh)},t.registerWaterfallChart=GJ,t.registerWaterfallSeries=hG,t.registerWordCloudChart=AJ,t.registerWordCloudSeries=vK,t.registerWordCloudShapeChart=kJ,t.removeTheme=OD,t.rippleEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow(e-h,2)+Math.pow(i-c,2))/Math.sqrt(Math.pow(s/2,2)+Math.pow(n/2,2)),u=o+l*(Math.sin(2*r*Math.PI*3-2*d*Math.PI)+1)/2;return Math.min(1,Math.max(0,u))},t.rotationScan=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.atan2(e-h,i-c),u=(d<0?d+2*Math.PI:d)/(2*Math.PI),p=o+l*(Math.sin(2*r*Math.PI-2*u*Math.PI)+1)/2;return Math.min(1,Math.max(0,p))},t.rowBottomToTop=function(t,e,i,s,n,r,a,o=0,l=1){const h=(s-1-e)/s,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.rowCenterToEdge=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=Math.abs(e-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.rowEdgeToCenter=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=1-Math.abs(e-h)/h,d=o+l*(Math.sin(2*r*Math.PI-2*c*Math.PI)+1)/2;return Math.min(1,Math.max(0,d))},t.rowTopToBottom=function(t,e,i,s,n,r,a,o=0,l=1){const h=e/s,c=o+l*(Math.sin(2*r*Math.PI-2*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.setDefaultCrosshairForCartesianChart=bz,t.shouldMarkDoMorph=TH,t.snakeWave=function(t,e,i,s,n,r,a,o=0,l=1){const h=(e+i)%(s+n)/(s+n),c=o+l*(Math.sin(2*r*Math.PI-4*h*Math.PI)+1)/2;return Math.min(1,Math.max(0,c))},t.sortDataInAxisHelper=RH,t.sortStackValueGroup=SF,t.specTransform=UD,t.spiralEffect=function(t,e,i,s,n,r,a,o=0,l=1){const h=s/2,c=n/2,d=Math.sqrt(Math.pow(e-h,2)+Math.pow(i-c,2)),u=Math.atan2(e-h,i-c),p=(d/Math.sqrt(Math.pow(s/2,2)+Math.pow(n/2,2))+u/(2*Math.PI))/2,g=o+l*(Math.sin(2*r*Math.PI-4*p*Math.PI)+1)/2;return Math.min(1,Math.max(0,g))},t.stack=CF,t.stackGroup=wF,t.stackMosaic=TF,t.stackMosaicTotal=kF,t.stackOffsetSilhouette=MF,t.stackTotal=AF,t.themeExist=DD,t.themes=BD,t.token=fD,t.transformColorSchemeToStandardStruct=$O,t.transformToGraphic=OF,t.userAnimationConfig=SH,t.valueInScaleRange=tD,t.version="2.0.5-alpha.5",t.vglobal=Ay,t.warn=G_,Object.defineProperty(t,"__esModule",{value:!0})}));
|